@edrlab/thorium-web 1.5.0 → 1.5.1
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/{chunk-GRYEOCGD.mjs → chunk-2B3HE57E.mjs} +36 -49
- package/dist/chunk-2B3HE57E.mjs.map +1 -0
- package/dist/{chunk-BBCSLDQT.mjs → chunk-3ITHCTDL.mjs} +61 -66
- package/dist/chunk-3ITHCTDL.mjs.map +1 -0
- package/dist/{chunk-PRQBFBJ7.mjs → chunk-3VB756GR.mjs} +19 -8
- package/dist/chunk-3VB756GR.mjs.map +1 -0
- package/dist/{chunk-ZD4LTF6G.mjs → chunk-AXX4U2FW.mjs} +25 -133
- package/dist/chunk-AXX4U2FW.mjs.map +1 -0
- package/dist/{chunk-2T65MDBR.mjs → chunk-CCHCCVSF.mjs} +3 -3
- package/dist/{chunk-2T65MDBR.mjs.map → chunk-CCHCCVSF.mjs.map} +1 -1
- package/dist/{chunk-63LKYJFG.mjs → chunk-J6XDICU2.mjs} +45 -15
- package/dist/chunk-J6XDICU2.mjs.map +1 -0
- package/dist/chunk-KQ3KS5O5.mjs +37 -0
- package/dist/chunk-KQ3KS5O5.mjs.map +1 -0
- package/dist/{chunk-DQDOOTCE.mjs → chunk-KT2QY5QU.mjs} +3 -3
- package/dist/{chunk-DQDOOTCE.mjs.map → chunk-KT2QY5QU.mjs.map} +1 -1
- package/dist/{chunk-Y5X74VW7.mjs → chunk-KXOIN35D.mjs} +9 -9
- package/dist/{chunk-Y5X74VW7.mjs.map → chunk-KXOIN35D.mjs.map} +1 -1
- package/dist/{chunk-BCXKBHU3.mjs → chunk-MTH2RF6V.mjs} +30 -15
- package/dist/chunk-MTH2RF6V.mjs.map +1 -0
- package/dist/{chunk-KJ55Q63A.mjs → chunk-THOJRBVD.mjs} +208 -59
- package/dist/chunk-THOJRBVD.mjs.map +1 -0
- package/dist/{chunk-VENFFPK2.mjs → chunk-VYSDLACR.mjs} +2 -2
- package/dist/{chunk-VENFFPK2.mjs.map → chunk-VYSDLACR.mjs.map} +1 -1
- package/dist/{chunk-KOR74F6M.mjs → chunk-X63WSMOH.mjs} +4 -36
- package/dist/chunk-X63WSMOH.mjs.map +1 -0
- package/dist/{chunk-PAFJZH7O.mjs → chunk-YE5QOQUT.mjs} +3 -3
- package/dist/{chunk-PAFJZH7O.mjs.map → chunk-YE5QOQUT.mjs.map} +1 -1
- package/dist/components/Audio/index.d.mts +3 -3
- package/dist/components/Audio/index.mjs +13 -12
- package/dist/components/Epub/index.d.mts +3 -3
- package/dist/components/Epub/index.mjs +14 -13
- package/dist/components/Misc/index.mjs +4 -4
- package/dist/components/Reader/index.d.mts +2 -2
- package/dist/components/Reader/index.mjs +20 -19
- package/dist/components/Reader/index.mjs.map +1 -1
- package/dist/components/WebPub/index.d.mts +3 -3
- package/dist/components/WebPub/index.mjs +14 -13
- package/dist/core/Components/index.d.mts +4 -20
- package/dist/core/Components/index.mjs +1 -1
- package/dist/core/Helpers/index.mjs +3 -2
- package/dist/core/Hooks/index.d.mts +10 -4
- package/dist/core/Hooks/index.mjs +2 -1
- package/dist/i18n/index.mjs +2 -2
- package/dist/lib/index.mjs +3 -2
- package/dist/locales/da/thorium-shared.json +217 -10
- package/dist/locales/he/thorium-shared.json +8 -0
- package/dist/locales/it/thorium-shared.json +2 -2
- package/dist/locales/it/thorium-web.json +3 -3
- package/dist/locales/lt/thorium-shared.json +85 -1
- package/dist/locales/sv/thorium-shared.json +5 -5
- package/dist/preferences/index.d.mts +2 -0
- package/dist/preferences/index.mjs +4 -3
- package/dist/{useAudioNavigator-pGwxhXLj.d.mts → useAudioNavigator-9RuOpLGB.d.mts} +4 -4
- package/dist/{useReaderTransitions-Zvomj9RQ.d.mts → useReaderTransitions-CpgrXS5g.d.mts} +25 -6
- package/package.json +5 -5
- package/dist/chunk-63LKYJFG.mjs.map +0 -1
- package/dist/chunk-BBCSLDQT.mjs.map +0 -1
- package/dist/chunk-BCXKBHU3.mjs.map +0 -1
- package/dist/chunk-GRYEOCGD.mjs.map +0 -1
- package/dist/chunk-KJ55Q63A.mjs.map +0 -1
- package/dist/chunk-KOR74F6M.mjs.map +0 -1
- package/dist/chunk-PRQBFBJ7.mjs.map +0 -1
- package/dist/chunk-ZD4LTF6G.mjs.map +0 -1
|
@@ -1,25 +1,136 @@
|
|
|
1
|
-
import { makeBreakpointsMap, isKeyboardTriggered, isActiveElement } from './chunk-
|
|
2
|
-
import { useFullscreen, useLocalStorage, useEpubNavigator } from './chunk-
|
|
3
|
-
import {
|
|
1
|
+
import { makeBreakpointsMap, isKeyboardTriggered, isActiveElement } from './chunk-VYSDLACR.mjs';
|
|
2
|
+
import { useFullscreen, useLocalStorage, useEpubNavigator } from './chunk-2B3HE57E.mjs';
|
|
3
|
+
import { ErrorHandler } from './chunk-RRDEPGBK.mjs';
|
|
4
|
+
import { useI18n } from './chunk-2NCN2AG2.mjs';
|
|
5
|
+
import { setFullscreen, setReaderProfile, setPositionsList, setTocTree, setScriptMode, setRTL, setFXL, setHasDisplayTransformability, setActionOpen, dockAction, setHovering, setSettingsContainer, debounce, setColumnCount, initialWebPubSettingsState, initialSettingsState, setWebPubFontFamily, setFontFamily, setWebPubFontWeight, setFontWeight, setWebPubHyphens, setHyphens, setScroll, setWebPubLetterSpacing, setLetterSpacing, setWebPubLineHeight, setLineHeight, setWebPubParagraphIndent, setParagraphIndent, setWebPubParagraphSpacing, setParagraphSpacing, setWebPubWordSpacing, setWordSpacing, setWebPubSpacingPreset, setWebPubPublisherStyles, setSpacingPreset, setPublisherStyles, setWebPubTextAlign, setTextAlign, setWebPubTextNormalization, setTextNormalization, setWebPubLigatures, setLigatures, setWebPubNoRuby, setNoRuby, setTheme, setWebPubZoom, setFontSize, setSkipBackwardInterval, setSkipForwardInterval, setSkipInterval, setAutoPlay, toggleActionOpen, setVolume, setPlaybackRate, setSleepTimerRemainingSeconds, setSleepTimerOnTrackEnd, setSleepTimerOnFragmentEnd, setRemotePlaybackState, ThReduxPreferencesAdapter, ThReduxGlobalPreferencesAdapter, setImmersive, setOverflow, setUserNavigated, setTocEntry, collapseDockPanel, expandDockPanel, activateDockPanel, deactivateDockPanel, setDockPanelWidth } from './chunk-YE5QOQUT.mjs';
|
|
4
6
|
import { buildTocTree, findTocItemById } from './chunk-TEZB4ULX.mjs';
|
|
5
|
-
import { useSharedPreferences, useActionsPreferences, prefixString, ThDockingTypes, ThSheetTypes, useAudioPreferences, usePreferences, useFilteredPreferenceKeys, defaultSpacingSettingsSubpanel, defaultSpacingSettingsMain, defaultTextSettingsSubpanel, defaultTextSettingsMain, ThTextSettingsKeys, ThSpacingSettingsKeys, buildThemeObject, defaultAudioSkipBackwardInterval, defaultAudioSkipForwardInterval, defaultAudioSkipInterval, defaultPreferences, ThPreferencesProvider, ThGlobalPreferencesProvider } from './chunk-
|
|
7
|
+
import { useSharedPreferences, useActionsPreferences, prefixString, ThDockingTypes, ThSheetTypes, useAudioPreferences, usePreferences, useFilteredPreferenceKeys, defaultSpacingSettingsSubpanel, defaultSpacingSettingsMain, defaultTextSettingsSubpanel, defaultTextSettingsMain, ThTextSettingsKeys, ThSpacingSettingsKeys, buildThemeObject, defaultAudioSkipBackwardInterval, defaultAudioSkipForwardInterval, defaultAudioSkipInterval, defaultPreferences, ThPreferencesProvider, ThGlobalPreferencesProvider } from './chunk-3VB756GR.mjs';
|
|
6
8
|
import { useAppDispatch, useAppSelector } from './chunk-A575ZW4A.mjs';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { ThMenuItem, ThActionButton, ThMenu, ThCollapsibleActionsBar, ThPopover, ThContainerHeader, ThNavigationButton, ThContainerBody, ThModal, ThBottomSheet, ThCloseButton, ThDockedPanel, useFirstFocusable, ThTypedComponentRenderer, useActions,
|
|
9
|
+
import { metaKeys } from './chunk-X63WSMOH.mjs';
|
|
10
|
+
import { isIOSish } from './chunk-KQ3KS5O5.mjs';
|
|
11
|
+
import { ThMenuItem, ThActionButton, ThMenu, ThCollapsibleActionsBar, ThPopover, ThContainerHeader, ThNavigationButton, ThContainerBody, ThModal, ThBottomSheet, ThCloseButton, ThDockedPanel, useFirstFocusable, ThTypedComponentRenderer, useActions, ThForm, ThFormNumberField, ThSettingsWrapper, ThRadioGroup, ThDropdown, ThSwitch, ThNumberField, ThSlider, ThSliderWithPresets, ThLink, ThLibrary, ThHome, ThBackArrow, ThFormSearchField } from './chunk-AXX4U2FW.mjs';
|
|
10
12
|
import { usePrevious } from './chunk-YZ73DHRU.mjs';
|
|
11
|
-
import {
|
|
12
|
-
import { Text, Popover, Dialog, ListBox, ListBoxItem, Radio, Button, Keyboard, Toolbar, useFilter, Tree, TreeItem, TreeItemContent, Collection } from 'react-aria-components';
|
|
13
|
+
import React23, { createContext, useContext, useState, useEffect, useMemo, useCallback, useRef } from 'react';
|
|
13
14
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
15
|
+
import { Text, Popover, Dialog, ListBox, ListBoxItem, Radio, Button, Keyboard, Toolbar, useFilter, Tree, TreeItem, TreeItemContent, Collection } from 'react-aria-components';
|
|
14
16
|
import { useObjectRef, useNumberFormatter, FocusScope, useLocale, useFocusWithin } from 'react-aria';
|
|
15
17
|
import classNames4 from 'classnames';
|
|
16
|
-
import React22, { createContext, useCallback, useRef, useMemo, useContext, useState, useEffect } from 'react';
|
|
17
18
|
import { Link, HttpFetcher, Manifest, Publication, ReadingProgression, Layout, Feature, Profile } from '@readium/shared';
|
|
18
19
|
import { getScriptMode, lineHeightRangeConfig, TextAlignment } from '@readium/navigator';
|
|
19
20
|
import i18nData from '@readium/css/css/vars/i18n.json';
|
|
20
21
|
import { useStore } from 'react-redux';
|
|
21
22
|
import { PanelGroup, Panel, PanelResizeHandle } from 'react-resizable-panels';
|
|
22
23
|
|
|
24
|
+
// src/components/Plugins/PluginRegistry.ts
|
|
25
|
+
var pluginsStore = [];
|
|
26
|
+
var PluginRegistryClass = class {
|
|
27
|
+
register(plugin) {
|
|
28
|
+
const existingPluginIndex = pluginsStore.findIndex((p) => p.id === plugin.id);
|
|
29
|
+
if (existingPluginIndex >= 0) {
|
|
30
|
+
pluginsStore[existingPluginIndex] = plugin;
|
|
31
|
+
} else {
|
|
32
|
+
pluginsStore.push(plugin);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
unregister(pluginId) {
|
|
36
|
+
const filteredPlugins = pluginsStore.filter((plugin) => plugin.id !== pluginId);
|
|
37
|
+
pluginsStore.length = 0;
|
|
38
|
+
pluginsStore.push(...filteredPlugins);
|
|
39
|
+
}
|
|
40
|
+
getPlugins() {
|
|
41
|
+
return [...pluginsStore];
|
|
42
|
+
}
|
|
43
|
+
getComponentMaps() {
|
|
44
|
+
const actionsComponentsMap = {};
|
|
45
|
+
const settingsComponentsMap = {};
|
|
46
|
+
const primaryAudioActionsMap = {};
|
|
47
|
+
[...pluginsStore].reverse().forEach((plugin) => {
|
|
48
|
+
if (plugin.components.actions) {
|
|
49
|
+
Object.entries(plugin.components.actions).forEach(([key, component]) => {
|
|
50
|
+
actionsComponentsMap[key] = component;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (plugin.components.settings) {
|
|
54
|
+
Object.entries(plugin.components.settings).forEach(([key, component]) => {
|
|
55
|
+
settingsComponentsMap[key] = component;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (plugin.components.primaryAudioActions) {
|
|
59
|
+
Object.entries(plugin.components.primaryAudioActions).forEach(([key, component]) => {
|
|
60
|
+
primaryAudioActionsMap[key] = component;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
actionsComponentsMap,
|
|
66
|
+
settingsComponentsMap,
|
|
67
|
+
primaryAudioActionsMap
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var ThPluginRegistry = new PluginRegistryClass();
|
|
72
|
+
var ThPluginContext = createContext({
|
|
73
|
+
actionsComponentsMap: {},
|
|
74
|
+
settingsComponentsMap: {},
|
|
75
|
+
textSettingsComponentsMap: {},
|
|
76
|
+
spacingSettingsComponentsMap: {},
|
|
77
|
+
primaryAudioActionsMap: {},
|
|
78
|
+
registerPlugin: ThPluginRegistry.register.bind(ThPluginRegistry),
|
|
79
|
+
unregisterPlugin: ThPluginRegistry.unregister.bind(ThPluginRegistry)
|
|
80
|
+
});
|
|
81
|
+
var usePlugins = () => useContext(ThPluginContext);
|
|
82
|
+
var ThPluginProvider = ({ children }) => {
|
|
83
|
+
const [componentMaps, setComponentMaps] = useState(() => {
|
|
84
|
+
const maps = ThPluginRegistry.getComponentMaps();
|
|
85
|
+
return {
|
|
86
|
+
...maps,
|
|
87
|
+
textSettingsComponentsMap: getTypedSettingsComponents(maps.settingsComponentsMap, "text"),
|
|
88
|
+
spacingSettingsComponentsMap: getTypedSettingsComponents(maps.settingsComponentsMap, "spacing")
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
function getTypedSettingsComponents(componentsMap, type) {
|
|
92
|
+
return Object.entries(componentsMap).filter(([_, component]) => component.type === type).reduce((acc, [key, component]) => {
|
|
93
|
+
acc[key] = component;
|
|
94
|
+
return acc;
|
|
95
|
+
}, {});
|
|
96
|
+
}
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
const updateComponentMaps = () => {
|
|
99
|
+
const maps = ThPluginRegistry.getComponentMaps();
|
|
100
|
+
setComponentMaps({
|
|
101
|
+
...maps,
|
|
102
|
+
textSettingsComponentsMap: getTypedSettingsComponents(maps.settingsComponentsMap, "text"),
|
|
103
|
+
spacingSettingsComponentsMap: getTypedSettingsComponents(maps.settingsComponentsMap, "spacing")
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
updateComponentMaps();
|
|
107
|
+
}, []);
|
|
108
|
+
const registerPlugin = (plugin) => {
|
|
109
|
+
ThPluginRegistry.register(plugin);
|
|
110
|
+
};
|
|
111
|
+
const unregisterPlugin = (pluginId) => {
|
|
112
|
+
ThPluginRegistry.unregister(pluginId);
|
|
113
|
+
};
|
|
114
|
+
const value = {
|
|
115
|
+
...componentMaps,
|
|
116
|
+
registerPlugin,
|
|
117
|
+
unregisterPlugin
|
|
118
|
+
};
|
|
119
|
+
return /* @__PURE__ */ jsx(ThPluginContext.Provider, { value, children });
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// src/components/Actions/hooks/useActionComponentStatus.ts
|
|
123
|
+
var useActionComponentStatus = (options) => {
|
|
124
|
+
const { actionKey, orderArray, additionalCondition } = options;
|
|
125
|
+
const { actionsComponentsMap, primaryAudioActionsMap } = usePlugins();
|
|
126
|
+
return useMemo(() => {
|
|
127
|
+
const isComponentRegistered = !!actionsComponentsMap?.[actionKey] || !!primaryAudioActionsMap?.[actionKey];
|
|
128
|
+
const isInOrder = orderArray ? orderArray.includes(actionKey) : true;
|
|
129
|
+
const isComponentAvailable = isComponentRegistered && isInOrder && (additionalCondition ?? true);
|
|
130
|
+
return { isComponentRegistered, isInOrder, isComponentAvailable };
|
|
131
|
+
}, [actionKey, orderArray, additionalCondition, actionsComponentsMap, primaryAudioActionsMap]);
|
|
132
|
+
};
|
|
133
|
+
|
|
23
134
|
// src/components/Actions/assets/styles/thorium-web.overflow.module.css
|
|
24
135
|
var thorium_web_overflow_default = {
|
|
25
136
|
hint: "thorium_web_overflow_hint",
|
|
@@ -208,7 +319,7 @@ var StatefulFullscreenTrigger = ({ variant }) => {
|
|
|
208
319
|
fs.handleFullscreen();
|
|
209
320
|
dispatch(setHovering(false));
|
|
210
321
|
};
|
|
211
|
-
if (!
|
|
322
|
+
if (!fs.isSupported) return null;
|
|
212
323
|
return /* @__PURE__ */ jsx(Fragment, { children: variant && variant === "menuItem" /* menu */ ? /* @__PURE__ */ jsx(
|
|
213
324
|
StatefulOverflowMenuItem,
|
|
214
325
|
{
|
|
@@ -226,6 +337,7 @@ var StatefulFullscreenTrigger = ({ variant }) => {
|
|
|
226
337
|
"aria-label": label,
|
|
227
338
|
placement: "bottom",
|
|
228
339
|
tooltipLabel: t("reader.fullscreen.tooltip"),
|
|
340
|
+
shortcut: preferences.actionsKeys["fullscreen" /* fullscreen */].shortcut,
|
|
229
341
|
onPress: handlePress,
|
|
230
342
|
children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true", focusable: "false" })
|
|
231
343
|
}
|
|
@@ -978,10 +1090,11 @@ var StatefulPopoverSheet = ({
|
|
|
978
1090
|
}
|
|
979
1091
|
}, [isOpen]);
|
|
980
1092
|
useWebkitPatch(!!isOpen);
|
|
981
|
-
if (
|
|
1093
|
+
if (React23.Children.toArray(children).length > 0) {
|
|
982
1094
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
983
1095
|
ThPopover,
|
|
984
1096
|
{
|
|
1097
|
+
id,
|
|
985
1098
|
ref: popoverRef,
|
|
986
1099
|
triggerRef,
|
|
987
1100
|
focusOptions: {
|
|
@@ -1087,10 +1200,11 @@ var StatefulModalBase = ({
|
|
|
1087
1200
|
}
|
|
1088
1201
|
}, [isOpen]);
|
|
1089
1202
|
useWebkitPatch(!!isOpen);
|
|
1090
|
-
if (
|
|
1203
|
+
if (React23.Children.toArray(children).length > 0) {
|
|
1091
1204
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
1092
1205
|
ThModal,
|
|
1093
1206
|
{
|
|
1207
|
+
id,
|
|
1094
1208
|
ref: sheetRef,
|
|
1095
1209
|
focusOptions: {
|
|
1096
1210
|
withinRef: focusWithinRef ?? sheetBodyRef,
|
|
@@ -1346,7 +1460,7 @@ var StatefulBottomSheet = ({
|
|
|
1346
1460
|
return "default";
|
|
1347
1461
|
}
|
|
1348
1462
|
};
|
|
1349
|
-
if (
|
|
1463
|
+
if (React23.Children.toArray(children).length > 0) {
|
|
1350
1464
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
1351
1465
|
ThBottomSheet,
|
|
1352
1466
|
{
|
|
@@ -1384,6 +1498,7 @@ var StatefulBottomSheet = ({
|
|
|
1384
1498
|
prefersReducedMotion,
|
|
1385
1499
|
compounds: {
|
|
1386
1500
|
container: {
|
|
1501
|
+
id,
|
|
1387
1502
|
className: classNames4(thorium_web_sheets_default.draggable, detentClassName),
|
|
1388
1503
|
ref: sheetContainerRef,
|
|
1389
1504
|
style: {
|
|
@@ -1497,10 +1612,11 @@ var StatefulDockedSheet = ({
|
|
|
1497
1612
|
return direction === "ltr" /* ltr */ ? thorium_web_sheets_default.dockedRightBorder : thorium_web_sheets_default.dockedLeftBorder;
|
|
1498
1613
|
}
|
|
1499
1614
|
}, [flow, direction]);
|
|
1500
|
-
if (
|
|
1615
|
+
if (React23.Children.toArray(children).length > 0) {
|
|
1501
1616
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
1502
1617
|
ThDockedPanel,
|
|
1503
1618
|
{
|
|
1619
|
+
id,
|
|
1504
1620
|
ref: dockedSheetRef,
|
|
1505
1621
|
isOpen,
|
|
1506
1622
|
portal: dockPortal,
|
|
@@ -1567,6 +1683,7 @@ var StatefulDockedSheet = ({
|
|
|
1567
1683
|
}
|
|
1568
1684
|
};
|
|
1569
1685
|
var StatefulCompactPopoverSheet = ({
|
|
1686
|
+
id,
|
|
1570
1687
|
triggerRef,
|
|
1571
1688
|
heading,
|
|
1572
1689
|
className,
|
|
@@ -1596,7 +1713,7 @@ var StatefulCompactPopoverSheet = ({
|
|
|
1596
1713
|
updateState: resetFocus
|
|
1597
1714
|
});
|
|
1598
1715
|
useWebkitPatch(!!isOpen);
|
|
1599
|
-
if (
|
|
1716
|
+
if (React23.Children.toArray(children).length > 0) {
|
|
1600
1717
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1601
1718
|
Popover,
|
|
1602
1719
|
{
|
|
@@ -1610,6 +1727,7 @@ var StatefulCompactPopoverSheet = ({
|
|
|
1610
1727
|
children: /* @__PURE__ */ jsx(
|
|
1611
1728
|
Dialog,
|
|
1612
1729
|
{
|
|
1730
|
+
id,
|
|
1613
1731
|
"aria-label": heading,
|
|
1614
1732
|
className: thorium_web_sheets_default.dialog,
|
|
1615
1733
|
children: /* @__PURE__ */ jsx(
|
|
@@ -2821,7 +2939,7 @@ var useGridNavigation = ({
|
|
|
2821
2939
|
onFocus
|
|
2822
2940
|
}) => {
|
|
2823
2941
|
const visibleColumns = useGridTemplate(containerRef, "columns");
|
|
2824
|
-
const onKeyDown =
|
|
2942
|
+
const onKeyDown = React23.useCallback((e) => {
|
|
2825
2943
|
const columns = visibleColumns || 1;
|
|
2826
2944
|
if (columns <= 1 || !items.current?.length) return;
|
|
2827
2945
|
const currentIdx = items.current.findIndex((val) => {
|
|
@@ -3069,7 +3187,7 @@ var StatefulDropdown = ({
|
|
|
3069
3187
|
className: thorium_web_reader_settings_default.label,
|
|
3070
3188
|
...compounds?.label || {}
|
|
3071
3189
|
},
|
|
3072
|
-
...
|
|
3190
|
+
...React23.isValidElement(compounds?.button) ? { button: compounds.button } : {
|
|
3073
3191
|
button: {
|
|
3074
3192
|
className: thorium_web_reader_settings_default.dropdownButton,
|
|
3075
3193
|
...compounds?.button || {}
|
|
@@ -3080,7 +3198,7 @@ var StatefulDropdown = ({
|
|
|
3080
3198
|
placement: "bottom",
|
|
3081
3199
|
...compounds?.popover || {}
|
|
3082
3200
|
},
|
|
3083
|
-
...
|
|
3201
|
+
...React23.isValidElement(compounds?.listbox) ? { listbox: compounds.listbox } : {
|
|
3084
3202
|
listbox: {
|
|
3085
3203
|
className: thorium_web_reader_settings_default.dropdownListbox,
|
|
3086
3204
|
...compounds?.listbox || {}
|
|
@@ -3893,7 +4011,7 @@ var getLineHeightCompensation = (language) => {
|
|
|
3893
4011
|
if (data[language]?.lineHeightCompensation !== void 0) return data[language].lineHeightCompensation;
|
|
3894
4012
|
const stripped = language.split("-").slice(0, -1).join("-");
|
|
3895
4013
|
if (stripped && data[stripped]?.lineHeightCompensation !== void 0) return data[stripped].lineHeightCompensation;
|
|
3896
|
-
return data.
|
|
4014
|
+
return data.latin?.lineHeightCompensation ?? 1;
|
|
3897
4015
|
};
|
|
3898
4016
|
var useLineHeight = () => {
|
|
3899
4017
|
const { preferences } = usePreferences();
|
|
@@ -4803,7 +4921,7 @@ var createDefaultPlugin = () => {
|
|
|
4803
4921
|
id: "core",
|
|
4804
4922
|
name: "Core Components",
|
|
4805
4923
|
description: "Default components for Thorium Web Epub StatefulReader",
|
|
4806
|
-
version: "1.5.
|
|
4924
|
+
version: "1.5.1",
|
|
4807
4925
|
components: {
|
|
4808
4926
|
actions: {
|
|
4809
4927
|
["fullscreen" /* fullscreen */]: {
|
|
@@ -6079,7 +6197,7 @@ var createAudioDefaultPlugin = () => {
|
|
|
6079
6197
|
id: "audio-core",
|
|
6080
6198
|
name: "Audio Core Components",
|
|
6081
6199
|
description: "Default components for Thorium Web Audio StatefulReader",
|
|
6082
|
-
version: "1.5.
|
|
6200
|
+
version: "1.5.1",
|
|
6083
6201
|
components: {
|
|
6084
6202
|
actions: {
|
|
6085
6203
|
["settings" /* settings */]: {
|
|
@@ -6145,39 +6263,6 @@ var StatefulGlobalPreferencesProvider = ({
|
|
|
6145
6263
|
return /* @__PURE__ */ jsx(ThGlobalPreferencesProvider, { adapter, initialPreferences, children });
|
|
6146
6264
|
};
|
|
6147
6265
|
|
|
6148
|
-
// src/helpers/peripherals.ts
|
|
6149
|
-
var NavPeripheralType = {
|
|
6150
|
-
progressForward: "th_nav_progress_forward",
|
|
6151
|
-
progressBackward: "th_nav_progress_backward",
|
|
6152
|
-
moveRight: "th_nav_move_right",
|
|
6153
|
-
moveLeft: "th_nav_move_left",
|
|
6154
|
-
moveUp: "th_nav_move_up",
|
|
6155
|
-
moveDown: "th_nav_move_down",
|
|
6156
|
-
moveHome: "th_nav_move_home",
|
|
6157
|
-
moveEnd: "th_nav_move_end",
|
|
6158
|
-
zoomIn: "th_nav_zoom_in",
|
|
6159
|
-
zoomOut: "th_nav_zoom_out"
|
|
6160
|
-
};
|
|
6161
|
-
var ZOOM_IN_KEY_COMBOS = [
|
|
6162
|
-
{ keyCode: 187, ctrl: true },
|
|
6163
|
-
{ keyCode: 61, ctrl: true },
|
|
6164
|
-
{ keyCode: 107, ctrl: true },
|
|
6165
|
-
{ keyCode: 187, meta: true },
|
|
6166
|
-
{ keyCode: 61, meta: true },
|
|
6167
|
-
{ keyCode: 107, meta: true }
|
|
6168
|
-
];
|
|
6169
|
-
var ZOOM_OUT_KEY_COMBOS = [
|
|
6170
|
-
{ keyCode: 189, ctrl: true },
|
|
6171
|
-
{ keyCode: 173, ctrl: true },
|
|
6172
|
-
{ keyCode: 109, ctrl: true },
|
|
6173
|
-
{ keyCode: 189, meta: true },
|
|
6174
|
-
{ keyCode: 173, meta: true },
|
|
6175
|
-
{ keyCode: 109, meta: true }
|
|
6176
|
-
];
|
|
6177
|
-
var ACTION_PERIPHERAL_PREFIX = "th_action_";
|
|
6178
|
-
var toActionPeripheralType = (key) => `${ACTION_PERIPHERAL_PREFIX}${key}`;
|
|
6179
|
-
var fromActionPeripheralType = (type) => type.startsWith(ACTION_PERIPHERAL_PREFIX) ? type.slice(ACTION_PERIPHERAL_PREFIX.length) : null;
|
|
6180
|
-
|
|
6181
6266
|
// src/components/assets/styles/thorium-web.reader.app.module.css
|
|
6182
6267
|
var thorium_web_reader_app_default = {
|
|
6183
6268
|
wrapper: "thorium_web_reader_app_wrapper",
|
|
@@ -6483,6 +6568,70 @@ var StatefulDockingWrapper = ({
|
|
|
6483
6568
|
}
|
|
6484
6569
|
};
|
|
6485
6570
|
|
|
6571
|
+
// src/helpers/peripherals.ts
|
|
6572
|
+
var NavPeripheralType = {
|
|
6573
|
+
progressForward: "th_nav_progress_forward",
|
|
6574
|
+
progressBackward: "th_nav_progress_backward",
|
|
6575
|
+
moveRight: "th_nav_move_right",
|
|
6576
|
+
moveLeft: "th_nav_move_left",
|
|
6577
|
+
moveUp: "th_nav_move_up",
|
|
6578
|
+
moveDown: "th_nav_move_down",
|
|
6579
|
+
moveHome: "th_nav_move_home",
|
|
6580
|
+
moveEnd: "th_nav_move_end",
|
|
6581
|
+
zoomIn: "th_nav_zoom_in",
|
|
6582
|
+
zoomOut: "th_nav_zoom_out"
|
|
6583
|
+
};
|
|
6584
|
+
var ZOOM_IN_KEY_COMBOS = [
|
|
6585
|
+
{ keyCode: 187, ctrl: true },
|
|
6586
|
+
{ keyCode: 61, ctrl: true },
|
|
6587
|
+
{ keyCode: 107, ctrl: true },
|
|
6588
|
+
{ keyCode: 187, meta: true },
|
|
6589
|
+
{ keyCode: 61, meta: true },
|
|
6590
|
+
{ keyCode: 107, meta: true }
|
|
6591
|
+
];
|
|
6592
|
+
var ZOOM_OUT_KEY_COMBOS = [
|
|
6593
|
+
{ keyCode: 189, ctrl: true },
|
|
6594
|
+
{ keyCode: 173, ctrl: true },
|
|
6595
|
+
{ keyCode: 109, ctrl: true },
|
|
6596
|
+
{ keyCode: 189, meta: true },
|
|
6597
|
+
{ keyCode: 173, meta: true },
|
|
6598
|
+
{ keyCode: 109, meta: true }
|
|
6599
|
+
];
|
|
6600
|
+
var ACTION_PERIPHERAL_PREFIX = "th_action_";
|
|
6601
|
+
var toActionPeripheralType = (key) => `${ACTION_PERIPHERAL_PREFIX}${key}`;
|
|
6602
|
+
var fromActionPeripheralType = (type) => type.startsWith(ACTION_PERIPHERAL_PREFIX) ? type.slice(ACTION_PERIPHERAL_PREFIX.length) : null;
|
|
6603
|
+
var DOCKING_PERIPHERAL_PREFIX = "th_docking_";
|
|
6604
|
+
var toDockingPeripheralType = (key) => `${DOCKING_PERIPHERAL_PREFIX}${key}`;
|
|
6605
|
+
var fromDockingPeripheralType = (type) => type.startsWith(DOCKING_PERIPHERAL_PREFIX) ? type.slice(DOCKING_PERIPHERAL_PREFIX.length) : null;
|
|
6606
|
+
var useFocusedDockableKey = () => {
|
|
6607
|
+
const { actionsKeys } = useActionsPreferences();
|
|
6608
|
+
return useCallback((dockingKey) => {
|
|
6609
|
+
const active = document.activeElement;
|
|
6610
|
+
if (!active) return null;
|
|
6611
|
+
const checkKey = (key) => {
|
|
6612
|
+
const dockable = actionsKeys[key]?.docked?.dockable;
|
|
6613
|
+
if (!dockable || dockable === "none" /* none */) return false;
|
|
6614
|
+
return dockingKey === "dockingTransient" /* transient */ || dockingKey === "dockingStart" /* start */ && (dockable === "start" /* start */ || dockable === "both" /* both */) || dockingKey === "dockingEnd" /* end */ && (dockable === "end" /* end */ || dockable === "both" /* both */);
|
|
6615
|
+
};
|
|
6616
|
+
let el = active;
|
|
6617
|
+
while (el) {
|
|
6618
|
+
const id = el.getAttribute("id");
|
|
6619
|
+
if (id) {
|
|
6620
|
+
if (checkKey(id)) return id;
|
|
6621
|
+
const keyFromId = Object.keys(actionsKeys).find((k) => id.startsWith(`${k}-`));
|
|
6622
|
+
if (keyFromId && checkKey(keyFromId)) return keyFromId;
|
|
6623
|
+
}
|
|
6624
|
+
const dataKey = el.getAttribute("data-key");
|
|
6625
|
+
if (dataKey) {
|
|
6626
|
+
const key = dataKey.slice(dataKey.lastIndexOf("-") + 1);
|
|
6627
|
+
if (key && checkKey(key)) return key;
|
|
6628
|
+
}
|
|
6629
|
+
el = el.parentElement;
|
|
6630
|
+
}
|
|
6631
|
+
return null;
|
|
6632
|
+
}, [actionsKeys]);
|
|
6633
|
+
};
|
|
6634
|
+
|
|
6486
6635
|
// src/components/assets/styles/thorium-web.reader.header.module.css
|
|
6487
6636
|
var thorium_web_reader_header_default = {
|
|
6488
6637
|
header: "thorium_web_reader_header_header",
|
|
@@ -6566,7 +6715,7 @@ var StatefulBackLink = ({
|
|
|
6566
6715
|
for (const { name, value } of Array.from(svgElement.attributes)) {
|
|
6567
6716
|
attributes[name] = value;
|
|
6568
6717
|
}
|
|
6569
|
-
contentNode =
|
|
6718
|
+
contentNode = React23.createElement("svg", {
|
|
6570
6719
|
...attributes,
|
|
6571
6720
|
"aria-hidden": "true",
|
|
6572
6721
|
focusable: "false",
|
|
@@ -6670,6 +6819,6 @@ var useReaderHeaderBase = (actionKeys) => {
|
|
|
6670
6819
|
};
|
|
6671
6820
|
};
|
|
6672
6821
|
|
|
6673
|
-
export { NavPeripheralType, NavigatorProvider, ORDERED_LINE_HEIGHT_OPTIONS, StatefulActionIcon, StatefulAudioAutoPlay, StatefulAudioPlaybackRateContainer, StatefulAudioPlaybackRateTrigger, StatefulAudioRemotePlaybackTrigger, StatefulAudioSettingsContainer, StatefulAudioSkipBackwardInterval, StatefulAudioSkipForwardInterval, StatefulAudioSkipInterval, StatefulAudioSleepTimerContainer, StatefulAudioSleepTimerTrigger, StatefulAudioTocContainer, StatefulAudioTocTrigger, StatefulAudioVolumeContainer, StatefulAudioVolumeTrigger, StatefulBackLink, StatefulBottomSheet, StatefulCollapsibleActionsBar, StatefulColumns, StatefulCompactPopoverSheet, StatefulDockedSheet, StatefulDockingWrapper, StatefulDropdown, StatefulFontFamily, StatefulFullScreenSheet, StatefulFullscreenTrigger, StatefulGlobalPreferencesProvider, StatefulGroupWrapper, StatefulHyphens, StatefulJumpToPositionContainer, StatefulJumpToPositionTrigger, StatefulLayout, StatefulLetterSpacing, StatefulLigatures, StatefulLineHeight, StatefulModalBase, StatefulModalSheet, StatefulNoRuby, StatefulNumberField, StatefulOverflowMenu, StatefulOverflowMenuItem, StatefulParagraphIndent, StatefulParagraphSpacing, StatefulPopoverSheet, StatefulPreferencesProvider, StatefulPublisherStyles, StatefulRadioGroup, StatefulSettingsTrigger, StatefulSettingsWrapper, StatefulSheetWrapper, StatefulSlider, StatefulSliderWithPresets, StatefulSpacingGroup, StatefulSpacingGroupContainer, StatefulSpacingPresets, StatefulSwitch, StatefulTextAlign, StatefulTextGroup, StatefulTextGroupContainer, StatefulTextNormalize, StatefulTheme, StatefulTocContainer, StatefulTocTrigger, StatefulVisualSettingsContainer, StatefulWordSpacing, StatefulZoom, UnstableStatefulFontWeight, ZOOM_IN_KEY_COMBOS, ZOOM_OUT_KEY_COMBOS, createAudioDefaultPlugin, createDefaultPlugin, fromActionPeripheralType, thorium_web_button_default, thorium_web_overflow_default, thorium_web_reader_app_default, thorium_web_reader_header_default, toActionPeripheralType, useDocking, useEffectiveRange, useGridNavigation, useGridTemplate, useIsScroll, useLineHeight, useNavigator, usePlaceholder, usePositionStorage, usePublication, useReaderHeaderBase, useReaderSetting, useReaderTransitions, useSettingsComponentStatus, useSpacingPresets };
|
|
6674
|
-
//# sourceMappingURL=chunk-
|
|
6675
|
-
//# sourceMappingURL=chunk-
|
|
6822
|
+
export { NavPeripheralType, NavigatorProvider, ORDERED_LINE_HEIGHT_OPTIONS, StatefulActionIcon, StatefulAudioAutoPlay, StatefulAudioPlaybackRateContainer, StatefulAudioPlaybackRateTrigger, StatefulAudioRemotePlaybackTrigger, StatefulAudioSettingsContainer, StatefulAudioSkipBackwardInterval, StatefulAudioSkipForwardInterval, StatefulAudioSkipInterval, StatefulAudioSleepTimerContainer, StatefulAudioSleepTimerTrigger, StatefulAudioTocContainer, StatefulAudioTocTrigger, StatefulAudioVolumeContainer, StatefulAudioVolumeTrigger, StatefulBackLink, StatefulBottomSheet, StatefulCollapsibleActionsBar, StatefulColumns, StatefulCompactPopoverSheet, StatefulDockedSheet, StatefulDockingWrapper, StatefulDropdown, StatefulFontFamily, StatefulFullScreenSheet, StatefulFullscreenTrigger, StatefulGlobalPreferencesProvider, StatefulGroupWrapper, StatefulHyphens, StatefulJumpToPositionContainer, StatefulJumpToPositionTrigger, StatefulLayout, StatefulLetterSpacing, StatefulLigatures, StatefulLineHeight, StatefulModalBase, StatefulModalSheet, StatefulNoRuby, StatefulNumberField, StatefulOverflowMenu, StatefulOverflowMenuItem, StatefulParagraphIndent, StatefulParagraphSpacing, StatefulPopoverSheet, StatefulPreferencesProvider, StatefulPublisherStyles, StatefulRadioGroup, StatefulSettingsTrigger, StatefulSettingsWrapper, StatefulSheetWrapper, StatefulSlider, StatefulSliderWithPresets, StatefulSpacingGroup, StatefulSpacingGroupContainer, StatefulSpacingPresets, StatefulSwitch, StatefulTextAlign, StatefulTextGroup, StatefulTextGroupContainer, StatefulTextNormalize, StatefulTheme, StatefulTocContainer, StatefulTocTrigger, StatefulVisualSettingsContainer, StatefulWordSpacing, StatefulZoom, ThPluginProvider, ThPluginRegistry, UnstableStatefulFontWeight, ZOOM_IN_KEY_COMBOS, ZOOM_OUT_KEY_COMBOS, createAudioDefaultPlugin, createDefaultPlugin, fromActionPeripheralType, fromDockingPeripheralType, thorium_web_button_default, thorium_web_overflow_default, thorium_web_reader_app_default, thorium_web_reader_header_default, toActionPeripheralType, toDockingPeripheralType, useActionComponentStatus, useDocking, useEffectiveRange, useFocusedDockableKey, useGridNavigation, useGridTemplate, useIsScroll, useLineHeight, useNavigator, usePlaceholder, usePlugins, usePositionStorage, usePublication, useReaderHeaderBase, useReaderSetting, useReaderTransitions, useSettingsComponentStatus, useSpacingPresets };
|
|
6823
|
+
//# sourceMappingURL=chunk-THOJRBVD.mjs.map
|
|
6824
|
+
//# sourceMappingURL=chunk-THOJRBVD.mjs.map
|