@hkdigital/lib-core 0.3.1

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 (485) hide show
  1. package/README.md +149 -0
  2. package/dist/assets/autospuiten/car-paint-picker/army-green.jpg +0 -0
  3. package/dist/assets/autospuiten/car-paint-picker/electric-blue.jpg +0 -0
  4. package/dist/assets/autospuiten/car-paint-picker/lemon-yellow.jpg +0 -0
  5. package/dist/assets/autospuiten/car-paint-picker/opaque-purple.jpg +0 -0
  6. package/dist/assets/autospuiten/car-paint-picker/rusty.jpg +0 -0
  7. package/dist/assets/autospuiten/car-paint-picker/sunset-orange.jpg +0 -0
  8. package/dist/assets/autospuiten/car-paint-picker/tomato-red.jpg +0 -0
  9. package/dist/assets/autospuiten/car-paint-picker.d.ts +17 -0
  10. package/dist/assets/autospuiten/car-paint-picker.js +41 -0
  11. package/dist/assets/autospuiten/labels.d.ts +7 -0
  12. package/dist/assets/autospuiten/labels.js +7 -0
  13. package/dist/classes/cache/IndexedDbCache.d.ts +216 -0
  14. package/dist/classes/cache/IndexedDbCache.js +1407 -0
  15. package/dist/classes/cache/MemoryResponseCache.d.ts +106 -0
  16. package/dist/classes/cache/MemoryResponseCache.js +138 -0
  17. package/dist/classes/cache/index.d.ts +3 -0
  18. package/dist/classes/cache/index.js +5 -0
  19. package/dist/classes/cache/typedef.d.ts +67 -0
  20. package/dist/classes/cache/typedef.js +41 -0
  21. package/dist/classes/data/IterableTree.d.ts +51 -0
  22. package/dist/classes/data/IterableTree.js +243 -0
  23. package/dist/classes/data/Selector.d.ts +30 -0
  24. package/dist/classes/data/Selector.js +190 -0
  25. package/dist/classes/data/index.d.ts +2 -0
  26. package/dist/classes/data/index.js +2 -0
  27. package/dist/classes/events/EventEmitter.d.ts +142 -0
  28. package/dist/classes/events/EventEmitter.js +275 -0
  29. package/dist/classes/events/index.d.ts +1 -0
  30. package/dist/classes/events/index.js +2 -0
  31. package/dist/classes/index.d.ts +4 -0
  32. package/dist/classes/index.js +4 -0
  33. package/dist/classes/logging/Logger.d.ts +78 -0
  34. package/dist/classes/logging/Logger.js +210 -0
  35. package/dist/classes/logging/constants.d.ts +12 -0
  36. package/dist/classes/logging/constants.js +16 -0
  37. package/dist/classes/logging/index.d.ts +2 -0
  38. package/dist/classes/logging/index.js +4 -0
  39. package/dist/classes/logging/typedef.d.ts +34 -0
  40. package/dist/classes/logging/typedef.js +17 -0
  41. package/dist/classes/promise/HkPromise.d.ts +121 -0
  42. package/dist/classes/promise/HkPromise.js +377 -0
  43. package/dist/classes/promise/index.d.ts +1 -0
  44. package/dist/classes/promise/index.js +1 -0
  45. package/dist/classes/services/ServiceBase.d.ts +163 -0
  46. package/dist/classes/services/ServiceBase.js +463 -0
  47. package/dist/classes/services/ServiceManager.d.ts +179 -0
  48. package/dist/classes/services/ServiceManager.js +614 -0
  49. package/dist/classes/services/index.d.ts +4 -0
  50. package/dist/classes/services/index.js +5 -0
  51. package/dist/classes/services/service-states.d.ts +159 -0
  52. package/dist/classes/services/service-states.js +205 -0
  53. package/dist/classes/services/typedef.d.ts +247 -0
  54. package/dist/classes/services/typedef.js +179 -0
  55. package/dist/classes/stores/SubscribersCount.d.ts +39 -0
  56. package/dist/classes/stores/SubscribersCount.js +107 -0
  57. package/dist/classes/stores/index.d.ts +1 -0
  58. package/dist/classes/stores/index.js +1 -0
  59. package/dist/classes/streams/LogTransformStream.d.ts +4 -0
  60. package/dist/classes/streams/LogTransformStream.js +19 -0
  61. package/dist/classes/streams/ServerEventsStore.d.ts +22 -0
  62. package/dist/classes/streams/ServerEventsStore.js +110 -0
  63. package/dist/classes/streams/TimeStampSource.d.ts +13 -0
  64. package/dist/classes/streams/TimeStampSource.js +26 -0
  65. package/dist/classes/streams/index.d.ts +3 -0
  66. package/dist/classes/streams/index.js +3 -0
  67. package/dist/classes/svelte/audio/AudioLoader.svelte.d.ts +30 -0
  68. package/dist/classes/svelte/audio/AudioLoader.svelte.js +58 -0
  69. package/dist/classes/svelte/audio/AudioScene.svelte.d.ts +74 -0
  70. package/dist/classes/svelte/audio/AudioScene.svelte.js +324 -0
  71. package/dist/classes/svelte/audio/mocks.d.ts +7 -0
  72. package/dist/classes/svelte/audio/mocks.js +35 -0
  73. package/dist/classes/svelte/finite-state-machine/FiniteStateMachine.svelte.d.ts +50 -0
  74. package/dist/classes/svelte/finite-state-machine/FiniteStateMachine.svelte.js +133 -0
  75. package/dist/classes/svelte/finite-state-machine/index.d.ts +1 -0
  76. package/dist/classes/svelte/finite-state-machine/index.js +1 -0
  77. package/dist/classes/svelte/image/ImageLoader.svelte.d.ts +19 -0
  78. package/dist/classes/svelte/image/ImageLoader.svelte.js +45 -0
  79. package/dist/classes/svelte/image/ImageScene.svelte.d.ts +78 -0
  80. package/dist/classes/svelte/image/ImageScene.svelte.js +249 -0
  81. package/dist/classes/svelte/image/ImageVariantsLoader.svelte.d.ts +43 -0
  82. package/dist/classes/svelte/image/ImageVariantsLoader.svelte.js +152 -0
  83. package/dist/classes/svelte/image/index.d.ts +2 -0
  84. package/dist/classes/svelte/image/index.js +4 -0
  85. package/dist/classes/svelte/image/mocks.d.ts +7 -0
  86. package/dist/classes/svelte/image/mocks.js +35 -0
  87. package/dist/classes/svelte/image/typedef.d.ts +16 -0
  88. package/dist/classes/svelte/image/typedef.js +8 -0
  89. package/dist/classes/svelte/index.d.ts +9 -0
  90. package/dist/classes/svelte/index.js +14 -0
  91. package/dist/classes/svelte/loading-state-machine/LoadingStateMachine.svelte.d.ts +12 -0
  92. package/dist/classes/svelte/loading-state-machine/LoadingStateMachine.svelte.js +109 -0
  93. package/dist/classes/svelte/loading-state-machine/constants.d.ts +12 -0
  94. package/dist/classes/svelte/loading-state-machine/constants.js +16 -0
  95. package/dist/classes/svelte/loading-state-machine/index.d.ts +2 -0
  96. package/dist/classes/svelte/loading-state-machine/index.js +3 -0
  97. package/dist/classes/svelte/network-loader/NetworkLoader.svelte.d.ts +91 -0
  98. package/dist/classes/svelte/network-loader/NetworkLoader.svelte.js +338 -0
  99. package/dist/classes/svelte/network-loader/constants.d.ts +2 -0
  100. package/dist/classes/svelte/network-loader/constants.js +3 -0
  101. package/dist/classes/svelte/network-loader/index.d.ts +2 -0
  102. package/dist/classes/svelte/network-loader/index.js +3 -0
  103. package/dist/classes/svelte/network-loader/mocks.d.ts +7 -0
  104. package/dist/classes/svelte/network-loader/mocks.js +30 -0
  105. package/dist/classes/svelte/network-loader/typedef.d.ts +7 -0
  106. package/dist/classes/svelte/network-loader/typedef.js +8 -0
  107. package/dist/components/area/HkArea.svelte +49 -0
  108. package/dist/components/area/HkArea.svelte.d.ts +26 -0
  109. package/dist/components/area/HkGridArea.svelte +77 -0
  110. package/dist/components/area/HkGridArea.svelte.d.ts +42 -0
  111. package/dist/components/area/index.d.ts +2 -0
  112. package/dist/components/area/index.js +2 -0
  113. package/dist/components/buttons/button/Button.svelte +82 -0
  114. package/dist/components/buttons/button/Button.svelte.d.ts +44 -0
  115. package/dist/components/buttons/button-icon-steeze/SteezeIconButton.svelte +30 -0
  116. package/dist/components/buttons/button-icon-steeze/SteezeIconButton.svelte.d.ts +16 -0
  117. package/dist/components/buttons/button-text/TextButton.svelte +21 -0
  118. package/dist/components/buttons/button-text/TextButton.svelte.d.ts +12 -0
  119. package/dist/components/buttons/index.d.ts +3 -0
  120. package/dist/components/buttons/index.js +3 -0
  121. package/dist/components/debug/debug-panel-design-scaling/DebugPanelDesignScaling.svelte +146 -0
  122. package/dist/components/debug/debug-panel-design-scaling/DebugPanelDesignScaling.svelte.d.ts +6 -0
  123. package/dist/components/debug/index.d.ts +1 -0
  124. package/dist/components/debug/index.js +1 -0
  125. package/dist/components/drag-drop/DragController.d.ts +20 -0
  126. package/dist/components/drag-drop/DragController.js +44 -0
  127. package/dist/components/drag-drop/DragDropContext.svelte +111 -0
  128. package/dist/components/drag-drop/DragDropContext.svelte.d.ts +18 -0
  129. package/dist/components/drag-drop/Draggable.svelte +519 -0
  130. package/dist/components/drag-drop/Draggable.svelte.d.ts +95 -0
  131. package/dist/components/drag-drop/DropZone.svelte +258 -0
  132. package/dist/components/drag-drop/DropZone.svelte.d.ts +96 -0
  133. package/dist/components/drag-drop/DropZoneArea.svelte +119 -0
  134. package/dist/components/drag-drop/DropZoneArea.svelte.d.ts +90 -0
  135. package/dist/components/drag-drop/DropZoneList.svelte +125 -0
  136. package/dist/components/drag-drop/DropZoneList.svelte.d.ts +92 -0
  137. package/dist/components/drag-drop/actions.d.ts +9 -0
  138. package/dist/components/drag-drop/actions.js +26 -0
  139. package/dist/components/drag-drop/drag-state.svelte.d.ts +97 -0
  140. package/dist/components/drag-drop/drag-state.svelte.js +322 -0
  141. package/dist/components/drag-drop/index.d.ts +6 -0
  142. package/dist/components/drag-drop/index.js +7 -0
  143. package/dist/components/drag-drop/util.d.ts +0 -0
  144. package/dist/components/drag-drop/util.js +85 -0
  145. package/dist/components/hkdev/blocks/TextBlock.svelte +47 -0
  146. package/dist/components/hkdev/blocks/TextBlock.svelte.d.ts +24 -0
  147. package/dist/components/hkdev/buttons/CheckButton.svelte +63 -0
  148. package/dist/components/hkdev/buttons/CheckButton.svelte.d.ts +34 -0
  149. package/dist/components/icons/HkIcon.svelte +86 -0
  150. package/dist/components/icons/HkIcon.svelte.d.ts +22 -0
  151. package/dist/components/icons/HkTabIcon.svelte +116 -0
  152. package/dist/components/icons/HkTabIcon.svelte.d.ts +40 -0
  153. package/dist/components/icons/SteezeIcon.svelte +97 -0
  154. package/dist/components/icons/SteezeIcon.svelte.d.ts +22 -0
  155. package/dist/components/icons/index.d.ts +4 -0
  156. package/dist/components/icons/index.js +6 -0
  157. package/dist/components/icons/typedef.d.ts +13 -0
  158. package/dist/components/icons/typedef.js +16 -0
  159. package/dist/components/index.d.ts +0 -0
  160. package/dist/components/index.js +2 -0
  161. package/dist/components/inputs/index.d.ts +1 -0
  162. package/dist/components/inputs/index.js +1 -0
  163. package/dist/components/inputs/text-input/TestTextInput.svelte__ +102 -0
  164. package/dist/components/inputs/text-input/TextInput.svelte +223 -0
  165. package/dist/components/inputs/text-input/TextInput.svelte.d.ts +56 -0
  166. package/dist/components/inputs/text-input/TextInput.svelte___ +83 -0
  167. package/dist/components/inputs/text-input/assets/IconInvalid.svelte +14 -0
  168. package/dist/components/inputs/text-input/assets/IconInvalid.svelte.d.ts +26 -0
  169. package/dist/components/inputs/text-input/assets/IconValid.svelte +12 -0
  170. package/dist/components/inputs/text-input/assets/IconValid.svelte.d.ts +26 -0
  171. package/dist/components/layout/grid-layers/GridLayers.svelte +63 -0
  172. package/dist/components/layout/grid-layers/GridLayers.svelte.d.ts +26 -0
  173. package/dist/components/layout/grid-layers/GridLayers.svelte__heightFrom__ +372 -0
  174. package/dist/components/layout/grid-layers/util.d.ts +19 -0
  175. package/dist/components/layout/grid-layers/util.js +74 -0
  176. package/dist/components/layout/index.d.ts +1 -0
  177. package/dist/components/layout/index.js +1 -0
  178. package/dist/components/panels/index.d.ts +1 -0
  179. package/dist/components/panels/index.js +1 -0
  180. package/dist/components/panels/panel/Panel.svelte +43 -0
  181. package/dist/components/panels/panel/Panel.svelte.d.ts +24 -0
  182. package/dist/components/rows/index.d.ts +2 -0
  183. package/dist/components/rows/index.js +3 -0
  184. package/dist/components/rows/panel-grid-row/PanelGridRow.svelte +104 -0
  185. package/dist/components/rows/panel-grid-row/PanelGridRow.svelte.d.ts +26 -0
  186. package/dist/components/rows/panel-row-2/PanelRow2.svelte +40 -0
  187. package/dist/components/rows/panel-row-2/PanelRow2.svelte.d.ts +26 -0
  188. package/dist/components/tab-bar/HkTabBar.state.svelte.d.ts +54 -0
  189. package/dist/components/tab-bar/HkTabBar.state.svelte.js +149 -0
  190. package/dist/components/tab-bar/HkTabBar.svelte +74 -0
  191. package/dist/components/tab-bar/HkTabBar.svelte.d.ts +34 -0
  192. package/dist/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +19 -0
  193. package/dist/components/tab-bar/HkTabBarSelector.state.svelte.js +93 -0
  194. package/dist/components/tab-bar/HkTabBarSelector.svelte +49 -0
  195. package/dist/components/tab-bar/HkTabBarSelector.svelte.d.ts +36 -0
  196. package/dist/components/tab-bar/index.d.ts +5 -0
  197. package/dist/components/tab-bar/index.js +17 -0
  198. package/dist/components/tab-bar/typedef.d.ts +8 -0
  199. package/dist/components/tab-bar/typedef.js +11 -0
  200. package/dist/config/imagetools-config.d.ts +26 -0
  201. package/dist/config/imagetools-config.js +189 -0
  202. package/dist/config/imagetools.d.ts +72 -0
  203. package/dist/constants/bases.d.ts +10 -0
  204. package/dist/constants/bases.js +13 -0
  205. package/dist/constants/errors/api.d.ts +10 -0
  206. package/dist/constants/errors/api.js +9 -0
  207. package/dist/constants/errors/generic.d.ts +20 -0
  208. package/dist/constants/errors/generic.js +20 -0
  209. package/dist/constants/errors/http.d.ts +16 -0
  210. package/dist/constants/errors/http.js +16 -0
  211. package/dist/constants/errors/index.d.ts +4 -0
  212. package/dist/constants/errors/index.js +4 -0
  213. package/dist/constants/errors/jwt.d.ts +8 -0
  214. package/dist/constants/errors/jwt.js +5 -0
  215. package/dist/constants/http/headers.d.ts +5 -0
  216. package/dist/constants/http/headers.js +6 -0
  217. package/dist/constants/http/index.d.ts +2 -0
  218. package/dist/constants/http/index.js +2 -0
  219. package/dist/constants/http/methods.d.ts +7 -0
  220. package/dist/constants/http/methods.js +14 -0
  221. package/dist/constants/index.d.ts +2 -0
  222. package/dist/constants/index.js +3 -0
  223. package/dist/constants/mime/application.d.ts +3 -0
  224. package/dist/constants/mime/application.js +5 -0
  225. package/dist/constants/mime/audio.d.ts +10 -0
  226. package/dist/constants/mime/audio.js +13 -0
  227. package/dist/constants/mime/image.d.ts +3 -0
  228. package/dist/constants/mime/image.js +3 -0
  229. package/dist/constants/mime/index.d.ts +4 -0
  230. package/dist/constants/mime/index.js +4 -0
  231. package/dist/constants/mime/text.d.ts +2 -0
  232. package/dist/constants/mime/text.js +2 -0
  233. package/dist/constants/regexp/index.d.ts +3 -0
  234. package/dist/constants/regexp/index.js +31 -0
  235. package/dist/constants/regexp/inspiratie.js__ +95 -0
  236. package/dist/constants/regexp/text.d.ts +47 -0
  237. package/dist/constants/regexp/text.js +49 -0
  238. package/dist/constants/regexp/user.d.ts +6 -0
  239. package/dist/constants/regexp/user.js +33 -0
  240. package/dist/constants/regexp/web.d.ts +1 -0
  241. package/dist/constants/regexp/web.js +3 -0
  242. package/dist/constants/state-labels/drag-states.d.ts +5 -0
  243. package/dist/constants/state-labels/drag-states.js +6 -0
  244. package/dist/constants/state-labels/drop-states.d.ts +4 -0
  245. package/dist/constants/state-labels/drop-states.js +6 -0
  246. package/dist/constants/state-labels/input-states.d.ts +8 -0
  247. package/dist/constants/state-labels/input-states.js +11 -0
  248. package/dist/constants/state-labels/submit-states.d.ts +4 -0
  249. package/dist/constants/state-labels/submit-states.js +4 -0
  250. package/dist/constants/time.d.ts +18 -0
  251. package/dist/constants/time.js +28 -0
  252. package/dist/css/utilities.css +43 -0
  253. package/dist/design/design-config.d.ts +157 -0
  254. package/dist/design/design-config.js +73 -0
  255. package/dist/design/tailwind-theme-extend.d.ts +23 -0
  256. package/dist/design/tailwind-theme-extend.js +158 -0
  257. package/dist/features/button-group/ButtonGroup.svelte +82 -0
  258. package/dist/features/button-group/ButtonGroup.svelte.d.ts +34 -0
  259. package/dist/features/button-group/typedef.d.ts +7 -0
  260. package/dist/features/button-group/typedef.js +10 -0
  261. package/dist/features/compare-left-right/CompareLeftRight.svelte +179 -0
  262. package/dist/features/compare-left-right/CompareLeftRight.svelte.d.ts +18 -0
  263. package/dist/features/compare-left-right/index.d.ts +1 -0
  264. package/dist/features/compare-left-right/index.js +1 -0
  265. package/dist/features/game-box/GameBox.svelte +577 -0
  266. package/dist/features/game-box/GameBox.svelte.d.ts +140 -0
  267. package/dist/features/game-box/gamebox.util.d.ts +32 -0
  268. package/dist/features/game-box/gamebox.util.js +83 -0
  269. package/dist/features/hk-app-layout/HkAppLayout.state.svelte.d.ts +6 -0
  270. package/dist/features/hk-app-layout/HkAppLayout.state.svelte.js +25 -0
  271. package/dist/features/hk-app-layout/HkAppLayout.svelte +251 -0
  272. package/dist/features/hk-app-layout/HkAppLayout.svelte.d.ts +19 -0
  273. package/dist/features/image-box/ImageBox.svelte +210 -0
  274. package/dist/features/image-box/ImageBox.svelte.d.ts +38 -0
  275. package/dist/features/image-box/index.d.ts +4 -0
  276. package/dist/features/image-box/index.js +5 -0
  277. package/dist/features/image-box/typedef.d.ts +4 -0
  278. package/dist/features/image-box/typedef.js +32 -0
  279. package/dist/features/index.d.ts +11 -0
  280. package/dist/features/index.js +23 -0
  281. package/dist/features/presenter/ImageSlide.svelte +64 -0
  282. package/dist/features/presenter/ImageSlide.svelte.d.ts +36 -0
  283. package/dist/features/presenter/Presenter.state.svelte.d.ts +74 -0
  284. package/dist/features/presenter/Presenter.state.svelte.js +638 -0
  285. package/dist/features/presenter/Presenter.svelte +142 -0
  286. package/dist/features/presenter/Presenter.svelte.d.ts +18 -0
  287. package/dist/features/presenter/constants.d.ts +5 -0
  288. package/dist/features/presenter/constants.js +7 -0
  289. package/dist/features/presenter/index.d.ts +6 -0
  290. package/dist/features/presenter/index.js +10 -0
  291. package/dist/features/presenter/typedef.d.ts +92 -0
  292. package/dist/features/presenter/typedef.js +106 -0
  293. package/dist/features/presenter/util.d.ts +63 -0
  294. package/dist/features/presenter/util.js +210 -0
  295. package/dist/features/virtual-viewport/VirtualViewport.svelte +196 -0
  296. package/dist/features/virtual-viewport/VirtualViewport.svelte.d.ts +42 -0
  297. package/dist/index.d.ts +0 -0
  298. package/dist/index.js +0 -0
  299. package/dist/logging/adapters/console.d.ts +48 -0
  300. package/dist/logging/adapters/console.js +114 -0
  301. package/dist/logging/adapters/pino.d.ts +25 -0
  302. package/dist/logging/adapters/pino.js +60 -0
  303. package/dist/logging/constants.d.ts +1 -0
  304. package/dist/logging/constants.js +1 -0
  305. package/dist/logging/factories/client.d.ts +10 -0
  306. package/dist/logging/factories/client.js +21 -0
  307. package/dist/logging/factories/server.d.ts +10 -0
  308. package/dist/logging/factories/server.js +22 -0
  309. package/dist/logging/factories/universal.d.ts +9 -0
  310. package/dist/logging/factories/universal.js +23 -0
  311. package/dist/logging/index.d.ts +5 -0
  312. package/dist/logging/index.js +8 -0
  313. package/dist/schemas/index.d.ts +1 -0
  314. package/dist/schemas/index.js +1 -0
  315. package/dist/schemas/validate-url.d.ts +30 -0
  316. package/dist/schemas/validate-url.js +180 -0
  317. package/dist/server/index.d.ts +1 -0
  318. package/dist/server/index.js +1 -0
  319. package/dist/server/logger.d.ts +25 -0
  320. package/dist/server/logger.js +94 -0
  321. package/dist/states/index.d.ts +1 -0
  322. package/dist/states/index.js +1 -0
  323. package/dist/states/navigation.svelte.d.ts +23 -0
  324. package/dist/states/navigation.svelte.js +55 -0
  325. package/dist/stores/index.d.ts +1 -0
  326. package/dist/stores/index.js +1 -0
  327. package/dist/stores/theme.d.ts +28 -0
  328. package/dist/stores/theme.js +80 -0
  329. package/dist/themes/hkdev/components/blocks/text-block.css +34 -0
  330. package/dist/themes/hkdev/components/boxes/game-box.css +11 -0
  331. package/dist/themes/hkdev/components/buttons/button-icon-steeze.css +22 -0
  332. package/dist/themes/hkdev/components/buttons/button-text.css +32 -0
  333. package/dist/themes/hkdev/components/buttons/button.css +146 -0
  334. package/dist/themes/hkdev/components/buttons/skip-button.css +5 -0
  335. package/dist/themes/hkdev/components/drag-drop/draggable.css +73 -0
  336. package/dist/themes/hkdev/components/drag-drop/drop-zone.css +58 -0
  337. package/dist/themes/hkdev/components/icons/icon-steeze.css +16 -0
  338. package/dist/themes/hkdev/components/inputs/text-input.css +102 -0
  339. package/dist/themes/hkdev/components/panels/panel.css +25 -0
  340. package/dist/themes/hkdev/components/rows/panel-grid-row.css +4 -0
  341. package/dist/themes/hkdev/components/rows/panel-row-2.css +5 -0
  342. package/dist/themes/hkdev/components.css +29 -0
  343. package/dist/themes/hkdev/debug.css +2 -0
  344. package/dist/themes/hkdev/global/layout.css +32 -0
  345. package/dist/themes/hkdev/global/on-colors.css +32 -0
  346. package/dist/themes/hkdev/globals.css +4 -0
  347. package/dist/themes/hkdev/responsive.css +12 -0
  348. package/dist/themes/hkdev/theme-ext.d.ts +4 -0
  349. package/dist/themes/hkdev/theme-ext.js +12 -0
  350. package/dist/themes/hkdev/theme.css +219 -0
  351. package/dist/themes/index.d.ts +1 -0
  352. package/dist/themes/index.js +1 -0
  353. package/dist/typedef/context.d.ts +3 -0
  354. package/dist/typedef/context.js +6 -0
  355. package/dist/typedef/drag.d.ts +29 -0
  356. package/dist/typedef/drag.js +25 -0
  357. package/dist/typedef/drop.d.ts +15 -0
  358. package/dist/typedef/drop.js +12 -0
  359. package/dist/typedef/image.d.ts +12 -0
  360. package/dist/typedef/image.js +38 -0
  361. package/dist/typedef/index.d.ts +4 -0
  362. package/dist/typedef/index.js +4 -0
  363. package/dist/util/array/index.d.ts +183 -0
  364. package/dist/util/array/index.js +436 -0
  365. package/dist/util/bases/base58.d.ts +58 -0
  366. package/dist/util/bases/base58.js +262 -0
  367. package/dist/util/bases/index.d.ts +1 -0
  368. package/dist/util/bases/index.js +1 -0
  369. package/dist/util/compare/index.d.ts +68 -0
  370. package/dist/util/compare/index.js +247 -0
  371. package/dist/util/css/css-vars.d.ts +24 -0
  372. package/dist/util/css/css-vars.js +83 -0
  373. package/dist/util/css/index.d.ts +1 -0
  374. package/dist/util/css/index.js +1 -0
  375. package/dist/util/design-system/components/states.d.ts +15 -0
  376. package/dist/util/design-system/components/states.js +22 -0
  377. package/dist/util/design-system/css/clamp.d.ts +17 -0
  378. package/dist/util/design-system/css/clamp.js +66 -0
  379. package/dist/util/design-system/css/root-design-vars.d.ts +77 -0
  380. package/dist/util/design-system/css/root-design-vars.js +102 -0
  381. package/dist/util/design-system/index.d.ts +5 -0
  382. package/dist/util/design-system/index.js +5 -0
  383. package/dist/util/design-system/layout/scaling.d.ts +98 -0
  384. package/dist/util/design-system/layout/scaling.js +228 -0
  385. package/dist/util/design-system/skeleton.d.ts +41 -0
  386. package/dist/util/design-system/skeleton.js +208 -0
  387. package/dist/util/design-system/tailwind.d.ts +183 -0
  388. package/dist/util/design-system/tailwind.js +288 -0
  389. package/dist/util/env/index.d.ts +1 -0
  390. package/dist/util/env/index.js +9 -0
  391. package/dist/util/exceptions/index.d.ts +15 -0
  392. package/dist/util/exceptions/index.js +23 -0
  393. package/dist/util/expect/arrays.d.ts +30 -0
  394. package/dist/util/expect/arrays.js +47 -0
  395. package/dist/util/expect/index.d.ts +103 -0
  396. package/dist/util/expect/index.js +259 -0
  397. package/dist/util/expect/primitives.d.ts +30 -0
  398. package/dist/util/expect/primitives.js +55 -0
  399. package/dist/util/expect/url.d.ts +32 -0
  400. package/dist/util/expect/url.js +60 -0
  401. package/dist/util/function/index.d.ts +34 -0
  402. package/dist/util/function/index.js +218 -0
  403. package/dist/util/geo/index.d.ts +10 -0
  404. package/dist/util/geo/index.js +26 -0
  405. package/dist/util/http/caching.d.ts +28 -0
  406. package/dist/util/http/caching.js +263 -0
  407. package/dist/util/http/errors.d.ts +18 -0
  408. package/dist/util/http/errors.js +97 -0
  409. package/dist/util/http/headers.d.ts +40 -0
  410. package/dist/util/http/headers.js +75 -0
  411. package/dist/util/http/http-request.d.ts +267 -0
  412. package/dist/util/http/http-request.js +578 -0
  413. package/dist/util/http/index.d.ts +6 -0
  414. package/dist/util/http/index.js +22 -0
  415. package/dist/util/http/json-request.d.ts +84 -0
  416. package/dist/util/http/json-request.js +224 -0
  417. package/dist/util/http/mocks.d.ts +20 -0
  418. package/dist/util/http/mocks.js +65 -0
  419. package/dist/util/http/response.d.ts +125 -0
  420. package/dist/util/http/response.js +294 -0
  421. package/dist/util/http/test-data__/content-length-test-hkdigital-small.V4HfZyBQ.avif +0 -0
  422. package/dist/util/http/typedef.d.ts +184 -0
  423. package/dist/util/http/typedef.js +93 -0
  424. package/dist/util/http/url.d.ts +25 -0
  425. package/dist/util/http/url.js +52 -0
  426. package/dist/util/image/index.d.ts +25 -0
  427. package/dist/util/image/index.js +86 -0
  428. package/dist/util/index.d.ts +3 -0
  429. package/dist/util/index.js +3 -0
  430. package/dist/util/is/index.d.ts +68 -0
  431. package/dist/util/is/index.js +140 -0
  432. package/dist/util/iterate/index.d.ts +131 -0
  433. package/dist/util/iterate/index.js +234 -0
  434. package/dist/util/object/index.d.ts +326 -0
  435. package/dist/util/object/index.js +1361 -0
  436. package/dist/util/singleton/index.d.ts +34 -0
  437. package/dist/util/singleton/index.js +97 -0
  438. package/dist/util/string/array-path.d.ts +15 -0
  439. package/dist/util/string/array-path.js +75 -0
  440. package/dist/util/string/convert.d.ts +22 -0
  441. package/dist/util/string/convert.js +54 -0
  442. package/dist/util/string/fs.d.ts +55 -0
  443. package/dist/util/string/fs.js +226 -0
  444. package/dist/util/string/index.d.ts +5 -0
  445. package/dist/util/string/index.js +5 -0
  446. package/dist/util/string/interpolate.d.ts +22 -0
  447. package/dist/util/string/interpolate.js +61 -0
  448. package/dist/util/string/pad.d.ts +8 -0
  449. package/dist/util/string/pad.js +10 -0
  450. package/dist/util/svelte/index.d.ts +3 -0
  451. package/dist/util/svelte/index.js +4 -0
  452. package/dist/util/svelte/loading/loading-tracker.svelte.d.ts +31 -0
  453. package/dist/util/svelte/loading/loading-tracker.svelte.js +108 -0
  454. package/dist/util/svelte/observe/index.d.ts +10 -0
  455. package/dist/util/svelte/observe/index.js +49 -0
  456. package/dist/util/svelte/state-context/index.d.ts +18 -0
  457. package/dist/util/svelte/state-context/index.js +117 -0
  458. package/dist/util/svelte/wait/index.d.ts +15 -0
  459. package/dist/util/svelte/wait/index.js +38 -0
  460. package/dist/util/sveltekit/index.d.ts +1 -0
  461. package/dist/util/sveltekit/index.js +1 -0
  462. package/dist/util/sveltekit/route-folders/index.d.ts +28 -0
  463. package/dist/util/sveltekit/route-folders/index.js +101 -0
  464. package/dist/util/time/index.d.ts +108 -0
  465. package/dist/util/time/index.js +323 -0
  466. package/dist/util/unique/index.d.ts +81 -0
  467. package/dist/util/unique/index.js +249 -0
  468. package/dist/valibot/date.js__ +10 -0
  469. package/dist/valibot/index.d.ts +4 -0
  470. package/dist/valibot/index.js +9 -0
  471. package/dist/valibot/url.d.ts +26 -0
  472. package/dist/valibot/url.js +95 -0
  473. package/dist/valibot/user.d.ts +6 -0
  474. package/dist/valibot/user.js +23 -0
  475. package/dist/zod/all.d.ts +6 -0
  476. package/dist/zod/all.js +33 -0
  477. package/dist/zod/generic.d.ts +6 -0
  478. package/dist/zod/generic.js +11 -0
  479. package/dist/zod/javascript.d.ts +8 -0
  480. package/dist/zod/javascript.js +32 -0
  481. package/dist/zod/user.d.ts +9 -0
  482. package/dist/zod/user.js +16 -0
  483. package/dist/zod/web.d.ts +21 -0
  484. package/dist/zod/web.js +52 -0
  485. package/package.json +133 -0
