@wix/himalaya-cli 0.1493.0 → 0.1495.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 (97) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +5 -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/bookings-v2/src/extensions.d.ts +52 -2
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/index.d.ts +180 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/ecom/src/extensions.d.ts +16 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/stores-v1/src/display.d.ts +24 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/live-activity.mjs +3 -1
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -1
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +4 -2
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-ecom.mjs +14 -0
  12. package/dist/cli.mjs +3585 -2540
  13. package/dist/preview-assets.generated.bin +0 -0
  14. package/guides/himi-json-output.md +46 -4
  15. package/guides/iap-products.md +68 -9
  16. package/guides/one-app-to-himi-app.md +80 -5
  17. package/guides/qa-builds.md +2 -2
  18. package/guides/widgets.md +5 -3
  19. package/package.json +2 -2
  20. package/templates/beauty-salon/dev/index.ts +4442 -1532
  21. package/templates/beauty-salon/himalaya.content.json +1 -1
  22. package/templates/beauty-salon/tier5-src/_shared/himi-store-collection.ts +6 -3
  23. package/templates/beauty-salon/tier5-src/_shared/himi-store-saved.ts +7 -1
  24. package/templates/beauty-salon/tier5-src/_shared/wix-service-price.ts +18 -0
  25. package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +514 -117
  26. package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  27. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +196 -34
  28. package/templates/beauty-salon/tier5-src/himi-store-saved/index.ts +21 -5
  29. package/templates/beauty-salon/tier5-src/himi-store-shop/index.ts +14 -2
  30. package/templates/beauty-salon/tokens.json +21 -0
  31. package/templates/branded-lite/dev/index.ts +4427 -1510
  32. package/templates/branded-lite/himalaya.content.json +1 -1
  33. package/templates/branded-lite/tier5-src/_shared/himi-store-collection.ts +6 -3
  34. package/templates/branded-lite/tier5-src/_shared/himi-store-saved.ts +7 -1
  35. package/templates/branded-lite/tier5-src/_shared/wix-service-price.ts +18 -0
  36. package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +514 -117
  37. package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  38. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +196 -34
  39. package/templates/branded-lite/tier5-src/himi-store-saved/index.ts +21 -5
  40. package/templates/branded-lite/tier5-src/himi-store-shop/index.ts +14 -2
  41. package/templates/branded-lite/tokens.json +9 -0
  42. package/templates/community-club/dev/index.ts +1 -1
  43. package/templates/community-club/tier5-src/_shared/himi-store-saved.ts +7 -1
  44. package/templates/community-club/tier5-src/_shared/wix-service-price.ts +18 -0
  45. package/templates/community-club/tokens.json +21 -0
  46. package/templates/events-meetups/dev/index.ts +1 -1
  47. package/templates/events-meetups/tier5-src/_shared/himi-store-saved.ts +7 -1
  48. package/templates/events-meetups/tier5-src/_shared/wix-service-price.ts +18 -0
  49. package/templates/events-meetups/tokens.json +21 -0
  50. package/templates/gym-fitness/dev/index.ts +4439 -1529
  51. package/templates/gym-fitness/himalaya.content.json +1 -1
  52. package/templates/gym-fitness/tier5-src/_shared/himi-store-collection.ts +6 -3
  53. package/templates/gym-fitness/tier5-src/_shared/himi-store-saved.ts +7 -1
  54. package/templates/gym-fitness/tier5-src/_shared/wix-service-price.ts +18 -0
  55. package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +514 -117
  56. package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  57. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +196 -34
  58. package/templates/gym-fitness/tier5-src/himi-store-saved/index.ts +21 -5
  59. package/templates/gym-fitness/tier5-src/himi-store-shop/index.ts +14 -2
  60. package/templates/gym-fitness/tokens.json +21 -0
  61. package/templates/nonprofit-cause/dev/index.ts +1 -1
  62. package/templates/nonprofit-cause/tier5-src/_shared/himi-store-saved.ts +7 -1
  63. package/templates/nonprofit-cause/tier5-src/_shared/wix-service-price.ts +18 -0
  64. package/templates/nonprofit-cause/tokens.json +21 -0
  65. package/templates/podcast-creator/dev/index.ts +1 -1
  66. package/templates/podcast-creator/tier5-src/_shared/himi-store-saved.ts +7 -1
  67. package/templates/podcast-creator/tier5-src/_shared/wix-service-price.ts +18 -0
  68. package/templates/podcast-creator/tokens.json +21 -0
  69. package/templates/portfolio-creative/dev/index.ts +2569 -1013
  70. package/templates/portfolio-creative/himalaya.content.json +1 -1
  71. package/templates/portfolio-creative/tier5-src/_shared/himi-store-collection.ts +6 -3
  72. package/templates/portfolio-creative/tier5-src/_shared/himi-store-saved.ts +7 -1
  73. package/templates/portfolio-creative/tier5-src/_shared/wix-service-price.ts +18 -0
  74. package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  75. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +196 -34
  76. package/templates/portfolio-creative/tier5-src/himi-store-saved/index.ts +21 -5
  77. package/templates/portfolio-creative/tier5-src/himi-store-shop/index.ts +14 -2
  78. package/templates/portfolio-creative/tokens.json +21 -0
  79. package/templates/restaurant/dev/index.ts +1 -1
  80. package/templates/restaurant/tier5-src/_shared/himi-store-saved.ts +7 -1
  81. package/templates/restaurant/tier5-src/_shared/wix-service-price.ts +18 -0
  82. package/templates/restaurant/tokens.json +21 -0
  83. package/templates/retail-store/dev/index.ts +2541 -985
  84. package/templates/retail-store/himalaya.content.json +1 -1
  85. package/templates/retail-store/tier5-src/_shared/himi-store-collection.ts +6 -3
  86. package/templates/retail-store/tier5-src/_shared/himi-store-saved.ts +7 -1
  87. package/templates/retail-store/tier5-src/_shared/wix-service-price.ts +18 -0
  88. package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +256 -19
  89. package/templates/retail-store/tier5-src/himi-store-product/index.ts +196 -34
  90. package/templates/retail-store/tier5-src/himi-store-saved/index.ts +21 -5
  91. package/templates/retail-store/tier5-src/himi-store-shop/index.ts +14 -2
  92. package/templates/retail-store/tokens.json +21 -0
  93. package/templates/yoga-studio/dev/index.ts +1618 -264
  94. package/templates/yoga-studio/tier5-src/_shared/himi-store-saved.ts +7 -1
  95. package/templates/yoga-studio/tier5-src/_shared/wix-service-price.ts +18 -0
  96. package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +514 -117
  97. package/templates/yoga-studio/tokens.json +21 -0
