@edrlab/thorium-web 1.4.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ThPreferencesAdapter-L1H6gzmu.d.mts → ThPreferencesAdapter-_5AePKHa.d.mts} +5 -3
- package/dist/{ThSettingsWrapper-DWEA4hYF.d.mts → ThSettingsWrapper-B_9klYXH.d.mts} +1 -1
- package/dist/{actions-BjeRjaJU.d.mts → actions-CuRRM3rp.d.mts} +4 -1
- package/dist/{actionsReducer-B32cq2mB.d.mts → actionsReducer-VFR42qgL.d.mts} +1 -1
- package/dist/{chunk-NUXGQWED.mjs → chunk-2NCN2AG2.mjs} +3 -3
- package/dist/{chunk-NUXGQWED.mjs.map → chunk-2NCN2AG2.mjs.map} +1 -1
- package/dist/{chunk-5LUMM7FW.mjs → chunk-44PEO3DS.mjs} +2 -2
- package/dist/{chunk-5LUMM7FW.mjs.map → chunk-44PEO3DS.mjs.map} +1 -1
- package/dist/chunk-AQSJDL63.mjs +193 -0
- package/dist/chunk-AQSJDL63.mjs.map +1 -0
- package/dist/{chunk-T5ENYSDJ.mjs → chunk-DQDOOTCE.mjs} +3 -3
- package/dist/{chunk-T5ENYSDJ.mjs.map → chunk-DQDOOTCE.mjs.map} +1 -1
- package/dist/{chunk-QUSGPT5M.mjs → chunk-E2JEGVVE.mjs} +12 -11
- package/dist/chunk-E2JEGVVE.mjs.map +1 -0
- package/dist/{chunk-P6ILEQ5P.mjs → chunk-ETLIGONP.mjs} +17 -9
- package/dist/chunk-ETLIGONP.mjs.map +1 -0
- package/dist/chunk-GNROODJB.mjs +9 -0
- package/dist/chunk-GNROODJB.mjs.map +1 -0
- package/dist/{chunk-6MONB2DN.mjs → chunk-KGSFTRCH.mjs} +15 -37
- package/dist/chunk-KGSFTRCH.mjs.map +1 -0
- package/dist/{chunk-PXXWEMNL.mjs → chunk-MSHUPSBI.mjs} +54 -38
- package/dist/chunk-MSHUPSBI.mjs.map +1 -0
- package/dist/{chunk-XRFLDNAY.mjs → chunk-OD75GC5N.mjs} +52 -12
- package/dist/chunk-OD75GC5N.mjs.map +1 -0
- package/dist/{chunk-KVUG6BNI.mjs → chunk-RBEPH5E5.mjs} +19 -13
- package/dist/chunk-RBEPH5E5.mjs.map +1 -0
- package/dist/{chunk-TSLTLQ6O.mjs → chunk-SI4FBFHM.mjs} +20 -16
- package/dist/chunk-SI4FBFHM.mjs.map +1 -0
- package/dist/{chunk-IVXRCKWR.mjs → chunk-WF2UOYO7.mjs} +4 -4
- package/dist/{chunk-IVXRCKWR.mjs.map → chunk-WF2UOYO7.mjs.map} +1 -1
- package/dist/{chunk-WLVE3WNW.mjs → chunk-YEVLT3AV.mjs} +12 -7
- package/dist/chunk-YEVLT3AV.mjs.map +1 -0
- package/dist/components/Audio/index.css +2 -1
- package/dist/components/Audio/index.css.map +1 -1
- package/dist/components/Audio/index.d.mts +14 -13
- package/dist/components/Audio/index.mjs +10 -10
- package/dist/components/Epub/index.css +2 -1
- package/dist/components/Epub/index.css.map +1 -1
- package/dist/components/Epub/index.d.mts +11 -11
- package/dist/components/Epub/index.mjs +11 -11
- package/dist/components/Misc/index.mjs +5 -5
- package/dist/components/Reader/index.css +2 -1
- package/dist/components/Reader/index.css.map +1 -1
- package/dist/components/Reader/index.d.mts +9 -9
- package/dist/components/Reader/index.mjs +24 -22
- package/dist/components/Reader/index.mjs.map +1 -1
- package/dist/components/WebPub/index.css +2 -1
- package/dist/components/WebPub/index.css.map +1 -1
- package/dist/components/WebPub/index.d.mts +11 -11
- package/dist/components/WebPub/index.mjs +11 -11
- package/dist/core/Components/index.d.mts +6 -6
- package/dist/core/Components/index.mjs +2 -2
- package/dist/core/Helpers/index.mjs +1 -1
- package/dist/core/Hooks/index.d.mts +4 -4
- package/dist/i18n/index.mjs +3 -3
- package/dist/lib/index.d.mts +15 -8
- package/dist/lib/index.mjs +2 -2
- package/dist/locales/da/thorium-web.json +37 -2
- package/dist/locales/fi/thorium-web.json +1 -1
- package/dist/locales/fr/thorium-web.json +1 -1
- package/dist/locales/lt/thorium-web.json +26 -1
- package/dist/next-lib/index.mjs +1 -1
- package/dist/next-lib/index.mjs.map +1 -1
- package/dist/preferences/index.d.mts +8 -8
- package/dist/preferences/index.mjs +4 -4
- package/dist/{settingsReducer-DLaT2wUB.d.mts → settingsReducer-VqBhLq50.d.mts} +1 -1
- package/dist/{useContrast-Bo7cDw_X.d.mts → useContrast-Cbso7N1l.d.mts} +1 -1
- package/dist/{usePreferences-D8NU1yhP.d.mts → usePreferences-9ZvbcbLW.d.mts} +3 -3
- package/dist/{useReaderTransitions-BQGzKeY2.d.mts → useReaderTransitions-0hKGCvMm.d.mts} +10 -9
- package/package.json +5 -5
- package/dist/chunk-6MONB2DN.mjs.map +0 -1
- package/dist/chunk-B3WDMWCT.mjs +0 -9
- package/dist/chunk-B3WDMWCT.mjs.map +0 -1
- package/dist/chunk-KVUG6BNI.mjs.map +0 -1
- package/dist/chunk-MLEYTQGK.mjs +0 -60
- package/dist/chunk-MLEYTQGK.mjs.map +0 -1
- package/dist/chunk-P6ILEQ5P.mjs.map +0 -1
- package/dist/chunk-PXXWEMNL.mjs.map +0 -1
- package/dist/chunk-QUSGPT5M.mjs.map +0 -1
- package/dist/chunk-TSLTLQ6O.mjs.map +0 -1
- package/dist/chunk-WLVE3WNW.mjs.map +0 -1
- package/dist/chunk-XRFLDNAY.mjs.map +0 -1
|
@@ -3,7 +3,7 @@ import { useBreakpoints, useForcedColors, useMonochrome, useReducedMotion, useRe
|
|
|
3
3
|
import { ThGlobalPreferencesContext } from './chunk-AE6P4KJB.mjs';
|
|
4
4
|
import { useAppSelector } from './chunk-A575ZW4A.mjs';
|
|
5
5
|
import { useColorScheme, useContrast } from './chunk-NQ2ZSGCX.mjs';
|
|
6
|
-
import { isSupportedLocale, supportedLocales } from './chunk-
|
|
6
|
+
import { isSupportedLocale, supportedLocales } from './chunk-GNROODJB.mjs';
|
|
7
7
|
import { createContext, useMemo, useState, useCallback, useEffect, useContext, useRef } from 'react';
|
|
8
8
|
import { I18nProvider, useLocale } from 'react-aria';
|
|
9
9
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -1974,13 +1974,7 @@ var defaultPreferences = createPreferences({
|
|
|
1974
1974
|
"toc" /* toc */,
|
|
1975
1975
|
"fullscreen" /* fullscreen */
|
|
1976
1976
|
],
|
|
1977
|
-
collapse:
|
|
1978
|
-
// Number of partially icons to display
|
|
1979
|
-
// value "all" a keyword for the length of displayOrder above
|
|
1980
|
-
// Icons with visibility always are excluded from collapsing
|
|
1981
|
-
["compact" /* compact */]: 2,
|
|
1982
|
-
["medium" /* medium */]: 3
|
|
1983
|
-
},
|
|
1977
|
+
collapse: true,
|
|
1984
1978
|
keys: {
|
|
1985
1979
|
["settings" /* settings */]: defaultSettingsAction,
|
|
1986
1980
|
["fullscreen" /* fullscreen */]: defaultFullscreenAction,
|
|
@@ -3759,6 +3753,49 @@ var proxyUrl = (url) => {
|
|
|
3759
3753
|
}
|
|
3760
3754
|
return url;
|
|
3761
3755
|
};
|
|
3756
|
+
var initRanges = (prefs) => {
|
|
3757
|
+
const ranges = {};
|
|
3758
|
+
let prev = null;
|
|
3759
|
+
Object.entries(prefs).forEach(([key, value]) => {
|
|
3760
|
+
if (value && !isNaN(value)) {
|
|
3761
|
+
const max = value;
|
|
3762
|
+
const min = prev ? prev + 1 : null;
|
|
3763
|
+
ranges[key] = { min, max };
|
|
3764
|
+
prev = value;
|
|
3765
|
+
} else if (!value && key === "xLarge" /* xLarge */ && prev) {
|
|
3766
|
+
ranges[key] = { min: prev + 1, max: null };
|
|
3767
|
+
}
|
|
3768
|
+
});
|
|
3769
|
+
return ranges;
|
|
3770
|
+
};
|
|
3771
|
+
var resolveBreakpoint = (width, ranges) => {
|
|
3772
|
+
for (const [key, range] of Object.entries(ranges)) {
|
|
3773
|
+
const { min, max } = range;
|
|
3774
|
+
if (min !== null && width < min) continue;
|
|
3775
|
+
if (max !== null && width > max) continue;
|
|
3776
|
+
return key;
|
|
3777
|
+
}
|
|
3778
|
+
return null;
|
|
3779
|
+
};
|
|
3780
|
+
var useContainerBreakpoints = (map, onChange) => {
|
|
3781
|
+
const [containerEl, setContainerEl] = useState(null);
|
|
3782
|
+
useEffect(() => {
|
|
3783
|
+
if (!containerEl) return;
|
|
3784
|
+
const ranges = initRanges(map);
|
|
3785
|
+
const observer = new ResizeObserver((entries) => {
|
|
3786
|
+
const entry = entries[0];
|
|
3787
|
+
if (!entry) return;
|
|
3788
|
+
const width = entry.contentRect.width;
|
|
3789
|
+
const breakpoint = resolveBreakpoint(width, ranges);
|
|
3790
|
+
onChange?.(breakpoint);
|
|
3791
|
+
});
|
|
3792
|
+
observer.observe(containerEl);
|
|
3793
|
+
return () => observer.disconnect();
|
|
3794
|
+
}, [containerEl, map, onChange]);
|
|
3795
|
+
return useCallback((el) => {
|
|
3796
|
+
setContainerEl(el);
|
|
3797
|
+
}, []);
|
|
3798
|
+
};
|
|
3762
3799
|
|
|
3763
3800
|
// src/preferences/hooks/useTheming.ts
|
|
3764
3801
|
var useTheming = ({
|
|
@@ -3776,11 +3813,13 @@ var useTheming = ({
|
|
|
3776
3813
|
onMonochromeChange,
|
|
3777
3814
|
onReducedMotionChange,
|
|
3778
3815
|
onReducedTransparencyChange,
|
|
3779
|
-
onCoverThemeGenerated
|
|
3816
|
+
onCoverThemeGenerated,
|
|
3817
|
+
onContainerBreakpointChange
|
|
3780
3818
|
}) => {
|
|
3781
3819
|
const [coverThemeTokens, setCoverThemeTokens] = useState(null);
|
|
3782
3820
|
const [coverThemeFailed, setCoverThemeFailed] = useState(false);
|
|
3783
3821
|
const breakpoints = useBreakpoints(breakpointsMap, onBreakpointChange);
|
|
3822
|
+
const setContainerRef = useContainerBreakpoints(breakpointsMap, onContainerBreakpointChange);
|
|
3784
3823
|
const colorScheme = useColorScheme(onColorSchemeChange);
|
|
3785
3824
|
const colorSchemeRef = useRef(colorScheme);
|
|
3786
3825
|
const contrast = useContrast(onContrastChange);
|
|
@@ -3878,7 +3917,8 @@ var useTheming = ({
|
|
|
3878
3917
|
reducedMotion,
|
|
3879
3918
|
reducedTransparency,
|
|
3880
3919
|
coverThemeTokens,
|
|
3881
|
-
themeResolved
|
|
3920
|
+
themeResolved,
|
|
3921
|
+
setContainerRef
|
|
3882
3922
|
};
|
|
3883
3923
|
};
|
|
3884
3924
|
var useSharedPreferences = () => {
|
|
@@ -3909,5 +3949,5 @@ var useSharedPreferences = () => {
|
|
|
3909
3949
|
};
|
|
3910
3950
|
|
|
3911
3951
|
export { 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 };
|
|
3912
|
-
//# sourceMappingURL=chunk-
|
|
3913
|
-
//# sourceMappingURL=chunk-
|
|
3952
|
+
//# sourceMappingURL=chunk-OD75GC5N.mjs.map
|
|
3953
|
+
//# sourceMappingURL=chunk-OD75GC5N.mjs.map
|