@apple-pie/slice 0.1.3 → 0.1.5

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 (126) hide show
  1. package/README.md +47 -77
  2. package/dist/cjs/chunks/{Button-hg5kGC1P.js → Button-Ck4syxwn.js} +4 -2
  3. package/dist/cjs/chunks/{ButtonBar-C9Nm9faU.js → ButtonBar-Cx9Xwddh.js} +1 -1
  4. package/dist/cjs/chunks/{Camera-Dx_PT3pS.js → Camera-BrLRwcw1.js} +1 -1
  5. package/dist/cjs/chunks/{Card-AgEMKJ4O.js → Card-CYDP4vAN.js} +1 -1
  6. package/dist/cjs/chunks/{CheckBox-CLMxlUff.js → CheckBox-DYG1fNWy.js} +1 -1
  7. package/dist/cjs/chunks/{Chip-CIy_Xe3i.js → Chip-CqOwsrmt.js} +1 -1
  8. package/dist/cjs/chunks/{DropDown-FZb52YxR.js → DropDown-Bo0bxkFk.js} +1 -1
  9. package/dist/cjs/chunks/{FileList-BQgcnKPP.js → FileList-bA8PoGOh.js} +1 -1
  10. package/dist/cjs/chunks/{Grouper-Bgc1wrQM.js → Grouper-BszVihfB.js} +1 -1
  11. package/dist/cjs/chunks/{IconButton-CBWmUZxR.js → IconButton-yWq-C437.js} +1 -1
  12. package/dist/cjs/chunks/{ProgressIndicator-qjya_Yb5.js → ProgressIndicator-Dvq4eIWW.js} +1 -1
  13. package/dist/cjs/chunks/{PromptInput-ZqHQUfXw.js → PromptInput-Hgh6995X.js} +1 -1
  14. package/dist/cjs/chunks/{RadioButton-Ce9uf54a.js → RadioButton-Cu-laBV5.js} +1 -1
  15. package/dist/cjs/chunks/{RadioButtonList-dhPr-Uhs.js → RadioButtonList-COS7jfsC.js} +1 -1
  16. package/dist/cjs/chunks/SSEConnection-B_yE8cXz.js +140 -0
  17. package/dist/cjs/chunks/{Slider-CrjpZooG.js → Slider-BeXrWjVx.js} +36 -36
  18. package/dist/cjs/chunks/{TabBar-DuwypMB6.js → TabBar-DCRr3l9L.js} +1 -1
  19. package/dist/cjs/chunks/{TextArea-BhzVGfKA.js → TextArea-DM0aHGGt.js} +1 -1
  20. package/dist/cjs/chunks/{TextField-hIjxrOG9.js → TextField-DQgpDpR1.js} +18 -16
  21. package/dist/cjs/chunks/{Toast-DMUM1wuL.js → Toast-D-Y1Ytnb.js} +1 -1
  22. package/dist/cjs/chunks/{UploadArea-B4GA06LW.js → UploadArea-Y_B35qjZ.js} +1 -1
  23. package/dist/cjs/chunks/WSConnection-DCBuJGmb.js +206 -0
  24. package/dist/cjs/chunks/{_types-C_zOsCbB.js → _types-NyUTfBLR.js} +25 -7
  25. package/dist/cjs/chunks/{sseStore-Dg0WuXsI.js → sseStore-CIIeshjm.js} +3 -3
  26. package/dist/cjs/chunks/windowStore-CCxCOUqa.js +156 -0
  27. package/dist/cjs/components/Button/index.js +3 -3
  28. package/dist/cjs/components/ButtonBar/index.js +3 -3
  29. package/dist/cjs/components/Camera/index.js +2 -2
  30. package/dist/cjs/components/Card/index.js +2 -2
  31. package/dist/cjs/components/CheckBox/index.js +2 -2
  32. package/dist/cjs/components/Chip/index.js +2 -2
  33. package/dist/cjs/components/DropDown/index.js +2 -2
  34. package/dist/cjs/components/FileList/index.js +3 -3
  35. package/dist/cjs/components/Grouper/index.js +2 -2
  36. package/dist/cjs/components/Icon/index.js +1 -1
  37. package/dist/cjs/components/IconButton/index.js +2 -2
  38. package/dist/cjs/components/Progress/index.js +2 -2
  39. package/dist/cjs/components/PromptInput/index.js +5 -5
  40. package/dist/cjs/components/RadioButton/index.js +2 -2
  41. package/dist/cjs/components/RadioButtonList/index.js +3 -3
  42. package/dist/cjs/components/Slider/index.js +1 -1
  43. package/dist/cjs/components/TabBar/index.js +3 -3
  44. package/dist/cjs/components/TextArea/index.js +4 -4
  45. package/dist/cjs/components/Textfield/index.js +5 -5
  46. package/dist/cjs/components/Toast/index.js +2 -2
  47. package/dist/cjs/components/UploadArea/index.js +4 -4
  48. package/dist/cjs/hooks/useWindow.js +46 -11
  49. package/dist/cjs/index.js +2 -2
  50. package/dist/cjs/stores/SSE.js +2 -2
  51. package/dist/cjs/stores/WS.js +62 -0
  52. package/dist/cjs/stores/window.js +14 -3
  53. package/dist/cjs/stores.js +15 -4
  54. package/dist/cjs/utils/index.js +2 -2
  55. package/dist/cjs/utils/objects/index.js +4 -138
  56. package/dist/esm/chunks/{Button-DJDS7Yad.mjs → Button-DexmN81C.mjs} +5 -3
  57. package/dist/esm/chunks/{ButtonBar-DIsqJmrS.mjs → ButtonBar-C-LwBxlY.mjs} +1 -1
  58. package/dist/esm/chunks/{Camera-BvJJ5cd-.mjs → Camera-DdUBZi52.mjs} +1 -1
  59. package/dist/esm/chunks/{Card-DjHdCav5.mjs → Card-DUfnTA5v.mjs} +1 -1
  60. package/dist/esm/chunks/{CheckBox-C1LPehvl.mjs → CheckBox-Bnd3UAt0.mjs} +1 -1
  61. package/dist/esm/chunks/{Chip-ByaaWpFx.mjs → Chip-BJS4oJBL.mjs} +1 -1
  62. package/dist/esm/chunks/{DropDown-CM01mO_W.mjs → DropDown-CbX16ETP.mjs} +1 -1
  63. package/dist/esm/chunks/{FileList-CmlXqPXl.mjs → FileList-E5uvcN2J.mjs} +2 -2
  64. package/dist/esm/chunks/{Grouper-DNmAYWdR.mjs → Grouper-X9OursiT.mjs} +1 -1
  65. package/dist/esm/chunks/{IconButton-C8RBNFzh.mjs → IconButton-B5WEf-v5.mjs} +1 -1
  66. package/dist/esm/chunks/{ProgressIndicator-h11R3FG1.mjs → ProgressIndicator-DeLwB3Rb.mjs} +1 -1
  67. package/dist/esm/chunks/{PromptInput-DSHVUuEf.mjs → PromptInput-BdMotrXA.mjs} +2 -2
  68. package/dist/esm/chunks/{RadioButton-_lo_FJ8g.mjs → RadioButton-D6kP8p0n.mjs} +1 -1
  69. package/dist/esm/chunks/{RadioButtonList-CLHJxrI_.mjs → RadioButtonList-guQECpwi.mjs} +1 -1
  70. package/dist/esm/chunks/SSEConnection-Dj9P0SWE.mjs +140 -0
  71. package/dist/esm/chunks/{Slider-Bih21QiT.mjs → Slider-ZuSvETfo.mjs} +37 -37
  72. package/dist/esm/chunks/{TabBar-CDDzA_m1.mjs → TabBar-BYtGaj_A.mjs} +2 -2
  73. package/dist/esm/chunks/{TextArea-CyVBzMoN.mjs → TextArea-D88dZrXm.mjs} +1 -1
  74. package/dist/esm/chunks/{TextField-CYI2vbvO.mjs → TextField-DvTB_JoS.mjs} +20 -18
  75. package/dist/esm/chunks/{Toast-ovxR12_-.mjs → Toast-BdlopzJ6.mjs} +1 -1
  76. package/dist/esm/chunks/{UploadArea-Kez3VD4d.mjs → UploadArea--i-bbRIJ.mjs} +3 -3
  77. package/dist/esm/chunks/WSConnection-DlYSitff.mjs +206 -0
  78. package/dist/esm/chunks/{_types-CTmvSEX0.mjs → _types-C8GP_aSD.mjs} +20 -2
  79. package/dist/esm/chunks/{sseStore-m3IPyLwJ.mjs → sseStore-DdqmnAAf.mjs} +2 -2
  80. package/dist/esm/chunks/windowStore-BOTh1g37.mjs +148 -0
  81. package/dist/esm/components/Button/index.mjs +3 -3
  82. package/dist/esm/components/ButtonBar/index.mjs +3 -3
  83. package/dist/esm/components/Camera/index.mjs +2 -2
  84. package/dist/esm/components/Card/index.mjs +2 -2
  85. package/dist/esm/components/CheckBox/index.mjs +2 -2
  86. package/dist/esm/components/Chip/index.mjs +2 -2
  87. package/dist/esm/components/DropDown/index.mjs +2 -2
  88. package/dist/esm/components/FileList/index.mjs +3 -3
  89. package/dist/esm/components/Grouper/index.mjs +2 -2
  90. package/dist/esm/components/Icon/index.mjs +1 -1
  91. package/dist/esm/components/IconButton/index.mjs +2 -2
  92. package/dist/esm/components/Progress/index.mjs +2 -2
  93. package/dist/esm/components/PromptInput/index.mjs +5 -5
  94. package/dist/esm/components/RadioButton/index.mjs +2 -2
  95. package/dist/esm/components/RadioButtonList/index.mjs +3 -3
  96. package/dist/esm/components/Slider/index.mjs +1 -1
  97. package/dist/esm/components/TabBar/index.mjs +3 -3
  98. package/dist/esm/components/TextArea/index.mjs +4 -4
  99. package/dist/esm/components/Textfield/index.mjs +5 -5
  100. package/dist/esm/components/Toast/index.mjs +2 -2
  101. package/dist/esm/components/UploadArea/index.mjs +4 -4
  102. package/dist/esm/hooks/useWindow.mjs +47 -11
  103. package/dist/esm/index.mjs +21 -21
  104. package/dist/esm/stores/SSE.mjs +2 -2
  105. package/dist/esm/stores/WS.mjs +59 -0
  106. package/dist/esm/stores/window.mjs +3 -1
  107. package/dist/esm/stores.mjs +5 -5
  108. package/dist/esm/utils/index.mjs +3 -1
  109. package/dist/esm/utils/objects/index.mjs +4 -139
  110. package/dist/types/components/Icon/_types.d.ts +1 -0
  111. package/dist/types/components/Slider/_types.d.ts +0 -2
  112. package/dist/types/hooks/index.d.ts +1 -1
  113. package/dist/types/hooks/useWindow/useWindow.d.ts +19 -0
  114. package/dist/types/index.d.ts +1 -1
  115. package/dist/types/stores/WS/_types.d.ts +17 -0
  116. package/dist/types/stores/WS/index.d.ts +2 -0
  117. package/dist/types/stores/WS/wsStore.d.ts +19 -0
  118. package/dist/types/stores/window/_types.d.ts +5 -0
  119. package/dist/types/stores/window/index.d.ts +3 -2
  120. package/dist/types/stores/window/windowStore.d.ts +8 -0
  121. package/dist/types/utils/index.d.ts +2 -2
  122. package/dist/types/utils/objects/WSConnection/WSConnection.d.ts +147 -0
  123. package/dist/types/utils/objects/index.d.ts +2 -0
  124. package/package.json +1 -1
  125. package/dist/cjs/chunks/windowStore-RaJswiHM.js +0 -70
  126. package/dist/esm/chunks/windowStore-CwW0i_le.mjs +0 -71
