@wix/himalaya-cli 0.1494.0 → 0.1496.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 (82) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/live-activity/src/index.d.ts +4 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +2 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ecom/src/extensions.d.ts +16 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/display.d.ts +24 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/live-activity.mjs +3 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -1
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-ecom.mjs +14 -0
  9. package/dist/cli.mjs +3584 -2541
  10. package/dist/preview-assets.generated.bin +0 -0
  11. package/guides/himi-json-output.md +46 -4
  12. package/guides/iap-products.md +68 -9
  13. package/guides/one-app-to-himi-app.md +80 -5
  14. package/guides/sdk-reference.json +11 -256
  15. package/guides/widgets.md +5 -3
  16. package/package.json +2 -2
  17. package/templates/beauty-salon/dev/index.ts +2590 -1034
  18. package/templates/beauty-salon/himalaya.content.json +1 -1
  19. package/templates/beauty-salon/tier5-src/_shared/himi-store-collection.ts +6 -3
  20. package/templates/beauty-salon/tier5-src/_shared/himi-store-saved.ts +7 -1
  21. package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  22. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +196 -34
  23. package/templates/beauty-salon/tier5-src/himi-store-saved/index.ts +21 -5
  24. package/templates/beauty-salon/tier5-src/himi-store-shop/index.ts +14 -2
  25. package/templates/beauty-salon/tokens.json +15 -0
  26. package/templates/branded-lite/dev/index.ts +2696 -1140
  27. package/templates/branded-lite/himalaya.content.json +1 -1
  28. package/templates/branded-lite/tier5-src/_shared/business-chat-model.ts +35 -4
  29. package/templates/branded-lite/tier5-src/_shared/business-chat-transport.ts +12 -5
  30. package/templates/branded-lite/tier5-src/_shared/himi-store-collection.ts +6 -3
  31. package/templates/branded-lite/tier5-src/_shared/himi-store-saved.ts +7 -1
  32. package/templates/branded-lite/tier5-src/business-chat/index.ts +50 -17
  33. package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  34. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +196 -34
  35. package/templates/branded-lite/tier5-src/himi-store-saved/index.ts +21 -5
  36. package/templates/branded-lite/tier5-src/himi-store-shop/index.ts +14 -2
  37. package/templates/branded-lite/tokens.json +8 -0
  38. package/templates/community-club/dev/index.ts +1 -1
  39. package/templates/community-club/tier5-src/_shared/himi-store-saved.ts +7 -1
  40. package/templates/community-club/tokens.json +15 -0
  41. package/templates/events-meetups/dev/index.ts +1 -1
  42. package/templates/events-meetups/tier5-src/_shared/himi-store-saved.ts +7 -1
  43. package/templates/events-meetups/tokens.json +15 -0
  44. package/templates/gym-fitness/dev/index.ts +2695 -1139
  45. package/templates/gym-fitness/himalaya.content.json +1 -1
  46. package/templates/gym-fitness/tier5-src/_shared/himi-store-collection.ts +6 -3
  47. package/templates/gym-fitness/tier5-src/_shared/himi-store-saved.ts +7 -1
  48. package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  49. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +196 -34
  50. package/templates/gym-fitness/tier5-src/himi-store-saved/index.ts +21 -5
  51. package/templates/gym-fitness/tier5-src/himi-store-shop/index.ts +14 -2
  52. package/templates/gym-fitness/tokens.json +15 -0
  53. package/templates/nonprofit-cause/dev/index.ts +1 -1
  54. package/templates/nonprofit-cause/tier5-src/_shared/himi-store-saved.ts +7 -1
  55. package/templates/nonprofit-cause/tokens.json +15 -0
  56. package/templates/podcast-creator/dev/index.ts +1 -1
  57. package/templates/podcast-creator/tier5-src/_shared/himi-store-saved.ts +7 -1
  58. package/templates/podcast-creator/tokens.json +15 -0
  59. package/templates/portfolio-creative/dev/index.ts +2569 -1013
  60. package/templates/portfolio-creative/himalaya.content.json +1 -1
  61. package/templates/portfolio-creative/tier5-src/_shared/himi-store-collection.ts +6 -3
  62. package/templates/portfolio-creative/tier5-src/_shared/himi-store-saved.ts +7 -1
  63. package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  64. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +196 -34
  65. package/templates/portfolio-creative/tier5-src/himi-store-saved/index.ts +21 -5
  66. package/templates/portfolio-creative/tier5-src/himi-store-shop/index.ts +14 -2
  67. package/templates/portfolio-creative/tokens.json +15 -0
  68. package/templates/restaurant/dev/index.ts +1 -1
  69. package/templates/restaurant/tier5-src/_shared/himi-store-saved.ts +7 -1
  70. package/templates/restaurant/tokens.json +15 -0
  71. package/templates/retail-store/dev/index.ts +2541 -985
  72. package/templates/retail-store/himalaya.content.json +1 -1
  73. package/templates/retail-store/tier5-src/_shared/himi-store-collection.ts +6 -3
  74. package/templates/retail-store/tier5-src/_shared/himi-store-saved.ts +7 -1
  75. package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  76. package/templates/retail-store/tier5-src/himi-store-product/index.ts +196 -34
  77. package/templates/retail-store/tier5-src/himi-store-saved/index.ts +21 -5
  78. package/templates/retail-store/tier5-src/himi-store-shop/index.ts +14 -2
  79. package/templates/retail-store/tokens.json +15 -0
  80. package/templates/yoga-studio/dev/index.ts +1 -1
  81. package/templates/yoga-studio/tier5-src/_shared/himi-store-saved.ts +7 -1
  82. package/templates/yoga-studio/tokens.json +15 -0
