@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.
- package/README.md +149 -0
- package/dist/assets/autospuiten/car-paint-picker/army-green.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/electric-blue.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/lemon-yellow.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/opaque-purple.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/rusty.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/sunset-orange.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker/tomato-red.jpg +0 -0
- package/dist/assets/autospuiten/car-paint-picker.d.ts +17 -0
- package/dist/assets/autospuiten/car-paint-picker.js +41 -0
- package/dist/assets/autospuiten/labels.d.ts +7 -0
- package/dist/assets/autospuiten/labels.js +7 -0
- package/dist/classes/cache/IndexedDbCache.d.ts +216 -0
- package/dist/classes/cache/IndexedDbCache.js +1407 -0
- package/dist/classes/cache/MemoryResponseCache.d.ts +106 -0
- package/dist/classes/cache/MemoryResponseCache.js +138 -0
- package/dist/classes/cache/index.d.ts +3 -0
- package/dist/classes/cache/index.js +5 -0
- package/dist/classes/cache/typedef.d.ts +67 -0
- package/dist/classes/cache/typedef.js +41 -0
- package/dist/classes/data/IterableTree.d.ts +51 -0
- package/dist/classes/data/IterableTree.js +243 -0
- package/dist/classes/data/Selector.d.ts +30 -0
- package/dist/classes/data/Selector.js +190 -0
- package/dist/classes/data/index.d.ts +2 -0
- package/dist/classes/data/index.js +2 -0
- package/dist/classes/events/EventEmitter.d.ts +142 -0
- package/dist/classes/events/EventEmitter.js +275 -0
- package/dist/classes/events/index.d.ts +1 -0
- package/dist/classes/events/index.js +2 -0
- package/dist/classes/index.d.ts +4 -0
- package/dist/classes/index.js +4 -0
- package/dist/classes/logging/Logger.d.ts +78 -0
- package/dist/classes/logging/Logger.js +210 -0
- package/dist/classes/logging/constants.d.ts +12 -0
- package/dist/classes/logging/constants.js +16 -0
- package/dist/classes/logging/index.d.ts +2 -0
- package/dist/classes/logging/index.js +4 -0
- package/dist/classes/logging/typedef.d.ts +34 -0
- package/dist/classes/logging/typedef.js +17 -0
- package/dist/classes/promise/HkPromise.d.ts +121 -0
- package/dist/classes/promise/HkPromise.js +377 -0
- package/dist/classes/promise/index.d.ts +1 -0
- package/dist/classes/promise/index.js +1 -0
- package/dist/classes/services/ServiceBase.d.ts +163 -0
- package/dist/classes/services/ServiceBase.js +463 -0
- package/dist/classes/services/ServiceManager.d.ts +179 -0
- package/dist/classes/services/ServiceManager.js +614 -0
- package/dist/classes/services/index.d.ts +4 -0
- package/dist/classes/services/index.js +5 -0
- package/dist/classes/services/service-states.d.ts +159 -0
- package/dist/classes/services/service-states.js +205 -0
- package/dist/classes/services/typedef.d.ts +247 -0
- package/dist/classes/services/typedef.js +179 -0
- package/dist/classes/stores/SubscribersCount.d.ts +39 -0
- package/dist/classes/stores/SubscribersCount.js +107 -0
- package/dist/classes/stores/index.d.ts +1 -0
- package/dist/classes/stores/index.js +1 -0
- package/dist/classes/streams/LogTransformStream.d.ts +4 -0
- package/dist/classes/streams/LogTransformStream.js +19 -0
- package/dist/classes/streams/ServerEventsStore.d.ts +22 -0
- package/dist/classes/streams/ServerEventsStore.js +110 -0
- package/dist/classes/streams/TimeStampSource.d.ts +13 -0
- package/dist/classes/streams/TimeStampSource.js +26 -0
- package/dist/classes/streams/index.d.ts +3 -0
- package/dist/classes/streams/index.js +3 -0
- package/dist/classes/svelte/audio/AudioLoader.svelte.d.ts +30 -0
- package/dist/classes/svelte/audio/AudioLoader.svelte.js +58 -0
- package/dist/classes/svelte/audio/AudioScene.svelte.d.ts +74 -0
- package/dist/classes/svelte/audio/AudioScene.svelte.js +324 -0
- package/dist/classes/svelte/audio/mocks.d.ts +7 -0
- package/dist/classes/svelte/audio/mocks.js +35 -0
- package/dist/classes/svelte/finite-state-machine/FiniteStateMachine.svelte.d.ts +50 -0
- package/dist/classes/svelte/finite-state-machine/FiniteStateMachine.svelte.js +133 -0
- package/dist/classes/svelte/finite-state-machine/index.d.ts +1 -0
- package/dist/classes/svelte/finite-state-machine/index.js +1 -0
- package/dist/classes/svelte/image/ImageLoader.svelte.d.ts +19 -0
- package/dist/classes/svelte/image/ImageLoader.svelte.js +45 -0
- package/dist/classes/svelte/image/ImageScene.svelte.d.ts +78 -0
- package/dist/classes/svelte/image/ImageScene.svelte.js +249 -0
- package/dist/classes/svelte/image/ImageVariantsLoader.svelte.d.ts +43 -0
- package/dist/classes/svelte/image/ImageVariantsLoader.svelte.js +152 -0
- package/dist/classes/svelte/image/index.d.ts +2 -0
- package/dist/classes/svelte/image/index.js +4 -0
- package/dist/classes/svelte/image/mocks.d.ts +7 -0
- package/dist/classes/svelte/image/mocks.js +35 -0
- package/dist/classes/svelte/image/typedef.d.ts +16 -0
- package/dist/classes/svelte/image/typedef.js +8 -0
- package/dist/classes/svelte/index.d.ts +9 -0
- package/dist/classes/svelte/index.js +14 -0
- package/dist/classes/svelte/loading-state-machine/LoadingStateMachine.svelte.d.ts +12 -0
- package/dist/classes/svelte/loading-state-machine/LoadingStateMachine.svelte.js +109 -0
- package/dist/classes/svelte/loading-state-machine/constants.d.ts +12 -0
- package/dist/classes/svelte/loading-state-machine/constants.js +16 -0
- package/dist/classes/svelte/loading-state-machine/index.d.ts +2 -0
- package/dist/classes/svelte/loading-state-machine/index.js +3 -0
- package/dist/classes/svelte/network-loader/NetworkLoader.svelte.d.ts +91 -0
- package/dist/classes/svelte/network-loader/NetworkLoader.svelte.js +338 -0
- package/dist/classes/svelte/network-loader/constants.d.ts +2 -0
- package/dist/classes/svelte/network-loader/constants.js +3 -0
- package/dist/classes/svelte/network-loader/index.d.ts +2 -0
- package/dist/classes/svelte/network-loader/index.js +3 -0
- package/dist/classes/svelte/network-loader/mocks.d.ts +7 -0
- package/dist/classes/svelte/network-loader/mocks.js +30 -0
- package/dist/classes/svelte/network-loader/typedef.d.ts +7 -0
- package/dist/classes/svelte/network-loader/typedef.js +8 -0
- package/dist/components/area/HkArea.svelte +49 -0
- package/dist/components/area/HkArea.svelte.d.ts +26 -0
- package/dist/components/area/HkGridArea.svelte +77 -0
- package/dist/components/area/HkGridArea.svelte.d.ts +42 -0
- package/dist/components/area/index.d.ts +2 -0
- package/dist/components/area/index.js +2 -0
- package/dist/components/buttons/button/Button.svelte +82 -0
- package/dist/components/buttons/button/Button.svelte.d.ts +44 -0
- package/dist/components/buttons/button-icon-steeze/SteezeIconButton.svelte +30 -0
- package/dist/components/buttons/button-icon-steeze/SteezeIconButton.svelte.d.ts +16 -0
- package/dist/components/buttons/button-text/TextButton.svelte +21 -0
- package/dist/components/buttons/button-text/TextButton.svelte.d.ts +12 -0
- package/dist/components/buttons/index.d.ts +3 -0
- package/dist/components/buttons/index.js +3 -0
- package/dist/components/debug/debug-panel-design-scaling/DebugPanelDesignScaling.svelte +146 -0
- package/dist/components/debug/debug-panel-design-scaling/DebugPanelDesignScaling.svelte.d.ts +6 -0
- package/dist/components/debug/index.d.ts +1 -0
- package/dist/components/debug/index.js +1 -0
- package/dist/components/drag-drop/DragController.d.ts +20 -0
- package/dist/components/drag-drop/DragController.js +44 -0
- package/dist/components/drag-drop/DragDropContext.svelte +111 -0
- package/dist/components/drag-drop/DragDropContext.svelte.d.ts +18 -0
- package/dist/components/drag-drop/Draggable.svelte +519 -0
- package/dist/components/drag-drop/Draggable.svelte.d.ts +95 -0
- package/dist/components/drag-drop/DropZone.svelte +258 -0
- package/dist/components/drag-drop/DropZone.svelte.d.ts +96 -0
- package/dist/components/drag-drop/DropZoneArea.svelte +119 -0
- package/dist/components/drag-drop/DropZoneArea.svelte.d.ts +90 -0
- package/dist/components/drag-drop/DropZoneList.svelte +125 -0
- package/dist/components/drag-drop/DropZoneList.svelte.d.ts +92 -0
- package/dist/components/drag-drop/actions.d.ts +9 -0
- package/dist/components/drag-drop/actions.js +26 -0
- package/dist/components/drag-drop/drag-state.svelte.d.ts +97 -0
- package/dist/components/drag-drop/drag-state.svelte.js +322 -0
- package/dist/components/drag-drop/index.d.ts +6 -0
- package/dist/components/drag-drop/index.js +7 -0
- package/dist/components/drag-drop/util.d.ts +0 -0
- package/dist/components/drag-drop/util.js +85 -0
- package/dist/components/hkdev/blocks/TextBlock.svelte +47 -0
- package/dist/components/hkdev/blocks/TextBlock.svelte.d.ts +24 -0
- package/dist/components/hkdev/buttons/CheckButton.svelte +63 -0
- package/dist/components/hkdev/buttons/CheckButton.svelte.d.ts +34 -0
- package/dist/components/icons/HkIcon.svelte +86 -0
- package/dist/components/icons/HkIcon.svelte.d.ts +22 -0
- package/dist/components/icons/HkTabIcon.svelte +116 -0
- package/dist/components/icons/HkTabIcon.svelte.d.ts +40 -0
- package/dist/components/icons/SteezeIcon.svelte +97 -0
- package/dist/components/icons/SteezeIcon.svelte.d.ts +22 -0
- package/dist/components/icons/index.d.ts +4 -0
- package/dist/components/icons/index.js +6 -0
- package/dist/components/icons/typedef.d.ts +13 -0
- package/dist/components/icons/typedef.js +16 -0
- package/dist/components/index.d.ts +0 -0
- package/dist/components/index.js +2 -0
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/inputs/index.js +1 -0
- package/dist/components/inputs/text-input/TestTextInput.svelte__ +102 -0
- package/dist/components/inputs/text-input/TextInput.svelte +223 -0
- package/dist/components/inputs/text-input/TextInput.svelte.d.ts +56 -0
- package/dist/components/inputs/text-input/TextInput.svelte___ +83 -0
- package/dist/components/inputs/text-input/assets/IconInvalid.svelte +14 -0
- package/dist/components/inputs/text-input/assets/IconInvalid.svelte.d.ts +26 -0
- package/dist/components/inputs/text-input/assets/IconValid.svelte +12 -0
- package/dist/components/inputs/text-input/assets/IconValid.svelte.d.ts +26 -0
- package/dist/components/layout/grid-layers/GridLayers.svelte +63 -0
- package/dist/components/layout/grid-layers/GridLayers.svelte.d.ts +26 -0
- package/dist/components/layout/grid-layers/GridLayers.svelte__heightFrom__ +372 -0
- package/dist/components/layout/grid-layers/util.d.ts +19 -0
- package/dist/components/layout/grid-layers/util.js +74 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.js +1 -0
- package/dist/components/panels/index.d.ts +1 -0
- package/dist/components/panels/index.js +1 -0
- package/dist/components/panels/panel/Panel.svelte +43 -0
- package/dist/components/panels/panel/Panel.svelte.d.ts +24 -0
- package/dist/components/rows/index.d.ts +2 -0
- package/dist/components/rows/index.js +3 -0
- package/dist/components/rows/panel-grid-row/PanelGridRow.svelte +104 -0
- package/dist/components/rows/panel-grid-row/PanelGridRow.svelte.d.ts +26 -0
- package/dist/components/rows/panel-row-2/PanelRow2.svelte +40 -0
- package/dist/components/rows/panel-row-2/PanelRow2.svelte.d.ts +26 -0
- package/dist/components/tab-bar/HkTabBar.state.svelte.d.ts +54 -0
- package/dist/components/tab-bar/HkTabBar.state.svelte.js +149 -0
- package/dist/components/tab-bar/HkTabBar.svelte +74 -0
- package/dist/components/tab-bar/HkTabBar.svelte.d.ts +34 -0
- package/dist/components/tab-bar/HkTabBarSelector.state.svelte.d.ts +19 -0
- package/dist/components/tab-bar/HkTabBarSelector.state.svelte.js +93 -0
- package/dist/components/tab-bar/HkTabBarSelector.svelte +49 -0
- package/dist/components/tab-bar/HkTabBarSelector.svelte.d.ts +36 -0
- package/dist/components/tab-bar/index.d.ts +5 -0
- package/dist/components/tab-bar/index.js +17 -0
- package/dist/components/tab-bar/typedef.d.ts +8 -0
- package/dist/components/tab-bar/typedef.js +11 -0
- package/dist/config/imagetools-config.d.ts +26 -0
- package/dist/config/imagetools-config.js +189 -0
- package/dist/config/imagetools.d.ts +72 -0
- package/dist/constants/bases.d.ts +10 -0
- package/dist/constants/bases.js +13 -0
- package/dist/constants/errors/api.d.ts +10 -0
- package/dist/constants/errors/api.js +9 -0
- package/dist/constants/errors/generic.d.ts +20 -0
- package/dist/constants/errors/generic.js +20 -0
- package/dist/constants/errors/http.d.ts +16 -0
- package/dist/constants/errors/http.js +16 -0
- package/dist/constants/errors/index.d.ts +4 -0
- package/dist/constants/errors/index.js +4 -0
- package/dist/constants/errors/jwt.d.ts +8 -0
- package/dist/constants/errors/jwt.js +5 -0
- package/dist/constants/http/headers.d.ts +5 -0
- package/dist/constants/http/headers.js +6 -0
- package/dist/constants/http/index.d.ts +2 -0
- package/dist/constants/http/index.js +2 -0
- package/dist/constants/http/methods.d.ts +7 -0
- package/dist/constants/http/methods.js +14 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +3 -0
- package/dist/constants/mime/application.d.ts +3 -0
- package/dist/constants/mime/application.js +5 -0
- package/dist/constants/mime/audio.d.ts +10 -0
- package/dist/constants/mime/audio.js +13 -0
- package/dist/constants/mime/image.d.ts +3 -0
- package/dist/constants/mime/image.js +3 -0
- package/dist/constants/mime/index.d.ts +4 -0
- package/dist/constants/mime/index.js +4 -0
- package/dist/constants/mime/text.d.ts +2 -0
- package/dist/constants/mime/text.js +2 -0
- package/dist/constants/regexp/index.d.ts +3 -0
- package/dist/constants/regexp/index.js +31 -0
- package/dist/constants/regexp/inspiratie.js__ +95 -0
- package/dist/constants/regexp/text.d.ts +47 -0
- package/dist/constants/regexp/text.js +49 -0
- package/dist/constants/regexp/user.d.ts +6 -0
- package/dist/constants/regexp/user.js +33 -0
- package/dist/constants/regexp/web.d.ts +1 -0
- package/dist/constants/regexp/web.js +3 -0
- package/dist/constants/state-labels/drag-states.d.ts +5 -0
- package/dist/constants/state-labels/drag-states.js +6 -0
- package/dist/constants/state-labels/drop-states.d.ts +4 -0
- package/dist/constants/state-labels/drop-states.js +6 -0
- package/dist/constants/state-labels/input-states.d.ts +8 -0
- package/dist/constants/state-labels/input-states.js +11 -0
- package/dist/constants/state-labels/submit-states.d.ts +4 -0
- package/dist/constants/state-labels/submit-states.js +4 -0
- package/dist/constants/time.d.ts +18 -0
- package/dist/constants/time.js +28 -0
- package/dist/css/utilities.css +43 -0
- package/dist/design/design-config.d.ts +157 -0
- package/dist/design/design-config.js +73 -0
- package/dist/design/tailwind-theme-extend.d.ts +23 -0
- package/dist/design/tailwind-theme-extend.js +158 -0
- package/dist/features/button-group/ButtonGroup.svelte +82 -0
- package/dist/features/button-group/ButtonGroup.svelte.d.ts +34 -0
- package/dist/features/button-group/typedef.d.ts +7 -0
- package/dist/features/button-group/typedef.js +10 -0
- package/dist/features/compare-left-right/CompareLeftRight.svelte +179 -0
- package/dist/features/compare-left-right/CompareLeftRight.svelte.d.ts +18 -0
- package/dist/features/compare-left-right/index.d.ts +1 -0
- package/dist/features/compare-left-right/index.js +1 -0
- package/dist/features/game-box/GameBox.svelte +577 -0
- package/dist/features/game-box/GameBox.svelte.d.ts +140 -0
- package/dist/features/game-box/gamebox.util.d.ts +32 -0
- package/dist/features/game-box/gamebox.util.js +83 -0
- package/dist/features/hk-app-layout/HkAppLayout.state.svelte.d.ts +6 -0
- package/dist/features/hk-app-layout/HkAppLayout.state.svelte.js +25 -0
- package/dist/features/hk-app-layout/HkAppLayout.svelte +251 -0
- package/dist/features/hk-app-layout/HkAppLayout.svelte.d.ts +19 -0
- package/dist/features/image-box/ImageBox.svelte +210 -0
- package/dist/features/image-box/ImageBox.svelte.d.ts +38 -0
- package/dist/features/image-box/index.d.ts +4 -0
- package/dist/features/image-box/index.js +5 -0
- package/dist/features/image-box/typedef.d.ts +4 -0
- package/dist/features/image-box/typedef.js +32 -0
- package/dist/features/index.d.ts +11 -0
- package/dist/features/index.js +23 -0
- package/dist/features/presenter/ImageSlide.svelte +64 -0
- package/dist/features/presenter/ImageSlide.svelte.d.ts +36 -0
- package/dist/features/presenter/Presenter.state.svelte.d.ts +74 -0
- package/dist/features/presenter/Presenter.state.svelte.js +638 -0
- package/dist/features/presenter/Presenter.svelte +142 -0
- package/dist/features/presenter/Presenter.svelte.d.ts +18 -0
- package/dist/features/presenter/constants.d.ts +5 -0
- package/dist/features/presenter/constants.js +7 -0
- package/dist/features/presenter/index.d.ts +6 -0
- package/dist/features/presenter/index.js +10 -0
- package/dist/features/presenter/typedef.d.ts +92 -0
- package/dist/features/presenter/typedef.js +106 -0
- package/dist/features/presenter/util.d.ts +63 -0
- package/dist/features/presenter/util.js +210 -0
- package/dist/features/virtual-viewport/VirtualViewport.svelte +196 -0
- package/dist/features/virtual-viewport/VirtualViewport.svelte.d.ts +42 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +0 -0
- package/dist/logging/adapters/console.d.ts +48 -0
- package/dist/logging/adapters/console.js +114 -0
- package/dist/logging/adapters/pino.d.ts +25 -0
- package/dist/logging/adapters/pino.js +60 -0
- package/dist/logging/constants.d.ts +1 -0
- package/dist/logging/constants.js +1 -0
- package/dist/logging/factories/client.d.ts +10 -0
- package/dist/logging/factories/client.js +21 -0
- package/dist/logging/factories/server.d.ts +10 -0
- package/dist/logging/factories/server.js +22 -0
- package/dist/logging/factories/universal.d.ts +9 -0
- package/dist/logging/factories/universal.js +23 -0
- package/dist/logging/index.d.ts +5 -0
- package/dist/logging/index.js +8 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/validate-url.d.ts +30 -0
- package/dist/schemas/validate-url.js +180 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/dist/server/logger.d.ts +25 -0
- package/dist/server/logger.js +94 -0
- package/dist/states/index.d.ts +1 -0
- package/dist/states/index.js +1 -0
- package/dist/states/navigation.svelte.d.ts +23 -0
- package/dist/states/navigation.svelte.js +55 -0
- package/dist/stores/index.d.ts +1 -0
- package/dist/stores/index.js +1 -0
- package/dist/stores/theme.d.ts +28 -0
- package/dist/stores/theme.js +80 -0
- package/dist/themes/hkdev/components/blocks/text-block.css +34 -0
- package/dist/themes/hkdev/components/boxes/game-box.css +11 -0
- package/dist/themes/hkdev/components/buttons/button-icon-steeze.css +22 -0
- package/dist/themes/hkdev/components/buttons/button-text.css +32 -0
- package/dist/themes/hkdev/components/buttons/button.css +146 -0
- package/dist/themes/hkdev/components/buttons/skip-button.css +5 -0
- package/dist/themes/hkdev/components/drag-drop/draggable.css +73 -0
- package/dist/themes/hkdev/components/drag-drop/drop-zone.css +58 -0
- package/dist/themes/hkdev/components/icons/icon-steeze.css +16 -0
- package/dist/themes/hkdev/components/inputs/text-input.css +102 -0
- package/dist/themes/hkdev/components/panels/panel.css +25 -0
- package/dist/themes/hkdev/components/rows/panel-grid-row.css +4 -0
- package/dist/themes/hkdev/components/rows/panel-row-2.css +5 -0
- package/dist/themes/hkdev/components.css +29 -0
- package/dist/themes/hkdev/debug.css +2 -0
- package/dist/themes/hkdev/global/layout.css +32 -0
- package/dist/themes/hkdev/global/on-colors.css +32 -0
- package/dist/themes/hkdev/globals.css +4 -0
- package/dist/themes/hkdev/responsive.css +12 -0
- package/dist/themes/hkdev/theme-ext.d.ts +4 -0
- package/dist/themes/hkdev/theme-ext.js +12 -0
- package/dist/themes/hkdev/theme.css +219 -0
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/index.js +1 -0
- package/dist/typedef/context.d.ts +3 -0
- package/dist/typedef/context.js +6 -0
- package/dist/typedef/drag.d.ts +29 -0
- package/dist/typedef/drag.js +25 -0
- package/dist/typedef/drop.d.ts +15 -0
- package/dist/typedef/drop.js +12 -0
- package/dist/typedef/image.d.ts +12 -0
- package/dist/typedef/image.js +38 -0
- package/dist/typedef/index.d.ts +4 -0
- package/dist/typedef/index.js +4 -0
- package/dist/util/array/index.d.ts +183 -0
- package/dist/util/array/index.js +436 -0
- package/dist/util/bases/base58.d.ts +58 -0
- package/dist/util/bases/base58.js +262 -0
- package/dist/util/bases/index.d.ts +1 -0
- package/dist/util/bases/index.js +1 -0
- package/dist/util/compare/index.d.ts +68 -0
- package/dist/util/compare/index.js +247 -0
- package/dist/util/css/css-vars.d.ts +24 -0
- package/dist/util/css/css-vars.js +83 -0
- package/dist/util/css/index.d.ts +1 -0
- package/dist/util/css/index.js +1 -0
- package/dist/util/design-system/components/states.d.ts +15 -0
- package/dist/util/design-system/components/states.js +22 -0
- package/dist/util/design-system/css/clamp.d.ts +17 -0
- package/dist/util/design-system/css/clamp.js +66 -0
- package/dist/util/design-system/css/root-design-vars.d.ts +77 -0
- package/dist/util/design-system/css/root-design-vars.js +102 -0
- package/dist/util/design-system/index.d.ts +5 -0
- package/dist/util/design-system/index.js +5 -0
- package/dist/util/design-system/layout/scaling.d.ts +98 -0
- package/dist/util/design-system/layout/scaling.js +228 -0
- package/dist/util/design-system/skeleton.d.ts +41 -0
- package/dist/util/design-system/skeleton.js +208 -0
- package/dist/util/design-system/tailwind.d.ts +183 -0
- package/dist/util/design-system/tailwind.js +288 -0
- package/dist/util/env/index.d.ts +1 -0
- package/dist/util/env/index.js +9 -0
- package/dist/util/exceptions/index.d.ts +15 -0
- package/dist/util/exceptions/index.js +23 -0
- package/dist/util/expect/arrays.d.ts +30 -0
- package/dist/util/expect/arrays.js +47 -0
- package/dist/util/expect/index.d.ts +103 -0
- package/dist/util/expect/index.js +259 -0
- package/dist/util/expect/primitives.d.ts +30 -0
- package/dist/util/expect/primitives.js +55 -0
- package/dist/util/expect/url.d.ts +32 -0
- package/dist/util/expect/url.js +60 -0
- package/dist/util/function/index.d.ts +34 -0
- package/dist/util/function/index.js +218 -0
- package/dist/util/geo/index.d.ts +10 -0
- package/dist/util/geo/index.js +26 -0
- package/dist/util/http/caching.d.ts +28 -0
- package/dist/util/http/caching.js +263 -0
- package/dist/util/http/errors.d.ts +18 -0
- package/dist/util/http/errors.js +97 -0
- package/dist/util/http/headers.d.ts +40 -0
- package/dist/util/http/headers.js +75 -0
- package/dist/util/http/http-request.d.ts +267 -0
- package/dist/util/http/http-request.js +578 -0
- package/dist/util/http/index.d.ts +6 -0
- package/dist/util/http/index.js +22 -0
- package/dist/util/http/json-request.d.ts +84 -0
- package/dist/util/http/json-request.js +224 -0
- package/dist/util/http/mocks.d.ts +20 -0
- package/dist/util/http/mocks.js +65 -0
- package/dist/util/http/response.d.ts +125 -0
- package/dist/util/http/response.js +294 -0
- package/dist/util/http/test-data__/content-length-test-hkdigital-small.V4HfZyBQ.avif +0 -0
- package/dist/util/http/typedef.d.ts +184 -0
- package/dist/util/http/typedef.js +93 -0
- package/dist/util/http/url.d.ts +25 -0
- package/dist/util/http/url.js +52 -0
- package/dist/util/image/index.d.ts +25 -0
- package/dist/util/image/index.js +86 -0
- package/dist/util/index.d.ts +3 -0
- package/dist/util/index.js +3 -0
- package/dist/util/is/index.d.ts +68 -0
- package/dist/util/is/index.js +140 -0
- package/dist/util/iterate/index.d.ts +131 -0
- package/dist/util/iterate/index.js +234 -0
- package/dist/util/object/index.d.ts +326 -0
- package/dist/util/object/index.js +1361 -0
- package/dist/util/singleton/index.d.ts +34 -0
- package/dist/util/singleton/index.js +97 -0
- package/dist/util/string/array-path.d.ts +15 -0
- package/dist/util/string/array-path.js +75 -0
- package/dist/util/string/convert.d.ts +22 -0
- package/dist/util/string/convert.js +54 -0
- package/dist/util/string/fs.d.ts +55 -0
- package/dist/util/string/fs.js +226 -0
- package/dist/util/string/index.d.ts +5 -0
- package/dist/util/string/index.js +5 -0
- package/dist/util/string/interpolate.d.ts +22 -0
- package/dist/util/string/interpolate.js +61 -0
- package/dist/util/string/pad.d.ts +8 -0
- package/dist/util/string/pad.js +10 -0
- package/dist/util/svelte/index.d.ts +3 -0
- package/dist/util/svelte/index.js +4 -0
- package/dist/util/svelte/loading/loading-tracker.svelte.d.ts +31 -0
- package/dist/util/svelte/loading/loading-tracker.svelte.js +108 -0
- package/dist/util/svelte/observe/index.d.ts +10 -0
- package/dist/util/svelte/observe/index.js +49 -0
- package/dist/util/svelte/state-context/index.d.ts +18 -0
- package/dist/util/svelte/state-context/index.js +117 -0
- package/dist/util/svelte/wait/index.d.ts +15 -0
- package/dist/util/svelte/wait/index.js +38 -0
- package/dist/util/sveltekit/index.d.ts +1 -0
- package/dist/util/sveltekit/index.js +1 -0
- package/dist/util/sveltekit/route-folders/index.d.ts +28 -0
- package/dist/util/sveltekit/route-folders/index.js +101 -0
- package/dist/util/time/index.d.ts +108 -0
- package/dist/util/time/index.js +323 -0
- package/dist/util/unique/index.d.ts +81 -0
- package/dist/util/unique/index.js +249 -0
- package/dist/valibot/date.js__ +10 -0
- package/dist/valibot/index.d.ts +4 -0
- package/dist/valibot/index.js +9 -0
- package/dist/valibot/url.d.ts +26 -0
- package/dist/valibot/url.js +95 -0
- package/dist/valibot/user.d.ts +6 -0
- package/dist/valibot/user.js +23 -0
- package/dist/zod/all.d.ts +6 -0
- package/dist/zod/all.js +33 -0
- package/dist/zod/generic.d.ts +6 -0
- package/dist/zod/generic.js +11 -0
- package/dist/zod/javascript.d.ts +8 -0
- package/dist/zod/javascript.js +32 -0
- package/dist/zod/user.d.ts +9 -0
- package/dist/zod/user.js +16 -0
- package/dist/zod/web.d.ts +21 -0
- package/dist/zod/web.js +52 -0
- package/package.json +133 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get game width for landscape mode
|
|
3
|
+
*
|
|
4
|
+
* @param {object} _
|
|
5
|
+
* @param {number} _.windowWidth
|
|
6
|
+
* @param {number} _.windowHeight
|
|
7
|
+
* @param {number} [_.aspectOnLandscape]
|
|
8
|
+
*
|
|
9
|
+
* @returns {number} game width
|
|
10
|
+
*/
|
|
11
|
+
export function getGameWidthOnLandscape({ windowWidth, windowHeight, aspectOnLandscape }: {
|
|
12
|
+
windowWidth: number;
|
|
13
|
+
windowHeight: number;
|
|
14
|
+
aspectOnLandscape?: number;
|
|
15
|
+
}): number;
|
|
16
|
+
/**
|
|
17
|
+
* Get game width for portrait mode
|
|
18
|
+
*
|
|
19
|
+
* @param {object} _
|
|
20
|
+
* @param {number} _.windowWidth
|
|
21
|
+
* @param {number} _.windowHeight
|
|
22
|
+
* @param {number} [_.aspectOnPortrait]
|
|
23
|
+
*
|
|
24
|
+
* @returns {number} game width
|
|
25
|
+
*/
|
|
26
|
+
export function getGameWidthOnPortrait({ windowWidth, windowHeight, aspectOnPortrait }: {
|
|
27
|
+
windowWidth: number;
|
|
28
|
+
windowHeight: number;
|
|
29
|
+
aspectOnPortrait?: number;
|
|
30
|
+
}): number;
|
|
31
|
+
export const ERROR_WINDOW_SIZE_NOT_LANDSCAPE: "Window size is not landsccape";
|
|
32
|
+
export const ERROR_WINDOW_SIZE_NOT_PORTRAIT: "Window size is not portrait";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export const ERROR_WINDOW_SIZE_NOT_LANDSCAPE = 'Window size is not landsccape';
|
|
2
|
+
|
|
3
|
+
export const ERROR_WINDOW_SIZE_NOT_PORTRAIT = 'Window size is not portrait';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Get game width for landscape mode
|
|
7
|
+
*
|
|
8
|
+
* @param {object} _
|
|
9
|
+
* @param {number} _.windowWidth
|
|
10
|
+
* @param {number} _.windowHeight
|
|
11
|
+
* @param {number} [_.aspectOnLandscape]
|
|
12
|
+
*
|
|
13
|
+
* @returns {number} game width
|
|
14
|
+
*/
|
|
15
|
+
export function getGameWidthOnLandscape({
|
|
16
|
+
windowWidth,
|
|
17
|
+
windowHeight,
|
|
18
|
+
aspectOnLandscape
|
|
19
|
+
}) {
|
|
20
|
+
if (!windowHeight) {
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (windowWidth < windowHeight) {
|
|
25
|
+
throw new Error(ERROR_WINDOW_SIZE_NOT_LANDSCAPE);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (!aspectOnLandscape) {
|
|
29
|
+
// No game aspect specified for landscape
|
|
30
|
+
// => return full width
|
|
31
|
+
return windowWidth;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const windowAspect = windowWidth / windowHeight;
|
|
35
|
+
|
|
36
|
+
if (windowAspect > aspectOnLandscape) {
|
|
37
|
+
// aspect of window if wider than game aspect => fill height
|
|
38
|
+
return aspectOnLandscape * windowHeight;
|
|
39
|
+
} else {
|
|
40
|
+
// aspect of game is wider => fill width
|
|
41
|
+
return windowWidth;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Get game width for portrait mode
|
|
47
|
+
*
|
|
48
|
+
* @param {object} _
|
|
49
|
+
* @param {number} _.windowWidth
|
|
50
|
+
* @param {number} _.windowHeight
|
|
51
|
+
* @param {number} [_.aspectOnPortrait]
|
|
52
|
+
*
|
|
53
|
+
* @returns {number} game width
|
|
54
|
+
*/
|
|
55
|
+
export function getGameWidthOnPortrait({
|
|
56
|
+
windowWidth,
|
|
57
|
+
windowHeight,
|
|
58
|
+
aspectOnPortrait
|
|
59
|
+
}) {
|
|
60
|
+
if (!windowHeight) {
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (windowHeight < windowWidth) {
|
|
65
|
+
throw new Error(ERROR_WINDOW_SIZE_NOT_PORTRAIT);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (!aspectOnPortrait) {
|
|
69
|
+
// No game aspect specified for portrait
|
|
70
|
+
// => return full width
|
|
71
|
+
return windowWidth;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const windowAspect = windowWidth / windowHeight;
|
|
75
|
+
|
|
76
|
+
if (windowAspect > aspectOnPortrait) {
|
|
77
|
+
// aspect of window if wider than game aspect => fill height
|
|
78
|
+
return aspectOnPortrait * windowHeight;
|
|
79
|
+
} else {
|
|
80
|
+
// aspect of game is wider => fill width
|
|
81
|
+
return windowWidth;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export class AppLayoutState {
|
|
2
|
+
landscapeOnSmallScreen: boolean;
|
|
3
|
+
}
|
|
4
|
+
export const createOrGetState: (contextKey?: import("../../typedef").ContextKey) => AppLayoutState;
|
|
5
|
+
export const createState: (contextKey?: import("../../typedef").ContextKey) => AppLayoutState;
|
|
6
|
+
export const getState: (contextKey?: import("../../typedef").ContextKey) => AppLayoutState;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineStateContext } from '../../util/svelte/state-context';
|
|
2
|
+
|
|
3
|
+
import { browser } from '$app/environment';
|
|
4
|
+
|
|
5
|
+
import { MediaQuery } from 'svelte/reactivity';
|
|
6
|
+
|
|
7
|
+
/* ------------------------------------------------------- Define state class */
|
|
8
|
+
|
|
9
|
+
export class AppLayoutState {
|
|
10
|
+
landscapeOnSmallScreen = $state(false);
|
|
11
|
+
|
|
12
|
+
constructor() {
|
|
13
|
+
if (browser) {
|
|
14
|
+
let mq = new MediaQuery('(max-height: 400px');
|
|
15
|
+
|
|
16
|
+
$effect(() => {
|
|
17
|
+
this.landscapeOnSmallScreen = mq.matches ? true : false;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* -------------------------------------- Export create & get state functions */
|
|
24
|
+
|
|
25
|
+
export const [createOrGetState, createState, getState] = defineStateContext(AppLayoutState);
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* // file.svelte
|
|
5
|
+
* <script>
|
|
6
|
+
* import AppLayout from '.../components/layout';
|
|
7
|
+
* <_/script>
|
|
8
|
+
*
|
|
9
|
+
* <AppLayout>
|
|
10
|
+
* {#snippet bgSnippet()}
|
|
11
|
+
* <BgGradient />
|
|
12
|
+
* {/snippet}
|
|
13
|
+
*
|
|
14
|
+
* {#snippet bottomSnippet()}
|
|
15
|
+
* <BottomBar />
|
|
16
|
+
* {/snippet}
|
|
17
|
+
*
|
|
18
|
+
* Main content
|
|
19
|
+
*
|
|
20
|
+
* </AppLayout>
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { useResizeObserver } from '../../util/svelte/observe/index.js';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @typedef AppLayoutProps
|
|
27
|
+
*
|
|
28
|
+
* @property {import('svelte').Snippet|undefined} [bgPageSnippet]
|
|
29
|
+
* @property {import('svelte').Snippet|undefined} [bgSnippet]
|
|
30
|
+
* @property {import('svelte').Snippet|undefined} [topSnippet]
|
|
31
|
+
* @property {import('svelte').Snippet|undefined} [bottomSnippet]
|
|
32
|
+
* @property {import('svelte').Snippet} children
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/** @type {AppLayoutProps} */
|
|
36
|
+
let {
|
|
37
|
+
// > Functional
|
|
38
|
+
|
|
39
|
+
/** @type {boolean} */
|
|
40
|
+
// hasAuth = false,
|
|
41
|
+
|
|
42
|
+
bgPageSnippet,
|
|
43
|
+
bgSnippet,
|
|
44
|
+
|
|
45
|
+
topSnippet,
|
|
46
|
+
bottomSnippet,
|
|
47
|
+
|
|
48
|
+
children
|
|
49
|
+
|
|
50
|
+
// > Style
|
|
51
|
+
|
|
52
|
+
// base = '',
|
|
53
|
+
// bg = '',
|
|
54
|
+
// classes = '',
|
|
55
|
+
|
|
56
|
+
// > Background (child) styles
|
|
57
|
+
|
|
58
|
+
// > AppTop (child) styles
|
|
59
|
+
|
|
60
|
+
// appTopBase = '',
|
|
61
|
+
// appTopBg = '',
|
|
62
|
+
// appTopPadding = '',
|
|
63
|
+
// appTopMargin = '',
|
|
64
|
+
// appTopClasses = ''
|
|
65
|
+
} = $props();
|
|
66
|
+
|
|
67
|
+
// setAppLayoutContext({});
|
|
68
|
+
|
|
69
|
+
// Observe AppLayoutHeight
|
|
70
|
+
|
|
71
|
+
/** @type {HTMLElement|null} */
|
|
72
|
+
let elemAppLayout = $state(null);
|
|
73
|
+
let elemAppLayoutHeight = $state(0);
|
|
74
|
+
let elemAppLayoutWidth = $state(0);
|
|
75
|
+
|
|
76
|
+
useResizeObserver(
|
|
77
|
+
() => elemAppLayout,
|
|
78
|
+
(entries) => {
|
|
79
|
+
for (const { contentRect } of entries) {
|
|
80
|
+
// console.log('elemLayoutHeight', entry.contentRect.height);
|
|
81
|
+
elemAppLayoutHeight = contentRect.height;
|
|
82
|
+
elemAppLayoutWidth = contentRect.width;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
// Observe layoutTopHeight
|
|
89
|
+
|
|
90
|
+
/** @type {HTMLElement|null} */
|
|
91
|
+
// let elemLayoutTop = $state(null);
|
|
92
|
+
// let elemLayoutTopHeight = $state(0);
|
|
93
|
+
|
|
94
|
+
// useResizeObserver(
|
|
95
|
+
// () => elemLayoutTop,
|
|
96
|
+
// (entries) => {
|
|
97
|
+
// for (const entry of entries) {
|
|
98
|
+
// console.log('elemLayoutTopHeight', entry.contentRect.height);
|
|
99
|
+
// elemLayoutTopHeight = entry.contentRect.height;
|
|
100
|
+
// break;
|
|
101
|
+
// }
|
|
102
|
+
// }
|
|
103
|
+
// );
|
|
104
|
+
|
|
105
|
+
// Observe layoutContentHeight
|
|
106
|
+
|
|
107
|
+
/** @type {HTMLElement|null} */
|
|
108
|
+
let elemLayoutContent = $state(null);
|
|
109
|
+
let elemLayoutContentHeight = $state(0);
|
|
110
|
+
|
|
111
|
+
useResizeObserver(
|
|
112
|
+
() => elemLayoutContent,
|
|
113
|
+
(entries) => {
|
|
114
|
+
for (const entry of entries) {
|
|
115
|
+
// console.log('elemLayoutHeight', entry.contentRect.height);
|
|
116
|
+
elemLayoutContentHeight = entry.contentRect.height;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
// Observe layoutBottomHeight
|
|
123
|
+
|
|
124
|
+
/** @type {HTMLElement|null} */
|
|
125
|
+
let elemLayoutBottom = $state(null);
|
|
126
|
+
|
|
127
|
+
let elemLayoutBottomHeight = $state(0);
|
|
128
|
+
|
|
129
|
+
useResizeObserver(
|
|
130
|
+
() => elemLayoutBottom,
|
|
131
|
+
(entries) => {
|
|
132
|
+
for (const entry of entries) {
|
|
133
|
+
// console.log('elemLayoutBottomRect', entry.contentRect);
|
|
134
|
+
elemLayoutBottomHeight = entry.contentRect.height;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
let contentMarginBottom = $derived(elemLayoutBottomHeight);
|
|
141
|
+
|
|
142
|
+
let innerWidth = $state(0);
|
|
143
|
+
let innerHeight = $state(0);
|
|
144
|
+
let outerHeight = $state(0);
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<svelte:window bind:innerWidth bind:innerHeight bind:outerHeight />
|
|
148
|
+
|
|
149
|
+
<div data-layout-page-bg class="fixed z-0 h-screen w-screen">
|
|
150
|
+
{#if bgPageSnippet}
|
|
151
|
+
{@render bgPageSnippet()}
|
|
152
|
+
{/if}
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<!-- <div
|
|
156
|
+
data-app-layout
|
|
157
|
+
class="g-no-select g-no-double-tab-zoom relative z-10 mx-auto grid min-h-lvh w-full grid-cols-[1fr] place-items-stretch border-8 border-green-500"
|
|
158
|
+
bind:this={elemAppLayout}
|
|
159
|
+
> -->
|
|
160
|
+
<div
|
|
161
|
+
data-app-layout
|
|
162
|
+
class="g-no-select g-no-double-tab-zoom relative z-10 mx-auto min-h-svh w-full"
|
|
163
|
+
bind:this={elemAppLayout}
|
|
164
|
+
>
|
|
165
|
+
<!-- BG (fixed)) -->
|
|
166
|
+
|
|
167
|
+
<div
|
|
168
|
+
data-layout-bg
|
|
169
|
+
class="relative bottom-0 z-20 h-svh w-full"
|
|
170
|
+
style:position={elemAppLayoutWidth ? 'fixed' : 'static'}
|
|
171
|
+
style:width={elemAppLayoutWidth ? `${elemAppLayoutWidth}px` : 'auto'}
|
|
172
|
+
>
|
|
173
|
+
{#if bgSnippet}
|
|
174
|
+
{@render bgSnippet()}
|
|
175
|
+
{/if}
|
|
176
|
+
</div>
|
|
177
|
+
|
|
178
|
+
<!-- FG (top, content) -->
|
|
179
|
+
|
|
180
|
+
<div data-layout-fg class="relative z-30 flex min-h-svh w-full flex-col">
|
|
181
|
+
<div data-layout-top class="relative z-40 w-full">
|
|
182
|
+
{#if topSnippet}
|
|
183
|
+
{@render topSnippet()}
|
|
184
|
+
{/if}
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
<div
|
|
188
|
+
data-layout-content
|
|
189
|
+
class="relative z-40 flex w-full grow flex-col"
|
|
190
|
+
bind:this={elemLayoutContent}
|
|
191
|
+
style:margin-bottom={`${contentMarginBottom}px`}
|
|
192
|
+
>
|
|
193
|
+
<!-- <div class="border text-white">
|
|
194
|
+
Top height: [{elemLayoutTopHeight}]<br />
|
|
195
|
+
Content height: [{elemLayoutContentHeight}]<br />
|
|
196
|
+
Bottom height: [{elemLayoutBottomHeight}]<br />
|
|
197
|
+
App Layout height: [{elemAppLayoutHeight}]<br />
|
|
198
|
+
Content margin bottom [{contentMarginBottom}]<br />
|
|
199
|
+
innerWidth [{innerWidth}]<br />
|
|
200
|
+
innerHeight [{innerHeight}]
|
|
201
|
+
</div> -->
|
|
202
|
+
<!-- -webkit-font-smoothing: antialiased; -->
|
|
203
|
+
{@render children()}
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<!-- Bottom (fixed) -->
|
|
208
|
+
|
|
209
|
+
<div
|
|
210
|
+
data-layout-bottom
|
|
211
|
+
bind:this={elemLayoutBottom}
|
|
212
|
+
class="bottom-0 z-50 mx-auto"
|
|
213
|
+
style:position={elemAppLayoutWidth ? 'fixed' : 'static'}
|
|
214
|
+
style:width={elemAppLayoutWidth ? `${elemAppLayoutWidth}px` : 'auto'}
|
|
215
|
+
>
|
|
216
|
+
{#if bottomSnippet}
|
|
217
|
+
{@render bottomSnippet()}
|
|
218
|
+
{/if}
|
|
219
|
+
|
|
220
|
+
<!-- <AppBottom
|
|
221
|
+
base={appTopBase}
|
|
222
|
+
bg={appTopBg}
|
|
223
|
+
padding={appTopPadding}
|
|
224
|
+
margin={appTopMargin}
|
|
225
|
+
classes={appTopClasses}
|
|
226
|
+
/> -->
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
<style>
|
|
231
|
+
[data-layout-page-bg] {
|
|
232
|
+
overflow: hidden;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
[data-layout-bg] {
|
|
236
|
+
grid-area: 1 / 1 / 2 / 2; /* row-start, col-start, row-end, col-end */
|
|
237
|
+
overflow: hidden;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
[data-layout-fg] {
|
|
241
|
+
grid-area: 1 / 1 / 2 / 2; /* row-start, col-start, row-end, col-end */
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/*
|
|
245
|
+
* Shift contents of page to the left when scrollbar appears,
|
|
246
|
+
* so content like tab bars stay centered
|
|
247
|
+
*/
|
|
248
|
+
/*:global(html:not(.no-scrollbar-shift-fix)) {
|
|
249
|
+
padding-left: calc(100vw - 100%);
|
|
250
|
+
}*/
|
|
251
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default HkAppLayout;
|
|
2
|
+
type HkAppLayout = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<AppLayoutProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const HkAppLayout: import("svelte").Component<{
|
|
7
|
+
bgPageSnippet?: import("svelte").Snippet | undefined;
|
|
8
|
+
bgSnippet?: import("svelte").Snippet | undefined;
|
|
9
|
+
topSnippet?: import("svelte").Snippet | undefined;
|
|
10
|
+
bottomSnippet?: import("svelte").Snippet | undefined;
|
|
11
|
+
children: import("svelte").Snippet;
|
|
12
|
+
}, {}, "">;
|
|
13
|
+
type AppLayoutProps = {
|
|
14
|
+
bgPageSnippet?: import("svelte").Snippet | undefined;
|
|
15
|
+
bgSnippet?: import("svelte").Snippet | undefined;
|
|
16
|
+
topSnippet?: import("svelte").Snippet | undefined;
|
|
17
|
+
bottomSnippet?: import("svelte").Snippet | undefined;
|
|
18
|
+
children: import("svelte").Snippet;
|
|
19
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { ImageLoader } from '../../classes/svelte/image/index.js';
|
|
3
|
+
import { ImageVariantsLoader } from '../../classes/svelte/image/index.js';
|
|
4
|
+
import { toSingleImageMeta } from '../../util/image/index.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @type {{
|
|
8
|
+
* base?: string,
|
|
9
|
+
* bg?: string,
|
|
10
|
+
* classes?: string,
|
|
11
|
+
* width?: string,
|
|
12
|
+
* height?: string,
|
|
13
|
+
* aspect?: string,
|
|
14
|
+
* overflow?: string,
|
|
15
|
+
* fit?: 'contain' | 'cover' | 'fill',
|
|
16
|
+
* position?: import('../../typedef/image.js').ObjectPosition,
|
|
17
|
+
* imageMeta?: import('../../typedef').ImageSource,
|
|
18
|
+
* imageLoader?: import('../../classes/svelte/image/index.js').ImageLoader,
|
|
19
|
+
* alt?: string,
|
|
20
|
+
* id?: string|Symbol
|
|
21
|
+
* onProgress?: (progress: import('../../classes/svelte/network-loader/typedef.js').LoadingProgress, id: string|Symbol) => void,
|
|
22
|
+
* [attr: string]: any
|
|
23
|
+
* }}
|
|
24
|
+
*/
|
|
25
|
+
let {
|
|
26
|
+
// Style
|
|
27
|
+
base,
|
|
28
|
+
bg,
|
|
29
|
+
classes,
|
|
30
|
+
width,
|
|
31
|
+
height,
|
|
32
|
+
aspect,
|
|
33
|
+
overflow = 'overflow-clip',
|
|
34
|
+
|
|
35
|
+
// Fitting and positioning of image in its container
|
|
36
|
+
fit = 'contain',
|
|
37
|
+
position = 'left top',
|
|
38
|
+
|
|
39
|
+
// Image data
|
|
40
|
+
imageMeta,
|
|
41
|
+
imageLoader,
|
|
42
|
+
|
|
43
|
+
// Accessibility
|
|
44
|
+
alt = '',
|
|
45
|
+
|
|
46
|
+
// Identification
|
|
47
|
+
id = Symbol('ImageBox'),
|
|
48
|
+
|
|
49
|
+
// Events
|
|
50
|
+
onProgress,
|
|
51
|
+
|
|
52
|
+
// Additional attributes
|
|
53
|
+
...attrs
|
|
54
|
+
} = $props();
|
|
55
|
+
|
|
56
|
+
// if (!imageMeta) {
|
|
57
|
+
// throw new Error('Missing [imageMeta]');
|
|
58
|
+
// }
|
|
59
|
+
|
|
60
|
+
/** @type {HTMLDivElement|undefined} */
|
|
61
|
+
let containerElem = $state();
|
|
62
|
+
|
|
63
|
+
let imageMeta_ = $state();
|
|
64
|
+
let variantsLoader = $state();
|
|
65
|
+
let variantObjectUrl = $state(null);
|
|
66
|
+
let objectUrl = $state(null);
|
|
67
|
+
|
|
68
|
+
// For single image meta
|
|
69
|
+
let metaWidth = $state(0);
|
|
70
|
+
let metaHeight = $state(0);
|
|
71
|
+
|
|
72
|
+
/** @type {ImageLoader|undefined} */
|
|
73
|
+
let imageLoader_ = $state();
|
|
74
|
+
|
|
75
|
+
$effect(() => {
|
|
76
|
+
// Setup variants loader for responsive images
|
|
77
|
+
if (Array.isArray(imageMeta) && !imageLoader && !variantsLoader) {
|
|
78
|
+
variantsLoader = new ImageVariantsLoader(imageMeta, {
|
|
79
|
+
devicePixelRatio: window.devicePixelRatio
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// Handle single image meta
|
|
83
|
+
else if (imageMeta && !variantsLoader) {
|
|
84
|
+
imageMeta_ = toSingleImageMeta(imageMeta);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// Handle progress reporting
|
|
89
|
+
$effect(() => {
|
|
90
|
+
if (!onProgress) return;
|
|
91
|
+
|
|
92
|
+
// Report progress from variants loader
|
|
93
|
+
if (variantsLoader) {
|
|
94
|
+
onProgress(variantsLoader.progress, id);
|
|
95
|
+
}
|
|
96
|
+
// Report progress from single image loader
|
|
97
|
+
else if (imageLoader_) {
|
|
98
|
+
onProgress(imageLoader_.progress, id);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
$effect(() => {
|
|
103
|
+
if (imageMeta_) {
|
|
104
|
+
metaWidth = imageMeta_.width ?? 0;
|
|
105
|
+
metaHeight = imageMeta_.height ?? 0;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
$effect(() => {
|
|
110
|
+
if (!imageMeta && imageLoader && !imageLoader_) {
|
|
111
|
+
imageLoader_ = imageLoader;
|
|
112
|
+
imageMeta_ = imageLoader.imageMeta;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
$effect(() => {
|
|
117
|
+
if (imageMeta_ && !imageLoader_) {
|
|
118
|
+
imageLoader_ = new ImageLoader({ imageMeta: imageMeta_ });
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
$effect(() => {
|
|
123
|
+
if (imageLoader_?.initial) {
|
|
124
|
+
imageLoader_.load();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
$effect(() => {
|
|
129
|
+
if (imageLoader_?.loaded) {
|
|
130
|
+
objectUrl = imageLoader_.getObjectURL();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return () => {
|
|
134
|
+
if (objectUrl) {
|
|
135
|
+
URL.revokeObjectURL(objectUrl);
|
|
136
|
+
objectUrl = null;
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
$effect(() => {
|
|
142
|
+
if (!containerElem || !variantsLoader) return;
|
|
143
|
+
|
|
144
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
145
|
+
for (const entry of entries) {
|
|
146
|
+
const { width, height } = entry.contentRect;
|
|
147
|
+
variantsLoader.updateOptimalImageMeta({
|
|
148
|
+
containerWidth: width,
|
|
149
|
+
containerHeight: height,
|
|
150
|
+
fit
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
resizeObserver.observe(containerElem);
|
|
156
|
+
return () => resizeObserver.disconnect();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
$effect(() => {
|
|
160
|
+
if (variantsLoader?.loaded) {
|
|
161
|
+
variantObjectUrl = variantsLoader.getObjectURL();
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return () => {
|
|
165
|
+
if (variantObjectUrl) {
|
|
166
|
+
URL.revokeObjectURL(variantObjectUrl);
|
|
167
|
+
variantObjectUrl = null;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
</script>
|
|
172
|
+
|
|
173
|
+
<div
|
|
174
|
+
data-component="image-box"
|
|
175
|
+
bind:this={containerElem}
|
|
176
|
+
class="{base} {bg} {aspect} {overflow} {width} {height} {classes}"
|
|
177
|
+
style:--fit={fit}
|
|
178
|
+
style:--pos={position}
|
|
179
|
+
style:width={width || (height && aspect) ? undefined : '100%'}
|
|
180
|
+
style:height={height || (width && aspect) ? undefined : '100%'}
|
|
181
|
+
{...attrs}
|
|
182
|
+
>
|
|
183
|
+
{#if variantsLoader?.loaded && variantObjectUrl}
|
|
184
|
+
<img
|
|
185
|
+
src={variantObjectUrl}
|
|
186
|
+
{alt}
|
|
187
|
+
width={variantsLoader.variant.width}
|
|
188
|
+
height={variantsLoader.variant.height}
|
|
189
|
+
/>
|
|
190
|
+
{:else if objectUrl && metaWidth && metaHeight}
|
|
191
|
+
<img src={objectUrl} {alt} width={metaWidth} height={metaHeight} />
|
|
192
|
+
{/if}
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
<style>
|
|
196
|
+
[data-component='image-box'] {
|
|
197
|
+
max-width: 100%;
|
|
198
|
+
max-height: 100%;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
img {
|
|
202
|
+
display: block;
|
|
203
|
+
width: 100%;
|
|
204
|
+
height: 100%;
|
|
205
|
+
max-width: 100%;
|
|
206
|
+
max-height: 100%;
|
|
207
|
+
object-fit: var(--fit);
|
|
208
|
+
object-position: var(--pos);
|
|
209
|
+
}
|
|
210
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export default ImageBox;
|
|
2
|
+
type ImageBox = {
|
|
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
|
+
width?: string;
|
|
10
|
+
height?: string;
|
|
11
|
+
aspect?: string;
|
|
12
|
+
overflow?: string;
|
|
13
|
+
fit?: "fill" | "cover" | "contain";
|
|
14
|
+
position?: string;
|
|
15
|
+
imageMeta?: ImageSource;
|
|
16
|
+
imageLoader?: ImageLoader;
|
|
17
|
+
alt?: string;
|
|
18
|
+
id?: string | Symbol;
|
|
19
|
+
onProgress?: (progress: LoadingProgress, id: string | Symbol) => void;
|
|
20
|
+
}>): void;
|
|
21
|
+
};
|
|
22
|
+
declare const ImageBox: import("svelte").Component<{
|
|
23
|
+
[attr: string]: any;
|
|
24
|
+
base?: string;
|
|
25
|
+
bg?: string;
|
|
26
|
+
classes?: string;
|
|
27
|
+
width?: string;
|
|
28
|
+
height?: string;
|
|
29
|
+
aspect?: string;
|
|
30
|
+
overflow?: string;
|
|
31
|
+
fit?: "contain" | "cover" | "fill";
|
|
32
|
+
position?: import("../../typedef/image.js").ObjectPosition;
|
|
33
|
+
imageMeta?: import("../../typedef").ImageSource;
|
|
34
|
+
imageLoader?: import("../../classes/svelte/image/index.js").ImageLoader;
|
|
35
|
+
alt?: string;
|
|
36
|
+
id?: string | Symbol;
|
|
37
|
+
onProgress?: (progress: import("../../classes/svelte/network-loader/typedef.js").LoadingProgress, id: string | Symbol) => void;
|
|
38
|
+
}, {}, "">;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: {};
|
|
2
|
+
export default _default;
|
|
3
|
+
export type ObjectFit = ("contain" | "cover" | "fill" | "none" | "scale-down");
|
|
4
|
+
export type ObjectPosition = ("left" | "center" | "right" | "top" | "bottom" | "left top" | "left center" | "left bottom" | "center top" | "center center" | "center bottom" | "right top" | "right center" | "right bottom" | `${number}% ${number}%` | `${number}px ${number}px`);
|