@edrlab/thorium-web 1.5.5 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ThPreferencesAdapter-B3a-f5v-.d.mts → ThPreferencesAdapter-GepvYoaL.d.mts} +4 -3
- package/dist/{ThSettingsWrapper-D4WIzlXA.d.mts → ThSettingsWrapper-DyYC678Q.d.mts} +1 -1
- package/dist/{actions-C33UN3Ji.d.mts → actions-CTg9C4C-.d.mts} +1 -1
- package/dist/{actionsReducer-Bzcj3wk3.d.mts → actionsReducer-Cnd7Cdh9.d.mts} +1 -1
- package/dist/{chunk-I572ZFCT.mjs → chunk-2YS5JTIR.mjs} +55 -35
- package/dist/chunk-2YS5JTIR.mjs.map +1 -0
- package/dist/{chunk-VYSDLACR.mjs → chunk-3R5JARA2.mjs} +3 -3
- package/dist/{chunk-VYSDLACR.mjs.map → chunk-3R5JARA2.mjs.map} +1 -1
- package/dist/{chunk-UOFADXXI.mjs → chunk-6DR4EAK3.mjs} +40 -47
- package/dist/chunk-6DR4EAK3.mjs.map +1 -0
- package/dist/chunk-7SMOXFAF.mjs +121 -0
- package/dist/chunk-7SMOXFAF.mjs.map +1 -0
- package/dist/{chunk-7A6UGSHQ.mjs → chunk-C6LWEQL2.mjs} +82 -69
- package/dist/chunk-C6LWEQL2.mjs.map +1 -0
- package/dist/{chunk-AEEGHJVM.mjs → chunk-CXKDZVAV.mjs} +113 -258
- package/dist/chunk-CXKDZVAV.mjs.map +1 -0
- package/dist/{chunk-GFSLVQIG.mjs → chunk-EREFYF5J.mjs} +3 -3
- package/dist/{chunk-GFSLVQIG.mjs.map → chunk-EREFYF5J.mjs.map} +1 -1
- package/dist/{chunk-G2M4MYVF.mjs → chunk-I765HTBI.mjs} +15 -109
- package/dist/chunk-I765HTBI.mjs.map +1 -0
- package/dist/{chunk-7AHUCM7Z.mjs → chunk-JXHRUQKP.mjs} +39 -16
- package/dist/chunk-JXHRUQKP.mjs.map +1 -0
- package/dist/{chunk-NJOWH5YK.mjs → chunk-MBWYHA4U.mjs} +43 -48
- package/dist/chunk-MBWYHA4U.mjs.map +1 -0
- package/dist/{chunk-NQ2ZSGCX.mjs → chunk-MFVZ5AEN.mjs} +7 -3
- package/dist/chunk-MFVZ5AEN.mjs.map +1 -0
- package/dist/{chunk-2YRT7RNW.mjs → chunk-QOU3R5ZT.mjs} +9 -3
- package/dist/chunk-QOU3R5ZT.mjs.map +1 -0
- package/dist/{chunk-N6MQQMTM.mjs → chunk-TNXLY2ZQ.mjs} +41 -18
- package/dist/chunk-TNXLY2ZQ.mjs.map +1 -0
- package/dist/components/Audio/index.d.mts +13 -13
- package/dist/components/Audio/index.mjs +10 -11
- package/dist/components/Epub/index.d.mts +13 -13
- package/dist/components/Epub/index.mjs +11 -12
- package/dist/components/Reader/index.d.mts +12 -12
- package/dist/components/Reader/index.mjs +18 -18
- package/dist/components/WebPub/index.d.mts +13 -13
- package/dist/components/WebPub/index.mjs +11 -12
- package/dist/core/Components/index.d.mts +6 -6
- package/dist/core/Helpers/index.d.mts +4 -4
- package/dist/core/Helpers/index.mjs +2 -2
- package/dist/core/Hooks/index.d.mts +14 -9
- package/dist/core/Hooks/index.mjs +4 -4
- package/dist/lib/index.d.mts +38 -27
- package/dist/lib/index.mjs +3 -4
- package/dist/locales/ar/thorium-shared.json +39 -0
- package/dist/locales/bg/thorium-web.json +23 -0
- package/dist/locales/brh/thorium-shared.json +1 -0
- package/dist/locales/brh/thorium-web.json +1 -0
- package/dist/locales/da/thorium-shared.json +3 -0
- package/dist/locales/el/thorium-web.json +41 -6
- package/dist/locales/en/thorium-shared.json +3 -0
- package/dist/locales/es/thorium-shared.json +3 -0
- package/dist/locales/et/thorium-shared.json +3 -0
- package/dist/locales/fi/thorium-shared.json +3 -0
- package/dist/locales/fi/thorium-web.json +3 -3
- package/dist/locales/fr/thorium-shared.json +3 -0
- package/dist/locales/he/thorium-shared.json +3 -1
- package/dist/locales/it/thorium-shared.json +3 -0
- package/dist/locales/lt/thorium-shared.json +36 -10
- package/dist/locales/pt-PT/thorium-shared.json +8 -5
- package/dist/locales/sv/thorium-shared.json +3 -3
- package/dist/locales/tr/thorium-shared.json +80 -0
- package/dist/preferences/index.d.mts +10 -10
- package/dist/preferences/index.mjs +4 -5
- package/dist/{settingsReducer-Pp9aoiiC.d.mts → settingsReducer-DRWEq8Cm.d.mts} +1 -1
- package/dist/{ui-DnZZhozX.d.mts → ui-DHQ_zvWn.d.mts} +7 -1
- package/dist/{useAudioNavigator-9RuOpLGB.d.mts → useAudioNavigator-B4NBPvmZ.d.mts} +4 -5
- package/dist/{useContrast-Bl08zDTU.d.mts → useContrast-Unp3534Z.d.mts} +1 -1
- package/dist/{usePreferences-Cy7-JN2x.d.mts → usePreferences-Bi-ptif0.d.mts} +6 -9
- package/dist/usePublicationProgress-DT-X5ZLf.d.mts +44 -0
- package/dist/{useReaderTransitions-BsTdWZDK.d.mts → useReaderTransitions-B9fOF61y.d.mts} +10 -14
- package/package.json +23 -15
- package/dist/chunk-2YRT7RNW.mjs.map +0 -1
- package/dist/chunk-7A6UGSHQ.mjs.map +0 -1
- package/dist/chunk-7AHUCM7Z.mjs.map +0 -1
- package/dist/chunk-A575ZW4A.mjs +0 -10
- package/dist/chunk-A575ZW4A.mjs.map +0 -1
- package/dist/chunk-AEEGHJVM.mjs.map +0 -1
- package/dist/chunk-G2M4MYVF.mjs.map +0 -1
- package/dist/chunk-I572ZFCT.mjs.map +0 -1
- package/dist/chunk-N6MQQMTM.mjs.map +0 -1
- package/dist/chunk-NJOWH5YK.mjs.map +0 -1
- package/dist/chunk-NQ2ZSGCX.mjs.map +0 -1
- package/dist/chunk-TEZB4ULX.mjs +0 -57
- package/dist/chunk-TEZB4ULX.mjs.map +0 -1
- package/dist/chunk-UOFADXXI.mjs.map +0 -1
- package/dist/useTimeline-DCZ1qoCO.d.mts +0 -55
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { S as ShortcutRepresentation } from './keyboardUtilities-BCP3UcLb.mjs';
|
|
2
|
-
import { B as BreakpointsMap,
|
|
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-
|
|
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-
|
|
2
|
+
import { B as BreakpointsMap, e as ThBreakpoints, f as ThBreakpointsObject, g as ThDocumentTitleFormat, a as ThBackLinkPref, h as ThFormatPref, i as ThRunningHeadFormat, j as ThProgressionFormat, k as ThLayoutUI, l as ThScrollAffordance, m as ThPaginatedAffordancePref } from './ui-DHQ_zvWn.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-Unp3534Z.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-CTg9C4C-.mjs';
|
|
5
5
|
import { IContentProtectionConfig, IAudioContentProtectionConfig, ExperimentKey } from '@readium/navigator';
|
|
6
6
|
|
|
7
7
|
type CSSValueUnitless = `${number}`;
|
|
@@ -533,6 +533,7 @@ interface ThPreferences<K extends CustomizableKeys = {}> {
|
|
|
533
533
|
toggleOnMiddlePointer: Array<"tap" | "click">;
|
|
534
534
|
hideOnForwardScroll: boolean;
|
|
535
535
|
showOnBackwardScroll: boolean;
|
|
536
|
+
affordance: ThScrollAffordance;
|
|
536
537
|
};
|
|
537
538
|
paginated: {
|
|
538
539
|
reflow: ThPaginatedAffordancePref;
|
|
@@ -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-
|
|
5
|
+
import { h as ThActionEntry, i as ThActionsBarProps, C as CollapsiblePref } from './actions-CTg9C4C-.mjs';
|
|
6
6
|
|
|
7
7
|
interface HTMLAttributesWithRef<T> extends React.HTMLAttributes<T> {
|
|
8
8
|
ref?: React.ForwardedRef<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { ToolbarProps } from 'react-aria-components';
|
|
4
|
-
import { B as BreakpointsMap } from './ui-
|
|
4
|
+
import { B as BreakpointsMap } from './ui-DHQ_zvWn.mjs';
|
|
5
5
|
import { KeyCombo } from '@readium/navigator-html-injectables';
|
|
6
6
|
|
|
7
7
|
declare enum ThActionsTriggerVariant {
|
|
@@ -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-
|
|
3
|
+
import { T as ThDockingKeys } from './actions-CTg9C4C-.mjs';
|
|
4
4
|
|
|
5
5
|
type ActionsStateKeys = string;
|
|
6
6
|
type OverflowStateKeys = string;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { useReaderHeaderBase, thorium_web_reader_app_default, StatefulBackLink, thorium_web_reader_header_default, StatefulCollapsibleActionsBar, thorium_web_overflow_default, useIsScroll, useNavigator, useEffectiveRange } from './chunk-
|
|
2
|
-
import { makeBreakpointsMap, getBestMatchingProgressionFormat } from './chunk-
|
|
3
|
-
import { setHovering, setWebPubZoom, setFontSize } from './chunk-
|
|
4
|
-
import { usePreferences } from './chunk-
|
|
5
|
-
import { ThRunningHeadFormat, ThProgressionFormat } from './chunk-
|
|
6
|
-
import { useAppSelector, useAppDispatch } from './chunk-
|
|
1
|
+
import { useReaderHeaderBase, thorium_web_reader_app_default, StatefulBackLink, thorium_web_reader_header_default, StatefulCollapsibleActionsBar, thorium_web_overflow_default, useIsScroll, useNavigator, useEffectiveRange } from './chunk-C6LWEQL2.mjs';
|
|
2
|
+
import { makeBreakpointsMap, getBestMatchingProgressionFormat } from './chunk-3R5JARA2.mjs';
|
|
3
|
+
import { setHovering, setWebPubZoom, setFontSize } from './chunk-I765HTBI.mjs';
|
|
4
|
+
import { usePreferences } from './chunk-6DR4EAK3.mjs';
|
|
5
|
+
import { ThRunningHeadFormat, ThProgressionFormat } from './chunk-QOU3R5ZT.mjs';
|
|
6
|
+
import { useAppSelector, useAppDispatch } from './chunk-MFVZ5AEN.mjs';
|
|
7
7
|
import { getPlatform } from './chunk-KQ3KS5O5.mjs';
|
|
8
8
|
import { ThInteractiveOverlay, ThHeader, ThFooter, ThRunningHead, ThPagination } from './chunk-ES2Y5MC7.mjs';
|
|
9
9
|
import { useI18n } from './chunk-2NCN2AG2.mjs';
|
|
10
10
|
import { useRef, useCallback, useEffect, useMemo } from 'react';
|
|
11
11
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
12
12
|
import classNames from 'classnames';
|
|
13
|
+
import { Link } from '@readium/shared';
|
|
13
14
|
import { useLocale, useFocusWithin } from 'react-aria';
|
|
14
15
|
|
|
15
16
|
var StatefulReaderRunningHead = ({
|
|
16
17
|
formatPref
|
|
17
18
|
}) => {
|
|
18
19
|
const { t } = useI18n();
|
|
19
|
-
const
|
|
20
|
+
const progress = useAppSelector((state) => state.publication.progress);
|
|
20
21
|
const isImmersive = useAppSelector((state) => state.reader.isImmersive);
|
|
21
22
|
const isHovering = useAppSelector((state) => state.reader.isHovering);
|
|
22
23
|
const isFullscreen = useAppSelector((state) => state.reader.isFullscreen);
|
|
@@ -51,12 +52,12 @@ var StatefulReaderRunningHead = ({
|
|
|
51
52
|
}, [variants, isImmersive, displayInImmersive, isHovering, isFullscreen, displayInFullscreen]);
|
|
52
53
|
const runningHead = useMemo(() => {
|
|
53
54
|
if (displayFormat === "title" /* title */) {
|
|
54
|
-
return
|
|
55
|
+
return progress?.title || "";
|
|
55
56
|
} else if (displayFormat === "chapter" /* chapter */) {
|
|
56
|
-
return
|
|
57
|
+
return progress?.progression?.currentChapter || progress?.title || "";
|
|
57
58
|
}
|
|
58
59
|
return "";
|
|
59
|
-
}, [displayFormat,
|
|
60
|
+
}, [displayFormat, progress]);
|
|
60
61
|
if (!runningHead || displayFormat === "none" /* none */) return null;
|
|
61
62
|
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
62
63
|
ThRunningHead,
|
|
@@ -157,7 +158,7 @@ var StatefulReaderProgression = ({
|
|
|
157
158
|
fallbackVariant
|
|
158
159
|
}) => {
|
|
159
160
|
const { t } = useI18n();
|
|
160
|
-
const
|
|
161
|
+
const progress = useAppSelector((state) => state.publication.progress);
|
|
161
162
|
const isImmersive = useAppSelector((state) => state.reader.isImmersive);
|
|
162
163
|
const isFullscreen = useAppSelector((state) => state.reader.isFullscreen);
|
|
163
164
|
const isHovering = useAppSelector((state) => state.reader.isHovering);
|
|
@@ -191,12 +192,12 @@ var StatefulReaderProgression = ({
|
|
|
191
192
|
return "none" /* none */;
|
|
192
193
|
}
|
|
193
194
|
if (Array.isArray(variants)) {
|
|
194
|
-
return getBestMatchingProgressionFormat(variants,
|
|
195
|
+
return getBestMatchingProgressionFormat(variants, progress?.progression) || fallbackFormat.variants;
|
|
195
196
|
}
|
|
196
197
|
return variants;
|
|
197
|
-
}, [variants,
|
|
198
|
+
}, [variants, progress?.progression, fallbackFormat, isImmersive, isHovering, isFullscreen, displayInImmersive, displayInFullscreen]);
|
|
198
199
|
const displayText = useMemo(() => {
|
|
199
|
-
if (displayFormat === "none" /* none */ || !
|
|
200
|
+
if (displayFormat === "none" /* none */ || !progress?.progression) {
|
|
200
201
|
return "";
|
|
201
202
|
}
|
|
202
203
|
const {
|
|
@@ -208,7 +209,7 @@ var StatefulReaderProgression = ({
|
|
|
208
209
|
positionsLeft,
|
|
209
210
|
totalItems,
|
|
210
211
|
currentIndex
|
|
211
|
-
} =
|
|
212
|
+
} = progress.progression;
|
|
212
213
|
let text = "";
|
|
213
214
|
const formatPositions = (positions) => {
|
|
214
215
|
if (positions.length === 2) {
|
|
@@ -278,7 +279,7 @@ var StatefulReaderProgression = ({
|
|
|
278
279
|
break;
|
|
279
280
|
}
|
|
280
281
|
return text;
|
|
281
|
-
}, [displayFormat,
|
|
282
|
+
}, [displayFormat, progress, t]);
|
|
282
283
|
if (!displayText || displayFormat === "none" /* none */) {
|
|
283
284
|
return null;
|
|
284
285
|
}
|
|
@@ -334,8 +335,20 @@ var StatefulReaderPagination = ({
|
|
|
334
335
|
}
|
|
335
336
|
);
|
|
336
337
|
};
|
|
338
|
+
|
|
339
|
+
// src/components/hooks/useAdjacentReadingOrderItems.ts
|
|
340
|
+
var useAdjacentReadingOrderItems = (readingOrder) => {
|
|
341
|
+
const currentIndex = useAppSelector((state) => state.publication.progress?.progression?.currentIndex);
|
|
342
|
+
if (!readingOrder || currentIndex === void 0) return { previous: null, next: null };
|
|
343
|
+
const index = currentIndex - 1;
|
|
344
|
+
return {
|
|
345
|
+
previous: index > 0 ? readingOrder.items[index - 1] : null,
|
|
346
|
+
next: index < readingOrder.items.length - 1 ? readingOrder.items[index + 1] : null
|
|
347
|
+
};
|
|
348
|
+
};
|
|
337
349
|
var StatefulReaderFooter = ({
|
|
338
350
|
layout,
|
|
351
|
+
publication,
|
|
339
352
|
progressionFormatPref,
|
|
340
353
|
progressionFormatFallback
|
|
341
354
|
}) => {
|
|
@@ -350,7 +363,10 @@ var StatefulReaderFooter = ({
|
|
|
350
363
|
const isScroll = useIsScroll();
|
|
351
364
|
const breakpoint = useAppSelector((state) => state.theming.containerBreakpoint);
|
|
352
365
|
const reducedMotion = useAppSelector((state) => state.theming.prefersReducedMotion);
|
|
353
|
-
const
|
|
366
|
+
const adjacentTimelineItems = useAppSelector((state) => state.publication.adjacentTimelineItems);
|
|
367
|
+
const { previous: previousReadingOrderItem, next: nextReadingOrderItem } = useAdjacentReadingOrderItems(publication.readingOrder);
|
|
368
|
+
const { preferences } = usePreferences();
|
|
369
|
+
const affordance = preferences.affordances.scroll.affordance;
|
|
354
370
|
const dispatch = useAppDispatch();
|
|
355
371
|
const { focusWithinProps } = useFocusWithin({
|
|
356
372
|
onFocusWithin() {
|
|
@@ -370,42 +386,46 @@ var StatefulReaderFooter = ({
|
|
|
370
386
|
dispatch(setHovering(false));
|
|
371
387
|
}
|
|
372
388
|
};
|
|
373
|
-
const {
|
|
374
|
-
const buildNode = useCallback((
|
|
375
|
-
if (!locator) return void 0;
|
|
389
|
+
const { goLink } = useNavigator().unified;
|
|
390
|
+
const buildNode = useCallback((title, compactKey, descriptiveKey) => {
|
|
376
391
|
return breakpoint !== "compact" /* compact */ && breakpoint !== "medium" /* medium */ ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
377
392
|
/* @__PURE__ */ jsx("span", { className: thorium_web_reader_app_default.srOnly, children: t(descriptiveKey) }),
|
|
378
|
-
/* @__PURE__ */ jsx("span", { className: thorium_web_reader_pagination_default.label, children: title ||
|
|
393
|
+
/* @__PURE__ */ jsx("span", { className: thorium_web_reader_pagination_default.label, children: title || t(compactKey) })
|
|
379
394
|
] }) : /* @__PURE__ */ jsx("span", { className: thorium_web_reader_pagination_default.label, children: t(compactKey) });
|
|
380
395
|
}, [t, breakpoint]);
|
|
381
396
|
const updateLinks = useCallback(() => {
|
|
382
|
-
const previous =
|
|
383
|
-
const next =
|
|
397
|
+
const previous = affordance === "readingOrder" /* readingOrder */ ? previousReadingOrderItem : adjacentTimelineItems.previous;
|
|
398
|
+
const next = affordance === "readingOrder" /* readingOrder */ ? nextReadingOrderItem : adjacentTimelineItems.next;
|
|
384
399
|
const previousLink = previous ? {
|
|
385
400
|
node: buildNode(
|
|
386
|
-
previous,
|
|
387
|
-
timeline?.previousItem?.title,
|
|
401
|
+
previous.title,
|
|
388
402
|
isFXL ? "reader.actions.goToPreviousPage.compact" : "reader.actions.goToPreviousChapter.compact",
|
|
389
403
|
isFXL ? "reader.actions.goToPreviousPage.descriptive" : "reader.actions.goToPreviousChapter.descriptive"
|
|
390
404
|
),
|
|
391
|
-
onPress: () =>
|
|
405
|
+
onPress: () => goLink(new Link({ href: previous.href }), !reducedMotion, () => {
|
|
392
406
|
})
|
|
393
407
|
} : void 0;
|
|
394
408
|
const nextLink = next ? {
|
|
395
409
|
node: buildNode(
|
|
396
|
-
next,
|
|
397
|
-
timeline?.nextItem?.title,
|
|
410
|
+
next.title,
|
|
398
411
|
isFXL ? "reader.actions.goToNextPage.compact" : "reader.actions.goToNextChapter.compact",
|
|
399
412
|
isFXL ? "reader.actions.goToNextPage.descriptive" : "reader.actions.goToNextChapter.descriptive"
|
|
400
413
|
),
|
|
401
|
-
onPress: () =>
|
|
414
|
+
onPress: () => goLink(new Link({ href: next.href }), !reducedMotion, () => {
|
|
402
415
|
})
|
|
403
416
|
} : void 0;
|
|
404
417
|
return isRTL ? { left: nextLink, right: previousLink } : { left: previousLink, right: nextLink };
|
|
405
|
-
}, [
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
418
|
+
}, [
|
|
419
|
+
goLink,
|
|
420
|
+
buildNode,
|
|
421
|
+
affordance,
|
|
422
|
+
adjacentTimelineItems,
|
|
423
|
+
previousReadingOrderItem,
|
|
424
|
+
nextReadingOrderItem,
|
|
425
|
+
reducedMotion,
|
|
426
|
+
isFXL,
|
|
427
|
+
isRTL
|
|
428
|
+
]);
|
|
409
429
|
useEffect(() => {
|
|
410
430
|
if (isImmersive) {
|
|
411
431
|
const focusElement = document.activeElement;
|
|
@@ -763,5 +783,5 @@ function getReaderClassNames(options) {
|
|
|
763
783
|
}
|
|
764
784
|
|
|
765
785
|
export { StatefulReaderFooter, StatefulReaderHeader, getReaderClassNames, useFonts, useZoomCallbacks };
|
|
766
|
-
//# sourceMappingURL=chunk-
|
|
767
|
-
//# sourceMappingURL=chunk-
|
|
786
|
+
//# sourceMappingURL=chunk-2YS5JTIR.mjs.map
|
|
787
|
+
//# sourceMappingURL=chunk-2YS5JTIR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/StatefulReaderRunningHead.tsx","../src/components/StatefulReaderHeader.tsx","../src/components/assets/styles/thorium-web.reader.pagination.module.css","../src/components/assets/styles/thorium-web.reader.progression.module.css","../src/core/Components/Reader/ThProgression.tsx","../src/components/StatefulReaderProgression.tsx","../src/components/StatefulReaderPagination.tsx","../src/components/hooks/useAdjacentReadingOrderItems.ts","../src/components/StatefulReaderFooter.tsx","../src/core/Hooks/fonts/androidPatchCss.ts","../src/core/Hooks/fonts/useFonts.ts","../src/components/Settings/hooks/useZoomCallbacks.ts","../src/components/Helpers/getReaderClassNames.ts"],"names":["Fragment","jsx","wrapper","listItem","leftButton","progression","rightButton","label","useMemo","classNames","useRef","jsxs","useCallback","useEffect"],"mappings":";;;;;;;;;;;;;;;AAcO,IAAM,4BAA4B,CAAC;AAAA,EACxC;AACF,CAAA,KAEM;AACJ,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,OAAA,EAAQ;AAEtB,EAAA,MAAM,QAAA,GAAW,cAAA,CAAe,CAAA,KAAA,KAAS,KAAA,CAAM,YAAY,QAAQ,CAAA;AACnE,EAAA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,EAAM,iBAAA,EAAmB,QAAQ,CAAC,CAAA;AAEjE,EAAA,OAAO,EAAE,QAAQ,OAAA,EAAQ;AAC3B;AChDA,IAAM,cAAA,GAAiB;AAAA,EACrB,8BAAsB,uBAAA;AAAA,EACtB,8BAAsB;AACxB,CAAA;AAEA,IAAM,oBAAoB,CAAC,MAAA,EAAgB,EAAA,KACzC,CAAA,EAAI,MAAO,CAAA,EAAI,EAAA,CAAG,MAAA,CAAO,CAAC,EAAE,WAAA,EAAY,GAAI,EAAA,CAAG,KAAA,CAAM,CAAC,CAAE,CAAA,CAAA;AAEnD,SAAS,oBAAoB,OAAA,EAAqC;AACvE,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,QAAA;AAAA,IACA,WAAA,GAAc,KAAA;AAAA,IACd,UAAA,GAAa,KAAA;AAAA,IACb,KAAA,GAAQ,KAAA;AAAA,IACR,UAAA;AAAA,IACA;AAAA,GACF,GAAI,OAAA;AAEJ,EAAA,OAAOH,UAAAA;AAAA,IACL,8BAAA,CAAa,KAAA;AAAA,IACb,WAAW,sBAAA,GAAyB,qBAAA;AAAA,IACpC,WAAA,IAAe,yBAAA;AAAA,IACf,UAAA,IAAc,wBAAA;AAAA,IACd,QAAQ,mBAAA,GAAsB,sBAAA;AAAA,IAC9B,eAAe,QAAQ,CAAA;AAAA,IACvB,UAAA,GAAa,iBAAA,CAAkB,gBAAA,EAAkB,UAAU,CAAA,GAAI,MAAA;AAAA,IAC/D,mBAAA,GAAsB,iBAAA,CAAkB,0BAAA,EAA4B,mBAAmB,CAAA,GAAI;AAAA,GAC7F;AACF","file":"chunk-2YS5JTIR.mjs","sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\n\nimport { ThRunningHeadFormat } from \"@/preferences/models\";\nimport { ThFormatPref, ThFormatPrefValue } from \"@/preferences\";\n\nimport { ThRunningHead } from \"@/core/Components\";\n\nimport { useI18n } from \"@/i18n/useI18n\";\n\nimport { useAppSelector } from \"@/lib/hooks\";\nimport { makeBreakpointsMap } from \"@/core/Helpers/breakpointsMap\";\n\nexport const StatefulReaderRunningHead = ({ \n formatPref\n}: {\n formatPref?: ThFormatPref<ThRunningHeadFormat>;\n}) => {\n const { t } = useI18n();\n \n const progress = useAppSelector(state => state.publication.progress);\n const isImmersive = useAppSelector(state => state.reader.isImmersive);\n const isHovering = useAppSelector(state => state.reader.isHovering);\n const isFullscreen = useAppSelector(state => state.reader.isFullscreen);\n const breakpoint = useAppSelector(state => state.theming.containerBreakpoint);\n\n // Get the fallback format based on isFXL\n const fallbackFormat = useMemo<ThFormatPrefValue<ThRunningHeadFormat>>(() => ({\n variants: ThRunningHeadFormat.title,\n displayInImmersive: true,\n displayInFullscreen: true\n }), []);\n\n const breakpointsMap = useMemo(() => {\n return makeBreakpointsMap<ThFormatPrefValue<ThRunningHeadFormat>>({\n defaultValue: formatPref?.default || fallbackFormat,\n fromEnum: ThRunningHeadFormat,\n pref: formatPref?.breakpoints,\n validateKey: \"variants\"\n });\n }, [formatPref, fallbackFormat]);\n \n // Get current preferences with proper fallback\n const currentPrefs = useMemo(() => {\n if (!breakpoint) return formatPref?.default || fallbackFormat;\n return breakpointsMap[breakpoint] || formatPref?.default || fallbackFormat;\n }, [breakpoint, breakpointsMap, formatPref?.default, fallbackFormat]);\n\n const { variants, displayInImmersive, displayInFullscreen } = currentPrefs;\n\n const displayFormat = useMemo(() => {\n if (!variants) return ThRunningHeadFormat.title;\n \n // Check if we should hide in immersive mode\n if (isImmersive && displayInImmersive === false && !isHovering) {\n return ThRunningHeadFormat.none;\n }\n \n // Check if we should hide in fullscreen mode\n if (isImmersive && isFullscreen && displayInFullscreen === false && !isHovering) {\n return ThRunningHeadFormat.none;\n }\n \n return variants;\n }, [variants, isImmersive, displayInImmersive, isHovering, isFullscreen, displayInFullscreen]);\n\n const runningHead = useMemo(() => {\n if (displayFormat === ThRunningHeadFormat.title) {\n return progress?.title || \"\";\n } else if (displayFormat === ThRunningHeadFormat.chapter) {\n return progress?.progression?.currentChapter || progress?.title || \"\";\n }\n return \"\";\n }, [displayFormat, progress]);\n\n if (!runningHead || displayFormat === ThRunningHeadFormat.none) return null;\n \n return (\n <>\n <ThRunningHead \n label={ runningHead } \n aria-label={ t(\"reader.app.header.runningHead\") }\n />\n </>\n );\n}","\"use client\";\n\nimport React from \"react\";\n\nimport { ActionKeyType } from \"@/preferences\";\nimport { ThLayoutUI, ThRunningHeadFormat } from \"@/preferences/models\";\nimport { ThFormatPref } from \"@/preferences\";\n\nimport readerStyles from \"./assets/styles/thorium-web.reader.app.module.css\";\nimport readerHeaderStyles from \"./assets/styles/thorium-web.reader.header.module.css\";\nimport overflowMenuStyles from \"./Actions/assets/styles/thorium-web.overflow.module.css\";\n\nimport { ThHeader } from \"@/core/Components/Reader/ThHeader\";\nimport { StatefulBackLink } from \"./StatefulBackLink\";\nimport { StatefulReaderRunningHead } from \"./StatefulReaderRunningHead\";\nimport { ThInteractiveOverlay } from \"../core/Components/Reader/ThInteractiveOverlay\";\nimport { StatefulCollapsibleActionsBar } from \"./Actions/StatefulCollapsibleActionsBar\";\n\nimport { useReaderHeaderBase } from \"./hooks/useReaderHeaderBase\";\nimport { usePreferences } from \"@/preferences/hooks\";\n\nimport classNames from \"classnames\";\n\nexport const StatefulReaderHeader = ({\n actionKeys,\n actionsOrder,\n layout,\n runningHeadFormatPref\n}: {\n actionKeys: ActionKeyType[];\n actionsOrder: ActionKeyType[];\n layout: ThLayoutUI;\n runningHeadFormatPref?: ThFormatPref<ThRunningHeadFormat>;\n}) => {\n const {\n headerRef, focusWithinProps, setHover, removeHover,\n listActionItems, isImmersive, isHovering, isScroll, t,\n } = useReaderHeaderBase(actionKeys);\n\n const { preferences } = usePreferences();\n\n return (\n <>\n <ThInteractiveOverlay\n className={ classNames(readerStyles.barOverlay, readerStyles.headerOverlay) }\n isActive={ layout === ThLayoutUI.layered && isImmersive && !isHovering }\n onMouseEnter={ setHover }\n onMouseLeave={ removeHover }\n />\n\n <ThHeader\n ref={ headerRef }\n className={ classNames(readerStyles.topBar, readerHeaderStyles.header) }\n aria-label={ t(\"reader.app.header.label\") }\n onMouseEnter={ setHover }\n onMouseLeave={ removeHover }\n { ...focusWithinProps }\n >\n { preferences.theming.header?.backLink && <StatefulBackLink className={ readerHeaderStyles.backlinkWrapper } /> }\n\n <StatefulReaderRunningHead formatPref={ runningHeadFormatPref } />\n\n <StatefulCollapsibleActionsBar\n id=\"reader-header-overflowMenu\"\n items={ listActionItems() }\n prefs={{ ...preferences.actions, displayOrder: actionsOrder }}\n className={ readerHeaderStyles.actionsWrapper }\n aria-label={ t(\"reader.app.header.actions\") }\n overflowMenuClassName={\n (!isScroll || preferences.affordances.scroll.hintInImmersive)\n ? overflowMenuStyles.hint\n : undefined\n }\n />\n </ThHeader>\n </>\n );\n};\n",".wrapper {\n box-sizing: border-box;\n display: grid;\n gap: calc(var(--th-layout-spacing) / 2);\n grid-template-areas: \"pagination-start pagination-center pagination-end\";\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n background-color: var(--th-theme-background);\n color: var(--th-theme-text);\n align-items: center;\n width: 100%;\n max-width: var(--th-layout-constraints-pagination, 100%);\n}\n\n.listItem {\n box-sizing: border-box;\n list-style: none;\n}\n\n.listItem:has(.leftButton) {\n grid-area: pagination-start;\n justify-self: start;\n}\n\n.listItem:has(.progression) {\n grid-area: pagination-center;\n justify-self: center;\n}\n\n.listItem:has(.rightButton) {\n grid-area: pagination-end;\n justify-self: end;\n}\n\n\n.listItem button {\n box-sizing: border-box;\n padding: calc(var(--th-icon-size, 24px) * (1/4)) calc(var(--th-layout-spacing) / 2);\n gap: calc(var(--th-layout-spacing) / 2);\n max-height: calc(var(--th-icon-size, 24px) * 2);\n max-width: 100%;\n border-radius: var(--th-layout-radius);\n display: flex;\n align-items: center;\n}\n\n.rightButton {\n margin-inline-start: auto;\n text-align: end;\n}\n\n.listItem button[data-hovered] {\n background-color: var(--th-theme-hover);\n color: var(--th-theme-onHover);\n}\n\n.listItem button[data-focus-visible] {\n outline: 2px solid var(--th-theme-focus);\n}\n\n.listItem button[data-disabled] {\n color: var(--th-theme-disable);\n}\n\n.listItem button .label {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n white-space: normal;\n -webkit-line-clamp: 1;\n line-clamp: 1;\n}\n\n.listItem button svg {\n flex: none;\n width: var(--th-icon-size, 24px);\n height: var(--th-icon-size, 24px);\n fill: currentColor;\n}",".wrapper {\n color: var(--th-theme-text);\n font-variant-numeric: lining-nums tabular-nums;\n text-align: center;\n}","\"use client\";\n\nimport React from \"react\";\n\nexport interface ThProgressionProps extends React.HTMLAttributes<HTMLDivElement> {\n ref?: React.RefObject<HTMLDivElement>\n}\n\nexport const ThProgression = ({ \n ref,\n children, \n ...props\n}: ThProgressionProps) => {\n return (\n <>\n <div \n ref={ ref } \n {...props }\n >\n { children }\n </div>\n </>\n )\n}","\"use client\";\n\nimport { useMemo } from \"react\";\n\nimport progressionStyles from \"./assets/styles/thorium-web.reader.progression.module.css\";\n\nimport { ThProgressionFormat } from \"@/preferences/models\";\nimport { ThFormatPref, ThFormatPrefValue } from \"@/preferences\";\n\nimport { ThProgression } from \"@/core/Components/Reader/ThProgression\";\n\nimport { useI18n } from \"@/i18n/useI18n\";\n\nimport { useAppSelector } from \"@/lib/hooks\";\n\nimport { makeBreakpointsMap } from \"@/core/Helpers/breakpointsMap\";\nimport { getBestMatchingProgressionFormat } from \"@/core/Helpers/progressionFormat\";\n\nimport classNames from \"classnames\";\n\nexport const StatefulReaderProgression = ({ \n className,\n formatPref,\n fallbackVariant\n}: { \n className?: string,\n formatPref?: ThFormatPref<ThProgressionFormat | ThProgressionFormat[]>,\n fallbackVariant: ThProgressionFormat | Array<ThProgressionFormat>\n}) => {\n const { t } = useI18n();\n \n const progress = useAppSelector(state => state.publication.progress);\n const isImmersive = useAppSelector(state => state.reader.isImmersive);\n const isFullscreen = useAppSelector(state => state.reader.isFullscreen);\n const isHovering = useAppSelector(state => state.reader.isHovering);\n const breakpoint = useAppSelector(state => state.theming.breakpoint);\n\n \n const fallbackFormat = useMemo(() => {\n return {\n variants: fallbackVariant,\n displayInImmersive: true,\n displayInFullscreen: true\n };\n }, [fallbackVariant]);\n \n const breakpointsMap = useMemo(() => {\n return makeBreakpointsMap<ThFormatPrefValue<ThProgressionFormat | ThProgressionFormat[]>>({\n defaultValue: formatPref?.default || fallbackFormat,\n fromEnum: ThProgressionFormat,\n pref: formatPref?.breakpoints,\n validateKey: \"variants\"\n });\n }, [formatPref, fallbackFormat]);\n \n // Get current preferences with proper fallback\n const currentPrefs = useMemo(() => {\n if (!breakpoint) return formatPref?.default || fallbackFormat;\n return breakpointsMap[breakpoint] || formatPref?.default || fallbackFormat;\n }, [breakpoint, breakpointsMap, formatPref?.default, fallbackFormat]);\n\n const { variants, displayInImmersive, displayInFullscreen } = currentPrefs;\n \n // Get the display format, handling both single format and array of formats\n const displayFormat = useMemo(() => {\n if (!variants) return fallbackFormat.variants;\n \n // Check if we should hide in immersive mode\n if (isImmersive && displayInImmersive === false && !isHovering) {\n return ThProgressionFormat.none;\n }\n \n // Check if we should hide in fullscreen mode\n if (isImmersive && isFullscreen && displayInFullscreen === false && !isHovering) {\n return ThProgressionFormat.none;\n }\n \n if (Array.isArray(variants)) {\n return getBestMatchingProgressionFormat(variants, progress?.progression) || \n fallbackFormat.variants;\n }\n \n return variants;\n }, [variants, progress?.progression, fallbackFormat, isImmersive, isHovering, isFullscreen, displayInImmersive, displayInFullscreen]);\n\n // Compute display text based on current position and timeline\n const displayText = useMemo(() => {\n if (displayFormat === ThProgressionFormat.none || !progress?.progression) {\n return \"\";\n }\n\n const { \n currentPositions = [],\n totalPositions,\n relativeProgression,\n totalProgression,\n currentChapter,\n positionsLeft,\n totalItems,\n currentIndex\n } = progress.progression;\n \n let text = \"\";\n \n // Format positions for display (handle array of two positions with a dash)\n const formatPositions = (positions: number[]) => {\n if (positions.length === 2) {\n return positions.join(\"–\");\n }\n return positions[0]?.toString() || \"\";\n };\n \n switch (displayFormat) {\n case ThProgressionFormat.positions:\n if (currentPositions.length > 0) {\n text = formatPositions(currentPositions);\n }\n break;\n \n case ThProgressionFormat.positionsOfTotal:\n if (currentPositions.length > 0 && totalPositions) {\n text = t(\"reader.progression.xOfY.compact\", { \n x: formatPositions(currentPositions),\n y: totalPositions\n });\n }\n break;\n\n case ThProgressionFormat.positionsPercentOfTotal:\n if (currentPositions.length > 0 && totalPositions) {\n const percentage = Math.round((totalProgression || 0) * 100);\n text = t(\"reader.progression.xOfY.descriptive\", { \n x: formatPositions(currentPositions),\n y: totalPositions,\n z: `${ percentage }%`\n });\n }\n break;\n \n case ThProgressionFormat.positionsLeft:\n if (positionsLeft !== undefined) {\n text = t(`reader.progression.positionsLeftInChapter.descriptive`, { \n count: positionsLeft\n });\n }\n break;\n \n case ThProgressionFormat.overallProgression:\n if (totalProgression !== undefined) {\n const percentage = Math.round(totalProgression * 100);\n text = `${ percentage }%`;\n }\n break;\n \n case ThProgressionFormat.resourceProgression:\n if (relativeProgression !== undefined) {\n const percentage = Math.round(relativeProgression * 100);\n text = `${ percentage }%`;\n }\n break;\n \n case ThProgressionFormat.progressionOfResource:\n if (relativeProgression !== undefined) {\n const percentage = Math.round(relativeProgression * 100);\n text = t(\"reader.progression.xOfY.compact\", {\n x: `${ percentage }%`,\n y: currentChapter || t(\"reader.app.progression.referenceFallback\")\n });\n }\n break;\n\n case ThProgressionFormat.readingOrderIndex:\n if (currentIndex !== undefined && totalItems !== undefined) {\n text = t(\"reader.progression.xOfY.compact\", {\n x: currentIndex,\n y: totalItems\n });\n }\n break;\n }\n \n return text;\n }, [displayFormat, progress, t]);\n\n if (!displayText || displayFormat === ThProgressionFormat.none) {\n return null;\n }\n\n return (\n <ThProgression \n id=\"current-progression\" \n className={ classNames(progressionStyles.wrapper, className) }\n aria-label={ t(\"reader.app.progression.wrapper\") }\n >\n { displayText }\n </ThProgression>\n );\n};","\"use client\";\n\nimport { useRef, KeyboardEvent } from \"react\";\n\nimport { ThPagination, ThPaginationProps } from \"@/core/Components/Reader/ThPagination\";\n\nimport readerPaginationStyles from \"./assets/styles/thorium-web.reader.pagination.module.css\";\n\nexport const StatefulReaderPagination = ({\n ref,\n links,\n compounds,\n children,\n ...props\n}: ThPaginationProps) => {\n const leftButtonRef = useRef<HTMLButtonElement>(null);\n const rightButtonRef = useRef<HTMLButtonElement>(null);\n\n const updatedCompounds = {\n ...compounds,\n leftButton: {\n ...compounds?.leftButton,\n ref: leftButtonRef,\n onKeyDown: (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n leftButtonRef.current?.blur();\n }\n }\n },\n rightButton: {\n ...compounds?.rightButton,\n ref: rightButtonRef,\n onKeyDown: (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n rightButtonRef.current?.blur();\n }\n }\n }\n };\n\n return (\n <ThPagination\n ref={ ref }\n className={ readerPaginationStyles.wrapper }\n links={ links }\n compounds={ updatedCompounds }\n { ...props }\n >\n { children }\n </ThPagination>\n )\n}\n","import { Link, Links } from \"@readium/shared\";\n\nimport { useAppSelector } from \"@/lib/hooks\";\n\nexport const useAdjacentReadingOrderItems = (\n readingOrder: Links | undefined\n): { previous: Link | null; next: Link | null } => {\n const currentIndex = useAppSelector(state => state.publication.progress?.progression?.currentIndex);\n\n if (!readingOrder || currentIndex === undefined) return { previous: null, next: null };\n\n const index = currentIndex - 1; // currentIndex is 1-based, see usePublicationProgress.ts\n\n return {\n previous: index > 0 ? readingOrder.items[index - 1] : null,\n next: index < readingOrder.items.length - 1 ? readingOrder.items[index + 1] : null\n };\n};\n","\"use client\";\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\nimport readerStyles from \"./assets/styles/thorium-web.reader.app.module.css\";\nimport readerPaginationStyles from \"./assets/styles/thorium-web.reader.pagination.module.css\";\n\nimport { ThBreakpoints, ThLayoutUI, ThFormatPref, ThProgressionFormat, ThNavigationAffordance } from \"@/preferences/models\";\n\nimport { ThFooter } from \"@/core/Components/Reader/ThFooter\";\nimport { StatefulReaderProgression } from \"./StatefulReaderProgression\";\nimport { ThInteractiveOverlay } from \"../core/Components/Reader/ThInteractiveOverlay\";\nimport { StatefulReaderPagination } from \"./StatefulReaderPagination\";\nimport { ThPaginationLinkProps } from \"@/core/Components/Reader/ThPagination\";\n\nimport { Link, Publication } from \"@readium/shared\";\n\nimport { useNavigator } from \"@/core/Navigator\";\nimport { useFocusWithin, useLocale } from \"react-aria\";\nimport { useI18n } from \"@/i18n/useI18n\";\nimport { usePreferences } from \"@/preferences/hooks/usePreferences\";\n\nimport { setHovering } from \"@/lib/readerReducer\";\nimport { useAppDispatch, useAppSelector } from \"@/lib/hooks\";\nimport { useIsScroll } from \"@/hooks\";\nimport { useAdjacentReadingOrderItems } from \"./hooks/useAdjacentReadingOrderItems\";\n\nimport classNames from \"classnames\";\n\nexport const StatefulReaderFooter = ({\n layout,\n publication,\n progressionFormatPref,\n progressionFormatFallback\n}: {\n layout: ThLayoutUI;\n publication: Publication;\n progressionFormatPref?: ThFormatPref<ThProgressionFormat | ThProgressionFormat[]>;\n progressionFormatFallback: ThProgressionFormat | ThProgressionFormat[];\n}) => {\n const { t } = useI18n();\n const { direction } = useLocale();\n const footerRef = useRef<HTMLDivElement>(null);\n const isImmersive = useAppSelector(state => state.reader.isImmersive);\n const isHovering = useAppSelector(state => state.reader.isHovering);\n const hasScrollAffordance = useAppSelector(state => state.reader.hasScrollAffordance);\n const isRTL = useAppSelector(state => state.publication.isRTL);\n const isFXL = useAppSelector(state => state.publication.isFXL);\n const isScroll = useIsScroll();\n const breakpoint = useAppSelector(state => state.theming.containerBreakpoint);\n const reducedMotion = useAppSelector(state => state.theming.prefersReducedMotion);\n const adjacentTimelineItems = useAppSelector(state => state.publication.adjacentTimelineItems);\n const { previous: previousReadingOrderItem, next: nextReadingOrderItem } = useAdjacentReadingOrderItems(publication.readingOrder);\n const { preferences } = usePreferences();\n const affordance = preferences.affordances.scroll.affordance;\n\n const dispatch = useAppDispatch();\n\n const { focusWithinProps } = useFocusWithin({\n onFocusWithin() {\n dispatch(setHovering(true));\n },\n onBlurWithin() {\n dispatch(setHovering(false));\n }\n });\n\n const setHover = () => {\n if (!hasScrollAffordance) {\n dispatch(setHovering(true));\n }\n };\n\n const removeHover = () => {\n if (!hasScrollAffordance) {\n dispatch(setHovering(false));\n }\n };\n\n const { goLink } = useNavigator().unified;\n\n const buildNode = useCallback((\n title: string | undefined,\n compactKey: string,\n descriptiveKey: string\n ) => {\n return breakpoint !== ThBreakpoints.compact && breakpoint !== ThBreakpoints.medium ? (\n <>\n <span className={ readerStyles.srOnly }>{ t(descriptiveKey) }</span>\n <span className={ readerPaginationStyles.label }>{ title || t(compactKey) }</span>\n </>\n ) : (\n <span className={ readerPaginationStyles.label }>{ t(compactKey) }</span>\n );\n }, [t, breakpoint]);\n\n const updateLinks = useCallback(() => {\n const previous = affordance === ThNavigationAffordance.readingOrder\n ? previousReadingOrderItem\n : adjacentTimelineItems.previous;\n\n const next = affordance === ThNavigationAffordance.readingOrder\n ? nextReadingOrderItem\n : adjacentTimelineItems.next;\n\n const previousLink: ThPaginationLinkProps | undefined = previous ? {\n node: buildNode(\n previous.title,\n isFXL ? \"reader.actions.goToPreviousPage.compact\" : \"reader.actions.goToPreviousChapter.compact\",\n isFXL ? \"reader.actions.goToPreviousPage.descriptive\" : \"reader.actions.goToPreviousChapter.descriptive\"\n ),\n onPress: () => goLink(new Link({ href: previous.href }), !reducedMotion, () => {})\n } : undefined;\n\n const nextLink: ThPaginationLinkProps | undefined = next ? {\n node: buildNode(\n next.title,\n isFXL ? \"reader.actions.goToNextPage.compact\" : \"reader.actions.goToNextChapter.compact\",\n isFXL ? \"reader.actions.goToNextPage.descriptive\" : \"reader.actions.goToNextChapter.descriptive\"\n ),\n onPress: () => goLink(new Link({ href: next.href }), !reducedMotion, () => {})\n } : undefined;\n\n return isRTL\n ? { left: nextLink, right: previousLink }\n : { left: previousLink, right: nextLink };\n }, [\n goLink,\n buildNode,\n affordance,\n adjacentTimelineItems,\n previousReadingOrderItem,\n nextReadingOrderItem,\n reducedMotion,\n isFXL,\n isRTL\n ]);\n\n useEffect(() => {\n // Blur any focused element when entering immersive mode\n if (isImmersive) {\n const focusElement = document.activeElement;\n if (focusElement && footerRef.current?.contains(focusElement)) {\n (focusElement as HTMLElement).blur();\n }\n }\n }, [isImmersive]);\n\n return(\n <>\n <ThInteractiveOverlay\n className={ classNames(readerStyles.barOverlay, readerStyles.footerOverlay) }\n isActive={ layout === ThLayoutUI.layered && isImmersive && !isHovering }\n onMouseEnter={ setHover }\n onMouseLeave={ removeHover }\n />\n\n <ThFooter\n ref={ footerRef }\n className={ readerStyles.bottomBar }\n aria-label={ t(\"reader.app.footer.label\") }\n onMouseEnter={ setHover }\n onMouseLeave={ removeHover }\n { ...focusWithinProps }\n >\n { (isScroll)\n ? <StatefulReaderPagination\n aria-label={ t(\"reader.navigation.scroll.wrapper\") }\n links={ updateLinks() }\n dir={ direction }\n compounds={ {\n listItem: {\n className: readerPaginationStyles.listItem\n },\n leftButton: {\n className: readerPaginationStyles.leftButton,\n preventFocusOnPress: true\n },\n rightButton: {\n className: readerPaginationStyles.rightButton,\n preventFocusOnPress: true\n }\n } }\n >\n <StatefulReaderProgression\n className={ readerPaginationStyles.progression }\n formatPref={ progressionFormatPref }\n fallbackVariant={ progressionFormatFallback }\n />\n </StatefulReaderPagination>\n : <StatefulReaderProgression\n formatPref={ progressionFormatPref }\n fallbackVariant={ progressionFormatFallback }\n /> }\n </ThFooter>\n </>\n )\n}\n","export const getAndroidPatchCss = () => {\n if (typeof window === \"undefined\") {\n return \"\";\n }\n \n const origin = window.location.origin;\n \n return `/* Readium CSS\n Android Fonts Patch module\n\n A stylesheet aligning Android generic serif and sans-serif fonts on other platforms\n\n Repo: https://github.com/readium/css */\n\n/* Android resolves sans-serif to Roboto, and serif to Droid Serif \n This created issues for FXL EPUBs relying on Times (New Roman),\n Helvetica or Arial while not embedding the font files in the package.\n\n See https://github.com/readium/css/issues/149\n\n Unfortunately it is no possible to target generic family using @font-face,\n we have to target specific font-family names e.g. Times, Arial, etc.\n\n This stylesheet/patch should be loaded only for this case i.e.\n a Fixed-Layout EPUB with text but no embedded font on an Android device.\n The logic for checking these conditions are up to implementers.\n*/\n\n/* Serif (Times + Times New Roman) */\n\n@font-face {\n font-family: Times;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: normal;\n}\n\n@font-face {\n font-family: \"Times New Roman\";\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: normal;\n}\n\n@font-face {\n font-family: Times;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-Italic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: italic;\n}\n\n@font-face {\n font-family: \"Times New Roman\";\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-Italic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: italic;\n}\n\n@font-face {\n font-family: Times;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-Bold.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: normal;\n}\n\n@font-face {\n font-family: \"Times New Roman\";\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-Bold.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: normal;\n}\n\n@font-face {\n font-family: Times;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-BoldItalic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: italic;\n}\n\n@font-face {\n font-family: \"Times New Roman\";\n src: url(\"${ new URL(\"/fonts/AndroidPatch/serif/NimbusRoman-BoldItalic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: italic;\n}\n\n/* Sans-serif (Helvetica + Arial) */\n\n@font-face {\n font-family: Helvetica;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: normal;\n}\n\n@font-face {\n font-family: Arial;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: normal;\n}\n\n@font-face {\n font-family: Helvetica;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-Italic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: italic;\n}\n\n@font-face {\n font-family: Arial;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-Italic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: normal;\n font-style: italic;\n}\n\n@font-face {\n font-family: Helvetica;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-Bold.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: normal;\n}\n\n@font-face {\n font-family: Arial;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-Bold.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: normal;\n}\n\n@font-face {\n font-family: Helvetica;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-BoldItalic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: italic;\n}\n\n@font-face {\n font-family: Arial;\n src: url(\"${ new URL(\"/fonts/AndroidPatch/sans-serif/NimbusSans-BoldItalic.woff\", origin).toString() }\") format(\"woff\");\n font-weight: bold;\n font-style: italic;\n}`;\n};\n","\"use client\";\n\nimport { useCallback, useEffect, useRef } from \"react\";\n\nimport { InjectableFontResources } from \"@/preferences/services/fonts\";\nimport { ILinkInjectable, IUrlInjectable, IBlobInjectable } from \"@readium/navigator\";\n\nimport { getPlatform } from \"@/core/Helpers/getPlatform\";\nimport { getAndroidPatchCss } from \"./androidPatchCss\";\n\ntype FontResource = (ILinkInjectable & IUrlInjectable) | (ILinkInjectable & IBlobInjectable);\n\nexport const useFonts = (fontResources?: InjectableFontResources | null) => {\n const injectedElementsRef = useRef<{\n prepend: HTMLElement[];\n append: HTMLElement[];\n }>({\n prepend: [],\n append: []\n });\n\n const createLinkElement = useCallback((resource: FontResource): HTMLLinkElement => {\n const link = document.createElement(\"link\");\n \n // Set all custom attributes first to make sure they are\n // overridden by the core attributes\n if (\"attributes\" in resource && resource.attributes) {\n Object.entries(resource.attributes).forEach(([key, value]) => {\n link.setAttribute(key, value as string);\n });\n }\n \n link.rel = resource.rel;\n link.as = resource.as;\n \n if (\"url\" in resource) {\n link.href = resource.url;\n } else if (\"blob\" in resource && resource.blob) {\n link.href = URL.createObjectURL(resource.blob);\n }\n \n return link;\n }, []);\n\n const removeInjectedElements = useCallback(() => {\n const { prepend, append } = injectedElementsRef.current;\n \n [...prepend, ...append].forEach(element => {\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n // Revoke blob URLs to prevent memory leaks\n if (element instanceof HTMLLinkElement && element.href.startsWith(\"blob:\")) {\n URL.revokeObjectURL(element.href);\n }\n });\n \n injectedElementsRef.current = {\n prepend: [],\n append: []\n };\n }, []);\n\n const injectFontResources = useCallback((resources: InjectableFontResources | null) => {\n if (typeof document === \"undefined\") return;\n \n removeInjectedElements();\n \n if (!resources) return;\n \n const { prepend, append } = resources;\n const injectedElements = injectedElementsRef.current;\n \n prepend.forEach(resource => {\n const element = createLinkElement(resource);\n document.head.insertBefore(element, document.head.firstChild);\n injectedElements.prepend.push(element);\n });\n \n append.forEach(resource => {\n const element = createLinkElement(resource);\n document.head.appendChild(element);\n injectedElements.append.push(element);\n });\n }, [createLinkElement, removeInjectedElements]);\n\n const getAndroidFXLPatch = useCallback((): (ILinkInjectable & IBlobInjectable) | null => {\n const platform = getPlatform();\n const isAndroid = platform === \"android\";\n \n if (!isAndroid) {\n return null;\n }\n \n const cssContent = getAndroidPatchCss();\n const blob = new Blob([cssContent], { type: \"text/css\" });\n \n return {\n as: \"link\",\n rel: \"stylesheet\",\n blob\n };\n }, []);\n\n useEffect(() => {\n injectFontResources(fontResources || null);\n \n return () => {\n removeInjectedElements();\n };\n }, [fontResources, injectFontResources, removeInjectedElements]);\n\n return {\n injectFontResources,\n removeFontResources: removeInjectedElements,\n getAndroidFXLPatch\n };\n};","import { useCallback } from \"react\";\n\nimport { ThSettingsKeys } from \"@/preferences/models\";\nimport { usePreferences } from \"@/preferences/hooks/usePreferences\";\nimport { useAppDispatch, useAppSelector } from \"@/lib/hooks\";\nimport { setFontSize } from \"@/lib/settingsReducer\";\nimport { setWebPubZoom } from \"@/lib/webPubSettingsReducer\";\nimport { useEffectiveRange } from \"./useEffectiveRange\";\nimport { EpubPreferencesEditor, IEpubPreferences, IWebPubPreferences, WebPubPreferencesEditor } from \"@readium/navigator\";\nimport { useEpubNavigator } from \"@/core/Hooks/Epub/useEpubNavigator\";\nimport { useWebPubNavigator } from \"@/core/Hooks/WebPub/useWebPubNavigator\";\n\ntype ZoomNavigator = ReturnType<typeof useEpubNavigator> | ReturnType<typeof useWebPubNavigator>;\n\nexport const useZoomCallbacks = (navigator: ZoomNavigator) => {\n const { preferences } = usePreferences();\n const readerProfile = useAppSelector(state => state.reader.profile);\n const isFXL = useAppSelector(state => state.publication.isFXL);\n const dispatch = useAppDispatch();\n\n const isWebPub = readerProfile === \"webPub\";\n\n const getSetting = navigator.getSetting as (key: string) => number | null | undefined;\n const submitPreferences = navigator.submitPreferences as (prefs: IEpubPreferences | IWebPubPreferences) => Promise<void>;\n const { preferencesEditor } = navigator;\n\n const supportedRange = isWebPub\n ? (preferencesEditor as WebPubPreferencesEditor)?.zoom?.supportedRange\n : isFXL\n ? (preferencesEditor as unknown as WebPubPreferencesEditor)?.zoom?.supportedRange\n : (preferencesEditor as EpubPreferencesEditor)?.fontSize?.supportedRange;\n\n const zoomConfig = preferences.settings.keys[ThSettingsKeys.zoom];\n const { range } = useEffectiveRange(zoomConfig.range, supportedRange);\n const [min, max] = range;\n const step = zoomConfig.step ?? 0.05;\n\n const zoomIn = useCallback(async () => {\n if (isWebPub) {\n const next = Math.min(max, (getSetting(\"zoom\") ?? 1) + step);\n await submitPreferences({ zoom: next });\n dispatch(setWebPubZoom(getSetting(\"zoom\")));\n } else {\n const next = Math.min(max, (getSetting(\"fontSize\") ?? 1) + step);\n await submitPreferences({ fontSize: next });\n dispatch(setFontSize(getSetting(\"fontSize\")));\n }\n }, [isWebPub, getSetting, max, step, submitPreferences, dispatch]);\n\n const zoomOut = useCallback(async () => {\n if (isWebPub) {\n const next = Math.max(min, (getSetting(\"zoom\") ?? 1) - step);\n await submitPreferences({ zoom: next });\n dispatch(setWebPubZoom(getSetting(\"zoom\")));\n } else {\n const next = Math.max(min, (getSetting(\"fontSize\") ?? 1) - step);\n await submitPreferences({ fontSize: next });\n dispatch(setFontSize(getSetting(\"fontSize\")));\n }\n }, [isWebPub, getSetting, min, step, submitPreferences, dispatch]);\n\n return { zoomIn, zoomOut };\n};\n","import { ThLayoutUI } from \"@/preferences\";\nimport readerStyles from \"../assets/styles/thorium-web.reader.app.module.css\";\nimport classNames from \"classnames\";\n\ninterface ReaderStyleOptions {\n layoutUI: ThLayoutUI;\n isScroll: boolean;\n isImmersive?: boolean;\n isHovering?: boolean;\n isFXL?: boolean;\n breakpoint?: string;\n containerBreakpoint?: string;\n}\n\nconst LAYOUT_CLASSES = {\n [ThLayoutUI.stacked]: \"thorium_web_stackedUI\",\n [ThLayoutUI.layered]: \"thorium_web_layeredUI\",\n} as const;\n\nconst toBreakpointClass = (prefix: string, bp: string) =>\n `${ prefix }${ bp.charAt(0).toUpperCase() + bp.slice(1) }`;\n\nexport function getReaderClassNames(options: ReaderStyleOptions): string {\n const {\n layoutUI,\n isScroll,\n isImmersive = false,\n isHovering = false,\n isFXL = false,\n breakpoint,\n containerBreakpoint,\n } = options;\n\n return classNames(\n readerStyles.shell,\n isScroll ? \"thorium_web_isScroll\" : \"thorium_web_isPaged\",\n isImmersive && \"thorium_web_isImmersive\",\n isHovering && \"thorium_web_isHovering\",\n isFXL ? \"thorium_web_isFXL\" : \"thorium_web_isReflow\",\n LAYOUT_CLASSES[layoutUI],\n breakpoint ? toBreakpointClass(\"thorium_web_is\", breakpoint) : undefined,\n containerBreakpoint ? toBreakpointClass(\"thorium_web_container_is\", containerBreakpoint) : undefined\n );\n}"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThBreakpoints } from './chunk-
|
|
1
|
+
import { ThBreakpoints } from './chunk-QOU3R5ZT.mjs';
|
|
2
2
|
|
|
3
3
|
// src/core/Helpers/breakpointsMap.ts
|
|
4
4
|
var makeBreakpointsMap = ({
|
|
@@ -136,5 +136,5 @@ var getBestMatchingProgressionFormat = (preferredFormats, timeline) => {
|
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
export { canRenderProgressionFormat, getBestMatchingProgressionFormat, getSupportedProgressionFormats, isActiveElement, isInteractiveElement, isKeyboardTriggered, makeBreakpointsMap };
|
|
139
|
-
//# sourceMappingURL=chunk-
|
|
140
|
-
//# sourceMappingURL=chunk-
|
|
139
|
+
//# sourceMappingURL=chunk-3R5JARA2.mjs.map
|
|
140
|
+
//# sourceMappingURL=chunk-3R5JARA2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/Helpers/breakpointsMap.ts","../src/core/Helpers/focusUtilities.ts","../src/core/Helpers/progressionFormat.ts"],"names":[],"mappings":";;;AAKO,IAAM,qBAAqB,CAAI;AAAA,EACpC,YAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,KAMmC;AAEjC,EAAA,MAAM,WAAA,GAAc,CAAC,KAAA,KAAwB;AAC3C,IAAA,IAAI,CAAC,aAAa,OAAO,IAAA;AAGzB,IAAA,MAAM,cAAA,GAAiB,CAAC,GAAA,EAA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AAA,IAAI,gBAAA,CAAiB,MAAA,GAAS,CAAA,IAAK,cAAA,EAAgB;AACjD,IAAA,SAAA,CAAU,IAAA;AAAA,MAAA,kBAAA;AAAA,MAAA,yBAAA;AAAA,KAGV;AAAA,EACF;AAEA,EAAA,IAAI,kBAAkB,MAAA,EAAW;AAC/B,IAAA,SAAA,CAAU,IAAA,CAAA,eAAA,qBAAsC;AAAA,EAClD;AAEA,EAAA,IAAI,wBAAwB,MAAA,EAAW;AACrC,IAAA,SAAA,CAAU,IAAA;AAAA,MAAA,qBAAA;AAAA,MAAA,uBAAA;AAAA,KAGV;AAAA,EACF;AAEA,EAAA,IAAI,qBAAqB,MAAA,EAAW;AAClC,IAAA,SAAA,CAAU,IAAA,CAAA,oBAAA,0BAA2C;AAAA,EACvD;AAEA,EAAA,IAAI,YAAA,KAAiB,MAAA,IAAa,UAAA,KAAe,MAAA,EAAW;AAC1D,IAAA,SAAA,CAAU,IAAA,CAAA,mBAAA,yBAA0C;AAAA,EACtD;AAEA,EAAA,OAAO,SAAA;AACT;AAEO,IAAM,0BAAA,GAA6B,CACxC,MAAA,EACA,gBAAA,KACY;AACZ,EAAA,OAAO,gBAAA,CAAiB,SAAS,MAAM,CAAA;AACzC;AAEO,IAAM,gCAAA,GAAmC,CAC9C,gBAAA,EACA,QAAA,KAC+B;AAC/B,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,gBAAA,GAAmB,+BAA+B,QAAQ,CAAA;AAGhE,EAAA,MAAM,iBAAiB,gBAAA,CAAiB,IAAA;AAAA,IAAK,CAAA,MAAA,KAC3C,0BAAA,CAA2B,MAAA,EAAQ,gBAAgB;AAAA,GACrD;AAEA,EAAA,OAAO,cAAA,IAAkB,IAAA;AAC3B","file":"chunk-VYSDLACR.mjs","sourcesContent":["\"use client\";\n\nimport { ThBreakpoints } from \"@/preferences/models\";\nimport { BreakpointsMap } from \"@/core/Hooks/useBreakpoints\";\n\nexport const makeBreakpointsMap = <T>({\n defaultValue,\n fromEnum,\n pref,\n disabledValue,\n validateKey\n}: {\n defaultValue: T;\n fromEnum: any;\n pref?: BreakpointsMap<T> | boolean;\n disabledValue?: T;\n validateKey?: string;\n}): Required<BreakpointsMap<T>> => {\n \n const isValidType = (value: any): boolean => {\n if (!validateKey) return true;\n \n // Helper to get nested property\n const getNestedValue = (obj: any, path: string) => \n path.split(\".\").reduce((o, p) => o?.[p], obj);\n \n const valueToCheck = getNestedValue(value, validateKey);\n if (valueToCheck === undefined) return false;\n \n if (Array.isArray(valueToCheck)) {\n return valueToCheck.every(v => Object.values(fromEnum).includes(v));\n }\n return Object.values(fromEnum).includes(valueToCheck);\n };\n\n const breakpointsMap: Required<BreakpointsMap<T>> = {\n [ThBreakpoints.compact]: defaultValue,\n [ThBreakpoints.medium]: defaultValue,\n [ThBreakpoints.expanded]: defaultValue,\n [ThBreakpoints.large]: defaultValue,\n [ThBreakpoints.xLarge]: defaultValue\n };\n\n if (typeof pref === \"boolean\" || pref instanceof Boolean) {\n if (!pref && disabledValue) {\n Object.values(ThBreakpoints).forEach((key) => {\n breakpointsMap[key] = disabledValue;\n });\n }\n } else if (typeof pref === \"string\" && (!validateKey || isValidType(pref))) {\n Object.values(ThBreakpoints).forEach((key) => {\n breakpointsMap[key] = pref as unknown as T;\n });\n } else if (typeof pref === \"object\") {\n Object.entries(pref).forEach(([key, value]) => {\n if (!value) return;\n \n const isValid = !validateKey || isValidType(value);\n \n if (isValid) {\n // Merge the default value with the breakpoint-specific overrides\n if (typeof value === \"object\" && !Array.isArray(value)) {\n breakpointsMap[key as ThBreakpoints] = {\n ...defaultValue,\n ...value\n };\n } else {\n breakpointsMap[key as ThBreakpoints] = value as T;\n }\n }\n });\n }\n\n return breakpointsMap;\n};","\"use client\";\n\nexport const isActiveElement = (el: Element | undefined | null) => {\n if (el) return document.activeElement === el;\n return false;\n}\n\nexport const isKeyboardTriggered = (el: Element | undefined | null) => {\n if (el) return el.matches(\":focus-visible\");\n return false;\n}\n\nexport const isInteractiveElement = (element: Element | null) => {\n const iElements = [\"A\", \"AREA\", \"BUTTON\", \"DETAILS\", \"INPUT\", \"SELECT\", \"TEXTAREA\"];\n const iRoles = [\"dialog\", \"radiogroup\", \"radio\", \"menu\", \"menuitem\"]\n\n if (element && (element instanceof HTMLElement || element instanceof SVGElement)) {\n if (element.closest(\"[inert]\")) return false;\n if (element.hasAttribute(\"disabled\")) return false;\n if (element.role && iRoles.includes(element.role)) return true;\n\n // Panel Resize Handler cos’ of typo on tabIndex/tabindex\n if (element.hasAttribute(\"tabindex\")) {\n const attr = element.getAttribute(\"tabindex\");\n return attr && parseInt(attr, 10) >= 0;\n }\n\n if (element.tabIndex) return element.tabIndex >= 0;\n if (iElements.includes(element.tagName)) return true;\n }\n\n return false;\n}\n","import { ThProgressionFormat } from \"@/preferences/models\";\nimport { TimelineProgression } from \"@/core/Hooks/useTimeline\";\n\nexport const getSupportedProgressionFormats = (timeline?: TimelineProgression): ThProgressionFormat[] => {\n if (!timeline) {\n return [ThProgressionFormat.none];\n }\n\n const {\n currentPositions = [],\n totalPositions,\n relativeProgression,\n totalProgression,\n currentIndex,\n totalItems,\n positionsLeft\n } = timeline;\n\n const supported: ThProgressionFormat[] = [ThProgressionFormat.none];\n\n if (currentPositions.length > 0) {\n supported.push(ThProgressionFormat.positions);\n }\n \n if (currentPositions.length > 0 && totalPositions) {\n supported.push(\n ThProgressionFormat.positionsOfTotal,\n ThProgressionFormat.positionsPercentOfTotal\n );\n }\n \n if (positionsLeft !== undefined) {\n supported.push(ThProgressionFormat.positionsLeft);\n }\n \n if (relativeProgression !== undefined) {\n supported.push(\n ThProgressionFormat.resourceProgression,\n ThProgressionFormat.progressionOfResource\n );\n }\n \n if (totalProgression !== undefined) {\n supported.push(ThProgressionFormat.overallProgression);\n }\n \n if (currentIndex !== undefined && totalItems !== undefined) {\n supported.push(ThProgressionFormat.readingOrderIndex);\n }\n\n return supported;\n};\n\nexport const canRenderProgressionFormat = (\n format: ThProgressionFormat,\n supportedFormats: ThProgressionFormat[]\n): boolean => {\n return supportedFormats.includes(format);\n};\n\nexport const getBestMatchingProgressionFormat = (\n preferredFormats: ThProgressionFormat[],\n timeline?: TimelineProgression\n): ThProgressionFormat | null => {\n if (!timeline) {\n return null;\n }\n\n const supportedFormats = getSupportedProgressionFormats(timeline);\n \n // Find the first preferred format that's supported\n const firstSupported = preferredFormats.find(format => \n canRenderProgressionFormat(format, supportedFormats)\n );\n \n return firstSupported || null;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/core/Helpers/breakpointsMap.ts","../src/core/Helpers/focusUtilities.ts","../src/core/Helpers/progressionFormat.ts"],"names":[],"mappings":";;;AAKO,IAAM,qBAAqB,CAAI;AAAA,EACpC,YAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,KAMmC;AAEjC,EAAA,MAAM,WAAA,GAAc,CAAC,KAAA,KAAwB;AAC3C,IAAA,IAAI,CAAC,aAAa,OAAO,IAAA;AAGzB,IAAA,MAAM,cAAA,GAAiB,CAAC,GAAA,EAAU,IAAA,KAChC,KAAK,KAAA,CAAM,GAAG,CAAA,CAAE,MAAA,CAAO,CAAC,CAAA,EAAG,CAAA,KAAM,CAAA,GAAI,CAAC,GAAG,GAAG,CAAA;AAE9C,IAAA,MAAM,YAAA,GAAe,cAAA,CAAe,KAAA,EAAO,WAAW,CAAA;AACtD,IAAA,IAAI,YAAA,KAAiB,QAAW,OAAO,KAAA;AAEvC,IAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,YAAY,CAAA,EAAG;AAC/B,MAAA,OAAO,YAAA,CAAa,MAAM,CAAA,CAAA,KAAK,MAAA,CAAO,OAAO,QAAQ,CAAA,CAAE,QAAA,CAAS,CAAC,CAAC,CAAA;AAAA,IACpE;AACA,IAAA,OAAO,MAAA,CAAO,MAAA,CAAO,QAAQ,CAAA,CAAE,SAAS,YAAY,CAA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,MAAA,IAAa,UAAA,KAAe,MAAA,EAAW;AAC1D,IAAA,SAAA,CAAU,IAAA,CAAA,mBAAA,yBAA0C;AAAA,EACtD;AAEA,EAAA,OAAO,SAAA;AACT;AAEO,IAAM,0BAAA,GAA6B,CACxC,MAAA,EACA,gBAAA,KACY;AACZ,EAAA,OAAO,gBAAA,CAAiB,SAAS,MAAM,CAAA;AACzC;AAEO,IAAM,gCAAA,GAAmC,CAC9C,gBAAA,EACA,QAAA,KAC+B;AAC/B,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,MAAM,gBAAA,GAAmB,+BAA+B,QAAQ,CAAA;AAGhE,EAAA,MAAM,iBAAiB,gBAAA,CAAiB,IAAA;AAAA,IAAK,CAAA,MAAA,KAC3C,0BAAA,CAA2B,MAAA,EAAQ,gBAAgB;AAAA,GACrD;AAEA,EAAA,OAAO,cAAA,IAAkB,IAAA;AAC3B","file":"chunk-3R5JARA2.mjs","sourcesContent":["\"use client\";\n\nimport { ThBreakpoints } from \"@/preferences/models\";\nimport { BreakpointsMap } from \"@/core/Hooks/useBreakpoints\";\n\nexport const makeBreakpointsMap = <T>({\n defaultValue,\n fromEnum,\n pref,\n disabledValue,\n validateKey\n}: {\n defaultValue: T;\n fromEnum: any;\n pref?: BreakpointsMap<T> | boolean;\n disabledValue?: T;\n validateKey?: string;\n}): Required<BreakpointsMap<T>> => {\n \n const isValidType = (value: any): boolean => {\n if (!validateKey) return true;\n \n // Helper to get nested property\n const getNestedValue = (obj: any, path: string) => \n path.split(\".\").reduce((o, p) => o?.[p], obj);\n \n const valueToCheck = getNestedValue(value, validateKey);\n if (valueToCheck === undefined) return false;\n \n if (Array.isArray(valueToCheck)) {\n return valueToCheck.every(v => Object.values(fromEnum).includes(v));\n }\n return Object.values(fromEnum).includes(valueToCheck);\n };\n\n const breakpointsMap: Required<BreakpointsMap<T>> = {\n [ThBreakpoints.compact]: defaultValue,\n [ThBreakpoints.medium]: defaultValue,\n [ThBreakpoints.expanded]: defaultValue,\n [ThBreakpoints.large]: defaultValue,\n [ThBreakpoints.xLarge]: defaultValue\n };\n\n if (typeof pref === \"boolean\" || pref instanceof Boolean) {\n if (!pref && disabledValue) {\n Object.values(ThBreakpoints).forEach((key) => {\n breakpointsMap[key] = disabledValue;\n });\n }\n } else if (typeof pref === \"string\" && (!validateKey || isValidType(pref))) {\n Object.values(ThBreakpoints).forEach((key) => {\n breakpointsMap[key] = pref as unknown as T;\n });\n } else if (typeof pref === \"object\") {\n Object.entries(pref).forEach(([key, value]) => {\n if (!value) return;\n \n const isValid = !validateKey || isValidType(value);\n \n if (isValid) {\n // Merge the default value with the breakpoint-specific overrides\n if (typeof value === \"object\" && !Array.isArray(value)) {\n breakpointsMap[key as ThBreakpoints] = {\n ...defaultValue,\n ...value\n };\n } else {\n breakpointsMap[key as ThBreakpoints] = value as T;\n }\n }\n });\n }\n\n return breakpointsMap;\n};","\"use client\";\n\nexport const isActiveElement = (el: Element | undefined | null) => {\n if (el) return document.activeElement === el;\n return false;\n}\n\nexport const isKeyboardTriggered = (el: Element | undefined | null) => {\n if (el) return el.matches(\":focus-visible\");\n return false;\n}\n\nexport const isInteractiveElement = (element: Element | null) => {\n const iElements = [\"A\", \"AREA\", \"BUTTON\", \"DETAILS\", \"INPUT\", \"SELECT\", \"TEXTAREA\"];\n const iRoles = [\"dialog\", \"radiogroup\", \"radio\", \"menu\", \"menuitem\"]\n\n if (element && (element instanceof HTMLElement || element instanceof SVGElement)) {\n if (element.closest(\"[inert]\")) return false;\n if (element.hasAttribute(\"disabled\")) return false;\n if (element.role && iRoles.includes(element.role)) return true;\n\n // Panel Resize Handler cos’ of typo on tabIndex/tabindex\n if (element.hasAttribute(\"tabindex\")) {\n const attr = element.getAttribute(\"tabindex\");\n return attr && parseInt(attr, 10) >= 0;\n }\n\n if (element.tabIndex) return element.tabIndex >= 0;\n if (iElements.includes(element.tagName)) return true;\n }\n\n return false;\n}\n","import { ThProgressionFormat } from \"@/preferences/models\";\nimport { ProgressionDetails } from \"@/core/Hooks/usePublicationProgress\";\n\nexport const getSupportedProgressionFormats = (timeline?: ProgressionDetails): ThProgressionFormat[] => {\n if (!timeline) {\n return [ThProgressionFormat.none];\n }\n\n const {\n currentPositions = [],\n totalPositions,\n relativeProgression,\n totalProgression,\n currentIndex,\n totalItems,\n positionsLeft\n } = timeline;\n\n const supported: ThProgressionFormat[] = [ThProgressionFormat.none];\n\n if (currentPositions.length > 0) {\n supported.push(ThProgressionFormat.positions);\n }\n \n if (currentPositions.length > 0 && totalPositions) {\n supported.push(\n ThProgressionFormat.positionsOfTotal,\n ThProgressionFormat.positionsPercentOfTotal\n );\n }\n \n if (positionsLeft !== undefined) {\n supported.push(ThProgressionFormat.positionsLeft);\n }\n \n if (relativeProgression !== undefined) {\n supported.push(\n ThProgressionFormat.resourceProgression,\n ThProgressionFormat.progressionOfResource\n );\n }\n \n if (totalProgression !== undefined) {\n supported.push(ThProgressionFormat.overallProgression);\n }\n \n if (currentIndex !== undefined && totalItems !== undefined) {\n supported.push(ThProgressionFormat.readingOrderIndex);\n }\n\n return supported;\n};\n\nexport const canRenderProgressionFormat = (\n format: ThProgressionFormat,\n supportedFormats: ThProgressionFormat[]\n): boolean => {\n return supportedFormats.includes(format);\n};\n\nexport const getBestMatchingProgressionFormat = (\n preferredFormats: ThProgressionFormat[],\n timeline?: ProgressionDetails\n): ThProgressionFormat | null => {\n if (!timeline) {\n return null;\n }\n\n const supportedFormats = getSupportedProgressionFormats(timeline);\n \n // Find the first preferred format that's supported\n const firstSupported = preferredFormats.find(format => \n canRenderProgressionFormat(format, supportedFormats)\n );\n \n return firstSupported || null;\n};\n"]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { propsToCSSVars } from './chunk-
|
|
2
|
-
import { useBreakpoints, useForcedColors, useMonochrome, useReducedMotion, useReducedTransparency } from './chunk-
|
|
1
|
+
import { ThNavigationAffordance, propsToCSSVars } from './chunk-QOU3R5ZT.mjs';
|
|
2
|
+
import { useBreakpoints, useForcedColors, useMonochrome, useReducedMotion, useReducedTransparency } from './chunk-EREFYF5J.mjs';
|
|
3
3
|
import { ThGlobalPreferencesContext } from './chunk-AE6P4KJB.mjs';
|
|
4
|
-
import { useAppSelector } from './chunk-
|
|
5
|
-
import { useColorScheme, useContrast } from './chunk-NQ2ZSGCX.mjs';
|
|
4
|
+
import { useAppSelector, useColorScheme, useContrast } from './chunk-MFVZ5AEN.mjs';
|
|
6
5
|
import { isSupportedLocale, supportedLocales } from './chunk-GNROODJB.mjs';
|
|
7
6
|
import { createContext, useMemo, useState, useCallback, useEffect, useContext, useRef } from 'react';
|
|
8
7
|
import { I18nProvider, useLocale } from 'react-aria';
|
|
@@ -92,11 +91,11 @@ var ThActionsKeys = /* @__PURE__ */ ((ThActionsKeys3) => {
|
|
|
92
91
|
ThActionsKeys3["toc"] = "toc";
|
|
93
92
|
return ThActionsKeys3;
|
|
94
93
|
})(ThActionsKeys || {});
|
|
95
|
-
var ThDockingKeys = /* @__PURE__ */ ((
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return
|
|
94
|
+
var ThDockingKeys = /* @__PURE__ */ ((ThDockingKeys4) => {
|
|
95
|
+
ThDockingKeys4["start"] = "dockingStart";
|
|
96
|
+
ThDockingKeys4["end"] = "dockingEnd";
|
|
97
|
+
ThDockingKeys4["transient"] = "dockingTransient";
|
|
98
|
+
return ThDockingKeys4;
|
|
100
99
|
})(ThDockingKeys || {});
|
|
101
100
|
var ThDockingTypes = /* @__PURE__ */ ((ThDockingTypes2) => {
|
|
102
101
|
ThDockingTypes2["none"] = "none";
|
|
@@ -105,15 +104,15 @@ var ThDockingTypes = /* @__PURE__ */ ((ThDockingTypes2) => {
|
|
|
105
104
|
ThDockingTypes2["end"] = "end";
|
|
106
105
|
return ThDockingTypes2;
|
|
107
106
|
})(ThDockingTypes || {});
|
|
108
|
-
var ThSheetTypes = /* @__PURE__ */ ((
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return
|
|
107
|
+
var ThSheetTypes = /* @__PURE__ */ ((ThSheetTypes4) => {
|
|
108
|
+
ThSheetTypes4["popover"] = "popover";
|
|
109
|
+
ThSheetTypes4["compactPopover"] = "compactPopover";
|
|
110
|
+
ThSheetTypes4["modal"] = "modal";
|
|
111
|
+
ThSheetTypes4["fullscreen"] = "fullscreen";
|
|
112
|
+
ThSheetTypes4["dockedStart"] = "docked start";
|
|
113
|
+
ThSheetTypes4["dockedEnd"] = "docked end";
|
|
114
|
+
ThSheetTypes4["bottomSheet"] = "bottomSheet";
|
|
115
|
+
return ThSheetTypes4;
|
|
117
116
|
})(ThSheetTypes || {});
|
|
118
117
|
var ThSheetHeaderVariant = /* @__PURE__ */ ((ThSheetHeaderVariant2) => {
|
|
119
118
|
ThSheetHeaderVariant2["close"] = "close";
|
|
@@ -373,13 +372,13 @@ var defaultSpacingPresets = {
|
|
|
373
372
|
};
|
|
374
373
|
|
|
375
374
|
// src/preferences/models/audio.ts
|
|
376
|
-
var ThAudioActionKeys = /* @__PURE__ */ ((
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
return
|
|
375
|
+
var ThAudioActionKeys = /* @__PURE__ */ ((ThAudioActionKeys3) => {
|
|
376
|
+
ThAudioActionKeys3["toc"] = "audio.toc";
|
|
377
|
+
ThAudioActionKeys3["volume"] = "audio.volume";
|
|
378
|
+
ThAudioActionKeys3["playbackRate"] = "audio.playbackRate";
|
|
379
|
+
ThAudioActionKeys3["sleepTimer"] = "audio.sleepTimer";
|
|
380
|
+
ThAudioActionKeys3["remotePlayback"] = "audio.remotePlayback";
|
|
381
|
+
return ThAudioActionKeys3;
|
|
383
382
|
})(ThAudioActionKeys || {});
|
|
384
383
|
var ThAudioKeys = /* @__PURE__ */ ((ThAudioKeys2) => {
|
|
385
384
|
ThAudioKeys2["theme"] = "theme";
|
|
@@ -1152,15 +1151,15 @@ var devContentProtectionConfig = {
|
|
|
1152
1151
|
monitorDevTools: false,
|
|
1153
1152
|
disableRemotePlayback: false
|
|
1154
1153
|
};
|
|
1155
|
-
var ThThemeKeys = /* @__PURE__ */ ((
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
return
|
|
1154
|
+
var ThThemeKeys = /* @__PURE__ */ ((ThThemeKeys4) => {
|
|
1155
|
+
ThThemeKeys4["light"] = "light";
|
|
1156
|
+
ThThemeKeys4["sepia"] = "sepia";
|
|
1157
|
+
ThThemeKeys4["dark"] = "dark";
|
|
1158
|
+
ThThemeKeys4["paper"] = "paper";
|
|
1159
|
+
ThThemeKeys4["contrast1"] = "contrast1";
|
|
1160
|
+
ThThemeKeys4["contrast2"] = "contrast2";
|
|
1161
|
+
ThThemeKeys4["contrast3"] = "contrast3";
|
|
1162
|
+
return ThThemeKeys4;
|
|
1164
1163
|
})(ThThemeKeys || {});
|
|
1165
1164
|
var lightTheme = {
|
|
1166
1165
|
background: ReadiumCSSColors.backgroundColor,
|
|
@@ -1282,12 +1281,7 @@ var contrast3Theme = {
|
|
|
1282
1281
|
};
|
|
1283
1282
|
|
|
1284
1283
|
// src/preferences/audioPreferences.ts
|
|
1285
|
-
var ThAudioAffordance =
|
|
1286
|
-
ThAudioAffordance2["timeline"] = "timeline";
|
|
1287
|
-
ThAudioAffordance2["readingOrder"] = "readingOrder";
|
|
1288
|
-
ThAudioAffordance2["toc"] = "toc";
|
|
1289
|
-
return ThAudioAffordance2;
|
|
1290
|
-
})(ThAudioAffordance || {});
|
|
1284
|
+
var ThAudioAffordance = ThNavigationAffordance;
|
|
1291
1285
|
var validateRangePresets = (pref, context) => {
|
|
1292
1286
|
if (pref.variant !== "sliderWithPresets" /* sliderWithPresets */ || !pref.presets?.length) return;
|
|
1293
1287
|
const [min, max] = [Math.min(...pref.range), Math.max(...pref.range)];
|
|
@@ -1483,8 +1477,8 @@ var defaultAudioPreferences = createAudioPreferences({
|
|
|
1483
1477
|
},
|
|
1484
1478
|
contentProtection: defaultAudioContentProtectionConfig,
|
|
1485
1479
|
affordances: {
|
|
1486
|
-
previous:
|
|
1487
|
-
next:
|
|
1480
|
+
previous: ThAudioAffordance.toc,
|
|
1481
|
+
next: ThAudioAffordance.toc
|
|
1488
1482
|
},
|
|
1489
1483
|
shortcuts: {
|
|
1490
1484
|
representation: "symbol" /* symbol */,
|
|
@@ -1739,8 +1733,6 @@ var createPreferences = (params) => {
|
|
|
1739
1733
|
|
|
1740
1734
|
// src/preferences/defaultPreferences.ts
|
|
1741
1735
|
var defaultPreferences = createPreferences({
|
|
1742
|
-
// direction: ThLayoutDirection.ltr,
|
|
1743
|
-
// locale: "en",
|
|
1744
1736
|
experiments: {
|
|
1745
1737
|
reflow: ["experimentalHeaderFiltering", "experimentalZoom"],
|
|
1746
1738
|
webPub: ["experimentalHeaderFiltering", "experimentalZoom"]
|
|
@@ -1953,7 +1945,8 @@ var defaultPreferences = createPreferences({
|
|
|
1953
1945
|
hintInImmersive: true,
|
|
1954
1946
|
toggleOnMiddlePointer: ["tap", "click"],
|
|
1955
1947
|
hideOnForwardScroll: true,
|
|
1956
|
-
showOnBackwardScroll: true
|
|
1948
|
+
showOnBackwardScroll: true,
|
|
1949
|
+
affordance: "timeline" /* timeline */
|
|
1957
1950
|
},
|
|
1958
1951
|
paginated: {
|
|
1959
1952
|
reflow: {
|
|
@@ -3987,5 +3980,5 @@ var useSharedPreferences = () => {
|
|
|
3987
3980
|
};
|
|
3988
3981
|
|
|
3989
3982
|
export { TEXT_INPUT_SELECTORS, ThActionsKeys, ThAudioActionKeys, ThAudioAffordance, ThAudioKeys, ThAudioMemoryPreferencesAdapter, ThAudioPreferencesContext, ThAudioPreferencesProvider, ThDockingKeys, ThDockingTypes, ThGlobalMemoryPreferencesAdapter, ThGlobalPreferencesProvider, ThLayoutOptions, ThLineHeightOptions, ThMemoryPreferencesAdapter, ThPreferencesContext, ThPreferencesProvider, ThSettingsContainerKeys, ThSettingsKeys, ThSettingsRangePlaceholder, ThSettingsRangeVariant, ThSettingsTimerVariant, ThSheetHeaderVariant, ThSheetTypes, ThSpacingPresetKeys, ThSpacingSettingsKeys, ThTextAlignOptions, ThTextSettingsKeys, ThThemeKeys, arabicFarsiCollection, buildThemeObject, chineseSimplifiedCollection, chineseTraditionalCollection, contrast1Theme, contrast2Theme, contrast3Theme, createAudioPreferences, createDefinitionFromStaticFonts, createDefinitionsFromBunnyFonts, createDefinitionsFromGoogleFonts, createGlobalPreferences, createPreferences, darkTheme, defaultActionKeysObject, defaultAudioContentProtectionConfig, defaultAudioPlaybackRate, defaultAudioPlaybackRateAction, defaultAudioPreferences, defaultAudioPreferencesContextValue, defaultAudioRemotePlaybackAction, defaultAudioSkipBackwardInterval, defaultAudioSkipForwardInterval, defaultAudioSkipInterval, defaultAudioSleepTimer, defaultAudioSleepTimerAction, defaultAudioSleepTimerPresetList, defaultAudioTocAction, defaultAudioVolume, defaultAudioVolumeAction, defaultContentProtectionConfig, defaultFontCollection, defaultFullscreenAction, defaultJumpToPositionAction, defaultLetterSpacing, defaultLineHeights, defaultParagraphIndent, defaultParagraphSpacing, defaultPreferences, defaultPreferencesContextValue, defaultSettingsAction, defaultSpacingPresets, defaultSpacingPresetsOrder, defaultSpacingSettingsMain, defaultSpacingSettingsSubpanel, defaultTextSettingsMain, defaultTextSettingsSubpanel, defaultTocAction, defaultWordSpacing, defaultZoom, devContentProtectionConfig, hebrewCollection, japaneseCollection, japaneseVerticalCollection, koreanCollection, lightTheme, paperTheme, prefixString, proxyUrl, readiumCSSFontCollection, resolveAudioContentProtectionConfig, resolveContentProtectionConfig, sepiaTheme, tamilCollection, useActionsPreferences, useAudioActionsPreferences, useAudioPreferences, useFilteredPreferenceKeys, usePreferenceKeys, usePreferences, useSharedPreferences, useTheming, validateObjectKeys };
|
|
3990
|
-
//# sourceMappingURL=chunk-
|
|
3991
|
-
//# sourceMappingURL=chunk-
|
|
3983
|
+
//# sourceMappingURL=chunk-6DR4EAK3.mjs.map
|
|
3984
|
+
//# sourceMappingURL=chunk-6DR4EAK3.mjs.map
|