@@ -185,7 +185,9 @@ export declare function text(text: string, style?: string, opts?: {
185
185
  animateValue?: boolean;
186
186
  animateReveal?: boolean;
187
187
  markdown?: boolean;
188
+ textAlign?: "leading" | "center" | "trailing" | "justify";
188
189
  textDirection?: "auto" | "ltr" | "rtl";
190
+ decoration?: "underline" | "strikethrough";
189
191
  minimumScaleFactor?: number;
190
192
  monospacedDigits?: boolean;
191
193
  truncation?: "tail" | "head" | "middle";
@@ -749,6 +751,7 @@ export declare function stepper(props: {
749
751
  max?: number;
750
752
  onChange?: ActionShape; /** `$service:` path the count follows (worker is the source of truth). */
751
753
  valuePath?: string;
754
+ presentation?: "plain";
752
755
  }, opts?: {
753
756
  id?: string;
754
757
  }): Component;
@@ -78,6 +78,10 @@ export interface StartOptions {
78
78
  /** Android promotion is opt-in for a user-followed, bounded, time-sensitive
79
79
  * activity. The system may still keep it as an ordinary notification. */
80
80
  promoted?: boolean;
81
+ /** In an app embedded in another (`HimalayaEmbedSurfaces`): the push topic whose pushes
82
+ * repaint this activity while the app is closed, e.g. `bookings.<siteId>`. Ignored
83
+ * elsewhere. */
84
+ pushTopic?: string;
81
85
  }
82
86
  export interface UpdateOptions {
83
87
  /** The token returned by `start`. An empty id is a no-op. */
@@ -864,6 +864,8 @@ export interface StepperProps {
864
864
  min?: number;
865
865
  max?: number;
866
866
  onChange?: Action;
867
+ /** "plain" draws exposed minus/value/plus controls; absent uses the default capsule. */
868
+ presentation?: "plain";
867
869
  }
868
870
  export type AvatarSource = {
869
871
  /** Literal URL, or binding-aware `$service:`/`$item.` image URL. */
@@ -117,6 +117,22 @@ export declare function isOrdersForbiddenError(error: unknown): boolean;
117
117
  * `cart.subtotal?.formattedAmount ?? ""` and `(await getCurrentCart()).id || ""` —
118
118
  * all three degrade to empty/0 on an absent field, so no caller special-cases it. */
119
119
  export declare function getCurrentCart(): Promise<WixCartDetail>;
120
+ /** Add a coupon to the visitor/member's current cart — POST
121
+ * /ecom/v2/carts/current/add-coupon. Wix validates it against the current cart.
122
+ * @scope visitor — uses the active shopper's cart; Wix rejects an invalid coupon. */
123
+ export declare function addCouponToCurrentCart(code: string): Promise<{
124
+ cart?: WixCartDetail;
125
+ }>;
126
+ /** Remove a coupon from the current cart — POST /ecom/v2/carts/current/remove-coupon.
127
+ * @scope visitor — uses the active shopper's cart; a missing coupon ID is rejected. */
128
+ export declare function removeCouponFromCurrentCart(couponId: string): Promise<{
129
+ cart?: WixCartDetail;
130
+ }>;
131
+ /** Recalculate the current cart after a coupon change.
132
+ * @scope visitor — uses the active shopper's cart and returns its updated totals. */
133
+ export declare function calculateCurrentCart(): Promise<{
134
+ cart?: WixCartDetail;
135
+ }>;
120
136
  export interface WixRemoveLineItemsResponse {
121
137
  cart?: WixCartDetail;
122
138
  }
@@ -67,6 +67,19 @@ export interface StoreProduct {
67
67
  currency?: string;
68
68
  };
69
69
  };
70
+ /** Catalog V3 original price, when the actual price is discounted. */
71
+ compareAtPriceRange?: {
72
+ minValue?: {
73
+ amount?: string;
74
+ formattedAmount?: string;
75
+ currency?: string;
76
+ };
77
+ maxValue?: {
78
+ amount?: string;
79
+ formattedAmount?: string;
80
+ currency?: string;
81
+ };
82
+ };
70
83
  /** Option groups, both spellings: V1 `productOptions`, V3 `options`. Declared
71
84
  * because the wire carries them on BOTH catalogs and this type denying them is
72
85
  * what let every template product screen drop the colour/size picker. Shapes
@@ -78,6 +91,17 @@ export interface StoreProduct {
78
91
  variantsInfo?: {
79
92
  variants?: unknown[];
80
93
  };
94
+ /** Merchant-authored product details: V1 and V3 use different field names. */
95
+ additionalInfoSections?: {
96
+ title?: string;
97
+ description?: string;
98
+ }[];
99
+ infoSections?: {
100
+ title?: string;
101
+ uniqueName?: string;
102
+ plainDescription?: string;
103
+ description?: unknown;
104
+ }[];
81
105
  }
82
106
  export interface StoreProductsResponse {
83
107
  products?: StoreProduct[];
@@ -30,7 +30,9 @@ async function start(options) {
30
30
  // reads as "foreground-only, record no mapping".
31
31
  entityType: options.session?.entityType ?? "",
32
32
  entityId: options.session?.entityId ?? "",
33
- expiresAt: options.session?.expiresAt ?? 0
33
+ expiresAt: options.session?.expiresAt ?? 0,
34
+ // Only when set, so an app that names none sends exactly what it sent before.
35
+ ...options.pushTopic ? { pushTopic: options.pushTopic } : {}
34
36
  });
35
37
  if (!r || !r.activityId) return { activityId: "", started: false };
36
38
  return { activityId: r.activityId, started: r.started ?? true };
@@ -8716,7 +8716,7 @@ function zstack(props) {
8716
8716
  function text(text2, style, opts) {
8717
8717
  return {
8718
8718
  id: opts?.id ?? auto("text"),
8719
- body: { package: "himalaya", type: "Text", props: { text: text2, style, color: opts?.color, maxLines: opts?.maxLines, collapseWhenEmpty: opts?.collapseWhenEmpty, animateValue: opts?.animateValue, animateReveal: opts?.animateReveal, markdown: opts?.markdown, textDirection: opts?.textDirection, minimumScaleFactor: opts?.minimumScaleFactor, monospacedDigits: opts?.monospacedDigits, truncation: opts?.truncation } }
8719
+ body: { package: "himalaya", type: "Text", props: { text: text2, style, color: opts?.color, maxLines: opts?.maxLines, collapseWhenEmpty: opts?.collapseWhenEmpty, animateValue: opts?.animateValue, animateReveal: opts?.animateReveal, markdown: opts?.markdown, textAlign: opts?.textAlign, textDirection: opts?.textDirection, decoration: opts?.decoration, minimumScaleFactor: opts?.minimumScaleFactor, monospacedDigits: opts?.monospacedDigits, truncation: opts?.truncation } }
8720
8720
  };
8721
8721
  }
8722
8722
  function card2(children, opts) {
@@ -76,6 +76,17 @@ async function getCurrentCart() {
76
76
  throw e;
77
77
  }
78
78
  }
79
+ function addCouponToCurrentCart(code) {
80
+ if (!code.trim()) throw new Error("addCouponToCurrentCart: code is required");
81
+ return wixCall("POST", "/ecom/v2/carts/current/add-coupon", { coupon: { code: code.trim() } });
82
+ }
83
+ function removeCouponFromCurrentCart(couponId) {
84
+ if (!couponId) throw new Error("removeCouponFromCurrentCart: couponId is required");
85
+ return wixCall("POST", "/ecom/v2/carts/current/remove-coupon", { couponId });
86
+ }
87
+ function calculateCurrentCart() {
88
+ return wixCall("POST", "/ecom/v2/carts/current/calculate", { refreshCart: true });
89
+ }
79
90
  function removeLineItemsFromCurrentCart(lineItemIds) {
80
91
  return wixCall("POST", "/ecom/v1/carts/current/remove-line-items", { lineItemIds });
81
92
  }
@@ -201,8 +212,10 @@ function searchOrders(req = {}, opts) {
201
212
  );
202
213
  }
203
214
  export {
215
+ addCouponToCurrentCart,
204
216
  addToCurrentCart,
205
217
  archiveOrder,
218
+ calculateCurrentCart,
206
219
  cancelOrder,
207
220
  createCheckout,
208
221
  createCheckoutFromCurrentCart,
@@ -224,6 +237,7 @@ export {
224
237
  markSavedPaymentMethodPrimary,
225
238
  memberAddressFieldMask,
226
239
  refundPayments,
240
+ removeCouponFromCurrentCart,
227
241
  removeLineItemsFromCurrentCart,
228
242
  searchOrders,
229
243
  setDefaultMemberAddress,