@hkdigital/lib-sveltekit 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/classes/svelte/audio/AudioScene.svelte.js +1 -1
  2. package/dist/classes/svelte/image/ImageLoader.svelte.js +1 -1
  3. package/dist/classes/svelte/image/ImageScene.svelte.js +1 -1
  4. package/dist/classes/svelte/network-loader/NetworkLoader.svelte.js +1 -1
  5. package/dist/components/area/HkArea.svelte.d.ts +14 -0
  6. package/dist/components/area/HkGridArea.svelte.d.ts +22 -0
  7. package/dist/components/boxes/game-box/GameBox.svelte.d.ts +15 -0
  8. package/dist/components/boxes/virtual-viewport/VirtualViewport.svelte.d.ts +22 -0
  9. package/dist/components/buttons/button/Button.svelte.d.ts +21 -0
  10. package/dist/components/buttons/button-text/TextButton.svelte.d.ts +7 -0
  11. package/dist/components/hkdev/blocks/TextBlock.svelte.d.ts +13 -0
  12. package/dist/components/hkdev/buttons/CheckButton.svelte.d.ts +18 -0
  13. package/dist/components/icon/HkIcon.svelte.d.ts +12 -0
  14. package/dist/components/icon/HkTabIcon.svelte.d.ts +21 -0
  15. package/dist/components/image/ImageBox.svelte.d.ts +19 -0
  16. package/dist/components/inputs/text-input/TextInput.svelte.d.ts +28 -0
  17. package/dist/components/layout/HkAppLayout.svelte.d.ts +11 -0
  18. package/dist/components/layout/HkGridLayers.svelte.d.ts +23 -0
  19. package/dist/components/panels/plain-panel/PlainPanel.svelte.d.ts +12 -0
  20. package/dist/components/rows/panel-grid-row/PanelGridRow.svelte.d.ts +14 -0
  21. package/dist/components/rows/panel-row-2/PanelRow2.svelte.d.ts +14 -0
  22. package/dist/components/tab-bar/HkTabBar.svelte.d.ts +18 -0
  23. package/dist/components/tab-bar/HkTabBarSelector.svelte.d.ts +19 -0
  24. package/dist/components/widgets/compare-left-right/CompareLeftRight.svelte.d.ts +10 -0
  25. package/dist/design-system/tailwind-theme-extend.d.ts +4 -4
  26. package/dist/util/http/index.js +1 -1
  27. package/package.json +18 -18
  28. package/dist/components/image/EnhancedImage.svelte__ +0 -162
  29. package/dist/components/image/ImageBox.svelte__ +0 -242
  30. package/dist/components/image/ImageBox.svelte___ +0 -241
  31. package/dist/components/image/ResponsiveImage.svelte +0 -90
  32. package/dist/components/image/ResponsiveImage.svelte.d.ts +0 -15
  33. package/dist/components/image/ResponsiveImage.svelte__ +0 -90
