@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.
Files changed (94) hide show
  1. package/dist/{ThPreferencesAdapter-L1H6gzmu.d.mts → ThPreferencesAdapter-B3a-f5v-.d.mts} +25 -18
  2. package/dist/{ThSettingsWrapper-DWEA4hYF.d.mts → ThSettingsWrapper-DtzcwzYX.d.mts} +4 -4
  3. package/dist/{actions-BjeRjaJU.d.mts → actions-C33UN3Ji.d.mts} +18 -4
  4. package/dist/{actionsReducer-B32cq2mB.d.mts → actionsReducer-Bzcj3wk3.d.mts} +1 -1
  5. package/dist/{chunk-NUXGQWED.mjs → chunk-2NCN2AG2.mjs} +3 -3
  6. package/dist/{chunk-NUXGQWED.mjs.map → chunk-2NCN2AG2.mjs.map} +1 -1
  7. package/dist/{chunk-IVXRCKWR.mjs → chunk-2T65MDBR.mjs} +4 -4
  8. package/dist/{chunk-IVXRCKWR.mjs.map → chunk-2T65MDBR.mjs.map} +1 -1
  9. package/dist/{chunk-KVUG6BNI.mjs → chunk-63LKYJFG.mjs} +62 -56
  10. package/dist/chunk-63LKYJFG.mjs.map +1 -0
  11. package/dist/chunk-AQSJDL63.mjs +193 -0
  12. package/dist/chunk-AQSJDL63.mjs.map +1 -0
  13. package/dist/{chunk-TSLTLQ6O.mjs → chunk-BBCSLDQT.mjs} +144 -86
  14. package/dist/chunk-BBCSLDQT.mjs.map +1 -0
  15. package/dist/{chunk-QUSGPT5M.mjs → chunk-BCXKBHU3.mjs} +34 -15
  16. package/dist/chunk-BCXKBHU3.mjs.map +1 -0
  17. package/dist/{chunk-T5ENYSDJ.mjs → chunk-DQDOOTCE.mjs} +3 -3
  18. package/dist/{chunk-T5ENYSDJ.mjs.map → chunk-DQDOOTCE.mjs.map} +1 -1
  19. package/dist/chunk-GNROODJB.mjs +9 -0
  20. package/dist/chunk-GNROODJB.mjs.map +1 -0
  21. package/dist/{chunk-SZAVAQ6S.mjs → chunk-GRYEOCGD.mjs} +8 -5
  22. package/dist/chunk-GRYEOCGD.mjs.map +1 -0
  23. package/dist/{chunk-PXXWEMNL.mjs → chunk-KJ55Q63A.mjs} +220 -106
  24. package/dist/chunk-KJ55Q63A.mjs.map +1 -0
  25. package/dist/{chunk-5LUMM7FW.mjs → chunk-KOR74F6M.mjs} +9 -41
  26. package/dist/chunk-KOR74F6M.mjs.map +1 -0
  27. package/dist/{chunk-WLVE3WNW.mjs → chunk-PAFJZH7O.mjs} +12 -7
  28. package/dist/chunk-PAFJZH7O.mjs.map +1 -0
  29. package/dist/{chunk-XRFLDNAY.mjs → chunk-PRQBFBJ7.mjs} +123 -56
  30. package/dist/chunk-PRQBFBJ7.mjs.map +1 -0
  31. package/dist/{chunk-6MONB2DN.mjs → chunk-Y5X74VW7.mjs} +52 -146
  32. package/dist/chunk-Y5X74VW7.mjs.map +1 -0
  33. package/dist/{chunk-P6ILEQ5P.mjs → chunk-ZD4LTF6G.mjs} +17 -9
  34. package/dist/chunk-ZD4LTF6G.mjs.map +1 -0
  35. package/dist/components/Audio/index.css +12 -1
  36. package/dist/components/Audio/index.css.map +1 -1
  37. package/dist/components/Audio/index.d.mts +17 -15
  38. package/dist/components/Audio/index.mjs +11 -11
  39. package/dist/components/Epub/index.css +12 -1
  40. package/dist/components/Epub/index.css.map +1 -1
  41. package/dist/components/Epub/index.d.mts +14 -13
  42. package/dist/components/Epub/index.mjs +12 -12
  43. package/dist/components/Misc/index.mjs +5 -5
  44. package/dist/components/Reader/index.css +12 -1
  45. package/dist/components/Reader/index.css.map +1 -1
  46. package/dist/components/Reader/index.d.mts +12 -11
  47. package/dist/components/Reader/index.mjs +26 -24
  48. package/dist/components/Reader/index.mjs.map +1 -1
  49. package/dist/components/WebPub/index.css +12 -1
  50. package/dist/components/WebPub/index.css.map +1 -1
  51. package/dist/components/WebPub/index.d.mts +14 -13
  52. package/dist/components/WebPub/index.mjs +12 -12
  53. package/dist/core/Components/index.d.mts +7 -6
  54. package/dist/core/Components/index.mjs +2 -2
  55. package/dist/core/Helpers/index.d.mts +1 -1
  56. package/dist/core/Helpers/index.mjs +1 -1
  57. package/dist/core/Hooks/index.d.mts +6 -5
  58. package/dist/core/Hooks/index.mjs +1 -1
  59. package/dist/i18n/index.mjs +3 -3
  60. package/dist/keyboardUtilities-BCP3UcLb.d.mts +30 -0
  61. package/dist/lib/index.d.mts +17 -9
  62. package/dist/lib/index.mjs +2 -2
  63. package/dist/locales/da/thorium-web.json +37 -2
  64. package/dist/locales/fi/thorium-web.json +1 -1
  65. package/dist/locales/fr/thorium-web.json +1 -1
  66. package/dist/locales/he/thorium-web.json +9 -0
  67. package/dist/locales/it/thorium-web.json +22 -0
  68. package/dist/locales/lt/thorium-web.json +26 -1
  69. package/dist/locales/sv/thorium-web.json +22 -0
  70. package/dist/next-lib/index.mjs +1 -1
  71. package/dist/next-lib/index.mjs.map +1 -1
  72. package/dist/preferences/index.d.mts +14 -23
  73. package/dist/preferences/index.mjs +4 -4
  74. package/dist/{settingsReducer-DLaT2wUB.d.mts → settingsReducer-Pp9aoiiC.d.mts} +1 -1
  75. package/dist/{useAudioNavigator-CWXyNWq1.d.mts → useAudioNavigator-pGwxhXLj.d.mts} +4 -1
  76. package/dist/{useContrast-Bo7cDw_X.d.mts → useContrast-Bl08zDTU.d.mts} +2 -7
  77. package/dist/{usePreferences-D8NU1yhP.d.mts → usePreferences-Cy7-JN2x.d.mts} +4 -8
  78. package/dist/{useReaderTransitions-BQGzKeY2.d.mts → useReaderTransitions-Zvomj9RQ.d.mts} +30 -21
  79. package/package.json +7 -7
  80. package/dist/chunk-5LUMM7FW.mjs.map +0 -1
  81. package/dist/chunk-6MONB2DN.mjs.map +0 -1
  82. package/dist/chunk-B3WDMWCT.mjs +0 -9
  83. package/dist/chunk-B3WDMWCT.mjs.map +0 -1
  84. package/dist/chunk-KVUG6BNI.mjs.map +0 -1
  85. package/dist/chunk-MLEYTQGK.mjs +0 -60
  86. package/dist/chunk-MLEYTQGK.mjs.map +0 -1
  87. package/dist/chunk-P6ILEQ5P.mjs.map +0 -1
  88. package/dist/chunk-PXXWEMNL.mjs.map +0 -1
  89. package/dist/chunk-QUSGPT5M.mjs.map +0 -1
  90. package/dist/chunk-SZAVAQ6S.mjs.map +0 -1
  91. package/dist/chunk-TSLTLQ6O.mjs.map +0 -1
  92. package/dist/chunk-WLVE3WNW.mjs.map +0 -1
  93. package/dist/chunk-XRFLDNAY.mjs.map +0 -1
  94. package/dist/keyboardUtilities-BWAyLS_D.d.mts +0 -56
