@hkdigital/lib-core 0.3.15 → 0.4.4

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 (296) hide show
  1. package/README.md +6 -6
  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 +1 -1
  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 +75 -0
  15. package/dist/design/generators/index.js +35 -0
  16. package/dist/design/themes/hkdev/components/buttons/button-text.css +20 -1
  17. package/dist/design/themes/hkdev/theme-ext.js +1 -1
  18. package/dist/{classes/data → generic/data/classes}/IterableTree.js +2 -2
  19. package/dist/{classes/data → generic/data/classes}/Selector.js +1 -1
  20. package/dist/generic/data/classes/typedef.d.ts +24 -0
  21. package/dist/generic/data/classes/typedef.js +14 -0
  22. package/dist/generic/data.d.ts +2 -0
  23. package/dist/generic/data.js +2 -0
  24. package/dist/generic/errors.d.ts +2 -0
  25. package/dist/generic/errors.js +2 -0
  26. package/dist/generic/events.d.ts +1 -0
  27. package/dist/generic/events.js +1 -0
  28. package/dist/{classes/promise → generic/promises/classes}/HkPromise.d.ts +17 -7
  29. package/dist/{classes/promise → generic/promises/classes}/HkPromise.js +20 -10
  30. package/dist/generic/promises.d.ts +1 -0
  31. package/dist/generic/promises.js +1 -0
  32. package/dist/{classes/streams → generic/streaming/classes}/ServerEventsStore.d.ts +1 -1
  33. package/dist/{classes/streams → generic/streaming/classes}/ServerEventsStore.js +2 -2
  34. package/dist/generic/streaming.d.ts +3 -0
  35. package/dist/generic/streaming.js +3 -0
  36. package/dist/generic/typedef.d.ts +1 -0
  37. package/dist/generic/typedef.js +1 -0
  38. package/dist/index.js +1 -0
  39. package/dist/logging/errors.d.ts +7 -0
  40. package/dist/logging/errors.js +11 -0
  41. package/dist/logging/internal/adapters/console.d.ts +1 -16
  42. package/dist/logging/internal/adapters/console.js +320 -8
  43. package/dist/logging/internal/adapters/formatting.d.ts +69 -0
  44. package/dist/logging/internal/adapters/formatting.js +395 -0
  45. package/dist/logging/internal/adapters/pino.js +112 -21
  46. package/dist/logging/internal/adapters/typedef.d.ts +30 -0
  47. package/dist/logging/internal/adapters/typedef.js +11 -0
  48. package/dist/logging/internal/factories/server.js +11 -1
  49. package/dist/logging/internal/logger/Logger.d.ts +7 -5
  50. package/dist/logging/internal/logger/Logger.js +41 -6
  51. package/dist/logging/internal/test-errors.d.ts +35 -0
  52. package/dist/logging/internal/test-errors.js +138 -0
  53. package/dist/network/cache/IndexedDbCache.d.ts +1 -1
  54. package/dist/network/cache/MemoryResponseCache.d.ts +5 -0
  55. package/dist/network/cache/MemoryResponseCache.js +5 -2
  56. package/dist/network/errors.d.ts +2 -0
  57. package/dist/network/errors.js +2 -0
  58. package/dist/network/http/caching.js +1 -1
  59. package/dist/network/http/errors.d.ts +2 -2
  60. package/dist/network/http/errors.js +5 -13
  61. package/dist/network/http/http-request.js +1 -1
  62. package/dist/network/http/json-request.js +1 -1
  63. package/dist/network/http/response.js +1 -1
  64. package/dist/network/http/url.js +1 -1
  65. package/dist/network/loaders/README.md +14 -7
  66. package/dist/network/loaders/audio/AudioScene.svelte.js +3 -2
  67. package/dist/network/loaders/image/ImageLoader.svelte.d.ts +2 -2
  68. package/dist/network/loaders/image/ImageLoader.svelte.js +1 -1
  69. package/dist/network/loaders/image/ImageScene.svelte.d.ts +2 -2
  70. package/dist/network/loaders/image/ImageScene.svelte.js +9 -8
  71. package/dist/network/loaders/image/ImageVariantsLoader.svelte.d.ts +5 -5
  72. package/dist/network/loaders/image/ImageVariantsLoader.svelte.js +14 -13
  73. package/dist/network/loaders/image/utils/index.d.ts +2 -2
  74. package/dist/network/loaders/image/utils/index.js +9 -12
  75. package/dist/network/loaders/typedef.d.ts +0 -9
  76. package/dist/network/loaders/typedef.js +0 -12
  77. package/dist/network/states/NetworkLoader.svelte.d.ts +1 -1
  78. package/dist/network/states/NetworkLoader.svelte.js +3 -2
  79. package/dist/services/service-base/ServiceBase.d.ts +2 -2
  80. package/dist/services/service-base/ServiceBase.js +15 -11
  81. package/dist/services/service-base/typedef.d.ts +2 -31
  82. package/dist/services/service-base/typedef.js +3 -2
  83. package/dist/services/service-manager/ServiceManager.d.ts +3 -3
  84. package/dist/services/service-manager/ServiceManager.js +2 -2
  85. package/dist/services/service-manager/typedef.d.ts +3 -3
  86. package/dist/services/service-manager/typedef.js +3 -3
  87. package/dist/{classes/svelte → state/classes}/loading-state-machine/LoadingStateMachine.svelte.d.ts +1 -1
  88. package/dist/{classes/svelte → state/classes}/loading-state-machine/LoadingStateMachine.svelte.js +1 -1
  89. package/dist/state/classes/subscribers-count/index.d.ts +1 -0
  90. package/dist/state/classes/subscribers-count/index.js +1 -0
  91. package/dist/state/classes.d.ts +3 -0
  92. package/dist/state/classes.js +3 -0
  93. package/dist/{util/svelte/state-context/index.d.ts → state/context/state-context.d.ts} +1 -1
  94. package/dist/{util/svelte/state-context/index.js → state/context/state-context.js} +4 -4
  95. package/dist/state/context.d.ts +1 -0
  96. package/dist/state/context.js +1 -0
  97. package/dist/state/stores.d.ts +1 -0
  98. package/dist/state/stores.js +1 -0
  99. package/dist/ui/README.md +49 -0
  100. package/dist/ui/components/button-group/index.d.ts +1 -0
  101. package/dist/ui/components/button-group/index.js +1 -0
  102. package/dist/ui/{primitives → components}/drag-drop/DragDropContext.svelte +1 -1
  103. package/dist/ui/{primitives → components}/drag-drop/DragDropContext.svelte.d.ts +1 -1
  104. package/dist/ui/{primitives → components}/drag-drop/Draggable.svelte +2 -2
  105. package/dist/ui/{primitives → components}/drag-drop/Draggable.svelte.d.ts +1 -1
  106. package/dist/ui/{primitives → components}/drag-drop/DropZone.svelte +4 -4
  107. package/dist/ui/{primitives → components}/drag-drop/DropZone.svelte.d.ts +3 -3
  108. package/dist/ui/{primitives → components}/drag-drop/DropZoneArea.svelte +3 -3
  109. package/dist/ui/{primitives → components}/drag-drop/DropZoneArea.svelte.d.ts +4 -4
  110. package/dist/ui/{primitives → components}/drag-drop/DropZoneList.svelte +3 -3
  111. package/dist/ui/{primitives → components}/drag-drop/DropZoneList.svelte.d.ts +3 -3
  112. package/dist/ui/{primitives → components}/drag-drop/drag-state.svelte.d.ts +11 -11
  113. package/dist/ui/{primitives → components}/drag-drop/drag-state.svelte.js +5 -5
  114. package/dist/ui/components/drag-drop/typedef.d.ts +2 -0
  115. package/dist/ui/components/drag-drop/typedef.js +2 -0
  116. package/dist/ui/components/game-box/index.d.ts +1 -0
  117. package/dist/ui/components/game-box/index.js +1 -0
  118. package/dist/ui/components/grid-layers/index.d.ts +1 -0
  119. package/dist/ui/components/grid-layers/index.js +1 -0
  120. package/dist/ui/{primitives/layout → components}/grid-layers/util.js +1 -1
  121. package/dist/ui/components/hk-app-layout/HkAppLayout.state.svelte.d.ts +3 -3
  122. package/dist/ui/components/hk-app-layout/HkAppLayout.state.svelte.js +3 -4
  123. package/dist/ui/components/hk-app-layout/index.d.ts +1 -0
  124. package/dist/ui/components/hk-app-layout/index.js +1 -0
  125. package/dist/ui/components/image-box/ImageBox.svelte +2 -2
  126. package/dist/ui/components/image-box/ImageBox.svelte.d.ts +3 -3
  127. package/dist/ui/components/image-box/index.d.ts +1 -1
  128. package/dist/ui/components/presenter/ImageSlide.svelte +1 -1
  129. package/dist/ui/components/presenter/ImageSlide.svelte.d.ts +2 -2
  130. package/dist/ui/components/presenter/Presenter.state.svelte.d.ts +3 -3
  131. package/dist/ui/components/presenter/Presenter.state.svelte.js +1 -1
  132. package/dist/ui/components/presenter/Presenter.svelte +1 -1
  133. package/dist/ui/components/presenter/Presenter.svelte.d.ts +1 -1
  134. package/dist/ui/{primitives → components}/rows/panel-grid-row/PanelGridRow.svelte.d.ts +1 -1
  135. package/dist/ui/{primitives → components}/rows/panel-row-2/PanelRow2.svelte.d.ts +1 -1
  136. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.state.svelte.d.ts +3 -3
  137. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.state.svelte.js +4 -2
  138. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.svelte +2 -2
  139. package/dist/ui/{primitives → components}/tab-bar/HkTabBar.svelte.d.ts +2 -2
  140. package/dist/ui/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +19 -0
  141. package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.state.svelte.js +2 -2
  142. package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.svelte +1 -1
  143. package/dist/ui/{primitives → components}/tab-bar/HkTabBarSelector.svelte.d.ts +2 -2
  144. package/dist/ui/{primitives → components}/tab-bar/typedef.d.ts +1 -1
  145. package/dist/ui/{primitives → components}/tab-bar/typedef.js +1 -1
  146. package/dist/ui/components/typedef.d.ts +5 -0
  147. package/dist/ui/components/typedef.js +5 -0
  148. package/dist/ui/components/virtual-viewport/index.d.ts +1 -0
  149. package/dist/ui/components/virtual-viewport/index.js +1 -0
  150. package/dist/ui/components.d.ts +11 -0
  151. package/dist/ui/components.js +11 -0
  152. package/dist/ui/{primitives/hkdev → dev}/blocks/TextBlock.svelte +1 -1
  153. package/dist/ui/{primitives/debug → dev}/debug-panel-design-scaling/DebugPanelDesignScaling.svelte +1 -1
  154. package/dist/ui/dev.d.ts +3 -0
  155. package/dist/ui/dev.js +3 -0
  156. package/dist/ui/primitives/buttons/button/Button.svelte.d.ts +1 -1
  157. package/dist/ui/primitives/typedef.d.ts +1 -0
  158. package/dist/ui/primitives/typedef.js +1 -0
  159. package/dist/ui/primitives.d.ts +5 -0
  160. package/dist/ui/primitives.js +5 -0
  161. package/dist/ui/typedef.d.ts +2 -0
  162. package/dist/ui/typedef.js +2 -0
  163. package/dist/util/array/index.js +1 -1
  164. package/dist/util/bases/base58.d.ts +3 -3
  165. package/dist/util/bases/base58.js +3 -3
  166. package/dist/util/compare/index.d.ts +4 -5
  167. package/dist/util/compare/index.js +3 -4
  168. package/dist/util/exceptions/index.js +1 -1
  169. package/dist/util/expect/arrays.d.ts +11 -11
  170. package/dist/util/expect/arrays.js +14 -6
  171. package/dist/util/expect/index.js +2 -2
  172. package/dist/util/expect/primitives.d.ts +6 -5
  173. package/dist/util/expect/primitives.js +15 -5
  174. package/dist/util/expect/url.d.ts +6 -5
  175. package/dist/util/expect/url.js +15 -5
  176. package/dist/util/function/index.d.ts +1 -14
  177. package/dist/util/index.d.ts +5 -0
  178. package/dist/util/index.js +13 -0
  179. package/dist/util/is/index.d.ts +3 -2
  180. package/dist/util/is/index.js +2 -1
  181. package/dist/util/iterate/index.d.ts +6 -8
  182. package/dist/util/iterate/index.js +5 -5
  183. package/dist/util/object/index.d.ts +1 -2
  184. package/dist/util/object/index.js +2 -3
  185. package/dist/util/ssr/index.d.ts +16 -0
  186. package/dist/util/ssr/index.js +44 -0
  187. package/dist/util/svelte/index.d.ts +1 -1
  188. package/dist/util/svelte/index.js +1 -1
  189. package/dist/util/time/index.d.ts +2 -2
  190. package/dist/util/time/index.js +1 -1
  191. package/dist/valibot/index.d.ts +1 -1
  192. package/dist/valibot/index.js +27 -1
  193. package/package.json +3 -3
  194. package/dist/assets/autospuiten/car-paint-picker/army-green.jpg +0 -0
  195. package/dist/assets/autospuiten/car-paint-picker/electric-blue.jpg +0 -0
  196. package/dist/assets/autospuiten/car-paint-picker/lemon-yellow.jpg +0 -0
  197. package/dist/assets/autospuiten/car-paint-picker/opaque-purple.jpg +0 -0
  198. package/dist/assets/autospuiten/car-paint-picker/rusty.jpg +0 -0
  199. package/dist/assets/autospuiten/car-paint-picker/sunset-orange.jpg +0 -0
  200. package/dist/assets/autospuiten/car-paint-picker/tomato-red.jpg +0 -0
  201. package/dist/assets/autospuiten/car-paint-picker.d.ts +0 -17
  202. package/dist/assets/autospuiten/car-paint-picker.js +0 -41
  203. package/dist/assets/autospuiten/labels.d.ts +0 -7
  204. package/dist/assets/autospuiten/labels.js +0 -7
  205. package/dist/classes/data/index.d.ts +0 -2
  206. package/dist/classes/data/index.js +0 -2
  207. package/dist/classes/event-emitter/index.d.ts +0 -1
  208. package/dist/classes/event-emitter/index.js +0 -2
  209. package/dist/classes/index.d.ts +0 -4
  210. package/dist/classes/index.js +0 -4
  211. package/dist/classes/promise/index.d.ts +0 -1
  212. package/dist/classes/promise/index.js +0 -1
  213. package/dist/classes/stores/index.d.ts +0 -1
  214. package/dist/classes/stores/index.js +0 -1
  215. package/dist/classes/streams/index.d.ts +0 -3
  216. package/dist/classes/streams/index.js +0 -3
  217. package/dist/classes/svelte/index.d.ts +0 -1
  218. package/dist/classes/svelte/index.js +0 -1
  219. package/dist/errors/index.d.ts +0 -5
  220. package/dist/errors/index.js +0 -5
  221. package/dist/services/service-base/index.d.ts +0 -3
  222. package/dist/services/service-base/index.js +0 -3
  223. package/dist/states/index.d.ts +0 -1
  224. package/dist/states/index.js +0 -1
  225. package/dist/stores/index.d.ts +0 -1
  226. package/dist/stores/index.js +0 -1
  227. package/dist/typedef/index.d.ts +0 -3
  228. package/dist/typedef/index.js +0 -3
  229. package/dist/ui/primitives/debug/index.d.ts +0 -1
  230. package/dist/ui/primitives/debug/index.js +0 -1
  231. package/dist/ui/primitives/index.d.ts +0 -1
  232. package/dist/ui/primitives/index.js +0 -1
  233. package/dist/ui/primitives/layout/grid-layers/GridLayers.svelte__heightFrom__ +0 -372
  234. package/dist/ui/primitives/layout/index.d.ts +0 -1
  235. package/dist/ui/primitives/layout/index.js +0 -1
  236. package/dist/ui/primitives/tab-bar/HkTabBarSelector.state.svelte.d.ts +0 -19
  237. /package/dist/{errors → auth/errors}/jwt.d.ts +0 -0
  238. /package/dist/{errors → auth/errors}/jwt.js +0 -0
  239. /package/dist/{states → browser/navigation}/navigation.svelte.d.ts +0 -0
  240. /package/dist/{classes/data → generic/data/classes}/IterableTree.d.ts +0 -0
  241. /package/dist/{classes/data → generic/data/classes}/Selector.d.ts +0 -0
  242. /package/dist/{classes → generic}/data/typedef.d.ts +0 -0
  243. /package/dist/{classes → generic}/data/typedef.js +0 -0
  244. /package/dist/{errors → generic/errors}/generic.d.ts +0 -0
  245. /package/dist/{errors → generic/errors}/generic.js +0 -0
  246. /package/dist/{errors → generic/errors}/promise.d.ts +0 -0
  247. /package/dist/{errors → generic/errors}/promise.js +0 -0
  248. /package/dist/{classes/event-emitter → generic/events/classes}/EventEmitter.d.ts +0 -0
  249. /package/dist/{classes/event-emitter → generic/events/classes}/EventEmitter.js +0 -0
  250. /package/dist/{classes/streams → generic/streaming/classes}/LogTransformStream.d.ts +0 -0
  251. /package/dist/{classes/streams → generic/streaming/classes}/LogTransformStream.js +0 -0
  252. /package/dist/{classes/streams → generic/streaming/classes}/TimeStampSource.d.ts +0 -0
  253. /package/dist/{classes/streams → generic/streaming/classes}/TimeStampSource.js +0 -0
  254. /package/dist/{errors → network/errors}/api.d.ts +0 -0
  255. /package/dist/{errors → network/errors}/api.js +0 -0
  256. /package/dist/{errors → network/errors}/http.d.ts +0 -0
  257. /package/dist/{errors → network/errors}/http.js +0 -0
  258. /package/dist/{classes/svelte → state/classes}/finite-state-machine/FiniteStateMachine.svelte.d.ts +0 -0
  259. /package/dist/{classes/svelte → state/classes}/finite-state-machine/FiniteStateMachine.svelte.js +0 -0
  260. /package/dist/{classes/svelte → state/classes}/finite-state-machine/index.d.ts +0 -0
  261. /package/dist/{classes/svelte → state/classes}/finite-state-machine/index.js +0 -0
  262. /package/dist/{classes/svelte → state/classes}/loading-state-machine/constants.d.ts +0 -0
  263. /package/dist/{classes/svelte → state/classes}/loading-state-machine/constants.js +0 -0
  264. /package/dist/{classes/svelte → state/classes}/loading-state-machine/index.d.ts +0 -0
  265. /package/dist/{classes/svelte → state/classes}/loading-state-machine/index.js +0 -0
  266. /package/dist/{classes/stores → state/classes/subscribers-count}/SubscribersCount.d.ts +0 -0
  267. /package/dist/{classes/stores → state/classes/subscribers-count}/SubscribersCount.js +0 -0
  268. /package/dist/{typedef/context.d.ts → state/context/typedef.d.ts} +0 -0
  269. /package/dist/{typedef/context.js → state/context/typedef.js} +0 -0
  270. /package/dist/{stores → state/stores}/theme.d.ts +0 -0
  271. /package/dist/{stores → state/stores}/theme.js +0 -0
  272. /package/dist/ui/{primitives → components}/drag-drop/DragController.d.ts +0 -0
  273. /package/dist/ui/{primitives → components}/drag-drop/DragController.js +0 -0
  274. /package/dist/ui/{primitives → components}/drag-drop/actions.d.ts +0 -0
  275. /package/dist/ui/{primitives → components}/drag-drop/actions.js +0 -0
  276. /package/dist/ui/{primitives → components}/drag-drop/index.d.ts +0 -0
  277. /package/dist/ui/{primitives → components}/drag-drop/index.js +0 -0
  278. /package/dist/{typedef → ui/components/drag-drop/typedef}/drag.d.ts +0 -0
  279. /package/dist/{typedef → ui/components/drag-drop/typedef}/drag.js +0 -0
  280. /package/dist/{typedef → ui/components/drag-drop/typedef}/drop.d.ts +0 -0
  281. /package/dist/{typedef → ui/components/drag-drop/typedef}/drop.js +0 -0
  282. /package/dist/ui/{primitives → components}/drag-drop/util.d.ts +0 -0
  283. /package/dist/ui/{primitives → components}/drag-drop/util.js +0 -0
  284. /package/dist/ui/{primitives/layout → components}/grid-layers/GridLayers.svelte +0 -0
  285. /package/dist/ui/{primitives/layout → components}/grid-layers/GridLayers.svelte.d.ts +0 -0
  286. /package/dist/ui/{primitives/layout → components}/grid-layers/util.d.ts +0 -0
  287. /package/dist/ui/{primitives → components}/rows/index.d.ts +0 -0
  288. /package/dist/ui/{primitives → components}/rows/index.js +0 -0
  289. /package/dist/ui/{primitives → components}/rows/panel-grid-row/PanelGridRow.svelte +0 -0
  290. /package/dist/ui/{primitives → components}/rows/panel-row-2/PanelRow2.svelte +0 -0
  291. /package/dist/ui/{primitives → components}/tab-bar/index.d.ts +0 -0
  292. /package/dist/ui/{primitives → components}/tab-bar/index.js +0 -0
  293. /package/dist/ui/{primitives/hkdev → dev}/blocks/TextBlock.svelte.d.ts +0 -0
  294. /package/dist/ui/{primitives/hkdev → dev}/buttons/CheckButton.svelte +0 -0
  295. /package/dist/ui/{primitives/hkdev → dev}/buttons/CheckButton.svelte.d.ts +0 -0
  296. /package/dist/ui/{primitives/debug → dev}/debug-panel-design-scaling/DebugPanelDesignScaling.svelte.d.ts +0 -0
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Core library that we use to power up our SvelteKit projects
4
4
 
