@apple-pie/slice 0.0.5 → 0.0.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.
Files changed (414) hide show
  1. package/dist/cjs/chunks/Avatar-0EXaRG4e.js +54 -0
  2. package/dist/cjs/chunks/AvatarGroup-BsRUAZl0.js +37 -0
  3. package/dist/cjs/chunks/Badge-Bv6c2YVC.js +23 -0
  4. package/dist/cjs/chunks/Button-DFAWHJmQ.js +246 -0
  5. package/dist/cjs/chunks/ButtonBar-DOgYDAda.js +53 -0
  6. package/dist/cjs/chunks/Card-BPClSuHa.js +37 -0
  7. package/dist/cjs/chunks/CheckBox-tsExpwtr.js +56 -0
  8. package/dist/cjs/chunks/Chip-CPHF1zn-.js +84 -0
  9. package/dist/cjs/chunks/DivInput-DDQVtlot.js +102 -0
  10. package/dist/cjs/chunks/DocIcons-B5TcBqSH.js +108 -0
  11. package/dist/cjs/chunks/Dot-BSSClfHQ.js +73 -0
  12. package/dist/cjs/chunks/DrggablePanel-wWLPesc8.js +202 -0
  13. package/dist/cjs/chunks/DropDown-COdCr77A.js +102 -0
  14. package/dist/cjs/chunks/ErrorSummary-CIUqlSLC.js +60 -0
  15. package/dist/cjs/chunks/FileIcon-DTQaXxfC.js +221 -0
  16. package/dist/cjs/chunks/FileList-J2EgJyCo.js +217 -0
  17. package/dist/cjs/chunks/FlexDiv-CW5gSa4V.js +65 -0
  18. package/dist/cjs/chunks/Grouper-QwwunKen.js +61 -0
  19. package/dist/cjs/chunks/IconButton-B53y3z1_.js +77 -0
  20. package/dist/cjs/chunks/Label-DoiS07-y.js +111 -0
  21. package/dist/cjs/chunks/Logos-CAHU-eIP.js +483 -0
  22. package/dist/cjs/chunks/Overlay-Bb2YoSKr.js +36 -0
  23. package/dist/cjs/chunks/Pager-CN2z8M9E.js +37 -0
  24. package/dist/cjs/chunks/ProgressIndicator-BbrZ7Aoc.js +157 -0
  25. package/dist/cjs/chunks/PromptInput-BXDqUXFQ.js +150 -0
  26. package/dist/cjs/chunks/RadioButton-GKRhZEmb.js +56 -0
  27. package/dist/cjs/chunks/RadioButtonList-CFpZmyAX.js +59 -0
  28. package/dist/cjs/chunks/Slider-CZvCAodl.js +136 -0
  29. package/dist/cjs/chunks/Spacer-CtxV2Pww.js +18 -0
  30. package/dist/cjs/chunks/Switch-C94aofxQ.js +37 -0
  31. package/dist/cjs/chunks/TabBar-D6akzNUf.js +123 -0
  32. package/dist/cjs/chunks/TextArea-DjF8Koup.js +82 -0
  33. package/dist/cjs/chunks/TextField-Cg6mQcYl.js +204 -0
  34. package/dist/cjs/chunks/Tip-CjMHa-fD.js +88 -0
  35. package/dist/cjs/chunks/Toast-Cdyh6T-l.js +163 -0
  36. package/dist/cjs/chunks/UploadArea-BmZ50EEl.js +123 -0
  37. package/dist/cjs/chunks/_types-B5xXv4NA.js +1386 -0
  38. package/dist/cjs/chunks/sharedTypes-gCECyn2N.js +6 -0
  39. package/dist/cjs/chunks/style-inject.es-CMuL-BfJ.js +11 -0
  40. package/dist/cjs/chunks/tipStore-Ck4NLvml.js +17 -0
  41. package/dist/cjs/chunks/toastStore-CSStgB9d.js +17 -0
  42. package/dist/cjs/chunks/tslib.es6-C8dZW5nY.js +49 -0
  43. package/dist/cjs/chunks/uploads-worker-mD8pcsGP.js +221 -0
  44. package/dist/cjs/chunks/uploadsStore-CxWIctvI.js +75 -0
  45. package/dist/cjs/chunks/utils-BsBHecUI.js +70 -0
  46. package/dist/cjs/chunks/windowStore-RaJswiHM.js +70 -0
  47. package/dist/cjs/hooks/useDoubleClick.js +11 -23
  48. package/dist/cjs/hooks/useKeyboardShortcuts.js +18 -35
  49. package/dist/cjs/hooks/useLastUpdated.js +20 -42
  50. package/dist/cjs/hooks/useLocalStore.js +23 -39
  51. package/dist/cjs/hooks/useObserveResize.js +26 -44
  52. package/dist/cjs/hooks/useObserveTheme.js +18 -36
  53. package/dist/cjs/hooks/useTheme.js +17 -40
  54. package/dist/cjs/hooks/useToolTip.js +19 -32
  55. package/dist/cjs/hooks/useTrackRenders.js +11 -29
  56. package/dist/cjs/hooks/useWindow.js +29 -65
  57. package/dist/cjs/hooks.js +12 -30
  58. package/dist/cjs/index.js +47 -127
  59. package/dist/cjs/providers/ThemeProvider.js +27 -45
  60. package/dist/cjs/providers.js +5 -12
  61. package/dist/cjs/stores/tip.js +4 -9
  62. package/dist/cjs/stores/toast.js +4 -9
  63. package/dist/cjs/stores/uploads.js +11 -0
  64. package/dist/cjs/stores/window.js +8 -10
  65. package/dist/cjs/stores.js +18 -21
  66. package/dist/cjs/theme/colors.js +371 -379
  67. package/dist/cjs/theme/corners.js +10 -12
  68. package/dist/cjs/theme/elevations.js +10 -13
  69. package/dist/cjs/theme/themes.js +8 -13
  70. package/dist/cjs/theme/type.js +225 -384
  71. package/dist/cjs/theme.js +5 -13
  72. package/dist/cjs/uikit/Avatar/index.js +6 -0
  73. package/dist/cjs/uikit/AvatarGroup/index.js +7 -0
  74. package/dist/cjs/uikit/Badge/index.js +6 -0
  75. package/dist/cjs/uikit/Button/index.js +12 -0
  76. package/dist/cjs/uikit/ButtonBar/index.js +12 -0
  77. package/dist/cjs/uikit/Card/index.js +10 -0
  78. package/dist/cjs/uikit/CheckBox/index.js +10 -0
  79. package/dist/cjs/uikit/Chip/index.js +11 -0
  80. package/dist/cjs/uikit/DivInput/index.js +7 -0
  81. package/dist/cjs/uikit/DocIcon/index.js +9 -0
  82. package/dist/cjs/uikit/Dot/index.js +6 -0
  83. package/dist/cjs/uikit/DraggablePanel/index.js +10 -0
  84. package/dist/cjs/uikit/DropDown/index.js +10 -0
  85. package/dist/cjs/uikit/ErrorSummary/index.js +6 -0
  86. package/dist/cjs/uikit/FileIcon/index.js +15 -0
  87. package/dist/cjs/uikit/FileList/index.js +11 -0
  88. package/dist/cjs/uikit/FlexDiv/index.js +6 -0
  89. package/dist/cjs/uikit/Grouper/index.js +11 -0
  90. package/dist/cjs/uikit/Icon/index.js +14 -0
  91. package/dist/cjs/uikit/IconButton/index.js +12 -0
  92. package/dist/cjs/uikit/Label/index.js +10 -0
  93. package/dist/cjs/uikit/Logos/index.js +9 -0
  94. package/dist/cjs/uikit/Overlay/index.js +6 -0
  95. package/dist/cjs/uikit/Pager/index.js +7 -0
  96. package/dist/cjs/uikit/Progress/index.js +10 -0
  97. package/dist/cjs/uikit/PromptInput/index.js +14 -0
  98. package/dist/cjs/uikit/RadioButton/index.js +12 -0
  99. package/dist/cjs/uikit/RadioButtonList/index.js +13 -0
  100. package/dist/cjs/uikit/Slider/index.js +7 -0
  101. package/dist/cjs/uikit/Spacer/index.js +6 -0
  102. package/dist/cjs/uikit/Switch/index.js +6 -0
  103. package/dist/cjs/uikit/TabBar/index.js +12 -0
  104. package/dist/cjs/uikit/TextArea/index.js +13 -0
  105. package/dist/cjs/uikit/Textfield/index.js +13 -0
  106. package/dist/cjs/uikit/Tip/index.js +7 -0
  107. package/dist/cjs/uikit/Toast/index.js +16 -0
  108. package/dist/cjs/uikit/UploadArea/index.js +15 -0
  109. package/dist/cjs/workers/uploads/uploads.js +5 -0
  110. package/dist/esm/chunks/Avatar-D_W5zErj.mjs +60 -0
  111. package/dist/esm/chunks/AvatarGroup-Dbfmz0Yz.mjs +45 -0
  112. package/dist/esm/chunks/Badge-BISGWj5-.mjs +29 -0
  113. package/dist/esm/chunks/Button-B_aIY6wE.mjs +264 -0
  114. package/dist/esm/chunks/ButtonBar-Cr6TFvvD.mjs +66 -0
  115. package/dist/esm/chunks/Card-BzKBF0ny.mjs +45 -0
  116. package/dist/esm/chunks/CheckBox-CYggPKaT.mjs +68 -0
  117. package/dist/esm/chunks/Chip-B3wb9g1U.mjs +96 -0
  118. package/dist/esm/chunks/DivInput-_VL6PAqT.mjs +114 -0
  119. package/dist/esm/chunks/DocIcons-BxtcXsWI.mjs +114 -0
  120. package/dist/esm/chunks/Dot-C-Xu24wF.mjs +81 -0
  121. package/dist/esm/chunks/DrggablePanel-Bg3UKK1k.mjs +214 -0
  122. package/dist/esm/chunks/DropDown-D7KyGLkM.mjs +114 -0
  123. package/dist/esm/chunks/ErrorSummary-CZw06dSh.mjs +68 -0
  124. package/dist/esm/chunks/FileIcon-BcIJzIwA.mjs +233 -0
  125. package/dist/esm/chunks/FileList-DUzgHfE-.mjs +229 -0
  126. package/dist/esm/chunks/FlexDiv-BLYDgWu2.mjs +73 -0
  127. package/dist/esm/chunks/Grouper-CRldBHSw.mjs +75 -0
  128. package/dist/esm/chunks/IconButton-BBiZrXlS.mjs +93 -0
  129. package/dist/esm/chunks/Label-DPIAVkn1.mjs +124 -0
  130. package/dist/esm/chunks/Logos-CpcaarOG.mjs +493 -0
  131. package/dist/esm/chunks/Overlay-Bh0enFIe.mjs +44 -0
  132. package/dist/esm/chunks/Pager-B-1ZRUzU.mjs +45 -0
  133. package/dist/esm/chunks/ProgressIndicator-CNOBQ_Fv.mjs +167 -0
  134. package/dist/esm/chunks/PromptInput-DdsIgZ3T.mjs +160 -0
  135. package/dist/esm/chunks/RadioButton-D-TdQu3a.mjs +66 -0
  136. package/dist/esm/chunks/RadioButtonList-CEScWkbT.mjs +67 -0
  137. package/dist/esm/chunks/Slider-C3A8GCfH.mjs +142 -0
  138. package/dist/esm/chunks/Spacer-BlgEdKEM.mjs +20 -0
  139. package/dist/esm/chunks/Switch-obpmvCGd.mjs +45 -0
  140. package/dist/esm/chunks/TabBar-DFj021UP.mjs +141 -0
  141. package/dist/esm/chunks/TextArea-D_hq6VF3.mjs +90 -0
  142. package/dist/esm/chunks/TextField-Co0u-xdd.mjs +222 -0
  143. package/dist/esm/chunks/Tip-CHQh-Yq0.mjs +98 -0
  144. package/dist/esm/chunks/Toast-BiXzVFtM.mjs +179 -0
  145. package/dist/esm/chunks/UploadArea-B9685Z06.mjs +133 -0
  146. package/dist/esm/chunks/_types-KZDzhaiK.mjs +1395 -0
  147. package/dist/esm/chunks/sharedTypes-tn9-uJvb.mjs +8 -0
  148. package/dist/esm/chunks/style-inject.es-D0BjEaN8.mjs +11 -0
  149. package/dist/esm/chunks/tipStore-CL5a95Bl.mjs +15 -0
  150. package/dist/esm/chunks/toastStore-D2PEIqCo.mjs +15 -0
  151. package/dist/esm/chunks/tslib.es6-c-7TIv71.mjs +53 -0
  152. package/dist/esm/chunks/uploads-worker-Dv-4zGnC.mjs +224 -0
  153. package/dist/esm/chunks/uploadsStore-D69fEXMY.mjs +72 -0
  154. package/dist/esm/chunks/utils-BQ1v7VE4.mjs +74 -0
  155. package/dist/esm/chunks/windowStore-CwW0i_le.mjs +71 -0
  156. package/dist/esm/hooks/useDoubleClick.mjs +14 -0
  157. package/dist/esm/hooks/useKeyboardShortcuts.mjs +27 -0
  158. package/dist/esm/hooks/useLastUpdated.mjs +31 -0
  159. package/dist/esm/hooks/useLocalStore.mjs +36 -0
  160. package/dist/esm/hooks/useObserveResize.mjs +38 -0
  161. package/dist/esm/hooks/useObserveTheme.mjs +34 -0
  162. package/dist/esm/hooks/useTheme.mjs +73 -0
  163. package/dist/esm/hooks/useToolTip.mjs +23 -0
  164. package/dist/esm/hooks/useTrackRenders.mjs +23 -0
  165. package/dist/esm/hooks/useWindow.mjs +52 -0
  166. package/dist/esm/hooks.mjs +29 -0
  167. package/dist/esm/index.mjs +117 -0
  168. package/dist/esm/providers/ThemeProvider.mjs +49 -0
  169. package/dist/esm/providers.mjs +15 -0
  170. package/dist/esm/stores/tip.mjs +3 -0
  171. package/dist/esm/stores/toast.mjs +3 -0
  172. package/dist/esm/stores/uploads.mjs +7 -0
  173. package/dist/esm/stores/window.mjs +3 -0
  174. package/dist/esm/stores.mjs +13 -0
  175. package/dist/esm/theme/colors.mjs +373 -0
  176. package/dist/esm/theme/corners.mjs +12 -0
  177. package/dist/esm/theme/elevations.mjs +15 -0
  178. package/dist/esm/theme/themes.mjs +25 -0
  179. package/dist/esm/theme/type.mjs +236 -0
  180. package/dist/esm/theme.mjs +9 -0
  181. package/dist/esm/uikit/Avatar/index.mjs +9 -0
  182. package/dist/esm/uikit/AvatarGroup/index.mjs +11 -0
  183. package/dist/esm/uikit/Badge/index.mjs +9 -0
  184. package/dist/esm/uikit/Button/index.mjs +39 -0
  185. package/dist/esm/uikit/ButtonBar/index.mjs +39 -0
  186. package/dist/esm/uikit/Card/index.mjs +29 -0
  187. package/dist/esm/uikit/CheckBox/index.mjs +31 -0
  188. package/dist/esm/uikit/Chip/index.mjs +31 -0
  189. package/dist/esm/uikit/DivInput/index.mjs +13 -0
  190. package/dist/esm/uikit/DocIcon/index.mjs +23 -0
  191. package/dist/esm/uikit/Dot/index.mjs +11 -0
  192. package/dist/esm/uikit/DraggablePanel/index.mjs +29 -0
  193. package/dist/esm/uikit/DropDown/index.mjs +29 -0
  194. package/dist/esm/uikit/ErrorSummary/index.mjs +11 -0
  195. package/dist/esm/uikit/FileIcon/index.mjs +25 -0
  196. package/dist/esm/uikit/FileList/index.mjs +35 -0
  197. package/dist/esm/uikit/FlexDiv/index.mjs +11 -0
  198. package/dist/esm/uikit/Grouper/index.mjs +33 -0
  199. package/dist/esm/uikit/Icon/index.mjs +25 -0
  200. package/dist/esm/uikit/IconButton/index.mjs +37 -0
  201. package/dist/esm/uikit/Label/index.mjs +27 -0
  202. package/dist/esm/uikit/Logos/index.mjs +23 -0
  203. package/dist/esm/uikit/Overlay/index.mjs +11 -0
  204. package/dist/esm/uikit/Pager/index.mjs +11 -0
  205. package/dist/esm/uikit/Progress/index.mjs +27 -0
  206. package/dist/esm/uikit/PromptInput/index.mjs +45 -0
  207. package/dist/esm/uikit/RadioButton/index.mjs +39 -0
  208. package/dist/esm/uikit/RadioButtonList/index.mjs +41 -0
  209. package/dist/esm/uikit/Slider/index.mjs +13 -0
  210. package/dist/esm/uikit/Spacer/index.mjs +7 -0
  211. package/dist/esm/uikit/Switch/index.mjs +11 -0
  212. package/dist/esm/uikit/TabBar/index.mjs +39 -0
  213. package/dist/esm/uikit/TextArea/index.mjs +41 -0
  214. package/dist/esm/uikit/Textfield/index.mjs +43 -0
  215. package/dist/esm/uikit/Tip/index.mjs +13 -0
  216. package/dist/esm/uikit/Toast/index.mjs +31 -0
  217. package/dist/esm/uikit/UploadArea/index.mjs +37 -0
  218. package/dist/esm/workers/uploads/uploads.mjs +5 -0
  219. package/dist/types/index.d.ts +3 -0
  220. package/dist/types/stores/index.d.ts +1 -0
  221. package/dist/types/stores/uploads/_types.d.ts +16 -0
  222. package/dist/types/stores/uploads/index.d.ts +2 -0
  223. package/dist/types/stores/uploads/uploadsStore.d.ts +22 -0
  224. package/dist/types/uikit/FileList/_types.d.ts +1 -0
  225. package/dist/types/uikit/UploadArea/UploadArea.d.ts +54 -0
  226. package/dist/types/uikit/UploadArea/_types.d.ts +46 -0
  227. package/dist/types/uikit/UploadArea/index.d.ts +3 -0
  228. package/dist/types/util/utils.d.ts +4 -0
  229. package/dist/types/workers/uploads/uploads-worker.d.ts +129 -0
  230. package/dist/types/workers/uploads/uploads.d.ts +1 -0
  231. package/dist/types/workers/uploads/uploads.runtime.d.ts +1 -0
  232. package/package.json +23 -17
  233. package/dist/cjs/chunks/Avatar-z2YcOAoP.js +0 -68
  234. package/dist/cjs/chunks/AvatarGroup-Cz8369zI.js +0 -39
  235. package/dist/cjs/chunks/Badge-COSg__VJ.js +0 -41
  236. package/dist/cjs/chunks/Button-BNXqiA13.js +0 -312
  237. package/dist/cjs/chunks/ButtonBar-CeDdAOlH.js +0 -58
  238. package/dist/cjs/chunks/Card-Cc_c-S7i.js +0 -36
  239. package/dist/cjs/chunks/CheckBox-hTWIPqV_.js +0 -76
  240. package/dist/cjs/chunks/Chip-CLKVldi4.js +0 -93
  241. package/dist/cjs/chunks/DivInput-DnY2emt-.js +0 -204
  242. package/dist/cjs/chunks/DocIcons-BRWOzK96.js +0 -41
  243. package/dist/cjs/chunks/Dot-B5dO8kSS.js +0 -80
  244. package/dist/cjs/chunks/DrggablePanel-BtsURL9o.js +0 -302
  245. package/dist/cjs/chunks/DropDown-COr9u96t.js +0 -154
  246. package/dist/cjs/chunks/ErrorSummary-BrSHbGpk.js +0 -42
  247. package/dist/cjs/chunks/FileIcon-CEMQK_Je.js +0 -132
  248. package/dist/cjs/chunks/FileList-DWIm4o46.js +0 -163
  249. package/dist/cjs/chunks/FlexDiv-BHl29ywz.js +0 -103
  250. package/dist/cjs/chunks/Grouper-EyHoeA8w.js +0 -50
  251. package/dist/cjs/chunks/IconButton-9QZ4eKBZ.js +0 -84
  252. package/dist/cjs/chunks/Label-DZJ_YDtD.js +0 -134
  253. package/dist/cjs/chunks/Logos-DSlAUz8l.js +0 -119
  254. package/dist/cjs/chunks/Overlay-DV3C5NDO.js +0 -45
  255. package/dist/cjs/chunks/Pager-CRjpl1FZ.js +0 -42
  256. package/dist/cjs/chunks/ProgressIndicator-BAwAaw58.js +0 -121
  257. package/dist/cjs/chunks/PromptInput-DmO8a3oX.js +0 -212
  258. package/dist/cjs/chunks/RadioButton-DA9YUGEF.js +0 -65
  259. package/dist/cjs/chunks/RadioButtonList-BtsT7GJc.js +0 -116
  260. package/dist/cjs/chunks/Slider-CqrIwn-L.js +0 -285
  261. package/dist/cjs/chunks/Spacer-BEY2-_PB.js +0 -16
  262. package/dist/cjs/chunks/Switch-CtkFtogd.js +0 -43
  263. package/dist/cjs/chunks/TabBar-WsNlr-aZ.js +0 -176
  264. package/dist/cjs/chunks/TextArea-BMJWUH2H.js +0 -153
  265. package/dist/cjs/chunks/TextField-mfwz79cD.js +0 -248
  266. package/dist/cjs/chunks/Tip-Af6FMEDi.js +0 -91
  267. package/dist/cjs/chunks/Toast-CxAEOW4z.js +0 -158
  268. package/dist/cjs/chunks/_types-BNlHsGMQ.js +0 -714
  269. package/dist/cjs/chunks/sharedTypes-BvTjh6M5.js +0 -9
  270. package/dist/cjs/chunks/style-inject.es-XZHJH68X.js +0 -30
  271. package/dist/cjs/chunks/tipStore-C9oV9SIh.js +0 -23
  272. package/dist/cjs/chunks/toastStore-C-ETP9H6.js +0 -23
  273. package/dist/cjs/chunks/tslib.es6-4H29ixHs.js +0 -48
  274. package/dist/cjs/chunks/utils-BwNacfBU.js +0 -128
  275. package/dist/cjs/chunks/windowStore-CPcVHJq6.js +0 -93
  276. package/dist/cjs/uikit/Avatar.js +0 -11
  277. package/dist/cjs/uikit/AvatarGroup.js +0 -12
  278. package/dist/cjs/uikit/Badge.js +0 -11
  279. package/dist/cjs/uikit/Button.js +0 -26
  280. package/dist/cjs/uikit/ButtonBar.js +0 -26
  281. package/dist/cjs/uikit/Card.js +0 -21
  282. package/dist/cjs/uikit/CheckBox.js +0 -22
  283. package/dist/cjs/uikit/Chip.js +0 -22
  284. package/dist/cjs/uikit/DivInput.js +0 -13
  285. package/dist/cjs/uikit/DocIcon.js +0 -18
  286. package/dist/cjs/uikit/Dot.js +0 -12
  287. package/dist/cjs/uikit/DraggablePanel.js +0 -21
  288. package/dist/cjs/uikit/DropDown.js +0 -21
  289. package/dist/cjs/uikit/ErrorSummary.js +0 -12
  290. package/dist/cjs/uikit/FileIcon.js +0 -23
  291. package/dist/cjs/uikit/FileList.js +0 -24
  292. package/dist/cjs/uikit/FlexDiv.js +0 -12
  293. package/dist/cjs/uikit/Grouper.js +0 -23
  294. package/dist/cjs/uikit/Icon.js +0 -23
  295. package/dist/cjs/uikit/IconButton.js +0 -25
  296. package/dist/cjs/uikit/Label.js +0 -20
  297. package/dist/cjs/uikit/Logos.js +0 -18
  298. package/dist/cjs/uikit/Overlay.js +0 -12
  299. package/dist/cjs/uikit/Pager.js +0 -12
  300. package/dist/cjs/uikit/Progress.js +0 -21
  301. package/dist/cjs/uikit/PromptInput.js +0 -29
  302. package/dist/cjs/uikit/RadioButton.js +0 -26
  303. package/dist/cjs/uikit/RadioButtonList.js +0 -27
  304. package/dist/cjs/uikit/Slider.js +0 -13
  305. package/dist/cjs/uikit/Spacer.js +0 -10
  306. package/dist/cjs/uikit/Switch.js +0 -12
  307. package/dist/cjs/uikit/TabBar.js +0 -26
  308. package/dist/cjs/uikit/TextArea.js +0 -27
  309. package/dist/cjs/uikit/Textfield.js +0 -28
  310. package/dist/cjs/uikit/Tip.js +0 -13
  311. package/dist/cjs/uikit/Toast.js +0 -26
  312. package/dist/esm/chunks/Avatar-BtkvMV1v.js +0 -66
  313. package/dist/esm/chunks/AvatarGroup-pbqdS56o.js +0 -37
  314. package/dist/esm/chunks/Badge-DtxDLSO0.js +0 -39
  315. package/dist/esm/chunks/Button-BUJkJqdO.js +0 -310
  316. package/dist/esm/chunks/ButtonBar-Bl0oCxd8.js +0 -56
  317. package/dist/esm/chunks/Card-Bjk0kgQh.js +0 -34
  318. package/dist/esm/chunks/CheckBox-CvkZuSeB.js +0 -74
  319. package/dist/esm/chunks/Chip-o-YG_HAf.js +0 -91
  320. package/dist/esm/chunks/DivInput-D6ORPrkT.js +0 -202
  321. package/dist/esm/chunks/DocIcons-CbOX4n8Y.js +0 -39
  322. package/dist/esm/chunks/Dot-BZcEZbnm.js +0 -78
  323. package/dist/esm/chunks/DrggablePanel-DWrTjXvf.js +0 -300
  324. package/dist/esm/chunks/DropDown-BDIvYWI-.js +0 -152
  325. package/dist/esm/chunks/ErrorSummary-DzDnacH0.js +0 -40
  326. package/dist/esm/chunks/FileIcon-Cxh-QsYb.js +0 -130
  327. package/dist/esm/chunks/FileList-yo_u1Kvw.js +0 -161
  328. package/dist/esm/chunks/FlexDiv-CFyndG99.js +0 -101
  329. package/dist/esm/chunks/Grouper-NJbpaaQG.js +0 -48
  330. package/dist/esm/chunks/IconButton-3m9ugITV.js +0 -82
  331. package/dist/esm/chunks/Label-CgntsR3g.js +0 -132
  332. package/dist/esm/chunks/Logos-DwZP-TR2.js +0 -117
  333. package/dist/esm/chunks/Overlay-BolsHW9S.js +0 -43
  334. package/dist/esm/chunks/Pager-BHLyXq9p.js +0 -40
  335. package/dist/esm/chunks/ProgressIndicator-uI9BZwBB.js +0 -118
  336. package/dist/esm/chunks/PromptInput-C_qj6kGp.js +0 -210
  337. package/dist/esm/chunks/RadioButton-D8otD_Jj.js +0 -63
  338. package/dist/esm/chunks/RadioButtonList-CtX1j7rO.js +0 -114
  339. package/dist/esm/chunks/Slider-O6UelMjh.js +0 -283
  340. package/dist/esm/chunks/Spacer-DbZSG5x3.js +0 -14
  341. package/dist/esm/chunks/Switch-DjfrSiQz.js +0 -41
  342. package/dist/esm/chunks/TabBar-C0NgwRa2.js +0 -174
  343. package/dist/esm/chunks/TextArea-DK0giDGR.js +0 -151
  344. package/dist/esm/chunks/TextField-CQ4XYYNm.js +0 -246
  345. package/dist/esm/chunks/Tip-iFECDhwN.js +0 -89
  346. package/dist/esm/chunks/Toast-ZxMZtbd0.js +0 -156
  347. package/dist/esm/chunks/_types-RJ7q8S0B.js +0 -712
  348. package/dist/esm/chunks/sharedTypes-BfZzG1KX.js +0 -9
  349. package/dist/esm/chunks/style-inject.es-tgCJW-Cu.js +0 -28
  350. package/dist/esm/chunks/tipStore-nBYJ6tmE.js +0 -17
  351. package/dist/esm/chunks/toastStore-r3pvNa28.js +0 -17
  352. package/dist/esm/chunks/tslib.es6-0pkUdtrF.js +0 -45
  353. package/dist/esm/chunks/utils-CZ1LWeN6.js +0 -121
  354. package/dist/esm/chunks/windowStore-Cu4W4zJM.js +0 -91
  355. package/dist/esm/hooks/useDoubleClick.js +0 -24
  356. package/dist/esm/hooks/useKeyboardShortcuts.js +0 -42
  357. package/dist/esm/hooks/useLastUpdated.js +0 -51
  358. package/dist/esm/hooks/useLocalStore.js +0 -50
  359. package/dist/esm/hooks/useObserveResize.js +0 -54
  360. package/dist/esm/hooks/useObserveTheme.js +0 -41
  361. package/dist/esm/hooks/useTheme.js +0 -84
  362. package/dist/esm/hooks/useToolTip.js +0 -34
  363. package/dist/esm/hooks/useTrackRenders.js +0 -37
  364. package/dist/esm/hooks/useWindow.js +0 -84
  365. package/dist/esm/hooks.js +0 -15
  366. package/dist/esm/index.js +0 -58
  367. package/dist/esm/providers/ThemeProvider.js +0 -56
  368. package/dist/esm/providers.js +0 -8
  369. package/dist/esm/stores/tip.js +0 -2
  370. package/dist/esm/stores/toast.js +0 -2
  371. package/dist/esm/stores/window.js +0 -2
  372. package/dist/esm/stores.js +0 -4
  373. package/dist/esm/theme/colors.js +0 -377
  374. package/dist/esm/theme/corners.js +0 -12
  375. package/dist/esm/theme/elevations.js +0 -15
  376. package/dist/esm/theme/themes.js +0 -23
  377. package/dist/esm/theme/type.js +0 -393
  378. package/dist/esm/theme.js +0 -5
  379. package/dist/esm/uikit/Avatar.js +0 -5
  380. package/dist/esm/uikit/AvatarGroup.js +0 -6
  381. package/dist/esm/uikit/Badge.js +0 -5
  382. package/dist/esm/uikit/Button.js +0 -20
  383. package/dist/esm/uikit/ButtonBar.js +0 -20
  384. package/dist/esm/uikit/Card.js +0 -15
  385. package/dist/esm/uikit/CheckBox.js +0 -16
  386. package/dist/esm/uikit/Chip.js +0 -16
  387. package/dist/esm/uikit/DivInput.js +0 -7
  388. package/dist/esm/uikit/DocIcon.js +0 -12
  389. package/dist/esm/uikit/Dot.js +0 -6
  390. package/dist/esm/uikit/DraggablePanel.js +0 -15
  391. package/dist/esm/uikit/DropDown.js +0 -15
  392. package/dist/esm/uikit/ErrorSummary.js +0 -6
  393. package/dist/esm/uikit/FileIcon.js +0 -13
  394. package/dist/esm/uikit/FileList.js +0 -18
  395. package/dist/esm/uikit/FlexDiv.js +0 -6
  396. package/dist/esm/uikit/Grouper.js +0 -17
  397. package/dist/esm/uikit/Icon.js +0 -13
  398. package/dist/esm/uikit/IconButton.js +0 -19
  399. package/dist/esm/uikit/Label.js +0 -14
  400. package/dist/esm/uikit/Logos.js +0 -12
  401. package/dist/esm/uikit/Overlay.js +0 -6
  402. package/dist/esm/uikit/Pager.js +0 -6
  403. package/dist/esm/uikit/Progress.js +0 -14
  404. package/dist/esm/uikit/PromptInput.js +0 -23
  405. package/dist/esm/uikit/RadioButton.js +0 -20
  406. package/dist/esm/uikit/RadioButtonList.js +0 -21
  407. package/dist/esm/uikit/Slider.js +0 -7
  408. package/dist/esm/uikit/Spacer.js +0 -4
  409. package/dist/esm/uikit/Switch.js +0 -6
  410. package/dist/esm/uikit/TabBar.js +0 -20
  411. package/dist/esm/uikit/TextArea.js +0 -21
  412. package/dist/esm/uikit/Textfield.js +0 -22
  413. package/dist/esm/uikit/Tip.js +0 -7
  414. package/dist/esm/uikit/Toast.js +0 -16
