@wix/himalaya-cli 0.1172.0 → 0.1174.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 (68) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/extensions.d.ts +13 -3
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/products-v3.d.ts +13 -1
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores.mjs +10 -3
  4. package/dist/cli.mjs +38 -16
  5. package/dist/preview-assets.generated.bin +0 -0
  6. package/guides/sdk-reference.json +15 -3
  7. package/package.json +2 -2
  8. package/templates/beauty-salon-owner/dev/index.ts +172 -6
  9. package/templates/beauty-salon-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  10. package/templates/beauty-salon-owner/tier5-src/_shared/owner-rich-guard.ts +1 -9
  11. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  12. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-product-form/index.ts +130 -27
  13. package/templates/community-club-owner/dev/index.ts +257 -8
  14. package/templates/community-club-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  15. package/templates/community-club-owner/tier5-src/_shared/owner-rich-guard.ts +1 -9
  16. package/templates/community-club-owner/tier5-src/himi-owner-lite-event-form/index.ts +117 -51
  17. package/templates/community-club-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  18. package/templates/community-club-owner/tier5-src/himi-owner-lite-product-form/index.ts +130 -27
  19. package/templates/events-meetups-owner/dev/index.ts +87 -4
  20. package/templates/events-meetups-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  21. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-event-form/index.ts +117 -51
  22. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  23. package/templates/gym-fitness-owner/dev/index.ts +257 -8
  24. package/templates/gym-fitness-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  25. package/templates/gym-fitness-owner/tier5-src/_shared/owner-rich-guard.ts +1 -9
  26. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-event-form/index.ts +117 -51
  27. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  28. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-product-form/index.ts +130 -27
  29. package/templates/nonprofit-cause-owner/dev/index.ts +87 -4
  30. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  31. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-event-form/index.ts +117 -51
  32. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  33. package/templates/owner-lite/dev/index.ts +512 -17
  34. package/templates/owner-lite/tier5-src/_shared/owner-editor-value.ts +71 -5
  35. package/templates/owner-lite/tier5-src/_shared/owner-rich-guard.ts +1 -9
  36. package/templates/owner-lite/tier5-src/himi-owner-lite-event-form/index.ts +117 -51
  37. package/templates/owner-lite/tier5-src/himi-owner-lite-faq-question-form/index.ts +77 -10
  38. package/templates/owner-lite/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  39. package/templates/owner-lite/tier5-src/himi-owner-lite-product-form/index.ts +130 -27
  40. package/templates/podcast-creator-owner/dev/index.ts +257 -8
  41. package/templates/podcast-creator-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  42. package/templates/podcast-creator-owner/tier5-src/_shared/owner-rich-guard.ts +1 -9
  43. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-event-form/index.ts +117 -51
  44. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  45. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-product-form/index.ts +130 -27
  46. package/templates/portfolio-creative-owner/dev/index.ts +172 -6
  47. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  48. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-rich-guard.ts +1 -9
  49. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  50. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-product-form/index.ts +130 -27
  51. package/templates/restaurant-owner/dev/index.ts +257 -8
  52. package/templates/restaurant-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  53. package/templates/restaurant-owner/tier5-src/_shared/owner-rich-guard.ts +1 -9
  54. package/templates/restaurant-owner/tier5-src/himi-owner-lite-event-form/index.ts +117 -51
  55. package/templates/restaurant-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  56. package/templates/restaurant-owner/tier5-src/himi-owner-lite-product-form/index.ts +130 -27
  57. package/templates/retail-store-owner/dev/index.ts +172 -6
  58. package/templates/retail-store-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  59. package/templates/retail-store-owner/tier5-src/_shared/owner-rich-guard.ts +1 -9
  60. package/templates/retail-store-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  61. package/templates/retail-store-owner/tier5-src/himi-owner-lite-product-form/index.ts +130 -27
  62. package/templates/yoga-studio-owner/dev/index.ts +87 -4
  63. package/templates/yoga-studio-owner/tier5-src/_shared/owner-editor-value.ts +71 -5
  64. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-event-form/index.ts +117 -51
  65. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-post-form/index.ts +17 -42
  66. package/templates/events-meetups-owner/tier5-src/_shared/owner-rich-guard.ts +0 -35
  67. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-rich-guard.ts +0 -35
  68. package/templates/yoga-studio-owner/tier5-src/_shared/owner-rich-guard.ts +0 -35
@@ -1,18 +1,28 @@
1
1
  import type { WixProductWrite, WixCreateProductResponse, WixUpdateProductResponse, WixDeleteProductResponse } from "./index.js";
2
2
  import type { WixQueryProductsRequest, WixQueryProductsResponse, WixGetProductResponse } from "./index.js";
3
+ import { type V3RichContent } from "./products-v3.js";
4
+ /** [rico] #3373 — the Catalog-V3 Ricos description. */
5
+ export type WixProductRichContent = V3RichContent;
6
+ export type WixProductRichWrite = WixProductWrite & {
7
+ richDescription?: WixProductRichContent;
8
+ };
3
9
  /** Query products from whichever catalog this site runs. The V1 request shape
4
10
  * (`{query:{paging:{limit,offset}}}`) is the SDK's contract; the V3 arm maps it
5
11
  * onto cursor paging and reshapes each product back to the V1 layout. */
