@wix/himalaya-cli 0.1647.0 → 0.1648.0

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 (38) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +6 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/media/src/rendition.d.ts +6 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +1 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +4 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-events.mjs +4 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-media.mjs +22 -4
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-rich-content.mjs +4 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores-collections.mjs +4 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores.mjs +4 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-video.mjs +4 -0
  14. package/dist/browser-plane/assets.json +5 -5
  15. package/dist/browser-plane/preview-deferred/{155f61519885c85d61a39fa595197071a3ca07680da56055ccb1dcff2e709cd1.bin → 4ef4d326496b4d7809746936207067b4c921f5db9878ecc7030aa3a9e4d2aaeb.bin} +1 -1
  16. package/dist/browser-plane/sw.js +5 -5
  17. package/dist/cli.mjs +4098 -3351
  18. package/dist/preview-assets.generated.bin +0 -0
  19. package/guides/component-reference.json +1 -1
  20. package/guides/component-reference.md +2 -0
  21. package/guides/designing-himi-screens.md +4 -0
  22. package/guides/himi-skill.md +6 -0
  23. package/guides/image-preview.md +92 -0
  24. package/guides/index.json +7 -0
  25. package/guides/release-notes.md +6 -0
  26. package/guides/sdk-reference.json +9 -2
  27. package/package.json +2 -2
  28. package/templates/beauty-salon-owner/dev/index.ts +7 -0
  29. package/templates/community-club-owner/dev/index.ts +7 -0
  30. package/templates/events-meetups-owner/dev/index.ts +7 -0
  31. package/templates/gym-fitness-owner/dev/index.ts +7 -0
  32. package/templates/nonprofit-cause-owner/dev/index.ts +7 -0
  33. package/templates/owner-lite/dev/index.ts +7 -0
  34. package/templates/podcast-creator-owner/dev/index.ts +7 -0
  35. package/templates/portfolio-creative-owner/dev/index.ts +7 -0
  36. package/templates/restaurant-owner/dev/index.ts +7 -0
  37. package/templates/retail-store-owner/dev/index.ts +7 -0
  38. package/templates/yoga-studio-owner/dev/index.ts +7 -0