@@ -1,4 +1,4 @@
1
- export { R as RadioButtonList } from "../../chunks/RadioButtonList-CLHJxrI_.mjs";
1
+ export { R as RadioButtonList } from "../../chunks/RadioButtonList-guQECpwi.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -6,11 +6,11 @@ import "react/jsx-runtime";
6
6
 
7
7
  import "react";
8
8
 
9
- import "../../chunks/RadioButton-_lo_FJ8g.mjs";
9
+ import "../../chunks/RadioButton-D6kP8p0n.mjs";
10
10
 
11
11
  import "../../chunks/misc-cg9I7drO.mjs";
12
12
 
13
- import "../../chunks/_types-CTmvSEX0.mjs";
13
+ import "../../chunks/_types-C8GP_aSD.mjs";
14
14
 
15
15
  import "../../hooks/useTheme.mjs";
16
16
 
@@ -1,4 +1,4 @@
1
- export { S as Slider } from "../../chunks/Slider-Bih21QiT.mjs";
1
+ export { S as Slider } from "../../chunks/Slider-ZuSvETfo.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -1,4 +1,4 @@
1
- export { T as TabBar } from "../../chunks/TabBar-CDDzA_m1.mjs";
1
+ export { T as TabBar } from "../../chunks/TabBar-BYtGaj_A.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -28,11 +28,11 @@ import "../../chunks/Badge-DyICxZP2.mjs";
28
28
 