5
5
  This is a library for [SvelteKit](https://svelte.dev/) projects.
6
- It contains common code and components that we use to create our projects.
6
+ It contains common code, base components and documentation that help you with setting up a new project.
7
7
 
8
8
  ## Using the library
9
9
 
@@ -131,18 +131,18 @@ export default {
131
131
  To build your library:
132
132
 
133
133
  ```bash
134
- npm run package
134
+ pnpm run package
135
135
  ```
136
136
 
137
- ## Building the showcase app
137
+ ## Running the showcase app
138
138
 
139
- To create a production version of your showcase app:
139
+ To use the showcase app that illustrates the code in this lib
140
140
 
141
141
  ```bash
142
- npm run build
142
+ pnpm run dev
143
143
  ```
144
144
 
145
- You can preview the production build with `npm run preview`.
145
+ You can preview the production build with `pnpm run preview`.
146
146
 
147
147
  > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
148
148
 
@@ -0,0 +1 @@
1
+ export * from "./errors/jwt.js";
@@ -0,0 +1 @@
1
+ export * from './errors/jwt.js';
@@ -1,6 +1,6 @@
1
1
  import { onMount } from 'svelte';
2
2
 
3
- import { lazySingleton } from '../util/singleton/index.js';
3
+ import { lazySingleton } from '../../util/singleton/index.js';
4
4
 
5
5
  import { beforeNavigate, onNavigate, afterNavigate } from '$app/navigation';
6
6
 
@@ -0,0 +1 @@
1
+ export { nav } from "./navigation/navigation.svelte.js";
@@ -0,0 +1 @@
1
+ export { nav } from './navigation/navigation.svelte.js';
@@ -50,7 +50,7 @@ export default defineConfig(
50
50
  'import.meta.env.VITE_API_URL': JSON.stringify('https://api.example.com')
51
51
  },
52
52
  imagetoolsOptions: {
53
- widths: [640, 1024, 1536, 1920]
53
+ widths: [1920, 1536, 1024, 640]
54
54
  }
55
55
  })