@@ -1,21 +1,22 @@
1
1
  import { makeBreakpointsMap, isKeyboardTriggered, isActiveElement } from './chunk-VENFFPK2.mjs';
2
- import { useFullscreen, useLocalStorage, useEpubNavigator } from './chunk-SZAVAQ6S.mjs';
3
- 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-WLVE3WNW.mjs';
2
+ import { useFullscreen, useLocalStorage, useEpubNavigator } from './chunk-GRYEOCGD.mjs';
3
+ 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-PAFJZH7O.mjs';
4
4
  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-XRFLDNAY.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-PRQBFBJ7.mjs';
6
6
  import { useAppDispatch, useAppSelector } from './chunk-A575ZW4A.mjs';
7
- import { isIOSish, buildShortcut, metaKeys } from './chunk-5LUMM7FW.mjs';
7
+ import { isIOSish, metaKeys } from './chunk-KOR74F6M.mjs';
8
8
  import { ErrorHandler } from './chunk-RRDEPGBK.mjs';
9
- import { ThMenuItem, ThActionButton, ThMenu, ThCollapsibleActionsBar, ThPopover, ThContainerHeader, ThNavigationButton, ThContainerBody, ThModal, ThBottomSheet, ThCloseButton, ThDockedPanel, useFirstFocusable, ThTypedComponentRenderer, useActions, useActionComponentStatus, ThForm, ThFormNumberField, usePlugins, ThSettingsWrapper, ThRadioGroup, ThDropdown, ThSwitch, ThNumberField, ThSlider, ThSliderWithPresets, ThLink, ThLibrary, ThHome, ThBackArrow, ThFormSearchField } from './chunk-P6ILEQ5P.mjs';
9
+ import { ThMenuItem, ThActionButton, ThMenu, ThCollapsibleActionsBar, ThPopover, ThContainerHeader, ThNavigationButton, ThContainerBody, ThModal, ThBottomSheet, ThCloseButton, ThDockedPanel, useFirstFocusable, ThTypedComponentRenderer, useActions, useActionComponentStatus, ThForm, ThFormNumberField, usePlugins, ThSettingsWrapper, ThRadioGroup, ThDropdown, ThSwitch, ThNumberField, ThSlider, ThSliderWithPresets, ThLink, ThLibrary, ThHome, ThBackArrow, ThFormSearchField } from './chunk-ZD4LTF6G.mjs';
10
10
  import { usePrevious } from './chunk-YZ73DHRU.mjs';
11
- import { useI18n } from './chunk-NUXGQWED.mjs';
11
+ import { useI18n } from './chunk-2NCN2AG2.mjs';
12
12
  import { Text, Popover, Dialog, ListBox, ListBoxItem, Radio, Button, Keyboard, Toolbar, useFilter, Tree, TreeItem, TreeItemContent, Collection } from 'react-aria-components';
13
13
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
14
14
  import { useObjectRef, useNumberFormatter, FocusScope, useLocale, useFocusWithin } from 'react-aria';
15
15
  import classNames4 from 'classnames';
16
- import React22, { createContext, useCallback, useRef, useContext, useMemo, useState, useEffect } from 'react';
16
+ import React22, { createContext, useCallback, useRef, useMemo, useContext, useState, useEffect } from 'react';
17
17
  import { Link, HttpFetcher, Manifest, Publication, ReadingProgression, Layout, Feature, Profile } from '@readium/shared';
18
- import { getScriptMode, TextAlignment } from '@readium/navigator';
18
+ import { getScriptMode, lineHeightRangeConfig, TextAlignment } from '@readium/navigator';
19
+ import i18nData from '@readium/css/css/vars/i18n.json';
19
20
  import { useStore } from 'react-redux';
20
21
  import { PanelGroup, Panel, PanelResizeHandle } from 'react-resizable-panels';
21
22
 
@@ -28,40 +29,47 @@ var thorium_web_overflow_default = {
28
29
  menuItemLabel: "thorium_web_overflow_menuItemLabel",
29
30
  menuItemShortcut: "thorium_web_overflow_menuItemShortcut"
30
31
  };