29
29
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
30
30
 
31
- import "../../chunks/_types-CTmvSEX0.mjs";
31
+ import "../../chunks/_types-C8GP_aSD.mjs";
32
32
 
33
33
  import "../../chunks/misc-cg9I7drO.mjs";
34
34
 
35
- import "../../chunks/IconButton-C8RBNFzh.mjs";
35
+ import "../../chunks/IconButton-B5WEf-v5.mjs";
36
36
 
37
37
  import "motion/react";
38
38
 
@@ -1,4 +1,4 @@
1
- export { T as TextArea } from "../../chunks/TextArea-CyVBzMoN.mjs";
1
+ export { T as TextArea } from "../../chunks/TextArea-D88dZrXm.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -6,7 +6,7 @@ import "react/jsx-runtime";
6
6
 
7
7
  import "react";
8
8
 
9
- import "../../chunks/Button-DJDS7Yad.mjs";
9
+ import "../../chunks/Button-DexmN81C.mjs";
10
10
 
11
11
  import "motion/react";
12
12
 
@@ -16,7 +16,7 @@ import "../../chunks/style-inject.es-D0BjEaN8.mjs";
16
16
 
17
17
  import "../../chunks/Dot-CLGwQu-i.mjs";
18
18
 
19
- import "../../chunks/_types-CTmvSEX0.mjs";
19
+ import "../../chunks/_types-C8GP_aSD.mjs";
20
20
 
21
21
  import "../../hooks/useTheme.mjs";
22
22
 
@@ -38,6 +38,6 @@ import "../../hooks/useWindow.mjs";
38
38
 
39
39
  import "../../chunks/misc-cg9I7drO.mjs";
40
40
 
41
- import "../../chunks/ProgressIndicator-h11R3FG1.mjs";
41
+ import "../../chunks/ProgressIndicator-DeLwB3Rb.mjs";
42
42
 
43
43
  import "../../chunks/sharedTypes-tn9-uJvb.mjs";
@@ -1,4 +1,4 @@
1
- export { T as TextField } from "../../chunks/TextField-CYI2vbvO.mjs";
1
+ export { T as TextField } from "../../chunks/TextField-DvTB_JoS.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -26,7 +26,7 @@ import "../../hooks/useObserveTheme.mjs";
26
26
 
27
27
  import "../../hooks/useWindow.mjs";
28
28
 
29
- import "../../chunks/Button-DJDS7Yad.mjs";
29
+ import "../../chunks/Button-DexmN81C.mjs";
30
30
 
31
31
  import "../../chunks/Badge-DyICxZP2.mjs";
32
32
 
@@ -34,12 +34,12 @@ import "../../chunks/style-inject.es-D0BjEaN8.mjs";
34
34
 
35
35
  import "../../chunks/Dot-CLGwQu-i.mjs";
36
36
 
37
- import "../../chunks/_types-CTmvSEX0.mjs";
37
+ import "../../chunks/_types-C8GP_aSD.mjs";
38
38
 
39
39
  import "../../chunks/misc-cg9I7drO.mjs";
40
40
 
41
- import "../../chunks/ProgressIndicator-h11R3FG1.mjs";
41
+ import "../../chunks/ProgressIndicator-DeLwB3Rb.mjs";
42
42
 
43
43
  import "../../chunks/sharedTypes-tn9-uJvb.mjs";
44
44
 
45
- import "../../chunks/IconButton-C8RBNFzh.mjs";
45
+ import "../../chunks/IconButton-B5WEf-v5.mjs";
@@ -1,4 +1,4 @@
1
- export { T as Toast, a as ToastType } from "../../chunks/Toast-ovxR12_-.mjs";
1
+ export { T as Toast, a as ToastType } from "../../chunks/Toast-BdlopzJ6.mjs";
2
2
 
3
3
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
4
4
 
@@ -28,6 +28,6 @@ import "../../hooks/useWindow.mjs";
28
28
 
29
29
  import "../../chunks/misc-cg9I7drO.mjs";
30
30
 
31
- import "../../chunks/_types-CTmvSEX0.mjs";
31
+ import "../../chunks/_types-C8GP_aSD.mjs";
32
32
 
33
33
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
@@ -1,4 +1,4 @@
1
- export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "../../chunks/UploadArea-Kez3VD4d.mjs";
1
+ export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "../../chunks/UploadArea--i-bbRIJ.mjs";
2
2
 
3
3
  import "react/jsx-runtime";
4
4
 
