@stacksjs/defaults 0.74.15 → 0.74.17

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.
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.74.15",
5
+ "version": "0.74.17",
6
6
  "description": "A modern Stacks development environment.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
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.15",
5
+ "version": "0.74.17",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -34,6 +34,7 @@
34
34
  "project"
35
35
  ],
36
36
  "exports": {
37
+ "./resources/plugins/preloader": "./resources/plugins/preloader.ts",
37
38
  "./*": {
38
39
  "types": "./dist/*.d.ts",
39
40
  "bun": "./dist/*.js",
@@ -54,7 +55,7 @@
54
55
  "dependencies": {
55
56
  "@iconify-json/f7": "^1.2.2",
56
57
  "@iconify-json/hugeicons": "^1.2.27",
57
- "@stacksjs/mobile": "^0.74.15",
58
+ "@stacksjs/mobile": "^0.74.17",
58
59
  "@stacksjs/sanitizer": "^0.2.113",
59
60
  "ts-qr-codes": "^0.1.8"
60
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: string
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 || (srcset ? '100vw' : '')
31
- const sources = props.sources || []
32
- const loading = props.priority ? 'eager' : props.loading || 'lazy'
33
- const decoding = props.decoding || 'async'
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
- <picture class="relative block overflow-hidden bg-stone-100 dark:bg-stone-900 {{ className }}" @if(ratio) style="aspect-ratio: {{ ratio }};" @endif>
42
- @foreach (sources as source)
43
- <source type="{{ source.type }}" srcset="{{ source.srcset }}" @if(source.media) media="{{ source.media }}" @endif @if(sizes) sizes="{{ sizes }}" @endif>
44
- @endforeach
45
- <img
46
- src="{{ src }}"
47
- alt="{{ alt }}"
48
- @if(width) width="{{ width }}" @endif
49
- @if(height) height="{{ height }}" @endif
50
- @if(srcset) srcset="{{ srcset }}" @endif
51
- @if(sizes) sizes="{{ sizes }}" @endif
52
- loading="{{ loading }}"
53
- decoding="{{ decoding }}"
54
- fetchpriority="{{ priority }}"
55
- @if(props.decorative) aria-hidden="true" @endif
56
- class="h-full w-full"
57
- style="object-fit: {{ fit }}; object-position: {{ position }}; @if(placeholder) background: {{ placeholder }} center / cover no-repeat; @endif"
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
+ />