@lavalogic/scoria 0.36.0 → 0.37.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 (550) hide show
  1. package/dist/Components/AccordionGroup.svelte +6 -2
  2. package/dist/Components/AccordionGroupButton.svelte +78 -78
  3. package/dist/Components/AccordionGroupButtonProps.d.ts +27 -8
  4. package/dist/Components/AccordionGroupProps.d.ts +10 -2
  5. package/dist/Components/Action.svelte +31 -33
  6. package/dist/Components/ActionProps.d.ts +23 -3
  7. package/dist/Components/AlertModal.svelte +90 -39
  8. package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +1126 -0
  9. package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte.d.ts +4 -0
  10. package/dist/Components/AppointmentCalendar/AppointmentCalendarProps.d.ts +92 -0
  11. package/dist/Components/AppointmentCalendar/AppointmentCalendarProps.js +12 -0
  12. package/dist/Components/Base/BaseModal.svelte +172 -0
  13. package/dist/Components/Base/BaseModal.svelte.d.ts +4 -0
  14. package/dist/Components/Base/BaseModalProps.d.ts +73 -0
  15. package/dist/Components/Base/BaseModalProps.js +1 -0
  16. package/dist/Components/Base/ContextWrapper.svelte +37 -15
  17. package/dist/Components/Base/ContextWrapper.svelte.d.ts +24 -5
  18. package/dist/Components/Base/ContextWrapperProps.d.ts +22 -0
  19. package/dist/Components/Base/Pagination.svelte +70 -62
  20. package/dist/Components/Base/Pagination.svelte.d.ts +12 -2
  21. package/dist/Components/Base/PaginationProps.d.ts +60 -3
  22. package/dist/Components/Base/Snippets.svelte +7 -0
  23. package/dist/Components/Base/Snippets.svelte.d.ts +5 -1
  24. package/dist/Components/BigRadioSet.svelte +18 -9
  25. package/dist/Components/BigRadioSetProps.d.ts +17 -1
  26. package/dist/Components/Bubble.svelte +67 -34
  27. package/dist/Components/Bubble.svelte.d.ts +23 -2
  28. package/dist/Components/BubbleProps.d.ts +55 -4
  29. package/dist/Components/Button.svelte +50 -38
  30. package/dist/Components/ButtonProps.d.ts +66 -1
  31. package/dist/Components/Checkbox.svelte +57 -29
  32. package/dist/Components/Checkbox.svelte.d.ts +1 -12
  33. package/dist/Components/CheckboxProps.d.ts +27 -0
  34. package/dist/Components/CheckboxProps.js +1 -0
  35. package/dist/Components/CollapsibleCard.svelte +53 -22
  36. package/dist/Components/CollapsibleCardProps.d.ts +22 -1
  37. package/dist/Components/Contexts/ContextMenu.svelte +53 -32
  38. package/dist/Components/Contexts/ContextMenu.svelte.d.ts +26 -0
  39. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -7
  40. package/dist/Components/Contexts/ContextMenuDivider.svelte.d.ts +9 -0
  41. package/dist/Components/Contexts/ContextMenuOption.svelte +27 -18
  42. package/dist/Components/Contexts/ContextMenuOption.svelte.d.ts +12 -1
  43. package/dist/Components/Contexts/ContextMenuOptionProps.d.ts +34 -2
  44. package/dist/Components/Contexts/Toast.svelte +28 -4
  45. package/dist/Components/Contexts/Toast.svelte.d.ts +14 -0
  46. package/dist/Components/Contexts/ToastContainer.svelte +30 -11
  47. package/dist/Components/Contexts/ToastContainer.svelte.d.ts +14 -0
  48. package/dist/Components/Contexts/ToastProps.d.ts +14 -1
  49. package/dist/Components/Contexts/Tooltip.svelte +21 -10
  50. package/dist/Components/Contexts/Tooltip.svelte.d.ts +10 -0
  51. package/dist/Components/DataMatrixIcon.svelte +82 -11
  52. package/dist/Components/DataMatrixIconProps.d.ts +73 -1
  53. package/dist/Components/DateInput.svelte +64 -29
  54. package/dist/Components/DateInput.svelte.d.ts +1 -1
  55. package/dist/Components/DateOnlyInputProps.d.ts +31 -5
  56. package/dist/Components/DatePicker.svelte +96 -108
  57. package/dist/Components/DatePickerProps.d.ts +18 -1
  58. package/dist/Components/DateTimeInputProps.d.ts +30 -5
  59. package/dist/Components/DesktopModal.svelte +14 -43
  60. package/dist/Components/DesktopModalProps.d.ts +5 -4
  61. package/dist/Components/Dial.svelte +103 -41
  62. package/dist/Components/DialProps.d.ts +74 -2
  63. package/dist/Components/DimensionInput.svelte +50 -64
  64. package/dist/Components/DimensionInput.svelte.d.ts +1 -1
  65. package/dist/Components/DimensionInputProps.d.ts +39 -4
  66. package/dist/Components/DragMenu/DragMenuHolder.svelte +41 -29
  67. package/dist/Components/DragMenu/DragMenuHolderProps.d.ts +30 -1
  68. package/dist/Components/DragMenu/DraggableCard.svelte +44 -8
  69. package/dist/Components/DragMenu/DraggableCardProps.d.ts +27 -1
  70. package/dist/Components/FileCard.svelte +6 -2
  71. package/dist/Components/FileCardProps.d.ts +17 -1
  72. package/dist/Components/FileUpload.svelte +82 -42
  73. package/dist/Components/FileUploadProps.d.ts +34 -4
  74. package/dist/Components/GridInput.svelte +27 -17
  75. package/dist/Components/GridInput.svelte.d.ts +5 -5
  76. package/dist/Components/GridInputProps.d.ts +4 -1
  77. package/dist/Components/GridInputSet.svelte +12 -5
  78. package/dist/Components/GridInputSet.svelte.d.ts +5 -5
  79. package/dist/Components/GridInputSetProps.d.ts +4 -2
  80. package/dist/Components/HorizontalTabGroup.svelte +13 -11
  81. package/dist/Components/HorizontalTabGroupButton.svelte +16 -68
  82. package/dist/Components/HorizontalTabGroupProps.d.ts +15 -2
  83. package/dist/Components/Icon.svelte +62 -21
  84. package/dist/Components/IconProps.d.ts +54 -6
  85. package/dist/Components/Icons.d.ts +8 -0
  86. package/dist/Components/Icons.js +234 -215
  87. package/dist/Components/LoadingAnimation.svelte +18 -18
  88. package/dist/Components/LoadingAnimation.svelte.d.ts +1 -3
  89. package/dist/Components/LoadingAnimationProps.d.ts +16 -0
  90. package/dist/Components/LoadingAnimationProps.js +1 -0
  91. package/dist/Components/LoadingModal.svelte +18 -20
  92. package/dist/Components/LoadingModal.svelte.d.ts +1 -4
  93. package/dist/Components/LoadingModalProps.d.ts +17 -0
  94. package/dist/Components/LoadingModalProps.js +1 -0
  95. package/dist/Components/LoadingOverlay.svelte +11 -13
  96. package/dist/Components/LoadingOverlay.svelte.d.ts +1 -5
  97. package/dist/Components/LoadingOverlayProps.d.ts +28 -0
  98. package/dist/Components/LoadingOverlayProps.js +1 -0
  99. package/dist/Components/Modal.svelte +77 -82
  100. package/dist/Components/Modal.svelte.d.ts +1 -25
  101. package/dist/Components/ModalProps.d.ts +65 -0
  102. package/dist/Components/ModalProps.js +1 -0
  103. package/dist/Components/MultiSelect.svelte +88 -76
  104. package/dist/Components/MultiSelectCommonProps.d.ts +33 -4
  105. package/dist/Components/MultiSelectPropsAsObject.d.ts +5 -0
  106. package/dist/Components/MultiSelectPropsAsPrimitive.d.ts +6 -0
  107. package/dist/Components/Nav/CallbackButtonWithIcon.d.ts +22 -1
  108. package/dist/Components/Nav/Nav.svelte +35 -30
  109. package/dist/Components/Nav/Nav.svelte.d.ts +23 -2
  110. package/dist/Components/Nav/NavProps.d.ts +50 -3
  111. package/dist/Components/Nav/NavServiceMenuList.svelte +12 -3
  112. package/dist/Components/Nav/NavServiceMenuListProps.d.ts +25 -1
  113. package/dist/Components/Nav/NavTab.svelte +19 -48
  114. package/dist/Components/Nav/NavTab.svelte.d.ts +23 -2
  115. package/dist/Components/Nav/NavTabProps.d.ts +16 -2
  116. package/dist/Components/Nav/ServiceMenuItem.svelte +29 -20
  117. package/dist/Components/Nav/ServicesNav.svelte +60 -34
  118. package/dist/Components/Nav/ServicesNav.svelte.d.ts +23 -2
  119. package/dist/Components/Nav/ServicesNavProps.d.ts +20 -4
  120. package/dist/Components/Nav/SideMenuItemProps.d.ts +16 -0
  121. package/dist/Components/NumberInput.svelte +37 -27
  122. package/dist/Components/NumberInputProps.d.ts +37 -0
  123. package/dist/Components/PageHeading.svelte +2 -13
  124. package/dist/Components/PageHeading.svelte.d.ts +1 -6
  125. package/dist/Components/PageHeadingProps.d.ts +23 -0
  126. package/dist/Components/PageHeadingProps.js +1 -0
  127. package/dist/Components/PasswordInput.svelte +27 -15
  128. package/dist/Components/PasswordInput.svelte.d.ts +2 -2
  129. package/dist/Components/PasswordInputProps.d.ts +21 -0
  130. package/dist/Components/PasswordInputProps.js +1 -0
  131. package/dist/Components/Portal.svelte +14 -3
  132. package/dist/Components/PortalProps.d.ts +20 -1
  133. package/dist/Components/ProgressBubble.svelte +98 -53
  134. package/dist/Components/ProgressBubbleProps.d.ts +23 -2
  135. package/dist/Components/QuerySelect.svelte +103 -159
  136. package/dist/Components/QuerySelect.svelte.d.ts +2 -29
  137. package/dist/Components/QuerySelectProps.d.ts +66 -0
  138. package/dist/Components/QuerySelectProps.js +1 -0
  139. package/dist/Components/SingleSelect.svelte +86 -108
  140. package/dist/Components/SingleSelectCommonProps.d.ts +43 -5
  141. package/dist/Components/SingleSelectPropsAsObject.d.ts +7 -0
  142. package/dist/Components/SingleSelectPropsAsPrimitive.d.ts +8 -0
  143. package/dist/Components/StepButton.svelte +19 -69
  144. package/dist/Components/StepForm.svelte +52 -52
  145. package/dist/Components/StepFormProps.d.ts +16 -2
  146. package/dist/Components/Switch.svelte +68 -31
  147. package/dist/Components/Switch.svelte.d.ts +1 -1
  148. package/dist/Components/SwitchProps.d.ts +46 -0
  149. package/dist/Components/Table/Body/HeightData.d.ts +1 -6
  150. package/dist/Components/Table/Body/HeightData.js +8 -0
  151. package/dist/Components/Table/Body/QuickSearchCell.svelte +106 -50
  152. package/dist/Components/Table/Body/QuickSearchCell.svelte.d.ts +12 -11
  153. package/dist/Components/Table/Body/QuickSearchCellProps.d.ts +6 -0
  154. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +43 -9
  155. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte.d.ts +24 -2
  156. package/dist/Components/Table/Body/Rows/ColumnHighlightProps.d.ts +3 -0
  157. package/dist/Components/Table/Body/Rows/ColumnList.svelte +15 -5
  158. package/dist/Components/Table/Body/Rows/ColumnList.svelte.d.ts +12 -11
  159. package/dist/Components/Table/Body/Rows/ColumnListProps.d.ts +1 -0
  160. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +424 -91
  161. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte.d.ts +12 -11
  162. package/dist/Components/Table/Body/Rows/ColumnListRowProps.d.ts +5 -0
  163. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +43 -13
  164. package/dist/Components/Table/Body/Rows/Columns/AccessorComponentProps.d.ts +12 -0
  165. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +50 -38
  166. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte.d.ts +12 -12
  167. package/dist/Components/Table/Body/Rows/Columns/ActionsColumn.d.ts +9 -0
  168. package/dist/Components/Table/Body/Rows/Columns/ActionsTableCell.d.ts +5 -0
  169. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +61 -26
  170. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte.d.ts +14 -13
  171. package/dist/Components/Table/Body/Rows/Columns/BubbleCellProps.d.ts +12 -0
  172. package/dist/Components/Table/Body/Rows/Columns/BubbleCellProps.js +1 -0
  173. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +36 -16
  174. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +47 -24
  175. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte.d.ts +12 -11
  176. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCellProps.d.ts +7 -0
  177. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +54 -20
  178. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte.d.ts +17 -11
  179. package/dist/Components/Table/Body/Rows/Columns/RowSelectionColumn.d.ts +8 -0
  180. package/dist/Components/Table/Body/Rows/Columns/RowSelectionTableCell.d.ts +5 -0
  181. package/dist/Components/Table/Body/Rows/Columns/SelectColumn.d.ts +11 -0
  182. package/dist/Components/Table/Body/Rows/Columns/SelectTableCell.d.ts +11 -0
  183. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +55 -40
  184. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte.d.ts +11 -0
  185. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +38 -27
  186. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte.d.ts +13 -18
  187. package/dist/Components/Table/Body/Rows/Columns/TableCheckboxProps.d.ts +17 -0
  188. package/dist/Components/Table/Body/Rows/Columns/TableCheckboxProps.js +1 -0
  189. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +22 -7
  190. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte.d.ts +1 -7
  191. package/dist/Components/Table/Body/Rows/Columns/TableColumnProps.d.ts +16 -0
  192. package/dist/Components/Table/Body/Rows/Columns/TableColumnProps.js +1 -0
  193. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +61 -31
  194. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte.d.ts +12 -11
  195. package/dist/Components/Table/Body/Rows/Columns/TableDatePickerProps.d.ts +9 -0
  196. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +123 -244
  197. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte.d.ts +20 -12
  198. package/dist/Components/Table/Body/Rows/Columns/TableQueryCell.d.ts +8 -0
  199. package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.d.ts +9 -0
  200. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +126 -189
  201. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte.d.ts +12 -11
  202. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelectProps.d.ts +8 -0
  203. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +31 -19
  204. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte.d.ts +2 -5
  205. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckboxProps.d.ts +14 -0
  206. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckboxProps.js +1 -0
  207. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +125 -187
  208. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte.d.ts +13 -12
  209. package/dist/Components/Table/Body/Rows/Columns/TableSelectProps.d.ts +6 -0
  210. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +119 -270
  211. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte.d.ts +12 -11
  212. package/dist/Components/Table/Body/Rows/Columns/TableTextInputProps.d.ts +6 -0
  213. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +23 -13
  214. package/dist/Components/Table/Body/Rows/Columns/_helpers/useAsyncEditable.svelte.d.ts +104 -0
  215. package/dist/Components/Table/Body/Rows/Columns/_helpers/useAsyncEditable.svelte.js +215 -0
  216. package/dist/Components/Table/Body/Rows/TableRow.svelte +200 -132
  217. package/dist/Components/Table/Body/Rows/TableRow.svelte.d.ts +2 -10
  218. package/dist/Components/Table/Body/Rows/TableRowProps.d.ts +11 -2
  219. package/dist/Components/Table/Body/TableBody.svelte +170 -53
  220. package/dist/Components/Table/Body/TableBody.svelte.d.ts +15 -22
  221. package/dist/Components/Table/Body/TableBodyProps.d.ts +9 -7
  222. package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +18 -12
  223. package/dist/Components/Table/ColumnFactory.svelte.d.ts +43 -0
  224. package/dist/Components/Table/ColumnFactory.svelte.js +339 -0
  225. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +5 -3
  226. package/dist/Components/Table/Headers/HighlightAllHeader.svelte.d.ts +12 -11
  227. package/dist/Components/Table/Headers/SelectAllHeader.svelte +5 -3
  228. package/dist/Components/Table/Headers/SelectAllHeader.svelte.d.ts +12 -11
  229. package/dist/Components/Table/Headers/TableHead.svelte +340 -200
  230. package/dist/Components/Table/Headers/TableHead.svelte.d.ts +13 -16
  231. package/dist/Components/Table/Headers/TableHeadProps.d.ts +10 -0
  232. package/dist/Components/Table/Headers/TableHeadProps.js +1 -0
  233. package/dist/Components/Table/Misc/ColumnPanel.svelte +108 -50
  234. package/dist/Components/Table/Misc/ColumnPanel.svelte.d.ts +12 -11
  235. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +20 -7
  236. package/dist/Components/Table/Misc/ColumnPanelModal.svelte.d.ts +12 -11
  237. package/dist/Components/Table/Misc/ColumnPanelModalProps.d.ts +5 -0
  238. package/dist/Components/Table/Misc/FilterInput.svelte +30 -41
  239. package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +12 -11
  240. package/dist/Components/Table/Misc/FilterPanel.svelte +387 -29
  241. package/dist/Components/Table/Misc/FilterPanel.svelte.d.ts +12 -11
  242. package/dist/Components/Table/Misc/FilterPanelModal.svelte +4 -51
  243. package/dist/Components/Table/Misc/FilterPanelModal.svelte.d.ts +2 -23
  244. package/dist/Components/Table/Misc/SidePanel.svelte +12 -9
  245. package/dist/Components/Table/Misc/SidePanel.svelte.d.ts +1 -7
  246. package/dist/Components/Table/Misc/SidePanelProps.d.ts +17 -0
  247. package/dist/Components/Table/Misc/SidePanelProps.js +1 -0
  248. package/dist/Components/Table/Misc/TableFooter.svelte +44 -35
  249. package/dist/Components/Table/Misc/TableFooter.svelte.d.ts +13 -14
  250. package/dist/Components/Table/Misc/TableFooterProps.d.ts +8 -0
  251. package/dist/Components/Table/Misc/TableFooterProps.js +1 -0
  252. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +17 -48
  253. package/dist/Components/Table/Misc/TableHorizontalBar.svelte.d.ts +12 -11
  254. package/dist/Components/Table/Misc/TableSidebar.svelte +28 -47
  255. package/dist/Components/Table/Misc/TableSidebar.svelte.d.ts +12 -11
  256. package/dist/Components/Table/Misc/ToolboxPanel.svelte +121 -55
  257. package/dist/Components/Table/Misc/ToolboxPanel.svelte.d.ts +12 -11
  258. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +31 -24
  259. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte.d.ts +12 -11
  260. package/dist/Components/Table/Misc/ToolboxPanelModalProps.d.ts +5 -0
  261. package/dist/Components/Table/Misc/numberDateFilterTypes.d.ts +7 -4
  262. package/dist/Components/Table/Misc/numberDateFilterTypes.js +8 -3
  263. package/dist/Components/Table/Misc/stringFilterTypes.d.ts +6 -4
  264. package/dist/Components/Table/Misc/stringFilterTypes.js +7 -3
  265. package/dist/Components/Table/NestedTable.svelte +85 -41
  266. package/dist/Components/Table/NestedTable.svelte.d.ts +2 -10
  267. package/dist/Components/Table/NestedTableProps.d.ts +25 -0
  268. package/dist/Components/Table/NestedTableProps.js +1 -0
  269. package/dist/Components/Table/SubApis.svelte.d.ts +23 -0
  270. package/dist/Components/Table/SubApis.svelte.js +359 -0
  271. package/dist/Components/Table/Table.svelte +347 -172
  272. package/dist/Components/Table/Table.svelte.d.ts +24 -1
  273. package/dist/Components/Table/TableHelpers.svelte.d.ts +58 -0
  274. package/dist/Components/Table/TableHelpers.svelte.js +88 -0
  275. package/dist/Components/Table/Types/Columns/Column.d.ts +10 -0
  276. package/dist/Components/Table/Types/Columns/ColumnPinningState.d.ts +12 -0
  277. package/dist/Components/Table/Types/Columns/ColumnSizingState.d.ts +8 -0
  278. package/dist/Components/Table/Types/Columns/ColumnType.d.ts +17 -0
  279. package/dist/Components/Table/Types/Columns/ColumnType.js +18 -1
  280. package/dist/Components/Table/Types/Columns/DateColumn.d.ts +6 -0
  281. package/dist/Components/Table/Types/Columns/DateTableCell.d.ts +7 -0
  282. package/dist/Components/Table/Types/Columns/Definitions/AccessorFn.d.ts +13 -0
  283. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +28 -3
  284. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.js +15 -0
  285. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorType.d.ts +10 -0
  286. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorType.js +11 -1
  287. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +23 -2
  288. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.js +9 -2
  289. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.d.ts +21 -2
  290. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.js +8 -0
  291. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts +29 -3
  292. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.js +11 -0
  293. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.d.ts +23 -0
  294. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.js +8 -0
  295. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.d.ts +31 -0
  296. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.js +17 -3
  297. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +21 -2
  298. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.js +7 -0
  299. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +29 -1
  300. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js +17 -3
  301. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +122 -11
  302. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +77 -11
  303. package/dist/Components/Table/Types/Columns/Definitions/ColumnDefSet.d.ts +9 -0
  304. package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +41 -1
  305. package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +16 -0
  306. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +19 -1
  307. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js +12 -1
  308. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +11 -0
  309. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js +6 -3
  310. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +19 -0
  311. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js +25 -1
  312. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +26 -0
  313. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.js +20 -5
  314. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +43 -7
  315. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.js +18 -3
  316. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +19 -5
  317. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.js +16 -5
  318. package/dist/Components/Table/Types/Columns/Definitions/JSONColumnDefSet.d.ts +14 -0
  319. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +34 -2
  320. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js +30 -7
  321. package/dist/Components/Table/Types/Columns/Definitions/ValidationFn.d.ts +17 -0
  322. package/dist/Components/Table/Types/Columns/DefsWrapper.d.ts +10 -0
  323. package/dist/Components/Table/Types/Columns/DisplayType.d.ts +13 -0
  324. package/dist/Components/Table/Types/Columns/DisplayType.js +14 -1
  325. package/dist/Components/Table/Types/Columns/ExpandColumn.d.ts +5 -0
  326. package/dist/Components/Table/Types/Columns/ExpandTableCell.d.ts +7 -0
  327. package/dist/Components/Table/Types/Columns/JSONColumnPinningState.d.ts +6 -0
  328. package/dist/Components/Table/Types/Columns/ProgressBarColumn.d.ts +5 -0
  329. package/dist/Components/Table/Types/Columns/ProgressBarTableCell.d.ts +9 -0
  330. package/dist/Components/Table/Types/Columns/TableActionButton.d.ts +12 -0
  331. package/dist/Components/Table/Types/Columns/TableCell.d.ts +16 -2
  332. package/dist/Components/Table/Types/Columns/VisibilityState.d.ts +12 -0
  333. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.d.ts +173 -0
  334. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.js +241 -0
  335. package/dist/Components/Table/Types/Context/FilteringState.svelte.d.ts +166 -0
  336. package/dist/Components/Table/Types/Context/FilteringState.svelte.js +180 -0
  337. package/dist/Components/Table/Types/Context/FocusState.svelte.d.ts +316 -0
  338. package/dist/Components/Table/Types/Context/FocusState.svelte.js +751 -0
  339. package/dist/Components/Table/Types/Context/ITable.d.ts +10 -0
  340. package/dist/Components/Table/Types/Context/PreferencesState.svelte.d.ts +242 -0
  341. package/dist/Components/Table/Types/Context/PreferencesState.svelte.js +317 -0
  342. package/dist/Components/Table/Types/Context/ReadonlyRowModel.d.ts +14 -3
  343. package/dist/Components/Table/Types/Context/Row.d.ts +18 -0
  344. package/dist/Components/Table/Types/Context/RowModel.d.ts +11 -0
  345. package/dist/Components/Table/Types/Context/SelectionState.svelte.d.ts +260 -0
  346. package/dist/Components/Table/Types/Context/SelectionState.svelte.js +613 -0
  347. package/dist/Components/Table/Types/Context/SortingState.svelte.d.ts +112 -0
  348. package/dist/Components/Table/Types/Context/SortingState.svelte.js +272 -0
  349. package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +547 -53
  350. package/dist/Components/Table/Types/Context/TableContext.svelte.js +959 -1259
  351. package/dist/Components/Table/Types/Context/TableInitOptions.d.ts +16 -0
  352. package/dist/Components/Table/Types/Context/TableSettings.d.ts +20 -0
  353. package/dist/Components/Table/Types/Context/VirtualisationState.svelte.d.ts +167 -0
  354. package/dist/Components/Table/Types/Context/VirtualisationState.svelte.js +226 -0
  355. package/dist/Components/Table/Types/Coordinates/CellCoordinates.d.ts +12 -0
  356. package/dist/Components/Table/Types/Coordinates/CellCoordinatesWithoutColumn.d.ts +5 -0
  357. package/dist/Components/Table/Types/Coordinates/ColumnIndices.d.ts +16 -2
  358. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.d.ts +143 -0
  359. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.js +454 -0
  360. package/dist/Components/Table/Types/DataRepository/IDataRepository.d.ts +21 -0
  361. package/dist/Components/Table/Types/DataRepository/ILocalDataRepository.d.ts +10 -0
  362. package/dist/Components/Table/Types/DataRepository/IRemoteDataRepository.d.ts +16 -0
  363. package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.d.ts +87 -3
  364. package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.js +112 -7
  365. package/dist/Components/Table/Types/DataRepository/SortingState.d.ts +12 -0
  366. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.d.ts +87 -2
  367. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +74 -1
  368. package/dist/Components/Table/Types/ExpandedPanel.d.ts +9 -0
  369. package/dist/Components/Table/Types/ExpandedPanel.js +10 -1
  370. package/dist/Components/Table/Types/Filtering/ColumnFiltersState.d.ts +17 -0
  371. package/dist/Components/Table/Types/Filtering/CustomFilter.d.ts +21 -0
  372. package/dist/Components/Table/Types/Filtering/CustomFilterType.d.ts +5 -0
  373. package/dist/Components/Table/Types/Filtering/CustomFilterType.js +6 -1
  374. package/dist/Components/Table/Types/Filtering/CustomRemoteFilters.d.ts +6 -0
  375. package/dist/Components/Table/Types/Filtering/FilterFn.d.ts +28 -0
  376. package/dist/Components/Table/Types/Filtering/FilterMode.d.ts +7 -0
  377. package/dist/Components/Table/Types/Filtering/FilterType.d.ts +8 -0
  378. package/dist/Components/Table/Types/Filtering/FilterType.js +9 -1
  379. package/dist/Components/Table/Types/Filtering/FilterValueType.d.ts +11 -0
  380. package/dist/Components/Table/Types/Filtering/FilterValueType.js +12 -1
  381. package/dist/Components/Table/Types/Filtering/HasCustomFilterFunction.d.ts +23 -2
  382. package/dist/Components/Table/Types/Filtering/NumberDateFilterMode.d.ts +19 -12
  383. package/dist/Components/Table/Types/Filtering/NumberDateFilterMode.js +18 -14
  384. package/dist/Components/Table/Types/Filtering/StringFilterMode.d.ts +22 -15
  385. package/dist/Components/Table/Types/Filtering/StringFilterMode.js +22 -16
  386. package/dist/Components/Table/Types/Focus/MultiFocusEdge.d.ts +8 -0
  387. package/dist/Components/Table/Types/Focus/MultiFocusEdge.js +9 -1
  388. package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.d.ts +22 -0
  389. package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.js +22 -0
  390. package/dist/Components/Table/Types/Header.d.ts +8 -0
  391. package/dist/Components/Table/Types/HeaderGroup.d.ts +7 -0
  392. package/dist/Components/Table/Types/Layout/CellPinning.d.ts +1 -0
  393. package/dist/Components/Table/Types/Layout/CellPinning.js +8 -0
  394. package/dist/Components/Table/Types/OnChangeFn.d.ts +11 -0
  395. package/dist/Components/Table/Types/Pagination/PaginationState.d.ts +9 -0
  396. package/dist/Components/Table/Types/Pagination/PaginationType.d.ts +10 -0
  397. package/dist/Components/Table/Types/Pagination/PaginationType.js +11 -1
  398. package/dist/Components/Table/Types/Public/AnyEditEvent.d.ts +30 -0
  399. package/dist/Components/Table/Types/Public/AnyEditEvent.js +1 -0
  400. package/dist/Components/Table/Types/Public/BaseColumnOptions.d.ts +44 -0
  401. package/dist/Components/Table/Types/Public/BaseColumnOptions.js +1 -0
  402. package/dist/Components/Table/Types/Public/ColumnFactory.d.ts +35 -0
  403. package/dist/Components/Table/Types/Public/ColumnFactory.js +1 -0
  404. package/dist/Components/Table/Types/Public/ColumnOptions.d.ts +238 -0
  405. package/dist/Components/Table/Types/Public/ColumnOptions.js +1 -0
  406. package/dist/Components/Table/Types/Public/ColumnSpec.d.ts +39 -0
  407. package/dist/Components/Table/Types/Public/ColumnSpec.js +1 -0
  408. package/dist/Components/Table/Types/Public/CreateTableOptions.d.ts +87 -0
  409. package/dist/Components/Table/Types/Public/CreateTableOptions.js +1 -0
  410. package/dist/Components/Table/Types/Public/KeyConstraints.d.ts +42 -0
  411. package/dist/Components/Table/Types/Public/KeyConstraints.js +22 -0
  412. package/dist/Components/Table/Types/Public/RowSource.d.ts +87 -0
  413. package/dist/Components/Table/Types/Public/RowSource.js +1 -0
  414. package/dist/Components/Table/Types/Public/SelectionOptions.d.ts +26 -0
  415. package/dist/Components/Table/Types/Public/SelectionOptions.js +1 -0
  416. package/dist/Components/Table/Types/Public/Table.d.ts +39 -0
  417. package/dist/Components/Table/Types/Public/Table.js +1 -0
  418. package/dist/Components/Table/Types/Public/TableInitialState.d.ts +26 -0
  419. package/dist/Components/Table/Types/Public/TableInitialState.js +1 -0
  420. package/dist/Components/Table/Types/Public/TablePersistence.d.ts +38 -0
  421. package/dist/Components/Table/Types/Public/TablePersistence.js +1 -0
  422. package/dist/Components/Table/Types/Public/TableSubApis.d.ts +157 -0
  423. package/dist/Components/Table/Types/Public/TableSubApis.js +1 -0
  424. package/dist/Components/Table/Types/Public/index.d.ts +20 -0
  425. package/dist/Components/Table/Types/Public/index.js +8 -0
  426. package/dist/Components/Table/Types/Toolbar/ToolbarPosition.d.ts +4 -0
  427. package/dist/Components/Table/Types/Toolbar/ToolbarPosition.js +5 -1
  428. package/dist/Components/Table/createTable.svelte.d.ts +53 -0
  429. package/dist/Components/Table/createTable.svelte.js +269 -0
  430. package/dist/Components/TextArea.svelte +37 -18
  431. package/dist/Components/TextAreaProps.d.ts +37 -0
  432. package/dist/Components/TextInput.svelte +41 -22
  433. package/dist/Components/TextInputProps.d.ts +58 -1
  434. package/dist/Components/ThreeStateRadio.svelte +61 -64
  435. package/dist/Components/ThreeStateRadioProps.d.ts +29 -1
  436. package/dist/Components/Touch/BoolCard.svelte +8 -15
  437. package/dist/Components/Touch/BoolCard.svelte.d.ts +1 -10
  438. package/dist/Components/Touch/BoolCardProps.d.ts +21 -0
  439. package/dist/Components/Touch/BoolCardProps.js +1 -0
  440. package/dist/Components/Touch/DateModal.svelte +17 -25
  441. package/dist/Components/Touch/DateModal.svelte.d.ts +1 -17
  442. package/dist/Components/Touch/DateModalProps.d.ts +36 -0
  443. package/dist/Components/Touch/DateModalProps.js +1 -0
  444. package/dist/Components/Touch/EditCard.svelte +10 -3
  445. package/dist/Components/Touch/EditCardProps.d.ts +21 -0
  446. package/dist/Components/Touch/InfoCard.svelte +14 -7
  447. package/dist/Components/Touch/InfoCardProps.d.ts +9 -0
  448. package/dist/Components/Touch/InfoTextCard.svelte +9 -2
  449. package/dist/Components/Touch/InfoTextCardProps.d.ts +8 -0
  450. package/dist/Components/Touch/ModalExplanation.svelte +9 -12
  451. package/dist/Components/Touch/ModalExplanation.svelte.d.ts +1 -6
  452. package/dist/Components/Touch/ModalExplanationProps.d.ts +22 -0
  453. package/dist/Components/Touch/ModalExplanationProps.js +1 -0
  454. package/dist/Components/Touch/NumberKeyboard.svelte +62 -105
  455. package/dist/Components/Touch/NumberKeyboardProps.d.ts +19 -0
  456. package/dist/Components/Touch/NumberModal.svelte +16 -6
  457. package/dist/Components/Touch/NumberModalProps.d.ts +23 -1
  458. package/dist/Components/Touch/PlusMinusCard.svelte +12 -16
  459. package/dist/Components/Touch/PlusMinusCard.svelte.d.ts +1 -6
  460. package/dist/Components/Touch/PlusMinusCardProps.d.ts +18 -0
  461. package/dist/Components/Touch/PlusMinusCardProps.js +1 -0
  462. package/dist/Components/Touch/SelectModal.svelte +33 -15
  463. package/dist/Components/Touch/SelectModalProps.d.ts +22 -1
  464. package/dist/Components/Touch/SummaryCard.svelte +56 -14
  465. package/dist/Components/Touch/SummaryCardProps.d.ts +16 -3
  466. package/dist/Components/Touch/TextAreaModal.svelte +18 -9
  467. package/dist/Components/Touch/TextAreaModalProps.d.ts +21 -0
  468. package/dist/Components/Touch/TextModal.svelte +15 -32
  469. package/dist/Components/Touch/TextModalProps.d.ts +28 -1
  470. package/dist/Components/Touch/TouchCard.svelte +9 -47
  471. package/dist/Components/Touch/TouchCardProps.d.ts +21 -0
  472. package/dist/Components/Touch/TouchModal.svelte +105 -99
  473. package/dist/Components/Touch/TouchModalProps.d.ts +35 -1
  474. package/dist/Components/Touch/UtilityButton.svelte +36 -18
  475. package/dist/Components/Touch/UtilityButtonProps.d.ts +16 -0
  476. package/dist/Components/VerticalTabGroup.svelte +18 -40
  477. package/dist/Components/VerticalTabGroupButton.svelte +11 -50
  478. package/dist/Components/VerticalTabGroupProps.d.ts +15 -2
  479. package/dist/Contexts/AlertContext.svelte.d.ts +92 -8
  480. package/dist/Contexts/AlertContext.svelte.js +69 -6
  481. package/dist/Contexts/ContextMenuContext.svelte.d.ts +54 -8
  482. package/dist/Contexts/ContextMenuContext.svelte.js +48 -2
  483. package/dist/Contexts/TestContext.svelte.d.ts +27 -1
  484. package/dist/Contexts/TestContext.svelte.js +29 -1
  485. package/dist/Contexts/ToastContext.svelte.d.ts +29 -1
  486. package/dist/Contexts/ToastContext.svelte.js +93 -24
  487. package/dist/Contexts/TooltipContext.svelte.d.ts +68 -1
  488. package/dist/Contexts/TooltipContext.svelte.js +70 -7
  489. package/dist/Contexts/UntypedInputContext.svelte.d.ts +54 -5
  490. package/dist/Contexts/UntypedInputContext.svelte.js +87 -34
  491. package/dist/Delay/Delay.js +1 -1
  492. package/dist/Helpers/AsyncFlag.svelte.d.ts +39 -0
  493. package/dist/Helpers/AsyncFlag.svelte.js +72 -0
  494. package/dist/Helpers/Datamatrix.d.ts +10 -1
  495. package/dist/Helpers/Datamatrix.js +290 -1
  496. package/dist/Helpers/Helpers.svelte.d.ts +252 -18
  497. package/dist/Helpers/Helpers.svelte.js +271 -75
  498. package/dist/Helpers/INamed.d.ts +6 -0
  499. package/dist/Helpers/Storage.d.ts +67 -0
  500. package/dist/Helpers/Storage.js +138 -0
  501. package/dist/Helpers/dropdownPortal.d.ts +52 -0
  502. package/dist/Helpers/dropdownPortal.js +232 -0
  503. package/dist/Helpers/dropdownPortal.svelte.d.ts +2 -0
  504. package/dist/Helpers/dropdownPortal.svelte.js +5 -0
  505. package/dist/Helpers/memoiseByRow.d.ts +45 -0
  506. package/dist/Helpers/memoiseByRow.js +78 -0
  507. package/dist/Helpers/prefersReducedMotion.svelte.d.ts +27 -0
  508. package/dist/Helpers/prefersReducedMotion.svelte.js +18 -0
  509. package/dist/Helpers/useTooltip.svelte.d.ts +53 -0
  510. package/dist/Helpers/useTooltip.svelte.js +62 -0
  511. package/dist/Types/Examples/ExampleModal.svelte +2 -1
  512. package/dist/Types/Examples/ExampleSelectEnum.js +1 -1
  513. package/dist/Types/Internal/AsyncFlag.d.ts +7 -0
  514. package/dist/Types/Internal/AsyncFlag.js +1 -0
  515. package/dist/Types/Internal/BigRadioOption.d.ts +8 -0
  516. package/dist/Types/Internal/ButtonProp.d.ts +24 -2
  517. package/dist/Types/Internal/CallbackButton.d.ts +12 -0
  518. package/dist/Types/Internal/DateChange.d.ts +8 -0
  519. package/dist/Types/Internal/DatePickerType.d.ts +5 -0
  520. package/dist/Types/Internal/DatePickerType.js +6 -1
  521. package/dist/Types/Internal/IdentifiableToastMessage.d.ts +8 -0
  522. package/dist/Types/Internal/InputVariant.d.ts +5 -0
  523. package/dist/Types/Internal/InputVariant.js +6 -1
  524. package/dist/Types/Internal/Misc.d.ts +91 -0
  525. package/dist/Types/Internal/RefWrapper.d.ts +6 -0
  526. package/dist/Types/Internal/SelectOption.d.ts +8 -0
  527. package/dist/Types/Internal/Shape.d.ts +1 -0
  528. package/dist/Types/Internal/Shape.js +2 -1
  529. package/dist/Types/Internal/Side.d.ts +1 -0
  530. package/dist/Types/Internal/Side.js +2 -1
  531. package/dist/Types/Internal/Size.d.ts +5 -0
  532. package/dist/Types/Internal/Size.js +6 -1
  533. package/dist/Types/Internal/TabOption.d.ts +15 -5
  534. package/dist/Types/Internal/Ternary.d.ts +6 -0
  535. package/dist/Types/Internal/Ternary.js +7 -1
  536. package/dist/Types/Internal/ToastMessage.d.ts +28 -0
  537. package/dist/Types/Internal/Validity.d.ts +6 -0
  538. package/dist/Types/Internal/Validity.js +7 -1
  539. package/dist/Types/Internal/ValidityWrapper.d.ts +8 -0
  540. package/dist/Types/Internal/Variant.d.ts +5 -0
  541. package/dist/Types/Internal/Variant.js +6 -1
  542. package/dist/index.d.ts +27 -82
  543. package/dist/index.js +24 -62
  544. package/dist/scss/_mixins.scss +451 -167
  545. package/dist/scss/_motion.scss +57 -0
  546. package/dist/scss/_sizing.scss +16 -0
  547. package/dist/scss/colours.js +2 -2
  548. package/dist/scss/sizing.d.ts +9 -0
  549. package/dist/scss/sizing.js +10 -1
  550. package/package.json +35 -31