@@ -8,7 +8,7 @@ import "../../chunks/misc-cg9I7drO.mjs";
8
8
 
9
9
  import "../../chunks/tslib.es6-c-7TIv71.mjs";
10
10
 
11
- import "../../chunks/FileList-CmlXqPXl.mjs";
11
+ import "../../chunks/FileList-E5uvcN2J.mjs";
12
12
 
13
13
  import "../../chunks/FileIcon-CC_k5dUW.mjs";
14
14
 
@@ -30,10 +30,10 @@ import "../../hooks/useObserveTheme.mjs";
30
30
 
31
31
  import "../../hooks/useWindow.mjs";
32
32
 
33
- import "../../chunks/_types-CTmvSEX0.mjs";
33
+ import "../../chunks/_types-C8GP_aSD.mjs";
34
34
 
35
35
  import "../../chunks/style-inject.es-D0BjEaN8.mjs";
36
36
 
37
- import "../../chunks/ProgressIndicator-h11R3FG1.mjs";
37
+ import "../../chunks/ProgressIndicator-DeLwB3Rb.mjs";
38
38
 
39
39
  import "motion/react";
@@ -1,10 +1,10 @@
1
1
  import { useState, useEffect, useCallback } from "react";
2
2
 
3
- var _a, FormFactor;
4
-
5
3
  /**
6
4
  * Form factor names
7
- */ !function(FormFactor) {
5
+ */ var FormFactor;
6
+
7
+ !function(FormFactor) {
8
8
  FormFactor.Mobile = "mobile", FormFactor.Tablet = "tablet", FormFactor.Desktop = "desktop",
9
9
  FormFactor.DesktopL = "desktopL", FormFactor.DesktopXL = "desktopXL";
10
10
  }(FormFactor || (FormFactor = {}));
@@ -18,19 +18,50 @@ const bootstrapBreakPoints = {
18
18
  [FormFactor.Desktop]: 992,
19
19
  [FormFactor.DesktopL]: 1200,
20
20
  [FormFactor.DesktopXL]: 1400
21
- };
22
-
23
- const isElectron = navigator.userAgent.toLowerCase().includes("electron/"), isAppleDevice = navigator.platform.startsWith("Mac") || "iPhone" === navigator.platform, dpr = null !== (_a = Math.min(Math.ceil(window.devicePixelRatio), 3)) && void 0 !== _a ? _a : 1, isTouchDevice = "ontouchstart" in globalThis || navigator.maxTouchPoints > 0, orderedBps = Object.entries(bootstrapBreakPoints).sort((a, b) => -b[1] - a[1]);
21
+ }, isBrowser = "undefined" != typeof window && "undefined" != typeof navigator;
24
22
 
25
23
  function useWindow(breakpoints = bootstrapBreakPoints, top = !0) {
26
- const [viewportWidth, setViewportWidth] = useState(null), [viewportHeight, setViewportHeight] = useState(null), [height, setHeight] = useState("100vh"), [formFactor, setFormFactor] = useState(FormFactor.Desktop);
27
- useEffect(() => (handleResize(), window.addEventListener("resize", handleResize, !1),
28
- () => window.removeEventListener("resize", handleResize, !1)), []);
24
+ const isElectron = !!isBrowser && navigator.userAgent.toLowerCase().includes("electron/"), isAppleDevice = !!isBrowser && (navigator.platform.startsWith("Mac") || "iPhone" === navigator.platform), isTouchDevice = !!isBrowser && ("ontouchstart" in globalThis || navigator.maxTouchPoints > 0), dpr = isBrowser && null !== (_a = Math.min(Math.ceil(window.devicePixelRatio), 3)) && void 0 !== _a ? _a : 1;
25
+ var _a;
26
+ const [viewportWidth, setViewportWidth] = useState(null), [viewportHeight, setViewportHeight] = useState(null), [height, setHeight] = useState("100vh"), [formFactor, setFormFactor] = useState(FormFactor.Desktop), [location, setLocation] = useState(null), [locationError, setLocationError] = useState(null), [gettingLocation, setGettingLocation] = useState(!1), geolocationSupported = "undefined" != typeof navigator && "geolocation" in navigator;
27
+ useEffect(() => {
28
+ if (isBrowser) return handleResize(), window.addEventListener("resize", handleResize, !1),
29
+ () => window.removeEventListener("resize", handleResize, !1);
30
+ }, []);
29
31
  const getFormFactor = useCallback(width => {
30
32
  if (!width || width <= 0) return FormFactor.Mobile;
33
+ const orderedBps = Object.entries(breakpoints).sort((a, b) => b[1] - a[1]);
31
34
  for (const [formFactor, breakpoint] of orderedBps) if (width >= breakpoint) return formFactor;
32
35
  return FormFactor.Mobile;
33
- }, []);
36
+ }, [ breakpoints ]), requestGeolocation = useCallback(() => {
37
+ if (!geolocationSupported) {
38
+ const error = new Error("Geolocation is not supported in this browser.", {
39
+ cause: {
40
+ code: 0
41
+ }
42
+ });
43
+ return void setLocationError(error);
44
+ }
45
+ setGettingLocation(!0), setLocationError(null), navigator.geolocation.getCurrentPosition(position => {
46
+ setLocation({
47
+ latitude: position.coords.latitude,
48
+ longitude: position.coords.longitude,
49
+ accuracy: position.coords.accuracy,
50
+ altitude: position.coords.altitude,
51
+ altitudeAccuracy: position.coords.altitudeAccuracy,
52
+ heading: position.coords.heading,
53
+ speed: position.coords.speed,
54
+ timestamp: position.timestamp
55
+ }), setGettingLocation(!1);
56
+ }, err => {
57
+ const error = new Error(err.message, {
58
+ cause: {
59
+ code: err.code
60
+ }
61
+ });
62
+ setLocationError(error), setGettingLocation(!1);
63
+ });
64
+ }, [ geolocationSupported ]);
34
65
  function handleResize() {
35
66
  var _a, _b, _c, _d;
36
67
  const windowWidth = top && null !== (_b = null === (_a = window.top) || void 0 === _a ? void 0 : _a.innerWidth) && void 0 !== _b ? _b : window.innerWidth, windowHeight = top && null !== (_d = null === (_c = window.top) || void 0 === _c ? void 0 : _c.innerHeight) && void 0 !== _d ? _d : window.innerHeight;
@@ -45,7 +76,12 @@ function useWindow(breakpoints = bootstrapBreakPoints, top = !0) {
45
76
  isElectron: isElectron,
46
77
  isAppleDevice: isAppleDevice,
47
78
  formFactor: formFactor,
48
- dpr: dpr
79
+ dpr: dpr,
80
+ geolocationSupported: geolocationSupported,
81
+ location: location,
82
+ locationError: locationError,
83
+ gettingLocation: gettingLocation,
84
+ requestGeolocation: requestGeolocation
49
85
  };
50
86
  }
