@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,7 +1,7 @@
1
- import { e as UnstableShortcutRepresentation } from './keyboardUtilities-BWAyLS_D.mjs';
1
+ import { S as ShortcutRepresentation } from './keyboardUtilities-BCP3UcLb.mjs';
2
2
  import { B as BreakpointsMap, d as ThBreakpoints, e as ThBreakpointsObject, f as ThDocumentTitleFormat, T as ThBackLinkPref, g as ThFormatPref, h as ThRunningHeadFormat, i as ThProgressionFormat, j as ThLayoutUI, k as ThPaginatedAffordancePref } from './ui-DnZZhozX.mjs';
3
- import { I as I18nValue, e as ThColorScheme, f as ThContrast, g as ThSettingsKeys, h as ThTextSettingsKeys, b as ThSpacingSettingsKeys, d as ThSettingsRangePrefRequired, i as ThSettingsRadioPref, T as ThLineHeightOptions, j as ThSettingsGroupPref, a as ThSpacingPresetKeys } from './useContrast-Bo7cDw_X.mjs';
4
- import { e as ThSheetTypes, g as ThActionsKeys, d as ThCollapsibility, c as ThActionsTokens, f as ThDockingPref, T as ThDockingKeys } from './actions-BjeRjaJU.mjs';
3
+ import { e as ThColorScheme, f as ThContrast, g as ThSettingsKeys, h as ThTextSettingsKeys, b as ThSpacingSettingsKeys, d as ThSettingsRangePrefRequired, i as ThSettingsRadioPref, T as ThLineHeightOptions, j as ThSettingsGroupPref, a as ThSpacingPresetKeys } from './useContrast-Bl08zDTU.mjs';
4
+ import { I as I18nValue, e as ThSheetTypes, g as ThActionsKeys, d as ThCollapsibility, c as ThActionsTokens, f as ThDockingPref, T as ThDockingKeys } from './actions-C33UN3Ji.mjs';
5
5
  import { IContentProtectionConfig, IAudioContentProtectionConfig, ExperimentKey } from '@readium/navigator';
6
6
 
7
7
  type CSSValueUnitless = `${number}`;
@@ -350,8 +350,9 @@ interface useThemingProps<T extends string> {
350
350
  onMonochromeChange?: (isMonochrome: boolean) => void;
351
351
  onReducedMotionChange?: (reducedMotion: boolean) => void;
352
352
  onReducedTransparencyChange?: (reducedTransparency: boolean) => void;
353
+ onContainerBreakpointChange?: (breakpoint: ThBreakpoints | null) => void;
353
354
  }