@@ -1,10 +1,17 @@
1
1
  import { dev } from '$app/environment';
2
- import { TableContext } from '../Components/Table/Types/Context/TableContext.svelte.js';
3
- import { LocalTableDataRepository } from '../Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.js';
4
- import { CustomFilterType } from '../Components/Table/Types/Filtering/CustomFilterType.js';
5
2
  import { Sizing } from '../scss/sizing.js';
6
3
  import { untrack } from 'svelte';
7
4
  import { SvelteDate, SvelteSet } from 'svelte/reactivity';
5
+ /**
6
+ * Returns the singular or plural form of `text` based on `quantity`.
7
+ * Handles common English suffix rules (`-s`, `-x`, `-z`, `-ch`,
8
+ * `-sh` -> `-es`; everything else -> `-s`). Set `capitalise` when
9
+ * the surrounding copy is upper-case (e.g. table headers).
10
+ *
11
+ * @param text - The singular form.
12
+ * @param quantity - When equal to `1`, the singular form is returned unchanged. Defaults to `2`.
13
+ * @param options.capitalise - When `true`, the appended suffix is upper-case.
14
+ */
8
15
  export function autoPluralise(text, quantity = 2, { capitalise = false } = {}) {
9
16
  if (quantity === 1) {
10
17
  return text;
@@ -32,13 +39,93 @@ export function autoPluralise(text, quantity = 2, { capitalise = false } = {}) {
32
39
  }
33
40
  }
34
41
  }