51
87
 
@@ -32,11 +32,11 @@ export { A as AvatarGroup } from "./chunks/AvatarGroup-BZ18GwhK.mjs";
32
32
 
33
33
  export { B as Badge } from "./chunks/Badge-DyICxZP2.mjs";
34
34
 
35
- export { I as IconButton } from "./chunks/IconButton-C8RBNFzh.mjs";
35
+ export { I as IconButton } from "./chunks/IconButton-B5WEf-v5.mjs";
36
36
 
37
- export { C as Camera } from "./chunks/Camera-BvJJ5cd-.mjs";
37
+ export { C as Camera } from "./chunks/Camera-DdUBZi52.mjs";
38
38
 
39
- export { C as CheckBox } from "./chunks/CheckBox-C1LPehvl.mjs";
39
+ export { C as CheckBox } from "./chunks/CheckBox-Bnd3UAt0.mjs";
40
40
 
41
41
  export { D as DivInput } from "./chunks/DivInput-B7BliU1p.mjs";
42
42
 
@@ -46,11 +46,11 @@ export { D as Dot } from "./chunks/Dot-CLGwQu-i.mjs";
46
46
 
47
47
  export { D as DraggablePanel } from "./chunks/DrggablePanel-DvactFf5.mjs";
48
48
 
49
- export { D as DropDown } from "./chunks/DropDown-CM01mO_W.mjs";
49
+ export { D as DropDown } from "./chunks/DropDown-CbX16ETP.mjs";
50
50
 
51
51
  export { E as ErrorSummary } from "./chunks/ErrorSummary-S0shes-m.mjs";
52
52
 
53
- export { G as Grouper } from "./chunks/Grouper-DNmAYWdR.mjs";
53
+ export { G as Grouper } from "./chunks/Grouper-X9OursiT.mjs";
54
54
 
55
55
  export { O as Overlay } from "./chunks/Overlay-Cw9o1fHb.mjs";
56
56
 
@@ -58,47 +58,47 @@ export { F as FlexDiv } from "./chunks/FlexDiv-LGEGGrT0.mjs";
58
58
 
59
59
  export { P as Pager } from "./chunks/Pager-BX4TMwD_.mjs";
60
60
 
61
- export { P as PromptInput } from "./chunks/PromptInput-DSHVUuEf.mjs";
61
+ export { P as PromptInput } from "./chunks/PromptInput-BdMotrXA.mjs";
62
62
 
63
- export { D as DoneCheck, P as ProgressIndicator } from "./chunks/ProgressIndicator-h11R3FG1.mjs";
63
+ export { D as DoneCheck, P as ProgressIndicator } from "./chunks/ProgressIndicator-DeLwB3Rb.mjs";
64
64
 
65
- export { R as RadioButton } from "./chunks/RadioButton-_lo_FJ8g.mjs";
65
+ export { R as RadioButton } from "./chunks/RadioButton-D6kP8p0n.mjs";
66
66
 
67
- export { R as RadioButtonList } from "./chunks/RadioButtonList-CLHJxrI_.mjs";
67
+ export { R as RadioButtonList } from "./chunks/RadioButtonList-guQECpwi.mjs";
68
68
 
69
- export { S as Slider } from "./chunks/Slider-Bih21QiT.mjs";
69
+ export { S as Slider } from "./chunks/Slider-ZuSvETfo.mjs";
70
70
 
71
71
  export { S as Spacer } from "./chunks/Spacer-BlgEdKEM.mjs";
72
72
 
73
73
  export { S as Switch } from "./chunks/Switch-nWg2Ykea.mjs";
74
74
 
75
- export { T as TabBar } from "./chunks/TabBar-CDDzA_m1.mjs";
75
+ export { T as TabBar } from "./chunks/TabBar-BYtGaj_A.mjs";
76
76
 
77
- export { T as TextArea } from "./chunks/TextArea-CyVBzMoN.mjs";
77
+ export { T as TextArea } from "./chunks/TextArea-D88dZrXm.mjs";
78
78
 
79
- export { T as TextField } from "./chunks/TextField-CYI2vbvO.mjs";
79
+ export { T as TextField } from "./chunks/TextField-DvTB_JoS.mjs";
80
80
 
81
81
  export { ThemeProvider } from "./providers/ThemeProvider.mjs";
82
82
 
83
83
  export { T as Tip } from "./chunks/Tip-B-cDOFvV.mjs";
84
84
 
85
- export { T as Toast, a as ToastType } from "./chunks/Toast-ovxR12_-.mjs";
85
+ export { T as Toast, a as ToastType } from "./chunks/Toast-BdlopzJ6.mjs";
86
86
 
87
- export { B as Button } from "./chunks/Button-DJDS7Yad.mjs";
87
+ export { B as Button } from "./chunks/Button-DexmN81C.mjs";
88
88
 
89
- export { C as Chip } from "./chunks/Chip-ByaaWpFx.mjs";
89
+ export { C as Chip } from "./chunks/Chip-BJS4oJBL.mjs";
90
90
 