6
12
  export declare function queryProducts(req?: WixQueryProductsRequest): Promise<WixQueryProductsResponse>;
7
- /** Read one product from whichever catalog this site runs. */
8
- export declare function getProduct(productId: string): Promise<WixGetProductResponse>;
13
+ /** Read one product from whichever catalog this site runs. `opts.richDescription` (Catalog V3) also asks
14
+ * for the Ricos `description` and returns it as `product.richDescription` (null when the product has
15
+ * none). The key is ABSENT on a V1 catalog, which has no Ricos description, and without the option. */
16
+ export declare function getProduct(productId: string, opts?: {
17
+ richDescription?: boolean;
18
+ }): Promise<WixGetProductResponse>;
9
19
  /** Create a product. V1: `POST /stores/v1/products`. V3: `POST /stores/v3/products`
10
20
  * with the write model mapped onto V3's variants shape (see products-v3.ts). */
11
21
  export declare function createProduct(product: WixProductWrite): Promise<WixCreateProductResponse>;
12
22
  /** Update a product. V1: a plain `PATCH` of the supplied fields. V3: requires the
13
23
  * CURRENT `revision`, and rewrites the whole variants array when the patch reaches
14
24
  * a variant-level field (price/sku) — so that arm reads the product first. */
15
- export declare function updateProduct(productId: string, product: WixProductWrite): Promise<WixUpdateProductResponse>;
25
+ export declare function updateProduct(productId: string, product: WixProductRichWrite): Promise<WixUpdateProductResponse>;
16
26
  /** Delete a product — `DELETE /stores/v{1,3}/products/{id}`; same shape either way. */
17
27
  export declare function deleteProduct(productId: string): Promise<WixDeleteProductResponse>;
18
28
  export interface WixInventoryVariant {
@@ -12,6 +12,13 @@ export interface V3Variant {
12
12
  };
13
13
  choices?: unknown[];
14
14
  }
