@stacksjs/defaults 0.74.16 → 0.74.18
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/ide/vscode/package.json
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@stacksjs/defaults",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "0.74.
|
|
5
|
+
"version": "0.74.18",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/stacksjs/stacks.git",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@iconify-json/f7": "^1.2.2",
|
|
57
57
|
"@iconify-json/hugeicons": "^1.2.27",
|
|
58
|
-
"@stacksjs/mobile": "^0.74.
|
|
58
|
+
"@stacksjs/mobile": "^0.74.18",
|
|
59
59
|
"@stacksjs/sanitizer": "^0.2.113",
|
|
60
60
|
"ts-qr-codes": "^0.1.8"
|
|
61
61
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
<script server>
|
|
2
|
-
interface ImageSource { type: string, srcset: string, media?: string }
|
|
3
2
|
interface ImageProps {
|
|
4
3
|
src: string
|
|
5
|
-
alt
|
|
4
|
+
alt?: string
|
|
6
5
|
width?: number
|
|
7
6
|
height?: number
|
|
8
7
|
aspectRatio?: string
|
|
9
8
|
srcset?: string
|
|
10
9
|
sizes?: string
|
|
11
|
-
sources?: ImageSource[]
|
|
12
10
|
loading?: 'lazy' | 'eager'
|
|
13
11
|
decoding?: 'async' | 'sync' | 'auto'
|
|
14
12
|
fetchpriority?: 'high' | 'low' | 'auto'
|
|
@@ -16,7 +14,8 @@ interface ImageProps {
|
|
|
16
14
|
decorative?: boolean
|
|
17
15
|
fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down'
|
|
18
16
|
position?: string
|
|
19
|
-
placeholder?: string
|
|
17
|
+
placeholder?: 'blur' | 'thumbhash' | 'color' | 'empty' | 'none' | string
|
|
18
|
+
placeholderColor?: string
|
|
20
19
|
class?: string
|
|
21
20
|
}
|
|
22
21
|
const props = defineProps<ImageProps>()
|
|
@@ -27,33 +26,32 @@ const width = props.width || ''
|
|
|
27
26
|
const height = props.height || ''
|
|
28
27
|
const ratio = props.aspectRatio || (width && height ? `${width} / ${height}` : '')
|
|
29
28
|
const srcset = props.srcset || ''
|
|
30
|
-
const sizes = props.sizes ||
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const priority = props.priority ? 'high' : props.fetchpriority || 'auto'
|
|
29
|
+
const sizes = props.sizes || ''
|
|
30
|
+
const loading = props.loading || ''
|
|
31
|
+
const decoding = props.decoding || ''
|
|
32
|
+
const fetchpriority = props.fetchpriority || ''
|
|
35
33
|
const fit = props.fit || 'cover'
|
|
36
34
|
const position = props.position || 'center'
|
|
37
35
|
const placeholder = props.placeholder || ''
|
|
36
|
+
const placeholderColor = props.placeholderColor || ''
|
|
38
37
|
const className = props.class || ''
|
|
38
|
+
const imageStyle = `${ratio ? `aspect-ratio:${ratio};` : ''}object-fit:${fit};object-position:${position};`
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
>
|
|
59
|
-
</picture>
|
|
41
|
+
<StxImage
|
|
42
|
+
src="{{ src }}"
|
|
43
|
+
alt="{{ alt }}"
|
|
44
|
+
class="{{ className }}"
|
|
45
|
+
style="{{ imageStyle }}"
|
|
46
|
+
@if(width) width="{{ width }}" @endif
|
|
47
|
+
@if(height) height="{{ height }}" @endif
|
|
48
|
+
@if(srcset) srcset="{{ srcset }}" @endif
|
|
49
|
+
@if(sizes) sizes="{{ sizes }}" @endif
|
|
50
|
+
@if(loading) loading="{{ loading }}" @endif
|
|
51
|
+
@if(decoding) decoding="{{ decoding }}" @endif
|
|
52
|
+
@if(fetchpriority) fetchpriority="{{ fetchpriority }}" @endif
|
|
53
|
+
@if(props.priority) priority @endif
|
|
54
|
+
@if(props.decorative) aria-hidden="true" @endif
|
|
55
|
+
@if(placeholder) placeholder="{{ placeholder }}" @endif
|
|
56
|
+
@if(placeholderColor) placeholder-color="{{ placeholderColor }}" @endif
|
|
57
|
+
/>
|