91
91
  export { F as FileIcon, a as FileIconNames } from "./chunks/FileIcon-CC_k5dUW.mjs";
92
92
 
93
- export { I as Icon, a as IconNames } from "./chunks/_types-CTmvSEX0.mjs";
93
+ export { I as Icon, a as IconNames } from "./chunks/_types-C8GP_aSD.mjs";
94
94
 
95
- export { B as ButtonBar } from "./chunks/ButtonBar-DIsqJmrS.mjs";
95
+ export { B as ButtonBar } from "./chunks/ButtonBar-C-LwBxlY.mjs";
96
96
 
97
- export { C as Card } from "./chunks/Card-DjHdCav5.mjs";
97
+ export { C as Card } from "./chunks/Card-DUfnTA5v.mjs";
98
98
 
99
99
  export { L as Label } from "./chunks/Label-DOvquc82.mjs";
100
100
 
101
- export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "./chunks/UploadArea-Kez3VD4d.mjs";
101
+ export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "./chunks/UploadArea--i-bbRIJ.mjs";
102
102
 
103
103
  import "./theme/corners.mjs";
104
104
 
@@ -118,4 +118,4 @@ import "motion/react";
118
118
 
119
119
  import "./chunks/colors-DR9fLI5X.mjs";
120
120
 
121
- import "./chunks/FileList-CmlXqPXl.mjs";
121
+ import "./chunks/FileList-E5uvcN2J.mjs";
@@ -1,7 +1,7 @@
1
- export { u as useConnectionClose, a as useConnectionMessage, b as useIsConnected, c as useLastSSEMessage, d as useMessage, e as useSSE, f as useSSEActions, g as useSSEStore } from "../chunks/sseStore-m3IPyLwJ.mjs";
1
+ export { u as useConnectionClose, a as useConnectionMessage, b as useIsConnected, c as useLastSSEMessage, d as useMessage, e as useSSE, f as useSSEActions, g as useSSEStore } from "../chunks/sseStore-DdqmnAAf.mjs";
2
2
 
3
3
  import "zustand";
4
4
 
5
5
  import "../chunks/tslib.es6-c-7TIv71.mjs";
6
6
 
7
- import "../utils/objects/index.mjs";
7
+ import "../chunks/SSEConnection-Dj9P0SWE.mjs";
@@ -0,0 +1,59 @@
1
+ import { create } from "zustand";
2
+
3
+ import "../chunks/tslib.es6-c-7TIv71.mjs";
4
+
5
+ import { W as WSConnection } from "../chunks/WSConnection-DlYSitff.mjs";
6
+
7
+ const useWSStore = create((set, get) => ({
8
+ connections: [],
9
+ message: null,
10
+ closedConnection: null,
11
+ actions: {
12
+ addConnection: (name, options) => {
13
+ const existingConnection = get().connections.find(c => c.name === name);
14
+ null == existingConnection || existingConnection.connection.close({
15
+ code: 1e3,
16
+ reason: "Connection replaced"
17
+ });
18
+ const userOnMessageCallback = options.onMessageCallback, connection = new WSConnection(Object.assign(Object.assign({}, options), {
19
+ unifiedMessages: !0,
20
+ onMessageCallback: message => {
21
+ set({
22
+ message: message
23
+ }), null == userOnMessageCallback || userOnMessageCallback(message), "close" === message.type && set({
24
+ closedConnection: name
25
+ });
26
+ }
27
+ })), nextConnection = {
28
+ name: name,
29
+ connection: connection
30
+ };
31
+ return set(state => ({
32
+ connections: [ ...state.connections.filter(connection => connection.name !== name), nextConnection ]
33
+ })), nextConnection;
34
+ },
35
+ removeConnection: name => {
36
+ const existingConnection = get().connections.find(c => c.name === name);
37
+ existingConnection && (existingConnection.connection.close({
38
+ code: 1e3,
39
+ reason: "Connection removed"
40
+ }), set(state => ({
41
+ connections: state.connections.filter(connection => connection.name !== name)
42
+ })));
43
+ }
44
+ }
45
+ })), useWS = () => useWSStore(state => state.actions), useConnectionClose = () => useWSStore(state => state.closedConnection), useConnectionMessage = connection => useWSStore(state => state.connections.some(entry => entry.name === connection) ? state.message : null), useIsConnected = connection => useWSStore(state => {
46
+ var _a, _b;
47
+ return connection ? null !== (_b = null === (_a = state.connections.find(entry => entry.name === connection)) || void 0 === _a ? void 0 : _a.connection.connected) && void 0 !== _b && _b : state.connections.some(entry => entry.connection.connected);
48
+ });
49
+
50
+ function useMessage(type, connection) {
51
+ return useWSStore(state => {
52
+ const sourceMessage = connection && !state.connections.some(c => c.name === connection) ? null : state.message;
53
+ return type ? (null == sourceMessage ? void 0 : sourceMessage.type) !== type ? null : "open" === type || "error" === type || "close" === type ? "event" in sourceMessage ? sourceMessage.event : null : "data" in sourceMessage ? sourceMessage.data : null : sourceMessage;
54
+ });
55
+ }
56
+
57
+ const useWSActions = useWSStore.getState().actions, useLastWSMessage = () => useWSStore.getState().message;
58
+
59
+ export { useConnectionClose, useConnectionMessage, useIsConnected, useLastWSMessage, useMessage, useWS, useWSActions, useWSStore };
@@ -1,3 +1,5 @@
1
- export { F as FormFactor, u as useWindowStore } from "../chunks/windowStore-CwW0i_le.mjs";
1
+ export { F as FormFactor, d as dpr, f as formFactor, g as gettingLocation, i as isAppleDevice, a as isElectron, b as isTouchDevice, l as location, c as locationError, u as useDpr, e as useFormFactor, h as useGetLocation, j as useGettingLocation, k as useInitializeWindow, m as useIsAppleDevice, n as useIsElectron, o as useIsTouchDevice, p as useLocation, q as useLocationError, r as useViewportHeight, s as useViewportWidth, t as useWindowStore, v as viewportHeight, w as viewportWidth } from "../chunks/windowStore-BOTh1g37.mjs";
2
+
3
+ import "../chunks/tslib.es6-c-7TIv71.mjs";
2
4
 