@@ -80,7 +80,7 @@
80
80
  "displayName": "Membership"
81
81
  },
82
82
  "himi_product": {
83
- "displayName": "Product"
83
+ "displayName": "Product Details"
84
84
  },
85
85
  "himi_rsvp": {
86
86
  "displayName": "RSVP"
@@ -7,9 +7,12 @@ export const storeCollectionSaving: CollectionSaving = {
7
7
  const products = new Map(readSavedProducts().map(row => [row.id, row]));
8
8
  for (const row of rows) {
9
9
  if (typeof row.id !== 'string' || typeof row.name !== 'string') continue;
10
- products.set(row.id, { id: row.id, name: row.name,
11
- price: typeof row.commercePrice === 'string' ? row.commercePrice : typeof row.subtitle === 'string' ? row.subtitle : '',
12
- image: typeof row.image === 'string' ? row.image : '' });
10
+ const previous = products.get(row.id);
11
+ const freshPrice = typeof row.commercePrice === 'string' ? row.commercePrice : typeof row.subtitle === 'string' ? row.subtitle : '';
12
+ const wasPrice = typeof row.wasPrice === 'string' ? row.wasPrice || undefined : previous?.price === freshPrice ? previous?.wasPrice : undefined;
13
+ products.set(row.id, { ...previous, wasPrice, id: row.id, name: row.name,
14
+ price: freshPrice || previous?.price || '',
15
+ image: typeof row.image === 'string' && row.image ? row.image : previous?.image ?? '' });
13
16
  }
14
17
  const selected = ids.map(id => products.get(id));
15
18
  if (selected.some(row => !row)) throw new Error('Saved product metadata is unavailable');
@@ -5,6 +5,8 @@ export interface SavedProduct {
5
5
  name: string;
6
6
  price: string;
7
7
  image: string;
8
+ wasPrice?: string;
9
+ swatches?: string[];
8
10
  }
9
11
  type StorageLike = { getItem(key: string): string | null; setItem(key: string, value: string): void };
10
12
  const KEY = "himi-store:saved-products:v1";
@@ -24,7 +26,11 @@ export function readSavedProducts(): SavedProduct[] {
24
26
  if (!value || typeof value !== "object") continue;
25
27
  const row = value as Record<string, unknown>;
26
28
  if (typeof row.id !== "string" || !row.id.trim() || typeof row.name !== "string") continue;
27
- rows.set(row.id, { id: row.id, name: row.name, price: typeof row.price === "string" ? row.price : "", image: typeof row.image === "string" ? row.image : "" });
29
+ const swatches = Array.isArray(row.swatches)
30
+ ? row.swatches.filter((color): color is string => typeof color === "string" && /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i.test(color)).slice(0, 5)
31
+ : [];
32
+ rows.set(row.id, { id: row.id, name: row.name, price: typeof row.price === "string" ? row.price : "", image: typeof row.image === "string" ? row.image : "",
33
+ ...(typeof row.wasPrice === "string" && row.wasPrice ? { wasPrice: row.wasPrice } : {}), ...(swatches.length ? { swatches } : {}) });
28
34
  }
29
35
  return [...rows.values()];
30
36
  }
@@ -99,6 +99,24 @@ export function serviceIsChargeable(service: unknown): boolean {
99
99
  return amount != null && amount > 0;
100
100
  }
101
101
 
102
+ /**
103
+ * Format one Bookings v2 Money value (`{ value, currency }`, `value` a decimal string) — a
104
+ * price, a deposit, a VARIED minimum, a cancellation fee. A whole amount drops its cents
105
+ * ("₪90", not "₪90.00"), as the service screen shows it. "" when it carries no usable
106
+ * amount. The currency comes from the Money itself, then from `fallbackCurrency`.
107
+ */
108
+ export function formatServiceMoney(money: unknown, fallbackCurrency = "USD"): string {
109
+ const m = (money ?? {}) as { value?: unknown; amount?: unknown; currency?: unknown };
110
+ const amount = numberOf(m.value ?? m.amount);
111
+ if (amount == null) return "";
112
+ const currency = stringOf(m.currency) || fallbackCurrency;
113
+ try {
114
+ return formatCurrency(amount, currency, "en", Number.isInteger(amount) ? 0 : undefined);
115
+ } catch {
116
+ return `${amount}`;
117
+ }
118
+ }
119
+
102
120
  /**
103
121
  * Format a Wix Bookings service's price for display, e.g. "₪111" / "$20".
104
122
  *