@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.
Files changed (111) hide show
  1. package/dist/{ThPreferencesAdapter-D0rzsGRl.d.mts → ThPreferencesAdapter-L1H6gzmu.d.mts} +23 -6
  2. package/dist/{ThSettingsWrapper-BXuRgdqp.d.mts → ThSettingsWrapper-DWEA4hYF.d.mts} +1 -1
  3. package/dist/{actions-BLAr0oaM.d.mts → actions-BjeRjaJU.d.mts} +1 -1
  4. package/dist/{actionsReducer-BhG1wicI.d.mts → actionsReducer-B32cq2mB.d.mts} +11 -4
  5. package/dist/{chunk-L4XGZAZ5.mjs → chunk-2YRT7RNW.mjs} +20 -3
  6. package/dist/chunk-2YRT7RNW.mjs.map +1 -0
  7. package/dist/{chunk-UCTMVCW7.mjs → chunk-6MONB2DN.mjs} +91 -63
  8. package/dist/chunk-6MONB2DN.mjs.map +1 -0
  9. package/dist/chunk-A575ZW4A.mjs +10 -0
  10. package/dist/chunk-A575ZW4A.mjs.map +1 -0
  11. package/dist/chunk-AE6P4KJB.mjs +13 -0
  12. package/dist/chunk-AE6P4KJB.mjs.map +1 -0
  13. package/dist/{chunk-OWHP7ONM.mjs → chunk-IVXRCKWR.mjs} +4 -4
  14. package/dist/{chunk-OWHP7ONM.mjs.map → chunk-IVXRCKWR.mjs.map} +1 -1
  15. package/dist/{chunk-RRVLWDT3.mjs → chunk-KVUG6BNI.mjs} +92 -27
  16. package/dist/chunk-KVUG6BNI.mjs.map +1 -0
  17. package/dist/{chunk-IYAFKTPL.mjs → chunk-NUXGQWED.mjs} +7 -5
  18. package/dist/chunk-NUXGQWED.mjs.map +1 -0
  19. package/dist/{chunk-4ODYHZKD.mjs → chunk-P6ILEQ5P.mjs} +49 -51
  20. package/dist/chunk-P6ILEQ5P.mjs.map +1 -0
  21. package/dist/{chunk-D7MFLHXV.mjs → chunk-PXXWEMNL.mjs} +951 -592
  22. package/dist/chunk-PXXWEMNL.mjs.map +1 -0
  23. package/dist/{chunk-T2E6MRVP.mjs → chunk-QUSGPT5M.mjs} +11 -12
  24. package/dist/chunk-QUSGPT5M.mjs.map +1 -0
  25. package/dist/{chunk-XBZWGRDM.mjs → chunk-SZAVAQ6S.mjs} +30 -6
  26. package/dist/chunk-SZAVAQ6S.mjs.map +1 -0
  27. package/dist/{chunk-3LDWKC5N.mjs → chunk-T5ENYSDJ.mjs} +5 -5
  28. package/dist/chunk-T5ENYSDJ.mjs.map +1 -0
  29. package/dist/{chunk-4TVEDX7L.mjs → chunk-TSLTLQ6O.mjs} +127 -41
  30. package/dist/chunk-TSLTLQ6O.mjs.map +1 -0
  31. package/dist/{chunk-ITDBOMY5.mjs → chunk-VENFFPK2.mjs} +3 -3
  32. package/dist/{chunk-ITDBOMY5.mjs.map → chunk-VENFFPK2.mjs.map} +1 -1
  33. package/dist/{chunk-YZ3KCMKY.mjs → chunk-WLVE3WNW.mjs} +238 -58
  34. package/dist/chunk-WLVE3WNW.mjs.map +1 -0
  35. package/dist/chunk-XRFLDNAY.mjs +3913 -0
  36. package/dist/chunk-XRFLDNAY.mjs.map +1 -0
  37. package/dist/components/Audio/index.d.mts +12 -12
  38. package/dist/components/Audio/index.mjs +14 -14
  39. package/dist/components/Epub/index.css +3 -3
  40. package/dist/components/Epub/index.css.map +1 -1
  41. package/dist/components/Epub/index.d.mts +12 -12
  42. package/dist/components/Epub/index.mjs +15 -15
  43. package/dist/components/Misc/index.css +2 -2
  44. package/dist/components/Misc/index.css.map +1 -1
  45. package/dist/components/Misc/index.mjs +4 -4
  46. package/dist/components/Reader/index.css +5 -5
  47. package/dist/components/Reader/index.css.map +1 -1
  48. package/dist/components/Reader/index.d.mts +11 -11
  49. package/dist/components/Reader/index.mjs +26 -24
  50. package/dist/components/Reader/index.mjs.map +1 -1
  51. package/dist/components/WebPub/index.css +3 -3
  52. package/dist/components/WebPub/index.css.map +1 -1
  53. package/dist/components/WebPub/index.d.mts +12 -12
  54. package/dist/components/WebPub/index.mjs +15 -15
  55. package/dist/core/Components/index.d.mts +11 -21
  56. package/dist/core/Components/index.mjs +1 -1
  57. package/dist/core/Helpers/index.d.mts +1 -1
  58. package/dist/core/Helpers/index.mjs +2 -3
  59. package/dist/core/Hooks/index.d.mts +12 -8
  60. package/dist/core/Hooks/index.mjs +1 -1
  61. package/dist/i18n/index.mjs +3 -6
  62. package/dist/lib/index.d.mts +49 -20
  63. package/dist/lib/index.mjs +3 -2
  64. package/dist/locales/da/thorium-shared.json +3 -0
  65. package/dist/locales/en/thorium-shared.json +24 -2
  66. package/dist/locales/en/thorium-web.json +2 -2
  67. package/dist/locales/es/thorium-shared.json +364 -0
  68. package/dist/locales/es/thorium-web.json +130 -0
  69. package/dist/locales/et/thorium-shared.json +121 -9
  70. package/dist/locales/et/thorium-web.json +32 -1
  71. package/dist/locales/fi/thorium-shared.json +42 -4
  72. package/dist/locales/fi/thorium-web.json +36 -2
  73. package/dist/locales/fr/thorium-shared.json +108 -1
  74. package/dist/locales/fr/thorium-web.json +121 -86
  75. package/dist/locales/it/thorium-shared.json +108 -1
  76. package/dist/locales/it/thorium-web.json +15 -2
  77. package/dist/locales/lt/thorium-web.json +10 -1
  78. package/dist/locales/pl/thorium-web.json +1 -1
  79. package/dist/locales/pt-BR/thorium-shared.json +6 -0
  80. package/dist/locales/pt-BR/thorium-web.json +88 -88
  81. package/dist/locales/pt-PT/thorium-shared.json +91 -0
  82. package/dist/locales/pt-PT/thorium-web.json +15 -3
  83. package/dist/locales/sv/thorium-shared.json +108 -2
  84. package/dist/locales/sv/thorium-web.json +15 -3
  85. package/dist/locales/tr/thorium-shared.json +42 -0
  86. package/dist/preferences/index.d.mts +59 -13
  87. package/dist/preferences/index.mjs +6 -6
  88. package/dist/{settingsReducer-Bu1zeveu.d.mts → settingsReducer-DLaT2wUB.d.mts} +14 -2
  89. package/dist/{ui-nBv8gfr0.d.mts → ui-DnZZhozX.d.mts} +1 -1
  90. package/dist/{useAudioNavigator-C5aW4-eT.d.mts → useAudioNavigator-CWXyNWq1.d.mts} +3 -1
  91. package/dist/{useContrast-2t429O9O.d.mts → useContrast-Bo7cDw_X.d.mts} +5 -1
  92. package/dist/{usePreferences-VaBf46eP.d.mts → usePreferences-D8NU1yhP.d.mts} +6 -8
  93. package/dist/{useReaderTransitions-JDzlBFsu.d.mts → useReaderTransitions-BQGzKeY2.d.mts} +61 -10
  94. package/package.json +12 -11
  95. package/dist/chunk-3LDWKC5N.mjs.map +0 -1
  96. package/dist/chunk-4ODYHZKD.mjs.map +0 -1
  97. package/dist/chunk-4TVEDX7L.mjs.map +0 -1
  98. package/dist/chunk-7CGMWOZN.mjs +0 -20
  99. package/dist/chunk-7CGMWOZN.mjs.map +0 -1
  100. package/dist/chunk-C236BQQB.mjs +0 -1725
  101. package/dist/chunk-C236BQQB.mjs.map +0 -1
  102. package/dist/chunk-D7MFLHXV.mjs.map +0 -1
  103. package/dist/chunk-IYAFKTPL.mjs.map +0 -1
  104. package/dist/chunk-L4XGZAZ5.mjs.map +0 -1
  105. package/dist/chunk-RRVLWDT3.mjs.map +0 -1
  106. package/dist/chunk-T2E6MRVP.mjs.map +0 -1
  107. package/dist/chunk-UCTMVCW7.mjs.map +0 -1
  108. package/dist/chunk-WECWPYZB.mjs +0 -1950
  109. package/dist/chunk-WECWPYZB.mjs.map +0 -1
  110. package/dist/chunk-XBZWGRDM.mjs.map +0 -1
  111. 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, useMemo, useRef, Fragment as Fragment$1, useCallback, createElement } from 'react';
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, useLocale, useOverlayPosition, OverlayContainer, FocusScope, OverlayProvider, useDialog, useOverlay, useModal } from 'react-aria';
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 && actionMap[key]?.dockedWidth || void 0;
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, direction === "rtl" ? 1 - raw : raw));
426
+ const x = Math.max(0, Math.min(1, raw));
429
427
  if (anchorRef.current) {
430
- const side = direction === "rtl" ? "right" : "left";
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
- [direction === "rtl" ? "right" : "left"]: `${range.start / duration * 100}%`,
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
- [direction === "rtl" ? "right" : "left"]: `${segment.percentage}%`,
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", [direction === "rtl" ? "right" : "left"]: "0%", width: 0, height: "100%", top: 0 },
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
- isLoading && loader,
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
- ...props
1403
+ dir,
1404
+ ...restProps
1408
1405
  }) => {
1409
1406
  if (!links) {
1410
1407
  return null;
1411
1408
  }
1412
- const { previous, next } = links;
1409
+ const { left, right } = links;
1413
1410
  return /* @__PURE__ */ jsxs(
1414
1411
  "nav",
1415
1412
  {
1416
1413
  ref,
1417
- ...props,
1414
+ dir: "ltr",
1415
+ ...restProps,
1418
1416
  children: [
1419
- previous && /* @__PURE__ */ jsx("li", { ...compounds?.listItem, children: /* @__PURE__ */ jsxs(
1417
+ left && /* @__PURE__ */ jsx("li", { ...compounds?.listItem, children: /* @__PURE__ */ jsxs(
1420
1418
  Button,
1421
1419
  {
1422
- ...compounds?.previousButton,
1420
+ ...compounds?.leftButton,
1423
1421
  type: "button",
1424
- onPress: previous.onPress,
1422
+ onPress: left.onPress,
1425
1423
  children: [
1426
- previous.icon ? /* @__PURE__ */ jsx(previous.icon, { "aria-hidden": "true", focusable: "false" }) : direction === "left" ? /* @__PURE__ */ jsx(arrow_back_default, { "aria-hidden": "true", focusable: "false" }) : /* @__PURE__ */ jsx(arrow_forward_default, { "aria-hidden": "true", focusable: "false" }),
1427
- previous.node
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
- next && /* @__PURE__ */ jsx("li", { ...compounds?.listItem, children: /* @__PURE__ */ jsxs(
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?.nextButton,
1433
+ ...compounds?.rightButton,
1436
1434
  type: "button",
1437
- onPress: next.onPress,
1435
+ onPress: right.onPress,
1438
1436
  children: [
1439
- next.node,
1440
- next.icon ? /* @__PURE__ */ jsx(next.icon, { "aria-hidden": "true", focusable: "false" }) : direction === "left" ? /* @__PURE__ */ jsx(arrow_forward_default, { "aria-hidden": "true", focusable: "false" }) : /* @__PURE__ */ jsx(arrow_back_default, { "aria-hidden": "true", focusable: "false" })
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-4ODYHZKD.mjs.map
1882
- //# sourceMappingURL=chunk-4ODYHZKD.mjs.map
1879
+ //# sourceMappingURL=chunk-P6ILEQ5P.mjs.map
1880
+ //# sourceMappingURL=chunk-P6ILEQ5P.mjs.map