@absolutejs/absolute 0.19.0-beta.214 → 0.19.0-beta.216

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.
@@ -1,11 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref } from 'vue';
3
- import {
4
- DEFAULT_QUALITY,
5
- buildOptimizedUrl,
6
- generateBlurSvg,
7
- generateSrcSet
8
- } from '@absolutejs/absolute/image';
3
+ import { DEFAULT_QUALITY, buildOptimizedUrl, generateBlurSvg, generateSrcSet } from '@absolutejs/absolute/image';
9
4
 
10
5
  type ImageLoader = (params: {
11
6
  src: string;
@@ -59,11 +59,14 @@ export class ImageComponent {
59
59
  return buildOptimizedUrl(this.src(), currentWidth, this.quality());
60
60
  }, ...(ngDevMode ? [{ debugName: "resolvedSrc" }] : /* istanbul ignore next */ []));
61
61
  this.srcSet = computed(() => this.unoptimized()
62
- ? undefined
63
- : generateSrcSet(this.src(), this.width(), this.sizes(), undefined, this.loader() ?? undefined), ...(ngDevMode ? [{ debugName: "srcSet" }] : /* istanbul ignore next */ []));
64
- this.resolvedSizes = computed(() => this.sizes() ?? (this.fill() ? '100vw' : undefined), ...(ngDevMode ? [{ debugName: "resolvedSizes" }] : /* istanbul ignore next */ []));
62
+ ? null
63
+ : generateSrcSet(this.src(), this.width(), this.sizes(), undefined, this.loader() ?? undefined) ?? null, ...(ngDevMode ? [{ debugName: "srcSet" }] : /* istanbul ignore next */ []));
64
+ this.resolvedSrcSet = computed(() => this.srcSet() ?? null, ...(ngDevMode ? [{ debugName: "resolvedSrcSet" }] : /* istanbul ignore next */ []));
65
+ this.resolvedSizes = computed(() => this.sizes() ?? (this.fill() ? '100vw' : null), ...(ngDevMode ? [{ debugName: "resolvedSizes" }] : /* istanbul ignore next */ []));
66
+ this.resolvedCrossOrigin = computed(() => this.crossOrigin() ?? null, ...(ngDevMode ? [{ debugName: "resolvedCrossOrigin" }] : /* istanbul ignore next */ []));
67
+ this.resolvedReferrerPolicy = computed(() => this.referrerPolicy() ?? null, ...(ngDevMode ? [{ debugName: "resolvedReferrerPolicy" }] : /* istanbul ignore next */ []));
65
68
  this.resolvedLoading = computed(() => this.priority() ? 'eager' : this.loading(), ...(ngDevMode ? [{ debugName: "resolvedLoading" }] : /* istanbul ignore next */ []));