56
56
  );
@@ -4,6 +4,7 @@
4
4
  *
5
5
  * @param {object} [options]
6
6
  * @param {number[]} [options.widths=DEFAULT_WIDTHS]
7
+ * @param {number[]} [options.thumbnailWidth=DEFAULT_THUMBNAIL_WIDTH]
7
8
  *
8
9
  * @returns {(
9
10
  * entries: [string, string[]][]
@@ -11,6 +12,7 @@
11
12
  */
12
13
  export function generateResponseConfigs(options?: {
13
14
  widths?: number[];
15
+ thumbnailWidth?: number[];
14
16
  }): (entries: [string, string[]][]) => (Record<string, string | string[]>[]);
15
17
  /**
16
18
  * Configures and returns a function that can be used as
@@ -1,9 +1,12 @@
1
- const DEFAULT_WIDTHS = [640, 1024, 1536, 1920];
1
+ const DEFAULT_WIDTHS = [1920, 1536, 1024, 640];
2
+
3
+ const DEFAULT_THUMBNAIL_WIDTH = 150;
2
4
 
3
5
  const DEFAULT_PRESETS = {
4
6
  default: {
5
7
  format: 'avif',
6
- quality: '90'
8
+ quality: '90',
9
+ as: 'metadata'
7
10
  },
8
11
  render: {
9
12
  format: 'jpg',
@@ -44,6 +47,7 @@ const DEFAULT_PRESETS = {
44
47
  *
45
48
  * @param {object} [options]
46
49
  * @param {number[]} [options.widths=DEFAULT_WIDTHS]
50
+ * @param {number[]} [options.thumbnailWidth=DEFAULT_THUMBNAIL_WIDTH]
47
51
  *
48
52
  * @returns {(
49
53
  * entries: [string, string[]][]
@@ -70,21 +74,30 @@ export function generateResponseConfigs(options) {
70
74
 
71
75
  // @ts-ignore
72
76
  const responsiveConfig = entries.find(([key]) => key === 'responsive');
77
+ // console.log('responsiveConfig found:', !!responsiveConfig);
73
78
 
74
- if (!responsiveConfig) {
75
- // Directive 'responsive' was not set => return original config
79
+ const widths = options?.widths ?? DEFAULT_WIDTHS;
76
80
 
77
- return [configPairs];
81
+ // Always include the main image(s) and a thumbnail version
82
+ const thumbnailConfig = {
83
+ ...configPairs,
84
+ w: String(options?.thumbnailWidth ?? DEFAULT_THUMBNAIL_WIDTH)
85
+ };
78
86
 
79
- // Alternative: by returning undefined, the default resolveConfig is used
80
- // return undefined;
87
+ if (!responsiveConfig) {
88
+ // Directive 'responsive' was not set => return original + thumbnail
89
+ const originalConfig = configPairs; // No 'w' means original dimensions
90
+ // console.log('Returning original + thumbnail configs:', [originalConfig, thumbnailConfig]);
91
+ return [originalConfig, thumbnailConfig];
81
92
  }
82
93
 
83
- const widths = options?.widths ?? DEFAULT_WIDTHS;
84
-
85
- return widths.map((w) => {
94
+ // Directive 'responsive' was set => return responsive widths + thumbnail
95
+ const responsiveConfigs = widths.map((w) => {
86
96
  return { ...configPairs, w: String(w) };
87
97
  });
98
+ const result = [...responsiveConfigs, thumbnailConfig];
99
+ // console.log('Returning responsive + thumbnail configs:', result);
100
+ return result;
88
101
  };
89
102
  }
90
103
 
@@ -83,7 +83,7 @@ export async function generateViteConfig(options = {}) {
83
83
  new Date().toISOString()
84
84
  ),
85
85
  ...customDefines
86
- }
86
+ },
87
87
  };
88
88
 
89
89
  if (enableVitest) {
@@ -1,13 +1,13 @@
1
- type ImageMeta = import('../network/typedef.js').ImageMeta;
2
- type ImageSource = import('../network/typedef.js').ImageSource;
1
+ type ImageMeta = import('./typedef.js').ImageMeta;
2
+ type ImageSource = import('./typedef.js').ImageSource;
3
3
 
4
4
  declare module '*?responsive' {
5
- const out: ImageMeta[];
5
+ const out: ImageSource;
6
6
  export default out;
7
7
  }
8
8
 
9
9
  declare module '*&responsive' {
10
- const out: ImageMeta[];
10
+ const out: ImageSource;
11
11
  export default out;
12
12
  }
13
13
 
@@ -57,7 +57,7 @@ declare module '*?preset=savedata' {
57
57
  }
58
58
 
59
59
  declare module '*&preset=savedata' {
60
- const out: IImageSource;
60
+ const out: ImageSource;
61
61
  export default out;
62
62
  }
63
63
 
@@ -0,0 +1,11 @@
1
+ declare const _default: {};
2
+ export default _default;
3
+ export type ImageMeta = {
4
+ src: string;
5
+ width: number;
6
+ height: number;
7
+ };
8
+ /**
9
+ * Array of ImageMeta objects (always array format)
10
+ */
11
+ export type ImageSource = ImageMeta[];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Configuration type definitions for imagetools and build-time image processing
3
+ */
4
+
5
+ /**
6
+ * @typedef {object} ImageMeta
7
+ * @property {string} src
8
+ * @property {number} width
9
+ * @property {number} height
10
+ */
11
+
12
+ /**
13
+ * @typedef {ImageMeta[]} ImageSource
14
+ * Array of ImageMeta objects (always array format)
15
+ */
16
+
17
+ export default {};
@@ -18,10 +18,18 @@ const themeExtensions = generateTailwindThemeExtensions(designTokens);
18
18
 
19
19
  /** @type {import('tailwindcss').Config} \*/
20
20
  export default {
21
+ // Include @hkdigital libraries in content so Tailwind processes
22
+ // their design system classes and components for proper styling
23
+ content: [
24
+ './node_modules/@hkdigital/**/*.{html,js,svelte}',
25
+ './src/**/*.{html,js,svelte}'
26
+ ],
21
27
  theme: {
28
+ // Extend Tailwind's default theme using the design system tokens
22
29
  extend: themeExtensions
23
30
  },
24
31
  plugins: [
32
+ // Generate custom utility classes like 'type-heading-h2'
25
33
  customUtilitiesPlugin
26
34
  ]
27
35
  };
@@ -40,6 +48,70 @@ export default {
40
48
  {@render children()}
41
49
  ```
42
50
 
51
+ ## Using Design System Classes in External CSS
52
+
53
+ When using design system utilities like `p-16up`, `bg-surface-300`, or `border-primary-500` in external CSS files (loaded via `<style src="./style.css"></style>`), you **must** include the `@reference` directive at the top of your CSS file.
54
+
55
+ **SVELTE preprocess**
56
+ You need svelte preprocess to process external CSS files in your svelte files!
57
+
58
+ ```html
59
+ <div data-page>
60
+ <p>Hello there!</p>
61
+ </div>
62
+
63
+ <style src="./style.css"></style>
64
+ ```
65
+
66
+ ### ✅ Correct Usage
67
+
68
+ ```css
69
+ /* style.css */
70
+ @reference '../../app.css';
71
+
72
+ [data-page] {
73
+ & .my-component {
74
+ @apply p-16up bg-surface-300 border border-primary-500;
75
+ }
76
+ }
77
+ ```
78
+
79
+ ### ❌ Common Mistake
80
+
81
+ ```css
82
+ /* style.css - MISSING @reference directive */
83
+ [data-page] {
84
+ & .my-component {
85
+ @apply p-16up bg-surface-300; /* ERROR: Cannot apply unknown utility class */
86
+ }
87
+ }
88
+ ```
89
+
90
+ ### Path Resolution
91
+
92
+ The `@reference` path must be relative to your CSS file's location:
93
+
94
+ E.g. `/src/routes/examples/style.css` → `@reference '../../app.css'`
95
+
96
+ ```svelte
97
+ <style>
98
+ [data-page] {
99
+ & .my-component {
100
+ @apply p-16up bg-surface-300 border border-primary-500;
101
+ }
102
+ }
103
+ </style>
104
+ ```
105
+
106
+ ### Troubleshooting
107
+
108
+ If you see errors like:
109
+ - `Cannot apply unknown utility class 'p-16up'`
110
+ - `Cannot apply unknown utility class 'bg-surface-300'`
111
+ - `Are you using CSS modules or similar and missing @reference?`
112
+
113
+ **Solution**: Add `@reference` directive with the correct relative path to your `app.css` file.
114
+
43
115
  ## Core Concepts
44
116
 
45
117
  ### Responsive Scaling System
@@ -160,6 +232,9 @@ Available for all text point sizes: `1ut/bt/ht`, `2ut/bt/ht`, `4ut/bt/ht`, `6ut/
160
232
 
161
233
  **Auto Contrast**: Each color includes automatic contrast colors for accessibility. Use `text-{color}-contrast-{shade}` for optimal readability.
162
234
 
235
+ **Skeleton**
236
+ This library is based on both Tailwind and Skeleton. See [Skeleton Design Colors](https://www.skeleton.dev/docs/design/colors).
237
+
163
238
  ## Component Styling
164
239
 
165
240
  Components use `data-` attributes with CSS custom properties:
@@ -83,10 +83,45 @@ export function generateTailwindThemeExtensions({
83
83
 
84
84
  outlineOffset: {
85
85
  ...generateWidthStyles(STROKE_WIDTH_SIZES, '')
86
+ },
87
+
88
+ colors: {
89
+ ...generateColorStyles()
90
+ },
91
+
92
+ borderColor: {
93
+ ...generateColorStyles()
86
94
  }
87
95
  };
88
96
  }
89
97
 
98
+ /**
99
+ * Generates color styles using CSS variables
100
+ * Creates color classes for the design system theme
101
+ * @returns {Object} Color styles in Tailwind format
102
+ */
103
+ function generateColorStyles() {
104
+ const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
105
+ const colorNames = ['primary', 'secondary', 'tertiary', 'surface', 'success', 'warning', 'error'];
106
+ const colors = {};
107
+
108
+ // Generate main color variations
109
+ for (const colorName of colorNames) {
110
+ colors[colorName] = {};
111
+ for (const shade of shades) {
112
+ colors[colorName][shade] = `rgb(var(--color-${colorName}-${shade}) / <alpha-value>)`;
113
+ }
114
+
115
+ // Add contrast colors
116
+ for (const shade of shades) {
117
+ colors[`${colorName}-contrast`] = colors[`${colorName}-contrast`] || {};
118
+ colors[`${colorName}-contrast`][shade] = `rgb(var(--color-${colorName}-contrast-${shade}) / <alpha-value>)`;
119
+ }
120
+ }
121
+
122
+ return colors;
123
+ }
124
+
90
125
  /**
91
126
  * Generates text-based spacing units with with different scaling
92
127
  * units (ut, bt, ht)
@@ -2,14 +2,31 @@
2
2
  /* Type-based styling for text buttons */
3
3
  [data-component='button'][data-type='text'] {
4
4
  /* Typography settings */
5
- @apply font-ui text-ui-md;
5
+ @apply type-ui-md-dark;
6
6
  @apply uppercase;
7
7
  @apply whitespace-nowrap;
8
8
 
9
9
  /* Size settings */
10
10
 
11
+ &[data-size='sm'] {
12
+ @apply rounded-sm;
13
+ @apply type-ui-sm-dark;
14
+ @apply py-2ut px-8ut;
15
+ min-width: var(--btn-min-width);
16
+ min-height: var(--btn-min-height);
17
+ }
18
+
11
19
  &[data-size='md'] {
12
20
  @apply rounded-sm;
21
+ @apply type-ui-md-dark;
22
+ @apply py-4ut px-8ut;
23
+ min-width: var(--btn-min-width);
24
+ min-height: var(--btn-min-height);
25
+ }
26
+
27
+ &[data-size='lg'] {
28
+ @apply rounded-sm;
29
+ @apply type-ui-lg-dark;
13
30
  @apply py-8ut px-16ut;
14
31
  min-width: var(--btn-min-width);
15
32
  min-height: var(--btn-min-height);
@@ -17,10 +34,12 @@
17
34
 
18
35
  /* Role-specific text adjustments */
19
36
  &[data-role='primary'] {
37
+ color: var(--btn-primary-text);
20
38
  @apply font-extrabold;
21
39
  }
22
40
 
23
41
  &[data-role='secondary'] {
42
+ color: var(--btn-secondary-text);
24
43
  @apply font-bold;
25
44
  }
26
45
  }
@@ -1,4 +1,4 @@
1
- import { theme as themeStore } from '../../../stores/index.js';
1
+ import { theme as themeStore } from '../../../state/stores.js';
2
2
 
3
3
  /**
4
4
  * Set meta them color for the current theme
@@ -1,8 +1,8 @@
1
1
  /* ------------------------------------------------------------------ Imports */
2
2
 
3
- import * as expect from '../../util/expect/index.js';
3
+ import * as expect from '../../../util/expect/index.js';
4
4
 
5
- import { PATH_SEPARATOR } from '../../util/object/index.js';
5
+ import { PATH_SEPARATOR } from '../../../util/object/index.js';
6
6
 
7
7
  /* ------------------------------------------------------------------ Typedef */
8
8
 
@@ -28,7 +28,7 @@
28
28
 
29
29
  /* ------------------------------------------------------------------ Imports */
30
30
 
31
- import * as expect from '../../util/expect/index.js';
31
+ import * as expect from '../../../util/expect/index.js';
32
32
 
33
33
  /* ------------------------------------------------------------------- Export */
34
34
 
@@ -0,0 +1,24 @@
1
+ declare const _default: {};
2
+ export default _default;
3
+ export type IterableTreeOptions = {
4
+ /**
5
+ * - Whether to walk into array elements
6
+ */
7
+ walkArrays?: boolean;
8
+ /**
9
+ * - Whether to ignore empty object leaves
10
+ */
11
+ ignoreEmptyObjectLeaves?: boolean;
12
+ /**
13
+ * - Whether to expand path keys
14
+ */
15
+ expandPathKeys?: boolean;
16
+ /**
17
+ * - Whether to output intermediate nodes
18
+ */
19
+ outputIntermediateNodes?: boolean;
20
+ /**
21
+ * - Whether to use depth-first traversal
22
+ */
23
+ depthFirst?: boolean;
24
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Generic data class type definitions
3
+ */
4
+
5
+ /**
6
+ * @typedef {object} IterableTreeOptions
7
+ * @property {boolean} [walkArrays=false] - Whether to walk into array elements
8
+ * @property {boolean} [ignoreEmptyObjectLeaves=false] - Whether to ignore empty object leaves
9
+ * @property {boolean} [expandPathKeys=false] - Whether to expand path keys
10
+ * @property {boolean} [outputIntermediateNodes=false] - Whether to output intermediate nodes
11
+ * @property {boolean} [depthFirst=true] - Whether to use depth-first traversal
12
+ */
13
+
14
+ export default {};
@@ -0,0 +1,2 @@
1
+ export { default as Selector } from "./data/classes/Selector.js";
2
+ export { default as IterableTree } from "./data/classes/IterableTree.js";
@@ -0,0 +1,2 @@
1
+ export { default as Selector } from './data/classes/Selector.js';
2
+ export { default as IterableTree } from './data/classes/IterableTree.js';
@@ -0,0 +1,2 @@
1
+ export * from "./errors/generic.js";
2
+ export * from "./errors/promise.js";
@@ -0,0 +1,2 @@
1
+ export * from './errors/generic.js';
2
+ export * from './errors/promise.js';
@@ -0,0 +1 @@
1
+ export { default as EventEmitter } from "./events/classes/EventEmitter.js";
@@ -0,0 +1 @@
1
+ export { default as EventEmitter } from './events/classes/EventEmitter.js';
@@ -2,12 +2,16 @@
2
2
  * HkPromise extends the default javascript Promise class
3
3
  * - Exposes methods to interact with the state of the
4
4
  * promise, such as 'resolve' and 'reject'
5
+ *
6
+ * @template T
7
+ * @extends {Promise<T>}
8
+ * @implements {PromiseLike<T>}
5
9
  */
6
- export default class HkPromise extends Promise<any> {
10
+ export default class HkPromise<T> extends Promise<T> implements PromiseLike<T> {
7
11
  /**
8
- * @param {(resolveFn?:function, rejectFn?:function)=>void} [initFn]
12
+ * @param {(resolveFn?: (value: T | PromiseLike<T>) => void, rejectFn?: (reason?: any) => void) => void} [initFn]
9
13
  */
10
- constructor(initFn?: (resolveFn?: Function, rejectFn?: Function) => void);
14
+ constructor(initFn?: (resolveFn?: (value: T | PromiseLike<T>) => void, rejectFn?: (reason?: any) => void) => void);
11
15
  /**
12
16
  * Get value of property [resolved]
13
17
  *
@@ -108,15 +112,21 @@ export default class HkPromise extends Promise<any> {
108
112
  /**
109
113
  * Register a callback that is called when the promise resolves
110
114
  *
111
- * @param {...any} args - Callback functions and options
115
+ * @template TResult1
116
+ * @template TResult2
117
+ * @param {((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null} [onfulfilled]
118
+ * @param {((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null} [onrejected]
119
+ * @returns {Promise<TResult1 | TResult2>}
112
120
  */
113
- then(...args: any[]): Promise<any>;
121
+ then<TResult1, TResult2>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
114
122
  /**
115
123
  * Register a callback that is called when the promise rejects, is
116
124
  * cancelled or times out
117
125
  *
118
- * @param {...any} args - Callback functions and options
126
+ * @template TResult
127
+ * @param {((reason: any) => TResult | PromiseLike<TResult>) | undefined | null} [onrejected]
128
+ * @returns {Promise<T | TResult>}
119
129
  */
120
- catch(...args: any[]): Promise<any>;
130
+ catch<TResult>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
121
131
  #private;
122
132
  }
@@ -34,11 +34,11 @@
34
34
 
35
35
  /* ------------------------------------------------------------------ Imports */
36
36
 
37
- import * as expect from '../../util/expect/index.js';
37
+ import * as expect from '../../../util/expect/index.js';
38
38
 
39
- import { noop } from '../../util/function/index.js';
39
+ import { noop } from '../../../util/function/index.js';
40
40
 
41
- import { PromiseError } from '../../errors/promise.js';
41
+ import { PromiseError } from '../../errors.js';
42
42
 
43
43
  /* ---------------------------------------------------------------- Internals */
44
44
 
@@ -48,6 +48,10 @@ import { PromiseError } from '../../errors/promise.js';
48
48
  * HkPromise extends the default javascript Promise class
49
49
  * - Exposes methods to interact with the state of the
50
50
  * promise, such as 'resolve' and 'reject'
51
+ *
52
+ * @template T
53
+ * @extends {Promise<T>}
54
+ * @implements {PromiseLike<T>}
51
55
  */
52
56
  export default class HkPromise extends Promise {
53
57
  // Private fields using modern JavaScript syntax
@@ -62,7 +66,7 @@ export default class HkPromise extends Promise {
62
66
  #hasThen = false;
63
67
 
64
68
  /**
65
- * @param {(resolveFn?:function, rejectFn?:function)=>void} [initFn]
69
+ * @param {(resolveFn?: (value: T | PromiseLike<T>) => void, rejectFn?: (reason?: any) => void) => void} [initFn]
66
70
  */
67
71
  constructor(initFn) {
68
72
  let _resolveFn;
@@ -364,21 +368,27 @@ export default class HkPromise extends Promise {
364
368
  /**
365
369
  * Register a callback that is called when the promise resolves
366
370
  *
367
- * @param {...any} args - Callback functions and options
371
+ * @template TResult1
372
+ * @template TResult2
373
+ * @param {((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null} [onfulfilled]
374
+ * @param {((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null} [onrejected]
375
+ * @returns {Promise<TResult1 | TResult2>}
368
376
  */
369
- then(...args) {
377
+ then(onfulfilled, onrejected) {
370
378
  this.#hasThen = true;
371
379
 
372
- return super.then(...args);
380
+ return super.then(onfulfilled, onrejected);
373
381
  }
374
382
 
375
383
  /**
376
384
  * Register a callback that is called when the promise rejects, is
377
385
  * cancelled or times out
378
386
  *
379
- * @param {...any} args - Callback functions and options
387
+ * @template TResult
388
+ * @param {((reason: any) => TResult | PromiseLike<TResult>) | undefined | null} [onrejected]
389
+ * @returns {Promise<T | TResult>}
380
390
  */
381
- catch(...args) {
382
- return super.catch(...args);
391
+ catch(onrejected) {
392
+ return super.catch(onrejected);
383
393
  }
384
394
  } // end class
@@ -0,0 +1 @@
1
+ export { default as HkPromise } from "./promises/classes/HkPromise.js";
@@ -0,0 +1 @@
1
+ export { default as HkPromise } from './promises/classes/HkPromise.js';
@@ -18,4 +18,4 @@ export default class ServerEventsStore {
18
18
  subscribe(fn: import("svelte/store").Subscriber<object | null>): () => void;
19
19
  #private;
20
20
  }
21
- import SubscribersCount from '../stores/SubscribersCount.js';
21
+ import { SubscribersCount } from '../../../state/classes.js';
@@ -2,9 +2,9 @@ import { writable } from 'svelte/store';
2
2
 
3
3
  // eslint-disable-next-line no-unused-vars
4
4
  import * as v from 'valibot';
5
- import { AbsOrRelUrl } from '../../valibot/index.js';
5
+ import { AbsOrRelUrl } from '../../../valibot/index.js';
6
6
 
7
- import SubscribersCount from '../stores/SubscribersCount.js';
7
+ import { SubscribersCount } from '../../../state/classes.js';
8
8
 
9
9
  // > Class
10
10
 
@@ -0,0 +1,3 @@
1
+ export { default as LogTransformStream } from "./streaming/classes/LogTransformStream.js";
2
+ export { default as ServerEventsStore } from "./streaming/classes/ServerEventsStore.js";
3
+ export { default as TimeStampSource } from "./streaming/classes/TimeStampSource.js";
@@ -0,0 +1,3 @@
1
+ export { default as LogTransformStream } from './streaming/classes/LogTransformStream.js';
2
+ export { default as ServerEventsStore } from './streaming/classes/ServerEventsStore.js';
3
+ export { default as TimeStampSource } from './streaming/classes/TimeStampSource.js';
@@ -0,0 +1 @@
1
+ export * from "./data/typedef.js";
@@ -0,0 +1 @@
1
+ export * from './data/typedef.js';