@wix/himalaya-cli 0.1493.0 → 0.1494.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 (39) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +2 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/extensions.d.ts +52 -2
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/index.d.ts +180 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +4 -2
  5. package/dist/cli.mjs +30 -29
  6. package/dist/preview-assets.generated.bin +0 -0
  7. package/guides/qa-builds.md +2 -2
  8. package/guides/sdk-reference.json +256 -11
  9. package/package.json +2 -2
  10. package/templates/beauty-salon/dev/index.ts +1624 -270
  11. package/templates/beauty-salon/tier5-src/_shared/wix-service-price.ts +18 -0
  12. package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +514 -117
  13. package/templates/beauty-salon/tokens.json +6 -0
  14. package/templates/branded-lite/dev/index.ts +1621 -260
  15. package/templates/branded-lite/tier5-src/_shared/wix-service-price.ts +18 -0
  16. package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +514 -117
  17. package/templates/branded-lite/tokens.json +1 -0
  18. package/templates/community-club/tier5-src/_shared/wix-service-price.ts +18 -0
  19. package/templates/community-club/tokens.json +6 -0
  20. package/templates/events-meetups/tier5-src/_shared/wix-service-price.ts +18 -0
  21. package/templates/events-meetups/tokens.json +6 -0
  22. package/templates/gym-fitness/dev/index.ts +1623 -269
  23. package/templates/gym-fitness/tier5-src/_shared/wix-service-price.ts +18 -0
  24. package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +514 -117
  25. package/templates/gym-fitness/tokens.json +6 -0
  26. package/templates/nonprofit-cause/tier5-src/_shared/wix-service-price.ts +18 -0
  27. package/templates/nonprofit-cause/tokens.json +6 -0
  28. package/templates/podcast-creator/tier5-src/_shared/wix-service-price.ts +18 -0
  29. package/templates/podcast-creator/tokens.json +6 -0
  30. package/templates/portfolio-creative/tier5-src/_shared/wix-service-price.ts +18 -0
  31. package/templates/portfolio-creative/tokens.json +6 -0
  32. package/templates/restaurant/tier5-src/_shared/wix-service-price.ts +18 -0
  33. package/templates/restaurant/tokens.json +6 -0
  34. package/templates/retail-store/tier5-src/_shared/wix-service-price.ts +18 -0
  35. package/templates/retail-store/tokens.json +6 -0
  36. package/templates/yoga-studio/dev/index.ts +1617 -263
  37. package/templates/yoga-studio/tier5-src/_shared/wix-service-price.ts +18 -0
  38. package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +514 -117
  39. package/templates/yoga-studio/tokens.json +6 -0
@@ -28,6 +28,7 @@
28
28
  "xl": 24
29
29
  },
30
30
  "typography": {
31
+ "pageTitle": { "size": 28, "weight": 400, "line": 1.25, "letterSpacing": 0 },
31
32
  "title1": { "size": 28, "weight": 700, "line": 1.2, "letterSpacing": 0 },
32
33
  "title2": { "size": 22, "weight": 700, "line": 1.22, "letterSpacing": 0 },
33
34
  "title3": { "size": 18, "weight": 700, "line": 1.25, "letterSpacing": 0 },
@@ -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
  *
@@ -113,6 +113,12 @@
113
113
  "xl": 24
114
114
  },
115
115
  "typography": {
116
+ "pageTitle": {
117
+ "size": 28,
118
+ "weight": 400,
119
+ "line": 1.25,
120
+ "letterSpacing": 0
121
+ },
116
122
  "title1": {
117
123
  "size": 31,
118
124
  "weight": 700,
@@ -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
  *
@@ -109,6 +109,12 @@
109
109
  "xl": 24
110
110
  },
111
111
  "typography": {
112
+ "pageTitle": {
113
+ "size": 28,
114
+ "weight": 400,
115
+ "line": 1.25,
116
+ "letterSpacing": 0
117
+ },
112
118
  "title1": {
113
119
  "size": 32,
114
120
  "weight": 600,