@hkdigital/lib-core 0.3.14 → 0.4.3

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 (324) hide show
  1. package/README.md +18 -9
  2. package/dist/auth/errors.d.ts +1 -0
  3. package/dist/auth/errors.js +1 -0
  4. package/dist/{states → browser/navigation}/navigation.svelte.js +1 -1
  5. package/dist/browser/navigation.d.ts +1 -0
  6. package/dist/browser/navigation.js +1 -0
  7. package/dist/config/README.md +5 -5
  8. package/dist/config/generators/imagetools.d.ts +2 -0
  9. package/dist/config/generators/imagetools.js +23 -10
  10. package/dist/config/generators/vite.js +1 -1
  11. package/dist/config/imagetools.d.ts +5 -5
  12. package/dist/config/typedef.d.ts +11 -0
  13. package/dist/config/typedef.js +17 -0
  14. package/dist/design/README.md +211 -66
  15. package/dist/design/config/{design-config.d.ts → design-tokens.d.ts} +23 -10
  16. package/dist/design/config/design-tokens.js +107 -0
  17. package/dist/design/generators/index.d.ts +51 -0
  18. package/dist/design/generators/index.js +124 -0
  19. package/dist/design/index.d.ts +3 -4
  20. package/dist/design/index.js +24 -41
  21. package/dist/design/plugins/skeleton.d.ts +4 -2
  22. package/dist/design/plugins/skeleton.js +3 -2
  23. package/dist/design/themes/hkdev/components/buttons/button-text.css +38 -25
  24. package/dist/design/themes/hkdev/theme-ext.js +1 -1
  25. package/dist/design/utils/clamp.js +1 -1
  26. package/dist/design/utils/root-vars.d.ts +50 -39
  27. package/dist/design/utils/root-vars.js +127 -29
  28. package/dist/{classes/data → generic/data/classes}/IterableTree.js +2 -2
  29. package/dist/{classes/data → generic/data/classes}/Selector.js +1 -1
  30. package/dist/generic/data/classes/typedef.d.ts +24 -0
  31. package/dist/generic/data/classes/typedef.js +14 -0
  32. package/dist/generic/data.d.ts +2 -0
  33. package/dist/generic/data.js +2 -0
  34. package/dist/generic/errors.d.ts +2 -0
  35. package/dist/generic/errors.js +2 -0
  36. package/dist/generic/events.d.ts +1 -0
  37. package/dist/generic/events.js +1 -0
  38. package/dist/{classes/promise → generic/promises/classes}/HkPromise.d.ts +17 -7
  39. package/dist/{classes/promise → generic/promises/classes}/HkPromise.js +20 -10
  40. package/dist/generic/promises.d.ts +1 -0
  41. package/dist/generic/promises.js +1 -0
  42. package/dist/{classes/streams → generic/streaming/classes}/ServerEventsStore.d.ts +1 -1
  43. package/dist/{classes/streams → generic/streaming/classes}/ServerEventsStore.js +2 -2
  44. package/dist/generic/streaming.d.ts +3 -0
  45. package/dist/generic/streaming.js +3 -0
  46. package/dist/generic/typedef.d.ts +1 -0
  47. package/dist/generic/typedef.js +1 -0
  48. package/dist/index.js +1 -0
  49. package/dist/logging/errors.d.ts +7 -0
  50. package/dist/logging/errors.js +11 -0
  51. package/dist/logging/index.d.ts +2 -3
  52. package/dist/logging/index.js +3 -4
  53. package/dist/logging/internal/adapters/console.d.ts +1 -16
  54. package/dist/logging/internal/adapters/console.js +322 -14
  55. package/dist/logging/internal/adapters/formatting.d.ts +69 -0
  56. package/dist/logging/internal/adapters/formatting.js +395 -0
  57. package/dist/logging/internal/adapters/pino.js +128 -27
  58. package/dist/logging/internal/adapters/typedef.d.ts +30 -0
  59. package/dist/logging/internal/adapters/typedef.js +11 -0
  60. package/dist/logging/internal/factories/client.js +1 -1
  61. package/dist/logging/internal/factories/server.js +12 -2
  62. package/dist/logging/internal/logger/Logger.d.ts +9 -7
  63. package/dist/logging/internal/logger/Logger.js +44 -9
  64. package/dist/logging/internal/test-errors.d.ts +35 -0
  65. package/dist/logging/internal/test-errors.js +137 -0
  66. package/dist/network/cache/IndexedDbCache.d.ts +1 -1
  67. package/dist/network/cache/MemoryResponseCache.d.ts +5 -0
  68. package/dist/network/cache/MemoryResponseCache.js +5 -2
  69. package/dist/network/errors.d.ts +2 -0
  70. package/dist/network/errors.js +2 -0
  71. package/dist/network/http/caching.js +1 -1
  72. package/dist/network/http/errors.d.ts +2 -2
  73. package/dist/network/http/errors.js +5 -13
  74. package/dist/network/http/http-request.js +1 -1
  75. package/dist/network/http/json-request.js +1 -1
  76. package/dist/network/http/response.js +1 -1
  77. package/dist/network/http/url.js +1 -1
  78. package/dist/network/loaders/README.md +14 -7
  79. package/dist/network/loaders/audio/AudioScene.svelte.js +3 -2
  80. package/dist/network/loaders/image/ImageLoader.svelte.d.ts +2 -2
  81. package/dist/network/loaders/image/ImageLoader.svelte.js +1 -1
  82. package/dist/network/loaders/image/ImageScene.svelte.d.ts +2 -2
  83. package/dist/network/loaders/image/ImageScene.svelte.js +9 -8
  84. package/dist/network/loaders/image/ImageVariantsLoader.svelte.d.ts +5 -5
  85. package/dist/network/loaders/image/ImageVariantsLoader.svelte.js +14 -13
  86. package/dist/network/loaders/image/utils/index.d.ts +2 -2
  87. package/dist/network/loaders/image/utils/index.js +9 -12
  88. package/dist/network/loaders/typedef.d.ts +0 -9
  89. package/dist/network/loaders/typedef.js +0 -12
  90. package/dist/network/states/NetworkLoader.svelte.d.ts +1 -1
  91. package/dist/network/states/NetworkLoader.svelte.js +3 -2
  92. package/dist/services/index.d.ts +0 -2
  93. package/dist/services/index.js +0 -3
  94. package/dist/services/service-base/ServiceBase.d.ts +2 -2
  95. package/dist/services/service-base/ServiceBase.js +15 -11
  96. package/dist/services/service-base/typedef.d.ts +2 -31
  97. package/dist/services/service-base/typedef.js +3 -2
  98. package/dist/services/service-manager/ServiceManager.d.ts +3 -3
  99. package/dist/services/service-manager/ServiceManager.js +2 -2
  100. package/dist/services/service-manager/typedef.d.ts +3 -3
  101. package/dist/services/service-manager/typedef.js +3 -3
  102. package/dist/services/typedef.d.ts +2 -0
  103. package/dist/services/typedef.js +2 -0
  104. package/dist/{classes/svelte → state/classes}/loading-state-machine/LoadingStateMachine.svelte.d.ts +1 -1
  105. package/dist/{classes/svelte → state/classes}/loading-state-machine/LoadingStateMachine.svelte.js +1 -1
  106. package/dist/state/classes/subscribers-count/index.d.ts +1 -0
  107. package/dist/state/classes/subscribers-count/index.js +1 -0
  108. package/dist/state/classes.d.ts +3 -0
  109. package/dist/state/classes.js +3 -0
  110. package/dist/{util/svelte/state-context/index.d.ts → state/context/state-context.d.ts} +1 -1
  111. package/dist/{util/svelte/state-context/index.js → state/context/state-context.js} +4 -4
  112. package/dist/state/context.d.ts +1 -0
  113. package/dist/state/context.js +1 -0
  114. package/dist/state/stores.d.ts +1 -0
  115. package/dist/state/stores.js +1 -0
  116. package/dist/ui/README.md +49 -0
  117. package/dist/ui/components/button-group/index.d.ts +1 -0
  118. package/dist/ui/components/button-group/index.js +1 -0
  119. package/dist/ui/{primitives → components}/drag-drop/DragDropContext.svelte +1 -1
  120. package/dist/ui/{primitives → components}/drag-drop/DragDropContext.svelte.d.ts +1 -1
  121. package/dist/ui/{primitives → components}/drag-drop/Draggable.svelte +2 -2
  122. package/dist/ui/{primitives → components}/drag-drop/Draggable.svelte.d.ts +1 -1
  123. package/dist/ui/{primitives → components}/drag-drop/DropZone.svelte +4 -4
  124. package/dist/ui/{primitives → components}/drag-drop/DropZone.svelte.d.ts +3 -3
  125. package/dist/ui/{primitives → components}/drag-drop/DropZoneArea.svelte +3 -3
  126. package/dist/ui/{primitives → components}/drag-drop/DropZoneArea.svelte.d.ts +4 -4
  127. package/dist/ui/{primitives → components}/drag-drop/DropZoneList.svelte +3 -3
  128. package/dist/ui/{primitives → components}/drag-drop/DropZoneList.svelte.d.ts +3 -3
  129. package/dist/ui/{primitives → components}/drag-drop/drag-state.svelte.d.ts +11 -11
  130. package/dist/ui/{primitives → components}/drag-drop/drag-state.svelte.js +5 -5
  131. package/dist/ui/components/drag-drop/typedef.d.ts +2 -0
  132. package/dist/ui/components/drag-drop/typedef.js +2 -0
  133. package/dist/ui/components/game-box/GameBox.svelte +1 -1
  134. package/dist/ui/components/game-box/index.d.ts +1 -0
  135. package/dist/ui/components/game-box/index.js +1 -0
  136. package/dist/ui/components/grid-layers/index.d.ts +1 -0
  137. package/dist/ui/components/grid-layers/index.js +1 -0
  138. package/dist/ui/{primitives/layout → components}/grid-layers/util.js +1 -1
  139. package/dist/ui/components/hk-app-layout/HkAppLayout.state.svelte.d.ts +3 -3
  140. package/dist/ui/components/hk-app-layout/HkAppLayout.state.svelte.js +3 -4
  141. package/dist/ui/components/hk-app-layout/index.d.ts +1 -0
  142. package/dist/ui/components/hk-app-layout/index.js +1 -0
  143. package/dist/ui/components/image-box/ImageBox.svelte +2 -2
  144. package/dist/ui/components/image-box/ImageBox.svelte.d.ts +3 -3
  145. package/dist/ui/components/image-box/index.d.ts +1 -1
  146. package/dist/ui/components/presenter/ImageSlide.svelte +1 -1
  147. package/dist/ui/components/presenter/ImageSlide.svelte.d.ts +2 -2
  148. package/dist/ui/components/presenter/Presenter.state.svelte.d.ts +3 -3
  149. package/dist/ui/components/presenter/Presenter.state.svelte.js +1 -1
  150. package/dist/ui/components/presenter/Presenter.svelte +1 -1
  151. package/dist/ui/components/presenter/Presenter.svelte.d.ts +1 -1
  152. package/dist/ui/{primitives → components}/rows/panel-grid-row/PanelGridRow.svelte.d.ts +1 -1
  153. package/dist/ui/{primitives → components}/rows/panel-row-2/PanelRow2.svelte.d.ts +1 -1
  154. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.state.svelte.d.ts +3 -3
  155. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.state.svelte.js +4 -2
  156. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.svelte +2 -2
  157. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.svelte.d.ts +2 -2
  158. package/dist/ui/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +19 -0
  159. package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.state.svelte.js +2 -2
  160. package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.svelte +1 -1
  161. package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.svelte.d.ts +2 -2
  162. package/dist/ui/{primitives → components}/tab-bar/typedef.d.ts +1 -1
  163. package/dist/ui/{primitives → components}/tab-bar/typedef.js +1 -1
  164. package/dist/ui/components/typedef.d.ts +5 -0
  165. package/dist/ui/components/typedef.js +5 -0
  166. package/dist/ui/components/virtual-viewport/index.d.ts +1 -0
  167. package/dist/ui/components/virtual-viewport/index.js +1 -0
  168. package/dist/ui/components.d.ts +11 -0
  169. package/dist/ui/components.js +11 -0
  170. package/dist/ui/{primitives/hkdev → dev}/blocks/TextBlock.svelte +1 -1
  171. package/dist/ui/{primitives/debug → dev}/debug-panel-design-scaling/DebugPanelDesignScaling.svelte +8 -8
  172. package/dist/ui/dev.d.ts +3 -0
  173. package/dist/ui/dev.js +3 -0
  174. package/dist/ui/primitives/buttons/button/Button.svelte.d.ts +1 -1
  175. package/dist/ui/primitives/buttons/button-text/TextButton.svelte +1 -1
  176. package/dist/ui/primitives/typedef.d.ts +1 -0
  177. package/dist/ui/primitives/typedef.js +1 -0
  178. package/dist/ui/primitives.d.ts +5 -0
  179. package/dist/ui/primitives.js +5 -0
  180. package/dist/ui/typedef.d.ts +2 -0
  181. package/dist/ui/typedef.js +2 -0
  182. package/dist/util/array/index.js +1 -1
  183. package/dist/util/bases/base58.d.ts +3 -3
  184. package/dist/util/bases/base58.js +3 -3
  185. package/dist/util/compare/index.d.ts +4 -5
  186. package/dist/util/compare/index.js +3 -4
  187. package/dist/util/exceptions/index.js +1 -1
  188. package/dist/util/expect/arrays.d.ts +11 -11
  189. package/dist/util/expect/arrays.js +14 -6
  190. package/dist/util/expect/index.js +2 -2
  191. package/dist/util/expect/primitives.d.ts +6 -5
  192. package/dist/util/expect/primitives.js +15 -5
  193. package/dist/util/expect/url.d.ts +6 -5
  194. package/dist/util/expect/url.js +15 -5
  195. package/dist/util/function/index.d.ts +1 -14
  196. package/dist/util/index.d.ts +5 -0
  197. package/dist/util/index.js +13 -0
  198. package/dist/util/is/index.d.ts +3 -2
  199. package/dist/util/is/index.js +2 -1
  200. package/dist/util/iterate/index.d.ts +6 -8
  201. package/dist/util/iterate/index.js +5 -5
  202. package/dist/util/object/index.d.ts +1 -2
  203. package/dist/util/object/index.js +2 -3
  204. package/dist/util/ssr/index.d.ts +16 -0
  205. package/dist/util/ssr/index.js +44 -0
  206. package/dist/util/svelte/index.d.ts +1 -1
  207. package/dist/util/svelte/index.js +1 -1
  208. package/dist/util/time/index.d.ts +2 -2
  209. package/dist/util/time/index.js +1 -1
  210. package/dist/valibot/index.d.ts +1 -1
  211. package/dist/valibot/index.js +27 -1
  212. package/package.json +4 -4
  213. package/dist/assets/autospuiten/car-paint-picker/army-green.jpg +0 -0
  214. package/dist/assets/autospuiten/car-paint-picker/electric-blue.jpg +0 -0
  215. package/dist/assets/autospuiten/car-paint-picker/lemon-yellow.jpg +0 -0
  216. package/dist/assets/autospuiten/car-paint-picker/opaque-purple.jpg +0 -0
  217. package/dist/assets/autospuiten/car-paint-picker/rusty.jpg +0 -0
  218. package/dist/assets/autospuiten/car-paint-picker/sunset-orange.jpg +0 -0
  219. package/dist/assets/autospuiten/car-paint-picker/tomato-red.jpg +0 -0
  220. package/dist/assets/autospuiten/car-paint-picker.d.ts +0 -17
  221. package/dist/assets/autospuiten/car-paint-picker.js +0 -41
  222. package/dist/assets/autospuiten/labels.d.ts +0 -7
  223. package/dist/assets/autospuiten/labels.js +0 -7
  224. package/dist/classes/data/index.d.ts +0 -2
  225. package/dist/classes/data/index.js +0 -2
  226. package/dist/classes/event-emitter/index.d.ts +0 -1
  227. package/dist/classes/event-emitter/index.js +0 -2
  228. package/dist/classes/index.d.ts +0 -4
  229. package/dist/classes/index.js +0 -4
  230. package/dist/classes/promise/index.d.ts +0 -1
  231. package/dist/classes/promise/index.js +0 -1
  232. package/dist/classes/stores/index.d.ts +0 -1
  233. package/dist/classes/stores/index.js +0 -1
  234. package/dist/classes/streams/index.d.ts +0 -3
  235. package/dist/classes/streams/index.js +0 -3
  236. package/dist/classes/svelte/index.d.ts +0 -1
  237. package/dist/classes/svelte/index.js +0 -1
  238. package/dist/design/config/design-config.js +0 -73
  239. package/dist/design/tailwind-theme-extend.d.ts +0 -23
  240. package/dist/design/tailwind-theme-extend.js +0 -158
  241. package/dist/errors/index.d.ts +0 -5
  242. package/dist/errors/index.js +0 -5
  243. package/dist/logging/internal/factories/universal.d.ts +0 -9
  244. package/dist/logging/internal/factories/universal.js +0 -22
  245. package/dist/services/service-base/index.d.ts +0 -3
  246. package/dist/services/service-base/index.js +0 -3
  247. package/dist/states/index.d.ts +0 -1
  248. package/dist/states/index.js +0 -1
  249. package/dist/stores/index.d.ts +0 -1
  250. package/dist/stores/index.js +0 -1
  251. package/dist/typedef/index.d.ts +0 -4
  252. package/dist/typedef/index.js +0 -4
  253. package/dist/ui/primitives/debug/index.d.ts +0 -1
  254. package/dist/ui/primitives/debug/index.js +0 -1
  255. package/dist/ui/primitives/index.d.ts +0 -0
  256. package/dist/ui/primitives/index.js +0 -2
  257. package/dist/ui/primitives/layout/grid-layers/GridLayers.svelte__heightFrom__ +0 -372
  258. package/dist/ui/primitives/layout/index.d.ts +0 -1
  259. package/dist/ui/primitives/layout/index.js +0 -1
  260. package/dist/ui/primitives/tab-bar/HkTabBarSelector.state.svelte.d.ts +0 -19
  261. /package/dist/{errors → auth/errors}/jwt.d.ts +0 -0
  262. /package/dist/{errors → auth/errors}/jwt.js +0 -0
  263. /package/dist/{states → browser/navigation}/navigation.svelte.d.ts +0 -0
  264. /package/dist/{classes/data → generic/data/classes}/IterableTree.d.ts +0 -0
  265. /package/dist/{classes/data → generic/data/classes}/Selector.d.ts +0 -0
  266. /package/dist/{classes → generic}/data/typedef.d.ts +0 -0
  267. /package/dist/{classes → generic}/data/typedef.js +0 -0
  268. /package/dist/{errors → generic/errors}/generic.d.ts +0 -0
  269. /package/dist/{errors → generic/errors}/generic.js +0 -0
  270. /package/dist/{errors → generic/errors}/promise.d.ts +0 -0
  271. /package/dist/{errors → generic/errors}/promise.js +0 -0
  272. /package/dist/{classes/event-emitter → generic/events/classes}/EventEmitter.d.ts +0 -0
  273. /package/dist/{classes/event-emitter → generic/events/classes}/EventEmitter.js +0 -0
  274. /package/dist/{classes/streams → generic/streaming/classes}/LogTransformStream.d.ts +0 -0
  275. /package/dist/{classes/streams → generic/streaming/classes}/LogTransformStream.js +0 -0
  276. /package/dist/{classes/streams → generic/streaming/classes}/TimeStampSource.d.ts +0 -0
  277. /package/dist/{classes/streams → generic/streaming/classes}/TimeStampSource.js +0 -0
  278. /package/dist/logging/{internal/constants.d.ts → constants.d.ts} +0 -0
  279. /package/dist/logging/{internal/constants.js → constants.js} +0 -0
  280. /package/dist/logging/{internal/typedef.d.ts → typedef.d.ts} +0 -0
  281. /package/dist/logging/{internal/typedef.js → typedef.js} +0 -0
  282. /package/dist/{errors → network/errors}/api.d.ts +0 -0
  283. /package/dist/{errors → network/errors}/api.js +0 -0
  284. /package/dist/{errors → network/errors}/http.d.ts +0 -0
  285. /package/dist/{errors → network/errors}/http.js +0 -0
  286. /package/dist/{classes/svelte → state/classes}/finite-state-machine/FiniteStateMachine.svelte.d.ts +0 -0
  287. /package/dist/{classes/svelte → state/classes}/finite-state-machine/FiniteStateMachine.svelte.js +0 -0
  288. /package/dist/{classes/svelte → state/classes}/finite-state-machine/index.d.ts +0 -0
  289. /package/dist/{classes/svelte → state/classes}/finite-state-machine/index.js +0 -0
  290. /package/dist/{classes/svelte → state/classes}/loading-state-machine/constants.d.ts +0 -0
  291. /package/dist/{classes/svelte → state/classes}/loading-state-machine/constants.js +0 -0
  292. /package/dist/{classes/svelte → state/classes}/loading-state-machine/index.d.ts +0 -0
  293. /package/dist/{classes/svelte → state/classes}/loading-state-machine/index.js +0 -0
  294. /package/dist/{classes/stores → state/classes/subscribers-count}/SubscribersCount.d.ts +0 -0
  295. /package/dist/{classes/stores → state/classes/subscribers-count}/SubscribersCount.js +0 -0
  296. /package/dist/{typedef/context.d.ts → state/context/typedef.d.ts} +0 -0
  297. /package/dist/{typedef/context.js → state/context/typedef.js} +0 -0
  298. /package/dist/{stores → state/stores}/theme.d.ts +0 -0
  299. /package/dist/{stores → state/stores}/theme.js +0 -0
  300. /package/dist/ui/{primitives → components}/drag-drop/DragController.d.ts +0 -0
  301. /package/dist/ui/{primitives → components}/drag-drop/DragController.js +0 -0
  302. /package/dist/ui/{primitives → components}/drag-drop/actions.d.ts +0 -0
  303. /package/dist/ui/{primitives → components}/drag-drop/actions.js +0 -0
  304. /package/dist/ui/{primitives → components}/drag-drop/index.d.ts +0 -0
  305. /package/dist/ui/{primitives → components}/drag-drop/index.js +0 -0
  306. /package/dist/{typedef → ui/components/drag-drop/typedef}/drag.d.ts +0 -0
  307. /package/dist/{typedef → ui/components/drag-drop/typedef}/drag.js +0 -0
  308. /package/dist/{typedef → ui/components/drag-drop/typedef}/drop.d.ts +0 -0
  309. /package/dist/{typedef → ui/components/drag-drop/typedef}/drop.js +0 -0
  310. /package/dist/ui/{primitives → components}/drag-drop/util.d.ts +0 -0
  311. /package/dist/ui/{primitives → components}/drag-drop/util.js +0 -0
  312. /package/dist/ui/{primitives/layout → components}/grid-layers/GridLayers.svelte +0 -0
  313. /package/dist/ui/{primitives/layout → components}/grid-layers/GridLayers.svelte.d.ts +0 -0
  314. /package/dist/ui/{primitives/layout → components}/grid-layers/util.d.ts +0 -0
  315. /package/dist/ui/{primitives → components}/rows/index.d.ts +0 -0
  316. /package/dist/ui/{primitives → components}/rows/index.js +0 -0
  317. /package/dist/ui/{primitives → components}/rows/panel-grid-row/PanelGridRow.svelte +0 -0
  318. /package/dist/ui/{primitives → components}/rows/panel-row-2/PanelRow2.svelte +0 -0
  319. /package/dist/ui/{primitives → components}/tab-bar/index.d.ts +0 -0
  320. /package/dist/ui/{primitives → components}/tab-bar/index.js +0 -0
  321. /package/dist/ui/{primitives/hkdev → dev}/blocks/TextBlock.svelte.d.ts +0 -0
  322. /package/dist/ui/{primitives/hkdev → dev}/buttons/CheckButton.svelte +0 -0
  323. /package/dist/ui/{primitives/hkdev → dev}/buttons/CheckButton.svelte.d.ts +0 -0
  324. /package/dist/ui/{primitives/debug → dev}/debug-panel-design-scaling/DebugPanelDesignScaling.svelte.d.ts +0 -0