@@ -1,90 +0,0 @@
1
- <script>
2
- /** @typedef {import('../../config/typedef.js').ImageMeta} ImageMeta */
3
-
4
- import { ImageVariantsLoader } from '../../classes/svelte/image/index.js';
5
-
6
- /**
7
- * @type {{
8
- * base?: string,
9
- * classes?: string
10
- * boxBase?: string,
11
- * boxClasses?: string
12
- * boxAttrs?: { [attr: string]: * },
13
- * images: ImageMeta[],
14
- * alt?: string
15
- * } & { [attr: string]: any }}
16
- */
17
- const {
18
- base,
19
- classes,
20
- boxBase,
21
- boxClasses,
22
- boxAttrs,
23
-
24
- // Functional
25
- images,
26
- alt = '',
27
-
28
- // Attributes
29
- ...attrs
30
- } = $props();
31
-
32
- let variantsLoader = new ImageVariantsLoader(images);
33
-
34
- let containerWidth = $state(0);
35
-
36
- /** @type {ImageMeta|null} */
37
- let imageVariant = $state(null);
38
-
39
- $effect(() => {
40
- variantsLoader.updateOptimalImageMeta({ containerWidth });
41
- });
42
-
43
- // $effect(() => {
44
- // console.log('imageVariant', $state.snapshot(imageVariant));
45
- // });
46
-
47
- /** @type {string|null} */
48
- let imageUrl = $state(null);
49
-
50
- $effect(() => {
51
- let image;
52
-
53
- if (variantsLoader.loaded) {
54
- // @ts-ignore
55
- imageUrl = variantsLoader.getObjectURL();
56
- }
57
-
58
- return () => {
59
- if (imageUrl) {
60
- URL.revokeObjectURL(imageUrl);
61
- imageUrl = null;
62
- }
63
- };
64
- });
65
-
66
- let variant = $derived(variantsLoader.variant);
67
-
68
- // let image = $derived(variantsLoader.image);
69
- </script>
70
-
71
-
72
- <div
73
- bind:clientWidth={containerWidth}
74
- class="{boxBase} {boxClasses}"
75
- {...boxAttrs}
76
- >
77
- <!-- <p class="p text-white">variant: {JSON.stringify(variant)}</p> -->
78
-
79
- {#if variant}
80
- <img
81
- data-image="responsive"
82
- src={imageUrl ? imageUrl : ''}
83
- width={variant.width}
84
- height={variant.height}
85
- {alt}
86
- class="{boxBase} {boxClasses}"
87
- {...attrs}
88
- />
89
- {/if}
90
- </div>
@@ -1,15 +0,0 @@
1
- export default ResponsiveImage;
2
- export type ImageMeta = import("../../config/typedef.js").ImageMeta;
3
- declare const ResponsiveImage: import("svelte").Component<{
4
- base?: string;
5
- classes?: string;
6
- boxBase?: string;
7
- boxClasses?: string;
8
- boxAttrs?: {
9
- [attr: string]: any;
10
- };
11
- images: ImageMeta[];
12
- alt?: string;
13
- } & {
14
- [attr: string]: any;
15
- }, {}, "">;
@@ -1,90 +0,0 @@
1
- <script>
2
- /** @typedef {import('$lib/config/typedef.js').ImageMeta} ImageMeta */
3
-
4
- import { ImageVariantsLoader } from '$lib/classes/svelte/image/index.js';
5
-
6
- /**
7
- * @type {{
8
- * base?: string,
9
- * classes?: string
10
- * boxBase?: string,
11
- * boxClasses?: string
12
- * boxAttrs?: { [attr: string]: * },
13
- * images: ImageMeta[],
14
- * alt?: string
15
- * } & { [attr: string]: any }}
16
- */
17
- const {
18
- base,
19
- classes,
20
- boxBase,
21
- boxClasses,
22
- boxAttrs,
23
-
24
- // Functional
25
- images,
26
- alt = '',
27
-
28
- // Attributes
29
- ...attrs
30
- } = $props();
31
-
32
- let variantsLoader = new ImageVariantsLoader(images);
33
-
34
- let containerWidth = $state(0);
35
-
36
- /** @type {ImageMeta|null} */
37
- let imageVariant = $state(null);
38
-
39
- $effect(() => {
40
- variantsLoader.updateOptimalImageMeta({ containerWidth });
41
- });
42
-
43
- // $effect(() => {
44
- // console.log('imageVariant', $state.snapshot(imageVariant));
45
- // });
46
-
47
- /** @type {string|null} */
48
- let imageUrl = $state(null);
49
-
50
- $effect(() => {
51
- let image;
52
-
53
- if (variantsLoader.loaded) {
54
- // @ts-ignore
55
- imageUrl = variantsLoader.getObjectURL();
56
- }
57
-
58
- return () => {
59
- if (imageUrl) {
60
- URL.revokeObjectURL(imageUrl);
61
- imageUrl = null;
62
- }
63
- };
64
- });
65
-
66
- let variant = $derived(variantsLoader.variant);
67
-
68
- // let image = $derived(variantsLoader.image);
69
- </script>
70
-
71
-
72
- <div
73
- bind:clientWidth={containerWidth}
74
- class="{boxBase} {boxClasses}"
75
- {...boxAttrs}
76
- >
77
- <!-- <p class="p text-white">variant: {JSON.stringify(variant)}</p> -->
78
-
79
- {#if variant}
80
- <img
81
- data-image="responsive"
82
- src={imageUrl ? imageUrl : ''}
83
- width={variant.width}
84
- height={variant.height}
85
- {alt}
86
- class="{boxBase} {boxClasses}"
87
- {...attrs}
88
- />
89
- {/if}
90
- </div>