15
+ /** [rico] #3373 — Catalog V3's Ricos `description`. `plainDescription` is the SAME field rendered as HTML:
16
+ * V3 derives one from the other, so a write sends only `description`. */
17
+ export interface V3RichContent {
18
+ nodes?: unknown[];
19
+ metadata?: unknown;
20
+ documentStyle?: unknown;
21
+ }
15
22
  export interface V3Product {
16
23
  id?: string;
17
24
  revision?: string;
@@ -20,6 +27,7 @@ export interface V3Product {
20
27
  productType?: string;
21
28
  physicalProperties?: Record<string, unknown>;
22
29
  plainDescription?: string;
30
+ description?: V3RichContent;
23
31
  visible?: boolean;
24
32
  variantsInfo?: {
25
33
  variants?: V3Variant[];
@@ -43,6 +51,8 @@ export declare const V3_WRITE_FIELDS: readonly ["CURRENCY", "PLAIN_DESCRIPTION"]
43
51
  * `"MEDIA_ITEMS_INFO"` to the `fields` array.
44
52
  */
45
53
  export declare const V3_READ_FIELDS: readonly ["CURRENCY", "URL", "PLAIN_DESCRIPTION", "MEDIA_ITEMS_INFO"];
54
+ /** A single-product read that also carries the Ricos `description` (an owner product form). */
55
+ export declare const V3_DETAIL_READ_FIELDS: readonly ["CURRENCY", "URL", "PLAIN_DESCRIPTION", "MEDIA_ITEMS_INFO", "DESCRIPTION"];
46
56
  /** Most a single V3 products query will return. Bounds the offset emulation in
47
57
  * `queryProducts` (V3 pages by cursor; the SDK's callers page by offset). */
48
58
  export declare const V3_MAX_QUERY_LIMIT = 100;
@@ -123,4 +133,6 @@ export declare function touchesVariant(p: WixProductWrite): boolean;
123
133
  * delete the others), and `options` must ride along because variants and options
124
134
  * are mutually dependent.
125
135
  */
126
- export declare function toV3Update(productId: string, patch: WixProductWrite, current: V3Product): V3Product;
136
+ export declare function toV3Update(productId: string, patch: WixProductWrite & {
137
+ richDescription?: V3RichContent;
138
+ }, current: V3Product): V3Product;
@@ -134,6 +134,7 @@ async function resolveCatalogVersion() {
134
134
  // ../../stdlib/wix-sdk/stores-v1/src/products-v3.ts
135
135
  var V3_WRITE_FIELDS = ["CURRENCY", "PLAIN_DESCRIPTION"];
136
136
  var V3_READ_FIELDS = ["CURRENCY", "URL", "PLAIN_DESCRIPTION", "MEDIA_ITEMS_INFO"];
137
+ var V3_DETAIL_READ_FIELDS = [...V3_READ_FIELDS, "DESCRIPTION"];
137
138
  var V3_MAX_QUERY_LIMIT = 100;
138
139
  var V3_VARIANT_READ_FIELDS = ["VARIANT_OPTION_CHOICE_NAMES", "CURRENCY"];
139
140
  function toV3ProductType(productType) {
@@ -193,9 +194,11 @@ function touchesVariant(p) {
193
194
  return p.priceData?.price !== void 0 || p.sku !== void 0;
194
195
  }
195
196
  function toV3Update(productId, patch, current) {
197
+ if (patch.description !== void 0 && patch.richDescription !== void 0) throw new Error("updateProduct: send description OR richDescription, not both (Catalog V3 derives one from the other)");
196
198
  const out = { id: productId, revision: current.revision };
197
199
  if (patch.name !== void 0) out.name = patch.name;
198
200
  if (patch.description !== void 0) out.plainDescription = patch.description;
201
+ if (patch.richDescription !== void 0) out.description = patch.richDescription;
199
202
  if (patch.visible !== void 0) out.visible = patch.visible;
200
203
  if (touchesVariant(patch)) {
201
204
  const existing = current.variantsInfo?.variants ?? [];
@@ -724,16 +727,19 @@ function queryProducts(req = {}) {
724
727
  return { products: page.map(fromV3Product) };
725
728
  });
726
729
  }
727
- function getProduct(productId) {
730
+ function getProduct(productId, opts = {}) {
728
731
  if (!productId) throw new Error("getProduct: productId is required");
729
732
  const id = encodeURIComponent(productId);
733
+ const fields = opts.richDescription ? V3_DETAIL_READ_FIELDS : V3_READ_FIELDS;
730
734
  return readWithCatalogFallback(async (v) => {
731
735
  if (v === "v1") return wixCall("GET", `/stores/v1/products/${id}`);
732
736
  const res = await wixCall(
733
737
  "GET",
734
- `/stores/v3/products/${id}?${V3_READ_FIELDS.map((f) => `fields=${f}`).join("&")}`
738
+ `/stores/v3/products/${id}?${fields.map((f) => `fields=${f}`).join("&")}`
735
739
  );
736
- return { product: res.product ? fromV3Product(res.product) : void 0 };
740
+ if (!res.product) return { product: void 0 };
741
+ const product = fromV3Product(res.product);
742
+ return { product: opts.richDescription ? { ...product, richDescription: res.product.description ?? null } : product };
737
743
  });
738
744
  }
739
745
  async function createProduct(product) {
@@ -747,6 +753,7 @@ async function createProduct(product) {
747
753
  }
748
754
  async function updateProduct(productId, product) {
749
755
  if (await resolveCatalogVersion() === "v1") {
756
+ if (product.richDescription !== void 0) throw new Error("updateProduct: richDescription is Catalog V3 only (a V1 description is HTML)");
750
757
  return wixCall("PATCH", `/stores/v1/products/${productId}`, { product });
751
758
  }
752
759
  const current = await wixCall(
package/dist/cli.mjs CHANGED
@@ -6834,6 +6834,7 @@ function resolveTranslation(value, catalog, sourceCatalog) {
6834
6834
  var BINDING_SIGILS, BINDING_SIGIL_RE, TRANSLATION_PREFIX, TRANSLATION_KEY_RE;
6835
6835
  var init_bindings = __esm({
6836
6836
  "../../core/ts/src/bindings.ts"() {
6837
+ "use strict";
6837
6838
  BINDING_SIGILS = ["service", "flag", "item", "t"];
6838
6839
  BINDING_SIGIL_RE = new RegExp(
6839
6840
  `^\\$(?:${BINDING_SIGILS.filter((s) => s !== "t").join("|")})\\b|^\\$t:`
@@ -30828,6 +30829,7 @@ function hasContributed(bag, fieldId) {
30828
30829
  }
30829
30830
  function createFormBag() {
30830
30831
  const subs = /* @__PURE__ */ new Set();
30832
+ const preSubmit = /* @__PURE__ */ new Set();
30831
30833
  const notify = () => {
30832
30834
  bag.version++;
30833
30835
  for (const cb of subs) cb();
@@ -30878,6 +30880,15 @@ function createFormBag() {
30878
30880
  return () => {
30879
30881
  subs.delete(cb);
30880
30882
  };
30883
+ },
30884
+ onBeforeSubmit(cb) {
30885
+ preSubmit.add(cb);
30886
+ return () => {
30887
+ preSubmit.delete(cb);
30888
+ };
30889
+ },
30890
+ beforeSubmit() {
30891
+ for (const cb of Array.from(preSubmit)) cb();
30881
30892
  }
30882
30893
  };
30883
30894
  return bag;
@@ -31368,6 +31379,12 @@ function createRicosHostSession(o) {
31368
31379
  o.send({ v: 1, type: "requestContent", requestId: requestId2 });
31369
31380
  });
31370
31381
  },
31382
+ flushOnChange() {
31383
+ if (dirtyTimer === null || disposed || state.unavailable) return;
31384
+ t.clearTimeout(dirtyTimer);
31385
+ dirtyTimer = null;
31386
+ o.onDirty();
31387
+ },
31371
31388
  focus() {
31372
31389
  if (state.ready) o.send({ v: 1, type: "focus" });
31373
31390
  },
@@ -31633,7 +31650,11 @@ function RichContentEditorView({ props, ctx, wrap, nodeId, renderChild, ...dom }
31633
31650
  bag.register(name, void 0);
31634
31651
  const current = sessionRef.current?.currentContent();
31635
31652
  if (current != null) bag.set(name, current);
31636
- return () => bag.unregister(name);
31653
+ const off = bag.onBeforeSubmit(() => sessionRef.current?.flushOnChange());
31654
+ return () => {
31655
+ off();
31656
+ bag.unregister(name);
31657
+ };
31637
31658
  }, [bag, name]);
31638
31659
  const fireOnChange = () => {
31639
31660
  const act = onChangeRef.current;
@@ -36093,6 +36114,7 @@ var init_renderNode = __esm({
36093
36114
  bag.markSubmitAttempted();
36094
36115
  return;
36095
36116
  }
36117
+ bag.beforeSubmit();
36096
36118
  const merged = { ...action?.args ?? {}, ...bag.values };
36097
36119
  ctx.onAction?.({ ...action, args: merged });
36098
36120
  }
@@ -60242,21 +60264,21 @@ var init_preview_assets_generated = __esm({
60242
60264
  "../../packages/serve/src/preview-assets.generated.ts"() {
60243
60265
  init_preview_assets_format();
60244
60266
  PREVIEW_ASSET_MANIFEST = [
60245
- { key: "assets/index-B1fE1B9T.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1131811, sha256: "ead747f6e5d3d289965dc0d3486f678d999616cec487643300b3103983bc9462" },
60246
- { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 1131819, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
60247
- { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 1136429, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
60248
- { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 1625013, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
60249
- { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 1715937, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
60250
- { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 1806921, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
60251
- { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 1897901, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
60252
- { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 1988773, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
60253
- { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 2079753, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
60254
- { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 2188389, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
60255
- { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 2297473, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
60256
- { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 2406521, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
60257
- { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 2514221, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
60258
- { key: "index.html", contentType: "text/html; charset=utf-8", offset: 2602329, length: 4947, sha256: "4c3de9771721e41385e297f5e97c0ecd9a76e557a3584d3e6e7820e4bc615c96" },
60259
- { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 2607276, length: 17344, sha256: "d057298d75e7373e5e2c4d11b7d1bcbea88e03af555ba63d97641c78509c58e4" }
60267
+ { key: "assets/index-Ctt1n3e8.js", contentType: "application/javascript; charset=utf-8", offset: 8, length: 1132082, sha256: "58a8eb07cd4a6bf0fb735b45cc42f1a2014647bbcc385425be2d867b289fce19" },
60268
+ { key: "fonts/Roboto-LICENSE.txt", contentType: "application/octet-stream", offset: 1132090, length: 4610, sha256: "994062dd7af4186a739de55dd9e151c63b6301f8e2cbafc608d35c2e87da0cd2" },
60269
+ { key: "fonts/Roboto-Variable.ttf", contentType: "font/ttf", offset: 1136700, length: 488584, sha256: "d7598e12c5dbef095ff8272cfc55da0250bd07fbdecbac8a530b9b277872a134" },
60270
+ { key: "fonts/WixMadeforDisplay-Bold.ttf", contentType: "font/ttf", offset: 1625284, length: 90924, sha256: "ec4c7d63772d980d6e147b2df6215fd2737e4b04cebe0cf7e11dc695fb63cdcf" },
60271
+ { key: "fonts/WixMadeforDisplay-ExtraBold.ttf", contentType: "font/ttf", offset: 1716208, length: 90984, sha256: "bf4c16a2774edd38a921edf3099469866cd74c094fd596f3fa4e81f54a04dfaa" },
60272
+ { key: "fonts/WixMadeforDisplay-Medium.ttf", contentType: "font/ttf", offset: 1807192, length: 90980, sha256: "368faca44fb9f7207e4af784e94750b1ee59c1098b8689e0f4a918926f244fb5" },
60273
+ { key: "fonts/WixMadeforDisplay-Regular.ttf", contentType: "font/ttf", offset: 1898172, length: 90872, sha256: "97ed8f1a6772abe26e3d8af5cecfc4b02faa94497d585b0398b5053b739a70c1" },
60274
+ { key: "fonts/WixMadeforDisplay-SemiBold.ttf", contentType: "font/ttf", offset: 1989044, length: 90980, sha256: "642feab8a48ddf6c7a89d7c2a7c0edfa0e6e773f671287e460e222703563191e" },
60275
+ { key: "fonts/WixMadeforText-Bold.ttf", contentType: "font/ttf", offset: 2080024, length: 108636, sha256: "37c179b4fefb63ea9637322b84583a2df53aa226c150294eea1675c14b1b8e29" },
60276
+ { key: "fonts/WixMadeforText-ExtraBold.ttf", contentType: "font/ttf", offset: 2188660, length: 109084, sha256: "62e2fe4718129f36ecdb0ae4de385bd6b81ecc876146447167c6c140fad699a9" },
60277
+ { key: "fonts/WixMadeforText-Medium.ttf", contentType: "font/ttf", offset: 2297744, length: 109048, sha256: "4ecf270136af928612c76fe4ebade91d8156975e5ea4c0cf9225501dd1788e02" },
60278
+ { key: "fonts/WixMadeforText-Regular.ttf", contentType: "font/ttf", offset: 2406792, length: 107700, sha256: "dee56f09fd3efc127c1ea95557edc74110c1460a46287da36e0af25efd341ef5" },
60279
+ { key: "fonts/WixMadeforText-SemiBold.ttf", contentType: "font/ttf", offset: 2514492, length: 88108, sha256: "dced97a77624bc5f8b1ae65850360908297f4588e09feb6f22792d29dc7e765b" },
60280
+ { key: "index.html", contentType: "text/html; charset=utf-8", offset: 2602600, length: 4947, sha256: "35d5f5e7975e3975dd3efac82d1c12f81c6e29fd16fe74247b9ebf881b0e6d31" },
60281
+ { key: "t5-frame.html", contentType: "text/html; charset=utf-8", offset: 2607547, length: 17344, sha256: "d057298d75e7373e5e2c4d11b7d1bcbea88e03af555ba63d97641c78509c58e4" }
60260
60282
  ];
60261
60283
  }
60262
60284
  });
Binary file
@@ -22202,6 +22202,18 @@
22202
22202
  "decl": "export function addProductMedia(\n productId: string,\n opts?: WixCallOptions,\n): Promise<WixAddProductMediaResponse>;",
22203
22203
  "http": "POST /stores/v1/products/{…}/media"
22204
22204
  },
22205
+ {
22206
+ "name": "WixProductRichContent",
22207
+ "kind": "type",
22208
+ "jsdoc": "/** [rico] #3373 — the Catalog-V3 Ricos description. */",
22209
+ "decl": "export type WixProductRichContent = V3RichContent;"
22210
+ },
22211
+ {
22212
+ "name": "WixProductRichWrite",
22213
+ "kind": "type",
22214
+ "jsdoc": "",
22215
+ "decl": "export type WixProductRichWrite = WixProductWrite & { richDescription?: WixProductRichContent };"
22216
+ },
22205
22217
  {
22206
22218
  "name": "queryProducts",
22207
22219
  "kind": "function",
@@ -22212,8 +22224,8 @@
22212
22224
  {
22213
22225
  "name": "getProduct",
22214
22226
  "kind": "function",
22215
- "jsdoc": "/** Read one product from whichever catalog this site runs. */",
22216
- "decl": "export function getProduct(productId: string): Promise<WixGetProductResponse>;",
22227
+ "jsdoc": "/** Read one product from whichever catalog this site runs. `opts.richDescription` (Catalog V3) also asks\n * for the Ricos `description` and returns it as `product.richDescription` (null when the product has\n * none). The key is ABSENT on a V1 catalog, which has no Ricos description, and without the option. */",
22228
+ "decl": "export function getProduct(productId: string, opts: { richDescription?: boolean } = {}): Promise<WixGetProductResponse>;",
22217
22229
  "http": "GET /stores/v1/products/{…}"
22218
22230
  },
22219
22231
  {
@@ -22227,7 +22239,7 @@
22227
22239
  "name": "updateProduct",
22228
22240
  "kind": "function",
22229
22241
  "jsdoc": "/** Update a product. V1: a plain `PATCH` of the supplied fields. V3: requires the\n * CURRENT `revision`, and rewrites the whole variants array when the patch reaches\n * a variant-level field (price/sku) — so that arm reads the product first. */",
22230
- "decl": "export async function updateProduct(productId: string, product: WixProductWrite): Promise<WixUpdateProductResponse>;",
22242
+ "decl": "export async function updateProduct(productId: string, product: WixProductRichWrite): Promise<WixUpdateProductResponse>;",
22231
22243
  "http": "PATCH /stores/v1/products/{…}"
22232
22244
  },
22233
22245
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1172.0",
3
+ "version": "0.1174.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": "299f3f3ea1e5e7f326fbe1125c2d75bc08ecd649a548a3078aec094f"
70
+ "falconPackageHash": "67d51a3995755dd7861ad74fab421d09ed2ecd3590c2d5df555e0068"
71
71
  }
@@ -74057,7 +74057,7 @@ const SCREENS = runtimeSetting({
74057
74057
  "package": "himalaya",
74058
74058
  "type": "FormField",
74059
74059
  "props": {
74060
- "id": "description",
74060
+ "id": "descriptionText",
74061
74061
  "label": "Description",
74062
74062
  "kind": "text",
74063
74063
  "text": {
@@ -74070,7 +74070,90 @@ const SCREENS = runtimeSetting({
74070
74070
  }
74071
74071
  },
74072
74072
  "modifiers": {
74073
- "hiddenPath": "$service:himiOwnerLiteProductForm.descriptionProtected"
74073
+ "hiddenPath": "$service:himiOwnerLiteProductForm.descriptionFieldHidden"
74074
+ }
74075
+ },
74076
+ {
74077
+ "id": "product_form.description_slot",
74078
+ "body": {
74079
+ "package": "himalaya",
74080
+ "type": "VStack",
74081
+ "props": {
74082
+ "spacing": 6,
74083
+ "alignment": "leading",
74084
+ "children": [
74085
+ {
74086
+ "id": "",
74087
+ "body": {
74088
+ "package": "himalaya",
74089
+ "type": "Text",
74090
+ "props": {
74091
+ "text": "Description",
74092
+ "style": "bodyEmphasis"
74093
+ }
74094
+ }
74095
+ },
74096
+ {
74097
+ "id": "product_description_editor",
74098
+ "body": {
74099
+ "package": "himalaya",
74100
+ "type": "RichContentEditor",
74101
+ "props": {
74102
+ "name": "description",
74103
+ "documentPath": "$service:himiOwnerLiteProductForm.descriptionJson",
74104
+ "placeholder": "Optional",
74105
+ "uploadService": "himiOwnerLiteProductFormUploads",
74106
+ "onChange": {
74107
+ "actionId": "tier5.himiOwnerLiteProductForm.descriptionChanged"
74108
+ },
74109
+ "minHeight": 200,
74110
+ "fallback": {
74111
+ "id": "product_form.description_unavailable",
74112
+ "body": {
74113
+ "package": "himalaya",
74114
+ "type": "VStack",
74115
+ "props": {
74116
+ "spacing": 4,
74117
+ "alignment": "leading",
74118
+ "children": [
74119
+ {
74120
+ "id": "",
74121
+ "body": {
74122
+ "package": "himalaya",
74123
+ "type": "Text",
74124
+ "props": {
74125
+ "text": "Editor unavailable",
74126
+ "style": "title3"
74127
+ }
74128
+ }
74129
+ },
74130
+ {
74131
+ "id": "",
74132
+ "body": {
74133
+ "package": "himalaya",
74134
+ "type": "Text",
74135
+ "props": {
74136
+ "text": "The description can’t be edited here right now. Name, price and SKU still save, and the description stays as it is.",
74137
+ "style": "footnote",
74138
+ "color": "textSecondary"
74139
+ }
74140
+ }
74141
+ }
74142
+ ]
74143
+ }
74144
+ }
74145
+ }
74146
+ }
74147
+ },
74148
+ "modifiers": {
74149
+ "hiddenPath": "$service:himiOwnerLiteProductForm.descriptionPending"
74150
+ }
74151
+ }
74152
+ ]
74153
+ }
74154
+ },
74155
+ "modifiers": {
74156
+ "hiddenPath": "$service:himiOwnerLiteProductForm.descriptionEditorHidden"
74074
74157
  }
74075
74158
  }
74076
74159
  ],
@@ -74339,7 +74422,7 @@ const SCREENS = runtimeSetting({
74339
74422
  "onChange": {
74340
74423
  "actionId": "tier5.himiOwnerLitePostForm.bodyChanged"
74341
74424
  },
74342
- "minHeight": 360,
74425
+ "minHeight": 240,
74343
74426
  "fallback": {
74344
74427
  "id": "post_form.body_unavailable",
74345
74428
  "body": {
@@ -74796,7 +74879,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
74796
74879
  "package": "himalaya",
74797
74880
  "type": "FormField",
74798
74881
  "props": {
74799
- "id": "description",
74882
+ "id": "descriptionText",
74800
74883
  "label": "Description",
74801
74884
  "kind": "text",
74802
74885
  "text": {
@@ -74809,7 +74892,90 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
74809
74892
  }
74810
74893
  },
74811
74894
  "modifiers": {
74812
- "hiddenPath": "$service:himiOwnerLiteProductForm.descriptionProtected"
74895
+ "hiddenPath": "$service:himiOwnerLiteProductForm.descriptionFieldHidden"
74896
+ }
74897
+ },
74898
+ {
74899
+ "id": "product_form.description_slot",
74900
+ "body": {
74901
+ "package": "himalaya",
74902
+ "type": "VStack",
74903
+ "props": {
74904
+ "spacing": 6,
74905
+ "alignment": "leading",
74906
+ "children": [
74907
+ {
74908
+ "id": "",
74909
+ "body": {
74910
+ "package": "himalaya",
74911
+ "type": "Text",
74912
+ "props": {
74913
+ "text": "Description",
74914
+ "style": "bodyEmphasis"
74915
+ }
74916
+ }
74917
+ },
74918
+ {
74919
+ "id": "product_description_editor",
74920
+ "body": {
74921
+ "package": "himalaya",
74922
+ "type": "RichContentEditor",
74923
+ "props": {
74924
+ "name": "description",
74925
+ "documentPath": "$service:himiOwnerLiteProductForm.descriptionJson",
74926
+ "placeholder": "Optional",
74927
+ "uploadService": "himiOwnerLiteProductFormUploads",
74928
+ "onChange": {
74929
+ "actionId": "tier5.himiOwnerLiteProductForm.descriptionChanged"
74930
+ },
74931
+ "minHeight": 200,
74932
+ "fallback": {
74933
+ "id": "product_form.description_unavailable",
74934
+ "body": {
74935
+ "package": "himalaya",
74936
+ "type": "VStack",
74937
+ "props": {
74938
+ "spacing": 4,
74939
+ "alignment": "leading",
74940
+ "children": [
74941
+ {
74942
+ "id": "",
74943
+ "body": {
74944
+ "package": "himalaya",
74945
+ "type": "Text",
74946
+ "props": {
74947
+ "text": "Editor unavailable",
74948
+ "style": "title3"
74949
+ }
74950
+ }
74951
+ },
74952
+ {
74953
+ "id": "",
74954
+ "body": {
74955
+ "package": "himalaya",
74956
+ "type": "Text",
74957
+ "props": {
74958
+ "text": "The description can’t be edited here right now. Name, price and SKU still save, and the description stays as it is.",
74959
+ "style": "footnote",
74960
+ "color": "textSecondary"
74961
+ }
74962
+ }
74963
+ }
74964
+ ]
74965
+ }
74966
+ }
74967
+ }
74968
+ }
74969
+ },
74970
+ "modifiers": {
74971
+ "hiddenPath": "$service:himiOwnerLiteProductForm.descriptionPending"
74972
+ }
74973
+ }
74974
+ ]
74975
+ }
74976
+ },
74977
+ "modifiers": {
74978
+ "hiddenPath": "$service:himiOwnerLiteProductForm.descriptionEditorHidden"
74813
74979
  }
74814
74980
  }
74815
74981
  ],
@@ -75324,7 +75490,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
75324
75490
  "onChange": {
75325
75491
  "actionId": "tier5.himiOwnerLitePostForm.bodyChanged"
75326
75492
  },
75327
- "minHeight": 360,
75493
+ "minHeight": 240,
75328
75494
  "fallback": {
75329
75495
  "id": "post_form.body_unavailable",
75330
75496
  "body": {
@@ -8,7 +8,7 @@
8
8
  // drops nodes the owner never touched).
9
9
  // Inside the platform source this import is a relative path, so node test runs resolve it; an app's
10
10
  // copy imports "@himalaya/wix-rich-content".
11
- import { parseRicosJson, RICH_CONTENT_LIMITS, type RicosDocument } from "@himalaya/wix-rich-content";
11
+ import { parseRicosJson, isPlainRicos, RICH_CONTENT_LIMITS, type RicosDocument } from "@himalaya/wix-rich-content";
12
12
 
13
13
  export type EditorValue =
14
14
  | { kind: "absent" } // leave the stored body untouched
@@ -45,12 +45,78 @@ function overLimits(doc: RicosDocument): boolean {
45
45
  return false;
46
46
  }
47
47
 
48
- /** `raw` is `values[name]`; `seededJson` is the string the form published as the editor's seed. */
49
- export function editorValue(raw: unknown, seededJson: string): EditorValue {
50
- if (typeof raw !== "string" || raw === "") return { kind: "absent" };
51
- if (seededJson !== "" && raw === seededJson) return { kind: "unchanged" };
48
+ const TEXT_ONLY = new Set(["PARAGRAPH", "TEXT", "HEADING", "BULLETED_LIST", "ORDERED_LIST", "LIST_ITEM", "BLOCKQUOTE", "CODE_BLOCK"]);
49
+ /** No visible text and no non-text node (an image, a divider, an embed…): an empty body. */
50
+ export function isEmptyDocument(doc: RicosDocument): boolean {
51
+ const empty = (nodes: RicosDocument["nodes"] | undefined): boolean => (nodes ?? []).every((n) =>
52
+ TEXT_ONLY.has(String(n?.type)) && !String(n.textData?.text ?? "").trim() && empty(n.nodes));
53
+ return empty(doc.nodes);
54
+ }
55
+
56
+ /** A Ricos JSON string checked as every viewer would: the limits first, then the shape. */
57
+ function checkedDocument(raw: string): EditorValue {
52
58
  if (utf8Bytes(raw) > RICH_CONTENT_LIMITS.maxBytes) return { kind: "too_large" };
53
59
  const doc = parseRicosJson(raw);
54
60
  if (!doc) return { kind: "invalid" };
55
61
  return overLimits(doc) ? { kind: "too_large" } : { kind: "doc", doc, json: raw };
56
62
  }
63
+
64
+ /** `raw` is `values[name]`; `seededJson` is the string the form published as the editor's seed. */
65
+ export function editorValue(raw: unknown, seededJson: string): EditorValue {
66
+ if (typeof raw !== "string" || raw === "") return { kind: "absent" };
67
+ if (seededJson !== "" && raw === seededJson) return { kind: "unchanged" };
68
+ const checked = checkedDocument(raw);
69
+ // An empty editor over no body (a record that had none) writes nothing, rather than an empty document.
70
+ if (checked.kind === "doc" && seededJson === "" && isEmptyDocument(checked.doc)) return { kind: "unchanged" };
71
+ return checked;
72
+ }
73
+
74
+ // ── The per-field editor machinery every owner form shares (post body, event / product description,
75
+ // FAQ answer). Each form keeps `<key>Json` (the seed), `<key>Pending` and `<key>Dirty` in its state.
76
+
77
+ /** `<key>Pending`: until this run's load lands, the descriptor hides the editor — it seeds ONCE, so a
78
+ * provisional editor the owner typed into would keep that text over the real document.
79
+ * `<key>Dirty`: the editor's on_change fired since the field was loaded or saved. Once ready the bag
80
+ * ALWAYS holds a document — the engine's own re-serialization of the seed, not byte-equal to it — so
81
+ * only this says the owner edited the field. Every arm fires a pending on_change before it releases a
82
+ * Form submit, so an edit made inside the debounce window is reported before the submit reads it. */
83
+ export interface EditorGate { pending: boolean; dirty: boolean }
84
+
85
+ /** What a live submit does with `values[name]`: only an edit the editor reported counts. */
86
+ export function editorSubmitValue(raw: unknown, seededJson: string, gate: EditorGate): EditorValue {
87
+ return gate.pending || !gate.dirty ? { kind: "absent" } : editorValue(raw, seededJson);
88
+ }
89
+
90
+ /** A queued write's document. A replay runs in a FRESH worker with no editor, so the string is checked
91
+ * again (shape and limits); "absent" when the item carries none. Never "unchanged": it was an edit. */
92
+ export function queuedDocument(raw: unknown): EditorValue {
93
+ return typeof raw === "string" && raw !== "" ? checkedDocument(raw) : { kind: "absent" };
94
+ }
95
+
96
+ /** The editor's on_change: the field is now edited, and a confirmation of an earlier save is stale.
97
+ * No timing window: an arm fires the pending on_change BEFORE it releases a submit, so any on_change
98
+ * that arrives after a save carries an edit that save did not write. */
99
+ export function editorChanged<S extends { status: string; savedMessage: string }>(s: S): Pick<S, "status" | "savedMessage"> {
100
+ return { status: s.status === "saved" ? "idle" : s.status, savedMessage: "" };
101
+ }
102
+
103
+ /** The offline cache's verdict on the stored body (`<key>Protected`): rich unless KNOWN plain. From the
104
+ * document when the form knows it; otherwise plain only when the record was loaded as plain. A bundle
105
+ * rolled back past the editor reads this flag to decide whether its plain field may overwrite the body. */
106
+ export function cachedRichVerdict(doc: RicosDocument | null, knownPlain: boolean): "true" | "false" {
107
+ if (doc) return isPlainRicos(doc) ? "false" : "true";
108
+ return knownPlain ? "false" : "true";
109
+ }
110
+
111
+ /** Cold boot: the runtime lays this service's last persisted snapshot over its declared state, so the
112
+ * editor's first seed would be the document as it was when the screen last ran — and a Save after
113
+ * typing would write it over whatever the record holds now. Blank the hydrated seed and reset the gate
114
+ * before anything renders, in place (no action has run yet). `extra` resets further UI state. */
115
+ export function resetHydratedEditor(svc: unknown, keys: { json: string; pending: string; dirty: string }, pendingAtBoot: boolean, extra: Record<string, unknown> = {}): void {
116
+ const booted = (svc as { getState?: () => Record<string, unknown> | undefined }).getState?.();
117
+ if (!booted || typeof booted !== "object") return;
118
+ if (booted[keys.json]) booted[keys.json] = "";
119
+ booted[keys.pending] = pendingAtBoot;
120
+ booted[keys.dirty] = false;
121
+ Object.assign(booted, extra);
122
+ }
@@ -2,7 +2,7 @@
2
2
  // this file adds the read-only previews the forms show for a locked body, and the FAQ's legacy DraftJS answer.
3
3
  // Inside the platform source this import is a relative path, so node test runs resolve it; an app's copy
4
4
  // imports "@himalaya/wix-rich-content".
5
- import { htmlIsTrivial, isPlainRicos } from "@himalaya/wix-rich-content";
5
+ import { htmlIsTrivial } from "@himalaya/wix-rich-content";
6
6
 
7
7
  export { htmlIsTrivial };
8
8
 
@@ -16,14 +16,6 @@ export function htmlPreviewText(html: string | null | undefined): string {
16
16
  .split("\n").map((l) => l.replace(/\s+/g, " ").trim()).filter(Boolean).join("\n");
17
17
  }
18
18
 
19
- /** True when a plain text field can round-trip this Ricos document: no document styling, and
20
- * only paragraphs of undecorated text whose paragraph data is the wire default (Events v3 sends
21
- * `{ textStyle: { textAlignment: "AUTO" }, indentation: 0 }` on every paragraph). Anything else —
22
- * a heading, list, link, bold run, media node, alignment or indent — is rich, and so is a missing
23
- * document (callers decide what an absent body means). */
24
- export const ricosIsPlain = (doc: { nodes?: unknown; documentStyle?: unknown } | null | undefined): boolean =>
25
- !!doc && isPlainRicos(doc);
26
-
27
19
  /** Preview text for a legacy DraftJS document: its `blocks[].text` joined by a blank line, or ""
28
20
  * when the payload is not DraftJS JSON (never a throw). */
29
21
  export function draftjsText(raw: string | null | undefined): string {