@@ -0,0 +1,577 @@
1
+ <script>
2
+ import { onMount } from 'svelte';
3
+
4
+ import {
5
+ getGameWidthOnLandscape,
6
+ getGameWidthOnPortrait
7
+ } from './gamebox.util.js';
8
+
9
+ import { enableContainerScaling } from '../../util/design-system/index.js';
10
+ // import { enableContainerScaling } from '@hkdigital/lib-sveltekit/util/design-system/index.js';
11
+
12
+ /**
13
+ * @typedef {{
14
+ * isMobile:boolean,
15
+ * os:'Android'|'iOS',
16
+ * isFullscreen:boolean,
17
+ * isDevMode:boolean,
18
+ * requestDevmode:function,
19
+ * requestFullscreen:function,
20
+ * gameWidth: number,
21
+ * gameHeight: number
22
+ * }} SnippetParams
23
+ */
24
+
25
+ /**
26
+ * @typedef {import('svelte').Snippet<[SnippetParams]>} GameBoxSnippet
27
+ */
28
+
29
+ /**
30
+ * @type {{
31
+ * base?: string,
32
+ * bg?: string,
33
+ * classes?: string,
34
+ * style?: string,
35
+ * aspectOnLandscape?: number,
36
+ * aspectOnPortrait?: number,
37
+ * marginLeft?: number,
38
+ * marginRight?: number,
39
+ * marginTop?: number,
40
+ * marginBottom?: number,
41
+ * center?: boolean,
42
+ * enableScaling?: boolean,
43
+ * designLandscape?: {width: number, height: number},
44
+ * designPortrait?: {width: number, height: number},
45
+ * clamping?: {
46
+ * ui: {min: number, max: number},
47
+ * textBase: {min: number, max: number},
48
+ * textHeading: {min: number, max: number},
49
+ * textUi: {min: number, max: number}
50
+ * },
51
+ * snippetLandscape?:GameBoxSnippet,
52
+ * snippetPortrait?: GameBoxSnippet,
53
+ * snippetRequireFullscreen?: GameBoxSnippet,
54
+ * snippetInstallOnHomeScreen?: GameBoxSnippet,
55
+ * [attr: string]: any
56
+ * }}
57
+ */
58
+ const {
59
+ // > Style
60
+ base = '',
61
+ bg = '',
62
+ classes = '',
63
+ style = '',
64
+
65
+ // > Functional properties
66
+ aspectOnLandscape,
67
+ aspectOnPortrait,
68
+
69
+ marginLeft = 0,
70
+ marginRight = 0,
71
+
72
+ marginTop = 0,
73
+ marginBottom = 0,
74
+
75
+ center,
76
+
77
+ // > Scaling options
78
+ enableScaling = false,
79
+ designLandscape = { width: 1920, height: 1080 },
80
+ designPortrait = { width: 1920, height: 1080 },
81
+ clamping = {
82
+ ui: { min: 0.3, max: 2 },
83
+ textBase: { min: 0.75, max: 1.5 },
84
+ textHeading: { min: 0.75, max: 2.25 },
85
+ textUi: { min: 0.5, max: 1.25 }
86
+ },
87
+
88
+ // > Snippets
89
+ snippetLandscape,
90
+ snippetPortrait,
91
+ snippetRequireFullscreen,
92
+ snippetInstallOnHomeScreen
93
+ } = $props();
94
+
95
+ // > Game dimensions and state
96
+ let windowWidth = $state();
97
+ let windowHeight = $state();
98
+
99
+ let gameWidth = $state();
100
+ let gameHeight = $state();
101
+
102
+ let iosWindowWidth = $state();
103
+ let iosWindowHeight = $state();
104
+
105
+ function getIsLandscape() {
106
+ if (isPwa && isAppleMobile) {
107
+ return iosWindowWidth > iosWindowHeight;
108
+ } else {
109
+ return windowWidth > windowHeight;
110
+ }
111
+ }
112
+
113
+ let isLandscape = $state();
114
+
115
+ // $derived.by(getIsLandscape);
116
+
117
+ $effect(() => {
118
+ isLandscape = getIsLandscape();
119
+ });
120
+
121
+ // Game container reference
122
+ let gameContainer = $state();
123
+
124
+ // Update game dimensions based on window size and orientation
125
+ $effect(() => {
126
+ const width = iosWindowWidth ?? windowWidth;
127
+ const height = iosWindowHeight ?? windowHeight;
128
+
129
+ if (!width || !height) return;
130
+
131
+ const availWidth = width - marginLeft - marginRight;
132
+ const availHeight = height - marginTop - marginBottom;
133
+
134
+ // console.debug('GameBox margins:', {
135
+ // marginLeft,
136
+ // marginRight,
137
+ // marginTop,
138
+ // marginBottom
139
+ // });
140
+
141
+ let gameAspect;
142
+
143
+ if (availWidth > availHeight) {
144
+ gameWidth = getGameWidthOnLandscape({
145
+ windowWidth: availWidth,
146
+ windowHeight: availHeight,
147
+ aspectOnLandscape
148
+ });
149
+ gameAspect = aspectOnLandscape;
150
+ } else {
151
+ gameWidth = getGameWidthOnPortrait({
152
+ windowWidth: availWidth,
153
+ windowHeight: availHeight,
154
+ aspectOnPortrait
155
+ });
156
+ gameAspect = aspectOnPortrait;
157
+ }
158
+
159
+ if (gameAspect) {
160
+ gameHeight = gameWidth / gameAspect;
161
+ } else {
162
+ gameHeight = availHeight;
163
+ }
164
+ });
165
+
166
+ // Set up scaling if enabled, with orientation awareness
167
+ $effect(() => {
168
+ if (!enableScaling || !gameContainer || !gameWidth || !gameHeight) {
169
+ return () => {}; // No-op cleanup if scaling not enabled or required elements missing
170
+ }
171
+
172
+ // Select the appropriate design based on orientation
173
+ const activeDesign = isLandscape ? designLandscape : designPortrait;
174
+
175
+ // console.debug(
176
+ // `GameBox scaling [${isLandscape ? 'landscape' : 'portrait'}]:`,
177
+ // `game: ${gameWidth}x${gameHeight}`,
178
+ // `design: ${activeDesign.width}x${activeDesign.height}`
179
+ // );
180
+
181
+ // Apply scaling with the current design based on orientation
182
+ return enableContainerScaling({
183
+ container: gameContainer,
184
+ design: activeDesign,
185
+ clamping,
186
+ getDimensions: () => ({
187
+ width: gameWidth,
188
+ height: gameHeight
189
+ })
190
+ });
191
+ });
192
+
193
+ let show = $state(false);
194
+
195
+ const isAppleMobile = /iPhone|iPod/.test(navigator.userAgent);
196
+
197
+ let isPwa = $state(false);
198
+
199
+ let os = $state();
200
+
201
+ let isMobile = $state(false);
202
+
203
+ let isDevMode = $state(false);
204
+
205
+ // Check: always true for home app?
206
+ let isFullscreen = $state(false);
207
+
208
+ let supportsFullscreen = $state(false);
209
+
210
+ onMount(() => {
211
+ supportsFullscreen = document.fullscreenEnabled;
212
+
213
+ isMobile = getIsMobile();
214
+
215
+ os = getOS();
216
+
217
+ // Run before show
218
+ isFullscreen = !!document.fullscreenElement;
219
+
220
+ isPwa = window.matchMedia(
221
+ '(display-mode: fullscreen) or (display-mode: standalone)'
222
+ ).matches;
223
+
224
+ isLandscape = getIsLandscape();
225
+
226
+ show = true;
227
+
228
+ function updateIosWidthHeight() {
229
+ // const isPwa = window.matchMedia(
230
+ // '(display-mode: fullscreen) or (display-mode: standalone)'
231
+ // ).matches;
232
+
233
+ if (isPwa && isAppleMobile) {
234
+ const angle = screen.orientation.angle;
235
+
236
+ if (angle === 90 || angle === 270) {
237
+ iosWindowWidth = screen.height;
238
+ iosWindowHeight = screen.width;
239
+ } else {
240
+ iosWindowWidth = screen.width;
241
+ iosWindowHeight = screen.height;
242
+ }
243
+ // console.debug( { iosWindowWidth, iosWindowHeight } );
244
+ }
245
+ }
246
+
247
+ updateIosWidthHeight();
248
+
249
+ function updateOrientation(event) {
250
+ // console.debug('updateOrientation');
251
+ const type = event.target.type;
252
+ const angle = event.target.angle;
253
+
254
+ // isPwa = window.matchMedia(
255
+ // '(display-mode: fullscreen) or (display-mode: standalone)'
256
+ // ).matches;
257
+
258
+ updateIosWidthHeight();
259
+
260
+ console.debug(
261
+ `ScreenOrientation change: ${type}, ${angle} degrees.`,
262
+ isPwa,
263
+ windowWidth,
264
+ windowHeight,
265
+ screen.width,
266
+ screen.height,
267
+ iosWindowWidth,
268
+ iosWindowHeight
269
+ );
270
+
271
+ // if( angle
272
+ }
273
+
274
+ $effect(() => {
275
+ screen.orientation.addEventListener('change', updateOrientation);
276
+
277
+ return () => {
278
+ screen.orientation.removeEventListener('change', updateOrientation);
279
+ };
280
+ });
281
+
282
+ //
283
+ });
284
+
285
+ onMount(() => {
286
+ const gameBoxNoScroll = 'game-box-no-scroll';
287
+ const html = document.documentElement;
288
+ html.classList.add(gameBoxNoScroll);
289
+
290
+ return () => {
291
+ html.classList.remove(gameBoxNoScroll);
292
+ };
293
+ });
294
+
295
+ function getOS() {
296
+ if (isAppleMobile) {
297
+ return 'iOS';
298
+ } else if (/Android/.test(navigator.userAgent)) {
299
+ return 'Android';
300
+ }
301
+ }
302
+
303
+ /**
304
+ * Returns true if a device is a mobile phone (or similar)
305
+ */
306
+ function getIsMobile() {
307
+ // @ts-ignore
308
+ if (navigator?.userAgentData?.mobile !== undefined) {
309
+ // Supports for mobile flag
310
+ // @ts-ignore
311
+ return navigator.userAgentData.mobile;
312
+ } else if (isAppleMobile) {
313
+ return true;
314
+ } else if (/Android/.test(navigator.userAgent)) {
315
+ return true;
316
+ }
317
+
318
+ return false;
319
+ }
320
+
321
+ /**
322
+ * Returns true if the window is in full screen
323
+ * - Checks if CSS thinks we're in fullscreen mode
324
+ * - Checks if there is a fullscreen element (for safari)
325
+ */
326
+ function getIsFullscreen() {
327
+ if (
328
+ window.matchMedia(
329
+ '(display-mode: fullscreen) or (display-mode: standalone)'
330
+ ).matches
331
+ ) {
332
+ return true;
333
+ } else if (document.fullscreenElement) {
334
+ // Safari
335
+ return true;
336
+ }
337
+
338
+ return false;
339
+ }
340
+
341
+ async function requestFullscreen() {
342
+ console.debug('Request full screen');
343
+ show = false;
344
+
345
+ await document.documentElement.requestFullscreen();
346
+ isFullscreen = true;
347
+
348
+ setTimeout(() => {
349
+ show = true;
350
+ }, 1000);
351
+ }
352
+
353
+ // async function exitFullscreen() {
354
+ // console.debug('Exit full screen');
355
+ // show = false;
356
+
357
+ // await document.exitFullscreen();
358
+ // isFullscreen = false;
359
+
360
+ // setTimeout( () => { show = true; }, 1000 );
361
+ // }
362
+
363
+ $effect(() => {
364
+ // Update isFullscreen if window width or height changes
365
+
366
+ windowWidth;
367
+ windowHeight;
368
+
369
+ isFullscreen = getIsFullscreen();
370
+
371
+ // if( !isFullscreen )
372
+ // {
373
+ // show = false;
374
+ // setTimeout( () => { show = true; }, 1000 );
375
+ // }
376
+
377
+ // console.debug('isFullscreen', isFullscreen);
378
+ });
379
+
380
+ isDevMode = false;
381
+
382
+ function requestDevmode() {
383
+ isDevMode = true;
384
+ console.debug(isDevMode);
385
+ }
386
+
387
+ $effect(() => {
388
+ if (location.hostname === 'localhost') {
389
+ isDevMode = true;
390
+ }
391
+ });
392
+
393
+ $effect(() => {
394
+ if (isFullscreen) {
395
+ const url = new URL(window.location.href);
396
+ url.searchParams.set('preset', 'cinema');
397
+ window.history.pushState({}, '', url);
398
+ }
399
+ });
400
+ </script>
401
+
402
+ <svelte:window bind:innerWidth={windowWidth} bind:innerHeight={windowHeight} />
403
+
404
+ {#if gameHeight}
405
+ <div class:center>
406
+ <div
407
+ data-component="game-box"
408
+ data-orientation={isLandscape ? 'landscape' : 'portrait'}
409
+ bind:this={gameContainer}
410
+ class="{base} {bg} {classes}"
411
+ class:isMobile
412
+ style:width="{gameWidth}px"
413
+ style:height="{gameHeight}px"
414
+ style:--game-width={gameWidth}
415
+ style:--game-height={gameHeight}
416
+ style:margin-left="{marginLeft}px"
417
+ style:margin-right="{marginRight}px"
418
+ style:margin-top="{marginTop}px"
419
+ style:margin-bottom="{marginBottom}px"
420
+ {style}
421
+ >
422
+ {#if show}
423
+ {#if isLandscape}
424
+ <!-- Landscape -->
425
+ {#if snippetRequireFullscreen}
426
+ <!-- Require fullscreen -->
427
+ {#if isFullscreen && !isDevMode}
428
+ {@render snippetLandscape({
429
+ isMobile,
430
+ os,
431
+ isFullscreen,
432
+ isDevMode,
433
+ requestDevmode,
434
+ requestFullscreen,
435
+ gameWidth,
436
+ gameHeight
437
+ })}
438
+ {:else if supportsFullscreen && !isDevMode}
439
+ <!-- Require fullscreen (on landscape) -->
440
+ {@render snippetRequireFullscreen({
441
+ isMobile,
442
+ os,
443
+ isFullscreen,
444
+ isDevMode,
445
+ requestDevmode,
446
+ requestFullscreen,
447
+ gameWidth,
448
+ gameHeight
449
+ })}
450
+ {:else if isMobile && snippetInstallOnHomeScreen && !isDevMode}
451
+ <!-- Require install on home screen on mobile -->
452
+ {@render snippetInstallOnHomeScreen({
453
+ isMobile,
454
+ os,
455
+ isFullscreen,
456
+ isDevMode,
457
+ requestDevmode,
458
+ requestFullscreen,
459
+ gameWidth,
460
+ gameHeight
461
+ })}
462
+ {:else}
463
+ {@render snippetLandscape({
464
+ isMobile,
465
+ os,
466
+ isFullscreen,
467
+ isDevMode,
468
+ requestDevmode,
469
+ requestFullscreen,
470
+ gameWidth,
471
+ gameHeight
472
+ })}
473
+ {/if}
474
+ {:else}
475
+ <!-- Do not require fullscreen -->
476
+ <!-- *we do not try install home app -->
477
+ {@render snippetLandscape({
478
+ isMobile,
479
+ os,
480
+ isFullscreen,
481
+ isDevMode,
482
+ requestDevmode,
483
+ requestFullscreen,
484
+ gameWidth,
485
+ gameHeight
486
+ })}
487
+ {/if}
488
+ {:else}
489
+ <!-- Portrait -->
490
+ {#if snippetRequireFullscreen}
491
+ <!-- Require fullscreen -->
492
+ {#if isFullscreen && !isDevMode}
493
+ {@render snippetPortrait({
494
+ isMobile,
495
+ os,
496
+ isFullscreen,
497
+ isDevMode,
498
+ requestDevmode,
499
+ requestFullscreen,
500
+ gameWidth,
501
+ gameHeight
502
+ })}
503
+ {:else if supportsFullscreen && !isDevMode}
504
+ <!-- Require fullscreen (on landscape) -->
505
+ {@render snippetRequireFullscreen({
506
+ isMobile,
507
+ os,
508
+ isFullscreen,
509
+ isDevMode,
510
+ requestDevmode,
511
+ requestFullscreen,
512
+ gameWidth,
513
+ gameHeight
514
+ })}
515
+ {:else if isMobile && snippetInstallOnHomeScreen && !isDevMode}
516
+ <!-- Require install on home screen on mobile -->
517
+ {@render snippetInstallOnHomeScreen({
518
+ isMobile,
519
+ os,
520
+ isFullscreen,
521
+ isDevMode,
522
+ requestDevmode,
523
+ requestFullscreen,
524
+ gameWidth,
525
+ gameHeight
526
+ })}
527
+ {:else}
528
+ {@render snippetPortrait({
529
+ isMobile,
530
+ os,
531
+ isFullscreen,
532
+ isDevMode,
533
+ requestDevmode,
534
+ requestFullscreen,
535
+ gameWidth,
536
+ gameHeight
537
+ })}
538
+ {/if}
539
+ {:else}
540
+ <!-- Do not require fullscreen -->
541
+ <!-- *we do not try install home app -->
542
+ {@render snippetPortrait({
543
+ isMobile,
544
+ os,
545
+ isFullscreen,
546
+ isDevMode,
547
+ requestDevmode,
548
+ requestFullscreen,
549
+ gameWidth,
550
+ gameHeight
551
+ })}
552
+ {/if}
553
+ {/if}
554
+ {/if}
555
+ </div>
556
+ </div>
557
+ {/if}
558
+
559
+ <style>
560
+ .center {
561
+ display: grid;
562
+ height: 100lvh;
563
+ display: grid;
564
+ justify-items: center;
565
+ align-items: center;
566
+ /* border: solid 1px red;*/
567
+ }
568
+
569
+ :global(html.game-box-no-scroll) {
570
+ overflow: clip;
571
+ scrollbar-width: none; /* Firefox */
572
+ -ms-overflow-style: none; /* IE and Edge */
573
+ }
574
+ :global(html.game-box-no-scroll::-webkit-scrollbar) {
575
+ display: none;
576
+ }
577
+ </style>
@@ -0,0 +1,140 @@
1
+ export default GameBox;
2
+ type GameBox = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<{
5
+ [attr: string]: any;
6
+ base?: string;
7
+ bg?: string;
8
+ classes?: string;
9
+ style?: string;
10
+ aspectOnLandscape?: number;
11
+ aspectOnPortrait?: number;
12
+ marginLeft?: number;
13
+ marginRight?: number;
14
+ marginTop?: number;
15
+ marginBottom?: number;
16
+ center?: boolean;
17
+ enableScaling?: boolean;
18
+ designLandscape?: {
19
+ width: number;
20
+ height: number;
21
+ };
22
+ designPortrait?: {
23
+ width: number;
24
+ height: number;
25
+ };
26
+ clamping?: {
27
+ ui: {
28
+ min: number;
29
+ max: number;
30
+ };
31
+ textBase: {
32
+ min: number;
33
+ max: number;
34
+ };
35
+ textHeading: {
36
+ min: number;
37
+ max: number;
38
+ };
39
+ textUi: {
40
+ min: number;
41
+ max: number;
42
+ };
43
+ };
44
+ snippetLandscape?: Snippet<[SnippetParams]>;
45
+ snippetPortrait?: Snippet<[SnippetParams]>;
46
+ snippetRequireFullscreen?: Snippet<[SnippetParams]>;
47
+ snippetInstallOnHomeScreen?: Snippet<[SnippetParams]>;
48
+ }>): void;
49
+ };
50
+ declare const GameBox: import("svelte").Component<{
51
+ [attr: string]: any;
52
+ base?: string;
53
+ bg?: string;
54
+ classes?: string;
55
+ style?: string;
56
+ aspectOnLandscape?: number;
57
+ aspectOnPortrait?: number;
58
+ marginLeft?: number;
59
+ marginRight?: number;
60
+ marginTop?: number;
61
+ marginBottom?: number;
62
+ center?: boolean;
63
+ enableScaling?: boolean;
64
+ designLandscape?: {
65
+ width: number;
66
+ height: number;
67
+ };
68
+ designPortrait?: {
69
+ width: number;
70
+ height: number;
71
+ };
72
+ clamping?: {
73
+ ui: {
74
+ min: number;
75
+ max: number;
76
+ };
77
+ textBase: {
78
+ min: number;
79
+ max: number;
80
+ };
81
+ textHeading: {
82
+ min: number;
83
+ max: number;
84
+ };
85
+ textUi: {
86
+ min: number;
87
+ max: number;
88
+ };
89
+ };
90
+ snippetLandscape?: import("svelte").Snippet<[{
91
+ isMobile: boolean;
92
+ os: "Android" | "iOS";
93
+ isFullscreen: boolean;
94
+ isDevMode: boolean;
95
+ requestDevmode: Function;
96
+ requestFullscreen: Function;
97
+ gameWidth: number;
98
+ gameHeight: number;
99
+ }]>;
100
+ snippetPortrait?: import("svelte").Snippet<[{
101
+ isMobile: boolean;
102
+ os: "Android" | "iOS";
103
+ isFullscreen: boolean;
104
+ isDevMode: boolean;
105
+ requestDevmode: Function;
106
+ requestFullscreen: Function;
107
+ gameWidth: number;
108
+ gameHeight: number;
109
+ }]>;
110
+ snippetRequireFullscreen?: import("svelte").Snippet<[{
111
+ isMobile: boolean;
112
+ os: "Android" | "iOS";
113
+ isFullscreen: boolean;
114
+ isDevMode: boolean;
115
+ requestDevmode: Function;
116
+ requestFullscreen: Function;
117
+ gameWidth: number;
118
+ gameHeight: number;
119
+ }]>;
120
+ snippetInstallOnHomeScreen?: import("svelte").Snippet<[{
121
+ isMobile: boolean;
122
+ os: "Android" | "iOS";
123
+ isFullscreen: boolean;
124
+ isDevMode: boolean;
125
+ requestDevmode: Function;
126
+ requestFullscreen: Function;
127
+ gameWidth: number;
128
+ gameHeight: number;
129
+ }]>;
130
+ }, {}, "">;
131
+ type SnippetParams = {
132
+ isMobile: boolean;
133
+ os: "Android" | "iOS";
134
+ isFullscreen: boolean;
135
+ isDevMode: boolean;
136
+ requestDevmode: Function;
137
+ requestFullscreen: Function;
138
+ gameWidth: number;
139
+ gameHeight: number;
140
+ };