31
- var UnstableStatefulShortcut = ({
32
+ var DIGIT_OFFSET = 48;
33
+ var F_KEY_OFFSET = 112;
34
+ var resolveKeyLabel = (keyCode, label, t) => {
35
+ if (label !== void 0) {
36
+ if (typeof label === "string") return label;
37
+ return t(label.key, { defaultValue: label.fallback });
38
+ }
39
+ if (keyCode >= 65 && keyCode <= 90) return String.fromCharCode(keyCode);
40
+ if (keyCode >= DIGIT_OFFSET && keyCode <= 57) return String.fromCharCode(keyCode);
41
+ if (keyCode >= F_KEY_OFFSET && keyCode <= 123) return `F${keyCode - F_KEY_OFFSET + 1}`;
42
+ return "";
43
+ };
44
+ var pickCombo = (keyCombos, platformModifier) => {
45
+ if (keyCombos.length === 1) return keyCombos[0];
46
+ const wantsCtrl = platformModifier.modifier === "ctrlKey";
47
+ const preferred = keyCombos.find((c) => wantsCtrl ? c.ctrl : c.meta);
48
+ return preferred ?? keyCombos[0];
49
+ };
50
+ var StatefulShortcut = ({
32
51
  className,
33
- rawForm,
52
+ combo,
34
53
  representation,
35
54
  joiner
36
55
  }) => {
37
56
  const { shortcuts } = useSharedPreferences();
38
57
  const platformModifier = useAppSelector((state) => state.reader.platformModifier);
39
- representation = representation ? representation : shortcuts.representation || "symbol" /* symbol */;
40
- joiner = joiner ? joiner : shortcuts.joiner || " + ";
41
- const shortcutObj = buildShortcut(rawForm);
42
- if (shortcutObj) {
43
- let shortcutRepresentation = [];
44
- for (const prop in shortcutObj.modifiers) {
45
- if (shortcutObj.modifiers[prop]) {
46
- if (prop === "platformKey") {
47
- shortcutRepresentation.push(platformModifier[representation]);
48
- } else {
49
- const metaKey = metaKeys[prop];
50
- shortcutRepresentation.push(metaKey[representation]);
51
- }
52
- }
53
- }
54
- if (shortcutObj.char) {
55
- shortcutRepresentation.push(shortcutObj.char);
56
- }
57
- if (shortcutRepresentation.length > 0) {
58
- const displayShortcut = shortcutRepresentation.join(joiner);
59
- return /* @__PURE__ */ jsx(Keyboard, { className, children: displayShortcut });
60
- } else {
61
- return /* @__PURE__ */ jsx(Fragment, {});
62
- }
63
- }
64
- return /* @__PURE__ */ jsx(Fragment, {});
58
+ const { t } = useI18n();
59
+ const rep = representation ?? shortcuts.representation ?? "symbol" /* symbol */;
60
+ const sep = joiner ?? shortcuts.joiner ?? " + ";
61
+ const { keyCombos, label } = combo;
62
+ if (!keyCombos.length) return /* @__PURE__ */ jsx(Fragment, {});
63
+ const chosen = pickCombo(keyCombos, platformModifier);
64
+ const parts = [];
65
+ if (chosen.ctrl) parts.push(metaKeys.ctrlKey[rep]);
66
+ if (chosen.alt) parts.push(metaKeys.altKey[rep]);
67
+ if (chosen.shift) parts.push(metaKeys.shiftKey[rep]);
68
+ if (chosen.meta) parts.push(metaKeys.metaKey[rep]);
69
+ const keyLabel = resolveKeyLabel(chosen.keyCode, label, t);
70
+ if (keyLabel) parts.push(keyLabel);
71
+ if (!parts.length) return /* @__PURE__ */ jsx(Fragment, {});
72
+ return /* @__PURE__ */ jsx(Keyboard, { className, children: parts.join(sep) });
65
73
  };
66
74
  var StatefulOverflowMenuItem = ({
67
75
  id,
@@ -70,6 +78,7 @@ var StatefulOverflowMenuItem = ({
70
78
  shortcut = void 0,
71
79
  ...props
72
80
  }) => {
81
+ const { shortcuts } = useSharedPreferences();
73
82
  const menuItemLabelId = `${id}-label`;
74
83
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
75
84
  ThMenuItem,
@@ -90,11 +99,11 @@ var StatefulOverflowMenuItem = ({
90
99
  children: label
91
100
  }
92
101
  ),
93
- shortcut && /* @__PURE__ */ jsx(
94
- UnstableStatefulShortcut,
102
+ shortcut && shortcuts.displayIn?.includes("menuItem") && /* @__PURE__ */ jsx(
103
+ StatefulShortcut,
95
104
  {
96
105
  className: thorium_web_overflow_default.menuItemShortcut,
97
- rawForm: shortcut
106
+ combo: shortcut
98
107
  }
99
108
  )
100
109
  ]
@@ -109,6 +118,7 @@ var thorium_web_button_default = {
109
118
  closeButton: "thorium_web_button_closeButton",
110
119
  backButton: "thorium_web_button_backButton",
111
120
  tooltip: "thorium_web_button_tooltip",
121
+ tooltipShortcut: "thorium_web_button_tooltipShortcut",
112
122
  alwaysVisible: "thorium_web_button_alwaysVisible",
113
123
  partiallyVisible: "thorium_web_button_partiallyVisible",
114
124
  iconCompSm: "thorium_web_button_iconCompSm",
@@ -120,10 +130,11 @@ var StatefulActionIcon = ({
120
130
  visibility,
121
131
  placement,
122
132
  tooltipLabel,
133
+ shortcut,
123
134
  children,
124
135
  ...props
125
136
  }) => {
126
- const { theming } = useSharedPreferences();
137
+ const { theming, shortcuts } = useSharedPreferences();
127
138
  const triggerRef = useObjectRef(externalRef ?? null);
128
139
  const dispatch = useAppDispatch();
129
140
  const handleClassNameFromState = () => {
@@ -169,7 +180,10 @@ var StatefulActionIcon = ({
169
180
  placement,
170
181
  offset: theming.icon.tooltipOffset || 0
171
182
  },
172
- label: tooltipLabel
183
+ label: /* @__PURE__ */ jsxs(Fragment, { children: [
184
+ tooltipLabel,
185
+ shortcut && shortcuts.displayIn?.includes("tooltip") && /* @__PURE__ */ jsx(StatefulShortcut, { className: thorium_web_button_default.tooltipShortcut, combo: shortcut })
186
+ ] })
173
187
  } : void 0,
174
188
  ...Object.fromEntries(Object.entries(props).filter(([key]) => key !== "className")),
175
189
  children
@@ -219,6 +233,7 @@ var StatefulFullscreenTrigger = ({ variant }) => {
219
233
  };
220
234
  var SvgMoreVert = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "inherit", ...props, children: /* @__PURE__ */ jsx("path", { d: "M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z" }) });
221
235
  var more_vert_default = SvgMoreVert;
236
+ var MENU_DEPENDENCIES = ["Trigger"];
222
237
  var StatefulOverflowMenu = ({
223
238
  id,
224
239
  className,
@@ -241,7 +256,7 @@ var StatefulOverflowMenu = ({
241
256
  triggerRef,
242
257
  selectionMode: "none",
243
258
  className: thorium_web_overflow_default.menu,
244
- dependencies: ["Trigger"],
259
+ dependencies: MENU_DEPENDENCIES,
245
260
  items,
246
261
  compounds: {
247
262
  menuTrigger: {
@@ -274,7 +289,18 @@ var StatefulCollapsibleActionsBar = ({
274
289
  ...props
275
290
  }) => {
276
291
  const ref = useRef(null);
277
- const breakpoint = useAppSelector((state) => state.theming.breakpoint);
292
+ const breakpoint = useAppSelector((state) => state.theming.containerBreakpoint);
293
+ const compounds = useMemo(() => ({
294
+ menu: /* @__PURE__ */ jsx(
295
+ StatefulOverflowMenu,
296
+ {
297
+ id,
298
+ triggerRef: ref,
299
+ className: overflowMenuClassName,
300
+ items: []
301
+ }
302
+ )
303
+ }), [id, overflowMenuClassName]);
278
304
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
279
305
  ThCollapsibleActionsBar,
280
306
  {
@@ -282,17 +308,7 @@ var StatefulCollapsibleActionsBar = ({
282
308
  id,
283
309
  items,
284
310
  breakpoint,
285
- compounds: {
286
- menu: /* @__PURE__ */ jsx(
287
- StatefulOverflowMenu,
288
- {
289
- id,
290
- triggerRef: ref,
291
- className: overflowMenuClassName,
292
- items: []
293
- }
294
- )
295
- },
311
+ compounds,
296
312
  ...props
297
313
  }
298
314
  ) });
@@ -879,7 +895,7 @@ var useWebkitPatch = (isOpen) => {
879
895
  try {
880
896
  const visual = useNavigator().visual;
881
897
  getCframes = visual.getCframes;
882
- } catch (e) {
898
+ } catch (_e) {
883
899
  getCframes = void 0;
884
900
  }
885
901
  useEffect(() => {
@@ -907,7 +923,7 @@ var useWebkitPatch = (isOpen) => {
907
923
  try {
908
924
  frameWindow = frame?.window;
909
925
  if (!frameWindow?.document?.scrollingElement) return;
910
- } catch (e) {
926
+ } catch (_e) {
911
927
  return;
912
928
  }
913
929
  if (isHorizontalScroll) {
@@ -1457,8 +1473,7 @@ var StatefulDockedSheet = ({
1457
1473
  children,
1458
1474
  resetFocus,
1459
1475
  focusSelector,
1460
- focusWithinRef,
1461
- scrollTopOnFocus
1476
+ focusWithinRef
1462
1477
  }) => {
1463
1478
  const { t } = useI18n();
1464
1479
  const dockPortal = flow && document.getElementById(flow);
@@ -1552,7 +1567,6 @@ var StatefulDockedSheet = ({
1552
1567
  }
1553
1568
  };
1554
1569
  var StatefulCompactPopoverSheet = ({
1555
- id,
1556
1570
  triggerRef,
1557
1571
  heading,
1558
1572
  className,
@@ -2052,6 +2066,7 @@ var StatefulJumpToPositionTrigger = ({ variant }) => {
2052
2066
  "aria-label": t("reader.actions.goToPosition.descriptive"),
2053
2067
  placement: "bottom",
2054
2068
  tooltipLabel: t("reader.actions.goToPosition.compact"),
2069
+ shortcut: preferences.actionsKeys["jumpToPosition" /* jumpToPosition */].shortcut,
2055
2070
  onPress: () => setOpen(!actionState?.isOpen),
2056
2071
  children: /* @__PURE__ */ jsx(pin_drop_default, { "aria-hidden": "true", focusable: "false" })
2057
2072
  }
@@ -2480,6 +2495,7 @@ var StatefulSettingsTrigger = ({ variant }) => {
2480
2495
  "aria-label": isAudio ? t("reader.playback.preferences.audio.title") : t("reader.preferences.title"),
2481
2496
  placement: "bottom",
2482
2497
  tooltipLabel: isAudio ? t("reader.playback.preferences.audio.title") : t("reader.preferences.title"),
2498
+ shortcut: preferences.actionsKeys["settings" /* settings */].shortcut,
2483
2499
  onPress: () => setOpen(!actionState?.isOpen),
2484
2500
  children: isAudio ? /* @__PURE__ */ jsx(instant_mix_default, { "aria-hidden": "true", focusable: "false" }) : /* @__PURE__ */ jsx(match_case_default, { "aria-hidden": "true", focusable: "false" })
2485
2501
  }
@@ -2766,6 +2782,7 @@ var StatefulTocTrigger = ({ variant }) => {
2766
2782
  "aria-label": t("reader.tableOfContents.title"),
2767
2783
  placement: "bottom",
2768
2784
  tooltipLabel: t("reader.tableOfContents.title"),
2785
+ shortcut: preferences.actionsKeys["toc" /* toc */].shortcut,
2769
2786
  onPress: () => setOpen(!actionState?.isOpen),
2770
2787
  children: /* @__PURE__ */ jsx(toc_default, { "aria-hidden": "true", focusable: "false" })
2771
2788
  }
@@ -3858,14 +3875,55 @@ var StatefulLetterSpacing = ({ standalone = true }) => {
3858
3875
  }
3859
3876
  ) });
3860
3877
  };
3878
+ var ORDERED_LINE_HEIGHT_OPTIONS = ["small" /* small */, "medium" /* medium */, "large" /* large */];
3879
+ function spreadValues(values, globalMin, globalMax) {
3880
+ const n = values.length;
3881
+ if (n <= 1) return values;
3882
+ const indexed = values.map((v, i) => ({ v, i })).sort((a, b) => a.v - b.v);
3883
+ if (indexed.every((item, i) => i === 0 || item.v !== indexed[i - 1].v)) return values;
3884
+ const lo = indexed[0].v === indexed[n - 1].v ? globalMin : indexed[0].v;
3885
+ const hi = indexed[0].v === indexed[n - 1].v ? globalMax : indexed[n - 1].v;
3886
+ const step = (hi - lo) / (n - 1);
3887
+ const result = new Array(n);
3888
+ for (let i = 0; i < n; i++) result[indexed[i].i] = lo + i * step;
3889
+ return result;
3890
+ }
3891
+ var getLineHeightCompensation = (language) => {
3892
+ const data = i18nData;
3893
+ if (data[language]?.lineHeightCompensation !== void 0) return data[language].lineHeightCompensation;
3894
+ const stripped = language.split("-").slice(0, -1).join("-");
3895
+ if (stripped && data[stripped]?.lineHeightCompensation !== void 0) return data[stripped].lineHeightCompensation;
3896
+ return data.default?.lineHeightCompensation ?? 1;
3897
+ };
3861
3898
  var useLineHeight = () => {
3862
3899
  const { preferences } = usePreferences();
3863
- return useMemo(() => ({
3864
- ["publisher" /* publisher */]: null,
3865
- ["small" /* small */]: preferences.settings.keys["lineHeight" /* lineHeight */].keys["small" /* small */],
3866
- ["medium" /* medium */]: preferences.settings.keys["lineHeight" /* lineHeight */].keys["medium" /* medium */],
3867
- ["large" /* large */]: preferences.settings.keys["lineHeight" /* lineHeight */].keys["large" /* large */]
3868
- }), [preferences.settings.keys]);
3900
+ const fontLanguage = useAppSelector((state) => state.publication.fontLanguage);
3901
+ return useMemo(() => {
3902
+ const keys = preferences.settings.keys["lineHeight" /* lineHeight */].keys;
3903
+ const factor = getLineHeightCompensation(fontLanguage);
3904
+ const values = {
3905
+ ["publisher" /* publisher */]: null,
3906
+ ["small" /* small */]: keys["small" /* small */],
3907
+ ["medium" /* medium */]: keys["medium" /* medium */],
3908
+ ["large" /* large */]: keys["large" /* large */]
3909
+ };
3910
+ const compensate = (v) => v !== null ? v * factor : null;
3911
+ const compensatedValues = {
3912
+ ["publisher" /* publisher */]: null,
3913
+ ["small" /* small */]: compensate(values["small" /* small */]),
3914
+ ["medium" /* medium */]: compensate(values["medium" /* medium */]),
3915
+ ["large" /* large */]: compensate(values["large" /* large */])
3916
+ };
3917
+ const [minRange, maxRange] = lineHeightRangeConfig.range;
3918
+ const clamp = (v) => v === null ? minRange : Math.min(Math.max(v, minRange), maxRange);
3919
+ const ordered = ORDERED_LINE_HEIGHT_OPTIONS;
3920
+ const clamped = ordered.map((key) => clamp(compensatedValues[key]));
3921
+ const processed = spreadValues(clamped, minRange, maxRange);
3922
+ const processedValues = Object.fromEntries(
3923
+ ordered.map((key, i) => [key, processed[i]])
3924
+ );
3925
+ return { values, compensatedValues, processedValues, compensate };
3926
+ }, [preferences.settings.keys, fontLanguage]);
3869
3927
  };
3870
3928
  var SvgBook = (props) => /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "inherit", ...props, children: /* @__PURE__ */ jsx("path", { d: "M240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h480q33 0 56.5 23.5T800-800v640q0 33-23.5 56.5T720-80H240Zm0-80h480v-640h-80v280l-100-60-100 60v-280H240v640Zm0 0v-640 640Zm200-360 100-60 100 60-100-60-100 60Z" }) });
3871
3929
  var book_default = SvgBook;
@@ -3881,20 +3939,18 @@ var StatefulLineHeight = ({ standalone = true }) => {
3881
3939
  const profile = useAppSelector((state) => state.reader.profile);
3882
3940
  const isWebPub = profile === "webPub";
3883
3941
  const publisherStyles = useReaderSetting("publisherStyles");
3884
- const { getSetting, submitPreferences, preferencesEditor } = useNavigator().visual;
3942
+ const { getSetting, submitPreferences } = useNavigator().visual;
3885
3943
  const prefKey = SETTINGS_KEY_TO_PREFERENCE["lineHeight" /* lineHeight */];
3886
3944
  const { getEffectiveSpacingValue, setLineHeight: setLineHeight2 } = useSpacingPresets();
3887
3945
  const lineHeight = getEffectiveSpacingValue("lineHeight" /* lineHeight */);
3888
- const lineHeightOptions = useLineHeight();
3889
- const lineHeightNumericValues = useMemo(
3890
- () => Object.values(lineHeightOptions).filter((v) => v !== null),
3891
- [lineHeightOptions]
3892
- );
3893
- const { presets: effectivePresets } = useEffectiveRange(
3894
- [Math.min(...lineHeightNumericValues), Math.max(...lineHeightNumericValues)],
3895
- preferencesEditor?.lineHeight?.supportedRange,
3896
- lineHeightNumericValues
3897
- );
3946
+ const { processedValues } = useLineHeight();
3947
+ const processedPresets = useMemo(() => {
3948
+ const result = /* @__PURE__ */ new Map();
3949
+ result.set("small" /* small */, processedValues["small" /* small */]);
3950
+ result.set("medium" /* medium */, processedValues["medium" /* medium */]);
3951
+ result.set("large" /* large */, processedValues["large" /* large */]);
3952
+ return result;
3953
+ }, [processedValues]);
3898
3954
  const items = useMemo(() => {
3899
3955
  const baseItems = [
3900
3956
  {
@@ -3915,10 +3971,7 @@ var StatefulLineHeight = ({ standalone = true }) => {
3915
3971
  label: t("reader.preferences.lineHeight.large"),
3916
3972
  value: "large" /* large */
3917
3973
  }
3918
- ].filter((item) => {
3919
- const v = lineHeightOptions[item.id];
3920
- return effectivePresets === void 0 || effectivePresets.includes(v);
3921
- });
3974
+ ].filter((item) => processedPresets.has(item.id));
3922
3975
  if (preferences.settings.keys["lineHeight" /* lineHeight */].allowUnset !== false) {
3923
3976
  baseItems.unshift({
3924
3977
  id: "publisher" /* publisher */,
@@ -3928,16 +3981,16 @@ var StatefulLineHeight = ({ standalone = true }) => {
3928
3981
  });
3929
3982
  }
3930
3983
  return baseItems;
3931
- }, [preferences.settings.keys, lineHeightOptions, effectivePresets, t]);
3984
+ }, [preferences.settings.keys, processedPresets, t]);
3932
3985
  const updatePreference = useCallback(async (value) => {
3933
- const computedValue = value === "publisher" /* publisher */ ? null : lineHeightOptions[value];
3986
+ const submitValue = value === "publisher" /* publisher */ ? null : processedPresets.get(value) ?? null;
3934
3987
  await submitPreferences({
3935
- [prefKey]: computedValue
3988
+ [prefKey]: submitValue
3936
3989
  });
3937
- const currentLineHeight = getSetting(prefKey);
3938
- const currentDisplayLineHeightOption = Object.entries(lineHeightOptions).find(([key, value2]) => value2 === currentLineHeight)?.[0];
3990
+ const storedLineHeight = getSetting(prefKey);
3991
+ const currentDisplayLineHeightOption = [...processedPresets.entries()].find(([, v]) => v === storedLineHeight)?.[0];
3939
3992
  setLineHeight2(currentDisplayLineHeightOption);
3940
- }, [prefKey, submitPreferences, getSetting, setLineHeight2, lineHeightOptions]);
3993
+ }, [prefKey, submitPreferences, getSetting, setLineHeight2, processedPresets]);
3941
3994
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
3942
3995
  StatefulRadioGroup,
3943
3996
  {
@@ -4113,7 +4166,7 @@ var StatefulPublisherStyles = ({ standalone = true }) => {
4113
4166
  const paragraphSpacing = getEffectiveSpacingValue("paragraphSpacing" /* paragraphSpacing */);
4114
4167
  const letterSpacing = getEffectiveSpacingValue("letterSpacing" /* letterSpacing */);
4115
4168
  const wordSpacing = getEffectiveSpacingValue("wordSpacing" /* wordSpacing */);
4116
- const lineHeightOptions = useLineHeight();
4169
+ const { compensatedValues: lineHeightOptions } = useLineHeight();
4117
4170
  const { submitPreferences } = useNavigator().visual;
4118
4171
  const lineHeightPrefKey = SETTINGS_KEY_TO_PREFERENCE["lineHeight" /* lineHeight */];
4119
4172
  const paragraphIndentPrefKey = SETTINGS_KEY_TO_PREFERENCE["paragraphIndent" /* paragraphIndent */];
@@ -4206,7 +4259,7 @@ var StatefulSpacingPresets = ({ standalone }) => {
4206
4259
  const paragraphIndentPrefKey = SETTINGS_KEY_TO_PREFERENCE["paragraphIndent" /* paragraphIndent */];
4207
4260
  const paragraphSpacingPrefKey = SETTINGS_KEY_TO_PREFERENCE["paragraphSpacing" /* paragraphSpacing */];
4208
4261
  const wordSpacingPrefKey = SETTINGS_KEY_TO_PREFERENCE["wordSpacing" /* wordSpacing */];
4209
- const lineHeightOptions = useLineHeight();
4262
+ const { values: lineHeightOptions, compensate: compensateLineHeight } = useLineHeight();
4210
4263
  const { getPresetValues } = useSpacingPresets();
4211
4264
  const publicationType = isWebPub ? "webpub" : isFXL ? "fxl" : "reflow";
4212
4265
  const { isComponentUsed: isLetterSpacingUsed } = useSettingsComponentStatus({
@@ -4240,7 +4293,7 @@ var StatefulSpacingPresets = ({ standalone }) => {
4240
4293
  ["wordSpacing" /* wordSpacing */]: presetValues?.["wordSpacing" /* wordSpacing */] ?? null
4241
4294
  };
4242
4295
  const lineHeightValue = reduxValues["lineHeight" /* lineHeight */];
4243
- const lineHeightValueNumber = lineHeightValue && lineHeightValue !== "publisher" /* publisher */ ? lineHeightOptions[lineHeightValue] : null;
4296
+ const lineHeightValueNumber = lineHeightValue && lineHeightValue !== "publisher" /* publisher */ ? compensateLineHeight(lineHeightOptions[lineHeightValue]) : null;
4244
4297
  const preferencesToSubmit = {};
4245
4298
  if (isLetterSpacingUsed) {
4246
4299
  preferencesToSubmit[letterSpacingPrefKey] = reduxValues["letterSpacing" /* letterSpacing */];
@@ -4269,7 +4322,7 @@ var StatefulSpacingPresets = ({ standalone }) => {
4269
4322
  values: reduxValues
4270
4323
  }));
4271
4324
  }
4272
- }, [isWebPub, dispatch, submitPreferences, getPresetValues, lineHeightOptions, letterSpacingPrefKey, lineHeightPrefKey, paragraphIndentPrefKey, paragraphSpacingPrefKey, wordSpacingPrefKey, isLetterSpacingUsed, isLineHeightUsed, isParagraphIndentUsed, isParagraphSpacingUsed, isWordSpacingUsed]);
4325
+ }, [isWebPub, dispatch, submitPreferences, getPresetValues, lineHeightOptions, compensateLineHeight, letterSpacingPrefKey, lineHeightPrefKey, paragraphIndentPrefKey, paragraphSpacingPrefKey, wordSpacingPrefKey, isLetterSpacingUsed, isLineHeightUsed, isParagraphIndentUsed, isParagraphSpacingUsed, isWordSpacingUsed]);
4273
4326
  const spacingKeys = useMemo(() => {
4274
4327
  const baseKeys = isWebPub ? webPubSpacingPresetKeys : isFXL ? fxlSpacingPresetKeys : reflowSpacingPresetKeys;
4275
4328
  const subPanelKeys = subPanelSpacingSettingsKeys || [];
@@ -4315,6 +4368,7 @@ var StatefulTextAlign = ({ standalone = true }) => {
4315
4368
  const isWebPub = profile === "webPub";
4316
4369
  const isRTL = useAppSelector((state) => state.publication.isRTL);
4317
4370
  const textAlign = useReaderSetting("textAlign");
4371
+ const hyphens = useReaderSetting("hyphens");
4318
4372
  const dispatch = useAppDispatch();
4319
4373
  const { getSetting, submitPreferences } = useNavigator().visual;
4320
4374
  const hyphensPrefKey = SETTINGS_KEY_TO_PREFERENCE["hyphens" /* hyphens */];
@@ -4345,27 +4399,40 @@ var StatefulTextAlign = ({ standalone = true }) => {
4345
4399
  }
4346
4400
  ];
4347
4401
  const updatePreference = useCallback(async (value) => {
4348
- const textAlign2 = value === "publisher" /* publisher */ ? null : value === "start" /* start */ ? TextAlignment.start : TextAlignment.justify;
4349
- const currentHyphens = getSetting(hyphensPrefKey);
4350
- const hyphens = textAlign2 === null ? null : currentHyphens ?? textAlign2 === TextAlignment.justify;
4402
+ const oldTextAlign = textAlign;
4403
+ const navigatorTextAlign = value === "publisher" /* publisher */ ? null : value === "start" /* start */ ? TextAlignment.start : TextAlignment.justify;
4351
4404
  const preferencesToSubmit = {
4352
- [textAlignPrefKey]: textAlign2
4405
+ [textAlignPrefKey]: navigatorTextAlign
4353
4406
  };
4354
- if (isHyphensUsed) {
4355
- preferencesToSubmit[hyphensPrefKey] = hyphens;
4356
- }
4357
4407
  await submitPreferences(preferencesToSubmit);
4358
4408
  const textAlignSetting = getSetting(textAlignPrefKey);
4359
4409
  const textAlignValue = textAlignSetting === null ? "publisher" /* publisher */ : textAlignSetting;
4360
- const effectiveHyphens = getSetting(hyphensPrefKey);
4361
4410
  if (isWebPub) {
4362
4411
  dispatch(setWebPubTextAlign(textAlignValue));
4363
- dispatch(setWebPubHyphens(effectiveHyphens));
4364
4412
  } else {
4365
4413
  dispatch(setTextAlign(textAlignValue));
4366
- dispatch(setHyphens(effectiveHyphens));
4367
4414
  }
4368
- }, [hyphensPrefKey, textAlignPrefKey, isWebPub, getSetting, submitPreferences, dispatch, isHyphensUsed]);
4415
+ if (isHyphensUsed) {
4416
+ if (navigatorTextAlign === null) {
4417
+ await submitPreferences({ [hyphensPrefKey]: null });
4418
+ } else {
4419
+ const wasPublisher = oldTextAlign === "publisher" /* publisher */;
4420
+ let hyphensToSubmit;
4421
+ if (wasPublisher && hyphens === null) {
4422
+ hyphensToSubmit = navigatorTextAlign === TextAlignment.justify;
4423
+ } else {
4424
+ hyphensToSubmit = hyphens;
4425
+ }
4426
+ await submitPreferences({ [hyphensPrefKey]: hyphensToSubmit });
4427
+ const effectiveHyphens = getSetting(hyphensPrefKey);
4428
+ if (isWebPub) {
4429
+ dispatch(setWebPubHyphens(effectiveHyphens));
4430
+ } else {
4431
+ dispatch(setHyphens(effectiveHyphens));
4432
+ }
4433
+ }
4434
+ }
4435
+ }, [hyphensPrefKey, textAlignPrefKey, isWebPub, getSetting, submitPreferences, dispatch, isHyphensUsed, hyphens, textAlign]);
4369
4436
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
4370
4437
  StatefulRadioGroup,
4371
4438
  {
@@ -4736,7 +4803,7 @@ var createDefaultPlugin = () => {
4736
4803
  id: "core",
4737
4804
  name: "Core Components",
4738
4805
  description: "Default components for Thorium Web Epub StatefulReader",
4739
- version: "1.4.0",
4806
+ version: "1.5.0",
4740
4807
  components: {
4741
4808
  actions: {
4742
4809
  ["fullscreen" /* fullscreen */]: {
@@ -5330,6 +5397,8 @@ var StatefulAudioVolumeTrigger = ({ ref }) => {
5330
5397
  const { t } = useI18n();
5331
5398
  const profile = useAppSelector((state) => state.reader.profile);
5332
5399
  const { preferences } = useAudioPreferences();
5400
+ const { actionsKeys } = useActionsPreferences();
5401
+ const shortcut = actionsKeys["audio.volume" /* volume */]?.shortcut;
5333
5402
  const { preferencesEditor } = useNavigator().media;
5334
5403
  const volume = useAppSelector((state) => state.audioSettings.volume);
5335
5404
  const isTrackReady = useAppSelector((state) => state.player.isTrackReady);
@@ -5345,11 +5414,13 @@ var StatefulAudioVolumeTrigger = ({ ref }) => {
5345
5414
  if (volume <= max / 3 * 2) return volume_down_default;
5346
5415
  return volume_up_default;
5347
5416
  }, [volume, range]);
5417
+ if (isIOSish()) return null;
5348
5418
  return /* @__PURE__ */ jsx(
5349
5419
  StatefulActionIcon,
5350
5420
  {
5351
5421
  ref,
5352
5422
  tooltipLabel: t("reader.playback.preferences.audio.volume"),
5423
+ shortcut,
5353
5424
  placement: "top",
5354
5425
  onPress: () => {
5355
5426
  if (profile) {
@@ -5385,6 +5456,7 @@ var StatefulAudioVolumeContainer = ({ triggerRef, placement = "top" }) => {
5385
5456
  dispatch(setActionOpen({ key: "audio.volume" /* volume */, isOpen: open, profile }));
5386
5457
  }
5387
5458
  }, [dispatch, profile]);
5459
+ if (isIOSish()) return null;
5388
5460
  return /* @__PURE__ */ jsx(
5389
5461
  StatefulSheetWrapper,
5390
5462
  {
@@ -5432,6 +5504,8 @@ var thorium_web_playbackRate_default = {
5432
5504
  var StatefulAudioPlaybackRateTrigger = ({ ref }) => {
5433
5505
  const { t } = useI18n();
5434
5506
  const profile = useAppSelector((state) => state.reader.profile);
5507
+ const { actionsKeys } = useActionsPreferences();
5508
+ const shortcut = actionsKeys["audio.playbackRate" /* playbackRate */]?.shortcut;
5435
5509
  const playbackRate = useAppSelector((state) => state.audioSettings.playbackRate);
5436
5510
  const isTrackReady = useAppSelector((state) => state.player.isTrackReady);
5437
5511
  const isStalled = useAppSelector((state) => state.player.isStalled);
@@ -5442,6 +5516,7 @@ var StatefulAudioPlaybackRateTrigger = ({ ref }) => {
5442
5516
  {
5443
5517
  ref,
5444
5518
  tooltipLabel: t("reader.playback.preferences.playbackRate.descriptive"),
5519
+ shortcut,
5445
5520
  placement: "top",
5446
5521
  onPress: () => {
5447
5522
  if (profile) {
@@ -5547,6 +5622,8 @@ var thorium_web_audioToc_default = {
5547
5622
  var StatefulAudioTocTrigger = ({ ref }) => {
5548
5623
  const { t } = useI18n();
5549
5624
  const profile = useAppSelector((state) => state.reader.profile);
5625
+ const { actionsKeys } = useActionsPreferences();
5626
+ const shortcut = actionsKeys["audio.toc" /* toc */]?.shortcut;
5550
5627
  const isTrackReady = useAppSelector((state) => state.player.isTrackReady);
5551
5628
  const isStalled = useAppSelector((state) => state.player.isStalled);
5552
5629
  const isDisabled = !isTrackReady || isStalled;
@@ -5556,6 +5633,7 @@ var StatefulAudioTocTrigger = ({ ref }) => {
5556
5633
  {
5557
5634
  ref,
5558
5635
  tooltipLabel: t("reader.tableOfContents.title"),
5636
+ shortcut,
5559
5637
  placement: "top",
5560
5638
  onPress: () => {
5561
5639
  if (profile) {
@@ -5675,6 +5753,8 @@ var thorium_web_sleepTimer_default = {
5675
5753
  var StatefulAudioSleepTimerTrigger = ({ ref }) => {
5676
5754
  const { t } = useI18n();
5677
5755
  const profile = useAppSelector((state) => state.reader.profile);
5756
+ const { actionsKeys } = useActionsPreferences();
5757
+ const shortcut = actionsKeys["audio.sleepTimer" /* sleepTimer */]?.shortcut;
5678
5758
  const remainingSeconds = useAppSelector((state) => state.player.sleepTimer.remainingSeconds);
5679
5759
  const onTrackEnd = useAppSelector((state) => state.player.sleepTimer.onTrackEnd);
5680
5760
  const onFragmentEnd = useAppSelector((state) => state.player.sleepTimer.onFragmentEnd);
@@ -5697,6 +5777,7 @@ var StatefulAudioSleepTimerTrigger = ({ ref }) => {
5697
5777
  {
5698
5778
  ref,
5699
5779
  tooltipLabel: t("reader.playback.preferences.sleepTimer.descriptive"),
5780
+ shortcut,
5700
5781
  placement: "top",
5701
5782
  onPress: () => {
5702
5783
  if (profile) {
@@ -5998,7 +6079,7 @@ var createAudioDefaultPlugin = () => {
5998
6079
  id: "audio-core",
5999
6080
  name: "Audio Core Components",
6000
6081
  description: "Default components for Thorium Web Audio StatefulReader",
6001
- version: "1.4.0",
6082
+ version: "1.5.0",
6002
6083
  components: {
6003
6084
  actions: {
6004
6085
  ["settings" /* settings */]: {
@@ -6064,6 +6145,39 @@ var StatefulGlobalPreferencesProvider = ({
6064
6145
  return /* @__PURE__ */ jsx(ThGlobalPreferencesProvider, { adapter, initialPreferences, children });
6065
6146
  };
6066
6147
 
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
+
6067
6181
  // src/components/assets/styles/thorium-web.reader.app.module.css
6068
6182
  var thorium_web_reader_app_default = {
6069
6183
  wrapper: "thorium_web_reader_app_wrapper",
@@ -6556,6 +6670,6 @@ var useReaderHeaderBase = (actionKeys) => {
6556
6670
  };
6557
6671
  };
6558
6672
 
6559
- export { NavigatorProvider, 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, createAudioDefaultPlugin, createDefaultPlugin, thorium_web_button_default, thorium_web_overflow_default, thorium_web_reader_app_default, thorium_web_reader_header_default, useDocking, useEffectiveRange, useGridNavigation, useGridTemplate, useIsScroll, useLineHeight, useNavigator, usePlaceholder, usePositionStorage, usePublication, useReaderHeaderBase, useReaderSetting, useReaderTransitions, useSettingsComponentStatus, useSpacingPresets };
6560
- //# sourceMappingURL=chunk-PXXWEMNL.mjs.map
6561
- //# sourceMappingURL=chunk-PXXWEMNL.mjs.map
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-KJ55Q63A.mjs.map
6675
+ //# sourceMappingURL=chunk-KJ55Q63A.mjs.map