66
- this.resolvedFetchPriority = computed(() => this.priority() ? 'high' : this.fetchPriority(), ...(ngDevMode ? [{ debugName: "resolvedFetchPriority" }] : /* istanbul ignore next */ []));
69
+ this.resolvedFetchPriority = computed(() => this.priority() ? 'high' : (this.fetchPriority() ?? null), ...(ngDevMode ? [{ debugName: "resolvedFetchPriority" }] : /* istanbul ignore next */ []));
67
70
  this.imgStyle = computed(() => {
68
71
  const base = {
69
72
  ...(this.style() ?? {}),
@@ -107,16 +110,6 @@ export class ImageComponent {
107
110
  }
108
111
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: ImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
109
112
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.6", type: ImageComponent, isStandalone: true, selector: "abs-image", inputs: { alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: true, transformFunction: null }, blurDataURL: { classPropertyName: "blurDataURL", publicName: "blurDataURL", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, crossOrigin: { classPropertyName: "crossOrigin", publicName: "crossOrigin", isSignal: true, isRequired: false, transformFunction: null }, fetchPriority: { classPropertyName: "fetchPriority", publicName: "fetchPriority", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, loader: { classPropertyName: "loader", publicName: "loader", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, onError: { classPropertyName: "onError", publicName: "onError", isSignal: true, isRequired: false, transformFunction: null }, onLoad: { classPropertyName: "onLoad", publicName: "onLoad", isSignal: true, isRequired: false, transformFunction: null }, overrideSrc: { classPropertyName: "overrideSrc", publicName: "overrideSrc", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, priority: { classPropertyName: "priority", publicName: "priority", isSignal: true, isRequired: false, transformFunction: null }, quality: { classPropertyName: "quality", publicName: "quality", isSignal: true, isRequired: false, transformFunction: null }, referrerPolicy: { classPropertyName: "referrerPolicy", publicName: "referrerPolicy", isSignal: true, isRequired: false, transformFunction: null }, sizes: { classPropertyName: "sizes", publicName: "sizes", isSignal: true, isRequired: false, transformFunction: null }, src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: true, transformFunction: null }, style: { classPropertyName: "style", publicName: "style", isSignal: true, isRequired: false, transformFunction: null }, unoptimized: { classPropertyName: "unoptimized", publicName: "unoptimized", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
110
- @if (priority()) {
111
- <link
112
- rel="preload"
113
- as="image"
114
- [attr.href]="resolvedSrc()"
115
- [attr.imagesrcset]="srcSet()"
116
- [attr.imagesizes]="resolvedSizes()"
117
- [attr.crossorigin]="crossOrigin()"
118
- />
119
- }
120
113
  @if (fill()) {
121
114
  <span
122
115
  style="position:relative;overflow:hidden;display:block;width:100%;height:100%"
@@ -124,13 +117,13 @@ export class ImageComponent {
124
117
  <img
125
118
  [alt]="alt()"
126
119
  [src]="resolvedSrc()"
127
- [attr.srcset]="srcSet()"
120
+ [attr.srcset]="resolvedSrcSet()"
128
121
  [attr.sizes]="resolvedSizes()"
129
122
  [loading]="resolvedLoading()"
130
123
  [class]="className()"
131
124
  [ngStyle]="imgStyle()"
132
- [attr.crossorigin]="crossOrigin()"
133
- [attr.referrerpolicy]="referrerPolicy()"
125
+ [attr.crossorigin]="resolvedCrossOrigin()"
126
+ [attr.referrerpolicy]="resolvedReferrerPolicy()"
134
127
  [attr.fetchpriority]="resolvedFetchPriority()"
135
128
  decoding="async"
136
129
  (load)="handleLoad($event)"
@@ -141,15 +134,15 @@ export class ImageComponent {
141
134
  <img
142
135
  [alt]="alt()"
143
136
  [src]="resolvedSrc()"
144
- [attr.srcset]="srcSet()"
137
+ [attr.srcset]="resolvedSrcSet()"
145
138
  [attr.sizes]="resolvedSizes()"
146
139
  [width]="width()"
147
140
  [height]="height()"
148
141
  [loading]="resolvedLoading()"
149
142
  [class]="className()"
150
143
  [ngStyle]="imgStyle()"
151
- [attr.crossorigin]="crossOrigin()"
152
- [attr.referrerpolicy]="referrerPolicy()"
144
+ [attr.crossorigin]="resolvedCrossOrigin()"
145
+ [attr.referrerpolicy]="resolvedReferrerPolicy()"
153
146
  [attr.fetchpriority]="resolvedFetchPriority()"
154
147
  decoding="async"
155
148
  (load)="handleLoad($event)"
@@ -165,16 +158,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
165
158
  selector: 'abs-image',
166
159
  standalone: true,
167
160
  template: `
168
- @if (priority()) {
169
- <link
170
- rel="preload"
171
- as="image"
172
- [attr.href]="resolvedSrc()"
173
- [attr.imagesrcset]="srcSet()"
174
- [attr.imagesizes]="resolvedSizes()"
175
- [attr.crossorigin]="crossOrigin()"
176
- />
177
- }
178
161
  @if (fill()) {
179
162
  <span
180
163
  style="position:relative;overflow:hidden;display:block;width:100%;height:100%"
@@ -182,13 +165,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
182
165
  <img
183
166
  [alt]="alt()"
184
167
  [src]="resolvedSrc()"
185
- [attr.srcset]="srcSet()"
168
+ [attr.srcset]="resolvedSrcSet()"
186
169
  [attr.sizes]="resolvedSizes()"
187
170
  [loading]="resolvedLoading()"
188
171
  [class]="className()"
189
172
  [ngStyle]="imgStyle()"
190
- [attr.crossorigin]="crossOrigin()"
191
- [attr.referrerpolicy]="referrerPolicy()"
173
+ [attr.crossorigin]="resolvedCrossOrigin()"
174
+ [attr.referrerpolicy]="resolvedReferrerPolicy()"
192
175
  [attr.fetchpriority]="resolvedFetchPriority()"
193
176
  decoding="async"
194
177
  (load)="handleLoad($event)"
@@ -199,15 +182,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
199
182
  <img
200
183
  [alt]="alt()"
201
184
  [src]="resolvedSrc()"
202
- [attr.srcset]="srcSet()"
185
+ [attr.srcset]="resolvedSrcSet()"
203
186
  [attr.sizes]="resolvedSizes()"
204
187
  [width]="width()"
205
188
  [height]="height()"
206
189
  [loading]="resolvedLoading()"
207
190
  [class]="className()"
208
191
  [ngStyle]="imgStyle()"
209
- [attr.crossorigin]="crossOrigin()"
210
- [attr.referrerpolicy]="referrerPolicy()"
192
+ [attr.crossorigin]="resolvedCrossOrigin()"
193
+ [attr.referrerpolicy]="resolvedReferrerPolicy()"
211
194
  [attr.fetchpriority]="resolvedFetchPriority()"
212
195
  decoding="async"
213
196
  (load)="handleLoad($event)"
package/dist/build.js CHANGED
@@ -174177,7 +174177,7 @@ ${stubs}
174177
174177
  }
174178
174178
  return `${prefix}/@stub/${encodeURIComponent(specifier)}${suffix}`;
174179
174179
  };
174180
- result = result.replace(/^((?:import\s+.+?\s+from|export\s+.+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
174180
+ result = result.replace(/^((?:import\s+[\s\S]+?\s+from|export\s+[\s\S]+?\s+from|import)\s*["'])([^"'./][^"']*)(["'])/gm, stubReplace);
174181
174181
  result = result.replace(/(import\s*\(\s*["'])([^"'./][^"']*)(["']\s*\))/g, stubReplace);
174182
174182
  const fileDir = dirname7(filePath);
174183
174183
  result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, IMPORT_EXTENSIONS)}${suffix}`);
@@ -176710,5 +176710,5 @@ export {
176710
176710
  build
176711
176711
  };
176712
176712
 
176713
- //# debugId=C243CD67FDEAEAF864756E2164756E21
176713
+ //# debugId=B5B95DBA2BB208B564756E2164756E21
176714
176714
  //# sourceMappingURL=build.js.map