@edrlab/thorium-web 1.3.0 → 1.4.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.
- package/dist/{ThPreferencesAdapter-D0rzsGRl.d.mts → ThPreferencesAdapter-L1H6gzmu.d.mts} +23 -6
- package/dist/{ThSettingsWrapper-BXuRgdqp.d.mts → ThSettingsWrapper-DWEA4hYF.d.mts} +1 -1
- package/dist/{actions-BLAr0oaM.d.mts → actions-BjeRjaJU.d.mts} +1 -1
- package/dist/{actionsReducer-BhG1wicI.d.mts → actionsReducer-B32cq2mB.d.mts} +11 -4
- package/dist/{chunk-L4XGZAZ5.mjs → chunk-2YRT7RNW.mjs} +20 -3
- package/dist/chunk-2YRT7RNW.mjs.map +1 -0
- package/dist/{chunk-UCTMVCW7.mjs → chunk-6MONB2DN.mjs} +91 -63
- package/dist/chunk-6MONB2DN.mjs.map +1 -0
- package/dist/chunk-A575ZW4A.mjs +10 -0
- package/dist/chunk-A575ZW4A.mjs.map +1 -0
- package/dist/chunk-AE6P4KJB.mjs +13 -0
- package/dist/chunk-AE6P4KJB.mjs.map +1 -0
- package/dist/{chunk-OWHP7ONM.mjs → chunk-IVXRCKWR.mjs} +4 -4
- package/dist/{chunk-OWHP7ONM.mjs.map → chunk-IVXRCKWR.mjs.map} +1 -1
- package/dist/{chunk-RRVLWDT3.mjs → chunk-KVUG6BNI.mjs} +92 -27
- package/dist/chunk-KVUG6BNI.mjs.map +1 -0
- package/dist/{chunk-IYAFKTPL.mjs → chunk-NUXGQWED.mjs} +7 -5
- package/dist/chunk-NUXGQWED.mjs.map +1 -0
- package/dist/{chunk-4ODYHZKD.mjs → chunk-P6ILEQ5P.mjs} +49 -51
- package/dist/chunk-P6ILEQ5P.mjs.map +1 -0
- package/dist/{chunk-D7MFLHXV.mjs → chunk-PXXWEMNL.mjs} +951 -592
- package/dist/chunk-PXXWEMNL.mjs.map +1 -0
- package/dist/{chunk-T2E6MRVP.mjs → chunk-QUSGPT5M.mjs} +11 -12
- package/dist/chunk-QUSGPT5M.mjs.map +1 -0
- package/dist/{chunk-XBZWGRDM.mjs → chunk-SZAVAQ6S.mjs} +30 -6
- package/dist/chunk-SZAVAQ6S.mjs.map +1 -0
- package/dist/{chunk-3LDWKC5N.mjs → chunk-T5ENYSDJ.mjs} +5 -5
- package/dist/chunk-T5ENYSDJ.mjs.map +1 -0
- package/dist/{chunk-4TVEDX7L.mjs → chunk-TSLTLQ6O.mjs} +127 -41
- package/dist/chunk-TSLTLQ6O.mjs.map +1 -0
- package/dist/{chunk-ITDBOMY5.mjs → chunk-VENFFPK2.mjs} +3 -3
- package/dist/{chunk-ITDBOMY5.mjs.map → chunk-VENFFPK2.mjs.map} +1 -1
- package/dist/{chunk-YZ3KCMKY.mjs → chunk-WLVE3WNW.mjs} +238 -58
- package/dist/chunk-WLVE3WNW.mjs.map +1 -0
- package/dist/chunk-XRFLDNAY.mjs +3913 -0
- package/dist/chunk-XRFLDNAY.mjs.map +1 -0
- package/dist/components/Audio/index.d.mts +12 -12
- package/dist/components/Audio/index.mjs +14 -14
- package/dist/components/Epub/index.css +3 -3
- package/dist/components/Epub/index.css.map +1 -1
- package/dist/components/Epub/index.d.mts +12 -12
- package/dist/components/Epub/index.mjs +15 -15
- package/dist/components/Misc/index.css +2 -2
- package/dist/components/Misc/index.css.map +1 -1
- package/dist/components/Misc/index.mjs +4 -4
- package/dist/components/Reader/index.css +5 -5
- package/dist/components/Reader/index.css.map +1 -1
- package/dist/components/Reader/index.d.mts +11 -11
- package/dist/components/Reader/index.mjs +26 -24
- package/dist/components/Reader/index.mjs.map +1 -1
- package/dist/components/WebPub/index.css +3 -3
- package/dist/components/WebPub/index.css.map +1 -1
- package/dist/components/WebPub/index.d.mts +12 -12
- package/dist/components/WebPub/index.mjs +15 -15
- package/dist/core/Components/index.d.mts +11 -21
- package/dist/core/Components/index.mjs +1 -1
- package/dist/core/Helpers/index.d.mts +1 -1
- package/dist/core/Helpers/index.mjs +2 -3
- package/dist/core/Hooks/index.d.mts +12 -8
- package/dist/core/Hooks/index.mjs +1 -1
- package/dist/i18n/index.mjs +3 -6
- package/dist/lib/index.d.mts +49 -20
- package/dist/lib/index.mjs +3 -2
- package/dist/locales/da/thorium-shared.json +3 -0
- package/dist/locales/en/thorium-shared.json +24 -2
- package/dist/locales/en/thorium-web.json +2 -2
- package/dist/locales/es/thorium-shared.json +364 -0
- package/dist/locales/es/thorium-web.json +130 -0
- package/dist/locales/et/thorium-shared.json +121 -9
- package/dist/locales/et/thorium-web.json +32 -1
- package/dist/locales/fi/thorium-shared.json +42 -4
- package/dist/locales/fi/thorium-web.json +36 -2
- package/dist/locales/fr/thorium-shared.json +108 -1
- package/dist/locales/fr/thorium-web.json +121 -86
- package/dist/locales/it/thorium-shared.json +108 -1
- package/dist/locales/it/thorium-web.json +15 -2
- package/dist/locales/lt/thorium-web.json +10 -1
- package/dist/locales/pl/thorium-web.json +1 -1
- package/dist/locales/pt-BR/thorium-shared.json +6 -0
- package/dist/locales/pt-BR/thorium-web.json +88 -88
- package/dist/locales/pt-PT/thorium-shared.json +91 -0
- package/dist/locales/pt-PT/thorium-web.json +15 -3
- package/dist/locales/sv/thorium-shared.json +108 -2
- package/dist/locales/sv/thorium-web.json +15 -3
- package/dist/locales/tr/thorium-shared.json +42 -0
- package/dist/preferences/index.d.mts +59 -13
- package/dist/preferences/index.mjs +6 -6
- package/dist/{settingsReducer-Bu1zeveu.d.mts → settingsReducer-DLaT2wUB.d.mts} +14 -2
- package/dist/{ui-nBv8gfr0.d.mts → ui-DnZZhozX.d.mts} +1 -1
- package/dist/{useAudioNavigator-C5aW4-eT.d.mts → useAudioNavigator-CWXyNWq1.d.mts} +3 -1
- package/dist/{useContrast-2t429O9O.d.mts → useContrast-Bo7cDw_X.d.mts} +5 -1
- package/dist/{usePreferences-VaBf46eP.d.mts → usePreferences-D8NU1yhP.d.mts} +6 -8
- package/dist/{useReaderTransitions-JDzlBFsu.d.mts → useReaderTransitions-BQGzKeY2.d.mts} +61 -10
- package/package.json +12 -11
- package/dist/chunk-3LDWKC5N.mjs.map +0 -1
- package/dist/chunk-4ODYHZKD.mjs.map +0 -1
- package/dist/chunk-4TVEDX7L.mjs.map +0 -1
- package/dist/chunk-7CGMWOZN.mjs +0 -20
- package/dist/chunk-7CGMWOZN.mjs.map +0 -1
- package/dist/chunk-C236BQQB.mjs +0 -1725
- package/dist/chunk-C236BQQB.mjs.map +0 -1
- package/dist/chunk-D7MFLHXV.mjs.map +0 -1
- package/dist/chunk-IYAFKTPL.mjs.map +0 -1
- package/dist/chunk-L4XGZAZ5.mjs.map +0 -1
- package/dist/chunk-RRVLWDT3.mjs.map +0 -1
- package/dist/chunk-T2E6MRVP.mjs.map +0 -1
- package/dist/chunk-UCTMVCW7.mjs.map +0 -1
- package/dist/chunk-WECWPYZB.mjs +0 -1950
- package/dist/chunk-WECWPYZB.mjs.map +0 -1
- package/dist/chunk-XBZWGRDM.mjs.map +0 -1
- package/dist/chunk-YZ3KCMKY.mjs.map +0 -1
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { usePrevious } from './chunk-YZ73DHRU.mjs';
|
|
2
2
|
import { useCollapsibility } from './chunk-MLEYTQGK.mjs';
|
|
3
|
-
import React23, { createContext, useContext, useState, useEffect,
|
|
3
|
+
import React23, { createContext, useContext, useCallback, useMemo, useState, useEffect, useRef, Fragment as Fragment$1, createElement } from 'react';
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
|
-
import { useObjectRef,
|
|
5
|
+
import { useObjectRef, useOverlayPosition, OverlayContainer, FocusScope, OverlayProvider, useDialog, useOverlay, useModal } from 'react-aria';
|
|
6
6
|
import { Toolbar, TooltipTrigger, Button, Tooltip, MenuTrigger, Popover, Menu, Slider, SliderTrack, SliderThumb, Dialog, Modal, Heading, Form, NumberField, Label, FieldError, Input, Text, TextField, SearchField, Link, MenuItem, Keyboard, Group, RadioGroup, Radio, SliderOutput, Switch, SelectValue, Select, ListBox, ListBoxItem } from 'react-aria-components';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { useOverlayTriggerState } from 'react-stately';
|
|
9
9
|
import { Sheet } from 'react-modal-sheet';
|
|
10
10
|
import { useTransform } from 'motion/react';
|
|
11
11
|
|
|
12
|
-
// src/core/Components/Actions/hooks/useActions.ts
|
|
13
12
|
var useActions = (actionMap) => {
|
|
14
|
-
const findOpen = () => {
|
|
13
|
+
const findOpen = useCallback(() => {
|
|
15
14
|
const open = [];
|
|
16
15
|
Object.entries(actionMap).forEach(([key, value]) => {
|
|
17
16
|
if (value?.isOpen) open.push(key);
|
|
18
17
|
});
|
|
19
18
|
return open;
|
|
20
|
-
};
|
|
21
|
-
const anyOpen = () => {
|
|
19
|
+
}, [actionMap]);
|
|
20
|
+
const anyOpen = useCallback(() => {
|
|
22
21
|
return Object.values(actionMap).some((value) => value?.isOpen);
|
|
23
|
-
};
|
|
24
|
-
const isOpen = (key) => {
|
|
22
|
+
}, [actionMap]);
|
|
23
|
+
const isOpen = useCallback((key) => {
|
|
25
24
|
if (key) {
|
|
26
25
|
if (actionMap[key]?.isOpen == null) {
|
|
27
26
|
return false;
|
|
@@ -30,8 +29,8 @@ var useActions = (actionMap) => {
|
|
|
30
29
|
}
|
|
31
30
|
}
|
|
32
31
|
return false;
|
|
33
|
-
};
|
|
34
|
-
const findDocked = () => {
|
|
32
|
+
}, [actionMap]);
|
|
33
|
+
const findDocked = useCallback(() => {
|
|
35
34
|
const docked = [];
|
|
36
35
|
Object.entries(actionMap).forEach(([key, value]) => {
|
|
37
36
|
const docking = value?.docking;
|
|
@@ -40,31 +39,31 @@ var useActions = (actionMap) => {
|
|
|
40
39
|
}
|
|
41
40
|
});
|
|
42
41
|
return docked;
|
|
43
|
-
};
|
|
44
|
-
const anyDocked = () => {
|
|
42
|
+
}, [actionMap]);
|
|
43
|
+
const anyDocked = useCallback(() => {
|
|
45
44
|
return Object.values(actionMap).some((value) => {
|
|
46
45
|
const docking = value?.docking;
|
|
47
46
|
return docking === "dockingStart" /* start */ || docking === "dockingEnd" /* end */;
|
|
48
47
|
});
|
|
49
|
-
};
|
|
50
|
-
const isDocked = (key) => {
|
|
48
|
+
}, [actionMap]);
|
|
49
|
+
const isDocked = useCallback((key) => {
|
|
51
50
|
if (!key) return false;
|
|
52
51
|
const docking = actionMap[key]?.docking;
|
|
53
52
|
return docking === "dockingStart" /* start */ || docking === "dockingEnd" /* end */;
|
|
54
|
-
};
|
|
55
|
-
const whichDocked = (key) => {
|
|
53
|
+
}, [actionMap]);
|
|
54
|
+
const whichDocked = useCallback((key) => {
|
|
56
55
|
return key ? actionMap[key]?.docking : null;
|
|
57
|
-
};
|
|
58
|
-
const getDockedWidth = (key) => {
|
|
59
|
-
return key
|
|
60
|
-
};
|
|
61
|
-
const everyOpenDocked = () => {
|
|
56
|
+
}, [actionMap]);
|
|
57
|
+
const getDockedWidth = useCallback((key) => {
|
|
58
|
+
return key ? actionMap[key]?.dockedWidth : void 0;
|
|
59
|
+
}, [actionMap]);
|
|
60
|
+
const everyOpenDocked = useCallback(() => {
|
|
62
61
|
const opens = findOpen();
|
|
63
62
|
return opens.every((key) => {
|
|
64
63
|
return isDocked(key);
|
|
65
64
|
});
|
|
66
|
-
};
|
|
67
|
-
return {
|
|
65
|
+
}, [findOpen, isDocked]);
|
|
66
|
+
return useMemo(() => ({
|
|
68
67
|
findOpen,
|
|
69
68
|
anyOpen,
|
|
70
69
|
isOpen,
|
|
@@ -74,7 +73,7 @@ var useActions = (actionMap) => {
|
|
|
74
73
|
whichDocked,
|
|
75
74
|
getDockedWidth,
|
|
76
75
|
everyOpenDocked
|
|
77
|
-
};
|
|
76
|
+
}), [findOpen, anyOpen, isOpen, findDocked, anyDocked, isDocked, whichDocked, getDockedWidth, everyOpenDocked]);
|
|
78
77
|
};
|
|
79
78
|
|
|
80
79
|
// src/components/Plugins/PluginRegistry.ts
|
|
@@ -387,7 +386,6 @@ var ThAudioProgress = ({
|
|
|
387
386
|
segments,
|
|
388
387
|
compounds
|
|
389
388
|
}) => {
|
|
390
|
-
const { direction } = useLocale();
|
|
391
389
|
const anchorRef = useRef(null);
|
|
392
390
|
const overlayRef = useObjectRef(compounds?.tooltip?.ref);
|
|
393
391
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -425,12 +423,10 @@ var ThAudioProgress = ({
|
|
|
425
423
|
const handleTrackMouseMove = (e) => {
|
|
426
424
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
427
425
|
const raw = (e.clientX - rect.left) / rect.width;
|
|
428
|
-
const x = Math.max(0, Math.min(1,
|
|
426
|
+
const x = Math.max(0, Math.min(1, raw));
|
|
429
427
|
if (anchorRef.current) {
|
|
430
|
-
|
|
431
|
-
anchorRef.current.style.left = "";
|
|
428
|
+
anchorRef.current.style.left = `${x * 100}%`;
|
|
432
429
|
anchorRef.current.style.right = "";
|
|
433
|
-
anchorRef.current.style[side] = `${x * 100}%`;
|
|
434
430
|
updatePosition();
|
|
435
431
|
}
|
|
436
432
|
if (!isOpen) setIsOpen(true);
|
|
@@ -479,7 +475,7 @@ var ThAudioProgress = ({
|
|
|
479
475
|
{
|
|
480
476
|
...compounds?.seekableRange,
|
|
481
477
|
style: {
|
|
482
|
-
|
|
478
|
+
left: `${range.start / duration * 100}%`,
|
|
483
479
|
width: `${(range.end - range.start) / duration * 100}%`,
|
|
484
480
|
...compounds?.seekableRange?.style
|
|
485
481
|
}
|
|
@@ -492,7 +488,7 @@ var ThAudioProgress = ({
|
|
|
492
488
|
...compounds?.fragmentTick,
|
|
493
489
|
style: {
|
|
494
490
|
position: "absolute",
|
|
495
|
-
|
|
491
|
+
left: `${segment.percentage}%`,
|
|
496
492
|
...compounds?.fragmentTick?.style
|
|
497
493
|
}
|
|
498
494
|
},
|
|
@@ -502,7 +498,7 @@ var ThAudioProgress = ({
|
|
|
502
498
|
"span",
|
|
503
499
|
{
|
|
504
500
|
ref: anchorRef,
|
|
505
|
-
style: { position: "absolute",
|
|
501
|
+
style: { position: "absolute", left: "0%", width: 0, height: "100%", top: 0 },
|
|
506
502
|
"aria-hidden": "true"
|
|
507
503
|
}
|
|
508
504
|
),
|
|
@@ -1347,11 +1343,12 @@ var ThLoader = ({
|
|
|
1347
1343
|
{
|
|
1348
1344
|
ref,
|
|
1349
1345
|
...props,
|
|
1346
|
+
style: { position: "relative", ...props.style },
|
|
1350
1347
|
"aria-busy": isLoading,
|
|
1351
1348
|
"aria-live": "polite",
|
|
1352
1349
|
children: [
|
|
1353
|
-
|
|
1354
|
-
children
|
|
1350
|
+
children,
|
|
1351
|
+
isLoading && /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, zIndex: 1e4 }, children: loader })
|
|
1355
1352
|
]
|
|
1356
1353
|
}
|
|
1357
1354
|
) });
|
|
@@ -1400,44 +1397,45 @@ var ThInteractiveOverlay = ({
|
|
|
1400
1397
|
};
|
|
1401
1398
|
var ThPagination = ({
|
|
1402
1399
|
ref,
|
|
1403
|
-
direction = "left",
|
|
1404
1400
|
links,
|
|
1405
1401
|
compounds,
|
|
1406
1402
|
children,
|
|
1407
|
-
|
|
1403
|
+
dir,
|
|
1404
|
+
...restProps
|
|
1408
1405
|
}) => {
|
|
1409
1406
|
if (!links) {
|
|
1410
1407
|
return null;
|
|
1411
1408
|
}
|
|
1412
|
-
const {
|
|
1409
|
+
const { left, right } = links;
|
|
1413
1410
|
return /* @__PURE__ */ jsxs(
|
|
1414
1411
|
"nav",
|
|
1415
1412
|
{
|
|
1416
1413
|
ref,
|
|
1417
|
-
|
|
1414
|
+
dir: "ltr",
|
|
1415
|
+
...restProps,
|
|
1418
1416
|
children: [
|
|
1419
|
-
|
|
1417
|
+
left && /* @__PURE__ */ jsx("li", { ...compounds?.listItem, children: /* @__PURE__ */ jsxs(
|
|
1420
1418
|
Button,
|
|
1421
1419
|
{
|
|
1422
|
-
...compounds?.
|
|
1420
|
+
...compounds?.leftButton,
|
|
1423
1421
|
type: "button",
|
|
1424
|
-
onPress:
|
|
1422
|
+
onPress: left.onPress,
|
|
1425
1423
|
children: [
|
|
1426
|
-
|
|
1427
|
-
|
|
1424
|
+
left.icon ? /* @__PURE__ */ jsx(left.icon, { "aria-hidden": "true", focusable: "false" }) : /* @__PURE__ */ jsx(arrow_back_default, { "aria-hidden": "true", focusable: "false" }),
|
|
1425
|
+
left.node
|
|
1428
1426
|
]
|
|
1429
1427
|
}
|
|
1430
1428
|
) }),
|
|
1431
|
-
children && /* @__PURE__ */ jsx("li", { ...compounds?.listItem, children }),
|
|
1432
|
-
|
|
1429
|
+
children && /* @__PURE__ */ jsx("li", { ...compounds?.listItem, dir, children }),
|
|
1430
|
+
right && /* @__PURE__ */ jsx("li", { ...compounds?.listItem, children: /* @__PURE__ */ jsxs(
|
|
1433
1431
|
Button,
|
|
1434
1432
|
{
|
|
1435
|
-
...compounds?.
|
|
1433
|
+
...compounds?.rightButton,
|
|
1436
1434
|
type: "button",
|
|
1437
|
-
onPress:
|
|
1435
|
+
onPress: right.onPress,
|
|
1438
1436
|
children: [
|
|
1439
|
-
|
|
1440
|
-
|
|
1437
|
+
right.node,
|
|
1438
|
+
right.icon ? /* @__PURE__ */ jsx(right.icon, { "aria-hidden": "true", focusable: "false" }) : /* @__PURE__ */ jsx(arrow_forward_default, { "aria-hidden": "true", focusable: "false" })
|
|
1441
1439
|
]
|
|
1442
1440
|
}
|
|
1443
1441
|
) })
|
|
@@ -1878,5 +1876,5 @@ var ThGrid = ({
|
|
|
1878
1876
|
};
|
|
1879
1877
|
|
|
1880
1878
|
export { ThActionButton, ThActionsBar, ThActionsTriggerVariant, ThAudioProgress, ThBackArrow, ThBottomSheet, ThCloseButton, ThCollapsibleActionsBar, ThContainerBody, ThContainerHeader, ThContainerHeaderWithClose, ThContainerHeaderWithPrevious, ThDeleteButton, ThDockedPanel, ThDragIndicatorButton, ThDropdown, ThDropdownButton, ThFooter, ThForm, ThFormNumberField, ThFormSearchField, ThFormTextField, ThGrid, ThHeader, ThHome, ThInteractiveOverlay, ThLibrary, ThLink, ThLoader, ThMenu, ThMenuButton, ThMenuItem, ThModal, ThNavigationButton, ThNumberField, ThPagination, ThPluginProvider, ThPluginRegistry, ThPopover, ThRadioGroup, ThRunningHead, ThSettingsResetButton, ThSettingsWrapper, ThSettingsWrapperButton, ThSlider, ThSliderWithPresets, ThSwitch, ThTypedComponentRenderer, useActionComponentStatus, useActions, useFirstFocusable, usePlugins };
|
|
1881
|
-
//# sourceMappingURL=chunk-
|
|
1882
|
-
//# sourceMappingURL=chunk-
|
|
1879
|
+
//# sourceMappingURL=chunk-P6ILEQ5P.mjs.map
|
|
1880
|
+
//# sourceMappingURL=chunk-P6ILEQ5P.mjs.map
|