42
+ /** Reactive set of lower-case English vowels; useful for "a" vs "an" decisions. */
35
43
  export const vowels = new SvelteSet(['a', 'e', 'i', 'o', 'u']);
36
44
  // generic is present to bypass floatAlias type requirements and the like
37
- export function generateShortUUID() {
45
+ /**
46
+ * Returns the first 13 characters of a freshly generated v4 UUID.
47
+ *
48
+ * Inherits the entropy source of `generateUUID` (cryptographic when
49
+ * available, see that function's docstring), so the underlying random
50
+ * draw is strong. However, truncating a 128-bit UUID to 13 hex
51
+ * characters reduces it to roughly 52 bits of entropy, which makes
52
+ * collisions plausible at scale and renders the value vulnerable to
53
+ * brute-force guessing.
54
+ *
55
+ * WARNING: do NOT use `generateWeakId` for security-sensitive
56
+ * identifiers (CSRF tokens, session keys, password-reset codes,
57
+ * idempotency tokens). It is intended for short DOM `id` attributes
58
+ * and similar low-collision, non-secret labels only. For any
59
+ * security-sensitive identifier use `generateUUID` (or, in new code,
60
+ * `globalThis.crypto.randomUUID()` directly).
61
+ *
62
+ * The `<T extends string>` generic preserves the `BrandedString`
63
+ * ergonomics used by the rest of the helpers. Unlike `generateUUID`
64
+ * the brand parameter has no default - callers must opt in to a brand
65
+ * explicitly because the value is NOT a full UUID.
66
+ */
67
+ export function generateWeakId() {
38
68
  return generateUUID().substring(0, 13);
39
69
  }
40
- // taken from https://stackoverflow.com/a/8809472/18712055
70
+ /**
71
+ * @deprecated - use `generateWeakId`; the short form trades collision
72
+ * resistance for brevity and is NOT suitable for security tokens. The
73
+ * rename is part of the SecureUUIDs follow-up; this alias is preserved
74
+ * to avoid breaking existing consumers in the same release.
75
+ */
76
+ export function generateShortUUID() {
77
+ return generateWeakId();
78
+ }
79
+ let __weakUUIDWarned = false;
80
+ /**
81
+ * Generates an RFC 4122 version 4 UUID.
82
+ *
83
+ * Entropy source cascade (in order of preference):
84
+ * 1. `globalThis.crypto.randomUUID()` - native v4 UUID with
85
+ * cryptographically secure randomness. Available in all modern
86
+ * evergreen browsers (since 2022) and Node 19+.
87
+ * 2. `globalThis.crypto.getRandomValues(new Uint8Array(16))` - fills
88
+ * 16 random bytes from the platform CSPRNG, then sets the
89
+ * version (0x40) and variant (0x80) nibbles to produce a v4 UUID.
90
+ * Used when `randomUUID` is missing (older Safari, some embedded
91
+ * runtimes) but the Web Crypto API is otherwise present.
92
+ * 3. A `Math.random()`-based fallback that mixes in `Date.now()` and
93
+ * `performance.now()`. Emits a one-time `console.warn` to signal
94
+ * that the entropy is NOT cryptographically secure. Only reached
95
+ * on very old environments where `globalThis.crypto` itself is
96
+ * unavailable.
97
+ *
98
+ * The `<T extends string>` generic preserves the `BrandedString`
99
+ * ergonomics used by the rest of the helpers: callers may stamp the
100
+ * returned value with a brand without an explicit cast.
101
+ *
102
+ * @returns A v4 UUID string of the form
103
+ * `xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx` where `y` is one of
104
+ * `8`, `9`, `a`, `b`.
105
+ */
41
106
  export function generateUUID() {
107
+ const cryptoRef = typeof globalThis !== 'undefined' ? globalThis.crypto : undefined;
108
+ if (cryptoRef?.randomUUID) {
109
+ return cryptoRef.randomUUID();
110
+ }
111
+ if (cryptoRef?.getRandomValues) {
112
+ const bytes = new Uint8Array(16);
113
+ cryptoRef.getRandomValues(bytes);
114
+ // Set version (v4) and variant (RFC 4122) bits.
115
+ bytes[6] = (bytes[6] & 0x0f) | 0x40;
116
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
117
+ const hex = [];
118
+ for (let i = 0; i < 16; i++) {
119
+ hex.push(bytes[i].toString(16).padStart(2, '0'));
120
+ }
121
+ return `${hex[0]}${hex[1]}${hex[2]}${hex[3]}-${hex[4]}${hex[5]}-${hex[6]}${hex[7]}-${hex[8]}${hex[9]}-${hex[10]}${hex[11]}${hex[12]}${hex[13]}${hex[14]}${hex[15]}`;
122
+ }
123
+ // Last-resort fallback for environments without Web Crypto at all.
124
+ // Taken from https://stackoverflow.com/a/8809472/18712055.
125
+ if (!__weakUUIDWarned) {
126
+ __weakUUIDWarned = true;
127
+ console.warn('scoria generateUUID: Web Crypto API is unavailable; falling back to Math.random for UUID generation. The resulting identifiers are NOT cryptographically secure and must not be used for security tokens.');
128
+ }
42
129
  let d = new SvelteDate().getTime(),
43
130
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
44
131
  d2 = (typeof performance !== 'undefined' && performance.now && performance.now() * 1000) || 0;
@@ -55,6 +142,11 @@ export function generateUUID() {
55
142
  return (c == 'x' ? r : (r & 0x7) | 0x8).toString(16);
56
143
  });
57
144
  }
