@edrlab/thorium-web 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ThPreferencesAdapter-L1H6gzmu.d.mts → ThPreferencesAdapter-B3a-f5v-.d.mts} +25 -18
- package/dist/{ThSettingsWrapper-DWEA4hYF.d.mts → ThSettingsWrapper-DtzcwzYX.d.mts} +4 -4
- package/dist/{actions-BjeRjaJU.d.mts → actions-C33UN3Ji.d.mts} +18 -4
- package/dist/{actionsReducer-B32cq2mB.d.mts → actionsReducer-Bzcj3wk3.d.mts} +1 -1
- package/dist/{chunk-NUXGQWED.mjs → chunk-2NCN2AG2.mjs} +3 -3
- package/dist/{chunk-NUXGQWED.mjs.map → chunk-2NCN2AG2.mjs.map} +1 -1
- package/dist/{chunk-IVXRCKWR.mjs → chunk-2T65MDBR.mjs} +4 -4
- package/dist/{chunk-IVXRCKWR.mjs.map → chunk-2T65MDBR.mjs.map} +1 -1
- package/dist/{chunk-KVUG6BNI.mjs → chunk-63LKYJFG.mjs} +62 -56
- package/dist/chunk-63LKYJFG.mjs.map +1 -0
- package/dist/chunk-AQSJDL63.mjs +193 -0
- package/dist/chunk-AQSJDL63.mjs.map +1 -0
- package/dist/{chunk-TSLTLQ6O.mjs → chunk-BBCSLDQT.mjs} +144 -86
- package/dist/chunk-BBCSLDQT.mjs.map +1 -0
- package/dist/{chunk-QUSGPT5M.mjs → chunk-BCXKBHU3.mjs} +34 -15
- package/dist/chunk-BCXKBHU3.mjs.map +1 -0
- package/dist/{chunk-T5ENYSDJ.mjs → chunk-DQDOOTCE.mjs} +3 -3
- package/dist/{chunk-T5ENYSDJ.mjs.map → chunk-DQDOOTCE.mjs.map} +1 -1
- package/dist/chunk-GNROODJB.mjs +9 -0
- package/dist/chunk-GNROODJB.mjs.map +1 -0
- package/dist/{chunk-SZAVAQ6S.mjs → chunk-GRYEOCGD.mjs} +8 -5
- package/dist/chunk-GRYEOCGD.mjs.map +1 -0
- package/dist/{chunk-PXXWEMNL.mjs → chunk-KJ55Q63A.mjs} +220 -106
- package/dist/chunk-KJ55Q63A.mjs.map +1 -0
- package/dist/{chunk-5LUMM7FW.mjs → chunk-KOR74F6M.mjs} +9 -41
- package/dist/chunk-KOR74F6M.mjs.map +1 -0
- package/dist/{chunk-WLVE3WNW.mjs → chunk-PAFJZH7O.mjs} +12 -7
- package/dist/chunk-PAFJZH7O.mjs.map +1 -0
- package/dist/{chunk-XRFLDNAY.mjs → chunk-PRQBFBJ7.mjs} +123 -56
- package/dist/chunk-PRQBFBJ7.mjs.map +1 -0
- package/dist/{chunk-6MONB2DN.mjs → chunk-Y5X74VW7.mjs} +52 -146
- package/dist/chunk-Y5X74VW7.mjs.map +1 -0
- package/dist/{chunk-P6ILEQ5P.mjs → chunk-ZD4LTF6G.mjs} +17 -9
- package/dist/chunk-ZD4LTF6G.mjs.map +1 -0
- package/dist/components/Audio/index.css +12 -1
- package/dist/components/Audio/index.css.map +1 -1
- package/dist/components/Audio/index.d.mts +17 -15
- package/dist/components/Audio/index.mjs +11 -11
- package/dist/components/Epub/index.css +12 -1
- package/dist/components/Epub/index.css.map +1 -1
- package/dist/components/Epub/index.d.mts +14 -13
- package/dist/components/Epub/index.mjs +12 -12
- package/dist/components/Misc/index.mjs +5 -5
- package/dist/components/Reader/index.css +12 -1
- package/dist/components/Reader/index.css.map +1 -1
- package/dist/components/Reader/index.d.mts +12 -11
- package/dist/components/Reader/index.mjs +26 -24
- package/dist/components/Reader/index.mjs.map +1 -1
- package/dist/components/WebPub/index.css +12 -1
- package/dist/components/WebPub/index.css.map +1 -1
- package/dist/components/WebPub/index.d.mts +14 -13
- package/dist/components/WebPub/index.mjs +12 -12
- package/dist/core/Components/index.d.mts +7 -6
- package/dist/core/Components/index.mjs +2 -2
- package/dist/core/Helpers/index.d.mts +1 -1
- package/dist/core/Helpers/index.mjs +1 -1
- package/dist/core/Hooks/index.d.mts +6 -5
- package/dist/core/Hooks/index.mjs +1 -1
- package/dist/i18n/index.mjs +3 -3
- package/dist/keyboardUtilities-BCP3UcLb.d.mts +30 -0
- package/dist/lib/index.d.mts +17 -9
- package/dist/lib/index.mjs +2 -2
- package/dist/locales/da/thorium-web.json +37 -2
- package/dist/locales/fi/thorium-web.json +1 -1
- package/dist/locales/fr/thorium-web.json +1 -1
- package/dist/locales/he/thorium-web.json +9 -0
- package/dist/locales/it/thorium-web.json +22 -0
- package/dist/locales/lt/thorium-web.json +26 -1
- package/dist/locales/sv/thorium-web.json +22 -0
- package/dist/next-lib/index.mjs +1 -1
- package/dist/next-lib/index.mjs.map +1 -1
- package/dist/preferences/index.d.mts +14 -23
- package/dist/preferences/index.mjs +4 -4
- package/dist/{settingsReducer-DLaT2wUB.d.mts → settingsReducer-Pp9aoiiC.d.mts} +1 -1
- package/dist/{useAudioNavigator-CWXyNWq1.d.mts → useAudioNavigator-pGwxhXLj.d.mts} +4 -1
- package/dist/{useContrast-Bo7cDw_X.d.mts → useContrast-Bl08zDTU.d.mts} +2 -7
- package/dist/{usePreferences-D8NU1yhP.d.mts → usePreferences-Cy7-JN2x.d.mts} +4 -8
- package/dist/{useReaderTransitions-BQGzKeY2.d.mts → useReaderTransitions-Zvomj9RQ.d.mts} +30 -21
- package/package.json +7 -7
- package/dist/chunk-5LUMM7FW.mjs.map +0 -1
- package/dist/chunk-6MONB2DN.mjs.map +0 -1
- package/dist/chunk-B3WDMWCT.mjs +0 -9
- package/dist/chunk-B3WDMWCT.mjs.map +0 -1
- package/dist/chunk-KVUG6BNI.mjs.map +0 -1
- package/dist/chunk-MLEYTQGK.mjs +0 -60
- package/dist/chunk-MLEYTQGK.mjs.map +0 -1
- package/dist/chunk-P6ILEQ5P.mjs.map +0 -1
- package/dist/chunk-PXXWEMNL.mjs.map +0 -1
- package/dist/chunk-QUSGPT5M.mjs.map +0 -1
- package/dist/chunk-SZAVAQ6S.mjs.map +0 -1
- package/dist/chunk-TSLTLQ6O.mjs.map +0 -1
- package/dist/chunk-WLVE3WNW.mjs.map +0 -1
- package/dist/chunk-XRFLDNAY.mjs.map +0 -1
- package/dist/keyboardUtilities-BWAyLS_D.d.mts +0 -56
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useReaderHeaderBase, thorium_web_reader_app_default, StatefulBackLink, thorium_web_reader_header_default, StatefulCollapsibleActionsBar, thorium_web_overflow_default, useIsScroll, useNavigator } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import { setHovering } from './chunk-
|
|
4
|
-
import { usePreferences } from './chunk-
|
|
1
|
+
import { useReaderHeaderBase, thorium_web_reader_app_default, StatefulBackLink, thorium_web_reader_header_default, StatefulCollapsibleActionsBar, thorium_web_overflow_default, useIsScroll, useNavigator, useEffectiveRange } from './chunk-KJ55Q63A.mjs';
|
|
2
|
+
import { makeBreakpointsMap, getBestMatchingProgressionFormat } from './chunk-VENFFPK2.mjs';
|
|
3
|
+
import { setHovering, setWebPubZoom, setFontSize } from './chunk-PAFJZH7O.mjs';
|
|
4
|
+
import { usePreferences } from './chunk-PRQBFBJ7.mjs';
|
|
5
5
|
import { ThRunningHeadFormat, ThProgressionFormat } from './chunk-2YRT7RNW.mjs';
|
|
6
6
|
import { useAppSelector, useAppDispatch } from './chunk-A575ZW4A.mjs';
|
|
7
|
-
import { getPlatform
|
|
8
|
-
import { ThInteractiveOverlay, ThHeader, ThFooter, ThRunningHead, ThPagination } from './chunk-
|
|
9
|
-
import { useI18n } from './chunk-
|
|
7
|
+
import { getPlatform } from './chunk-KOR74F6M.mjs';
|
|
8
|
+
import { ThInteractiveOverlay, ThHeader, ThFooter, ThRunningHead, ThPagination } from './chunk-ZD4LTF6G.mjs';
|
|
9
|
+
import { useI18n } from './chunk-2NCN2AG2.mjs';
|
|
10
10
|
import { useRef, useCallback, useEffect, useMemo } from 'react';
|
|
11
11
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
12
12
|
import classNames from 'classnames';
|
|
@@ -20,7 +20,7 @@ var StatefulReaderRunningHead = ({
|
|
|
20
20
|
const isImmersive = useAppSelector((state) => state.reader.isImmersive);
|
|
21
21
|
const isHovering = useAppSelector((state) => state.reader.isHovering);
|
|
22
22
|
const isFullscreen = useAppSelector((state) => state.reader.isFullscreen);
|
|
23
|
-
const breakpoint = useAppSelector((state) => state.theming.
|
|
23
|
+
const breakpoint = useAppSelector((state) => state.theming.containerBreakpoint);
|
|
24
24
|
const fallbackFormat = useMemo(() => ({
|
|
25
25
|
variants: "title" /* title */,
|
|
26
26
|
displayInImmersive: true,
|
|
@@ -162,29 +162,6 @@ var StatefulReaderProgression = ({
|
|
|
162
162
|
const isFullscreen = useAppSelector((state) => state.reader.isFullscreen);
|
|
163
163
|
const isHovering = useAppSelector((state) => state.reader.isHovering);
|
|
164
164
|
const breakpoint = useAppSelector((state) => state.theming.breakpoint);
|
|
165
|
-
useMemo(() => {
|
|
166
|
-
if (!unstableTimeline?.progression) return "";
|
|
167
|
-
const {
|
|
168
|
-
currentPositions = [],
|
|
169
|
-
totalPositions,
|
|
170
|
-
relativeProgression,
|
|
171
|
-
totalProgression,
|
|
172
|
-
currentChapter,
|
|
173
|
-
positionsLeft,
|
|
174
|
-
totalItems,
|
|
175
|
-
currentIndex
|
|
176
|
-
} = unstableTimeline.progression;
|
|
177
|
-
return JSON.stringify({
|
|
178
|
-
currentPositions,
|
|
179
|
-
totalPositions,
|
|
180
|
-
relativeProgression,
|
|
181
|
-
totalProgression,
|
|
182
|
-
currentChapter,
|
|
183
|
-
positionsLeft,
|
|
184
|
-
totalItems,
|
|
185
|
-
currentIndex
|
|
186
|
-
});
|
|
187
|
-
}, [unstableTimeline?.progression]);
|
|
188
165
|
const fallbackFormat = useMemo(() => {
|
|
189
166
|
return {
|
|
190
167
|
variants: fallbackVariant,
|
|
@@ -320,7 +297,6 @@ var StatefulReaderPagination = ({
|
|
|
320
297
|
links,
|
|
321
298
|
compounds,
|
|
322
299
|
children,
|
|
323
|
-
dir,
|
|
324
300
|
...props
|
|
325
301
|
}) => {
|
|
326
302
|
const leftButtonRef = useRef(null);
|
|
@@ -366,14 +342,13 @@ var StatefulReaderFooter = ({
|
|
|
366
342
|
const { t } = useI18n();
|
|
367
343
|
const { direction } = useLocale();
|
|
368
344
|
const footerRef = useRef(null);
|
|
369
|
-
useAppSelector((state) => state.reader.profile);
|
|
370
345
|
const isImmersive = useAppSelector((state) => state.reader.isImmersive);
|
|
371
346
|
const isHovering = useAppSelector((state) => state.reader.isHovering);
|
|
372
347
|
const hasScrollAffordance = useAppSelector((state) => state.reader.hasScrollAffordance);
|
|
373
348
|
const isRTL = useAppSelector((state) => state.publication.isRTL);
|
|
374
349
|
const isFXL = useAppSelector((state) => state.publication.isFXL);
|
|
375
350
|
const isScroll = useIsScroll();
|
|
376
|
-
const breakpoint = useAppSelector((state) => state.theming.
|
|
351
|
+
const breakpoint = useAppSelector((state) => state.theming.containerBreakpoint);
|
|
377
352
|
const reducedMotion = useAppSelector((state) => state.theming.prefersReducedMotion);
|
|
378
353
|
const timeline = useAppSelector((state) => state.publication.unstableTimeline);
|
|
379
354
|
const dispatch = useAppDispatch();
|
|
@@ -722,120 +697,49 @@ var useFonts = (fontResources) => {
|
|
|
722
697
|
getAndroidFXLPatch
|
|
723
698
|
};
|
|
724
699
|
};
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
const shortcutsObj = {};
|
|
749
|
-
const displayOrder = this.store.getState().publication.isFXL ? this.actionsPref.fxlOrder : this.actionsPref.reflowOrder;
|
|
750
|
-
for (const actionKey of displayOrder) {
|
|
751
|
-
const shortcutString = this.actionsPref.keys[actionKey].shortcut;
|
|
752
|
-
if (shortcutString) {
|
|
753
|
-
const shortcutObj = buildShortcut(shortcutString);
|
|
754
|
-
if (shortcutObj?.key) {
|
|
755
|
-
Object.defineProperty(shortcutsObj, shortcutObj.key, {
|
|
756
|
-
value: {
|
|
757
|
-
actionKey,
|
|
758
|
-
modifiers: shortcutObj.modifiers
|
|
759
|
-
},
|
|
760
|
-
writable: false,
|
|
761
|
-
enumerable: true
|
|
762
|
-
});
|
|
763
|
-
}
|
|
764
|
-
}
|
|
700
|
+
var useZoomCallbacks = (navigator) => {
|
|
701
|
+
const { preferences } = usePreferences();
|
|
702
|
+
const readerProfile = useAppSelector((state) => state.reader.profile);
|
|
703
|
+
const isFXL = useAppSelector((state) => state.publication.isFXL);
|
|
704
|
+
const dispatch = useAppDispatch();
|
|
705
|
+
const isWebPub = readerProfile === "webPub";
|
|
706
|
+
const getSetting = navigator.getSetting;
|
|
707
|
+
const submitPreferences = navigator.submitPreferences;
|
|
708
|
+
const { preferencesEditor } = navigator;
|
|
709
|
+
const supportedRange = isWebPub ? preferencesEditor?.zoom?.supportedRange : isFXL ? preferencesEditor?.zoom?.supportedRange : preferencesEditor?.fontSize?.supportedRange;
|
|
710
|
+
const zoomConfig = preferences.settings.keys["zoom" /* zoom */];
|
|
711
|
+
const { range } = useEffectiveRange(zoomConfig.range, supportedRange);
|
|
712
|
+
const [min, max] = range;
|
|
713
|
+
const step = zoomConfig.step ?? 0.05;
|
|
714
|
+
const zoomIn = useCallback(async () => {
|
|
715
|
+
if (isWebPub) {
|
|
716
|
+
const next = Math.min(max, (getSetting("zoom") ?? 1) + step);
|
|
717
|
+
await submitPreferences({ zoom: next });
|
|
718
|
+
dispatch(setWebPubZoom(getSetting("zoom")));
|
|
719
|
+
} else {
|
|
720
|
+
const next = Math.min(max, (getSetting("fontSize") ?? 1) + step);
|
|
721
|
+
await submitPreferences({ fontSize: next });
|
|
722
|
+
dispatch(setFontSize(getSetting("fontSize")));
|
|
765
723
|
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
this["on" + EventName],
|
|
777
|
-
false
|
|
778
|
-
);
|
|
779
|
-
});
|
|
780
|
-
this.targets = this.targets.filter((t) => t !== item);
|
|
781
|
-
}
|
|
782
|
-
observe(item) {
|
|
783
|
-
if (!item) return;
|
|
784
|
-
if (this.targets.includes(item)) return;
|
|
785
|
-
this.observers.forEach((EventName) => {
|
|
786
|
-
item.addEventListener(EventName, this["on" + EventName], false);
|
|
787
|
-
});
|
|
788
|
-
this.targets.push(item);
|
|
789
|
-
}
|
|
790
|
-
onkeydown(e) {
|
|
791
|
-
const focusIsSafe = !isInteractiveElement(document.activeElement);
|
|
792
|
-
switch (e.code) {
|
|
793
|
-
case "Space":
|
|
794
|
-
focusIsSafe && this.callbacks.goProgression(e.shiftKey);
|
|
795
|
-
break;
|
|
796
|
-
case "ArrowRight":
|
|
797
|
-
focusIsSafe && this.callbacks.moveTo("right");
|
|
798
|
-
break;
|
|
799
|
-
case "ArrowLeft":
|
|
800
|
-
focusIsSafe && this.callbacks.moveTo("left");
|
|
801
|
-
break;
|
|
802
|
-
case "ArrowUp":
|
|
803
|
-
case "PageUp":
|
|
804
|
-
focusIsSafe && this.callbacks.moveTo("up");
|
|
805
|
-
break;
|
|
806
|
-
case "ArrowDown":
|
|
807
|
-
case "PageDown":
|
|
808
|
-
focusIsSafe && this.callbacks.moveTo("down");
|
|
809
|
-
break;
|
|
810
|
-
case "Home":
|
|
811
|
-
focusIsSafe && this.callbacks.moveTo("home");
|
|
812
|
-
break;
|
|
813
|
-
case "End":
|
|
814
|
-
focusIsSafe && this.callbacks.moveTo("end");
|
|
815
|
-
break;
|
|
816
|
-
default:
|
|
817
|
-
if (this.shortcuts.hasOwnProperty(e.code)) {
|
|
818
|
-
const customShortcutObj = this.shortcuts[e.code];
|
|
819
|
-
const sendCallback = Object.entries(customShortcutObj.modifiers).every(([modifier, value]) => {
|
|
820
|
-
if (modifier === "platformKey") {
|
|
821
|
-
return e[this.getPlatformModifier()] === value;
|
|
822
|
-
} else {
|
|
823
|
-
return e[modifier] === value;
|
|
824
|
-
}
|
|
825
|
-
});
|
|
826
|
-
if (sendCallback) {
|
|
827
|
-
e.preventDefault();
|
|
828
|
-
this.callbacks.toggleAction(customShortcutObj.actionKey);
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
break;
|
|
724
|
+
}, [isWebPub, getSetting, max, step, submitPreferences, dispatch]);
|
|
725
|
+
const zoomOut = useCallback(async () => {
|
|
726
|
+
if (isWebPub) {
|
|
727
|
+
const next = Math.max(min, (getSetting("zoom") ?? 1) - step);
|
|
728
|
+
await submitPreferences({ zoom: next });
|
|
729
|
+
dispatch(setWebPubZoom(getSetting("zoom")));
|
|
730
|
+
} else {
|
|
731
|
+
const next = Math.max(min, (getSetting("fontSize") ?? 1) - step);
|
|
732
|
+
await submitPreferences({ fontSize: next });
|
|
733
|
+
dispatch(setFontSize(getSetting("fontSize")));
|
|
832
734
|
}
|
|
833
|
-
}
|
|
735
|
+
}, [isWebPub, getSetting, min, step, submitPreferences, dispatch]);
|
|
736
|
+
return { zoomIn, zoomOut };
|
|
834
737
|
};
|
|
835
738
|
var LAYOUT_CLASSES = {
|
|
836
739
|
["stacked-ui" /* stacked */]: "thorium_web_stackedUI",
|
|
837
740
|
["layered-ui" /* layered */]: "thorium_web_layeredUI"
|
|
838
741
|
};
|
|
742
|
+
var toBreakpointClass = (prefix, bp) => `${prefix}${bp.charAt(0).toUpperCase() + bp.slice(1)}`;
|
|
839
743
|
function getReaderClassNames(options) {
|
|
840
744
|
const {
|
|
841
745
|
layoutUI,
|
|
@@ -843,7 +747,8 @@ function getReaderClassNames(options) {
|
|
|
843
747
|
isImmersive = false,
|
|
844
748
|
isHovering = false,
|
|
845
749
|
isFXL = false,
|
|
846
|
-
breakpoint
|
|
750
|
+
breakpoint,
|
|
751
|
+
containerBreakpoint
|
|
847
752
|
} = options;
|
|
848
753
|
return classNames(
|
|
849
754
|
thorium_web_reader_app_default.shell,
|
|
@@ -852,10 +757,11 @@ function getReaderClassNames(options) {
|
|
|
852
757
|
isHovering && "thorium_web_isHovering",
|
|
853
758
|
isFXL ? "thorium_web_isFXL" : "thorium_web_isReflow",
|
|
854
759
|
LAYOUT_CLASSES[layoutUI],
|
|
855
|
-
breakpoint ?
|
|
760
|
+
breakpoint ? toBreakpointClass("thorium_web_is", breakpoint) : void 0,
|
|
761
|
+
containerBreakpoint ? toBreakpointClass("thorium_web_container_is", containerBreakpoint) : void 0
|
|
856
762
|
);
|
|
857
763
|
}
|
|
858
764
|
|
|
859
|
-
export {
|
|
860
|
-
//# sourceMappingURL=chunk-
|
|
861
|
-
//# sourceMappingURL=chunk-
|
|
765
|
+
export { StatefulReaderFooter, StatefulReaderHeader, getReaderClassNames, useFonts, useZoomCallbacks };
|
|
766
|
+
//# sourceMappingURL=chunk-Y5X74VW7.mjs.map
|
|
767
|
+
//# sourceMappingURL=chunk-Y5X74VW7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/StatefulReaderRunningHead.tsx","../src/components/StatefulReaderHeader.tsx","../src/components/assets/styles/thorium-web.reader.pagination.module.css","../src/components/assets/styles/thorium-web.reader.progression.module.css","../src/core/Components/Reader/ThProgression.tsx","../src/components/StatefulReaderProgression.tsx","../src/components/StatefulReaderPagination.tsx","../src/components/StatefulReaderFooter.tsx","../src/core/Hooks/fonts/androidPatchCss.ts","../src/core/Hooks/fonts/useFonts.ts","../src/components/Settings/hooks/useZoomCallbacks.ts","../src/components/Helpers/getReaderClassNames.ts"],"names":["Fragment","jsx","wrapper","listItem","leftButton","progression","rightButton","label","useMemo","classNames","useRef","jsxs","useCallback","useEffect"],"mappings":";;;;;;;;;;;;;;AAcO,IAAM,4BAA4B,CAAC;AAAA,EACxC;AACF,CAAA,KAEM;AACJ,EAA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AAA;AAAA,IACpC,WAAA,IAAe,yBAAA;AAAA,IACf,UAAA,IAAc,wBAAA;AAAA,IACd,QAAQ,mBAAA,GAAsB,sBAAA;AAAA,IAC9B,eAAe,QAAQ,CAAA;AAAA,IACvB,UAAA,GAAa,iBAAA,CAAkB,gBAAA,EAAkB,UAAU,CAAA,GAAI,MAAA;AAAA,IAC/D,mBAAA,GAAsB,iBAAA,CAAkB,0BAAA,EAA4B,mBAAmB,CAAA,GAAI;AAAA,GAC7F;AACF","file":"chunk-Y5X74VW7.mjs","sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\n\nimport { ThRunningHeadFormat } from \"@/preferences/models\";\nimport { ThFormatPref, ThFormatPrefValue } from \"@/preferences\";\n\nimport { ThRunningHead } from \"@/core/Components\";\n\nimport { useI18n } from \"@/i18n/useI18n\";\n\nimport { useAppSelector } from \"@/lib/hooks\";\nimport { makeBreakpointsMap } from \"@/core/Helpers/breakpointsMap\";\n\nexport const StatefulReaderRunningHead = ({ \n formatPref\n}: {\n formatPref?: ThFormatPref<ThRunningHeadFormat>;\n}) => {\n const { t } = useI18n();\n \n const unstableTimeline = useAppSelector(state => state.publication.unstableTimeline);\n const isImmersive = useAppSelector(state => state.reader.isImmersive);\n const isHovering = useAppSelector(state => state.reader.isHovering);\n const isFullscreen = useAppSelector(state => state.reader.isFullscreen);\n const breakpoint = useAppSelector(state => state.theming.containerBreakpoint);\n\n // Get the fallback format based on isFXL\n const fallbackFormat = useMemo<ThFormatPrefValue<ThRunningHeadFormat>>(() => ({\n variants: ThRunningHeadFormat.title,\n displayInImmersive: true,\n displayInFullscreen: true\n }), []);\n\n const breakpointsMap = useMemo(() => {\n return makeBreakpointsMap<ThFormatPrefValue<ThRunningHeadFormat>>({\n defaultValue: formatPref?.default || fallbackFormat,\n fromEnum: ThRunningHeadFormat,\n pref: formatPref?.breakpoints,\n validateKey: \"variants\"\n });\n }, [formatPref, fallbackFormat]);\n \n // Get current preferences with proper fallback\n const currentPrefs = useMemo(() => {\n if (!breakpoint) return formatPref?.default || fallbackFormat;\n return breakpointsMap[breakpoint] || formatPref?.default || fallbackFormat;\n }, [breakpoint, breakpointsMap, formatPref?.default, fallbackFormat]);\n\n const { variants, displayInImmersive, displayInFullscreen } = currentPrefs;\n\n const displayFormat = useMemo(() => {\n if (!variants) return ThRunningHeadFormat.title;\n \n // Check if we should hide in immersive mode\n if (isImmersive && displayInImmersive === false && !isHovering) {\n return ThRunningHeadFormat.none;\n }\n \n // Check if we should hide in fullscreen mode\n if (isImmersive && isFullscreen && displayInFullscreen === false && !isHovering) {\n return ThRunningHeadFormat.none;\n }\n \n return variants;\n }, [variants, isImmersive, displayInImmersive, isHovering, isFullscreen, displayInFullscreen]);\n\n const runningHead = useMemo(() => {\n if (displayFormat === ThRunningHeadFormat.title) {\n return unstableTimeline?.title || \"\";\n } else if (displayFormat === ThRunningHeadFormat.chapter) {\n return unstableTimeline?.progression?.currentChapter || unstableTimeline?.title || \"\";\n }\n return \"\";\n }, [displayFormat, unstableTimeline]);\n\n if (!runningHead || displayFormat === ThRunningHeadFormat.none) return null;\n \n return (\n <>\n <ThRunningHead \n label={ runningHead } \n aria-label={ t(\"reader.app.header.runningHead\") }\n />\n </>\n );\n}","\"use client\";\n\nimport React from \"react\";\n\nimport { ActionKeyType } from \"@/preferences\";\nimport { ThLayoutUI, ThRunningHeadFormat } from \"@/preferences/models\";\nimport { ThFormatPref } from \"@/preferences\";\n\nimport readerStyles from \"./assets/styles/thorium-web.reader.app.module.css\";\nimport readerHeaderStyles from \"./assets/styles/thorium-web.reader.header.module.css\";\nimport overflowMenuStyles from \"./Actions/assets/styles/thorium-web.overflow.module.css\";\n\nimport { ThHeader } from \"@/core/Components/Reader/ThHeader\";\nimport { StatefulBackLink } from \"./StatefulBackLink\";\nimport { StatefulReaderRunningHead } from \"./StatefulReaderRunningHead\";\nimport { ThInteractiveOverlay } from \"../core/Components/Reader/ThInteractiveOverlay\";\nimport { StatefulCollapsibleActionsBar } from \"./Actions/StatefulCollapsibleActionsBar\";\n\nimport { useReaderHeaderBase } from \"./hooks/useReaderHeaderBase\";\nimport { usePreferences } from \"@/preferences/hooks\";\n\nimport classNames from \"classnames\";\n\nexport const StatefulReaderHeader = ({\n actionKeys,\n actionsOrder,\n layout,\n runningHeadFormatPref\n}: {\n actionKeys: ActionKeyType[];\n actionsOrder: ActionKeyType[];\n layout: ThLayoutUI;\n runningHeadFormatPref?: ThFormatPref<ThRunningHeadFormat>;\n}) => {\n const {\n headerRef, focusWithinProps, setHover, removeHover,\n listActionItems, isImmersive, isHovering, isScroll, t,\n } = useReaderHeaderBase(actionKeys);\n\n const { preferences } = usePreferences();\n\n return (\n <>\n <ThInteractiveOverlay\n className={ classNames(readerStyles.barOverlay, readerStyles.headerOverlay) }\n isActive={ layout === ThLayoutUI.layered && isImmersive && !isHovering }\n onMouseEnter={ setHover }\n onMouseLeave={ removeHover }\n />\n\n <ThHeader\n ref={ headerRef }\n className={ classNames(readerStyles.topBar, readerHeaderStyles.header) }\n aria-label={ t(\"reader.app.header.label\") }\n onMouseEnter={ setHover }\n onMouseLeave={ removeHover }\n { ...focusWithinProps }\n >\n { preferences.theming.header?.backLink && <StatefulBackLink className={ readerHeaderStyles.backlinkWrapper } /> }\n\n <StatefulReaderRunningHead formatPref={ runningHeadFormatPref } />\n\n <StatefulCollapsibleActionsBar\n id=\"reader-header-overflowMenu\"\n items={ listActionItems() }\n prefs={{ ...preferences.actions, displayOrder: actionsOrder }}\n className={ readerHeaderStyles.actionsWrapper }\n aria-label={ t(\"reader.app.header.actions\") }\n overflowMenuClassName={\n (!isScroll || preferences.affordances.scroll.hintInImmersive)\n ? overflowMenuStyles.hint\n : undefined\n }\n />\n </ThHeader>\n </>\n );\n};\n",".wrapper {\n box-sizing: border-box;\n display: grid;\n gap: calc(var(--th-layout-spacing) / 2);\n grid-template-areas: \"pagination-start pagination-center pagination-end\";\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n background-color: var(--th-theme-background);\n color: var(--th-theme-text);\n align-items: center;\n width: 100%;\n max-width: var(--th-layout-constraints-pagination, 100%);\n}\n\n.listItem {\n box-sizing: border-box;\n list-style: none;\n}\n\n.listItem:has(.leftButton) {\n grid-area: pagination-start;\n justify-self: start;\n}\n\n.listItem:has(.progression) {\n grid-area: pagination-center;\n justify-self: center;\n}\n\n.listItem:has(.rightButton) {\n grid-area: pagination-end;\n justify-self: end;\n}\n\n\n.listItem button {\n box-sizing: border-box;\n padding: calc(var(--th-icon-size, 24px) * (1/4)) calc(var(--th-layout-spacing) / 2);\n gap: calc(var(--th-layout-spacing) / 2);\n max-height: calc(var(--th-icon-size, 24px) * 2);\n max-width: 100%;\n border-radius: var(--th-layout-radius);\n display: flex;\n align-items: center;\n}\n\n.rightButton {\n margin-inline-start: auto;\n text-align: end;\n}\n\n.listItem button[data-hovered] {\n background-color: var(--th-theme-hover);\n color: var(--th-theme-onHover);\n}\n\n.listItem button[data-focus-visible] {\n outline: 2px solid var(--th-theme-focus);\n}\n\n.listItem button[data-disabled] {\n color: var(--th-theme-disable);\n}\n\n.listItem button .label {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n white-space: normal;\n -webkit-line-clamp: 1;\n line-clamp: 1;\n}\n\n.listItem button svg {\n flex: none;\n width: var(--th-icon-size, 24px);\n height: var(--th-icon-size, 24px);\n fill: currentColor;\n}",".wrapper {\n color: var(--th-theme-text);\n font-variant-numeric: lining-nums tabular-nums;\n text-align: center;\n}","\"use client\";\n\nimport React from \"react\";\n\nexport interface ThProgressionProps extends React.HTMLAttributes<HTMLDivElement> {\n ref?: React.RefObject<HTMLDivElement>\n}\n\nexport const ThProgression = ({ \n ref,\n children, \n ...props\n}: ThProgressionProps) => {\n return (\n <>\n <div \n ref={ ref } \n {...props }\n >\n { children }\n </div>\n </>\n )\n}","\"use client\";\n\nimport { useMemo } from \"react\";\n\nimport progressionStyles from \"./assets/styles/thorium-web.reader.progression.module.css\";\n\nimport { ThProgressionFormat } from \"@/preferences/models\";\nimport { ThFormatPref, ThFormatPrefValue } from \"@/preferences\";\n\nimport { ThProgression } from \"@/core/Components/Reader/ThProgression\";\n\nimport { useI18n } from \"@/i18n/useI18n\";\n\nimport { useAppSelector } from \"@/lib/hooks\";\n\nimport { makeBreakpointsMap } from \"@/core/Helpers/breakpointsMap\";\nimport { getBestMatchingProgressionFormat } from \"@/core/Helpers/progressionFormat\";\n\nimport classNames from \"classnames\";\n\nexport const StatefulReaderProgression = ({ \n className,\n formatPref,\n fallbackVariant\n}: { \n className?: string,\n formatPref?: ThFormatPref<ThProgressionFormat | ThProgressionFormat[]>,\n fallbackVariant: ThProgressionFormat | Array<ThProgressionFormat>\n}) => {\n const { t } = useI18n();\n \n const unstableTimeline = useAppSelector(state => state.publication.unstableTimeline);\n const isImmersive = useAppSelector(state => state.reader.isImmersive);\n const isFullscreen = useAppSelector(state => state.reader.isFullscreen);\n const isHovering = useAppSelector(state => state.reader.isHovering);\n const breakpoint = useAppSelector(state => state.theming.breakpoint);\n\n \n const fallbackFormat = useMemo(() => {\n return {\n variants: fallbackVariant,\n displayInImmersive: true,\n displayInFullscreen: true\n };\n }, [fallbackVariant]);\n \n const breakpointsMap = useMemo(() => {\n return makeBreakpointsMap<ThFormatPrefValue<ThProgressionFormat | ThProgressionFormat[]>>({\n defaultValue: formatPref?.default || fallbackFormat,\n fromEnum: ThProgressionFormat,\n pref: formatPref?.breakpoints,\n validateKey: \"variants\"\n });\n }, [formatPref, fallbackFormat]);\n \n // Get current preferences with proper fallback\n const currentPrefs = useMemo(() => {\n if (!breakpoint) return formatPref?.default || fallbackFormat;\n return breakpointsMap[breakpoint] || formatPref?.default || fallbackFormat;\n }, [breakpoint, breakpointsMap, formatPref?.default, fallbackFormat]);\n\n const { variants, displayInImmersive, displayInFullscreen } = currentPrefs;\n \n // Get the display format, handling both single format and array of formats\n const displayFormat = useMemo(() => {\n if (!variants) return fallbackFormat.variants;\n \n // Check if we should hide in immersive mode\n if (isImmersive && displayInImmersive === false && !isHovering) {\n return ThProgressionFormat.none;\n }\n \n // Check if we should hide in fullscreen mode\n if (isImmersive && isFullscreen && displayInFullscreen === false && !isHovering) {\n return ThProgressionFormat.none;\n }\n \n if (Array.isArray(variants)) {\n return getBestMatchingProgressionFormat(variants, unstableTimeline?.progression) || \n fallbackFormat.variants;\n }\n \n return variants;\n }, [variants, unstableTimeline?.progression, fallbackFormat, isImmersive, isHovering, isFullscreen, displayInImmersive, displayInFullscreen]);\n\n // Compute display text based on current position and timeline\n const displayText = useMemo(() => {\n if (displayFormat === ThProgressionFormat.none || !unstableTimeline?.progression) {\n return \"\";\n }\n\n const { \n currentPositions = [],\n totalPositions,\n relativeProgression,\n totalProgression,\n currentChapter,\n positionsLeft,\n totalItems,\n currentIndex\n } = unstableTimeline.progression;\n \n let text = \"\";\n \n // Format positions for display (handle array of two positions with a dash)\n const formatPositions = (positions: number[]) => {\n if (positions.length === 2) {\n return positions.join(\"–\");\n }\n return positions[0]?.toString() || \"\";\n };\n \n switch (displayFormat) {\n case ThProgressionFormat.positions:\n if (currentPositions.length > 0) {\n text = formatPositions(currentPositions);\n }\n break;\n \n case ThProgressionFormat.positionsOfTotal:\n if (currentPositions.length > 0 && totalPositions) {\n text = t(\"reader.progression.xOfY.compact\", { \n x: formatPositions(currentPositions),\n y: totalPositions\n });\n }\n break;\n\n case ThProgressionFormat.positionsPercentOfTotal:\n if (currentPositions.length > 0 && totalPositions) {\n const percentage = Math.round((totalProgression || 0) * 100);\n text = t(\"reader.progression.xOfY.descriptive\", { \n x: formatPositions(currentPositions),\n y: totalPositions,\n z: `${ percentage }%`\n });\n }\n break;\n \n case ThProgressionFormat.positionsLeft:\n if (positionsLeft !== undefined) {\n text = t(`reader.progression.positionsLeftInChapter.descriptive`, { \n count: positionsLeft\n });\n }\n break;\n \n case ThProgressionFormat.overallProgression:\n if (totalProgression !== undefined) {\n const percentage = Math.round(totalProgression * 100);\n text = `${ percentage }%`;\n }\n break;\n \n case ThProgressionFormat.resourceProgression:\n if (relativeProgression !== undefined) {\n const percentage = Math.round(relativeProgression * 100);\n text = `${ percentage }%`;\n }\n break;\n \n case ThProgressionFormat.progressionOfResource:\n if (relativeProgression !== undefined) {\n const percentage = Math.round(relativeProgression * 100);\n text = t(\"reader.progression.xOfY.compact\", {\n x: `${ percentage }%`,\n y: currentChapter || t(\"reader.app.progression.referenceFallback\")\n });\n }\n break;\n\n case ThProgressionFormat.readingOrderIndex:\n if (currentIndex !== undefined && totalItems !== undefined) {\n text = t(\"reader.progression.xOfY.compact\", {\n x: currentIndex,\n y: totalItems\n });\n }\n break;\n }\n \n return text;\n }, [displayFormat, unstableTimeline, t]);\n\n if (!displayText || displayFormat === ThProgressionFormat.none) {\n return null;\n }\n\n return (\n <ThProgression \n id=\"current-progression\" \n className={ classNames(progressionStyles.wrapper, className) }\n aria-label={ t(\"reader.app.progression.wrapper\") }\n >\n { displayText }\n </ThProgression>\n );\n};","\"use client\";\n\nimport { useRef, KeyboardEvent } from \"react\";\n\nimport { ThPagination, ThPaginationProps } from \"@/core/Components/Reader/ThPagination\";\n\nimport readerPaginationStyles from \"./assets/styles/thorium-web.reader.pagination.module.css\";\n\nexport const StatefulReaderPagination = ({\n ref,\n links,\n compounds,\n children,\n ...props\n}: ThPaginationProps) => {\n const leftButtonRef = useRef<HTMLButtonElement>(null);\n const rightButtonRef = useRef<HTMLButtonElement>(null);\n\n const updatedCompounds = {\n ...compounds,\n leftButton: {\n ...compounds?.leftButton,\n ref: leftButtonRef,\n onKeyDown: (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n leftButtonRef.current?.blur();\n }\n }\n },\n rightButton: {\n ...compounds?.rightButton,\n ref: rightButtonRef,\n onKeyDown: (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n rightButtonRef.current?.blur();\n }\n }\n }\n };\n\n return (\n <ThPagination\n ref={ ref }\n className={ readerPaginationStyles.wrapper }\n links={ links }\n compounds={ updatedCompounds }\n { ...props }\n >\n { children }\n </ThPagination>\n )\n}\n","\"use client\";\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\nimport readerStyles from \"./assets/styles/thorium-web.reader.app.module.css\";\nimport readerPaginationStyles from \"./assets/styles/thorium-web.reader.pagination.module.css\";\n\nimport { ThBreakpoints, ThLayoutUI, ThFormatPref, ThProgressionFormat } from \"@/preferences/models\";\n\nimport { ThFooter } from \"@/core/Components/Reader/ThFooter\";\nimport { StatefulReaderProgression } from \"./StatefulReaderProgression\";\nimport { ThInteractiveOverlay } from \"../core/Components/Reader/ThInteractiveOverlay\";\nimport { StatefulReaderPagination } from \"./StatefulReaderPagination\";\nimport { ThPaginationLinkProps } from \"@/core/Components/Reader/ThPagination\";\n\nimport { useNavigator } from \"@/core/Navigator\";\nimport { useFocusWithin, useLocale } from \"react-aria\";\nimport { useI18n } from \"@/i18n/useI18n\";\n\nimport { setHovering } from \"@/lib/readerReducer\";\nimport { useAppDispatch, useAppSelector } from \"@/lib/hooks\";\nimport { useIsScroll } from \"@/hooks\";\n\nimport classNames from \"classnames\";\n\nexport const StatefulReaderFooter = ({\n layout,\n progressionFormatPref,\n progressionFormatFallback\n}: {\n layout: ThLayoutUI;\n progressionFormatPref?: ThFormatPref<ThProgressionFormat | ThProgressionFormat[]>;\n progressionFormatFallback: ThProgressionFormat | ThProgressionFormat[];\n}) => {\n const { t } = useI18n();\n const { direction } = useLocale();\n const footerRef = useRef<HTMLDivElement>(null);\n const isImmersive = useAppSelector(state => state.reader.isImmersive);\n const isHovering = useAppSelector(state => state.reader.isHovering);\n const hasScrollAffordance = useAppSelector(state => state.reader.hasScrollAffordance);\n const isRTL = useAppSelector(state => state.publication.isRTL);\n const isFXL = useAppSelector(state => state.publication.isFXL);\n const isScroll = useIsScroll();\n const breakpoint = useAppSelector(state => state.theming.containerBreakpoint);\n const reducedMotion = useAppSelector(state => state.theming.prefersReducedMotion);\n const timeline = useAppSelector(state => state.publication.unstableTimeline);\n\n const dispatch = useAppDispatch();\n\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin() {\n dispatch(setHovering(true));\n },\n onBlurWithin() {\n dispatch(setHovering(false));\n }\n });\n\n const setHover = () => {\n if (!hasScrollAffordance) {\n dispatch(setHovering(true));\n }\n };\n\n const removeHover = () => {\n if (!hasScrollAffordance) {\n dispatch(setHovering(false));\n }\n };\n\n const { previousLocator, nextLocator, go } = useNavigator().unified;\n\n const buildNode = useCallback((\n locator: ReturnType<typeof previousLocator>,\n title: string | undefined,\n compactKey: string,\n descriptiveKey: string\n ) => {\n if (!locator) return undefined;\n\n return breakpoint !== ThBreakpoints.compact && breakpoint !== ThBreakpoints.medium ? (\n <>\n <span className={ readerStyles.srOnly }>{ t(descriptiveKey) }</span>\n <span className={ readerPaginationStyles.label }>{ title || locator.title || t(compactKey) }</span>\n </>\n ) : (\n <span className={ readerPaginationStyles.label }>{ t(compactKey) }</span>\n );\n }, [t, breakpoint]);\n\n const updateLinks = useCallback(() => {\n const previous = previousLocator();\n const next = nextLocator();\n\n const previousLink: ThPaginationLinkProps | undefined = previous ? {\n node: buildNode(\n previous,\n timeline?.previousItem?.title,\n isFXL ? \"reader.actions.goToPreviousPage.compact\" : \"reader.actions.goToPreviousChapter.compact\",\n isFXL ? \"reader.actions.goToPreviousPage.descriptive\" : \"reader.actions.goToPreviousChapter.descriptive\"\n ),\n onPress: () => go(previous, !reducedMotion, () => {})\n } : undefined;\n\n const nextLink: ThPaginationLinkProps | undefined = next ? {\n node: buildNode(\n next,\n timeline?.nextItem?.title,\n isFXL ? \"reader.actions.goToNextPage.compact\" : \"reader.actions.goToNextChapter.compact\",\n isFXL ? \"reader.actions.goToNextPage.descriptive\" : \"reader.actions.goToNextChapter.descriptive\"\n ),\n onPress: () => go(next, !reducedMotion, () => {})\n } : undefined;\n\n return isRTL\n ? { left: nextLink, right: previousLink }\n : { left: previousLink, right: nextLink };\n }, [go, previousLocator, nextLocator, buildNode, timeline, reducedMotion, isFXL, isRTL]);\n\n useEffect(() => {\n updateLinks();\n }, [timeline, updateLinks]);\n\n useEffect(() => {\n // Blur any focused element when entering immersive mode\n if (isImmersive) {\n const focusElement = document.activeElement;\n if (focusElement && footerRef.current?.contains(focusElement)) {\n (focusElement as HTMLElement).blur();\n }\n }\n }, [isImmersive]);\n\n return(\n <>\n <ThInteractiveOverlay\n className={ classNames(readerStyles.barOverlay, readerStyles.footerOverlay) }\n isActive={ layout === ThLayoutUI.layered && isImmersive && !isHovering }\n onMouseEnter={ setHover }\n onMouseLeave={ removeHover }\n />\n\n <ThFooter\n ref={ footerRef }\n className={ readerStyles.bottomBar }\n aria-label={ t(\"reader.app.footer.label\") }\n onMouseEnter={ setHover }\n onMouseLeave={ removeHover }\n { ...focusWithinProps }\n >\n { (isScroll)\n ? <StatefulReaderPagination\n aria-label={ t(\"reader.navigation.scroll.wrapper\") }\n links={ updateLinks() }\n dir={ direction }\n compounds={ {\n listItem: {\n className: readerPaginationStyles.listItem\n },\n leftButton: {\n className: readerPaginationStyles.leftButton,\n preventFocusOnPress: true\n },\n rightButton: {\n className: readerPaginationStyles.rightButton,\n preventFocusOnPress: true\n }\n } }\n >\n <StatefulReaderProgression\n className={ readerPaginationStyles.progression }\n formatPref={ progressionFormatPref }\n fallbackVariant={ progressionFormatFallback }\n />\n </StatefulReaderPagination>\n : <StatefulReaderProgression\n formatPref={ progressionFormatPref }\n fallbackVariant={ progressionFormatFallback }\n /> }\n </ThFooter>\n </>\n )\n}\n","export const getAndroidPatchCss = () => {\n if (typeof window === \"undefined\") {\n return \"\";\n }\n \n const origin = window.location.origin;\n \n return `/* Readium CSS\n Android Fonts Patch module\n\n A stylesheet aligning Android generic serif and sans-serif fonts on other platforms\n\n Repo: https://github.com/readium/css */\n\n/* Android resolves sans-serif to Roboto, and serif to Droid Serif \n This created issues for FXL EPUBs relying on Times (New Roman),\n Helvetica or Arial while not embedding the font files in the package.\n\n See https://github.com/readium/css/issues/149\n\n Unfortunately it is no possible to target generic family using @font-face,\n we have to target specific font-family names e.g. Times, Arial, etc.\n\n This stylesheet/patch should be loaded only for this case i.e.\n a Fixed-Layout EPUB with text but no embedded font on an Android device.\n The logic for checking these conditions are up to implementers.\n*/\n\n/* Serif (Times + Times New Roman) */\n\n@font-face {\n font-family: Times;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: normal;\n}\n\n@font-face {\n font-family: \"Times New Roman\";\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: normal;\n}\n\n@font-face {\n font-family: Times;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-Italic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: italic;\n}\n\n@font-face {\n font-family: \"Times New Roman\";\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-Italic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: italic;\n}\n\n@font-face {\n font-family: Times;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-Bold.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: normal;\n}\n\n@font-face {\n font-family: \"Times New Roman\";\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-Bold.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: normal;\n}\n\n@font-face {\n font-family: Times;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-BoldItalic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: italic;\n}\n\n@font-face {\n font-family: \"Times New Roman\";\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-BoldItalic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: italic;\n}\n\n/* Sans-serif (Helvetica + Arial) */\n\n@font-face {\n font-family: Helvetica;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: normal;\n}\n\n@font-face {\n font-family: Arial;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: normal;\n}\n\n@font-face {\n font-family: Helvetica;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-Italic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: italic;\n}\n\n@font-face {\n font-family: Arial;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-Italic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: italic;\n}\n\n@font-face {\n font-family: Helvetica;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-Bold.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: normal;\n}\n\n@font-face {\n font-family: Arial;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-Bold.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: normal;\n}\n\n@font-face {\n font-family: Helvetica;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-BoldItalic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: italic;\n}\n\n@font-face {\n font-family: Arial;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-BoldItalic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: italic;\n}`;\n};\n","\"use client\";\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\nimport { InjectableFontResources } from \"@/preferences/services/fonts\";\nimport { ILinkInjectable, IUrlInjectable, IBlobInjectable } from \"@readium/navigator\";\n\nimport { getPlatform } from \"@/core/Helpers/getPlatform\";\nimport { getAndroidPatchCss } from \"./androidPatchCss\";\n\ntype FontResource = (ILinkInjectable & IUrlInjectable) | (ILinkInjectable & IBlobInjectable);\n\nexport const useFonts = (fontResources?: InjectableFontResources | null) => {\n const injectedElementsRef = useRef<{\n prepend: HTMLElement[];\n append: HTMLElement[];\n }>({\n prepend: [],\n append: []\n });\n\n const createLinkElement = useCallback((resource: FontResource): HTMLLinkElement => {\n const link = document.createElement(\"link\");\n \n // Set all custom attributes first to make sure they are\n // overridden by the core attributes\n if (\"attributes\" in resource && resource.attributes) {\n Object.entries(resource.attributes).forEach(([key, value]) => {\n link.setAttribute(key, value as string);\n });\n }\n \n link.rel = resource.rel;\n link.as = resource.as;\n \n if (\"url\" in resource) {\n link.href = resource.url;\n } else if (\"blob\" in resource && resource.blob) {\n link.href = URL.createObjectURL(resource.blob);\n }\n \n return link;\n }, []);\n\n const removeInjectedElements = useCallback(() => {\n const { prepend, append } = injectedElementsRef.current;\n \n [...prepend, ...append].forEach(element => {\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n // Revoke blob URLs to prevent memory leaks\n if (element instanceof HTMLLinkElement && element.href.startsWith(\"blob:\")) {\n URL.revokeObjectURL(element.href);\n }\n });\n \n injectedElementsRef.current = {\n prepend: [],\n append: []\n };\n }, []);\n\n const injectFontResources = useCallback((resources: InjectableFontResources | null) => {\n if (typeof document === \"undefined\") return;\n \n removeInjectedElements();\n \n if (!resources) return;\n \n const { prepend, append } = resources;\n const injectedElements = injectedElementsRef.current;\n \n prepend.forEach(resource => {\n const element = createLinkElement(resource);\n document.head.insertBefore(element, document.head.firstChild);\n injectedElements.prepend.push(element);\n });\n \n append.forEach(resource => {\n const element = createLinkElement(resource);\n document.head.appendChild(element);\n injectedElements.append.push(element);\n });\n }, [createLinkElement, removeInjectedElements]);\n\n const getAndroidFXLPatch = useCallback((): (ILinkInjectable & IBlobInjectable) | null => {\n const platform = getPlatform();\n const isAndroid = platform === \"android\";\n \n if (!isAndroid) {\n return null;\n }\n \n const cssContent = getAndroidPatchCss();\n const blob = new Blob([cssContent], { type: \"text/css\" });\n \n return {\n as: \"link\",\n rel: \"stylesheet\",\n blob\n };\n }, []);\n\n useEffect(() => {\n injectFontResources(fontResources || null);\n \n return () => {\n removeInjectedElements();\n };\n }, [fontResources, injectFontResources, removeInjectedElements]);\n\n return {\n injectFontResources,\n removeFontResources: removeInjectedElements,\n getAndroidFXLPatch\n };\n};","import { useCallback } from \"react\";\n\nimport { ThSettingsKeys } from \"@/preferences/models\";\nimport { usePreferences } from \"@/preferences/hooks/usePreferences\";\nimport { useAppDispatch, useAppSelector } from \"@/lib/hooks\";\nimport { setFontSize } from \"@/lib/settingsReducer\";\nimport { setWebPubZoom } from \"@/lib/webPubSettingsReducer\";\nimport { useEffectiveRange } from \"./useEffectiveRange\";\nimport { EpubPreferencesEditor, IEpubPreferences, IWebPubPreferences, WebPubPreferencesEditor } from \"@readium/navigator\";\nimport { useEpubNavigator } from \"@/core/Hooks/Epub/useEpubNavigator\";\nimport { useWebPubNavigator } from \"@/core/Hooks/WebPub/useWebPubNavigator\";\n\ntype ZoomNavigator = ReturnType<typeof useEpubNavigator> | ReturnType<typeof useWebPubNavigator>;\n\nexport const useZoomCallbacks = (navigator: ZoomNavigator) => {\n const { preferences } = usePreferences();\n const readerProfile = useAppSelector(state => state.reader.profile);\n const isFXL = useAppSelector(state => state.publication.isFXL);\n const dispatch = useAppDispatch();\n\n const isWebPub = readerProfile === \"webPub\";\n\n const getSetting = navigator.getSetting as (key: string) => number | null | undefined;\n const submitPreferences = navigator.submitPreferences as (prefs: IEpubPreferences | IWebPubPreferences) => Promise<void>;\n const { preferencesEditor } = navigator;\n\n const supportedRange = isWebPub\n ? (preferencesEditor as WebPubPreferencesEditor)?.zoom?.supportedRange\n : isFXL\n ? (preferencesEditor as unknown as WebPubPreferencesEditor)?.zoom?.supportedRange\n : (preferencesEditor as EpubPreferencesEditor)?.fontSize?.supportedRange;\n\n const zoomConfig = preferences.settings.keys[ThSettingsKeys.zoom];\n const { range } = useEffectiveRange(zoomConfig.range, supportedRange);\n const [min, max] = range;\n const step = zoomConfig.step ?? 0.05;\n\n const zoomIn = useCallback(async () => {\n if (isWebPub) {\n const next = Math.min(max, (getSetting(\"zoom\") ?? 1) + step);\n await submitPreferences({ zoom: next });\n dispatch(setWebPubZoom(getSetting(\"zoom\")));\n } else {\n const next = Math.min(max, (getSetting(\"fontSize\") ?? 1) + step);\n await submitPreferences({ fontSize: next });\n dispatch(setFontSize(getSetting(\"fontSize\")));\n }\n }, [isWebPub, getSetting, max, step, submitPreferences, dispatch]);\n\n const zoomOut = useCallback(async () => {\n if (isWebPub) {\n const next = Math.max(min, (getSetting(\"zoom\") ?? 1) - step);\n await submitPreferences({ zoom: next });\n dispatch(setWebPubZoom(getSetting(\"zoom\")));\n } else {\n const next = Math.max(min, (getSetting(\"fontSize\") ?? 1) - step);\n await submitPreferences({ fontSize: next });\n dispatch(setFontSize(getSetting(\"fontSize\")));\n }\n }, [isWebPub, getSetting, min, step, submitPreferences, dispatch]);\n\n return { zoomIn, zoomOut };\n};\n","import { ThLayoutUI } from \"@/preferences\";\nimport readerStyles from \"../assets/styles/thorium-web.reader.app.module.css\";\nimport classNames from \"classnames\";\n\ninterface ReaderStyleOptions {\n layoutUI: ThLayoutUI;\n isScroll: boolean;\n isImmersive?: boolean;\n isHovering?: boolean;\n isFXL?: boolean;\n breakpoint?: string;\n containerBreakpoint?: string;\n}\n\nconst LAYOUT_CLASSES = {\n [ThLayoutUI.stacked]: \"thorium_web_stackedUI\",\n [ThLayoutUI.layered]: \"thorium_web_layeredUI\",\n} as const;\n\nconst toBreakpointClass = (prefix: string, bp: string) =>\n `${ prefix }${ bp.charAt(0).toUpperCase() + bp.slice(1) }`;\n\nexport function getReaderClassNames(options: ReaderStyleOptions): string {\n const {\n layoutUI,\n isScroll,\n isImmersive = false,\n isHovering = false,\n isFXL = false,\n breakpoint,\n containerBreakpoint,\n } = options;\n\n return classNames(\n readerStyles.shell,\n isScroll ? \"thorium_web_isScroll\" : \"thorium_web_isPaged\",\n isImmersive && \"thorium_web_isImmersive\",\n isHovering && \"thorium_web_isHovering\",\n isFXL ? \"thorium_web_isFXL\" : \"thorium_web_isReflow\",\n LAYOUT_CLASSES[layoutUI],\n breakpoint ? toBreakpointClass(\"thorium_web_is\", breakpoint) : undefined,\n containerBreakpoint ? toBreakpointClass(\"thorium_web_container_is\", containerBreakpoint) : undefined\n );\n}"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { usePrevious } from './chunk-YZ73DHRU.mjs';
|
|
2
|
-
import { useCollapsibility } from './chunk-
|
|
2
|
+
import { useCollapsibility } from './chunk-AQSJDL63.mjs';
|
|
3
3
|
import React23, { createContext, useContext, useCallback, useMemo, useState, useEffect, useRef, Fragment as Fragment$1, createElement } from 'react';
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
import { useObjectRef, useOverlayPosition, OverlayContainer, FocusScope, OverlayProvider, useDialog, useOverlay, useModal } from 'react-aria';
|
|
6
|
-
import { Toolbar, TooltipTrigger, Button, Tooltip, MenuTrigger, Popover, Menu, Slider, SliderTrack, SliderThumb, Dialog, Modal, Heading, Form, NumberField, Label, FieldError, Input, Text, TextField, SearchField, Link, MenuItem, Keyboard, Group, RadioGroup, Radio, SliderOutput, Switch, SelectValue, Select, ListBox, ListBoxItem } from 'react-aria-components';
|
|
6
|
+
import { Toolbar, TooltipTrigger, Button, Tooltip, MenuTrigger, Popover, Menu, useRenderProps, Slider, SliderTrack, SliderThumb, Dialog, Modal, Heading, Form, NumberField, Label, FieldError, Input, Text, TextField, SearchField, Link, MenuItem, Keyboard, Group, RadioGroup, Radio, SliderOutput, Switch, SelectValue, Select, ListBox, ListBoxItem } from 'react-aria-components';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { useOverlayTriggerState } from 'react-stately';
|
|
9
9
|
import { Sheet } from 'react-modal-sheet';
|
|
@@ -321,6 +321,7 @@ var ThMenu = ({
|
|
|
321
321
|
] });
|
|
322
322
|
}
|
|
323
323
|
};
|
|
324
|
+
var MENU_DEPENDENCIES = ["Trigger"];
|
|
324
325
|
var ThCollapsibleActionsBar = ({
|
|
325
326
|
ref,
|
|
326
327
|
id,
|
|
@@ -332,13 +333,22 @@ var ThCollapsibleActionsBar = ({
|
|
|
332
333
|
...props
|
|
333
334
|
}) => {
|
|
334
335
|
const resolvedRef = useObjectRef(ref);
|
|
335
|
-
const Actions = useCollapsibility(items, prefs, breakpoint);
|
|
336
|
+
const Actions = useCollapsibility(items, prefs, breakpoint, resolvedRef);
|
|
337
|
+
const isSpaceFit = prefs.collapse === true;
|
|
338
|
+
const { className } = useRenderProps({ ...props, values: {} });
|
|
336
339
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
337
340
|
ThActionsBar,
|
|
338
341
|
{
|
|
339
342
|
ref: resolvedRef,
|
|
340
343
|
...props,
|
|
341
344
|
children: [
|
|
345
|
+
isSpaceFit && // Hidden measurement clone — renders with the same className as the real bar
|
|
346
|
+
// so gap, display, and any other CSS-driven layout is identical.
|
|
347
|
+
// Plain div (not Toolbar) to avoid a nested role="toolbar".
|
|
348
|
+
// Absolutely positioned so it is out of flow; aria-hidden to exclude from AT.
|
|
349
|
+
/* @__PURE__ */ jsx("div", { ref: Actions.getGhostRef, className, "aria-hidden": "true", style: { position: "absolute", visibility: "hidden", pointerEvents: "none" }, children: items.map(
|
|
350
|
+
({ Trigger, key }) => /* @__PURE__ */ jsx("span", { ref: Actions.getItemRef(key), children: /* @__PURE__ */ jsx(Trigger, { variant: "iconButton" /* button */, ...props }) }, key)
|
|
351
|
+
) }),
|
|
342
352
|
Actions.ActionIcons.map(
|
|
343
353
|
({ Trigger, Target, key, associatedKey }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
344
354
|
/* @__PURE__ */ jsx(
|
|
@@ -354,18 +364,17 @@ var ThCollapsibleActionsBar = ({
|
|
|
354
364
|
] }, key)
|
|
355
365
|
),
|
|
356
366
|
React23.isValidElement(compounds?.menu) ? React23.cloneElement(compounds.menu, {
|
|
357
|
-
...compounds.menu.props,
|
|
358
367
|
id,
|
|
359
368
|
triggerRef: resolvedRef,
|
|
360
369
|
items: Actions.MenuItems,
|
|
361
|
-
dependencies:
|
|
370
|
+
dependencies: MENU_DEPENDENCIES
|
|
362
371
|
}) : /* @__PURE__ */ jsx(
|
|
363
372
|
ThMenu,
|
|
364
373
|
{
|
|
365
374
|
id,
|
|
366
375
|
triggerRef: resolvedRef,
|
|
367
376
|
items: Actions.MenuItems,
|
|
368
|
-
dependencies:
|
|
377
|
+
dependencies: MENU_DEPENDENCIES,
|
|
369
378
|
...compounds?.menu
|
|
370
379
|
}
|
|
371
380
|
)
|
|
@@ -1016,7 +1025,6 @@ var ThBottomSheetContainer = ({
|
|
|
1016
1025
|
] });
|
|
1017
1026
|
};
|
|
1018
1027
|
var ThBottomSheet = ({
|
|
1019
|
-
id,
|
|
1020
1028
|
isOpen,
|
|
1021
1029
|
onOpenChange,
|
|
1022
1030
|
ref,
|
|
@@ -1876,5 +1884,5 @@ var ThGrid = ({
|
|
|
1876
1884
|
};
|
|
1877
1885
|
|
|
1878
1886
|
export { ThActionButton, ThActionsBar, ThActionsTriggerVariant, ThAudioProgress, ThBackArrow, ThBottomSheet, ThCloseButton, ThCollapsibleActionsBar, ThContainerBody, ThContainerHeader, ThContainerHeaderWithClose, ThContainerHeaderWithPrevious, ThDeleteButton, ThDockedPanel, ThDragIndicatorButton, ThDropdown, ThDropdownButton, ThFooter, ThForm, ThFormNumberField, ThFormSearchField, ThFormTextField, ThGrid, ThHeader, ThHome, ThInteractiveOverlay, ThLibrary, ThLink, ThLoader, ThMenu, ThMenuButton, ThMenuItem, ThModal, ThNavigationButton, ThNumberField, ThPagination, ThPluginProvider, ThPluginRegistry, ThPopover, ThRadioGroup, ThRunningHead, ThSettingsResetButton, ThSettingsWrapper, ThSettingsWrapperButton, ThSlider, ThSliderWithPresets, ThSwitch, ThTypedComponentRenderer, useActionComponentStatus, useActions, useFirstFocusable, usePlugins };
|
|
1879
|
-
//# sourceMappingURL=chunk-
|
|
1880
|
-
//# sourceMappingURL=chunk-
|
|
1887
|
+
//# sourceMappingURL=chunk-ZD4LTF6G.mjs.map
|
|
1888
|
+
//# sourceMappingURL=chunk-ZD4LTF6G.mjs.map
|