@@ -55,9 +55,10 @@ export function iterable(value: any): boolean;
55
55
  *
56
56
  * @param {any} value
57
57
  *
58
- * @returns {boolean} true if the value is an Object, but not a Promise
58
+ * @returns {value is object}
59
+ * True if the value is an Object, but not a Promise
59
60
  */
60
- export function object(value: any): boolean;
61
+ export function object(value: any): value is object;
61
62
  export { argumentsCheck as arguments };
62
63
  /**
63
64
  * Check if a value is an Arguments object
@@ -129,7 +129,8 @@ export function iterable(value) {
129
129
  *
130
130
  * @param {any} value
131
131
  *
132
- * @returns {boolean} true if the value is an Object, but not a Promise
132
+ * @returns {value is object}
133
+ * True if the value is an Object, but not a Promise
133
134
  */
134
135
  export function object(value) {
135
136
  if (!(value instanceof Object)) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @typedef {import('../../classes/data/typedef.js').IterableTreeOptions} IterableTreeOptions
2
+ * @typedef {import('../../generic/typedef.js').IterableTreeOptions} IterableTreeOptions
3
3
  */
4
4
  /**
5
5
  * Filter all iterated elements
@@ -45,7 +45,7 @@ export function map(iterable: Iterable<any>, transformFn: Function): Generator;
45
45
  * @param {boolean} [options.depthFirst=true]
46
46
  * If true, use depth-first traversal, otherwise breadth-first
47
47
  *
48
- * @return {Iterator} iterator object
48
+ * @return {Iterable<[string[], any]>} iterable that yields [path, value] pairs
49
49
  */
50
50
  export function iterateObjectEntries(obj: object, options?: {
51
51
  walkArrays?: boolean;
@@ -53,19 +53,17 @@ export function iterateObjectEntries(obj: object, options?: {
53
53
  outputIntermediateNodes?: boolean;
54
54
  ignoreEmptyObjectLeaves?: boolean;
55
55
  depthFirst?: boolean;
56
- }): Iterator<any, any, any>;
56
+ }): Iterable<[string[], any]>;
57
57
  /**
58
58
  * Get an Iterator object that can be used to iterate over all paths in
59
59
  * the object
60
60
  *
61
61
  * @param {object} obj - Object to iterate
62
- * @param {IterableTreeOptions & { depthFirst: boolean}} [options]
62
+ * @param {import('../../generic/data/classes/typedef.js').IterableTreeOptions} [options]
63
63
  *
64
64
  * @return {Iterable<string[]>} iterable object that yields path arrays
65
65
  */
66
- export function iterateObjectPaths(obj: object, options?: IterableTreeOptions & {
67
- depthFirst: boolean;
68
- }): Iterable<string[]>;
66
+ export function iterateObjectPaths(obj: object, options?: import("../../generic/data/classes/typedef.js").IterableTreeOptions): Iterable<string[]>;
69
67
  /**
70
68
  * Get an Iterator object that can be used to iterate over all values in
71
69
  * the object (at the leaves of the object tree)
@@ -96,4 +94,4 @@ export function sortObjects({ it, getValueFn, reversed }: {
96
94
  getValueFn: Function;
97
95
  reversed?: boolean;
98
96
  }): Promise<any[]>;
99
- export type IterableTreeOptions = import("../../classes/data/typedef.js").IterableTreeOptions;
97
+ export type IterableTreeOptions = import("../../generic/typedef.js").IterableTreeOptions;
@@ -3,10 +3,10 @@
3
3
  import * as expect from '../expect/index.js';
4
4
  import { smallestFirst, largestFirst } from '../compare/index.js';
5
5
 
6
- import IterableTree from '../../classes/data/IterableTree.js';
6
+ import { IterableTree } from '../../generic/data.js';
7
7
 
8
8
  /**
9
- * @typedef {import('../../classes/data/typedef.js').IterableTreeOptions} IterableTreeOptions
9
+ * @typedef {import('../../generic/typedef.js').IterableTreeOptions} IterableTreeOptions
10
10
  */
11
11
 
12
12
  /* ------------------------------------------------------------------ Exports */
@@ -77,7 +77,7 @@ export function* map(iterable, transformFn) {
77
77
  * @param {boolean} [options.depthFirst=true]
78
78
  * If true, use depth-first traversal, otherwise breadth-first
79
79
  *
80
- * @return {Iterator} iterator object
80
+ * @return {Iterable<[string[], any]>} iterable that yields [path, value] pairs
81
81
  */
82
82
  export function iterateObjectEntries(obj, options = {}) {
83
83
  let objectIterator;
@@ -108,11 +108,11 @@ export function iterateObjectEntries(obj, options = {}) {
108
108
  * the object
109
109
  *
110
110
  * @param {object} obj - Object to iterate
111
- * @param {IterableTreeOptions & { depthFirst: boolean}} [options]
111
+ * @param {import('../../generic/data/classes/typedef.js').IterableTreeOptions} [options]
112
112
  *
113
113
  * @return {Iterable<string[]>} iterable object that yields path arrays
114
114
  */
115
- export function iterateObjectPaths(obj, options) {
115
+ export function iterateObjectPaths(obj, options = {}) {
116
116
  let objectIterator;
117
117
 
118
118
  const depthFirst =
@@ -93,9 +93,8 @@ export function objectSet(obj: object, path: string | any[], value: any, ...args
93
93
  * Removes a value at the specified object path from the object.
94
94
  * - All parent objects that remain empty will be removed too (recursively)
95
95
  *
96
- * @param {object} obj - Object to set the value in
96
+ * @param {object} obj - Object to delete the path from
97
97
  * @param {string|Array} path - Dot separated string path or array path
98
- * @param {any} value - value to set
99
98
  */
100
99
  export function deletePath(obj: object, path: string | any[]): void;
101
100
  /**
@@ -382,9 +382,8 @@ export function objectSet(obj, path, value) {
382
382
  * Removes a value at the specified object path from the object.
383
383
  * - All parent objects that remain empty will be removed too (recursively)
384
384
  *
385
- * @param {object} obj - Object to set the value in
385
+ * @param {object} obj - Object to delete the path from
386
386
  * @param {string|Array} path - Dot separated string path or array path
387
- * @param {any} value - value to set
388
387
  */
389
388
  export function deletePath(obj, path) {
390
389
  expect.object(obj);
@@ -777,7 +776,7 @@ export function patchObject(obj, changes, options = {}) {
777
776
  throw new Error(`Cannot set value [${path}=undefined]`);
778
777
  }
779
778
 
780
- if (ignoreAdd && Object._get(obj, path) === undefined) {
779
+ if (ignoreAdd && objectGet(obj, path) === undefined) {
781
780
  // Ignore add
782
781
  continue;
783
782
  } else if (ignoreUpdate && objectGet(obj, path) !== undefined) {
@@ -0,0 +1,16 @@
1
+ /**
2
+ * SSR context detection and prevention utilities
3
+ */
4
+ /**
5
+ * Detect if we're being called during SSR/build evaluation
6
+ * This helps catch improper usage that causes serialization issues
7
+ *
8
+ * @returns {boolean} True if in SSR context
9
+ */
10
+ export function detectSSRContext(): boolean;
11
+ /**
12
+ * Throws an error if called during SSR context with helpful guidance
13
+ *
14
+ * @throws {Error} When called in SSR context
15
+ */
16
+ export function expectNoSSRContext(): void;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * SSR context detection and prevention utilities
3
+ */
4
+
5
+ /**
6
+ * Detect if we're being called during SSR/build evaluation
7
+ * This helps catch improper usage that causes serialization issues
8
+ *
9
+ * @returns {boolean} True if in SSR context
10
+ */
11
+ export function detectSSRContext() {
12
+ // During development, check if this is module-level evaluation in server routes
13
+ const stack = new Error().stack;
14
+
15
+ if (stack) {
16
+ // Look for server route files in the stack
17
+ const serverRoutePattern = /\+(?:page|layout)\.server\.js|\+server\.js/;
18
+ const hasServerRoute = serverRoutePattern.test(stack);
19
+
20
+ // Be more aggressive - catch any server route context
21
+ if (hasServerRoute) {
22
+ return true;
23
+ }
24
+ }
25
+
26
+ return false;
27
+ }
28
+
29
+ /**
30
+ * Throws an error if called during SSR context with helpful guidance
31
+ *
32
+ * @throws {Error} When called in SSR context
33
+ */
34
+ export function expectNoSSRContext() {
35
+ if (detectSSRContext()) {
36
+ const errorMessage = `
37
+ ╭─────────────────────────────────────────────────────────────╮
38
+ │ Code should not run in SSR Context │
39
+ ╰─────────────────────────────────────────────────────────────╯`;
40
+
41
+ console.error(errorMessage);
42
+ throw new Error('This code should not run in SSR context');
43
+ }
44
+ }
@@ -1,3 +1,3 @@
1
1
  export * as observe from "./observe/index.js";
2
- export * as stateContext from "./state-context/index.js";
2
+ export * as stateContext from "../../state/context/state-context.js";
3
3
  export * as loading from "./loading/loading-tracker.svelte.js";
@@ -1,4 +1,4 @@
1
1
  export * as observe from './observe/index.js';
2
- export * as stateContext from './state-context/index.js';
2
+ export * as stateContext from '../../state/context/state-context.js';
3
3
 
4
4
  export * as loading from './loading/loading-tracker.svelte.js';
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * @returns {HkPromise} promise that resolves after a specified timeout
14
14
  */
15
- export function delay(delayOrMinDelayMs: number, maxDelayMs?: number): HkPromise;
15
+ export function delay(delayOrMinDelayMs: number, maxDelayMs?: number): HkPromise<any>;
16
16
  /**
17
17
  * Get the number of milliseconds since the specified time stamp of the default
18
18
  * reference time stamp TIME_2025_01_01
@@ -105,4 +105,4 @@ export function getTimeAtStartOfDay(dateOrTimestamp?: Date | number): number;
105
105
  * @returns {number} timestamp of start of the day
106
106
  */
107
107
  export function getTimeAtEndOfDay(dateOrTimestamp?: Date | number): number;
108
- import { HkPromise } from '../../classes/promise/index.js';
108
+ import { HkPromise } from '../../generic/promises.js';
@@ -37,7 +37,7 @@ import {
37
37
  } from '../../constants/time/index.js';
38
38
 
39
39
  import * as expect from '../expect';
40
- import { HkPromise } from '../../classes/promise/index.js';
40
+ import { HkPromise } from '../../generic/promises.js';
41
41
 
42
42
  /**
43
43
  * Returns a promise that resolves after a specified timeout
@@ -1,4 +1,4 @@
1
1
  export * from "./parsers.js";
2
- export { valibot as v };
3
2
  export default valibot;
3
+ export const v: any;
4
4
  import * as valibot from 'valibot';
@@ -4,5 +4,31 @@ import * as valibot from 'valibot';
4
4
 
5
5
  export * from './parsers.js';
6
6
 
7
- export { valibot as v };
7
+ /**
8
+ * Custom parse function that wraps valibot's original parse
9
+ * for better stack trace detection in error logging
10
+ */
11
+ function valibotParser(schema, input, config) {
12
+ return valibot.parse(schema, input, config);
13
+ }
14
+
15
+ // Create a new object that inherits from valibot but overrides parse
16
+ const v = Object.create(valibot);
17
+
18
+ // Use defineProperty to explicitly set our properties
19
+ Object.defineProperty(v, 'originalParse', {
20
+ value: valibot.parse,
21
+ writable: true,
22
+ enumerable: false,
23
+ configurable: true
24
+ });
25
+
26
+ Object.defineProperty(v, 'parse', {
27
+ value: valibotParser,
28
+ writable: true,
29
+ enumerable: true,
30
+ configurable: true
31
+ });
32
+
33
+ export { v };
8
34
  export default valibot;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.3.14",
3
+ "version": "0.4.3",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
@@ -8,7 +8,7 @@
8
8
  "license": "ISC",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/HKdigital/hkdigital--lib-sveltekit.git"
11
+ "url": "git+https://github.com/HKdigital/hkdigital--lib-core.git"
12
12
  },
13
13
  "keywords": [
14
14
  "component-library",
@@ -69,8 +69,7 @@
69
69
  "svelte": "./dist/index.js",
70
70
  "default": "./dist/index.js"
71
71
  },
72
- "./*": "./dist/*",
73
- "./typedef": "./dist/typedef/index.js"
72
+ "./*": "./dist/*"
74
73
  },
75
74
  "peerDependencies": {
76
75
  "@eslint/js": "^9.28.0",
@@ -97,6 +96,7 @@
97
96
  "@testing-library/svelte": "^5.2.7",
98
97
  "@testing-library/user-event": "^14.6.1",
99
98
  "@types/eslint": "^9.6.1",
99
+ "@types/node": "^24.2.1",
100
100
  "autoprefixer": "^10.4.21",
101
101
  "eslint": "^9.28.0",
102
102
  "eslint-config-prettier": "^10.1.5",
@@ -1,17 +0,0 @@
1
- export const carPaintImages: {
2
- rusty: import("../../network/typedef.js").ImageMeta[];
3
- "army-green": import("../../network/typedef.js").ImageMeta[];
4
- "electric-blue": import("../../network/typedef.js").ImageMeta[];
5
- "lemon-yellow": import("../../network/typedef.js").ImageMeta[];
6
- "opaque-purple": import("../../network/typedef.js").ImageMeta[];
7
- "sunset-orange": import("../../network/typedef.js").ImageMeta[];
8
- "tomato-red": import("../../network/typedef.js").ImageMeta[];
9
- };
10
- import Rusty from './car-paint-picker/rusty.jpg?preset=render&responsive';
11
- import ArmyGreen from './car-paint-picker/army-green.jpg?preset=render&responsive';
12
- import ElectricBlue from './car-paint-picker/electric-blue.jpg?preset=render&responsive';
13
- import LemonYellow from './car-paint-picker/lemon-yellow.jpg?preset=render&responsive';
14
- import OpaquePurple from './car-paint-picker/opaque-purple.jpg?preset=render&responsive';
15
- import SunsetOrange from './car-paint-picker/sunset-orange.jpg?preset=render&responsive';
16
- import TomatoRed from './car-paint-picker/tomato-red.jpg?preset=render&responsive';
17
- export { Rusty, ArmyGreen, ElectricBlue, LemonYellow, OpaquePurple, SunsetOrange, TomatoRed };
@@ -1,41 +0,0 @@
1
- import {
2
- LABEL_RUSTY,
3
- LABEL_ARMY_GREEN,
4
- LABEL_ELECTRIC_BLUE,
5
- LABEL_LEMON_YELLOW,
6
- LABEL_OPAQUE_PURPLE,
7
- LABEL_SUNSET_ORANGE,
8
- LABEL_TOMATO_RED
9
- } from './labels.js';
10
-
11
- import Rusty from './car-paint-picker/rusty.jpg?preset=render&responsive';
12
-
13
- import ArmyGreen from './car-paint-picker/army-green.jpg?preset=render&responsive';
14
- import ElectricBlue from './car-paint-picker/electric-blue.jpg?preset=render&responsive';
15
- import LemonYellow from './car-paint-picker/lemon-yellow.jpg?preset=render&responsive';
16
- import OpaquePurple from './car-paint-picker/opaque-purple.jpg?preset=render&responsive';
17
- import SunsetOrange from './car-paint-picker/sunset-orange.jpg?preset=render&responsive';
18
- import TomatoRed from './car-paint-picker/tomato-red.jpg?preset=render&responsive';
19
-
20
- // console.log('ArmyGreen', ArmyGreen);
21
-
22
- export const carPaintImages = {
23
- [LABEL_RUSTY]: Rusty,
24
- [LABEL_ARMY_GREEN]: ArmyGreen,
25
- [LABEL_ELECTRIC_BLUE]: ElectricBlue,
26
- [LABEL_LEMON_YELLOW]: LemonYellow,
27
- [LABEL_OPAQUE_PURPLE]: OpaquePurple,
28
- [LABEL_SUNSET_ORANGE]: SunsetOrange,
29
- [LABEL_TOMATO_RED]: TomatoRed
30
- };
31
-
32
- /* Also export as individual images */
33
- export {
34
- Rusty,
35
- ArmyGreen,
36
- ElectricBlue,
37
- LemonYellow,
38
- OpaquePurple,
39
- SunsetOrange,
40
- TomatoRed
41
- };
@@ -1,7 +0,0 @@
1
- export const LABEL_RUSTY: "rusty";
2
- export const LABEL_ARMY_GREEN: "army-green";
3
- export const LABEL_ELECTRIC_BLUE: "electric-blue";
4
- export const LABEL_LEMON_YELLOW: "lemon-yellow";
5
- export const LABEL_OPAQUE_PURPLE: "opaque-purple";
6
- export const LABEL_SUNSET_ORANGE: "sunset-orange";
7
- export const LABEL_TOMATO_RED: "tomato-red";
@@ -1,7 +0,0 @@
1
- export const LABEL_RUSTY = 'rusty';
2
- export const LABEL_ARMY_GREEN = 'army-green';
3
- export const LABEL_ELECTRIC_BLUE = 'electric-blue';
4
- export const LABEL_LEMON_YELLOW = 'lemon-yellow';
5
- export const LABEL_OPAQUE_PURPLE = 'opaque-purple';
6
- export const LABEL_SUNSET_ORANGE = 'sunset-orange';
7
- export const LABEL_TOMATO_RED = 'tomato-red';
@@ -1,2 +0,0 @@
1
- export { default as Selector } from "./Selector.js";
2
- export { default as IterableTree } from "./IterableTree.js";
@@ -1,2 +0,0 @@
1
- export { default as Selector } from './Selector.js';
2
- export { default as IterableTree } from './IterableTree.js';
@@ -1 +0,0 @@
1
- export { default as EventEmitter } from "./EventEmitter.js";
@@ -1,2 +0,0 @@
1
-
2
- export { default as EventEmitter } from './EventEmitter.js';
@@ -1,4 +0,0 @@
1
- export * as data from "./data/index.js";
2
- export * as streams from "./streams/index.js";
3
- export * as stores from "./stores/index.js";
4
- export * as svelte from "./svelte/index.js";
@@ -1,4 +0,0 @@
1
- export * as data from './data/index.js';
2
- export * as streams from './streams/index.js';
3
- export * as stores from './stores/index.js';
4
- export * as svelte from './svelte/index.js';
@@ -1 +0,0 @@
1
- export { default as HkPromise } from "./HkPromise.js";
@@ -1 +0,0 @@
1
- export { default as HkPromise } from './HkPromise.js';
@@ -1 +0,0 @@
1
- export { default as SubscribersCount } from "./SubscribersCount.js";
@@ -1 +0,0 @@
1
- export { default as SubscribersCount } from './SubscribersCount.js';
@@ -1,3 +0,0 @@
1
- export { default as LogTransformStream } from "./LogTransformStream.js";
2
- export { default as ServerEventsStore } from "./ServerEventsStore.js";
3
- export { default as TimeStampSource } from "./TimeStampSource.js";
@@ -1,3 +0,0 @@
1
- export { default as LogTransformStream } from './LogTransformStream.js';
2
- export { default as ServerEventsStore } from './ServerEventsStore.js';
3
- export { default as TimeStampSource } from './TimeStampSource.js';
@@ -1 +0,0 @@
1
- export { default as FiniteStateMachine } from "./finite-state-machine/FiniteStateMachine.svelte.js";
@@ -1 +0,0 @@
1
- export { default as FiniteStateMachine } from './finite-state-machine/FiniteStateMachine.svelte.js';
@@ -1,73 +0,0 @@
1
- /* == Design dimensions == */
2
-
3
- export const DESIGN = {
4
- width: 1024,
5
- height: 768
6
- };
7
-
8
- /* == Scaling-clamping behaviour == */
9
-
10
- export const CLAMPING = {
11
- ui: { min: 0.3, max: 2 },
12
- textBase: { min: 0.75, max: 1.5 },
13
- textHeading: { min: 0.75, max: 2.25 },
14
- textUi: { min: 0.5, max: 1.25 }
15
- };
16
-
17
- /* == Text == */
18
-
19
- export const TEXT_POINT_SIZES = [
20
- 1, 2, 4, 6, 8, 10, 11, 12, 16, 20, 24, 28, 32, 36, 50
21
- ];
22
-
23
- export const VIEWPORT_POINT_SIZES = [
24
- 1, 2, 4, 5, 6, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 120, 140, 160, 180,
25
- 200
26
- ];
27
-
28
- export const TEXT_BASE_SIZES = {
29
- sm: { size: 14, lineHeight: 1.25 },
30
- md: { size: 16, lineHeight: 1.25 },
31
- lg: { size: 18, lineHeight: 1.25 }
32
- };
33
-
34
- export const TEXT_HEADING_SIZES = {
35
- h1: { size: 32, lineHeight: 1.25 },
36
- h2: { size: 28, lineHeight: 1.25 },
37
- h3: { size: 24, lineHeight: 1.25 },
38
- h4: { size: 20, lineHeight: 1.25 },
39
- h5: { size: 16, lineHeight: 1.25 }
40
- };
41
-
42
- export const TEXT_UI_SIZES = {
43
- sm: { size: 14, lineHeight: 1 },
44
- md: { size: 16, lineHeight: 1 },
45
- lg: { size: 18, lineHeight: 1 }
46
- };
47
-
48
- /* == Border radius == */
49
-
50
- export const RADIUS_SIZES = {
51
- none: '0px',
52
- xs: { size: 5 },
53
- sm: { size: 10 },
54
- md: { size: 25 },
55
- lg: { size: 35 },
56
- full: '9999px'
57
- };
58
-
59
- /* == Border width == */
60
-
61
- export const BORDER_WIDTH_SIZES = {
62
- thin: { size: 1 },
63
- normal: { size: 2 },
64
- thick: { size: 4 }
65
- };
66
-
67
- /* == Stroke width == */
68
-
69
- export const STROKE_WIDTH_SIZES = {
70
- thin: { size: 1 },
71
- normal: { size: 2 },
72
- thick: { size: 4 }
73
- };
@@ -1,23 +0,0 @@
1
- export const spacing: {
2
- [x: string]: string;
3
- };
4
- export const fontSize: {
5
- [x: string]: string | [string, {
6
- lineHeight: number;
7
- }];
8
- };
9
- export const borderRadius: {
10
- [x: string]: string;
11
- };
12
- export const borderWidth: {
13
- [key: string]: string;
14
- };
15
- export const strokeWidth: {
16
- [key: string]: string;
17
- };
18
- export const outlineWidth: {
19
- [key: string]: string;
20
- };
21
- export const outlineOffset: {
22
- [key: string]: string;
23
- };