145
+ /**
146
+ * Creates a `RefWrapper<T>` whose `value` is `$state`-backed.
147
+ * Used to pass mutable reactive references into contexts and
148
+ * across module boundaries without exposing the underlying rune.
149
+ */
58
150
  export function refWrapper(initial) {
59
151
  let value = $state(initial);
60
152
  return {
@@ -66,6 +158,52 @@ export function refWrapper(initial) {
66
158
  },
67
159
  };
68
160
  }
161
+ /**
162
+ * Ergonomic constructor for the {@link CssLength} brand. The runtime
163
+ * value is the raw string the caller supplied; the cast is purely a
164
+ * compile-time tag. There is intentionally no validation - the
165
+ * browser is the authoritative parser for CSS length tokens. Use
166
+ * this at the call-site so the brand is obvious in the diff.
167
+ *
168
+ * @example
169
+ * ```ts
170
+ * <Icon name="cog" float left={cssLength('10px')} />
171
+ * ```
172
+ */
173
+ export function cssLength(value) {
174
+ return value;
175
+ }
176
+ /**
177
+ * Ergonomic constructor for the {@link ScoriaStorageKey} brand. Use
178
+ * at the call-site of components that persist state to
179
+ * `sessionStorage` / `localStorage` (e.g. `StepForm`,
180
+ * `VerticalTabGroup`) so the brand is obvious in the diff.
181
+ */
182
+ export function scoriaStorageKey(value) {
183
+ return value;
184
+ }
185
+ /**
186
+ * Ergonomic constructor for the {@link SyntheticColumnId} brand.
187
+ * Use at the call-site of `ColumnDef` constructors whose `id` is not
188
+ * a key on the row type (e.g. `RowSelectionDef`, `ExpandDef`,
189
+ * `ActionsDef`, `FilterOnlyDef`) so the brand is obvious in the diff.
190
+ *
191
+ * @example
192
+ * ```ts
193
+ * super({
194
+ * id: syntheticColumnId(`is-selectable-${generateUUID()}`),
195
+ * ...
196
+ * });
197
+ * ```
198
+ */
199
+ export function syntheticColumnId(value) {
200
+ return value;
201
+ }
202
+ /**
203
+ * Formats a date into the `YYYY-MM-DD 00:00:00` shape expected by
204
+ * the FloWMS SQL backend. Accepts bare `Date` objects or any
205
+ * branded date string scoria models elsewhere.
206
+ */
69
207
  export function SQLFriendly(date) {
70
208
  if (typeof date === 'string') {
71
209
  date = new SvelteDate(date);
@@ -75,22 +213,13 @@ export function SQLFriendly(date) {
75
213
  .toString()
76
214
  .padStart(2, '0')} 00:00:00`;
77
215
  }
216
+ /**
217
+ * Like {@link SQLFriendly} but keeps the local time component
218
+ * (`YYYY-MM-DDTHH:MM:SS±HH:MM`). Accepts an optional separate
219
+ * `timeDate` argument when the date and time-of-day need to come
220
+ * from different sources.
221
+ */
78
222
  export function SQLFriendlyWithLocalTime(date, timeDate) {
79
- if (typeof date === 'string') {
80
- // eslint-disable-next-line svelte/prefer-svelte-reactivity
81
- date = new Date(date);
82
- }
83
- if (typeof timeDate === 'string') {
84
- // eslint-disable-next-line svelte/prefer-svelte-reactivity
85
- timeDate = new Date(timeDate);
86
- }
87
- return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date
88
- .getDate()
89
- .toString()
90
- .padStart(2, '0')} ${localTimeFormat.format(timeDate ?? date)}`;
91
- }
92
- //HACK: transition will happen soon. Until then, this format cannot be used in production
93
- export function SQLFriendlyWithLocalTime_new(date, timeDate) {
94
223
  if (typeof date === 'string') {
95
224
  // eslint-disable-next-line svelte/prefer-svelte-reactivity
96
225
  date = new Date(date);
@@ -100,12 +229,17 @@ export function SQLFriendlyWithLocalTime_new(date, timeDate) {
100
229
  timeDate = new Date(timeDate);
101
230
  }
102
231
  const d = date;
103
- const t = (timeDate ?? date);
232
+ const t = timeDate ?? date;
104
233
  const pad = (n) => String(n).padStart(2, '0');
105
234
  const off = -t.getTimezoneOffset();
106
235
  const sign = off >= 0 ? '+' : '-';
107
236
  return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(t.getHours())}:${pad(t.getMinutes())}:${pad(t.getSeconds())}${sign}${pad(Math.floor(Math.abs(off) / 60))}:${pad(Math.abs(off) % 60)}`;
108
237
  }
238
+ /**
239
+ * Shared `Intl.DateTimeFormat` configured for UK locale, 24-hour
240
+ * clock, and the browser-resolved timezone. Useful for rendering
241
+ * timestamps consistently across scoria.
242
+ */
109
243
  export const localTimeFormat = new Intl.DateTimeFormat('en-GB', {
110
244
  hour: '2-digit',
111
245
  hourCycle: 'h23',
@@ -113,6 +247,13 @@ export const localTimeFormat = new Intl.DateTimeFormat('en-GB', {
113
247
  second: '2-digit',
114
248
  timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
115
249
  });
250
+ /**
251
+ * Default `onkeydown` handler that blurs the focused element when
252
+ * the user presses an alphanumeric key. Used on input wrappers
253
+ * and buttons so that scanner-driven barcode characters do not
254
+ * accumulate inside the focused field; instead the buffer goes
255
+ * to `UntypedInputContext`.
256
+ */
116
257
  export function passthrough(e) {
117
258
  if (!e.key.match(/^[a-zA-Z0-9[\]]$/gm)) {
118
259
  return;
@@ -120,6 +261,11 @@ export function passthrough(e) {
120
261
  e.target.blur();
121
262
  }
122
263
  let __canvas;
264
+ /**
265
+ * Returns a shared, memoised 2D canvas context used for offscreen
266
+ * text measurement (column auto-sizing, ellipsis truncation, etc).
267
+ * Returns `null` when the environment cannot create a `<canvas>`.
268
+ */
123
269
  export function getCanvasContext() {
124
270
  if (!__canvas) {
125
271
  const _canvas = document.createElement('canvas');
@@ -133,6 +279,7 @@ export function getCanvasContext() {
133
279
  }
134
280
  return __canvas.getContext('2d');
135
281
  }
282
+ /** Type guard for {@link IErrorResponse}. */
136
283
  export function isErrorResponse(error) {
137
284
  return (error != null &&
138
285
  typeof error === 'object' &&
@@ -140,9 +287,25 @@ export function isErrorResponse(error) {
140
287
  (Array.isArray(error.errors) || typeof error.errors === 'string') &&
141
288
  !!error.errors.length);
142
289
  }
290
+ /**
291
+ * Type guard for the structural-`Error` shape. Returns `true` for
292
+ * any object with a `string` `message` property, which covers both
293
+ * native `Error` and cross-realm error-like objects.
294
+ */
143
295
  export function isJSError(error) {
144
296
  return 'message' in error && typeof error.message == 'string';
145
297
  }
298
+ /**
299
+ * Best-effort extraction of a user-displayable error message from
300
+ * an unknown error value. Handles {@link IErrorResponse}, plain JS
301
+ * `Error`, and arbitrary strings; falls back to the literal
302
+ * `'Unknown Error'` when no recognisable shape is found.
303
+ *
304
+ * Callers that surface the output to the clipboard (e.g.
305
+ * `ToastContext.toast`) must gate `includeStack` and `includeCause`
306
+ * on `dev` so production users cannot accidentally exfiltrate
307
+ * backend internals.
308
+ */
146
309
  export function getErrorMessage(error, { includeUUID = true, includeStack = false, includeCause = false } = {}) {
147
310
  if (!error) {
148
311
  return 'Unknown Error';
@@ -180,11 +343,31 @@ export function getErrorMessage(error, { includeUUID = true, includeStack = fals
180
343
  }
181
344
  return errorList || 'Unknown Error';
182
345
  }
346
+ /**
347
+ * Pragmatic email-address validation regex. Module-lifted so the
348
+ * pattern object is reused across calls instead of recompiled on
349
+ * each invocation.
350
+ */
351
+ const EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
352
+ /**
353
+ * Returns `true` when the supplied string parses as a plausible
354
+ * email address. Lower-cases first so address-portion comparisons
355
+ * are case-insensitive. Not RFC-5322 exhaustive; intended for
356
+ * UI-level pre-submission validation only.
357
+ */
183
358
  export function isValidEmailAddress(emailAddress) {
184
- return emailAddress
185
- .toLowerCase()
186
- .match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|.(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
359
+ return EMAIL_REGEX.test(emailAddress.toLowerCase());
187
360
  }
361
+ /**
362
+ * Svelte action that resizes a CSS grid item to span the row count
363
+ * required by its first child's height. Useful for masonry-style
364
+ * layouts where rows are uniform but content height is dynamic.
365
+ *
366
+ * Returns a teardown that disconnects the underlying
367
+ * `ResizeObserver` entirely; the previous implementation only
368
+ * unobserved the child, which left the observer registered with
369
+ * the browser and leaked the reference.
370
+ */
188
371
  export function gridItem(element) {
189
372
  const firstChild = element.firstElementChild;
190
373
  if (!firstChild) {
@@ -202,9 +385,14 @@ export function gridItem(element) {
202
385
  });
203
386
  observer.observe(firstChild);
204
387
  return () => {
205
- observer.unobserve(firstChild);
388
+ observer.disconnect();
206
389
  };
207
390
  }
391
+ /**
392
+ * Resolves after `delay` milliseconds. The internal `setTimeout`
393
+ * call is wrapped in `untrack` so reactive scopes that `await`
394
+ * `asyncSleep` do not register the sleep as a dependency.
395
+ */
208
396
  export async function asyncSleep(delay) {
209
397
  await untrack(() => new Promise((r) => {
210
398
  void setTimeout(() => {
@@ -212,6 +400,15 @@ export async function asyncSleep(delay) {
212
400
  }, delay);
213
401
  }));
214
402
  }
403
+ /**
404
+ * Maps each element of `array` through `callback`, returning the
405
+ * result synchronously when every callback returns a non-Promise
406
+ * value and otherwise returning a `Promise<Array<R>>`.
407
+ *
408
+ * Tightening the return to `Promise<Array<R>>` unconditionally is
409
+ * tracked in the Helpers workorder; the union is preserved here to
410
+ * avoid microtask scheduling for purely-synchronous call sites.
411
+ */
215
412
  export function asyncMap(array, callback) {
216
413
  const results = new Array(array.length);
217
414
  const pending = [];
@@ -242,6 +439,12 @@ export function asyncMap(array, callback) {
242
439
  }
243
440
  return Promise.all(pending).then(() => results);
244
441
  }
442
+ /**
443
+ * Calls `callback` on every element of `array`. Returns `void`
444
+ * when no callback returned a Promise; otherwise returns a
445
+ * `Promise<void>` that resolves once every pending callback has
446
+ * settled.
447
+ */
245
448
  export function asyncForEach(array, callback) {
246
449
  const pending = [];
247
450
  try {
@@ -265,6 +468,10 @@ export function asyncForEach(array, callback) {
265
468
  }
266
469
  return Promise.all(pending).then(() => { });
267
470
  }
471
+ /**
472
+ * Maps each element to an array of `R` and concatenates the
473
+ * results. Sync fast-path matches {@link asyncMap}.
474
+ */
268
475
  export function asyncFlatMap(array, callback) {
269
476
  const results = new Array(array.length);
270
477
  const pending = [];
@@ -295,6 +502,10 @@ export function asyncFlatMap(array, callback) {
295
502
  }
296
503
  return Promise.all(pending).then(() => results.flat());
297
504
  }
505
+ /**
506
+ * Returns `true` as soon as any callback returns truthy.
507
+ * Short-circuits on synchronous truthy returns.
508
+ */
298
509
  export function asyncSome(array, callback) {
299
510
  const asyncItems = [];
300
511
  try {
@@ -327,6 +538,10 @@ export function asyncSome(array, callback) {
327
538
  Promise.all(promises).then((r) => r.some(Boolean)),
328
539
  ]);
329
540
  }
541
+ /**
542
+ * Returns `true` when every callback returns truthy.
543
+ * Short-circuits on the first synchronous falsy return.
544
+ */
330
545
  export function asyncAll(array, callback) {
331
546
  if (array.length === 0) {
332
547
  return true;
@@ -364,7 +579,12 @@ export function asyncAll(array, callback) {
364
579
  Promise.all(promises).then((r) => r.every(Boolean)),
365
580
  ]);
366
581
  }
582
+ /** Alias of {@link asyncAll}. */
367
583
  export const asyncEvery = asyncAll;
584
+ /**
585
+ * Filters the array by the result of `callback`, returning the
586
+ * indices of matching elements (sorted ascending).
587
+ */
368
588
  export function asyncFilterIndices(array, callback) {
369
589
  const filtered = [];
370
590
  const pending = [];
@@ -397,6 +617,10 @@ export function asyncFilterIndices(array, callback) {
397
617
  }
398
618
  return Promise.all(pending).then(() => filtered.sort((a, b) => a - b));
399
619
  }
620
+ /**
621
+ * Filters the array by the result of `callback`, returning the
622
+ * matching elements (sorted by their original index).
623
+ */
400
624
  export function asyncFilter(array, callback) {
401
625
  const filtered = asyncFilterIndices(array, callback);
402
626
  if (Array.isArray(filtered)) {
@@ -404,75 +628,47 @@ export function asyncFilter(array, callback) {
404
628
  }
405
629
  return filtered.then((f) => f.sort((a, b) => a - b).map((i) => array[i]));
406
630
  }
631
+ /**
632
+ * Promise-catch handler that logs in development and silently
633
+ * swallows in production. Intended for fire-and-forget tasks
634
+ * where the user-visible error path is already covered (e.g.
635
+ * `ToastContext.toast`).
636
+ */
407
637
  export function devCatch(e) {
408
638
  if (dev) {
409
639
  console.log(e);
410
640
  }
411
641
  }
412
- export function hasQuery(customFilter) {
413
- return (!!customFilter &&
414
- customFilter.type == CustomFilterType.Select &&
415
- !!customFilter.query &&
416
- typeof customFilter.query == 'function');
417
- }
642
+ /** Type guard for the date-range tuple shape used by the date filter. */
418
643
  export function isDateTuple(value) {
419
644
  return (Array.isArray(value) &&
420
645
  value.length < 3 &&
421
646
  (value[0] === null || (typeof value[0] == 'object' && value[0] instanceof Date)) &&
422
647
  (value[1] === null || (typeof value[1] == 'object' && value[1] instanceof Date)));
423
648
  }
649
+ /**
650
+ * Type guard for the numeric-range array shape used by the number
651
+ * filter (single number, single null, or [min, max] tuple).
652
+ */
424
653
  export function isNumericArray(value) {
425
654
  return Array.isArray(value) && (value[0] === null || typeof value[0] == 'number');
426
655
  }
656
+ /**
657
+ * Type guard distinguishing a bare {@link Validity} value from a
658
+ * {@link ValidityWrapper} object carrying both `value` and `reason`.
659
+ */
427
660
  export function isValidityTuple(v) {
428
661
  return v != null && typeof v == 'object';
429
662
  }
663
+ /** Unicode horizontal ellipsis (U+2026). */
430
664
  export const ellipses = '…';
665
+ /** Standard "loading..." placeholder text with U+2026 ellipsis. */
431
666
  export const loadingText = 'loading…';
667
+ /**
668
+ * Type-safe `in` check: narrows `key` to a known key of `obj`.
669
+ * Useful for indexing into objects when the index variable is
670
+ * typed as plain `string`.
671
+ */
432
672
  export function isKeyOf(key, obj) {
433
673
  return key in obj;
434
674
  }
435
- export function createLocalTable(args) {
436
- const localRepo = new LocalTableDataRepository(args.name, args.data, args.getUserId);
437
- return TableContext.init(args.defs, args.name, localRepo, {
438
- selectionExtractor: args.selectionExtractor,
439
- getUserId: args.getUserId,
440
- });
441
- }
442
- export function getAccessorSortingFn(accessorFn, desc) {
443
- return desc
444
- ? (_a, _b) => {
445
- const a = accessorFn(_a);
446
- const b = accessorFn(_b);
447
- if (a == undefined && b != undefined) {
448
- return 1;
449
- }
450
- if (b == undefined && a != undefined) {
451
- return -1;
452
- }
453
- if (a < b) {
454
- return 1;
455
- }
456
- if (a > b) {
457
- return -1;
458
- }
459
- return 0;
460
- }
461
- : (_a, _b) => {
462
- const a = accessorFn(_a);
463
- const b = accessorFn(_b);
464
- if (a == undefined && b != undefined) {
465
- return 1;
466
- }
467
- if (b == undefined && a != undefined) {
468
- return -1;
469
- }
470
- if (a < b) {
471
- return -1;
472
- }
473
- if (a > b) {
474
- return 1;
475
- }
476
- return 0;
477
- };
478
- }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Minimal "thing with a name" interface used by storybook fixtures
3
+ * and a handful of internal types. Prefer a more specific
4
+ * interface in new code; this is retained for backwards
5
+ * compatibility with existing consumers.
6
+ */
1
7
  export interface INamed {
2
8
  name: string;
3
9
  }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Attempt to load a key from `storage`, JSON-decode the slot, and pass
3
+ * the raw decoded value through `validator`. Returns the typed value on
4
+ * success or `fallback` on every failure path:
5
+ *
6
+ * - the slot is missing (`getItem` returned `null`);
7
+ * - the slot is not valid JSON (throws inside `JSON.parse` are caught);
8
+ * - the decoded value fails `validator`;
9
+ * - `storage` itself throws (private browsing, quota errors).
10
+ *
11
+ * All failure paths return `fallback`. When `dev` is true and a value is
12
+ * present but malformed, the helper emits a single `console.warn` so
13
+ * issues are visible during development without ever leaking into
14
+ * production logs.
15
+ *
16
+ * Storage is same-origin and writable by any script running in that
17
+ * origin, so any value retrieved here is untrusted: the validator is the
18
+ * only barrier between persisted data and downstream reactive state.
19
+ *
20
+ * @typeParam T The validated shape returned on success.
21
+ * @param storage `localStorage`, `sessionStorage`, or any `Storage`-shaped object.
22
+ * @param key The slot to read. Callers are responsible for namespacing.
23
+ * @param validator A type guard that decides whether `raw` is a `T`.
24
+ * @param fallback Value returned on every failure path.
25
+ * @returns The validated `T` on success, otherwise `fallback`.
26
+ */
27
+ export declare function readJSON<T>(storage: Storage, key: string, validator: (raw: unknown) => raw is T, fallback: T): T;
28
+ /**
29
+ * Persist `value` to `storage` as a JSON envelope of the shape
30
+ * `{ v: schemaVersion, value }`. The envelope lets readers
31
+ * (see {@link readVersionedJSON}) detect schema drift and drop entries
32
+ * written by an older or future build instead of feeding them into
33
+ * reactive state.
34
+ *
35
+ * Throws from `JSON.stringify` (circular references) or from `setItem`
36
+ * (quota errors, locked storage) are swallowed and logged via
37
+ * `console.warn` in `dev` only. Persistence failure is never fatal: the
38
+ * caller's in-memory state is the source of truth.
39
+ *
40
+ * @typeParam T The value type to persist.
41
+ * @param storage `localStorage`, `sessionStorage`, or any `Storage`-shaped object.
42
+ * @param key The slot to write. Callers are responsible for namespacing.
43
+ * @param value The value to serialise.
44
+ * @param schemaVersion An integer that bumps whenever the persisted
45
+ * shape changes in a backwards-incompatible way.
46
+ */
47
+ export declare function writeJSON<T>(storage: Storage, key: string, value: T, schemaVersion: number): void;
48
+ /**
49
+ * Read an envelope written by {@link writeJSON} and unwrap its `value`
50
+ * if the recorded schema version matches `currentVersion` and the
51
+ * inner value satisfies `validator`.
52
+ *
53
+ * Returns `fallback` for every failure path: missing slot, malformed
54
+ * JSON, missing envelope shape, version mismatch, validator rejection,
55
+ * or storage throws. A version mismatch is treated as silent rejection
56
+ * so that callers can roll the schema forward without leaving stale
57
+ * shapes in user storage.
58
+ *
59
+ * @typeParam T The validated inner value type.
60
+ * @param storage `localStorage`, `sessionStorage`, or any `Storage`-shaped object.
61
+ * @param key The slot to read. Callers are responsible for namespacing.
62
+ * @param currentVersion The schema version this reader expects.
63
+ * @param validator A type guard applied to the unwrapped inner value.
64
+ * @param fallback Value returned on every failure path.
65
+ * @returns The validated `T` on success, otherwise `fallback`.
66
+ */
67
+ export declare function readVersionedJSON<T>(storage: Storage, key: string, currentVersion: number, validator: (raw: unknown) => raw is T, fallback: T): T;