354
- declare const useTheming: <T extends string>({ theme, systemKeys, themeKeys, breakpointsMap, initProps, coverUrl, autoThemeSource, onBreakpointChange, onColorSchemeChange, onContrastChange, onForcedColorsChange, onMonochromeChange, onReducedMotionChange, onReducedTransparencyChange, onCoverThemeGenerated, }: useThemingProps<T>) => {
355
+ declare const useTheming: <T extends string>({ theme, systemKeys, themeKeys, breakpointsMap, initProps, coverUrl, autoThemeSource, onBreakpointChange, onColorSchemeChange, onContrastChange, onForcedColorsChange, onMonochromeChange, onReducedMotionChange, onReducedTransparencyChange, onCoverThemeGenerated, onContainerBreakpointChange, }: useThemingProps<T>) => {
355
356
  inferThemeAuto: () => T | undefined;
356
357
  theme: string | undefined;
357
358
  breakpoints: ThBreakpointsObject;
@@ -363,6 +364,7 @@ declare const useTheming: <T extends string>({ theme, systemKeys, themeKeys, bre
363
364
  reducedTransparency: boolean;
364
365
  coverThemeTokens: ThemeTokens | null;
365
366
  themeResolved: boolean;
367
+ setContainerRef: (el: Element | null) => void;
366
368
  };
367
369
 
368
370
  interface ThGlobalPreferences {
@@ -445,6 +447,21 @@ type ThSettingsKeyTypes<K extends CustomizableKeys = DefaultKeys> = {
445
447
  [key in S]: any;
446
448
  } : {} : {});
447
449
  type ThConstraintKeys = Extract<ThSheetTypes, ThSheetTypes.bottomSheet | ThSheetTypes.popover | ThSheetTypes.modal> | "pagination" | "dropdown";
450
+ type ThShortcutsDisplayIn = "tooltip" | "menuItem";
451
+ interface ThShortcutsPref {
452
+ representation: ShortcutRepresentation;
453
+ joiner?: string;
454
+ displayIn?: ThShortcutsDisplayIn[];
455
+ }
456
+ interface ThIconPref {
457
+ size: number;
458
+ tooltipOffset: number;
459
+ tooltipDelay?: number;
460
+ }
461
+ interface ThLayoutDefaultsPref {
462
+ dockingWidth: number;
463
+ scrim: string;
464
+ }
448
465
  interface ThPreferences<K extends CustomizableKeys = {}> {
449
466
  experiments?: {
450
467
  reflow?: Array<ExperimentKey>;
@@ -484,11 +501,7 @@ interface ThPreferences<K extends CustomizableKeys = {}> {
484
501
  offset: number;
485
502
  tooltipDelay?: number;
486
503
  };
487
- icon: {
488
- size: number;
489
- tooltipOffset: number;
490
- tooltipDelay?: number;
491
- };
504
+ icon: ThIconPref;
492
505
  layout: {
493
506
  ui?: {
494
507
  reflow?: ThLayoutUI;
@@ -497,10 +510,7 @@ interface ThPreferences<K extends CustomizableKeys = {}> {
497
510
  };
498
511
  radius: number;
499
512
  spacing: number;
500
- defaults: {
501
- dockingWidth: number;
502
- scrim: string;
503
- };
513
+ defaults: ThLayoutDefaultsPref;
504
514
  constraints?: {
505
515
  [key in ThConstraintKeys]?: number | null;
506
516
  };
@@ -530,10 +540,7 @@ interface ThPreferences<K extends CustomizableKeys = {}> {
530
540
  };
531
541
  };
532
542
  actions: ThActionsPref<K>;
533
- shortcuts: {
534
- representation: UnstableShortcutRepresentation;
535
- joiner?: string;
536
- };
543
+ shortcuts: ThShortcutsPref;
537
544
  docking: ThDockingPref<ThDockingKeys>;
538
545
  settings: {
539
546
  reflowOrder: Array<SettingsKey<K>>;
@@ -565,4 +572,4 @@ interface ThPreferencesAdapter<T extends CustomizableKeys = CustomizableKeys> {
565
572
  unsubscribe(callback: (prefs: ThPreferences<T>) => void): void;
566
573
  }
567
574
 
568
- export { type LocalVariableFontFile as $, type ActionKey as A, type CSSAbsoluteLength as B, type CustomizableKeys as C, type DefaultKeys as D, type CSSAngle as E, type FontCollection as F, type CSSDefaultViewport as G, type CSSDynamicViewport as H, type CSSFrequency as I, type CSSFontRelativeLength as J, type CSSLargeViewport as K, type LocalStaticFontFile as L, type CSSPhysicalLength as M, type CSSRelativeLength as N, type CSSResolution as O, type CSSRootFontRelativeLength as P, type CSSSmallViewport as Q, type CSSTime as R, type SettingsKey as S, ThThemeKeys as T, type CSSViewport as U, type VariableFontRangeConfig as V, type WeightConfig as W, type CSSColor as X, type SystemFontSource as Y, type BunnyFontSource as Z, type GoogleFontSource as _, type ThemeTokens as a, type LocalStaticFontSource as a0, type LocalVariableFontSource as a1, type LocalFontSource as a2, type FontSource as a3, type FontSpec as a4, type ValidatedLanguageCollection as a5, type ThFontFamilyPref as a6, readiumCSSFontCollection as a7, defaultFontCollection as a8, tamilCollection as a9, arabicFarsiCollection as aa, hebrewCollection as ab, chineseSimplifiedCollection as ac, chineseTraditionalCollection as ad, japaneseCollection as ae, japaneseVerticalCollection as af, koreanCollection as ag, type CopyProtectionConfig as ah, type PrintProtectionConfig as ai, type ContentProtectionConfig as aj, resolveContentProtectionConfig as ak, resolveAudioContentProtectionConfig as al, defaultContentProtectionConfig as am, defaultAudioContentProtectionConfig as an, devContentProtectionConfig as ao, lightTheme as ap, darkTheme as aq, paperTheme as ar, sepiaTheme as as, contrast1Theme as at, contrast2Theme as au, contrast3Theme as av, type AudioContentProtectionConfig as b, type ThPreferencesAdapter as c, type ThPreferences as d, type ThGlobalPreferences as e, type ThGlobalPreferencesAdapter as f, type FontDefinition as g, createGlobalPreferences as h, type ThemeKey as i, type TextSettingsKey as j, type SpacingSettingsKey as k, type ThSettingsSpacingPresets as l, type ThSpacingPreset as m, type ThActionsPref as n, type ThSettingsKeyTypes as o, type ThConstraintKeys as p, createPreferences as q, type ActionKeyType as r, type ThemeKeyType as s, type SettingsKeyType as t, useTheming as u, type TextSettingsKeyType as v, type SpacingSettingsKeyType as w, type useThemingProps as x, type CSSValueUnitless as y, type CSSValueWithUnit as z };
575
+ export { type CSSColor as $, type ActionKey as A, type SpacingSettingsKeyType as B, type CustomizableKeys as C, type DefaultKeys as D, type useThemingProps as E, type FontCollection as F, type CSSValueUnitless as G, type CSSValueWithUnit as H, type CSSAbsoluteLength as I, type CSSAngle as J, type CSSDefaultViewport as K, type LocalStaticFontFile as L, type CSSDynamicViewport as M, type CSSFrequency as N, type CSSFontRelativeLength as O, type CSSLargeViewport as P, type CSSPhysicalLength as Q, type CSSRelativeLength as R, type SettingsKey as S, ThThemeKeys as T, type CSSResolution as U, type VariableFontRangeConfig as V, type WeightConfig as W, type CSSRootFontRelativeLength as X, type CSSSmallViewport as Y, type CSSTime as Z, type CSSViewport as _, type ThemeTokens as a, type SystemFontSource as a0, type BunnyFontSource as a1, type GoogleFontSource as a2, type LocalVariableFontFile as a3, type LocalStaticFontSource as a4, type LocalVariableFontSource as a5, type LocalFontSource as a6, type FontSource as a7, type FontSpec as a8, type ValidatedLanguageCollection as a9, type ThFontFamilyPref as aa, readiumCSSFontCollection as ab, defaultFontCollection as ac, tamilCollection as ad, arabicFarsiCollection as ae, hebrewCollection as af, chineseSimplifiedCollection as ag, chineseTraditionalCollection as ah, japaneseCollection as ai, japaneseVerticalCollection as aj, koreanCollection as ak, type CopyProtectionConfig as al, type PrintProtectionConfig as am, type ContentProtectionConfig as an, resolveContentProtectionConfig as ao, resolveAudioContentProtectionConfig as ap, defaultContentProtectionConfig as aq, defaultAudioContentProtectionConfig as ar, devContentProtectionConfig as as, lightTheme as at, darkTheme as au, paperTheme as av, sepiaTheme as aw, contrast1Theme as ax, contrast2Theme as ay, contrast3Theme as az, type AudioContentProtectionConfig as b, type ThShortcutsPref as c, type ThPreferencesAdapter as d, type ThPreferences as e, type ThGlobalPreferences as f, type ThGlobalPreferencesAdapter as g, type FontDefinition as h, type ThIconPref as i, type ThLayoutDefaultsPref as j, createGlobalPreferences as k, type ThemeKey as l, type TextSettingsKey as m, type SpacingSettingsKey as n, type ThSettingsSpacingPresets as o, type ThSpacingPreset as p, type ThActionsPref as q, type ThSettingsKeyTypes as r, type ThConstraintKeys as s, type ThShortcutsDisplayIn as t, useTheming as u, createPreferences as v, type ActionKeyType as w, type ThemeKeyType as x, type SettingsKeyType as y, type TextSettingsKeyType as z };
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default, { ComponentType, SVGProps } from 'react';
3
3
  import { TooltipTriggerProps, KeyboardProps } from 'react-aria';
4
4
  import { ButtonProps, TooltipProps, MenuItemProps, LabelProps, MenuProps, MenuTriggerProps, PopoverProps, NumberFieldProps, GroupProps, InputProps, RadioGroupProps, RadioProps, SliderProps, SliderOutputProps, SliderTrackProps, SliderThumbProps, SwitchProps, HeadingProps, SelectProps, Button, ListBoxProps, ListBox, ListBoxItemProps, Heading } from 'react-aria-components';
5
- import { h as ThActionEntry, i as ThActionsBarProps, C as CollapsiblePref } from './actions-BjeRjaJU.mjs';
5
+ import { h as ThActionEntry, i as ThActionsBarProps, C as CollapsiblePref } from './actions-C33UN3Ji.mjs';
6
6
 
7
7
  interface HTMLAttributesWithRef<T> extends React.HTMLAttributes<T> {
8
8
  ref?: React.ForwardedRef<T>;
@@ -13,7 +13,7 @@ type WithRef<T, K> = T & {
13
13
 
14
14
  interface ThActionButtonProps extends ButtonProps {
15
15
  label?: string;
16
- ref?: React.ForwardedRef<HTMLButtonElement>;
16
+ ref?: React__default.ForwardedRef<HTMLButtonElement>;
17
17
  compounds?: {
18
18
  /**
19
19
  * Props for the tooltipTrigger component. See `TooltipTriggerProps` for more information.
@@ -24,9 +24,9 @@ interface ThActionButtonProps extends ButtonProps {
24
24
  */
25
25
  tooltip?: WithRef<TooltipProps, HTMLDivElement>;
26
26
  /**
27
- * String for the tooltip
27
+ * Content for the tooltip
28
28
  */
29
- label: string;
29
+ label: React__default.ReactNode;
30
30
  };
31
31
  }
32
32
  declare const ThActionButton: ({ ref, compounds, children, ...props }: ThActionButtonProps) => react_jsx_runtime.JSX.Element;
@@ -1,6 +1,8 @@
1
+ import { RefObject } from 'react';
1
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
3
  import { ToolbarProps } from 'react-aria-components';
3
4
  import { B as BreakpointsMap } from './ui-DnZZhozX.mjs';
5
+ import { KeyCombo } from '@readium/navigator-html-injectables';
4
6
 
5
7
  declare enum ThActionsTriggerVariant {
6
8
  button = "iconButton",
@@ -33,15 +35,27 @@ interface CollapsiblePref {
33
35
  };
34
36
  };
35
37
  }
36
- declare const useCollapsibility: (items: ThActionEntry<string>[], prefs: CollapsiblePref, breakpoint?: string) => {
38
+ declare const useCollapsibility: (items: ThActionEntry<string>[], prefs: CollapsiblePref, breakpoint?: string, containerRef?: RefObject<HTMLElement | null>) => {
37
39
  ActionIcons: ThActionEntry<string>[];
38
40
  MenuItems: ThActionEntry<string>[];
41
+ getItemRef: (key: string) => (el: HTMLElement | null) => void;
42
+ getGhostRef: (el: HTMLDivElement | null) => void;
39
43
  };
40
44
 
45
+ type I18nValue<T> = T | string | {
46
+ key: string;
47
+ fallback?: string;
48
+ };
49
+
50
+ interface ThShortcutConfig {
51
+ keyCombos: KeyCombo[];
52
+ label?: I18nValue<string>;
53
+ }
54
+ declare const TEXT_INPUT_SELECTORS: string[];
41
55
  type ThBottomSheetDetent = "content-height" | "full-height";
42
56
  interface ThActionsTokens {
43
57
  visibility: ThCollapsibilityVisibility;
44
- shortcut: string | null;
58
+ shortcut: ThShortcutConfig | null;
45
59
  sheet?: {
46
60
  defaultSheet: Exclude<ThSheetTypes, ThSheetTypes.dockedStart | ThSheetTypes.dockedEnd | ThSheetTypes.compactPopover>;
47
61
  breakpoints: BreakpointsMap<Exclude<ThSheetTypes, ThSheetTypes.compactPopover>>;
@@ -51,7 +65,7 @@ interface ThActionsTokens {
51
65
  }
52
66
  interface ThAudioActionsTokens {
53
67
  visibility: ThCollapsibilityVisibility;
54
- shortcut: string | null;
68
+ shortcut: ThShortcutConfig | null;
55
69
  sheet?: {
56
70
  defaultSheet: Exclude<ThSheetTypes, ThSheetTypes.dockedStart | ThSheetTypes.dockedEnd | ThSheetTypes.popover>;
57
71
  breakpoints: BreakpointsMap<Exclude<ThSheetTypes, ThSheetTypes.popover>>;
@@ -117,4 +131,4 @@ declare const defaultFullscreenAction: ThActionsTokens;
117
131
  declare const defaultTocAction: ThActionsTokens;
118
132
  declare const defaultJumpToPositionAction: ThActionsTokens;
119
133
 
120
- export { type CollapsiblePref as C, ThDockingKeys as T, ThSheetHeaderVariant as a, type ThAudioActionsTokens as b, type ThActionsTokens as c, type ThCollapsibility as d, ThSheetTypes as e, type ThDockingPref as f, ThActionsKeys as g, type ThActionEntry as h, type ThActionsBarProps as i, type ThBottomSheetDetent as j, type ThActionsDockedPref as k, type ThActionsSnappedPref as l, ThDockingTypes as m, defaultActionKeysObject as n, defaultSettingsAction as o, defaultFullscreenAction as p, defaultTocAction as q, defaultJumpToPositionAction as r, ThCollapsibilityVisibility as s, ThActionsTriggerVariant as t, useCollapsibility as u, ThActionsBar as v };
134
+ export { type CollapsiblePref as C, type I18nValue as I, ThDockingKeys as T, ThSheetHeaderVariant as a, type ThAudioActionsTokens as b, type ThActionsTokens as c, type ThCollapsibility as d, ThSheetTypes as e, type ThDockingPref as f, ThActionsKeys as g, type ThActionEntry as h, type ThActionsBarProps as i, type ThShortcutConfig as j, TEXT_INPUT_SELECTORS as k, type ThBottomSheetDetent as l, type ThActionsDockedPref as m, type ThActionsSnappedPref as n, ThDockingTypes as o, defaultActionKeysObject as p, defaultSettingsAction as q, defaultFullscreenAction as r, defaultTocAction as s, defaultJumpToPositionAction as t, ThCollapsibilityVisibility as u, useCollapsibility as v, ThActionsTriggerVariant as w, ThActionsBar as x };
@@ -1,6 +1,6 @@
1
1
  import * as _reduxjs_toolkit from '@reduxjs/toolkit';
2
2
  import { W as WritableDraft } from './immer.d-CoRThNOF.mjs';
3
- import { T as ThDockingKeys } from './actions-BjeRjaJU.mjs';
3
+ import { T as ThDockingKeys } from './actions-C33UN3Ji.mjs';
4
4
 
5
5
  type ActionsStateKeys = string;
6
6
  type OverflowStateKeys = string;
@@ -1,4 +1,4 @@
1
- import { supportedLocales } from './chunk-B3WDMWCT.mjs';
1
+ import { supportedLocales } from './chunk-GNROODJB.mjs';
2
2
  import i18n from 'i18next';
3
3
  export { default as i18n } from 'i18next';
4
4
  import { initReactI18next, useTranslation } from 'react-i18next';
@@ -67,5 +67,5 @@ var useI18n = (ns) => {
67
67
  };
68
68
 
69
69
  export { DEFAULT_CONFIG, initI18n, useI18n };
70
- //# sourceMappingURL=chunk-NUXGQWED.mjs.map
71
- //# sourceMappingURL=chunk-NUXGQWED.mjs.map
70
+ //# sourceMappingURL=chunk-2NCN2AG2.mjs.map
71
+ //# sourceMappingURL=chunk-2NCN2AG2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/i18n/config.ts","../src/i18n/useI18n.ts"],"names":["i18n"],"mappings":";;;;;;;;AAOO,IAAM,cAAA,GAA8B;AAAA,EACzC,WAAA,EAAa,IAAA;AAAA,EACb,IAAA,EAAM,KAAA;AAAA,EACN,wBAAA,EAA0B,IAAA;AAAA,EAC1B,aAAA,EAAe,gBAAA;AAAA,EACf,SAAA,EAAW;AAAA,IACT,KAAA,EAAO,CAAC,WAAW,CAAA;AAAA,IACnB,QAAQ;AAAC,GACX;AAAA,EACA,aAAA,EAAe;AAAA,IACb,WAAA,EAAa;AAAA,GACf;AAAA,EACA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,EAAA,EAAI,CAAC,gBAAA,EAAkB,aAAa,CAAA;AAAA,EACpC,SAAA,EAAW,CAAC,aAAA,EAAe,gBAAgB,CAAA;AAAA,EAC3C,iBAAA,EAAmB;AACrB;AAEO,IAAM,QAAA,GAAW,OAAO,OAAA,GAAgC,EAAC,KAAM;AACpE,EAAA,IAAI,KAAK,aAAA,EAAe;AACtB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA,CACJ,GAAA,CAAI,OAAO,CAAA,CACX,GAAA,CAAI,g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\"i18next-browser-languagedetector\";\nimport Backend from \"i18next-http-backend\";\nimport { InitOptions } from \"i18next\";\nimport { supportedLocales } from \"./supported-locales\";\n\nexport const DEFAULT_CONFIG: InitOptions = {\n fallbackLng: \"en\",\n load: \"all\",\n nonExplicitSupportedLngs: true,\n supportedLngs: supportedLocales,\n detection: {\n order: [\"navigator\"],\n caches: []\n },\n interpolation: {\n escapeValue: false\n },\n backend: {\n loadPath: \"/locales/{{lng}}/{{ns}}.json\"\n },\n ns: [\"thorium-shared\", \"thorium-web\"],\n defaultNS: [\"thorium-web\", \"thorium-shared\"],\n returnEmptyString: false\n};\n\nexport const initI18n = async (options: Partial<InitOptions> = {}) => {\n if (i18n.isInitialized) {\n return i18n;\n }\n\n return i18n\n .use(Backend)\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n ...DEFAULT_CONFIG,\n ...options\n });\n};\n\nexport { i18n };","import { useCallback } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { DEFAULT_CONFIG } from \"./config\";\n\n/**\n * Hook to access the i18n instance and translation functions\n * @param ns Optional additional namespace(s) to include alongside the default namespaces\n * @returns Translation functions and i18n instance\n */\nexport const useI18n = (ns?: string | string[]) => {\n // If no namespace provided, use both defaults with fallback\n // If namespace provided, use only that (override behavior)\n const { t: tRaw, i18n, ready } = useTranslation(ns || DEFAULT_CONFIG.ns as string[]);\n \n // Helper function to change language\n const changeLanguage = (lng: string) => {\n return i18n.changeLanguage(lng);\n };\n\n // Enhanced t function that searches both namespaces only when using defaults\n const t = useCallback((key: string, options?: any): string => {\n if (ns) {\n // If custom namespace provided, use it directly (no fallback)\n return tRaw(key, options) as string;\n } else {\n // If no namespace provided, search all default namespaces\n for (const namespace of DEFAULT_CONFIG.ns as string[]) {\n const result = tRaw(key, { ...options, ns: namespace });\n if (result !== key) return result as string;\n }\n return key;\n }\n }, [ns, tRaw]);\n\n return {\n // Translation function\n t,\n // i18n instance\n i18n,\n // Whether translations are loaded\n ready,\n // Current language\n currentLanguage: i18n.language,\n // List of available languages\n languages: i18n.languages,\n // Function to change language\n changeLanguage\n };\n};\n"]}
1
+ {"version":3,"sources":["../src/i18n/config.ts","../src/i18n/useI18n.ts"],"names":["i18n"],"mappings":";;;;;;;;AAOO,IAAM,cAAA,GAA8B;AAAA,EACzC,WAAA,EAAa,IAAA;AAAA,EACb,IAAA,EAAM,KAAA;AAAA,EACN,wBAAA,EAA0B,IAAA;AAAA,EAC1B,aAAA,EAAe,gBAAA;AAAA,EACf,SAAA,EAAW;AAAA,IACT,KAAA,EAAO,CAAC,WAAW,CAAA;AAAA,IACnB,QAAQ;AAAC,GACX;AAAA,EACA,aAAA,EAAe;AAAA,IACb,WAAA,EAAa;AAAA,GACf;AAAA,EACA,OAAA,EAAS;AAAA,IACP,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,EAAA,EAAI,CAAC,gBAAA,EAAkB,aAAa,CAAA;AAAA,EACpC,SAAA,EAAW,CAAC,aAAA,EAAe,gBAAgB,CAAA;AAAA,EAC3C,iBAAA,EAAmB;AACrB;AAEO,IAAM,QAAA,GAAW,OAAO,OAAA,GAAgC,EAAC,KAAM;AACpE,EAAA,IAAI,KAAK,aAAA,EAAe;AACtB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,IAAA,CACJ,GAAA,CAAI,OAAO,CAAA,CACX,GAAA,CAAI,gBAAgB,CAAA,CACpB,GAAA,CAAI,gBAAgB,CAAA,CACpB,IAAA,CAAK;AAAA,IACJ,GAAG,cAAA;AAAA,IACH,GAAG;AAAA,GACJ,CAAA;AACL;AC/BO,IAAM,OAAA,GAAU,CAAC,EAAA,KAA2B;AAGjD,EAAA,MAAM,EAAE,CAAA,EAAG,IAAA,EAAM,IAAA,EAAAA,KAAAA,EAAM,OAAM,GAAI,cAAA,CAAe,EAAA,IAAM,cAAA,CAAe,EAAc,CAAA;AAGnF,EAAA,MAAM,cAAA,GAAiB,CAAC,GAAA,KAAgB;AACtC,IAAA,OAAOA,KAAAA,CAAK,eAAe,GAAG,CAAA;AAAA,EAChC,CAAA;AAGA,EAAA,MAAM,CAAA,GAAI,WAAA,CAAY,CAAC,GAAA,EAAa,OAAA,KAA0B;AAC5D,IAAA,IAAI,EAAA,EAAI;AAEN,MAAA,OAAO,IAAA,CAAK,KAAK,OAAO,CAAA;AAAA,IAC1B,CAAA,MAAO;AAEL,MAAA,KAAA,MAAW,SAAA,IAAa,eAAe,EAAA,EAAgB;AACrD,QAAA,MAAM,MAAA,GAAS,KAAK,GAAA,EAAK,EAAE,GAAG,OAAA,EAAS,EAAA,EAAI,WAAW,CAAA;AACtD,QAAA,IAAI,MAAA,KAAW,KAAK,OAAO,MAAA;AAAA,MAC7B;AACA,MAAA,OAAO,GAAA;AAAA,IACT;AAAA,EACF,CAAA,EAAG,CAAC,EAAA,EAAI,IAAI,CAAC,CAAA;AAEb,EAAA,OAAO;AAAA;AAAA,IAEL,CAAA;AAAA;AAAA,IAEA,IAAA,EAAAA,KAAAA;AAAA;AAAA,IAEA,KAAA;AAAA;AAAA,IAEA,iBAAiBA,KAAAA,CAAK,QAAA;AAAA;AAAA,IAEtB,WAAWA,KAAAA,CAAK,SAAA;AAAA;AAAA,IAEhB;AAAA,GACF;AACF","file":"chunk-2NCN2AG2.mjs","sourcesContent":["import i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nimport Backend from \"i18next-http-backend\";\nimport { InitOptions } from \"i18next\";\nimport { supportedLocales } from \"./supported-locales\";\n\nexport const DEFAULT_CONFIG: InitOptions = {\n fallbackLng: \"en\",\n load: \"all\",\n nonExplicitSupportedLngs: true,\n supportedLngs: supportedLocales,\n detection: {\n order: [\"navigator\"],\n caches: []\n },\n interpolation: {\n escapeValue: false\n },\n backend: {\n loadPath: \"/locales/{{lng}}/{{ns}}.json\"\n },\n ns: [\"thorium-shared\", \"thorium-web\"],\n defaultNS: [\"thorium-web\", \"thorium-shared\"],\n returnEmptyString: false\n};\n\nexport const initI18n = async (options: Partial<InitOptions> = {}) => {\n if (i18n.isInitialized) {\n return i18n;\n }\n\n return i18n\n .use(Backend)\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n ...DEFAULT_CONFIG,\n ...options\n });\n};\n\nexport { i18n };","import { useCallback } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { DEFAULT_CONFIG } from \"./config\";\n\n/**\n * Hook to access the i18n instance and translation functions\n * @param ns Optional additional namespace(s) to include alongside the default namespaces\n * @returns Translation functions and i18n instance\n */\nexport const useI18n = (ns?: string | string[]) => {\n // If no namespace provided, use both defaults with fallback\n // If namespace provided, use only that (override behavior)\n const { t: tRaw, i18n, ready } = useTranslation(ns || DEFAULT_CONFIG.ns as string[]);\n \n // Helper function to change language\n const changeLanguage = (lng: string) => {\n return i18n.changeLanguage(lng);\n };\n\n // Enhanced t function that searches both namespaces only when using defaults\n const t = useCallback((key: string, options?: any): string => {\n if (ns) {\n // If custom namespace provided, use it directly (no fallback)\n return tRaw(key, options) as string;\n } else {\n // If no namespace provided, search all default namespaces\n for (const namespace of DEFAULT_CONFIG.ns as string[]) {\n const result = tRaw(key, { ...options, ns: namespace });\n if (result !== key) return result as string;\n }\n return key;\n }\n }, [ns, tRaw]);\n\n return {\n // Translation function\n t,\n // i18n instance\n i18n,\n // Whether translations are loaded\n ready,\n // Current language\n currentLanguage: i18n.language,\n // List of available languages\n languages: i18n.languages,\n // Function to change language\n changeLanguage\n };\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { ThGrid, ThLoader } from './chunk-P6ILEQ5P.mjs';
2
- import { useI18n } from './chunk-NUXGQWED.mjs';
1
+ import { ThGrid, ThLoader } from './chunk-ZD4LTF6G.mjs';
2
+ import { useI18n } from './chunk-2NCN2AG2.mjs';
3
3
  import { isValidElement, cloneElement } from 'react';
4
4
  import { Link } from 'react-aria-components';
5
5
  import classNames from 'classnames';
@@ -130,5 +130,5 @@ var ErrorDisplay = ({
130
130
  };
131
131
 
132
132
  export { DefaultImage, ErrorDisplay, PublicationGrid, StatefulLoader };
133
- //# sourceMappingURL=chunk-IVXRCKWR.mjs.map
134
- //# sourceMappingURL=chunk-IVXRCKWR.mjs.map
133
+ //# sourceMappingURL=chunk-2T65MDBR.mjs.map
134
+ //# sourceMappingURL=chunk-2T65MDBR.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Misc/assets/styles/thorium-web.publicationGrid.module.css","../src/components/Misc/PublicationGrid.tsx","../src/components/Misc/assets/styles/thorium-web.loader.module.css","../src/components/Misc/StatefulLoader.tsx","../src/components/Misc/assets/styles/thorium-web.error.module.css","../src/components/Misc/ErrorDisplay.tsx"],"names":["wrapper","card","cover","image","info","title","author","rendition","loader","jsx","message","jsxs"],"mappings":";;;;;;;;AAAA,IAAA,mCAAA,GAAA;AAAA,EAAC,OAAA,EAAAA,qCAAAA;AAAA,EAWA,IAAA,EAAAC,kCAAAA;AAAA,EAgBA,KAAA,EAAAC,mCAAAA;AAAA,EAQA,KAAA,EAAAC,mCAAAA;AAAA,EAMA,IAAA,EAAAC,kCAAAA;AAAA,EAOA,KAAA,EAAAC,mCAAAA;AAAA,EAOA,MAAA,EAAAC,oCAAAA;AAAA,EAMA,SAAA,EAAAC;AAAA,CAAA;AClDM,IAAM,eAAe,CAAC;AAAA,EAC3B,GAAA;AAAA,EACA,GAAA,GAAM;AACR,CAAA,qBAIE,GAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,GAAA;AAAA,IACA,WAAY,mCAAA,CAAsB,KAAA;AAAA,IAClC,OAAA,EAAQ;AAAA;AACV;AAkBK,IAAM,kBAAkB,CAAC;AAAA,EAC9B,YAAA;AAAA,EACA,WAAA,GAAc,GAAA;AAAA,EACd,GAAA,GAAM,QAAA;AAAA,EACN,WAAA,GAAc,CAAC,WAAA,qBACb,GAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACC,KAAM,WAAA,CAAY,KAAA;AAAA,M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Ae,EAAG,OAAO,EAAE,gCAAgC,CAAA;AACrE,IAAA,IAAI,KAAA,CAAM,SAAA,EAAU,EAAG,OAAO,EAAE,2BAA2B,CAAA;AAC3D,IAAA,IAAI,KAAA,CAAM,aAAA,EAAc,EAAG,OAAO,EAAE,+BAA+B,CAAA;AACnE,IAAA,IAAI,KAAA,CAAM,aAAA,EAAc,EAAG,OAAO,EAAE,+BAA+B,CAAA;AACnE,IAAA,OAAO,EAAE,2BAA2B,CAAA;AAAA,EACtC,CAAA;AAEA,EAAA,uBACEC,IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAY,0BAAY,OAAA,EAC3B,QAAA,EAAA;AAAA,oBAAAF,GAAAA,CAAC,QAAG,SAAA,EAAY,yBAAA,CAAY,OAAU,QAAA,EAAA,KAAA,IAAS,CAAA,CAAE,yBAAyB,CAAA,EAAG,CAAA;AAAA,oBAC7EA,GAAAA,CAAC,GAAA,EAAA,EAAE,WAAY,yBAAA,CAAY,OAAA,EAAY,0BAAe,EAAG,CAAA;AAAA,IACvD;AAAA,GAAA,EACJ,CAAA;AAEJ","file":"chunk-IVXRCKWR.mjs","sourcesContent":[".wrapper {\n --th-color-text: #333;\n --th-color-text-secondary: #666;\n --th-color-background: #fff;\n --th-color-primary: #e0e0e0;\n --th-color-secondary: #fafafa;\n\n padding: 1rem;\n width: 100%;\n}\n\n.card {\n display: flex;\n text-decoration: none;\n color: inherit;\n border: 1px solid var(--th-color-primary);\n border-radius: 8px;\n overflow: hidden;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n background: white;\n}\n\n.card:hover {\n transform: translateY(-2px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n}\n\n.cover {\n width: 120px;\n height: 180px;\n flex-shrink: 0;\n margin: 0;\n background-color: var(--th-color-secondary);\n}\n\n.image {\n width: 120px;\n height: 180px;\n object-fit: contain;\n}\n\n.info {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n}\n\n.title {\n margin: 0 0 0.5rem;\n font-weight: 600;\n font-size: 1.25rem;\n color: var(--th-color-text);\n}\n\n.author {\n margin: 0 0 0.75rem;\n color: var(--th-color-text-secondary);\n font-size: 1rem;\n}\n\n.rendition {\n background: var(--th-color-primary);\n color: var(--th-color-text);\n padding: 0.25rem 0.75rem;\n margin: 0;\n border-radius: 20px;\n font-size: 0.875rem;\n font-weight: 500;\n margin-top: auto;\n align-self: flex-start;\n}","\"use client\";\n\nimport React, { cloneElement, isValidElement } from \"react\";\n\nimport publicationGridStyles from \"./assets/styles/thorium-web.publicationGrid.module.css\";\n\nimport { ThGrid } from \"@/core/Components\";\nimport { Link } from \"react-aria-components\";\n\nimport classNames from \"classnames\";\n\nexport const DefaultImage = ({\n src,\n alt = \"\"\n}: {\n src: string;\n alt?: string;\n}) => (\n <img\n src={ src }\n alt={ alt }\n className={ publicationGridStyles.image }\n loading=\"lazy\"\n />\n);\n\nexport interface Publication {\n title: string;\n author: string;\n cover: string;\n url: string;\n rendition?: string;\n}\n\nexport interface PublicationGridProps {\n publications: Publication[];\n columnWidth?: number;\n gap?: string;\n renderCover?: (publication: Publication) => React.ReactElement<React.ImgHTMLAttributes<HTMLImageElement>>;\n}\n\nexport const PublicationGrid = ({ \n publications,\n columnWidth = 400,\n gap = \"1.5rem\",\n renderCover = (publication) => (\n <DefaultImage\n src={ publication.cover }\n alt=\"\"\n />\n ),\n}: PublicationGridProps) => {\n const renderCoverWithClass = (publication: Publication) => {\n const cover = renderCover(publication);\n \n if (!isValidElement<React.ImgHTMLAttributes<HTMLImageElement>>(cover)) {\n return (\n <DefaultImage\n src={ publication.cover }\n alt=\"\"\n />\n );\n }\n\n return cloneElement(cover, {\n className: classNames(\n publicationGridStyles.image,\n cover.props.className\n )\n });\n };\n\n return (\n <ThGrid\n className={ publicationGridStyles.wrapper }\n items={ publications }\n columnWidth={ columnWidth }\n gap={ gap }\n renderItem={ (publication, index) => (\n <Link\n href={ publication.url }\n key={ index }\n className={ publicationGridStyles.card }\n >\n <figure className={ publicationGridStyles.cover }>\n { renderCoverWithClass(publication) }\n </figure>\n <div className={ publicationGridStyles.info }>\n <h2 className={ publicationGridStyles.title }>\n { publication.title }\n </h2>\n <p className={ publicationGridStyles.author }>\n { publication.author }\n </p>\n { publication.rendition && (\n <p className={ publicationGridStyles.rendition }>\n { publication.rendition }\n </p>\n ) }\n </div>\n </Link>\n ) }\n />\n );\n};",".wrapper {\n width: 100%;\n height: 100dvh;\n height: 100vh;\n}\n\n.loader {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n color: var(--th-theme-text, CanvasText);\n background-color: var(--th-theme-background, Canvas);\n font-weight: bold;\n}\n\n.loader::after {\n content: \"...\";\n overflow: hidden;\n display: inline-block;\n vertical-align: bottom;\n animation: ellipsis-dot 1s infinite 300ms;\n animation-fill-mode: forwards;\n width: 3ch;\n}\n\n@keyframes ellipsis-dot {\n 25% {\n content: \"\";\n }\n 50% {\n content: \".\";\n }\n 75% {\n content: \"..\";\n }\n 100% {\n content: \"...\";\n }\n}","import { ReactNode } from \"react\";\n\nimport readerLoaderStyles from \"./assets/styles/thorium-web.loader.module.css\";\n\nimport { ThLoader } from \"@/core/Components/Reader/ThLoader\";\n\nimport { useI18n } from \"@/i18n/useI18n\";\n\nexport const StatefulLoader = ({ isLoading, children }: { isLoading: boolean, children: ReactNode }) => {\n const { t } = useI18n();\n\n return (\n <>\n <ThLoader \n isLoading={ isLoading } \n loader={ <div className={ readerLoaderStyles.loader }>{ t(\"reader.app.loading\") }</div> } \n className={ readerLoaderStyles.wrapper } \n >\n { children }\n </ThLoader>\n </>\n )\n}",".wrapper {\n --th-color-text: #333;\n --th-color-text-secondary: #666;\n --th-color-background: #fff;\n\n padding: 2rem;\n text-align: center;\n max-width: 600px;\n margin: 0 auto;\n}\n\n.title {\n font-size: 1.5rem;\n font-weight: 600;\n color: var(--th-color-text);\n margin: 0 0 1rem 0;\n}\n\n.message {\n font-size: 1.125rem;\n color: var(--th-color-text-secondary);\n line-height: 1.6;\n margin: 0 0 1.5rem 0;\n}","import { ReactNode } from \"react\";\nimport { ProcessedError } from \"@/helpers/errorHandler\";\nimport { useI18n } from \"@/i18n/useI18n\";\nimport errorStyles from \"./assets/styles/thorium-web.error.module.css\";\n\ninterface ErrorDisplayProps {\n error: ProcessedError;\n title?: string;\n children?: ReactNode;\n}\n\nexport const ErrorDisplay = ({ \n error, \n title,\n children\n}: ErrorDisplayProps) => {\n const { t } = useI18n();\n \n const getUserMessage = () => {\n if (error.isNotFound()) return t(\"reader.app.errors.notFound\");\n if (error.isAccessDenied()) return t(\"reader.app.errors.accessDenied\");\n if (error.isNetwork()) return t(\"reader.app.errors.network\");\n if (error.isServerError()) return t(\"reader.app.errors.serverError\");\n if (error.isClientError()) return t(\"reader.app.errors.clientError\");\n return t(\"reader.app.errors.generic\");\n };\n\n return (\n <div className={ errorStyles.wrapper }>\n <h1 className={ errorStyles.title }>{ title || t(\"reader.app.errors.title\") }</h1>\n <p className={ errorStyles.message }>{ getUserMessage() }</p>\n { children }\n </div>\n );\n};\n"]}
1
+ {"version":3,"sources":["../src/components/Misc/assets/styles/thorium-web.publicationGrid.module.css","../src/components/Misc/PublicationGrid.tsx","../src/components/Misc/assets/styles/thorium-web.loader.module.css","../src/components/Misc/StatefulLoader.tsx","../src/components/Misc/assets/styles/thorium-web.error.module.css","../src/components/Misc/ErrorDisplay.tsx"],"names":["wrapper","card","cover","image","info","title","author","rendition","loader","jsx","message","jsxs"],"mappings":";;;;;;;;AAAA,IAAA,mCAAA,GAAA;AAAA,EAAC,OAAA,EAAAA,qCAAAA;AAAA,EAWA,IAAA,EAAAC,kCAAAA;AAAA,EAgBA,KAAA,EAAAC,mCAAAA;AAAA,EAQA,KAAA,EAAAC,mCAAAA;AAAA,EAMA,IAAA,EAAAC,kCAAAA;AAAA,EAOA,KAAA,EAAAC,mCAAAA;AAAA,EAOA,MAAA,EAAAC,oCAAAA;AAAA,EAMA,SAAA,EAAAC;AAAA,CA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-primary: #e0e0e0;\n --th-color-secondary: #fafafa;\n\n padding: 1rem;\n width: 100%;\n}\n\n.card {\n display: flex;\n text-decoration: none;\n color: inherit;\n border: 1px solid var(--th-color-primary);\n border-radius: 8px;\n overflow: hidden;\n transition: transform 0.2s ease, box-shadow 0.2s ease;\n background: white;\n}\n\n.card:hover {\n transform: translateY(-2px);\n box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);\n}\n\n.cover {\n width: 120px;\n height: 180px;\n flex-shrink: 0;\n margin: 0;\n background-color: var(--th-color-secondary);\n}\n\n.image {\n width: 120px;\n height: 180px;\n object-fit: contain;\n}\n\n.info {\n padding: 1rem;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n}\n\n.title {\n margin: 0 0 0.5rem;\n font-weight: 600;\n font-size: 1.25rem;\n color: var(--th-color-text);\n}\n\n.author {\n margin: 0 0 0.75rem;\n color: var(--th-color-text-secondary);\n font-size: 1rem;\n}\n\n.rendition {\n background: var(--th-color-primary);\n color: var(--th-color-text);\n padding: 0.25rem 0.75rem;\n margin: 0;\n border-radius: 20px;\n font-size: 0.875rem;\n font-weight: 500;\n margin-top: auto;\n align-self: flex-start;\n}","\"use client\";\n\nimport React, { cloneElement, isValidElement } from \"react\";\n\nimport publicationGridStyles from \"./assets/styles/thorium-web.publicationGrid.module.css\";\n\nimport { ThGrid } from \"@/core/Components\";\nimport { Link } from \"react-aria-components\";\n\nimport classNames from \"classnames\";\n\nexport const DefaultImage = ({\n src,\n alt = \"\"\n}: {\n src: string;\n alt?: string;\n}) => (\n <img\n src={ src }\n alt={ alt }\n className={ publicationGridStyles.image }\n loading=\"lazy\"\n />\n);\n\nexport interface Publication {\n title: string;\n author: string;\n cover: string;\n url: string;\n rendition?: string;\n}\n\nexport interface PublicationGridProps {\n publications: Publication[];\n columnWidth?: number;\n gap?: string;\n renderCover?: (publication: Publication) => React.ReactElement<React.ImgHTMLAttributes<HTMLImageElement>>;\n}\n\nexport const PublicationGrid = ({ \n publications,\n columnWidth = 400,\n gap = \"1.5rem\",\n renderCover = (publication) => (\n <DefaultImage\n src={ publication.cover }\n alt=\"\"\n />\n ),\n}: PublicationGridProps) => {\n const renderCoverWithClass = (publication: Publication) => {\n const cover = renderCover(publication);\n \n if (!isValidElement<React.ImgHTMLAttributes<HTMLImageElement>>(cover)) {\n return (\n <DefaultImage\n src={ publication.cover }\n alt=\"\"\n />\n );\n }\n\n return cloneElement(cover, {\n className: classNames(\n publicationGridStyles.image,\n cover.props.className\n )\n });\n };\n\n return (\n <ThGrid\n className={ publicationGridStyles.wrapper }\n items={ publications }\n columnWidth={ columnWidth }\n gap={ gap }\n renderItem={ (publication, index) => (\n <Link\n href={ publication.url }\n key={ index }\n className={ publicationGridStyles.card }\n >\n <figure className={ publicationGridStyles.cover }>\n { renderCoverWithClass(publication) }\n </figure>\n <div className={ publicationGridStyles.info }>\n <h2 className={ publicationGridStyles.title }>\n { publication.title }\n </h2>\n <p className={ publicationGridStyles.author }>\n { publication.author }\n </p>\n { publication.rendition && (\n <p className={ publicationGridStyles.rendition }>\n { publication.rendition }\n </p>\n ) }\n </div>\n </Link>\n ) }\n />\n );\n};",".wrapper {\n width: 100%;\n height: 100dvh;\n height: 100vh;\n}\n\n.loader {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n color: var(--th-theme-text, CanvasText);\n background-color: var(--th-theme-background, Canvas);\n font-weight: bold;\n}\n\n.loader::after {\n content: \"...\";\n overflow: hidden;\n display: inline-block;\n vertical-align: bottom;\n animation: ellipsis-dot 1s infinite 300ms;\n animation-fill-mode: forwards;\n width: 3ch;\n}\n\n@keyframes ellipsis-dot {\n 25% {\n content: \"\";\n }\n 50% {\n content: \".\";\n }\n 75% {\n content: \"..\";\n }\n 100% {\n content: \"...\";\n }\n}","import { ReactNode } from \"react\";\n\nimport readerLoaderStyles from \"./assets/styles/thorium-web.loader.module.css\";\n\nimport { ThLoader } from \"@/core/Components/Reader/ThLoader\";\n\nimport { useI18n } from \"@/i18n/useI18n\";\n\nexport const StatefulLoader = ({ isLoading, children }: { isLoading: boolean, children: ReactNode }) => {\n const { t } = useI18n();\n\n return (\n <>\n <ThLoader \n isLoading={ isLoading } \n loader={ <div className={ readerLoaderStyles.loader }>{ t(\"reader.app.loading\") }</div> } \n className={ readerLoaderStyles.wrapper } \n >\n { children }\n </ThLoader>\n </>\n )\n}",".wrapper {\n --th-color-text: #333;\n --th-color-text-secondary: #666;\n --th-color-background: #fff;\n\n padding: 2rem;\n text-align: center;\n max-width: 600px;\n margin: 0 auto;\n}\n\n.title {\n font-size: 1.5rem;\n font-weight: 600;\n color: var(--th-color-text);\n margin: 0 0 1rem 0;\n}\n\n.message {\n font-size: 1.125rem;\n color: var(--th-color-text-secondary);\n line-height: 1.6;\n margin: 0 0 1.5rem 0;\n}","import { ReactNode } from \"react\";\nimport { ProcessedError } from \"@/helpers/errorHandler\";\nimport { useI18n } from \"@/i18n/useI18n\";\nimport errorStyles from \"./assets/styles/thorium-web.error.module.css\";\n\ninterface ErrorDisplayProps {\n error: ProcessedError;\n title?: string;\n children?: ReactNode;\n}\n\nexport const ErrorDisplay = ({ \n error, \n title,\n children\n}: ErrorDisplayProps) => {\n const { t } = useI18n();\n \n const getUserMessage = () => {\n if (error.isNotFound()) return t(\"reader.app.errors.notFound\");\n if (error.isAccessDenied()) return t(\"reader.app.errors.accessDenied\");\n if (error.isNetwork()) return t(\"reader.app.errors.network\");\n if (error.isServerError()) return t(\"reader.app.errors.serverError\");\n if (error.isClientError()) return t(\"reader.app.errors.clientError\");\n return t(\"reader.app.errors.generic\");\n };\n\n return (\n <div className={ errorStyles.wrapper }>\n <h1 className={ errorStyles.title }>{ title || t(\"reader.app.errors.title\") }</h1>\n <p className={ errorStyles.message }>{ getUserMessage() }</p>\n { children }\n </div>\n );\n};\n"]}
@@ -1,11 +1,11 @@
1
- import { useFonts, Peripherals, StatefulReaderHeader, StatefulReaderFooter, getReaderClassNames } from './chunk-6MONB2DN.mjs';
2
- import { createDefaultPlugin, useSpacingPresets, useSettingsComponentStatus, usePositionStorage, useLineHeight, NavigatorProvider, thorium_web_reader_app_default, StatefulDockingWrapper } from './chunk-PXXWEMNL.mjs';
3
- import { useWebPubSettingsCache, useFullscreen, useWebPubNavigator, useTimeline, useDocumentTitle } from './chunk-SZAVAQ6S.mjs';
4
- import { setFullscreen, setTimeline, setHovering, toggleImmersive, toggleActionOpen, setPublicationStart, setPublicationEnd, setLoading } from './chunk-WLVE3WNW.mjs';
5
- import { usePreferences, resolveContentProtectionConfig } from './chunk-XRFLDNAY.mjs';
6
- import { useAppSelector, useAppDispatch, useAppStore } from './chunk-A575ZW4A.mjs';
7
- import { ThPluginRegistry, ThPluginProvider } from './chunk-P6ILEQ5P.mjs';
8
- import { useI18n } from './chunk-NUXGQWED.mjs';
1
+ import { useFonts, useZoomCallbacks, StatefulReaderHeader, StatefulReaderFooter, getReaderClassNames } from './chunk-Y5X74VW7.mjs';
2
+ import { createDefaultPlugin, useSpacingPresets, useSettingsComponentStatus, usePositionStorage, fromActionPeripheralType, NavPeripheralType, NavigatorProvider, thorium_web_reader_app_default, StatefulDockingWrapper, ZOOM_IN_KEY_COMBOS, ZOOM_OUT_KEY_COMBOS, toActionPeripheralType, useLineHeight } from './chunk-KJ55Q63A.mjs';
3
+ import { useWebPubSettingsCache, useFullscreen, useWebPubNavigator, useTimeline, useDocumentTitle } from './chunk-GRYEOCGD.mjs';
4
+ import { setFullscreen, setTimeline, setHovering, toggleImmersive, toggleActionOpen, setPublicationStart, setPublicationEnd, setLoading } from './chunk-PAFJZH7O.mjs';
5
+ import { usePreferences, resolveContentProtectionConfig, useActionsPreferences } from './chunk-PRQBFBJ7.mjs';
6
+ import { useAppSelector, useAppDispatch } from './chunk-A575ZW4A.mjs';
7
+ import { ThPluginRegistry, ThPluginProvider } from './chunk-ZD4LTF6G.mjs';
8
+ import { useI18n } from './chunk-2NCN2AG2.mjs';
9
9
  import { useState, useLayoutEffect, useRef, useCallback, useMemo, useEffect } from 'react';
10
10
  import { Locator } from '@readium/shared';
11
11
  import classNames from 'classnames';
@@ -15,9 +15,9 @@ var useWebPubPreferencesConfig = ({
15
15
  settings,
16
16
  fontLanguage,
17
17
  hasDisplayTransformability,
18
- getFontMetadata,
19
- lineHeightOptions
18
+ getFontMetadata
20
19
  }) => {
20
+ const { processedValues: lineHeightOptions } = useLineHeight();
21
21
  const { isComponentUsed: isFontFamilyUsed } = useSettingsComponentStatus({
22
22
  settingsKey: "fontFamily" /* fontFamily */,
23
23
  publicationType: "webpub"
@@ -73,7 +73,6 @@ var useWebPubPreferencesConfig = ({
73
73
  if (hasDisplayTransformability) {
74
74
  if (isFontFamilyUsed) preferences.fontFamily = getFontMetadata(settings.fontFamily[fontLanguage] ?? "")?.fontStack || null;
75
75
  if (isFontWeightUsed) preferences.fontWeight = settings.fontWeight;
76
- if (isHyphensUsed) preferences.hyphens = settings.hyphens;
77
76
  if (isLigaturesUsed) preferences.ligatures = settings.ligatures;
78
77
  if (isNoRubyUsed) preferences.noRuby = settings.noRuby;
79
78
  if (isLetterSpacingUsed) preferences.letterSpacing = settings.letterSpacing;
@@ -81,6 +80,7 @@ var useWebPubPreferencesConfig = ({
81
80
  if (isParagraphIndentUsed) preferences.paragraphIndent = settings.paragraphIndent;
82
81
  if (isParagraphSpacingUsed) preferences.paragraphSpacing = settings.paragraphSpacing;
83
82
  if (isTextAlignUsed) preferences.textAlign = settings.textAlign;
83
+ if (isHyphensUsed && settings.textAlign !== "publisher") preferences.hyphens = settings.hyphens;
84
84
  if (isTextNormalizeUsed) preferences.textNormalization = settings.textNormalization;
85
85
  if (isWordSpacingUsed) preferences.wordSpacing = settings.wordSpacing;
86
86
  }
@@ -90,7 +90,6 @@ var useWebPubPreferencesConfig = ({
90
90
  fontLanguage,
91
91
  hasDisplayTransformability,
92
92
  getFontMetadata,
93
- lineHeightOptions,
94
93
  isFontFamilyUsed,
95
94
  isFontWeightUsed,
96
95
  isHyphensUsed,
@@ -102,7 +101,8 @@ var useWebPubPreferencesConfig = ({
102
101
  isParagraphSpacingUsed,
103
102
  isTextAlignUsed,
104
103
  isTextNormalizeUsed,
105
- isWordSpacingUsed
104
+ isWordSpacingUsed,
105
+ lineHeightOptions
106
106
  ]);
107
107
  return { webPubPreferences };
108
108
  };
@@ -146,8 +146,8 @@ var useWebPubReaderInit = ({
146
146
  injectFontResources,
147
147
  removeFontResources,
148
148
  getFontInjectables,
149
- lineHeightOptions,
150
149
  contentProtectionConfig,
150
+ keyboardPeripherals,
151
151
  onNavigatorReady,
152
152
  onNavigatorLoaded,
153
153
  onCleanup
@@ -157,8 +157,7 @@ var useWebPubReaderInit = ({
157
157
  settings: cache.current.settings,
158
158
  fontLanguage,
159
159
  hasDisplayTransformability,
160
- getFontMetadata,
161
- lineHeightOptions
160
+ getFontMetadata
162
161
  });
163
162
  const { injectables } = useWebPubInjectablesConfig({
164
163
  isFontFamilyUsed,
@@ -187,7 +186,8 @@ var useWebPubReaderInit = ({
187
186
  experiments: preferences.experiments?.webPub || null
188
187
  },
189
188
  injectables,
190
- contentProtection: contentProtectionConfig
189
+ contentProtection: contentProtectionConfig,
190
+ keyboardPeripherals
191
191
  };
192
192
  isNavigatorLoadedWebPub.current = true;
193
193
  onNavigatorReady?.();
@@ -217,11 +217,26 @@ var useWebPubReaderInit = ({
217
217
  navigatorReady
218
218
  };
219
219
  };
220
+ var useWebPubKeyboardPeripherals = () => {
221
+ const { actionsKeys } = useActionsPreferences();
222
+ return useMemo(() => {
223
+ const config = [
224
+ { type: NavPeripheralType.zoomIn, keyCombos: [...ZOOM_IN_KEY_COMBOS] },
225
+ { type: NavPeripheralType.zoomOut, keyCombos: [...ZOOM_OUT_KEY_COMBOS] }
226
+ ];
227
+ for (const [key, tokens] of Object.entries(actionsKeys)) {
228
+ const shortcut = tokens?.shortcut;
229
+ if (shortcut) config.push({ type: toActionPeripheralType(key), keyCombos: shortcut.keyCombos });
230
+ }
231
+ return config;
232
+ }, [actionsKeys]);
233
+ };
220
234
  var ExperimentalWebPubStatefulReader = ({
221
235
  publication,
222
236
  localDataKey,
223
237
  plugins,
224
- positionStorage
238
+ positionStorage,
239
+ containerRefSetter
225
240
  }) => {
226
241
  const [pluginsRegistered, setPluginsRegistered] = useState(false);
227
242
  useLayoutEffect(() => {
@@ -237,9 +252,9 @@ var ExperimentalWebPubStatefulReader = ({
237
252
  if (!pluginsRegistered) {
238
253
  return null;
239
254
  }
240
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ThPluginProvider, { children: /* @__PURE__ */ jsx(StatefulReaderInner, { publication, localDataKey, positionStorage }) }) });
255
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ThPluginProvider, { children: /* @__PURE__ */ jsx(StatefulReaderInner, { publication, localDataKey, positionStorage, containerRefSetter }) }) });
241
256
  };
242
- var StatefulReaderInner = ({ publication, localDataKey, positionStorage }) => {
257
+ var StatefulReaderInner = ({ publication, localDataKey, positionStorage, containerRefSetter }) => {
243
258
  const { preferences, getFontMetadata, getFontInjectables } = usePreferences();
244
259
  const { t } = useI18n();
245
260
  const { getEffectiveSpacingValue } = useSpacingPresets();
@@ -267,6 +282,8 @@ var StatefulReaderInner = ({ publication, localDataKey, positionStorage }) => {
267
282
  const hasDisplayTransformability = useAppSelector((state) => state.publication.hasDisplayTransformability);
268
283
  const isImmersive = useAppSelector((state) => state.reader.isImmersive);
269
284
  const isHovering = useAppSelector((state) => state.reader.isHovering);
285
+ const breakpoint = useAppSelector((state) => state.theming.breakpoint);
286
+ const containerBreakpoint = useAppSelector((state) => state.theming.containerBreakpoint);
270
287
  const cache = useWebPubSettingsCache(
271
288
  fontFamily,
272
289
  fontWeight,
@@ -285,10 +302,12 @@ var StatefulReaderInner = ({ publication, localDataKey, positionStorage }) => {
285
302
  );
286
303
  const layoutUI = preferences.theming.layout.ui?.webPub || "stacked-ui" /* stacked */;
287
304
  const dispatch = useAppDispatch();
305
+ const profile = useAppSelector((state) => state.reader.profile);
306
+ const keyboardPeripherals = useWebPubKeyboardPeripherals();
288
307
  const onFsChange = useCallback((isFullscreen) => {
289
308
  dispatch(setFullscreen(isFullscreen));
290
309
  }, [dispatch]);
291
- const fs = useFullscreen(onFsChange);
310
+ useFullscreen(onFsChange);
292
311
  const webPubNavigator = useWebPubNavigator();
293
312
  const {
294
313
  currentPositions,
@@ -305,7 +324,6 @@ var StatefulReaderInner = ({ publication, localDataKey, positionStorage }) => {
305
324
  dispatch(setTimeline(timeline2));
306
325
  }
307
326
  });
308
- const lineHeightOptions = useLineHeight();
309
327
  const documentTitleFormat = preferences.metadata?.documentTitle?.format;
310
328
  let documentTitle;
311
329
  if (documentTitleFormat) {
@@ -339,30 +357,9 @@ var StatefulReaderInner = ({ publication, localDataKey, positionStorage }) => {
339
357
  dispatch(setHovering(false));
340
358
  dispatch(toggleImmersive());
341
359
  }, [dispatch]);
342
- const appStore = useAppStore();
343
- const p = useMemo(() => new Peripherals(appStore, preferences.actions, {
344
- moveTo: () => {
345
- },
346
- goProgression: () => {
347
- },
348
- toggleAction: (actionKey) => {
349
- switch (actionKey) {
350
- case "fullscreen" /* fullscreen */:
351
- fs.handleFullscreen();
352
- break;
353
- case "settings" /* settings */:
354
- case "toc" /* toc */:
355
- dispatch(toggleActionOpen({
356
- key: actionKey,
357
- profile: "webPub"
358
- }));
359
- break;
360
- }
361
- }
362
- }), [appStore, preferences.actions, fs, dispatch]);
360
+ const { zoomIn, zoomOut } = useZoomCallbacks(webPubNavigator);
363
361
  const listeners = useMemo(() => ({
364
362
  frameLoaded: async function(_wnd) {
365
- p.observe(window);
366
363
  },
367
364
  positionChanged: async function(locator) {
368
365
  setLocalData(locator);
@@ -405,9 +402,21 @@ var StatefulReaderInner = ({ publication, localDataKey, positionStorage }) => {
405
402
  },
406
403
  contextMenu: function(_data) {
407
404
  },
408
- peripheral: function(_data) {
405
+ peripheral: function(data) {
406
+ switch (data.type) {
407
+ case NavPeripheralType.zoomIn:
408
+ zoomIn();
409
+ break;
410
+ case NavPeripheralType.zoomOut:
411
+ zoomOut();
412
+ break;
413
+ default: {
414
+ const actionKey = fromActionPeripheralType(data.type);
415
+ if (actionKey && profile) dispatch(toggleActionOpen({ key: actionKey, profile }));
416
+ }
417
+ }
409
418
  }
410
- }), [p, setLocalData, canGoBackward, canGoForward, dispatch, toggleIsImmersive]);
419
+ }), [setLocalData, canGoBackward, canGoForward, dispatch, toggleIsImmersive, zoomIn, zoomOut, profile]);
411
420
  const initialPosition = useMemo(() => getLocalData(), [getLocalData]);
412
421
  useWebPubReaderInit({
413
422
  container,
@@ -423,27 +432,24 @@ var StatefulReaderInner = ({ publication, localDataKey, positionStorage }) => {
423
432
  injectFontResources,
424
433
  removeFontResources,
425
434
  getFontInjectables,
426
- lineHeightOptions,
427
435
  contentProtectionConfig: resolveContentProtectionConfig(preferences.contentProtection, t),
436
+ keyboardPeripherals,
428
437
  onNavigatorReady: () => {
429
438
  dispatch(setLoading(false));
430
- },
431
- onNavigatorLoaded: () => {
432
- p.observe(window);
433
- },
434
- onCleanup: () => {
435
- p.destroy();
436
439
  }
437
440
  });
438
441
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(NavigatorProvider, { visualNavigator: webPubNavigator, children: /* @__PURE__ */ jsx("main", { className: thorium_web_reader_app_default.main, children: /* @__PURE__ */ jsx(StatefulDockingWrapper, { children: /* @__PURE__ */ jsxs(
439
442
  "div",
440
443
  {
444
+ ref: containerRefSetter,
441
445
  className: classNames(
442
446
  getReaderClassNames({
443
447
  isScroll: true,
444
448
  isImmersive,
445
449
  isHovering,
446
- layoutUI
450
+ layoutUI,
451
+ breakpoint,
452
+ containerBreakpoint
447
453
  })
448
454
  ),
449
455
  children: [
@@ -471,5 +477,5 @@ var StatefulReaderInner = ({ publication, localDataKey, positionStorage }) => {
471
477
  };
472
478
 
473
479
  export { ExperimentalWebPubStatefulReader };
474
- //# sourceMappingURL=chunk-KVUG6BNI.mjs.map
475
- //# sourceMappingURL=chunk-KVUG6BNI.mjs.map
480
+ //# sourceMappingURL=chunk-63LKYJFG.mjs.map
481
+ //# sourceMappingURL=chunk-63LKYJFG.mjs.map