@wix/himalaya-cli 0.1095.0 → 0.1097.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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/display.d.ts +11 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/extensions.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/options.d.ts +74 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores.mjs +132 -0
- package/dist/cli.mjs +53 -19
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/sdk-reference.json +61 -1
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +215 -1
- package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +214 -7
- package/templates/branded-lite/dev/index.ts +215 -1
- package/templates/branded-lite/tier5-src/himi-store-product/index.ts +214 -7
- package/templates/gym-fitness/dev/index.ts +215 -1
- package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +214 -7
- package/templates/portfolio-creative/dev/index.ts +215 -1
- package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +214 -7
- package/templates/retail-store/dev/index.ts +215 -1
- package/templates/retail-store/tier5-src/himi-store-product/index.ts +214 -7
|
@@ -66,6 +66,17 @@ export interface StoreProduct {
|
|
|
66
66
|
currency?: string;
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
|
+
/** Option groups, both spellings: V1 `productOptions`, V3 `options`. Declared
|
|
70
|
+
* because the wire carries them on BOTH catalogs and this type denying them is
|
|
71
|
+
* what let every template product screen drop the colour/size picker. Shapes
|
|
72
|
+
* differ per catalog, so read them with `productOptions()` from ./options. */
|
|
73
|
+
productOptions?: unknown[];
|
|
74
|
+
options?: unknown[];
|
|
75
|
+
/** V3 purchasable variants. The cart addresses a V3 option choice by `variantId`,
|
|
76
|
+
* which `cartOptionsPayload()` resolves out of this. */
|
|
77
|
+
variantsInfo?: {
|
|
78
|
+
variants?: unknown[];
|
|
79
|
+
};
|
|
69
80
|
}
|
|
70
81
|
export interface StoreProductsResponse {
|
|
71
82
|
products?: StoreProduct[];
|
|
@@ -43,6 +43,7 @@ export declare function queryInventory(productId: string): Promise<WixQueryInven
|
|
|
43
43
|
* Only the supplied fields change (e.g. trackQuantity + a variant's quantity). */
|
|
44
44
|
export declare function updateInventory(inventoryItemId: string, inventoryItem: WixInventoryItemWrite): Promise<WixUpdateInventoryResponse>;
|
|
45
45
|
export * from "./display.js";
|
|
46
|
+
export * from "./options.js";
|
|
46
47
|
/** Forget the resolved Stores catalog version, in this worker and app-wide.
|
|
47
48
|
* Call this when the app points itself at a DIFFERENT Wix site. */
|
|
48
49
|
export declare function forgetCatalogVersion(): void;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { StoreProduct } from "./display.js";
|
|
2
|
+
import { type WixImageSize } from "@wix/himalaya/wix-media";
|
|
3
|
+
/** One selectable choice inside an option group. */
|
|
4
|
+
export interface StoreOptionChoice {
|
|
5
|
+
/** Stable id within the group. V3: the `choiceId`. V1: the choice's own label,
|
|
6
|
+
* which is what V1 has and what its cart payload carries. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** What the shopper reads on the chip — "BEIGE", "M". */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Is at least one variant carrying this choice in stock? */
|
|
11
|
+
inStock: boolean;
|
|
12
|
+
/** HEX swatch the site configured for this choice ("#e1bfc5"), or "" — a colour
|
|
13
|
+
* group carries one, a size group does not. */
|
|
14
|
+
colorCode: string;
|
|
15
|
+
/** Choice-linked image, sized, or "" when the choice has none. */
|
|
16
|
+
image: string;
|
|
17
|
+
}
|
|
18
|
+
/** One option group, e.g. `COLOR` with `BEIGE` / `PINK`. */
|
|
19
|
+
export interface StoreOption {
|
|
20
|
+
/** V3: the option id, used to resolve the variant. V1: the option name. */
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
/** `color` groups are the ones worth rendering as swatches — the choices carry
|
|
24
|
+
* a `colorCode`. Everything else is a list of words. */
|
|
25
|
+
kind: "color" | "list";
|
|
26
|
+
choices: StoreOptionChoice[];
|
|
27
|
+
}
|
|
28
|
+
/** The shopper's pick: option id → choice id. A group the shopper has not chosen
|
|
29
|
+
* yet is absent (or maps to ""). */
|
|
30
|
+
export type StoreOptionSelection = Record<string, string>;
|
|
31
|
+
/**
|
|
32
|
+
* Every offerable option group on a product, in site order, from either catalog.
|
|
33
|
+
*
|
|
34
|
+
* `[]` for a product with no options — the common case, so a caller must render
|
|
35
|
+
* nothing rather than an empty picker.
|
|
36
|
+
*
|
|
37
|
+
* `size` sizes the per-choice swatch image, like `productImage`; pass `null` for
|
|
38
|
+
* the stored original.
|
|
39
|
+
*/
|
|
40
|
+
export declare function productOptions(product: StoreProduct | undefined, size?: WixImageSize | null): StoreOption[];
|
|
41
|
+
/** The choice to preselect for a group: the only one when there is exactly one,
|
|
42
|
+
* otherwise "" so the shopper picks deliberately. */
|
|
43
|
+
export declare function defaultChoice(option: StoreOption): string;
|
|
44
|
+
/** A selection with every single-choice group pre-filled — what a product screen
|
|
45
|
+
* starts from. */
|
|
46
|
+
export declare function defaultSelection(options: StoreOption[]): StoreOptionSelection;
|
|
47
|
+
/** Has the shopper chosen in EVERY group? Add to cart stays disabled until this
|
|
48
|
+
* is true — a half-chosen product is the unfulfillable order. */
|
|
49
|
+
export declare function isSelectionComplete(options: StoreOption[], selection: StoreOptionSelection): boolean;
|
|
50
|
+
/** Human summary of the current selection, e.g. "BEIGE · M" ("" when nothing is
|
|
51
|
+
* chosen). Labels, not ids — this is shopper-facing text. */
|
|
52
|
+
export declare function selectionSummary(options: StoreOption[], selection: StoreOptionSelection): string;
|
|
53
|
+
/**
|
|
54
|
+
* The V3 variant matching the shopper's choices, or "" when none does.
|
|
55
|
+
*
|
|
56
|
+
* Set equality on `{optionId, choiceId}` pairs, not order — V3 does not promise
|
|
57
|
+
* the variant's `choices` array is in the product's option order, and a positional
|
|
58
|
+
* compare passes on a two-option product until the day the site reorders it.
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveVariantId(product: StoreProduct | undefined, selection: StoreOptionSelection): string;
|
|
61
|
+
/**
|
|
62
|
+
* The `catalogReference.options` value for `addToCurrentCart`, built for whichever
|
|
63
|
+
* catalog this product came from — V3 `{ variantId }`, V1 `{ options: {…} }`.
|
|
64
|
+
*
|
|
65
|
+
* `undefined` for a product with no options at all, which is what the cart wants
|
|
66
|
+
* (the line needs no `options` object).
|
|
67
|
+
*
|
|
68
|
+
* THROWS on V3 when the selection matches no variant, rather than returning a
|
|
69
|
+
* payload that adds an un-fulfillable line. The two ways to get here are a
|
|
70
|
+
* selection that is still incomplete (guard with `isSelectionComplete`) and a read
|
|
71
|
+
* whose `variantsInfo` did not come back — both are the caller's to fix, and both
|
|
72
|
+
* are invisible if this returns a plausible-looking payload instead.
|
|
73
|
+
*/
|
|
74
|
+
export declare function cartOptionsPayload(product: StoreProduct | undefined, options: StoreOption[], selection: StoreOptionSelection): Record<string, unknown> | undefined;
|
|
@@ -577,6 +577,131 @@ function plainText(value) {
|
|
|
577
577
|
return (value || "").replace(/<[^>]+>/g, "").replace(/\s+/g, " ").trim();
|
|
578
578
|
}
|
|
579
579
|
|
|
580
|
+
// ../../stdlib/wix-sdk/stores-v1/src/options.ts
|
|
581
|
+
function str(v) {
|
|
582
|
+
return typeof v === "string" ? v.trim() : "";
|
|
583
|
+
}
|
|
584
|
+
function choiceImage(raw, size) {
|
|
585
|
+
const m = raw;
|
|
586
|
+
const slot = m?.mainMedia ?? m?.items?.[0] ?? raw;
|
|
587
|
+
return slot ? mediaSlotUrl(slot, size) : "";
|
|
588
|
+
}
|
|
589
|
+
function hex(raw) {
|
|
590
|
+
const v = str(raw);
|
|
591
|
+
return /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/.test(v) ? v.toLowerCase() : "";
|
|
592
|
+
}
|
|
593
|
+
function v1Choices(raw, size) {
|
|
594
|
+
const out = [];
|
|
595
|
+
for (const c of Array.isArray(raw) ? raw : []) {
|
|
596
|
+
const o = c;
|
|
597
|
+
if (o.visible === false) continue;
|
|
598
|
+
const label = str(o.description) || str(o.value);
|
|
599
|
+
if (!label || out.some((x) => x.id === label)) continue;
|
|
600
|
+
out.push({
|
|
601
|
+
id: label,
|
|
602
|
+
label,
|
|
603
|
+
inStock: o.inStock !== false,
|
|
604
|
+
colorCode: hex(o.value),
|
|
605
|
+
image: choiceImage(o.media, size)
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
return out;
|
|
609
|
+
}
|
|
610
|
+
function v3Choices(raw, size) {
|
|
611
|
+
const settings = raw;
|
|
612
|
+
const out = [];
|
|
613
|
+
for (const c of Array.isArray(settings?.choices) ? settings.choices : []) {
|
|
614
|
+
const o = c;
|
|
615
|
+
if (o.visible === false) continue;
|
|
616
|
+
const label = str(o.name) || str(o.key);
|
|
617
|
+
const id = str(o.choiceId);
|
|
618
|
+
if (!id || !label || out.some((x) => x.id === id)) continue;
|
|
619
|
+
const linked = Array.isArray(o.linkedMedia) ? o.linkedMedia[0] : void 0;
|
|
620
|
+
out.push({
|
|
621
|
+
id,
|
|
622
|
+
label,
|
|
623
|
+
inStock: o.inStock !== false,
|
|
624
|
+
colorCode: hex(o.colorCode) || hex(o.value?.colorCode),
|
|
625
|
+
image: choiceImage(o.displayImage ?? linked, size)
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
return out;
|
|
629
|
+
}
|
|
630
|
+
function kindOf(raw) {
|
|
631
|
+
const v = str(raw).toUpperCase();
|
|
632
|
+
return v.includes("COLOR") || v.includes("COLOUR") || v === "SWATCH_CHOICES" ? "color" : "list";
|
|
633
|
+
}
|
|
634
|
+
function productOptions(product, size = WIX_LIST_IMAGE) {
|
|
635
|
+
const p = product;
|
|
636
|
+
const out = [];
|
|
637
|
+
for (const raw of Array.isArray(p?.productOptions) ? p.productOptions : []) {
|
|
638
|
+
const o = raw;
|
|
639
|
+
const name = str(o.name);
|
|
640
|
+
const choices = v1Choices(o.choices, size);
|
|
641
|
+
if (name) out.push({ id: name, name, kind: kindOf(o.optionType), choices });
|
|
642
|
+
}
|
|
643
|
+
if (out.length) return out;
|
|
644
|
+
for (const raw of Array.isArray(p?.options) ? p.options : []) {
|
|
645
|
+
const o = raw;
|
|
646
|
+
const name = str(o.name);
|
|
647
|
+
const id = str(o.id) || name;
|
|
648
|
+
const choices = v3Choices(o.choicesSettings, size);
|
|
649
|
+
if (name) out.push({ id, name, kind: kindOf(o.optionRenderType), choices });
|
|
650
|
+
}
|
|
651
|
+
return out;
|
|
652
|
+
}
|
|
653
|
+
function defaultChoice(option) {
|
|
654
|
+
return option.choices.length === 1 ? option.choices[0].id : "";
|
|
655
|
+
}
|
|
656
|
+
function defaultSelection(options) {
|
|
657
|
+
const out = {};
|
|
658
|
+
for (const o of options) {
|
|
659
|
+
const choice = defaultChoice(o);
|
|
660
|
+
if (choice) out[o.id] = choice;
|
|
661
|
+
}
|
|
662
|
+
return out;
|
|
663
|
+
}
|
|
664
|
+
function isSelectionComplete(options, selection) {
|
|
665
|
+
return options.every((o) => !!selection[o.id]);
|
|
666
|
+
}
|
|
667
|
+
function selectionSummary(options, selection) {
|
|
668
|
+
return options.map((o) => o.choices.find((c) => c.id === selection[o.id])?.label ?? "").filter(Boolean).join(" \xB7 ");
|
|
669
|
+
}
|
|
670
|
+
function isV3(p) {
|
|
671
|
+
return Array.isArray(p.options) || !!p.variantsInfo;
|
|
672
|
+
}
|
|
673
|
+
function resolveVariantId(product, selection) {
|
|
674
|
+
const p = product;
|
|
675
|
+
const variants = p?.variantsInfo?.variants ?? [];
|
|
676
|
+
const want = Object.entries(selection).filter(([, choice]) => !!choice);
|
|
677
|
+
for (const v of variants) {
|
|
678
|
+
if (v.visible === false) continue;
|
|
679
|
+
const pairs = (v.choices ?? []).map((c) => [str(c.optionChoiceIds?.optionId), str(c.optionChoiceIds?.choiceId)]);
|
|
680
|
+
if (pairs.length !== want.length) continue;
|
|
681
|
+
if (want.every(([optionId, choiceId]) => pairs.some(([o, c]) => o === optionId && c === choiceId))) {
|
|
682
|
+
return str(v.id);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
return "";
|
|
686
|
+
}
|
|
687
|
+
function cartOptionsPayload(product, options, selection) {
|
|
688
|
+
const p = product ?? {};
|
|
689
|
+
if (isV3(p)) {
|
|
690
|
+
const variantId = resolveVariantId(product, selection);
|
|
691
|
+
if (variantId) return { variantId };
|
|
692
|
+
if (options.length === 0) return void 0;
|
|
693
|
+
throw new Error(
|
|
694
|
+
"cartOptionsPayload: no Catalog V3 variant matches the chosen options \u2014 check every option group has a choice (isSelectionComplete) and that the product was read with its variantsInfo."
|
|
695
|
+
);
|
|
696
|
+
}
|
|
697
|
+
const picked = {};
|
|
698
|
+
for (const o of options) {
|
|
699
|
+
const choice = selection[o.id];
|
|
700
|
+
if (choice) picked[o.name] = choice;
|
|
701
|
+
}
|
|
702
|
+
return Object.keys(picked).length ? { options: picked } : void 0;
|
|
703
|
+
}
|
|
704
|
+
|
|
580
705
|
// ../../stdlib/wix-sdk/stores-v1/src/extensions.ts
|
|
581
706
|
function queryProducts(req = {}) {
|
|
582
707
|
return readWithCatalogFallback(async (v) => {
|
|
@@ -685,21 +810,28 @@ export {
|
|
|
685
810
|
WIX_DETAIL_IMAGE,
|
|
686
811
|
WIX_LIST_IMAGE,
|
|
687
812
|
addProductMedia,
|
|
813
|
+
cartOptionsPayload,
|
|
688
814
|
createProduct,
|
|
815
|
+
defaultChoice,
|
|
816
|
+
defaultSelection,
|
|
689
817
|
deleteProduct,
|
|
690
818
|
forgetCatalogVersion2 as forgetCatalogVersion,
|
|
691
819
|
getProduct,
|
|
692
820
|
getStoreProduct,
|
|
821
|
+
isSelectionComplete,
|
|
693
822
|
isUnsizedWixMedia,
|
|
694
823
|
mediaSlotUrl,
|
|
695
824
|
plainText,
|
|
696
825
|
productGallery,
|
|
697
826
|
productImage,
|
|
827
|
+
productOptions,
|
|
698
828
|
productPrice,
|
|
699
829
|
queryInventory,
|
|
700
830
|
queryProducts,
|
|
701
831
|
queryStoreProducts,
|
|
832
|
+
resolveVariantId,
|
|
702
833
|
searchStoreProducts,
|
|
834
|
+
selectionSummary,
|
|
703
835
|
updateInventory,
|
|
704
836
|
updateProduct,
|
|
705
837
|
wixCall,
|
package/dist/cli.mjs
CHANGED
|
@@ -24584,6 +24584,7 @@ function shouldRevealError(args) {
|
|
|
24584
24584
|
var EMAIL_RE, URL_HOST_RE, INTEGER_RE, NUMBER_RE;
|
|
24585
24585
|
var init_validation = __esm({
|
|
24586
24586
|
"../../core/ts/src/validation.ts"() {
|
|
24587
|
+
"use strict";
|
|
24587
24588
|
EMAIL_RE = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.[A-Za-z]{2,}$/;
|
|
24588
24589
|
URL_HOST_RE = /^[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*(:[0-9]+)?$/;
|
|
24589
24590
|
INTEGER_RE = /^[+-]?[0-9]+$/;
|
|
@@ -28204,6 +28205,7 @@ function validateWorkerSubtree(raw, slotId, policy, actionCatalog) {
|
|
|
28204
28205
|
var WORKER_SUBTREE_CEILINGS, ID_PART, ACTION_ID;
|
|
28205
28206
|
var init_worker_subtree = __esm({
|
|
28206
28207
|
"../../core/ts/src/worker-subtree.ts"() {
|
|
28208
|
+
"use strict";
|
|
28207
28209
|
init_worker_subtree_safe_types_generated();
|
|
28208
28210
|
WORKER_SUBTREE_CEILINGS = Object.freeze({
|
|
28209
28211
|
maxEncodedBytes: 65536,
|
|
@@ -55228,10 +55230,41 @@ function assetBytes(asset) {
|
|
|
55228
55230
|
`preview asset (${asset.contentType}) has neither bytes nor base64 \u2014 exactly one must be set by the producer`
|
|
55229
55231
|
);
|
|
55230
55232
|
}
|
|
55231
|
-
function bytes(asset, cacheControl) {
|
|
55233
|
+
function bytes(asset, cacheControl, cors = false) {
|
|
55232
55234
|
return new Response(assetBytes(asset), {
|
|
55233
55235
|
status: 200,
|
|
55234
|
-
headers: {
|
|
55236
|
+
headers: {
|
|
55237
|
+
"content-type": asset.contentType,
|
|
55238
|
+
"cache-control": cacheControl,
|
|
55239
|
+
// #3425 — an EMBEDDED boot loads the bundle and its fonts from another origin: a module
|
|
55240
|
+
// script and an @font-face are always fetched in CORS mode. Public, content-addressed (or
|
|
55241
|
+
// shell) bytes with no credential attached, so `*` — never a reflected origin, never
|
|
55242
|
+
// Allow-Credentials.
|
|
55243
|
+
...cors ? { "access-control-allow-origin": "*" } : {}
|
|
55244
|
+
}
|
|
55245
|
+
});
|
|
55246
|
+
}
|
|
55247
|
+
function embedManifest(assets) {
|
|
55248
|
+
const index = assets.get("index.html");
|
|
55249
|
+
if (!index) {
|
|
55250
|
+
return new Response(JSON.stringify({ error: "preview_not_built" }), {
|
|
55251
|
+
status: 503,
|
|
55252
|
+
headers: { "content-type": "application/json; charset=utf-8", "access-control-allow-origin": "*" }
|
|
55253
|
+
});
|
|
55254
|
+
}
|
|
55255
|
+
const html = new TextDecoder().decode(assetBytes(index)).replace(/(=|url\()(["']?)\/preview\//g, "$1$2");
|
|
55256
|
+
const attr = (tag, name) => tag.match(new RegExp(`\\s${name}=["']([^"']+)["']`, "i"))?.[1];
|
|
55257
|
+
const script = [...html.matchAll(/<script\b[^>]*>/gi)].map((m) => m[0]).filter((t) => /type=["']module["']/i.test(t)).map((t) => attr(t, "src")).find(Boolean);
|
|
55258
|
+
const styles = [...html.matchAll(/<link\b[^>]*>/gi)].map((m) => m[0]).filter((t) => /rel=["']stylesheet["']/i.test(t)).map((t) => attr(t, "href")).filter((h) => !!h);
|
|
55259
|
+
const css = [...html.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)].map((m) => m[1]).join("\n");
|
|
55260
|
+
return new Response(JSON.stringify({ v: 1, base: "preview/", script: script ?? null, styles, css, frame: "t5-frame.html" }), {
|
|
55261
|
+
status: 200,
|
|
55262
|
+
headers: {
|
|
55263
|
+
"content-type": "application/json; charset=utf-8",
|
|
55264
|
+
// It changes on every artifact deploy (new hashed entry), so it is never cached as immutable.
|
|
55265
|
+
"cache-control": "no-cache",
|
|
55266
|
+
"access-control-allow-origin": "*"
|
|
55267
|
+
}
|
|
55235
55268
|
});
|
|
55236
55269
|
}
|
|
55237
55270
|
function scriptNonce() {
|
|
@@ -55289,6 +55322,7 @@ function indexHtml(asset, pathname, creds, handoverAttempted = false) {
|
|
|
55289
55322
|
}
|
|
55290
55323
|
function previewResponse(pathname, assets, mount = "/preview", creds, handoverAttempted = false) {
|
|
55291
55324
|
const key2 = pathname.replace(MOUNT_STRIP[mount], "") || "index.html";
|
|
55325
|
+
if (key2 === "embed.json") return embedManifest(assets);
|
|
55292
55326
|
const hit = assets.get(key2);
|
|
55293
55327
|
if (hit) {
|
|
55294
55328
|
if (key2 === "index.html") return indexHtml(hit, pathname, creds, handoverAttempted);
|
|
@@ -55305,8 +55339,8 @@ function previewResponse(pathname, assets, mount = "/preview", creds, handoverAt
|
|
|
55305
55339
|
});
|
|
55306
55340
|
}
|
|
55307
55341
|
const immutable = key2.startsWith("assets/");
|
|
55308
|
-
if (key2.startsWith("fonts/")) return bytes(hit, "public, max-age=86400, stale-while-revalidate=604800");
|
|
55309
|
-
return bytes(hit, immutable ? "public, max-age=31536000, immutable" : "no-cache");
|
|
55342
|
+
if (key2.startsWith("fonts/")) return bytes(hit, "public, max-age=86400, stale-while-revalidate=604800", true);
|
|
55343
|
+
return bytes(hit, immutable ? "public, max-age=31536000, immutable" : "no-cache", immutable);
|
|
55310
55344
|
}
|
|
55311
55345
|
if (key2.startsWith("assets/") || key2.startsWith("__himi/")) {
|
|
55312
55346
|
return new Response(JSON.stringify({ error: "preview_asset_not_found", key: key2 }), {
|
|
@@ -55613,21 +55647,21 @@ var init_preview_assets_generated = __esm({
|
|
|
55613
55647
|
"../../packages/serve/src/preview-assets.generated.ts"() {
|
|
55614
55648
|
init_preview_assets_format();
|
|
55615
55649
|
PREVIEW_ASSET_MANIFEST = [
|
|
55616
|
-
{ key: "assets/index-
|
|
55617
|
-
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset:
|
|
55618
|
-
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset:
|
|
55619
|
-
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset:
|
|
55620
|
-
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
55621
|
-
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset:
|
|
55622
|
-
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset:
|
|
55623
|
-
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
55624
|
-
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset:
|
|
55625
|
-
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset:
|
|
55626
|
-
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset:
|
|
55627
|
-
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset:
|
|
55628
|
-
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset:
|
|
55629
|
-
{ key: "index.html", contentType: "text/html; charset=utf-8", offset:
|
|
55630
|
-
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset:
|
|
55650
|
+
{ key: "assets/index-CkJJIVgC.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1086565, sha256: "23abe36ec66a0951f04e69988f44efc2bebcf316b5e62c106b189b3c98c43833" },
|
|
55651
|
+
{ key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 1086573, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
|
|
55652
|
+
{ key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 1091183, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
|
|
55653
|
+
{ key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 1579767, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
|
|
55654
|
+
{ key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 1670691, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
|
|
55655
|
+
{ key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 1761675, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
|
|
55656
|
+
{ key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 1852655, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
|
|
55657
|
+
{ key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 1943527, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
|
|
55658
|
+
{ key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 2034507, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
|
|
55659
|
+
{ key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 2143143, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
|
|
55660
|
+
{ key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 2252227, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
|
|
55661
|
+
{ key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 2361275, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
|
|
55662
|
+
{ key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 2468975, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
|
|
55663
|
+
{ key: "index.html", contentType: "text/html; charset=utf-8", offset: 2557083, length: 4947, sha256: "000fae927c619a62d02eac8479271fdfbe65747b09affafd58490063eaaf614a" },
|
|
55664
|
+
{ key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 2562030, length: 17209, sha256: "dffc9718e2faa63ae2cc919e0a842f585ed565aaaa7c53778e90379442c731b6" }
|
|
55631
55665
|
];
|
|
55632
55666
|
}
|
|
55633
55667
|
});
|
|
Binary file
|
|
@@ -21651,7 +21651,7 @@
|
|
|
21651
21651
|
"name": "StoreProduct",
|
|
21652
21652
|
"kind": "interface",
|
|
21653
21653
|
"jsdoc": "",
|
|
21654
|
-
"decl": "export interface StoreProduct {\n id?: string;\n name?: string;\n slug?: string;\n description?: string;\n plainDescription?: string;\n /** Both gallery layouts: V1 `mainMedia`/`items`, V3 `main`/`itemsInfo.items`. */\n media?: {\n mainMedia?: WixMediaSlot;\n main?: WixMediaSlot;\n items?: WixMediaSlot[];\n itemsInfo?: { items?: WixMediaSlot[] };\n };\n price?: { formatted?: { price?: string }; price?: number; currency?: string };\n priceData?: { formatted?: { price?: string }; price?: number; currency?: string };\n currency?: string;\n actualPriceRange?: {\n minValue?: { amount?: string; formattedAmount?: string; currency?: string };\n maxValue?: { amount?: string; formattedAmount?: string; currency?: string };\n };\n}"
|
|
21654
|
+
"decl": "export interface StoreProduct {\n id?: string;\n name?: string;\n slug?: string;\n description?: string;\n plainDescription?: string;\n /** Both gallery layouts: V1 `mainMedia`/`items`, V3 `main`/`itemsInfo.items`. */\n media?: {\n mainMedia?: WixMediaSlot;\n main?: WixMediaSlot;\n items?: WixMediaSlot[];\n itemsInfo?: { items?: WixMediaSlot[] };\n };\n price?: { formatted?: { price?: string }; price?: number; currency?: string };\n priceData?: { formatted?: { price?: string }; price?: number; currency?: string };\n currency?: string;\n actualPriceRange?: {\n minValue?: { amount?: string; formattedAmount?: string; currency?: string };\n maxValue?: { amount?: string; formattedAmount?: string; currency?: string };\n };\n /** Option groups, both spellings: V1 `productOptions`, V3 `options`. Declared\n * because the wire carries them on BOTH catalogs and this type denying them is\n * what let every template product screen drop the colour/size picker. Shapes\n * differ per catalog, so read them with `productOptions()` from ./options. */\n productOptions?: unknown[];\n options?: unknown[];\n /** V3 purchasable variants. The cart addresses a V3 option choice by `variantId`,\n * which `cartOptionsPayload()` resolves out of this. */\n variantsInfo?: { variants?: unknown[] };\n}"
|
|
21655
21655
|
},
|
|
21656
21656
|
{
|
|
21657
21657
|
"name": "StoreProductsResponse",
|
|
@@ -21696,6 +21696,66 @@
|
|
|
21696
21696
|
"jsdoc": "",
|
|
21697
21697
|
"decl": "export function plainText(value?: string): string;"
|
|
21698
21698
|
},
|
|
21699
|
+
{
|
|
21700
|
+
"name": "StoreOptionChoice",
|
|
21701
|
+
"kind": "interface",
|
|
21702
|
+
"jsdoc": "/** One selectable choice inside an option group. */",
|
|
21703
|
+
"decl": "export interface StoreOptionChoice {\n /** Stable id within the group. V3: the `choiceId`. V1: the choice's own label,\n * which is what V1 has and what its cart payload carries. */\n id: string;\n /** What the shopper reads on the chip — \"BEIGE\", \"M\". */\n label: string;\n /** Is at least one variant carrying this choice in stock? */\n inStock: boolean;\n /** HEX swatch the site configured for this choice (\"#e1bfc5\"), or \"\" — a colour\n * group carries one, a size group does not. */\n colorCode: string;\n /** Choice-linked image, sized, or \"\" when the choice has none. */\n image: string;\n}"
|
|
21704
|
+
},
|
|
21705
|
+
{
|
|
21706
|
+
"name": "StoreOption",
|
|
21707
|
+
"kind": "interface",
|
|
21708
|
+
"jsdoc": "/** One option group, e.g. `COLOR` with `BEIGE` / `PINK`. */",
|
|
21709
|
+
"decl": "export interface StoreOption {\n /** V3: the option id, used to resolve the variant. V1: the option name. */\n id: string;\n name: string;\n /** `color` groups are the ones worth rendering as swatches — the choices carry\n * a `colorCode`. Everything else is a list of words. */\n kind: \"color\" | \"list\";\n choices: StoreOptionChoice[];\n}"
|
|
21710
|
+
},
|
|
21711
|
+
{
|
|
21712
|
+
"name": "StoreOptionSelection",
|
|
21713
|
+
"kind": "type",
|
|
21714
|
+
"jsdoc": "/** The shopper's pick: option id → choice id. A group the shopper has not chosen\n * yet is absent (or maps to \"\"). */",
|
|
21715
|
+
"decl": "export type StoreOptionSelection = Record<string, string>;"
|
|
21716
|
+
},
|
|
21717
|
+
{
|
|
21718
|
+
"name": "productOptions",
|
|
21719
|
+
"kind": "function",
|
|
21720
|
+
"jsdoc": "/**\n * Every offerable option group on a product, in site order, from either catalog.\n *\n * `[]` for a product with no options — the common case, so a caller must render\n * nothing rather than an empty picker.\n *\n * `size` sizes the per-choice swatch image, like `productImage`; pass `null` for\n * the stored original.\n */",
|
|
21721
|
+
"decl": "export function productOptions(\n product: StoreProduct | undefined,\n size: WixImageSize | null = WIX_LIST_IMAGE,\n): StoreOption[];"
|
|
21722
|
+
},
|
|
21723
|
+
{
|
|
21724
|
+
"name": "defaultChoice",
|
|
21725
|
+
"kind": "function",
|
|
21726
|
+
"jsdoc": "/** The choice to preselect for a group: the only one when there is exactly one,\n * otherwise \"\" so the shopper picks deliberately. */",
|
|
21727
|
+
"decl": "export function defaultChoice(option: StoreOption): string;"
|
|
21728
|
+
},
|
|
21729
|
+
{
|
|
21730
|
+
"name": "defaultSelection",
|
|
21731
|
+
"kind": "function",
|
|
21732
|
+
"jsdoc": "/** A selection with every single-choice group pre-filled — what a product screen\n * starts from. */",
|
|
21733
|
+
"decl": "export function defaultSelection(options: StoreOption[]): StoreOptionSelection;"
|
|
21734
|
+
},
|
|
21735
|
+
{
|
|
21736
|
+
"name": "isSelectionComplete",
|
|
21737
|
+
"kind": "function",
|
|
21738
|
+
"jsdoc": "/** Has the shopper chosen in EVERY group? Add to cart stays disabled until this\n * is true — a half-chosen product is the unfulfillable order. */",
|
|
21739
|
+
"decl": "export function isSelectionComplete(options: StoreOption[], selection: StoreOptionSelection): boolean;"
|
|
21740
|
+
},
|
|
21741
|
+
{
|
|
21742
|
+
"name": "selectionSummary",
|
|
21743
|
+
"kind": "function",
|
|
21744
|
+
"jsdoc": "/** Human summary of the current selection, e.g. \"BEIGE · M\" (\"\" when nothing is\n * chosen). Labels, not ids — this is shopper-facing text. */",
|
|
21745
|
+
"decl": "export function selectionSummary(options: StoreOption[], selection: StoreOptionSelection): string;"
|
|
21746
|
+
},
|
|
21747
|
+
{
|
|
21748
|
+
"name": "resolveVariantId",
|
|
21749
|
+
"kind": "function",
|
|
21750
|
+
"jsdoc": "/**\n * The V3 variant matching the shopper's choices, or \"\" when none does.\n *\n * Set equality on `{optionId, choiceId}` pairs, not order — V3 does not promise\n * the variant's `choices` array is in the product's option order, and a positional\n * compare passes on a two-option product until the day the site reorders it.\n */",
|
|
21751
|
+
"decl": "export function resolveVariantId(product: StoreProduct | undefined, selection: StoreOptionSelection): string;"
|
|
21752
|
+
},
|
|
21753
|
+
{
|
|
21754
|
+
"name": "cartOptionsPayload",
|
|
21755
|
+
"kind": "function",
|
|
21756
|
+
"jsdoc": "/**\n * The `catalogReference.options` value for `addToCurrentCart`, built for whichever\n * catalog this product came from — V3 `{ variantId }`, V1 `{ options: {…} }`.\n *\n * `undefined` for a product with no options at all, which is what the cart wants\n * (the line needs no `options` object).\n *\n * THROWS on V3 when the selection matches no variant, rather than returning a\n * payload that adds an un-fulfillable line. The two ways to get here are a\n * selection that is still incomplete (guard with `isSelectionComplete`) and a read\n * whose `variantsInfo` did not come back — both are the caller's to fix, and both\n * are invisible if this returns a plausible-looking payload instead.\n */",
|
|
21757
|
+
"decl": "export function cartOptionsPayload(\n product: StoreProduct | undefined,\n options: StoreOption[],\n selection: StoreOptionSelection,\n): Record<string, unknown> | undefined;"
|
|
21758
|
+
},
|
|
21699
21759
|
{
|
|
21700
21760
|
"name": "forgetCatalogVersion",
|
|
21701
21761
|
"kind": "function",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1097.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"artifactId": "himalaya-cli"
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
|
-
"falconPackageHash": "
|
|
70
|
+
"falconPackageHash": "a14970a4ab0b5e14659e9a75dc3d4ddbcaa2a0955fc287caf553d82c"
|
|
71
71
|
}
|