@edrlab/thorium-web 0.11.0 → 0.13.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/README.md +1 -1
- package/dist/{chunk-IUF5GAPA.mjs → chunk-AFXHD6TS.mjs} +43 -22
- package/dist/chunk-AFXHD6TS.mjs.map +1 -0
- package/dist/{chunk-JS5WI5D4.mjs → chunk-CW72NB4V.mjs} +2 -2
- package/dist/{chunk-JS5WI5D4.mjs.map → chunk-CW72NB4V.mjs.map} +1 -1
- package/dist/{chunk-2U455VSY.mjs → chunk-GSWRWFPI.mjs} +4 -3
- package/dist/chunk-GSWRWFPI.mjs.map +1 -0
- package/dist/{chunk-4BUYRCGX.mjs → chunk-VMGV6SUR.mjs} +3 -3
- package/dist/{chunk-4BUYRCGX.mjs.map → chunk-VMGV6SUR.mjs.map} +1 -1
- package/dist/components/Epub/index.d.mts +6 -5
- package/dist/components/Epub/index.mjs +135 -114
- package/dist/components/Epub/index.mjs.map +1 -1
- package/dist/core/Components/index.mjs +1 -1
- package/dist/core/Hooks/index.mjs +1 -1
- package/dist/{index-DycjI7PE.d.mts → index-CMOrqzJQ.d.mts} +27 -25
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.mjs +1 -1
- package/dist/preferences/index.mjs +1 -1
- package/dist/{reader-GYRNT4IZ.css → reader-JFQBOUCS.css} +91 -40
- package/dist/{readerHeader.module-LTPJ6FLV.module.css → readerHeader.module-PDCMID5Y.module.css} +7 -1
- package/dist/readerProgression.module-QP76XMVO.module.css +11 -0
- package/dist/{readerStates.module-WG46M7GK.module.css → readerStates.module-XBXHDJTJ.module.css} +3 -7
- package/package.json +7 -7
- package/dist/chunk-2U455VSY.mjs.map +0 -1
- package/dist/chunk-IUF5GAPA.mjs.map +0 -1
- package/dist/readerProgression.module-PL3TD3GE.module.css +0 -4
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { require_debounce, useAppSelector, useAppDispatch, setColumnCount, setFontFamily, setFontWeight, setHyphens, setScroll, setLetterSpacing, setPublisherStyles, setLineHeight, setParagraphIndent, setParagraphSpacing, setSettingsContainer, setTextAlign, setTextNormalization, setTheme, setWordSpacing, setFontSize, toggleImmersive, setFullscreen, setActionOpen, dockAction, setImmersive, setHovering, setArrows, setProgression, setTocEntry, useAppStore, toggleActionOpen, setDirection, setPlatformModifier, setRTL, setFXL, setRunningHead, setTocTree, setOverflow, setPositionsList, setLoading, collapseDockPanel, expandDockPanel, activateDockPanel, deactivateDockPanel, setDockPanelWidth } from '../../chunk-
|
|
2
|
-
export { ThStoreProvider, actionsSlice, activateDockPanel, collapseDockPanel, deactivateDockPanel, dockAction, expandDockPanel, makeStore, publicationSlice, readerSlice, setActionOpen, setArrows, setBreakpoint, setColorScheme, setColumnCount, setContrast, setDirection, setDockPanelWidth, setFXL, setFontFamily, setFontSize, setFontWeight, setForcedColors, setFullscreen, setHovering, setHyphens, setImmersive, setLayoutStrategy, setLetterSpacing, setLineHeight, setLineLength, setLoading, setMonochrome, setOverflow, setParagraphIndent, setParagraphSpacing, setPlatformModifier, setPositionsList, setProgression, setPublicationEnd, setPublicationStart, setPublisherStyles, setRTL, setReducedMotion, setReducedTransparency, setRunningHead, setScroll, setSettingsContainer, setTextAlign, setTextNormalization, setTheme,
|
|
3
|
-
import { defaultFontFamilyOptions, usePreferences, defaultLetterSpacing, defaultLineHeights, defaultParagraphIndent, defaultParagraphSpacing, defaultSpacingSettingsSubpanel, defaultSpacingSettingsMain, defaultTextSettingsSubpanel, defaultTextSettingsMain, usePreferenceKeys, buildThemeObject, defaultWordSpacing, defaultFontSize } from '../../chunk-
|
|
4
|
-
export { ThPreferencesProvider, usePreferences, useTheming } from '../../chunk-
|
|
5
|
-
import { ThRadioGroup, ThDropdown, ThSlider, ThSwitch, ThNumberField, ThSettingsWrapper, ThActionButton, ThMenu, ThCollapsibleActionsBar, ThMenuItem, ThPopover, ThContainerHeader, ThNavigationButton, ThContainerBody, ThBottomSheet, ThCloseButton, ThModal, ThDockedPanel, ThTypedComponentRenderer, useActions, ThForm, ThFormNumberField, ThFormSearchField, ThFormTextField, ThLoader, ThHeader, ThRunningHead, ThFooter, ThProgression } from '../../chunk-
|
|
1
|
+
import { require_debounce, useAppSelector, useAppDispatch, setColumnCount, setFontFamily, setFontWeight, setHyphens, setScroll, setLetterSpacing, setPublisherStyles, setLineHeight, setParagraphIndent, setParagraphSpacing, setSettingsContainer, setTextAlign, setTextNormalization, setTheme, setWordSpacing, setFontSize, toggleImmersive, setFullscreen, setActionOpen, dockAction, setImmersive, setHovering, setArrows, setProgression, setTocEntry, useAppStore, toggleActionOpen, setDirection, setPlatformModifier, setRTL, setFXL, setRunningHead, setTocTree, setOverflow, setPositionsList, setLoading, collapseDockPanel, expandDockPanel, activateDockPanel, deactivateDockPanel, setDockPanelWidth } from '../../chunk-AFXHD6TS.mjs';
|
|
2
|
+
export { ThStoreProvider, actionsSlice, activateDockPanel, collapseDockPanel, deactivateDockPanel, dockAction, expandDockPanel, makeStore, publicationSlice, readerSlice, setActionOpen, setArrows, setBreakpoint, setColorScheme, setColumnCount, setContrast, setDirection, setDockPanelWidth, setFXL, setFontFamily, setFontSize, setFontWeight, setForcedColors, setFullscreen, setHovering, setHyphens, setImmersive, setLayoutStrategy, setLetterSpacing, setLineHeight, setLineLength, setLoading, setMonochrome, setOverflow, setParagraphIndent, setParagraphSpacing, setPlatformModifier, setPositionsList, setProgression, setPublicationEnd, setPublicationStart, setPublisherStyles, setRTL, setReducedMotion, setReducedTransparency, setRunningHead, setScroll, setSettingsContainer, setTextAlign, setTextNormalization, setTheme, setTocEntry, setTocTree, setWordSpacing, settingsSlice, themeSlice, toggleActionOpen, toggleImmersive, useAppDispatch, useAppSelector, useAppStore } from '../../chunk-AFXHD6TS.mjs';
|
|
3
|
+
import { defaultFontFamilyOptions, usePreferences, defaultLetterSpacing, defaultLineHeights, defaultParagraphIndent, defaultParagraphSpacing, defaultSpacingSettingsSubpanel, defaultSpacingSettingsMain, defaultTextSettingsSubpanel, defaultTextSettingsMain, usePreferenceKeys, buildThemeObject, defaultWordSpacing, defaultFontSize } from '../../chunk-VMGV6SUR.mjs';
|
|
4
|
+
export { ThPreferencesProvider, usePreferences, useTheming } from '../../chunk-VMGV6SUR.mjs';
|
|
5
|
+
import { ThRadioGroup, ThDropdown, ThSlider, ThSwitch, ThNumberField, ThSettingsWrapper, ThActionButton, ThMenu, ThCollapsibleActionsBar, ThMenuItem, ThPopover, ThContainerHeader, ThNavigationButton, ThContainerBody, ThBottomSheet, ThCloseButton, ThModal, ThDockedPanel, ThTypedComponentRenderer, useActions, ThForm, ThFormNumberField, ThFormSearchField, ThFormTextField, ThLoader, ThHeader, ThRunningHead, ThFooter, ThProgression } from '../../chunk-GSWRWFPI.mjs';
|
|
6
6
|
import '../../chunk-MLEYTQGK.mjs';
|
|
7
7
|
import { makeBreakpointsMap, localData, isKeyboardTriggered, isActiveElement, isInteractiveElement } from '../../chunk-4DAERVPF.mjs';
|
|
8
8
|
export { isActiveElement, isInteractiveElement, isKeyboardTriggered, localData, makeBreakpointsMap } from '../../chunk-4DAERVPF.mjs';
|
|
9
9
|
export { propsToCSSVars } from '../../chunk-TTGURRX3.mjs';
|
|
10
10
|
import { isIOSish, getPlatformModifier, buildShortcut, metaKeys } from '../../chunk-IEYR7QV7.mjs';
|
|
11
11
|
export { UnstableShortcutMetaKeywords, UnstableShortcutRepresentation, buildShortcut, defaultPlatformModifier, getPlatform, getPlatformModifier, isIOSish, isIpadOS, isMacish, metaKeys } from '../../chunk-IEYR7QV7.mjs';
|
|
12
|
-
import { useEpubNavigator, en_default, useFullscreen, usePrevious, TH_CUSTOM_SCHEME, ThScrollActions } from '../../chunk-
|
|
13
|
-
export { useEpubNavigator } from '../../chunk-
|
|
12
|
+
import { useEpubNavigator, en_default, useFullscreen, usePrevious, TH_CUSTOM_SCHEME, ThScrollActions } from '../../chunk-CW72NB4V.mjs';
|
|
13
|
+
export { useEpubNavigator } from '../../chunk-CW72NB4V.mjs';
|
|
14
14
|
import '../../chunk-KBKVDSTL.mjs';
|
|
15
15
|
import '../../chunk-NQ2ZSGCX.mjs';
|
|
16
16
|
import { ThDockingTypes, ThSheetTypes } from '../../chunk-PGRUW4ME.mjs';
|
|
@@ -20,18 +20,18 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
|
20
20
|
import settingsStyles3 from '../../settings.module-5WB3OOEF.module.css';
|
|
21
21
|
import { ListBox, ListBoxItem, Radio, Text, useFilter, Tree, TreeItem, TreeItemContent, Button, Collection, Keyboard, Toolbar } from 'react-aria-components';
|
|
22
22
|
import { fontWeightRangeConfig, TextAlignment } from '@readium/navigator';
|
|
23
|
-
import
|
|
23
|
+
import classNames9 from 'classnames';
|
|
24
24
|
import readerSharedUI9 from '../../readerSharedUI.module-ZOIZ4GTR.module.css';
|
|
25
|
-
import '../../reader-
|
|
25
|
+
import '../../reader-JFQBOUCS.css';
|
|
26
26
|
import arrowStyles2 from '../../readerArrowButton.module-C37PFDSY.module.css';
|
|
27
27
|
import { I18nProvider } from 'react-aria';
|
|
28
|
-
import { Link, HttpFetcher, Manifest, Publication, ReadingProgression
|
|
28
|
+
import { Link, EPUBLayout, Locator, HttpFetcher, Manifest, Publication, ReadingProgression } from '@readium/shared';
|
|
29
29
|
import dockingStyles from '../../docking.module-TDNYZX4H.module.css';
|
|
30
30
|
import { PanelGroup, Panel, PanelResizeHandle } from 'react-resizable-panels';
|
|
31
|
-
import
|
|
32
|
-
import readerHeaderStyles from '../../readerHeader.module-LTPJ6FLV.module.css';
|
|
31
|
+
import readerHeaderStyles from '../../readerHeader.module-PDCMID5Y.module.css';
|
|
33
32
|
import overflowMenuStyles from '../../overflowMenu.module-XQRI7RJJ.module.css';
|
|
34
|
-
import
|
|
33
|
+
import readerStateStyles from '../../readerStates.module-XBXHDJTJ.module.css';
|
|
34
|
+
import progressionStyles from '../../readerProgression.module-QP76XMVO.module.css';
|
|
35
35
|
import jumpToPositionStyles from '../../jumpToPosition.module-4C47UYPE.module.css';
|
|
36
36
|
import sheetStyles2 from '../../sheets.module-DDN7GPMG.module.css';
|
|
37
37
|
import tocStyles from '../../toc.module-XJLXQM7G.module.css';
|
|
@@ -582,10 +582,10 @@ var StatefulSlider = ({
|
|
|
582
582
|
{
|
|
583
583
|
...props,
|
|
584
584
|
...standalone ? { label } : { "aria-label": label },
|
|
585
|
-
className:
|
|
585
|
+
className: classNames9(settingsStyles3.readerSettingsSlider, standalone ? settingsStyles3.readerSettingsGroup : ""),
|
|
586
586
|
compounds: {
|
|
587
587
|
label: {
|
|
588
|
-
className:
|
|
588
|
+
className: classNames9(settingsStyles3.readerSettingsLabel, settingsStyles3.readerSettingsSliderLabel)
|
|
589
589
|
},
|
|
590
590
|
output: {
|
|
591
591
|
className: settingsStyles3.readerSettingsSliderOutput
|
|
@@ -720,7 +720,7 @@ var StatefulNumberField = ({
|
|
|
720
720
|
{
|
|
721
721
|
...props,
|
|
722
722
|
...standalone ? { label } : { "aria-label": label },
|
|
723
|
-
className:
|
|
723
|
+
className: classNames9(settingsStyles3.readerSettingsNumbfield, standalone ? settingsStyles3.readerSettingsGroup : ""),
|
|
724
724
|
compounds: {
|
|
725
725
|
group: {
|
|
726
726
|
className: settingsStyles3.readerSettingsGroupWrapper
|
|
@@ -1026,16 +1026,16 @@ var StatefulGroupWrapper = ({
|
|
|
1026
1026
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1027
1027
|
ThSettingsWrapper,
|
|
1028
1028
|
{
|
|
1029
|
-
className:
|
|
1029
|
+
className: classNames9(settingsStyles3.readerSettingsGroup, settingsStyles3.readerSettingsAdvancedGroup),
|
|
1030
1030
|
items: componentsMap,
|
|
1031
1031
|
prefs: resolvedPrefs,
|
|
1032
1032
|
compounds: {
|
|
1033
1033
|
label: heading,
|
|
1034
1034
|
heading: {
|
|
1035
|
-
className:
|
|
1035
|
+
className: classNames9(settingsStyles3.readerSettingsLabel, settingsStyles3.readerSettingsGroupLabel)
|
|
1036
1036
|
},
|
|
1037
1037
|
button: {
|
|
1038
|
-
className:
|
|
1038
|
+
className: classNames9(readerSharedUI9.icon, settingsStyles3.readerSettingsAdvancedIcon),
|
|
1039
1039
|
"aria-label": moreLabel,
|
|
1040
1040
|
compounds: {
|
|
1041
1041
|
tooltipTrigger: {
|
|
@@ -1394,11 +1394,11 @@ var StatefulTheme = ({ mapArrowNav }) => {
|
|
|
1394
1394
|
label: en_default.reader.settings.themes.title,
|
|
1395
1395
|
value: theme,
|
|
1396
1396
|
onChange: async (val) => await updatePreference(val),
|
|
1397
|
-
children: /* @__PURE__ */ jsx("div", { className:
|
|
1397
|
+
children: /* @__PURE__ */ jsx("div", { className: classNames9(settingsStyles3.readerSettingsRadioWrapper, settingsStyles3.readerSettingsThemesWrapper), children: themeItems.current.map(
|
|
1398
1398
|
(t) => /* @__PURE__ */ jsx(
|
|
1399
1399
|
Radio,
|
|
1400
1400
|
{
|
|
1401
|
-
className:
|
|
1401
|
+
className: classNames9(
|
|
1402
1402
|
settingsStyles3.readerSettingsRadio,
|
|
1403
1403
|
settingsStyles3.readerSettingsThemeRadio
|
|
1404
1404
|
),
|
|
@@ -1635,7 +1635,7 @@ var DockHandle = ({
|
|
|
1635
1635
|
className: dockingStyles.dockResizeHandle,
|
|
1636
1636
|
disabled: !isResizable,
|
|
1637
1637
|
tabIndex: isPopulated ? 0 : -1,
|
|
1638
|
-
children: isResizable && hasDragIndicator && /* @__PURE__ */ jsx("div", { className:
|
|
1638
|
+
children: isResizable && hasDragIndicator && /* @__PURE__ */ jsx("div", { className: classNames9(dockingStyles.dockResizeHandleGrab, classFromFlow()) })
|
|
1639
1639
|
}
|
|
1640
1640
|
) });
|
|
1641
1641
|
};
|
|
@@ -1727,7 +1727,7 @@ var DockPanel = ({
|
|
|
1727
1727
|
{
|
|
1728
1728
|
id: flow,
|
|
1729
1729
|
"aria-label": makeDockLabel(),
|
|
1730
|
-
className:
|
|
1730
|
+
className: classNames9(dockingStyles.dockPanelContainer, dockClassName)
|
|
1731
1731
|
}
|
|
1732
1732
|
)
|
|
1733
1733
|
}
|
|
@@ -1854,7 +1854,7 @@ var StatefulActionIcon = ({
|
|
|
1854
1854
|
ThActionButton,
|
|
1855
1855
|
{
|
|
1856
1856
|
ref: triggerRef,
|
|
1857
|
-
className:
|
|
1857
|
+
className: classNames9(readerSharedUI9.icon, handleClassNameFromState(), props.className),
|
|
1858
1858
|
onPress: props.onPress || defaultOnPressFunc,
|
|
1859
1859
|
onKeyDown: blurOnEsc,
|
|
1860
1860
|
onFocus: handleImmersive,
|
|
@@ -1993,15 +1993,6 @@ var StatefulReaderHeader = () => {
|
|
|
1993
1993
|
const removeHover = () => {
|
|
1994
1994
|
dispatch(setHovering(false));
|
|
1995
1995
|
};
|
|
1996
|
-
const handleClassNameFromState = () => {
|
|
1997
|
-
let className = "";
|
|
1998
|
-
if (isImmersive && isHovering) {
|
|
1999
|
-
className = readerStateStyles.immersiveHovering;
|
|
2000
|
-
} else if (isImmersive) {
|
|
2001
|
-
className = readerStateStyles.immersive;
|
|
2002
|
-
}
|
|
2003
|
-
return className;
|
|
2004
|
-
};
|
|
2005
1996
|
const listActionItems = useCallback(() => {
|
|
2006
1997
|
const actionKeys = isFXL ? fxlActionKeys : reflowActionKeys;
|
|
2007
1998
|
const actionsItems = [];
|
|
@@ -2023,7 +2014,7 @@ var StatefulReaderHeader = () => {
|
|
|
2023
2014
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
2024
2015
|
ThHeader,
|
|
2025
2016
|
{
|
|
2026
|
-
className:
|
|
2017
|
+
className: readerHeaderStyles.header,
|
|
2027
2018
|
id: "top-bar",
|
|
2028
2019
|
"aria-label": en_default.reader.app.header.label,
|
|
2029
2020
|
onMouseEnter: setHover,
|
|
@@ -2076,7 +2067,7 @@ var StatefulReaderArrowButton = ({
|
|
|
2076
2067
|
const handleClassNameFromState = () => {
|
|
2077
2068
|
let className2 = "";
|
|
2078
2069
|
if (!hasArrows && !switchedFromScrollable()) {
|
|
2079
|
-
className2 = readerStateStyles.
|
|
2070
|
+
className2 = readerStateStyles.noOpacity;
|
|
2080
2071
|
}
|
|
2081
2072
|
return className2;
|
|
2082
2073
|
};
|
|
@@ -2110,7 +2101,7 @@ var StatefulReaderArrowButton = ({
|
|
|
2110
2101
|
onPress: (e) => onPress && handleOnPress(e, onPress),
|
|
2111
2102
|
onHoverChange: (isHovering2) => setIsHovering(isHovering2),
|
|
2112
2103
|
onKeyDown: blurOnEsc,
|
|
2113
|
-
className:
|
|
2104
|
+
className: classNames9(className, handleClassNameFromSpaceProp(), handleClassNameFromState()),
|
|
2114
2105
|
isDisabled,
|
|
2115
2106
|
preventFocusOnPress: true,
|
|
2116
2107
|
...props,
|
|
@@ -2159,8 +2150,6 @@ var StatefulReaderProgression = () => {
|
|
|
2159
2150
|
) });
|
|
2160
2151
|
};
|
|
2161
2152
|
var StatefulReaderFooter = () => {
|
|
2162
|
-
const isImmersive = useAppSelector((state) => state.reader.isImmersive);
|
|
2163
|
-
const isHovering = useAppSelector((state) => state.reader.isHovering);
|
|
2164
2153
|
const dispatch = useAppDispatch();
|
|
2165
2154
|
const setHover = () => {
|
|
2166
2155
|
dispatch(setHovering(true));
|
|
@@ -2168,19 +2157,9 @@ var StatefulReaderFooter = () => {
|
|
|
2168
2157
|
const removeHover = () => {
|
|
2169
2158
|
dispatch(setHovering(false));
|
|
2170
2159
|
};
|
|
2171
|
-
const handleClassNameFromState = () => {
|
|
2172
|
-
let className = "";
|
|
2173
|
-
if (isImmersive && isHovering) {
|
|
2174
|
-
className = readerStateStyles.immersiveHovering;
|
|
2175
|
-
} else if (isImmersive) {
|
|
2176
|
-
className = readerStateStyles.immersive;
|
|
2177
|
-
}
|
|
2178
|
-
return className;
|
|
2179
|
-
};
|
|
2180
2160
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2181
2161
|
ThFooter,
|
|
2182
2162
|
{
|
|
2183
|
-
className: handleClassNameFromState(),
|
|
2184
2163
|
id: "bottom-bar",
|
|
2185
2164
|
"aria-label": en_default.reader.app.footer.label,
|
|
2186
2165
|
onMouseEnter: setHover,
|
|
@@ -2559,7 +2538,7 @@ var StatefulPopoverSheet = ({
|
|
|
2559
2538
|
updateState: resetFocus
|
|
2560
2539
|
},
|
|
2561
2540
|
placement: placement || "bottom",
|
|
2562
|
-
className:
|
|
2541
|
+
className: classNames9(sheetStyles2.popOverSheet, className),
|
|
2563
2542
|
isOpen,
|
|
2564
2543
|
onOpenChange,
|
|
2565
2544
|
isKeyboardDismissDisabled: dismissEscapeKeyClose,
|
|
@@ -2589,7 +2568,7 @@ var StatefulPopoverSheet = ({
|
|
|
2589
2568
|
direction: direction === "ltr" ? "left" : "right",
|
|
2590
2569
|
label: en_default.reader.app.back.trigger,
|
|
2591
2570
|
ref: popoverCloseRef,
|
|
2592
|
-
className:
|
|
2571
|
+
className: classNames9(className, readerSharedUI9.backButton),
|
|
2593
2572
|
"aria-label": en_default.reader.app.back.trigger,
|
|
2594
2573
|
onPress: onClosePress
|
|
2595
2574
|
}
|
|
@@ -2805,7 +2784,7 @@ var StatefulBottomSheet = ({
|
|
|
2805
2784
|
prefersReducedMotion,
|
|
2806
2785
|
compounds: {
|
|
2807
2786
|
container: {
|
|
2808
|
-
className:
|
|
2787
|
+
className: classNames9(sheetStyles2.bottomSheetModal, detentClassName),
|
|
2809
2788
|
ref: sheetContainerRef,
|
|
2810
2789
|
style: {
|
|
2811
2790
|
maxWidth: maxWidthPref
|
|
@@ -2817,15 +2796,15 @@ var StatefulBottomSheet = ({
|
|
|
2817
2796
|
onKeyDown: onDragKeyCallback
|
|
2818
2797
|
},
|
|
2819
2798
|
content: {
|
|
2820
|
-
className:
|
|
2799
|
+
className: classNames9(sheetStyles2.bottomSheet, className),
|
|
2821
2800
|
disableDrag: true
|
|
2822
2801
|
},
|
|
2823
2802
|
scroller: {
|
|
2824
|
-
className:
|
|
2803
|
+
className: classNames9(sheetStyles2.bottomSheetScroller, sheetStyles2.sheetBody),
|
|
2825
2804
|
draggable: false
|
|
2826
2805
|
},
|
|
2827
2806
|
backdrop: {
|
|
2828
|
-
className:
|
|
2807
|
+
className: classNames9(sheetStyles2.bottomSheetBackdrop, scrimClassName),
|
|
2829
2808
|
style: { "--defaults-scrim": scrimPref.override }
|
|
2830
2809
|
}
|
|
2831
2810
|
},
|
|
@@ -2846,7 +2825,7 @@ var StatefulBottomSheet = ({
|
|
|
2846
2825
|
direction: direction === "ltr" ? "left" : "right",
|
|
2847
2826
|
label: en_default.reader.app.back.trigger,
|
|
2848
2827
|
ref: bottomSheetCloseRef,
|
|
2849
|
-
className:
|
|
2828
|
+
className: classNames9(className, readerSharedUI9.backButton),
|
|
2850
2829
|
"aria-label": en_default.reader.app.back.trigger,
|
|
2851
2830
|
onPress: onClosePress
|
|
2852
2831
|
}
|
|
@@ -2908,7 +2887,7 @@ var StatefulFullScreenSheet = ({
|
|
|
2908
2887
|
isOpen,
|
|
2909
2888
|
onOpenChange,
|
|
2910
2889
|
isDismissable: true,
|
|
2911
|
-
className:
|
|
2890
|
+
className: classNames9(sheetStyles2.fullScreenSheet, className),
|
|
2912
2891
|
isKeyboardDismissDisabled: dismissEscapeKeyClose,
|
|
2913
2892
|
style: {
|
|
2914
2893
|
"--sheet-sticky-header": fullScreenHeaderRef.current ? `${fullScreenHeaderRef.current.clientHeight}px` : void 0
|
|
@@ -2931,7 +2910,7 @@ var StatefulFullScreenSheet = ({
|
|
|
2931
2910
|
direction: direction === "ltr" ? "left" : "right",
|
|
2932
2911
|
label: en_default.reader.app.back.trigger,
|
|
2933
2912
|
ref: fullScreenCloseRef,
|
|
2934
|
-
className:
|
|
2913
|
+
className: classNames9(className, readerSharedUI9.backButton),
|
|
2935
2914
|
"aria-label": en_default.reader.app.back.trigger,
|
|
2936
2915
|
onPress: onClosePress
|
|
2937
2916
|
}
|
|
@@ -2997,7 +2976,7 @@ var StatefulDockedSheet = ({
|
|
|
2997
2976
|
autoFocus: false,
|
|
2998
2977
|
updateState: resetFocus
|
|
2999
2978
|
},
|
|
3000
|
-
className:
|
|
2979
|
+
className: classNames9(sheetStyles2.dockedSheet, className, classFromFlow()),
|
|
3001
2980
|
style: {
|
|
3002
2981
|
"--sheet-sticky-header": dockedSheetHeaderRef.current ? `${dockedSheetHeaderRef.current.clientHeight}px` : void 0
|
|
3003
2982
|
},
|
|
@@ -3019,7 +2998,7 @@ var StatefulDockedSheet = ({
|
|
|
3019
2998
|
direction: direction === "ltr" ? "left" : "right",
|
|
3020
2999
|
label: en_default.reader.app.back.trigger,
|
|
3021
3000
|
ref: dockedSheetCloseRef,
|
|
3022
|
-
className:
|
|
3001
|
+
className: classNames9(className, readerSharedUI9.backButton),
|
|
3023
3002
|
"aria-label": en_default.reader.app.back.trigger,
|
|
3024
3003
|
onPress: onClosePress
|
|
3025
3004
|
}
|
|
@@ -3654,6 +3633,7 @@ var StatefulTocContainer = ({ triggerRef }) => {
|
|
|
3654
3633
|
/* @__PURE__ */ jsx(
|
|
3655
3634
|
ThFormSearchField,
|
|
3656
3635
|
{
|
|
3636
|
+
"aria-label": en_default.reader.toc.search.label,
|
|
3657
3637
|
value: filterValue,
|
|
3658
3638
|
onChange: setFilterValue,
|
|
3659
3639
|
onClear: () => setFilterValue(""),
|
|
@@ -3665,7 +3645,6 @@ var StatefulTocContainer = ({ triggerRef }) => {
|
|
|
3665
3645
|
input: {
|
|
3666
3646
|
ref: searchInputRef,
|
|
3667
3647
|
className: tocStyles.tocSearchInput,
|
|
3668
|
-
"aria-label": en_default.reader.toc.search.label,
|
|
3669
3648
|
placeholder: en_default.reader.toc.search.placeholder
|
|
3670
3649
|
},
|
|
3671
3650
|
searchIcon: {
|
|
@@ -3806,7 +3785,10 @@ var createDefaultPlugin = () => {
|
|
|
3806
3785
|
type: "text"
|
|
3807
3786
|
},
|
|
3808
3787
|
["theme" /* theme */]: {
|
|
3809
|
-
Comp: StatefulTheme
|
|
3788
|
+
Comp: StatefulTheme,
|
|
3789
|
+
props: {
|
|
3790
|
+
mapArrowNav: 2
|
|
3791
|
+
}
|
|
3810
3792
|
},
|
|
3811
3793
|
["wordSpacing" /* wordSpacing */]: {
|
|
3812
3794
|
Comp: StatefulWordSpacing,
|
|
@@ -3987,6 +3969,7 @@ var StatefulReader = ({
|
|
|
3987
3969
|
const localDataKey = useRef(`${selfHref}-current-location`);
|
|
3988
3970
|
const arrowsWidth = useRef(2 * ((RSPrefs.theming.arrow.size || 40) + (RSPrefs.theming.arrow.offset || 0)));
|
|
3989
3971
|
const isFXL = useAppSelector((state) => state.publication.isFXL);
|
|
3972
|
+
const positionsList = useAppSelector((state) => state.publication.positionsList);
|
|
3990
3973
|
const tocTree = useAppSelector((state) => state.publication.tocTree);
|
|
3991
3974
|
const tocEntry = useAppSelector((state) => state.publication.tocEntry);
|
|
3992
3975
|
const textAlign = useAppSelector((state) => state.settings.textAlign);
|
|
@@ -4013,6 +3996,7 @@ var StatefulReader = ({
|
|
|
4013
3996
|
const breakpoint = useAppSelector((state) => state.theming.breakpoint);
|
|
4014
3997
|
const arrowsOccupySpace = breakpoint && (breakpoint === "large" /* large */ || breakpoint === "xLarge" /* xLarge */);
|
|
4015
3998
|
const isImmersive = useAppSelector((state) => state.reader.isImmersive);
|
|
3999
|
+
const isHovering = useAppSelector((state) => state.reader.isHovering);
|
|
4016
4000
|
const cache = useRef({
|
|
4017
4001
|
isImmersive,
|
|
4018
4002
|
arrowsOccupySpace: arrowsOccupySpace || false,
|
|
@@ -4036,6 +4020,7 @@ var StatefulReader = ({
|
|
|
4036
4020
|
wordSpacing
|
|
4037
4021
|
},
|
|
4038
4022
|
tocTree,
|
|
4023
|
+
positionsList: positionsList || [],
|
|
4039
4024
|
colorScheme,
|
|
4040
4025
|
reducedMotion
|
|
4041
4026
|
});
|
|
@@ -4097,41 +4082,60 @@ var StatefulReader = ({
|
|
|
4097
4082
|
totalProgression: locator.locations.totalProgression
|
|
4098
4083
|
}));
|
|
4099
4084
|
}, [dispatch, currentPositions]);
|
|
4100
|
-
const
|
|
4101
|
-
if (
|
|
4102
|
-
const cLoc = currentLocator();
|
|
4103
|
-
if (cLoc) handleProgression(cLoc);
|
|
4104
|
-
} else {
|
|
4105
|
-
handleScrollAffordances(cache.current.settings.scroll);
|
|
4106
|
-
}
|
|
4107
|
-
};
|
|
4108
|
-
const handleTocEntryOnNav = useCallback((link) => {
|
|
4109
|
-
if (!link) return;
|
|
4085
|
+
const handleTocEntryOnNav = useCallback((locator) => {
|
|
4086
|
+
if (!locator) return;
|
|
4110
4087
|
if (cache.current.tocTree) {
|
|
4111
|
-
const findMatch = (items) => {
|
|
4088
|
+
const findMatch = (items, link) => {
|
|
4112
4089
|
for (const item of items) {
|
|
4113
|
-
if (item.href === link
|
|
4090
|
+
if (item.href === link?.href) {
|
|
4114
4091
|
return item;
|
|
4115
4092
|
}
|
|
4116
4093
|
if (item.children) {
|
|
4117
|
-
const
|
|
4118
|
-
if (
|
|
4119
|
-
return
|
|
4094
|
+
const match = findMatch(item.children, link);
|
|
4095
|
+
if (match) {
|
|
4096
|
+
return match;
|
|
4120
4097
|
}
|
|
4121
4098
|
}
|
|
4122
4099
|
}
|
|
4123
4100
|
return void 0;
|
|
4124
4101
|
};
|
|
4125
|
-
const
|
|
4126
|
-
if (
|
|
4102
|
+
const currentMatch = findMatch(cache.current.tocTree, new Link(locator));
|
|
4103
|
+
if (currentMatch) {
|
|
4104
|
+
dispatch(setTocEntry(currentMatch.id));
|
|
4105
|
+
return;
|
|
4106
|
+
}
|
|
4107
|
+
if (navLayout() === EPUBLayout.fixed) {
|
|
4108
|
+
const positions = currentPositions();
|
|
4109
|
+
if (positions && positions.length === 2) {
|
|
4110
|
+
const otherPosition = positions[0] === locator.locations.position ? positions[1] : positions[0];
|
|
4111
|
+
const otherPositionInList = cache.current.positionsList.find((pos) => pos.locations.position === otherPosition);
|
|
4112
|
+
if (otherPositionInList) {
|
|
4113
|
+
const match = findMatch(cache.current.tocTree, new Link(otherPositionInList));
|
|
4114
|
+
if (match) {
|
|
4115
|
+
dispatch(setTocEntry(match.id));
|
|
4116
|
+
return;
|
|
4117
|
+
}
|
|
4118
|
+
}
|
|
4119
|
+
}
|
|
4120
|
+
}
|
|
4127
4121
|
}
|
|
4128
|
-
}, [dispatch]);
|
|
4122
|
+
}, [dispatch, currentPositions, navLayout]);
|
|
4129
4123
|
const handleFXLProgression = useCallback((locator) => {
|
|
4130
4124
|
handleProgression(locator);
|
|
4131
|
-
handleTocEntryOnNav(
|
|
4125
|
+
handleTocEntryOnNav(locator);
|
|
4132
4126
|
localData.set(localDataKey.current, locator);
|
|
4133
4127
|
}, [handleProgression, handleTocEntryOnNav]);
|
|
4134
4128
|
onFXLPositionChange(handleFXLProgression);
|
|
4129
|
+
const initReadingEnv = async () => {
|
|
4130
|
+
if (navLayout() === EPUBLayout.fixed) {
|
|
4131
|
+
const cLoc = currentLocator();
|
|
4132
|
+
if (cLoc) {
|
|
4133
|
+
handleFXLProgression(cLoc);
|
|
4134
|
+
}
|
|
4135
|
+
} else {
|
|
4136
|
+
handleScrollAffordances(cache.current.settings.scroll);
|
|
4137
|
+
}
|
|
4138
|
+
};
|
|
4135
4139
|
const p = new Peripherals(useAppStore(), RSPrefs.actions, {
|
|
4136
4140
|
moveTo: (direction) => {
|
|
4137
4141
|
switch (direction) {
|
|
@@ -4186,7 +4190,7 @@ var StatefulReader = ({
|
|
|
4186
4190
|
positionChanged: async function(locator) {
|
|
4187
4191
|
const currentLocator2 = localData.get(localDataKey.current);
|
|
4188
4192
|
if (currentLocator2?.href !== locator.href) {
|
|
4189
|
-
handleTocEntryOnNav(
|
|
4193
|
+
handleTocEntryOnNav(locator);
|
|
4190
4194
|
}
|
|
4191
4195
|
if (navLayout() === EPUBLayout.reflowable) {
|
|
4192
4196
|
const debouncedHandleProgression = (0, import_debounce.default)(
|
|
@@ -4207,6 +4211,7 @@ var StatefulReader = ({
|
|
|
4207
4211
|
return true;
|
|
4208
4212
|
},
|
|
4209
4213
|
click: function(_e) {
|
|
4214
|
+
navLayout() === EPUBLayout.fixed && handleTap(_e);
|
|
4210
4215
|
return true;
|
|
4211
4216
|
},
|
|
4212
4217
|
zoom: function(_scale) {
|
|
@@ -4298,16 +4303,19 @@ var StatefulReader = ({
|
|
|
4298
4303
|
useEffect(() => {
|
|
4299
4304
|
cache.current.settings.wordSpacing = wordSpacing;
|
|
4300
4305
|
}, [wordSpacing]);
|
|
4306
|
+
useEffect(() => {
|
|
4307
|
+
cache.current.positionsList = positionsList || [];
|
|
4308
|
+
}, [positionsList]);
|
|
4301
4309
|
useEffect(() => {
|
|
4302
4310
|
cache.current.tocTree = tocTree;
|
|
4303
4311
|
if (tocEntry) return;
|
|
4304
4312
|
const knownPosition = localData.get(localDataKey.current);
|
|
4305
4313
|
if (knownPosition) {
|
|
4306
|
-
handleTocEntryOnNav(
|
|
4314
|
+
handleTocEntryOnNav(knownPosition);
|
|
4307
4315
|
} else {
|
|
4308
4316
|
const initialTocEntry = tocTree?.[0];
|
|
4309
4317
|
if (initialTocEntry) {
|
|
4310
|
-
handleTocEntryOnNav(new
|
|
4318
|
+
handleTocEntryOnNav(new Locator({ href: initialTocEntry.href, type: "" }));
|
|
4311
4319
|
}
|
|
4312
4320
|
}
|
|
4313
4321
|
}, [tocTree, tocEntry, handleTocEntryOnNav]);
|
|
@@ -4359,13 +4367,13 @@ var StatefulReader = ({
|
|
|
4359
4367
|
const pubTitle = publication.current.metadata.title.getTranslation("en");
|
|
4360
4368
|
dispatch(setRunningHead(pubTitle));
|
|
4361
4369
|
dispatch(setProgression({ currentPublication: pubTitle }));
|
|
4362
|
-
let
|
|
4370
|
+
let positionsList2;
|
|
4363
4371
|
const fetchPositions = async () => {
|
|
4364
|
-
|
|
4365
|
-
if (
|
|
4366
|
-
dispatch(setProgression({ totalPositions:
|
|
4372
|
+
positionsList2 = await publication.current?.positionsFromManifest();
|
|
4373
|
+
if (positionsList2 && positionsList2.length > 0) {
|
|
4374
|
+
dispatch(setProgression({ totalPositions: positionsList2.length }));
|
|
4367
4375
|
}
|
|
4368
|
-
const deserializedPositionsList = deserializePositions(
|
|
4376
|
+
const deserializedPositionsList = deserializePositions(positionsList2);
|
|
4369
4377
|
dispatch(setPositionsList(deserializedPositionsList));
|
|
4370
4378
|
};
|
|
4371
4379
|
fetchPositions().catch(console.error).then(() => {
|
|
@@ -4373,7 +4381,7 @@ var StatefulReader = ({
|
|
|
4373
4381
|
const initialPosition = localData.get(localDataKey.current);
|
|
4374
4382
|
let idCounter = 0;
|
|
4375
4383
|
const idGenerator = () => `toc-${++idCounter}`;
|
|
4376
|
-
const tocTree2 = createTocTree(publication.current?.tableOfContents?.items || [], idGenerator,
|
|
4384
|
+
const tocTree2 = createTocTree(publication.current?.tableOfContents?.items || [], idGenerator, positionsList2);
|
|
4377
4385
|
dispatch(setTocTree(tocTree2));
|
|
4378
4386
|
const initialConstraint = cache.current.arrowsOccupySpace ? arrowsWidth.current : 0;
|
|
4379
4387
|
const themeKeys = isFXL2 ? fxlThemeKeys : reflowThemeKeys;
|
|
@@ -4400,7 +4408,9 @@ var StatefulReader = ({
|
|
|
4400
4408
|
layoutStrategy: cache.current.settings.layoutStrategy,
|
|
4401
4409
|
letterSpacing: cache.current.settings.publisherStyles ? void 0 : cache.current.settings.letterSpacing,
|
|
4402
4410
|
lineHeight: cache.current.settings.publisherStyles ? void 0 : cache.current.settings.lineHeight === null ? null : lineHeightOptions[cache.current.settings.lineHeight],
|
|
4403
|
-
|
|
4411
|
+
optimalLineLength: cache.current.settings.lineLength?.optimal,
|
|
4412
|
+
maximalLineLength: cache.current.settings.lineLength?.max?.isDisabled ? null : cache.current.settings.lineLength?.max?.chars,
|
|
4413
|
+
minimalLineLength: cache.current.settings.lineLength?.min?.isDisabled ? null : cache.current.settings.lineLength?.min?.chars,
|
|
4404
4414
|
paragraphIndent: cache.current.settings.publisherStyles ? void 0 : cache.current.settings.paragraphIndent,
|
|
4405
4415
|
paragraphSpacing: cache.current.settings.publisherStyles ? void 0 : cache.current.settings.paragraphSpacing,
|
|
4406
4416
|
scroll: cache.current.settings.scroll,
|
|
@@ -4420,7 +4430,7 @@ var StatefulReader = ({
|
|
|
4420
4430
|
container: container.current,
|
|
4421
4431
|
publication: publication.current,
|
|
4422
4432
|
listeners,
|
|
4423
|
-
positionsList,
|
|
4433
|
+
positionsList: positionsList2,
|
|
4424
4434
|
initialPosition,
|
|
4425
4435
|
preferences,
|
|
4426
4436
|
defaults,
|
|
@@ -4439,29 +4449,40 @@ var StatefulReader = ({
|
|
|
4439
4449
|
EpubNavigatorDestroy(() => p.destroy());
|
|
4440
4450
|
};
|
|
4441
4451
|
}, [rawManifest, selfHref, RSPrefs, fxlThemeKeys, reflowThemeKeys]);
|
|
4442
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(I18nProvider, { locale: RSPrefs.locale, children: /* @__PURE__ */ jsx(ThPluginProvider, { children: /* @__PURE__ */ jsx("main", { children: /* @__PURE__ */ jsx(StatefulDockingWrapper, { children: /* @__PURE__ */ jsxs(
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4452
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(I18nProvider, { locale: RSPrefs.locale, children: /* @__PURE__ */ jsx(ThPluginProvider, { children: /* @__PURE__ */ jsx("main", { children: /* @__PURE__ */ jsx(StatefulDockingWrapper, { children: /* @__PURE__ */ jsxs(
|
|
4453
|
+
"div",
|
|
4454
|
+
{
|
|
4455
|
+
id: "reader-main",
|
|
4456
|
+
className: classNames9(
|
|
4457
|
+
isFXL ? "isFXL" : "isReflow",
|
|
4458
|
+
isImmersive ? "isImmersive" : "",
|
|
4459
|
+
isHovering ? "isHovering" : ""
|
|
4460
|
+
),
|
|
4461
|
+
children: [
|
|
4462
|
+
/* @__PURE__ */ jsx(StatefulReaderHeader, {}),
|
|
4463
|
+
isPaged ? /* @__PURE__ */ jsx("nav", { className: arrowStyles2.container, id: arrowStyles2.left, children: /* @__PURE__ */ jsx(
|
|
4464
|
+
StatefulReaderArrowButton,
|
|
4465
|
+
{
|
|
4466
|
+
direction: "left",
|
|
4467
|
+
occupySpace: arrowsOccupySpace || false,
|
|
4468
|
+
isDisabled: atPublicationStart,
|
|
4469
|
+
onPress: () => goLeft(!reducedMotion, activateImmersiveOnAction)
|
|
4470
|
+
}
|
|
4471
|
+
) }) : /* @__PURE__ */ jsx(Fragment, {}),
|
|
4472
|
+
/* @__PURE__ */ jsx("article", { id: "wrapper", "aria-label": en_default.reader.app.publicationWrapper, children: /* @__PURE__ */ jsx("div", { id: "container", ref: container }) }),
|
|
4473
|
+
isPaged ? /* @__PURE__ */ jsx("nav", { className: arrowStyles2.container, id: arrowStyles2.right, children: /* @__PURE__ */ jsx(
|
|
4474
|
+
StatefulReaderArrowButton,
|
|
4475
|
+
{
|
|
4476
|
+
direction: "right",
|
|
4477
|
+
occupySpace: arrowsOccupySpace || false,
|
|
4478
|
+
isDisabled: atPublicationEnd,
|
|
4479
|
+
onPress: () => goRight(!reducedMotion, activateImmersiveOnAction)
|
|
4480
|
+
}
|
|
4481
|
+
) }) : /* @__PURE__ */ jsx(Fragment, {}),
|
|
4482
|
+
isPaged ? /* @__PURE__ */ jsx(StatefulReaderFooter, {}) : /* @__PURE__ */ jsx(Fragment, {})
|
|
4483
|
+
]
|
|
4484
|
+
}
|
|
4485
|
+
) }) }) }) }) });
|
|
4465
4486
|
};
|
|
4466
4487
|
var BookUrlConverter = () => {
|
|
4467
4488
|
const [bookUrl, setBookUrl] = useState("");
|