3
5
  import "zustand";
@@ -1,4 +1,4 @@
1
- export { F as FormFactor, u as useWindowStore } from "./chunks/windowStore-CwW0i_le.mjs";
1
+ export { F as FormFactor, d as dpr, f as formFactor, g as gettingLocation, i as isAppleDevice, a as isElectron, b as isTouchDevice, l as location, c as locationError, u as useDpr, e as useFormFactor, h as useGetLocation, j as useGettingLocation, k as useInitializeWindow, m as useIsAppleDevice, n as useIsElectron, o as useIsTouchDevice, p as useLocation, q as useLocationError, r as useViewportHeight, s as useViewportWidth, t as useWindowStore, v as viewportHeight, w as viewportWidth } from "./chunks/windowStore-BOTh1g37.mjs";
2
2
 
3
3
  export { c as createUploadsWorker, g as getUploads, a as getUploadsError, b as getUploadsWorkerStatus, u as uploadsActions, d as uploadsInitialized, e as useUploads, f as useUploadsActions, h as useUploadsError, i as useUploadsInitialized, j as useUploadsStore, k as useUploadsWorkerStatus } from "./chunks/uploadsStore-D69fEXMY.mjs";
4
4
 
@@ -6,12 +6,12 @@ export { g as getTip, t as tipActions, u as useTip, a as useTipActions, b as use
6
6
 
7
7
  export { g as getToast, t as toastActions, u as useToast, a as useToastActions, b as useToastStore } from "./chunks/toastStore-D2PEIqCo.mjs";
8
8
 
9
- export { u as useConnectionClose, a as useConnectionMessage, b as useIsConnected, c as useLastSSEMessage, d as useMessage, e as useSSE, f as useSSEActions, g as useSSEStore } from "./chunks/sseStore-m3IPyLwJ.mjs";
9
+ export { u as useConnectionClose, a as useConnectionMessage, b as useIsConnected, c as useLastSSEMessage, d as useMessage, e as useSSE, f as useSSEActions, g as useSSEStore } from "./chunks/sseStore-DdqmnAAf.mjs";
10
+
11
+ import "./chunks/tslib.es6-c-7TIv71.mjs";
10
12
 
11
13
  import "zustand";
12
14
 
13
15
  import "./chunks/uploads-worker-Dv-4zGnC.mjs";
14
16
 
15
- import "./chunks/tslib.es6-c-7TIv71.mjs";
16
-
17
- import "./utils/objects/index.mjs";
17
+ import "./chunks/SSEConnection-Dj9P0SWE.mjs";
@@ -2,6 +2,8 @@ export { c as copyToClipboard } from "../chunks/misc-cg9I7drO.mjs";
2
2
 
3
3
  export { a as addOpacity, t as tintFromColor } from "../chunks/colors-DR9fLI5X.mjs";
4
4
 
5
- export { SSEConnection } from "./objects/index.mjs";
5
+ export { S as SSEConnection } from "../chunks/SSEConnection-Dj9P0SWE.mjs";
6
+
7
+ export { W as WSConnection } from "../chunks/WSConnection-DlYSitff.mjs";
6
8
 
7
9
  import "../chunks/tslib.es6-c-7TIv71.mjs";
@@ -1,140 +1,5 @@
1
- class SSEConnection {
2
- /**
3
- * Whether the underlying EventSource is currently open.
4
- */
5
- get connected() {
6
- var _a;
7
- return (null === (_a = this.sseConnection) || void 0 === _a ? void 0 : _a.readyState) === EventSource.OPEN;
8
- }
9
- /**
10
- * Direct access to the underlying EventSource instance.
11
- */ get connection() {
12
- return this.sseConnection;
13
- }
14
- /**
15
- * Create an SEE connection instance
16
- */ constructor(options) {
17
- var _a, _b, _c;
18
- this.sseConnection = null, this.customEventHandlers = new Map, this.unifiedOnMessage = !1,
19
- /**
20
- * One message received
21
- */
22
- this.onMessage = event => {
23
- const data = this.parseEventData(event.data);
24
- this.emitUnifiedMessage({
25
- type: "message",
26
- data: data,
27
- event: event
28
- }), this.emitParsedMessage(data), this.shouldCloseFromMessage(event.data, data) && this.closeFromConnectionEvent();
29
- },
30
- /**
31
- * On error event
32
- */
33
- this.onError = event => {
34
- var _a;
35
- null === (_a = this.onErrorCallback) || void 0 === _a || _a.call(this, event), this.emitUnifiedMessage({
36
- type: "error",
37
- event: event
38
- });
39
- },
40
- /**
41
- * On open event
42
- */
43
- this.onOpen = event => {
44
- var _a;
45
- null === (_a = this.onOpenCallback) || void 0 === _a || _a.call(this, event), this.emitUnifiedMessage({
46
- type: "open",
47
- event: event
48
- });
49
- },
50
- /**
51
- * Close the SSE connection and release resources.
52
- */
53
- this.close = () => {
54
- this.sseConnection && (this.detachAllEventListeners(this.sseConnection), this.sseConnection.close(),
55
- this.sseConnection = null);
56
- }, this.url = null !== (_a = null == options ? void 0 : options.url) && void 0 !== _a ? _a : "",
57
- this.options = null !== (_b = null == options ? void 0 : options.options) && void 0 !== _b ? _b : void 0,
58
- this.unifiedOnMessage = null !== (_c = null == options ? void 0 : options.unifiedOnMessage) && void 0 !== _c && _c,
59
- this.onMessageCallback = null == options ? void 0 : options.onMessageCallback, this.onErrorCallback = null == options ? void 0 : options.onErrorCallback,
60
- this.onOpenCallback = null == options ? void 0 : options.onOpenCallback, this.onCloseCallback = null == options ? void 0 : options.onCloseCallback,
61
- this.connectionClose = null == options ? void 0 : options.connectionClose, (null == options ? void 0 : options.customEvents) ? this.customEvents = Array.isArray(null == options ? void 0 : options.customEvents) ? options.customEvents : [ options.customEvents ] : this.customEvents = [],
62
- this.sseConnection = new EventSource(this.url, this.options), this.attachDefaultEventListeners(this.sseConnection),
63
- this.customEvents.length > 0 && this.attachCustomEventListeners(this.customEvents);
64
- }
65
- /**
66
- * Safely parse SSE event data. Falls back to the raw string when the payload is not JSON.
67
- */ parseEventData(rawData) {
68
- try {
69
- return JSON.parse(rawData);
70
- } catch (_a) {
71
- return rawData;
72
- }
73
- }
74
- /**
75
- * Attach default SEE events
76
- */ attachDefaultEventListeners(connection) {
77
- connection.addEventListener("message", this.onMessage), connection.addEventListener("error", this.onError),
78
- connection.addEventListener("open", this.onOpen);
79
- }
80
- emitParsedMessage(data) {
81
- var _a;
82
- this.unifiedOnMessage || null === (_a = this.onMessageCallback) || void 0 === _a || _a.call(this, data);
83
- }
84
- emitUnifiedMessage(message) {
85
- var _a;
86
- this.unifiedOnMessage && (null === (_a = this.onMessageCallback) || void 0 === _a || _a.call(this, message));
87
- }
88
- emitCloseEvent(event) {
89
- var _a;
90
- null === (_a = this.onCloseCallback) || void 0 === _a || _a.call(this, event), this.emitUnifiedMessage({
91
- type: "close",
92
- event: event
93
- });
94
- }
95
- closeFromConnectionEvent() {
96
- const closeEvent = new Event("close");
97
- this.emitCloseEvent(closeEvent), this.close();
98
- }
99
- shouldCloseFromMessage(rawData, data) {
100
- var _a;
101
- return !!(null === (_a = this.connectionClose) || void 0 === _a ? void 0 : _a.message) && (rawData === this.connectionClose.message || data === this.connectionClose.message);
102
- }
103
- emitUnifiedCustomMessage(customEvent, data, event) {
104
- this.emitUnifiedMessage({
105
- type: customEvent.name,
106
- data: data,
107
- event: event
108
- });
109
- }
110
- /**
111
- * Attach custom event listeners to the SSE connection
112
- */ attachCustomEventListener(customEvent) {
113
- var _a;
114
- if (!this.sseConnection) return;
115
- const handler = eventInfo => {
116
- var _a, _b;
117
- const data = this.parseEventData(eventInfo.data);
118
- null === (_a = customEvent.handler) || void 0 === _a || _a.call(customEvent, data),
119
- this.emitUnifiedCustomMessage(customEvent, data, eventInfo), (null === (_b = this.connectionClose) || void 0 === _b ? void 0 : _b.event) === customEvent.name && this.closeFromConnectionEvent();
120
- }, currentHandlers = null !== (_a = this.customEventHandlers.get(customEvent.name)) && void 0 !== _a ? _a : [];
121
- currentHandlers.push(handler), this.customEventHandlers.set(customEvent.name, currentHandlers),
122
- this.sseConnection.addEventListener(customEvent.name, handler);
123
- }
124
- /**
125
- * Attach custom event listeners to the SSE connection
126
- */ attachCustomEventListeners(customEvents) {
127
- const events = Array.isArray(customEvents) ? customEvents : [ customEvents ];
128
- for (const event of events) this.attachCustomEventListener(event);
129
- }
130
- /**
131
- * Clean up listeners
132
- */ detachAllEventListeners(connection) {
133
- connection.removeEventListener("message", this.onMessage), connection.removeEventListener("error", this.onError),
134
- connection.removeEventListener("open", this.onOpen);
135
- for (const [eventName, handlers] of this.customEventHandlers.entries()) for (const handler of handlers) connection.removeEventListener(eventName, handler);
136
- this.customEventHandlers.clear();
137
- }
138
- }
1
+ export { S as SSEConnection } from "../../chunks/SSEConnection-Dj9P0SWE.mjs";
139
2
 
140
- export { SSEConnection };
3
+ export { W as WSConnection } from "../../chunks/WSConnection-DlYSitff.mjs";
4
+
5
+ import "../../chunks/tslib.es6-c-7TIv71.mjs";
@@ -13,6 +13,7 @@ type IconBaseProps = {
13
13
  };
14
14
  export type IconProps = Omit<React.SVGAttributes<SVGSVGElement>, keyof IconBaseProps> & IconBaseProps;
15
15
  export declare enum IconNames {
16
+ target = "target",
16
17
  video = "video",
17
18
  mic = "mic",
18
19
  micMuted = "mic muted",
@@ -7,8 +7,6 @@ type SliderBaseProps = {
7
7
  height?: number | string;
8
8
  touchHeight?: number | string;
9
9
  trackHeadSize?: number | null;
10
- trackHeadWidth?: number | null;
11
- headType?: 'round' | 'square' | 'none';
12
10
  headColor?: string;
13
11
  trackColor?: string;
14
12
  progressColor?: string;
@@ -5,5 +5,5 @@ export { useToolTip } from './useToolTip/useToolTip';
5
5
  export { type KeyboardShortcut, type KeyboardShortcuts, useKeyboardShortcuts, } from './useKeyboardShortcuts/useKeyboardShortcuts';
6
6
  export { useLastUpdated } from './useLastUpdated/useLastUpdated';
7
7
  export { useLocalStore } from './useLocalStore/useLocalStore';
8
- export { useWindow, FormFactor, type BreakPoints } from './useWindow/useWindow';
8
+ export { useWindow, FormFactor, type BreakPoints, type WindowGeolocation, type WindowGeolocationError, } from './useWindow/useWindow';
9
9
  export { useObserveResize } from './useObserveResize/useObserveResize';