@bagelink/vue 1.20.89 → 1.20.96

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.20.89",
4
+ "version": "1.20.96",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -63,7 +63,7 @@
63
63
  "@types/signature_pad": "^4.0.0",
64
64
  "vue": "^3.5.43",
65
65
  "vue-component-type-helpers": "^2.2.12",
66
- "@bagelink/sdk": "1.20.89"
66
+ "@bagelink/sdk": "1.20.96"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@bagelink/sdk": "*",
@@ -32,6 +32,11 @@ interface ImageProps {
32
32
  rounded?: boolean | number
33
33
  /** Defer the download until the image nears the viewport. */
34
34
  lazy?: boolean
35
+ /**
36
+ * Mark as the LCP / above-the-fold candidate. Sets `fetchpriority="high"`
37
+ * and disables lazy loading so the browser fetches it immediately.
38
+ */
39
+ priority?: boolean
35
40
  }
36
41
 
37
42
  const props = defineProps<ImageProps>()
@@ -95,6 +100,9 @@ const radiusStyle = computed(() => {
95
100
  return typeof props.rounded === 'number' ? `${props.rounded}px` : 'var(--bgl-card-radius, 12px)'
96
101
  })
97
102
  const imgFit = computed(() => props.fit ?? 'cover')
103
+ /** Priority images must never lazy-load — that delays LCP. */
104
+ const isLazy = computed(() => !!props.lazy && !props.priority)
105
+ const fetchPriority = computed(() => (props.priority ? 'high' as const : undefined))
98
106
  </script>
99
107
 
100
108
  <template>
@@ -118,7 +126,8 @@ const imgFit = computed(() => props.fit ?? 'cover')
118
126
  v-if="imageSrc"
119
127
  :src="deliveredSrc"
120
128
  :alt="alt"
121
- :loading="lazy ? 'lazy' : undefined"
129
+ :loading="isLazy ? 'lazy' : undefined"
130
+ :fetchpriority="fetchPriority"
122
131
  decoding="async"
123
132
  class="bgl-image-frame-img h-100p"
124
133
  :class="[frameHasHeight ? 'absolute-fill' : 'bgl-image-frame-img--flow', { 'opacity-0': !imageLoaded }]"
@@ -140,7 +149,8 @@ const imgFit = computed(() => props.fit ?? 'cover')
140
149
  :src="deliveredSrc"
141
150
  v-bind="$attrs"
142
151
  :alt="alt"
143
- :loading="lazy ? 'lazy' : undefined"
152
+ :loading="isLazy ? 'lazy' : undefined"
153
+ :fetchpriority="fetchPriority"
144
154
  decoding="async"
145
155
  :width="normalizeDimension(width)"
146
156
  :height="normalizeDimension(height)"
@@ -167,7 +177,8 @@ const imgFit = computed(() => props.fit ?? 'cover')
167
177
  v-if="imageSrc"
168
178
  :src="deliveredSrc"
169
179
  :alt="alt"
170
- :loading="lazy ? 'lazy' : undefined"
180
+ :loading="isLazy ? 'lazy' : undefined"
181
+ :fetchpriority="fetchPriority"
171
182
  decoding="async"
172
183
  class="w-100p h-100p"
173
184
  :class="{ 'opacity-0': !imageLoaded }"