@@ -0,0 +1,8 @@
1
+ var ToolTipType;
2
+
3
+ !function(ToolTipType) {
4
+ ToolTipType.menu = "menu", ToolTipType.button = "button", ToolTipType.general = "general",
5
+ ToolTipType.other = "other";
6
+ }(ToolTipType || (ToolTipType = {}));
7
+
8
+ export { ToolTipType as T };
@@ -0,0 +1,11 @@
1
+ function styleInject(css, ref) {
2
+ void 0 === ref && (ref = {});
3
+ var insertAt = ref.insertAt;
4
+ if (css && "undefined" != typeof document) {
5
+ var head = document.head || document.getElementsByTagName("head")[0], style = document.createElement("style");
6
+ style.type = "text/css", "top" === insertAt && head.firstChild ? head.insertBefore(style, head.firstChild) : head.appendChild(style),
7
+ style.styleSheet ? style.styleSheet.cssText = css : style.appendChild(document.createTextNode(css));
8
+ }
9
+ }
10
+
11
+ export { styleInject as s };
@@ -0,0 +1,15 @@
1
+ import { create } from "zustand";
2
+
3
+ const useTipStore = create(set => ({
4
+ tip: null,
5
+ actions: {
6
+ push: tip => set({
7
+ tip: tip
8
+ }),
9
+ clear: () => set({
10
+ tip: null
11
+ })
12
+ }
13
+ })), useTip = () => useTipStore(state => state.tip), useTipActions = () => useTipStore(state => state.actions), tipActions = useTipStore.getState().actions, getTip = () => useTipStore.getState().tip;
14
+
15
+ export { useTipActions as a, useTipStore as b, getTip as g, tipActions as t, useTip as u };
@@ -0,0 +1,15 @@
1
+ import { create } from "zustand";
2
+
3
+ const useToastStore = create(set => ({
4
+ toast: null,
5
+ actions: {
6
+ push: toast => set({
7
+ toast: toast
8
+ }),
9
+ clear: () => set({
10
+ toast: null
11
+ })
12
+ }
13
+ })), useToast = () => useToastStore(state => state.toast), useToastActions = () => useToastStore(state => state.actions), toastActions = useToastStore.getState().actions, getToast = () => useToastStore.getState().toast;
14
+
15
+ export { useToastActions as a, useToastStore as b, getToast as g, toastActions as t, useToast as u };
@@ -0,0 +1,53 @@
1
+ /******************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
15
+ function __rest(s, e) {
16
+ var t = {};
17
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
18
+ if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
19
+ var i = 0;
20
+ for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
21
+ }
22
+ return t;
23
+ }
24
+
25
+ function __awaiter(thisArg, _arguments, P, generator) {
26
+ return new (P || (P = Promise))(function(resolve, reject) {
27
+ function fulfilled(value) {
28
+ try {
29
+ step(generator.next(value));
30
+ } catch (e) {
31
+ reject(e);
32
+ }
33
+ }
34
+ function rejected(value) {
35
+ try {
36
+ step(generator.throw(value));
37
+ } catch (e) {
38
+ reject(e);
39
+ }
40
+ }
41
+ function step(result) {
42
+ var value;
43
+ result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P(function(resolve) {
44
+ resolve(value);
45
+ })).then(fulfilled, rejected);
46
+ }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ }
50
+
51
+ "function" == typeof SuppressedError && SuppressedError;
52
+
53
+ export { __rest as _, __awaiter as a };
@@ -0,0 +1,224 @@
1
+ import { a as __awaiter } from "./tslib.es6-c-7TIv71.mjs";
2
+
3
+ var FileUploadStatus, UploadError, WorkerStatus;
4
+
5
+ !function(FileUploadStatus) {
6
+ FileUploadStatus.queued = "pending", FileUploadStatus.uploading = "uploading", FileUploadStatus.completed = "completed",
7
+ FileUploadStatus.failed = "failed";
8
+ }(FileUploadStatus || (FileUploadStatus = {})), function(UploadError) {
9
+ UploadError.SizeExceedsLimit = "size exceed limit", UploadError.TypeNotAllowed = "file type not allowed",
10
+ UploadError.UploadFailed = "upload failed", UploadError.UploadURLNotFound = "invalid upload url",
11
+ UploadError.AccessForbidden = "upload access forbidden", UploadError.NotAuthorized = "upload not authorized on server",
12
+ UploadError.TooLarge = "payload too large for server", UploadError.MediaNotSupported = "server does not supported file type",
13
+ UploadError.InternalError = "Internal server error", UploadError.Other = "Other server error";
14
+ }(UploadError || (UploadError = {})), function(WorkerStatus) {
15
+ WorkerStatus.Idle = "idle", WorkerStatus.Busy = "busy";
16
+ }(WorkerStatus || (WorkerStatus = {}));
17
+
18
+ class UploadWorkerClient {
19
+ constructor(target, getWorkerStatus) {
20
+ this.target = target, this.getWorkerStatus = getWorkerStatus;
21
+ }
22
+ updateStatus(status) {
23
+ this.target.postMessage({
24
+ type: "status",
25
+ uploads: status,
26
+ workerStatus: this.getWorkerStatus()
27
+ });
28
+ }
29
+ }
30
+
31
+ class UploadsWorker {
32
+ constructor(options, worker) {
33
+ this.queue = new Map, this.active = new Map, this.completed = new Map, this.failed = new Map,
34
+ this.workerStatus = WorkerStatus.Idle;
35
+ const {uploadURL: uploadURL, maxQueueSize: maxQueueSize = 5, accepted: accepted = [], maxConcurrentUploads: maxConcurrentUploads = 5, maxFileSize: maxFileSize = 5242880} = options;
36
+ this.uploadURL = uploadURL, this.maxQueueSize = maxQueueSize, this.maxConcurrentUploads = maxConcurrentUploads,
37
+ this.accepted = accepted, this.maxFileSize = maxFileSize, this.worker = null != worker ? worker : new UploadWorkerClient(globalThis, () => this.workerStatus);
38
+ }
39
+ /**
40
+ * Add new files to the upload queue
41
+ */ addFiles(file) {
42
+ const uploads = Array.isArray(file) ? file : [ file ];
43
+ for (const item of uploads) {
44
+ if (this.queue.size + this.active.size >= this.maxQueueSize) break;
45
+ const uploadItem = item instanceof File ? {
46
+ file: item
47
+ } : item, uploadInfo = {
48
+ id: crypto.randomUUID(),
49
+ file: uploadItem.file,
50
+ uploadURL: uploadItem.uploadURL,
51
+ status: FileUploadStatus.queued
52
+ };
53
+ this.queue.set(uploadInfo.id, uploadInfo), this.notifyStatus();
54
+ }
55
+ this.process();
56
+ }
57
+ /**
58
+ * Stop activity and flush all maps / data
59
+ */ clearUploads() {
60
+ this.queue.clear(), this.active.clear(), this.completed.clear(), this.failed.clear(),
61
+ this.notifyStatus();
62
+ }
63
+ /**
64
+ * Start the processing files in the upload queue
65
+ */ process() {
66
+ if (0 === this.queue.size && 0 === this.active.size) return this.workerStatus = WorkerStatus.Idle,
67
+ void this.notifyStatus();
68
+ for (this.workerStatus = WorkerStatus.Busy, this.notifyStatus(); this.active.size < this.maxConcurrentUploads && this.queue.size > 0; ) {
69
+ const nextUpload = this.queue.values().next().value;
70
+ if (!nextUpload) break;
71
+ this.startUpload(nextUpload);
72
+ }
73
+ }
74
+ get status() {
75
+ return this.workerStatus;
76
+ }
77
+ startUpload(upload) {
78
+ return __awaiter(this, void 0, void 0, function*() {
79
+ try {
80
+ if (upload.file.size > this.maxFileSize) throw new Error(UploadError.SizeExceedsLimit);
81
+ const ext = upload.file.name.split(".").pop(), mime = upload.file.type, filter = this.accepted.length > 0, accepted = this.accepted.includes(null != ext ? ext : "") || this.accepted.includes(null != mime ? mime : "");
82
+ if (filter && !accepted) throw new Error(UploadError.TypeNotAllowed);
83
+ upload.status = FileUploadStatus.uploading, upload.progress = 0, this.queue.delete(upload.id),
84
+ this.updateUploadStatus(upload), this.notifyStatus();
85
+ if (!(yield this.uploadFile(upload))) throw new Error(UploadError.UploadFailed);
86
+ upload.status = FileUploadStatus.completed, upload.progress = 100, this.updateUploadStatus(upload),
87
+ this.completed.set(upload.id, upload), this.notifyStatus();
88
+ } catch (error) {
89
+ const message = error instanceof Error ? error.message : "Unknown error";
90
+ switch (message) {
91
+ case UploadError.SizeExceedsLimit:
92
+ case UploadError.TypeNotAllowed:
93
+ case UploadError.UploadFailed:
94
+ case UploadError.InternalError:
95
+ case UploadError.UploadURLNotFound:
96
+ case UploadError.TooLarge:
97
+ case UploadError.AccessForbidden:
98
+ case UploadError.NotAuthorized:
99
+ case UploadError.MediaNotSupported:
100
+ case UploadError.Other:
101
+ upload.error = message;
102
+ break;
103
+
104
+ default:
105
+ console.warn(error), upload.error = UploadError.Other;
106
+ }
107
+ upload.status = FileUploadStatus.failed, this.updateUploadStatus(upload), this.failed.set(upload.id, upload),
108
+ this.notifyStatus();
109
+ } finally {
110
+ this.queue.delete(upload.id), this.active.delete(upload.id), 0 === this.queue.size && 0 === this.active.size ? (this.workerStatus = WorkerStatus.Idle,
111
+ this.notifyStatus()) : this.process();
112
+ }
113
+ });
114
+ }
115
+ /**
116
+ * perform the actual upload
117
+ */ uploadFile(upload) {
118
+ return __awaiter(this, void 0, void 0, function*() {
119
+ const formData = new FormData;
120
+ return formData.append("file", upload.file), new Promise((resolve, reject) => {
121
+ var _a;
122
+ const request = new XMLHttpRequest;
123
+ request.upload.addEventListener("progress", event => {
124
+ event.lengthComputable && 0 !== event.total && (upload.progress = Math.round(event.loaded / event.total * 100),
125
+ this.updateUploadStatus(upload));
126
+ }), request.addEventListener("load", () => {
127
+ let error;
128
+ if (request.status > 300 || request.status < 200) {
129
+ switch (request.status) {
130
+ case 400:
131
+ error = UploadError.UploadFailed;
132
+ break;
133
+
134
+ case 401:
135
+ error = UploadError.NotAuthorized;
136
+ break;
137
+
138
+ case 403:
139
+ error = UploadError.AccessForbidden;
140
+ break;
141
+
142
+ case 404:
143
+ error = UploadError.UploadURLNotFound;
144
+ break;
145
+
146
+ case 413:
147
+ error = UploadError.TooLarge;
148
+ break;
149
+
150
+ case 415:
151
+ error = UploadError.MediaNotSupported;
152
+ break;
153
+
154
+ case 500:
155
+ error = UploadError.InternalError;
156
+ break;
157
+
158
+ default:
159
+ error = UploadError.Other;
160
+ }
161
+ reject(new Error(error));
162
+ }
163
+ resolve(!0);
164
+ }), request.addEventListener("error", e => {
165
+ reject(new Error(UploadError.UploadFailed));
166
+ }), request.addEventListener("abort", () => {
167
+ reject(new Error(UploadError.UploadFailed));
168
+ }), request.open("POST", null !== (_a = upload.uploadURL) && void 0 !== _a ? _a : this.uploadURL),
169
+ request.send(formData);
170
+ });
171
+ });
172
+ }
173
+ /**
174
+ * Update the active upload with new data
175
+ */ updateUploadStatus(upload, updates = {}) {
176
+ const updated = Object.assign(Object.assign({}, upload), updates);
177
+ this.active.set(upload.id, updated), this.notifyStatus();
178
+ }
179
+ /**
180
+ * Create array with the current state of all uploads
181
+ */ currentStatus() {
182
+ return [ ...this.queue.values(), ...this.active.values(), ...this.completed.values(), ...this.failed.values() ];
183
+ }
184
+ /**
185
+ * Push status updates to the web worker
186
+ */ notifyStatus() {
187
+ this.worker.updateStatus(this.currentStatus());
188
+ }
189
+ }
190
+
191
+ class UploadsWorkerRuntime {
192
+ constructor(target) {
193
+ this.target = target, this.uploads = null, this.target.onmessage = event => {
194
+ this.handleMessage(event.data);
195
+ };
196
+ }
197
+ handleMessage(message) {
198
+ switch (message.type) {
199
+ case "initialize":
200
+ return void (this.uploads = new UploadsWorker(message.options, new UploadWorkerClient(this.target, () => this.getWorkerStatus())));
201
+
202
+ case "add-files":
203
+ return this.uploads ? void this.uploads.addFiles(message.files) : void this.postError("Uploads worker has not been initialized.");
204
+
205
+ case "clear-uploads":
206
+ return this.uploads ? void this.uploads.clearUploads() : void this.postError("Uploads worker has not been initialized.");
207
+ }
208
+ }
209
+ getWorkerStatus() {
210
+ return this.uploads ? this.uploads.status : WorkerStatus.Idle;
211
+ }
212
+ postError(message) {
213
+ this.target.postMessage({
214
+ type: "error",
215
+ message: message
216
+ });
217
+ }
218
+ }
219
+
220
+ function registerUploadsWorker(target = globalThis) {
221
+ return new UploadsWorkerRuntime(target);
222
+ }
223
+
224
+ export { WorkerStatus as W, registerUploadsWorker as r };
@@ -0,0 +1,72 @@
1
+ import { create } from "zustand";
2
+
3
+ import { W as WorkerStatus } from "./uploads-worker-Dv-4zGnC.mjs";
4
+
5
+ let uploadsWorker = null;
6
+
7
+ function createUploadsWorker(workerUrl) {
8
+ return new Worker(null != workerUrl ? workerUrl : new URL("../../workers/uploads/uploads.ts", import.meta.url), {
9
+ type: "module"
10
+ });
11
+ }
12
+
13
+ const useUploadsStore = create((set, get) => ({
14
+ uploads: [],
15
+ workerStatus: WorkerStatus.Idle,
16
+ initialized: !1,
17
+ error: null,
18
+ actions: {
19
+ initialize: (options, worker) => (uploadsWorker || (uploadsWorker = worker, uploadsWorker.onmessage = handleWorkerMessage),
20
+ uploadsWorker.postMessage({
21
+ type: "initialize",
22
+ options: options
23
+ }), set({
24
+ initialized: !0,
25
+ error: null
26
+ }), uploadsWorker),
27
+ push: files => {
28
+ if (!uploadsWorker || !get().initialized) return;
29
+ const uploads = (Array.isArray(files) ? files : [ files ]).map(item => item instanceof File ? {
30
+ file: item
31
+ } : item);
32
+ uploadsWorker.postMessage({
33
+ type: "add-files",
34
+ files: uploads
35
+ });
36
+ },
37
+ reset: () => {
38
+ uploadsWorker && uploadsWorker.postMessage({
39
+ type: "clear-uploads"
40
+ }), set({
41
+ uploads: [],
42
+ workerStatus: WorkerStatus.Idle,
43
+ error: null
44
+ });
45
+ }
46
+ }
47
+ }));
48
+
49
+ function handleWorkerMessage(event) {
50
+ const message = event.data;
51
+ switch (message.type) {
52
+ case "status":
53
+ return void function(message) {
54
+ useUploadsStore.setState({
55
+ uploads: message.uploads,
56
+ workerStatus: message.workerStatus,
57
+ error: null
58
+ });
59
+ }(message);
60
+
61
+ case "error":
62
+ return void function(message) {
63
+ useUploadsStore.setState({
64
+ error: message.message
65
+ });
66
+ }(message);
67
+ }
68
+ }
69
+
70
+ const useUploads = () => useUploadsStore(state => state.uploads), useUploadsWorkerStatus = () => useUploadsStore(state => state.workerStatus), useUploadsInitialized = () => useUploadsStore(state => state.initialized), useUploadsError = () => useUploadsStore(state => state.error), useUploadsActions = () => useUploadsStore(state => state.actions), uploadsActions = useUploadsStore.getState().actions, getUploads = () => useUploadsStore.getState().uploads, getUploadsWorkerStatus = () => useUploadsStore.getState().workerStatus, uploadsInitialized = () => useUploadsStore.getState().initialized, getUploadsError = () => useUploadsStore.getState().error;
71
+
72
+ export { getUploadsError as a, getUploadsWorkerStatus as b, createUploadsWorker as c, uploadsInitialized as d, useUploads as e, useUploadsActions as f, getUploads as g, useUploadsError as h, useUploadsInitialized as i, useUploadsStore as j, useUploadsWorkerStatus as k, uploadsActions as u };
@@ -0,0 +1,74 @@
1
+ import "./tslib.es6-c-7TIv71.mjs";
2
+
3
+ /**
4
+ * Clean up string with html
5
+ */ function cleanString(input, removeInvisible = !0, removeHtml = !0) {
6
+ let clean = input;
7
+ if (clean = clean.replaceAll(/\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, ""),
8
+ removeInvisible) {
9
+ const invisibleRegEx = /[\r\n\t]/gi;
10
+ clean = clean.replaceAll(invisibleRegEx, "");
11
+ }
12
+ if (removeHtml) {
13
+ const htmlRegEx = /<\/?[a-z][^>]*>/gi;
14
+ clean = clean.replaceAll(htmlRegEx, "");
15
+ }
16
+ return clean;
17
+ }
18
+
19
+ /**
20
+ * Debug component rendering
21
+ * Code removed when built / deployed
22
+ */ function debug(previous, updated, name = "component") {
23
+ if ("test" === process.env.NODE_ENV) return;
24
+ const props = previous.current.props, mount = previous.current.mount, unmount = previous.current.unmount;
25
+ if (mount) ; else if (unmount) ; else {
26
+ (function(props, updated) {
27
+ const reasons = [];
28
+ for (const key of Object.keys(updated)) if (updated[key] !== props[key]) try {
29
+ const propName = `${key}:`, prev = JSON.stringify(props[key]), valueChanged = `${prev} > ${JSON.stringify(updated[key])}`;
30
+ reasons.push(`${propName} ${valueChanged}`);
31
+ } catch (error) {
32
+ let message = "Unknown error";
33
+ error instanceof Error && (message = error.message), "string" == typeof error && (message = error),
34
+ reasons.push(`${key} ${message}`);
35
+ }
36
+ }
37
+ /**
38
+ * Utility to accessibility - mimics click event with designated keys event
39
+ */)(props, updated);
40
+ }
41
+ return {
42
+ props: updated,
43
+ mount: !1,
44
+ unmount: !1
45
+ };
46
+ }
47
+
48
+ function accessibleKeyDown(e, clickFunction, keys) {
49
+ [ "Enter", " " ].includes(e.key) && (e.preventDefault(), clickFunction());
50
+ }
51
+
52
+ /**
53
+ * Get the pointer position from a DOM touch or mouse event
54
+ */ function pointerPosition(e) {
55
+ if (e.type.startsWith("touch")) {
56
+ return e.touches[0].clientX;
57
+ }
58
+ return e.clientX;
59
+ }
60
+
61
+ /**
62
+ * Filter and trim class name array
63
+ */ function filterClasses(classNames) {
64
+ return classNames.filter(item => "" !== item).join(" ").trim();
65
+ }
66
+
67
+ /**
68
+ * Takes a style string or number and returns a valid CSS style string
69
+ */ function setStyle(value, defaultVal = void 0) {
70
+ const useValue = null != value ? value : defaultVal;
71
+ return useValue ? "string" == typeof useValue ? useValue : `${useValue}px` : "unset";
72
+ }
73
+
74
+ export { accessibleKeyDown as a, cleanString as c, debug as d, filterClasses as f, pointerPosition as p, setStyle as s };
@@ -0,0 +1,71 @@
1
+ import { create } from "zustand";
2
+
3
+ /**
4
+ * Form factor names
5
+ */ var FormFactor;
6
+
7
+ !function(FormFactor) {
8
+ FormFactor.Mobile = "mobile", FormFactor.Tablet = "tablet", FormFactor.Desktop = "desktop",
9
+ FormFactor.DesktopL = "desktopL", FormFactor.DesktopXL = "desktopXL";
10
+ }(FormFactor || (FormFactor = {}));
11
+
12
+ /**
13
+ * Use bootstrap breakpoints
14
+ */
15
+ const bootstrapBreakPoints = {
16
+ [FormFactor.Mobile]: 576,
17
+ [FormFactor.Tablet]: 768,
18
+ [FormFactor.Desktop]: 992,
19
+ [FormFactor.DesktopL]: 1200,
20
+ [FormFactor.DesktopXL]: 1400
21
+ }, orderedBps = Object.entries(bootstrapBreakPoints).sort((a, b) => -b[1] - a[1]), getFormFactor = width => {
22
+ if (!width || width <= 0) return FormFactor.Mobile;
23
+ for (const [formFactor, breakpoint] of orderedBps) if (width >= breakpoint) return formFactor;
24
+ return FormFactor.Mobile;
25
+ }, initialSize = processWindowSize(), useWindowStore = create((set, get) => {
26
+ var _a;
27
+ return {
28
+ formFactor: initialSize.formFactor,
29
+ viewportWidth: initialSize.viewportWidth,
30
+ viewportHeight: initialSize.viewportHeight,
31
+ height: initialSize.height,
32
+ isElectron: checkElectron(),
33
+ isAppleDevice: navigator.platform.startsWith("Mac") || "iPhone" === navigator.platform,
34
+ isTouchDevice: "ontouchstart" in globalThis || navigator.maxTouchPoints > 0,
35
+ dpr: null !== (_a = Math.min(Math.ceil(window.devicePixelRatio), 3)) && void 0 !== _a ? _a : 1,
36
+ actions: {
37
+ initialize: () => {
38
+ var _a;
39
+ const win = null !== (_a = globalThis.top) && void 0 !== _a ? _a : globalThis;
40
+ return null == win || win.addEventListener("resize", handleResize), () => null == win ? void 0 : win.removeEventListener("resize", handleResize);
41
+ }
42
+ }
43
+ };
44
+ });
45
+
46
+ function checkElectron() {
47
+ return navigator.userAgent.toLowerCase().includes("electron/");
48
+ }
49
+
50
+ function handleResize() {
51
+ const {formFactor: formFactor, viewportWidth: viewportWidth, viewportHeight: viewportHeight, height: height} = processWindowSize();
52
+ useWindowStore.setState({
53
+ formFactor: formFactor,
54
+ viewportWidth: viewportWidth,
55
+ viewportHeight: viewportHeight,
56
+ height: height
57
+ });
58
+ }
59
+
60
+ function processWindowSize(top = !0) {
61
+ var _a, _b, _c;
62
+ const viewport = null !== (_a = globalThis.top) && void 0 !== _a ? _a : globalThis, touch = "ontouchstart" in globalThis || navigator.maxTouchPoints > 0, windowWidth = null !== (_b = null == viewport ? void 0 : viewport.innerWidth) && void 0 !== _b ? _b : -1, windowHeight = null !== (_c = null == viewport ? void 0 : viewport.innerHeight) && void 0 !== _c ? _c : -1;
63
+ return {
64
+ formFactor: getFormFactor(windowWidth),
65
+ viewportWidth: windowWidth,
66
+ viewportHeight: windowHeight,
67
+ height: viewport && touch ? `${windowHeight}px` : "100vh"
68
+ };
69
+ }
70
+
71
+ export { FormFactor as F, useWindowStore as u };
@@ -0,0 +1,14 @@
1
+ import { useRef } from "react";
2
+
3
+ function useDoubleClick(onClick, onDblClick, delay = 200) {
4
+ const timer = useRef(null);
5
+ return [ payload => (timer.current && clearTimeout(timer.current), timer.current = setTimeout(() => {
6
+ onClick(payload);
7
+ }, delay), () => {
8
+ timer.current && clearTimeout(timer.current);
9
+ }), payload => {
10
+ timer.current && clearTimeout(timer.current), onDblClick(payload);
11
+ } ];
12
+ }
13
+
14
+ export { useDoubleClick };
@@ -0,0 +1,27 @@
1
+ import { useCallback, useEffect } from "react";
2
+
3
+ function useKeyboardShortcuts(shortcuts, shortCutHandler, isAppleDevice) {
4
+ const isEditable = useCallback(e => {
5
+ const target = e.target;
6
+ if (target) {
7
+ const tag = target.tagName;
8
+ return target.isContentEditable || "INPUT" === tag || "TEXTAREA" === tag || "SELECT" === tag;
9
+ }
10
+ return !1;
11
+ }, []), handleKeyPress = useCallback(e => {
12
+ if (isEditable(e)) return;
13
+ const isMeta = isAppleDevice && e.metaKey || !isAppleDevice && e.ctrlKey;
14
+ for (const s of shortcuts) if ((!s.metaPressed || isMeta) && s.key.toLowerCase() === e.key.toLowerCase()) {
15
+ e.preventDefault(), shortCutHandler(s);
16
+ break;
17
+ }
18
+ }, [ isAppleDevice, shortcuts, shortCutHandler, isEditable ]);
19
+ useEffect(() => {
20
+ if (0 !== shortcuts.length) return globalThis.addEventListener("keydown", handleKeyPress, !1),
21
+ () => {
22
+ globalThis.removeEventListener("keydown", handleKeyPress, !1);
23
+ };
24
+ }, [ shortcuts, handleKeyPress ]);
25
+ }
26
+
27
+ export { useKeyboardShortcuts };
@@ -0,0 +1,31 @@
1
+ import { useState, useEffect } from "react";
2
+
3
+ function getTimeDifference(date, labelPrefix) {
4
+ const compareDate = date instanceof Date ? date : new Date(date);
5
+ if (Number.isNaN(compareDate.getTime())) return `${labelPrefix}Invalid date`;
6
+ const secondsDiff = Math.max(0, Math.floor((Date.now() - compareDate.getTime()) / 1e3)), minutes = Math.floor(secondsDiff / 60), hours = Math.floor(minutes / 60), days = Math.floor(hours / 24);
7
+ return minutes < 1 ? `${labelPrefix}Just now` : 1 === minutes ? `${labelPrefix}1 min. ago` : minutes < 60 ? `${labelPrefix}${minutes} mins. ago` : 1 === hours ? `${labelPrefix}1 hour ago` : hours < 24 ? `${labelPrefix}${hours} hours ago` : 1 === days ? `${labelPrefix}1 day ago` : days < 15 ? `${labelPrefix}${days} days ago` : compareDate.toLocaleDateString("en-US", {
8
+ day: "2-digit",
9
+ month: "short",
10
+ year: "numeric"
11
+ });
12
+ }
13
+
14
+ function useLastUpdated(timestamp, prefix = "", interval = 1) {
15
+ const [lastUpdated, setLastUpdated] = useState(timestamp ? getTimeDifference(timestamp, prefix) : "");
16
+ return useEffect(() => {
17
+ if (!timestamp) return void setLastUpdated("");
18
+ setLastUpdated(getTimeDifference(timestamp, prefix));
19
+ const refreshMinutes = Math.max(interval, 1), intervalTimer = setInterval(() => {
20
+ setLastUpdated(getTimeDifference(timestamp, prefix));
21
+ }, 60 * refreshMinutes * 1e3);
22
+ return () => {
23
+ clearInterval(intervalTimer);
24
+ };
25
+ }, [ interval, prefix, timestamp ]), {
26
+ lastUpdated: lastUpdated,
27
+ timer: interval
28
+ };
29
+ }
30
+
31
+ export { useLastUpdated };
@@ -0,0 +1,36 @@
1
+ import { useState, useEffect } from "react";
2
+
3
+ function canUseLocalStorage() {
4
+ return "undefined" != typeof globalThis && "localStorage" in globalThis && void 0 !== globalThis.localStorage && null !== globalThis.localStorage;
5
+ }
6
+
7
+ function readLocalStorageValue(key, fallback) {
8
+ if (!canUseLocalStorage()) return fallback;
9
+ try {
10
+ const raw = globalThis.localStorage.getItem(key);
11
+ return null === raw ? (globalThis.localStorage.setItem(key, JSON.stringify(fallback)),
12
+ fallback) : JSON.parse(raw);
13
+ } catch (error) {
14
+ return console.error(`Error parsing local storage item for key ${key}:`, {
15
+ error: error
16
+ }), fallback;
17
+ }
18
+ }
19
+
20
+ function useLocalStore(key, value) {
21
+ const [item, setItem] = useState(() => readLocalStorageValue(key, value));
22
+ return useEffect(() => {
23
+ setItem(readLocalStorageValue(key, value));
24
+ }, [ key, value ]), [ item, function(data) {
25
+ if (canUseLocalStorage()) try {
26
+ globalThis.localStorage.setItem(key, JSON.stringify(data));
27
+ } catch (error) {
28
+ console.error(`Error setting local storage item for key ${key}:`, {
29
+ error: error
30
+ });
31
+ }
32
+ setItem(data);
33
+ } ];
34
+ }
35
+
36
+ export { useLocalStore };