@@ -263,7 +263,9 @@ export declare function appIntent(pkg: string, type: string, props: unknown, opt
263
263
  * announces; without one it is DECORATIVE. Both are correct answers and the
264
264
  * choice is the author's, but `contentDescription: ""` spells the second one
265
265
  * ambiguously — it reads as an unfinished name rather than a decision. Pass
266
- * `decorative: true` to say it out loud (`modifiers.accessibilityRole`). */
266
+ * `decorative: true` to say it out loud (`modifiers.accessibilityRole`).
267
+ * On a screen, a tap opens the image full screen by default; `modifiers.imagePreview: "off"` on it or
268
+ * a subtree opts out (`himi docs image-preview`). */
267
269
  export declare function image(props: {
268
270
  url?: string;
269
271
  asset?: string;
@@ -144,6 +144,8 @@ export interface Shadow {
144
144
  export interface Modifiers {
145
145
  /** Changing non-empty token: scroll this node into view and move accessibility focus to it. */
146
146
  scrollIntoViewPath?: string;
147
+ /** RFC 0078 — inherited preview scope; unknown values inherit. */
148
+ imagePreview?: string;
147
149
  padding?: EdgeInsets;
148
150
  background?: TokenRef;
149
151
  cornerRadius?: number;
@@ -814,6 +816,8 @@ export type ImageSource = {
814
816
  } | {
815
817
  asset: string;
816
818
  };
819
+ /** On a screen, a tap opens the image full screen by default; `modifiers.imagePreview: "off"` on it or a
820
+ * subtree opts out (`himi docs image-preview`). */
817
821
  export type ImageProps = {
818
822
  /** Literal URL, or binding-aware `$service:`/`$item.` image URL. */
819
823
  url?: string;
@@ -1126,6 +1126,9 @@ export declare const screenDescriptorSchema: {
1126
1126
  };
1127
1127
  };
1128
1128
  };
1129
+ readonly imagePreview: {
1130
+ readonly type: "string";
1131
+ };
1129
1132
  readonly ambientMotion: {
1130
1133
  readonly type: "object";
1131
1134
  readonly additionalProperties: false;
@@ -2639,6 +2642,9 @@ export declare const widgetSnapshotSchema: {
2639
2642
  };
2640
2643
  };
2641
2644
  };
2645
+ readonly imagePreview: {
2646
+ readonly type: "string";
2647
+ };
2642
2648
  readonly ambientMotion: {
2643
2649
  readonly type: "object";
2644
2650
  readonly additionalProperties: false;
@@ -5,7 +5,11 @@ export interface ImageTarget {
5
5
  scale: number;
6
6
  mode?: string;
7
7
  maxEdge?: number;
8
+ /** The image opens the image preview: fetched whole, never cropped by the server. */
9
+ previewable?: boolean;
8
10
  }
11
+ /** Full-screen preview opts into 2048px on phones; desktop/TV keep their larger ceiling. */
12
+ export declare function imagePreviewMaxEdge(platformMaxEdge?: number): number;
9
13
  /**
10
14
  * The pixel size an image is requested at for a box of `width`×`height` points at `scale`: the box in pixels,
11
15
  * its longer edge rounded up to a shared bucket (96 … 1400, or up to `maxEdge`, at most 4096) so nearby sizes
@@ -39,4 +43,6 @@ export declare function imageCandidates(source: string, box: {
39
43
  height?: number;
40
44
  ratio?: number;
41
45
  mode?: string;
46
+ maxEdge?: number;
47
+ previewable?: boolean;
42
48
  }, scales?: number[]): ImageCandidate[];
@@ -9453,6 +9453,7 @@ var screenDescriptorSchema = {
9453
9453
  // RFC 0069 — recurring, finite, transform-only motion on a decorative node. `kind`
9454
9454
  // is an open string: an unknown kind renders no motion, so an older validator must
9455
9455
  // not reject a newer one.
9456
+ imagePreview: { type: "string" },
9456
9457
  ambientMotion: {
9457
9458
  type: "object",
9458
9459
  additionalProperties: false,
@@ -324,6 +324,10 @@ function createBusinessContactService(opts = {}) {
324
324
  return svc;
325
325
  }
326
326
 
327
+ // ../../stdlib/wix-sdk/media/src/rendition.ts
328
+ var FLUID_WIDTHS = [320, 640, 768, 1024, 1280, 1400, 2048];
329
+ var DESKTOP_PREVIEW_WIDTHS = [...FLUID_WIDTHS, 2560, 3072, 4096];
330
+
327
331
  // ../../stdlib/wix-sdk/media/src/index.ts
328
332
  var WIX_LIST_IMAGE = { width: 1e3, height: 1e3, quality: 85 };
329
333
  var WIX_DETAIL_IMAGE = { width: 1400, height: 1400, quality: 85 };
@@ -7646,6 +7646,7 @@ var screenDescriptorSchema = {
7646
7646
  // RFC 0069 — recurring, finite, transform-only motion on a decorative node. `kind`
7647
7647
  // is an open string: an unknown kind renders no motion, so an older validator must
7648
7648
  // not reject a newer one.
7649
+ imagePreview: { type: "string" },
7649
7650
  ambientMotion: {
7650
7651
  type: "object",
7651
7652
  additionalProperties: false,
@@ -1,3 +1,7 @@
1
+ // ../../stdlib/wix-sdk/media/src/rendition.ts
2
+ var FLUID_WIDTHS = [320, 640, 768, 1024, 1280, 1400, 2048];
3
+ var DESKTOP_PREVIEW_WIDTHS = [...FLUID_WIDTHS, 2560, 3072, 4096];
4
+
1
5
  // ../../stdlib/wix-sdk/media/src/index.ts
2
6
  var WIX_LIST_IMAGE = { width: 1e3, height: 1e3, quality: 85 };
3
7
  var WIX_MEDIA = /^https?:\/\/static\.wixstatic\.com\/media\/[^/]/;
@@ -1,4 +1,7 @@
1
1
  // ../../stdlib/wix-sdk/media/src/rendition.ts
2
+ function imagePreviewMaxEdge(platformMaxEdge = 1400) {
3
+ return platformMaxEdge > 2048 ? Math.min(4096, platformMaxEdge) : 2048;
4
+ }
2
5
  var BUCKETS = [96, 128, 160, 192, 256, 320, 384, 512, 640, 768, 1024, 1280, 1400, 2048, 2560, 3072, 4096];
3
6
  var CREDENTIAL = /(?:[?&])(?:token|expires|signature|x-amz-[^=&#]*|pvt)=/i;
4
7
  var WIX = /^(https?:\/\/static\.wixstatic\.com\/media\/([^/?#]+))([^?#]*)([?#].*)?$/i;
@@ -50,18 +53,32 @@ function resolveImageRendition(source, target) {
50
53
  h = Math.min(h, sh);
51
54
  }
52
55
  }
56
+ const whole = !transform && mode === "fill" && target.previewable === true;
57
+ const fetched = whole ? "fit" : mode;
58
+ if (whole) {
59
+ const cap = imagePreviewMaxEdge(Number.isFinite(target.maxEdge) ? target.maxEdge : 1400), longest = Math.max(w, h);
60
+ if (2 * longest <= cap) {
61
+ w *= 2;
62
+ h *= 2;
63
+ } else {
64
+ w = Math.max(1, Math.ceil(w * cap / longest));
65
+ h = Math.max(1, Math.ceil(h * cap / longest));
66
+ }
67
+ }
53
68
  const gcd = (a, b) => b ? gcd(b, a % b) : a;
54
69
  const divisor = gcd(transform ? sw : w, transform ? sh : h);
55
- const shape = mode === "fill" ? `${(transform ? sw : w) / divisor}:${(transform ? sh : h) / divisor}` : "";
56
- result.family = `${base}|${mode}|${shape}|${extras.join(",")}${suffix}`;
70
+ const shape = fetched === "fill" ? `${(transform ? sw : w) / divisor}:${(transform ? sh : h) / divisor}` : "";
71
+ result.family = `${base}|${fetched}|${shape}|${extras.join(",")}${suffix}`;
57
72
  if (transform && sw <= pixels.width && sh <= pixels.height) return result;
58
- result.url = `${base}/v1/${mode}/w_${w},h_${h},${quality}${extras.length ? "," + extras.join(",") : ""}/${transform ? filename : "image." + ext}${suffix}`;
73
+ result.url = `${base}/v1/${fetched}/w_${w},h_${h},${quality}${extras.length ? "," + extras.join(",") : ""}/${transform ? filename : "image." + ext}${suffix}`;
59
74
  return result;
60
75
  }
61
76
  var FLUID_WIDTHS = [320, 640, 768, 1024, 1280, 1400, 2048];
77
+ var DESKTOP_PREVIEW_WIDTHS = [...FLUID_WIDTHS, 2560, 3072, 4096];
62
78
  function imageCandidates(source, box, scales = [1, 2, 3]) {
63
79
  const fixed = typeof box.width === "number" && box.width > 0 && typeof box.height === "number" && box.height > 0;
64
- const targets = fixed ? scales.map((scale) => ({ width: box.width, height: box.height, scale, mode: box.mode })) : FLUID_WIDTHS.map((width) => ({ width, height: box.ratio ? width / box.ratio : width, scale: 1, mode: box.ratio ? box.mode : "fit" }));
80
+ const widths = (box.maxEdge ?? 1400) > 2048 ? DESKTOP_PREVIEW_WIDTHS : FLUID_WIDTHS;
81
+ const targets = fixed ? scales.map((scale) => ({ width: box.width, height: box.height, scale, mode: box.mode, maxEdge: box.maxEdge, previewable: box.previewable })) : widths.map((width) => ({ width, height: box.ratio ? width / box.ratio : width, scale: 1, mode: box.ratio ? box.mode : "fit", maxEdge: box.maxEdge, previewable: box.previewable }));
65
82
  const seen = /* @__PURE__ */ new Set();
66
83
  const out = [];
67
84
  for (const target of targets) {
@@ -171,6 +188,7 @@ export {
171
188
  WIX_LIST_IMAGE,
172
189
  imageCandidates,
173
190
  imagePixelSize,
191
+ imagePreviewMaxEdge,
174
192
  isUnsizedWixMedia,
175
193
  resolveImageRendition,
176
194
  wixMediaUrl
@@ -1,3 +1,7 @@
1
+ // ../../stdlib/wix-sdk/media/src/rendition.ts
2
+ var FLUID_WIDTHS = [320, 640, 768, 1024, 1280, 1400, 2048];
3
+ var DESKTOP_PREVIEW_WIDTHS = [...FLUID_WIDTHS, 2560, 3072, 4096];
4
+
1
5
  // ../../stdlib/wix-sdk/media/src/index.ts
2
6
  var WIX_LIST_IMAGE = { width: 1e3, height: 1e3, quality: 85 };
3
7
  var WIX_DETAIL_IMAGE = { width: 1400, height: 1400, quality: 85 };
@@ -1,3 +1,7 @@
1
+ // ../../stdlib/wix-sdk/media/src/rendition.ts
2
+ var FLUID_WIDTHS = [320, 640, 768, 1024, 1280, 1400, 2048];
3
+ var DESKTOP_PREVIEW_WIDTHS = [...FLUID_WIDTHS, 2560, 3072, 4096];
4
+
1
5
  // ../../stdlib/wix-sdk/media/src/index.ts
2
6
  var WIX_LIST_IMAGE = { width: 1e3, height: 1e3, quality: 85 };
3
7
  var WIX_MEDIA = /^https?:\/\/static\.wixstatic\.com\/media\/[^/]/;
@@ -237,6 +237,10 @@ function toV3Update(productId, patch, current) {
237
237
  return out;
238
238
  }
239
239
 
240
+ // ../../stdlib/wix-sdk/media/src/rendition.ts
241
+ var FLUID_WIDTHS = [320, 640, 768, 1024, 1280, 1400, 2048];
242
+ var DESKTOP_PREVIEW_WIDTHS = [...FLUID_WIDTHS, 2560, 3072, 4096];
243
+
240
244
  // ../../stdlib/wix-sdk/media/src/index.ts
241
245
  var WIX_LIST_IMAGE = { width: 1e3, height: 1e3, quality: 85 };
242
246
  var WIX_DETAIL_IMAGE = { width: 1400, height: 1400, quality: 85 };
@@ -1,3 +1,7 @@
1
+ // ../../stdlib/wix-sdk/media/src/rendition.ts
2
+ var FLUID_WIDTHS = [320, 640, 768, 1024, 1280, 1400, 2048];
3
+ var DESKTOP_PREVIEW_WIDTHS = [...FLUID_WIDTHS, 2560, 3072, 4096];
4
+
1
5
  // ../../stdlib/wix-sdk/media/src/index.ts
2
6
  var WIX_LIST_IMAGE = { width: 1e3, height: 1e3, quality: 85 };
3
7
  var WIX_MEDIA = /^https?:\/\/static\.wixstatic\.com\/media\/[^/]/;
@@ -2,7 +2,7 @@
2
2
  "files": [
3
3
  {
4
4
  "name": "sw.js",
5
- "bytes": 2462113
5
+ "bytes": 2500666
6
6
  },
7
7
  {
8
8
  "name": "host.html",
@@ -21,7 +21,7 @@
21
21
  "bytes": 23064
22
22
  },
23
23
  {
24
- "name": "preview-deferred/155f61519885c85d61a39fa595197071a3ca07680da56055ccb1dcff2e709cd1.bin",
24
+ "name": "preview-deferred/4ef4d326496b4d7809746936207067b4c921f5db9878ecc7030aa3a9e4d2aaeb.bin",
25
25
  "bytes": 488215
26
26
  },
27
27
  {
@@ -79,10 +79,10 @@
79
79
  ],
80
80
  "deferred": [
81
81
  {
82
- "key": "assets/pdf-DTUlmBj2.js",
82
+ "key": "assets/pdf-D8JQa8ez.js",
83
83
  "contentType": "application/javascript; charset=utf-8",
84
- "sha256": "155f61519885c85d61a39fa595197071a3ca07680da56055ccb1dcff2e709cd1",
85
- "file": "preview-deferred/155f61519885c85d61a39fa595197071a3ca07680da56055ccb1dcff2e709cd1.bin"
84
+ "sha256": "4ef4d326496b4d7809746936207067b4c921f5db9878ecc7030aa3a9e4d2aaeb",
85
+ "file": "preview-deferred/4ef4d326496b4d7809746936207067b4c921f5db9878ecc7030aa3a9e4d2aaeb.bin"
86
86
  },
87
87
  {
88
88
  "key": "assets/pdf.worker.min-BGnVRhRG.js",