@wix/himalaya-cli 0.1588.0 → 0.1590.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 (220) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +2 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/torch/src/index.d.ts +39 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/capabilities.generated.d.ts +2 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +13 -2
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/extensions.d.ts +28 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-v1/src/index.d.ts +9 -5
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -0
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -0
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/torch.mjs +78 -0
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-groups.mjs +14 -0
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members.mjs +9 -8
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +4 -0
  20. package/dist/cli.mjs +121 -50
  21. package/dist/preview-assets.generated.bin +0 -0
  22. package/fixtures/wix-canned.json +16 -0
  23. package/guides/app-config.md +1 -1
  24. package/guides/importable-sdks.md +1 -0
  25. package/guides/one-app-to-himi-app.md +18 -4
  26. package/guides/qa-builds.md +12 -0
  27. package/guides/sdk-reference.json +101 -2
  28. package/guides/web-page-sdk-reference.md +1 -0
  29. package/package.json +2 -2
  30. package/templates/beauty-salon/tier5-src/_shared/app-locale.ts +61 -0
  31. package/templates/beauty-salon/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  32. package/templates/beauty-salon/tier5-src/_shared/engine-intl.ts +5 -3
  33. package/templates/beauty-salon/tier5-src/_shared/group-member-count.ts +15 -0
  34. package/templates/beauty-salon/tier5-src/_shared/himi-bookings.ts +54 -13
  35. package/templates/beauty-salon/tier5-src/_shared/himi-copy.ts +10 -2
  36. package/templates/beauty-salon/tier5-src/_shared/himi-restaurants.ts +2 -2
  37. package/templates/beauty-salon/tier5-src/_shared/restaurant-ordering.ts +1 -1
  38. package/templates/beauty-salon/tier5-src/_shared/wix-service-price.ts +2 -2
  39. package/templates/beauty-salon/tier5-src/himi-booking-services/index.ts +8 -3
  40. package/templates/beauty-salon/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  41. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +2 -1
  42. package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  43. package/templates/beauty-salon-owner/tier5-src/_shared/app-locale.ts +61 -0
  44. package/templates/beauty-salon-owner/tier5-src/_shared/engine-intl.ts +5 -3
  45. package/templates/beauty-salon-owner/tier5-src/_shared/himi-copy.ts +10 -2
  46. package/templates/branded-lite/config.ts +7 -0
  47. package/templates/branded-lite/dev/index.ts +469 -0
  48. package/templates/branded-lite/himalaya.content.json +3 -0
  49. package/templates/branded-lite/tier5-src/_shared/app-locale.ts +61 -0
  50. package/templates/branded-lite/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  51. package/templates/branded-lite/tier5-src/_shared/engine-intl.ts +5 -3
  52. package/templates/branded-lite/tier5-src/_shared/group-member-count.ts +15 -0
  53. package/templates/branded-lite/tier5-src/_shared/himi-bookings.ts +54 -13
  54. package/templates/branded-lite/tier5-src/_shared/himi-copy.ts +10 -2
  55. package/templates/branded-lite/tier5-src/_shared/himi-restaurants.ts +2 -2
  56. package/templates/branded-lite/tier5-src/_shared/restaurant-ordering.ts +1 -1
  57. package/templates/branded-lite/tier5-src/_shared/wix-service-price.ts +2 -2
  58. package/templates/branded-lite/tier5-src/himi-booking-services/index.ts +8 -3
  59. package/templates/branded-lite/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  60. package/templates/branded-lite/tier5-src/himi-branded-lite-group/index.ts +9 -3
  61. package/templates/branded-lite/tier5-src/himi-branded-lite-group-about/index.ts +2 -1
  62. package/templates/branded-lite/tier5-src/himi-branded-lite-groups/index.ts +6 -2
  63. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +2 -1
  64. package/templates/branded-lite/tier5-src/himi-branded-lite-loyalty/index.ts +3 -2
  65. package/templates/branded-lite/tier5-src/himi-branded-lite-my-groups/index.ts +237 -0
  66. package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  67. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +1 -1
  68. package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +5 -5
  69. package/templates/branded-lite/tier5-src/wix-spaces-member-detail/index.ts +5 -1
  70. package/templates/brandy/tier5-src/_shared/app-locale.ts +61 -0
  71. package/templates/brandy/tier5-src/_shared/himi-copy.ts +10 -2
  72. package/templates/community-club/config.ts +7 -0
  73. package/templates/community-club/dev/index.ts +469 -0
  74. package/templates/community-club/himalaya.content.json +3 -0
  75. package/templates/community-club/tier5-src/_shared/app-locale.ts +61 -0
  76. package/templates/community-club/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  77. package/templates/community-club/tier5-src/_shared/engine-intl.ts +5 -3
  78. package/templates/community-club/tier5-src/_shared/group-member-count.ts +15 -0
  79. package/templates/community-club/tier5-src/_shared/himi-copy.ts +10 -2
  80. package/templates/community-club/tier5-src/_shared/himi-restaurants.ts +2 -2
  81. package/templates/community-club/tier5-src/_shared/wix-service-price.ts +2 -2
  82. package/templates/community-club/tier5-src/himi-branded-lite-group/index.ts +9 -3
  83. package/templates/community-club/tier5-src/himi-branded-lite-group-about/index.ts +2 -1
  84. package/templates/community-club/tier5-src/himi-branded-lite-groups/index.ts +6 -2
  85. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +2 -1
  86. package/templates/community-club/tier5-src/himi-branded-lite-my-groups/index.ts +237 -0
  87. package/templates/community-club/tier5-src/himi-events-detail/index.ts +5 -5
  88. package/templates/community-club-owner/tier5-src/_shared/app-locale.ts +61 -0
  89. package/templates/community-club-owner/tier5-src/_shared/engine-intl.ts +5 -3
  90. package/templates/community-club-owner/tier5-src/_shared/himi-copy.ts +10 -2
  91. package/templates/events-meetups/config.ts +7 -0
  92. package/templates/events-meetups/dev/index.ts +469 -0
  93. package/templates/events-meetups/himalaya.content.json +3 -0
  94. package/templates/events-meetups/tier5-src/_shared/app-locale.ts +61 -0
  95. package/templates/events-meetups/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  96. package/templates/events-meetups/tier5-src/_shared/engine-intl.ts +5 -3
  97. package/templates/events-meetups/tier5-src/_shared/group-member-count.ts +15 -0
  98. package/templates/events-meetups/tier5-src/_shared/himi-copy.ts +10 -2
  99. package/templates/events-meetups/tier5-src/_shared/himi-restaurants.ts +2 -2
  100. package/templates/events-meetups/tier5-src/_shared/wix-service-price.ts +2 -2
  101. package/templates/events-meetups/tier5-src/himi-branded-lite-group/index.ts +9 -3
  102. package/templates/events-meetups/tier5-src/himi-branded-lite-group-about/index.ts +2 -1
  103. package/templates/events-meetups/tier5-src/himi-branded-lite-groups/index.ts +6 -2
  104. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +2 -1
  105. package/templates/events-meetups/tier5-src/himi-branded-lite-my-groups/index.ts +237 -0
  106. package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +5 -5
  107. package/templates/events-meetups-owner/tier5-src/_shared/app-locale.ts +61 -0
  108. package/templates/events-meetups-owner/tier5-src/_shared/engine-intl.ts +5 -3
  109. package/templates/events-meetups-owner/tier5-src/_shared/himi-copy.ts +10 -2
  110. package/templates/gym-fitness/tier5-src/_shared/app-locale.ts +61 -0
  111. package/templates/gym-fitness/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  112. package/templates/gym-fitness/tier5-src/_shared/engine-intl.ts +5 -3
  113. package/templates/gym-fitness/tier5-src/_shared/group-member-count.ts +15 -0
  114. package/templates/gym-fitness/tier5-src/_shared/himi-bookings.ts +54 -13
  115. package/templates/gym-fitness/tier5-src/_shared/himi-copy.ts +10 -2
  116. package/templates/gym-fitness/tier5-src/_shared/himi-restaurants.ts +2 -2
  117. package/templates/gym-fitness/tier5-src/_shared/restaurant-ordering.ts +1 -1
  118. package/templates/gym-fitness/tier5-src/_shared/wix-service-price.ts +2 -2
  119. package/templates/gym-fitness/tier5-src/himi-booking-services/index.ts +8 -3
  120. package/templates/gym-fitness/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  121. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +2 -1
  122. package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  123. package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +5 -5
  124. package/templates/gym-fitness-owner/tier5-src/_shared/app-locale.ts +61 -0
  125. package/templates/gym-fitness-owner/tier5-src/_shared/engine-intl.ts +5 -3
  126. package/templates/gym-fitness-owner/tier5-src/_shared/himi-copy.ts +10 -2
  127. package/templates/himi-chat/tier5-src/_shared/app-locale.ts +61 -0
  128. package/templates/himi-chat/tier5-src/_shared/himi-copy.ts +10 -2
  129. package/templates/nonprofit-cause/config.ts +7 -0
  130. package/templates/nonprofit-cause/dev/index.ts +469 -0
  131. package/templates/nonprofit-cause/himalaya.content.json +3 -0
  132. package/templates/nonprofit-cause/tier5-src/_shared/app-locale.ts +61 -0
  133. package/templates/nonprofit-cause/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  134. package/templates/nonprofit-cause/tier5-src/_shared/engine-intl.ts +5 -3
  135. package/templates/nonprofit-cause/tier5-src/_shared/group-member-count.ts +15 -0
  136. package/templates/nonprofit-cause/tier5-src/_shared/himi-copy.ts +10 -2
  137. package/templates/nonprofit-cause/tier5-src/_shared/himi-restaurants.ts +2 -2
  138. package/templates/nonprofit-cause/tier5-src/_shared/wix-service-price.ts +2 -2
  139. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-group/index.ts +9 -3
  140. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-group-about/index.ts +2 -1
  141. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-groups/index.ts +6 -2
  142. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +2 -1
  143. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-my-groups/index.ts +237 -0
  144. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  145. package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +5 -5
  146. package/templates/nonprofit-cause-owner/tier5-src/_shared/app-locale.ts +61 -0
  147. package/templates/nonprofit-cause-owner/tier5-src/_shared/engine-intl.ts +5 -3
  148. package/templates/nonprofit-cause-owner/tier5-src/_shared/himi-copy.ts +10 -2
  149. package/templates/owner-lite/tier5-src/_shared/app-locale.ts +61 -0
  150. package/templates/owner-lite/tier5-src/_shared/engine-intl.ts +5 -3
  151. package/templates/owner-lite/tier5-src/_shared/himi-copy.ts +10 -2
  152. package/templates/podcast-creator/tier5-src/_shared/app-locale.ts +61 -0
  153. package/templates/podcast-creator/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  154. package/templates/podcast-creator/tier5-src/_shared/engine-intl.ts +5 -3
  155. package/templates/podcast-creator/tier5-src/_shared/group-member-count.ts +15 -0
  156. package/templates/podcast-creator/tier5-src/_shared/himi-copy.ts +10 -2
  157. package/templates/podcast-creator/tier5-src/_shared/himi-restaurants.ts +2 -2
  158. package/templates/podcast-creator/tier5-src/_shared/wix-service-price.ts +2 -2
  159. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +2 -1
  160. package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  161. package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +5 -5
  162. package/templates/podcast-creator-owner/tier5-src/_shared/app-locale.ts +61 -0
  163. package/templates/podcast-creator-owner/tier5-src/_shared/engine-intl.ts +5 -3
  164. package/templates/podcast-creator-owner/tier5-src/_shared/himi-copy.ts +10 -2
  165. package/templates/portfolio-creative/tier5-src/_shared/app-locale.ts +61 -0
  166. package/templates/portfolio-creative/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  167. package/templates/portfolio-creative/tier5-src/_shared/engine-intl.ts +5 -3
  168. package/templates/portfolio-creative/tier5-src/_shared/group-member-count.ts +15 -0
  169. package/templates/portfolio-creative/tier5-src/_shared/himi-copy.ts +10 -2
  170. package/templates/portfolio-creative/tier5-src/_shared/himi-restaurants.ts +2 -2
  171. package/templates/portfolio-creative/tier5-src/_shared/restaurant-ordering.ts +1 -1
  172. package/templates/portfolio-creative/tier5-src/_shared/wix-service-price.ts +2 -2
  173. package/templates/portfolio-creative/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  174. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +2 -1
  175. package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +5 -5
  176. package/templates/portfolio-creative-owner/tier5-src/_shared/app-locale.ts +61 -0
  177. package/templates/portfolio-creative-owner/tier5-src/_shared/engine-intl.ts +5 -3
  178. package/templates/portfolio-creative-owner/tier5-src/_shared/himi-copy.ts +10 -2
  179. package/templates/restaurant/tier5-src/_shared/app-locale.ts +61 -0
  180. package/templates/restaurant/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  181. package/templates/restaurant/tier5-src/_shared/engine-intl.ts +5 -3
  182. package/templates/restaurant/tier5-src/_shared/group-member-count.ts +15 -0
  183. package/templates/restaurant/tier5-src/_shared/himi-copy.ts +10 -2
  184. package/templates/restaurant/tier5-src/_shared/himi-restaurants.ts +2 -2
  185. package/templates/restaurant/tier5-src/_shared/restaurant-ordering.ts +1 -1
  186. package/templates/restaurant/tier5-src/_shared/wix-service-price.ts +2 -2
  187. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +2 -1
  188. package/templates/restaurant/tier5-src/himi-events-detail/index.ts +5 -5
  189. package/templates/restaurant-owner/tier5-src/_shared/app-locale.ts +61 -0
  190. package/templates/restaurant-owner/tier5-src/_shared/engine-intl.ts +5 -3
  191. package/templates/restaurant-owner/tier5-src/_shared/himi-copy.ts +10 -2
  192. package/templates/retail-store/tier5-src/_shared/app-locale.ts +61 -0
  193. package/templates/retail-store/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  194. package/templates/retail-store/tier5-src/_shared/engine-intl.ts +5 -3
  195. package/templates/retail-store/tier5-src/_shared/group-member-count.ts +15 -0
  196. package/templates/retail-store/tier5-src/_shared/himi-copy.ts +10 -2
  197. package/templates/retail-store/tier5-src/_shared/himi-restaurants.ts +2 -2
  198. package/templates/retail-store/tier5-src/_shared/restaurant-ordering.ts +1 -1
  199. package/templates/retail-store/tier5-src/_shared/wix-service-price.ts +2 -2
  200. package/templates/retail-store/tier5-src/himi-branded-lite-cart/index.ts +1 -1
  201. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +2 -1
  202. package/templates/retail-store-owner/tier5-src/_shared/app-locale.ts +61 -0
  203. package/templates/retail-store-owner/tier5-src/_shared/engine-intl.ts +5 -3
  204. package/templates/retail-store-owner/tier5-src/_shared/himi-copy.ts +10 -2
  205. package/templates/yoga-studio/tier5-src/_shared/app-locale.ts +61 -0
  206. package/templates/yoga-studio/tier5-src/_shared/branded-lite-hosted.ts +1 -0
  207. package/templates/yoga-studio/tier5-src/_shared/engine-intl.ts +5 -3
  208. package/templates/yoga-studio/tier5-src/_shared/group-member-count.ts +15 -0
  209. package/templates/yoga-studio/tier5-src/_shared/himi-bookings.ts +54 -13
  210. package/templates/yoga-studio/tier5-src/_shared/himi-copy.ts +10 -2
  211. package/templates/yoga-studio/tier5-src/_shared/himi-restaurants.ts +2 -2
  212. package/templates/yoga-studio/tier5-src/_shared/wix-service-price.ts +2 -2
  213. package/templates/yoga-studio/tier5-src/himi-booking-services/index.ts +8 -3
  214. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +2 -1
  215. package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  216. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +1 -1
  217. package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +5 -5
  218. package/templates/yoga-studio-owner/tier5-src/_shared/app-locale.ts +61 -0
  219. package/templates/yoga-studio-owner/tier5-src/_shared/engine-intl.ts +5 -3
  220. package/templates/yoga-studio-owner/tier5-src/_shared/himi-copy.ts +10 -2
@@ -19,6 +19,7 @@ import { formatServicePrice } from "../_shared/wix-service-price.js";
19
19
  import { cleanTitle, initials } from "../_shared/himi-text.js";
20
20
  import { LAYOUT_KEY, type LayoutId, recommendLayout, resolveLayout } from "../_shared/himi-layouts.js";
21
21
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
22
+ import { groupMemberCount } from "../_shared/group-member-count.js";
22
23
  import { parseWeeklyGoal, weeklyGoalProgress, weeklySessionsFromPages } from "../_shared/weekly-goal.js";
23
24
  import { isBridgeUnavailable } from "../_shared/owner-load-error.js";
24
25
  import { formatDateMedium } from "../_shared/engine-intl.js";
@@ -736,7 +737,7 @@ function groupCard(group: WixGroup): GroupCard {
736
737
  return {
737
738
  id: group.id || title,
738
739
  title,
739
- meta: count == null ? "" : `${count} ${count === 1 ? "member" : "members"}`,
740
+ meta: count == null ? "" : groupMemberCount(count),
740
741
  image,
741
742
  initial: (title[0] || "G").toUpperCase(),
742
743
  hasImage: !!image,
@@ -82,7 +82,7 @@ function money(plan: WixPlan): string {
82
82
  const raw = price?.value;
83
83
  if (raw == null || raw === "" || Number.isNaN(Number(raw))) return "";
84
84
  try {
85
- return formatCurrency(Number(raw), price?.currency || "USD", "en");
85
+ return formatCurrency(Number(raw), price?.currency || "USD");
86
86
  } catch {
87
87
  return `${raw}`;
88
88
  }
@@ -0,0 +1,61 @@
1
+ // The language a worker formats numbers, money and plurals in, and the business's time zone. A worker has no host locale to read,
2
+ // so the screen's `onAppear` hands it over: `appear()` adds `locale` to the load params when the app
3
+ // pins its language, and `stashCopy` stores it here. Absent, every formatter stays on "en" — the
4
+ // house pattern every English app was approved with — so an unpinned app is unchanged.
5
+ //
6
+ // The business time zone comes the same way, from the app's provisioning (`businessTimeZone`, collected
7
+ // at migration time while the site's properties are readable): a worker cannot read it itself, because
8
+ // the site-properties route is owner-scoped. Absent, it is "" and no worker guesses one.
9
+ //
10
+ // Pure, no host globals: bundled into every worker that formats, copied into generated templates.
11
+
12
+ const TAG = /^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/;
13
+ let tag = "en";
14
+
15
+ /** Set from a load argument's `locale`; anything that is not a language tag resets to "en". */
16
+ export function setAppLocale(value: unknown): void {
17
+ tag = typeof value === "string" && TAG.test(value) ? value : "en";
18
+ }
19
+
20
+ export function appLocale(): string {
21
+ return tag;
22
+ }
23
+
24
+ /** An IANA zone such as "Asia/Jerusalem" (or "UTC") that this engine knows. A bare offset, a lowercase
25
+ * alias or an engine without ECMA-402 is not one: a zone is never guessed. */
26
+ export function isIanaTimeZone(value: unknown): value is string {
27
+ if (typeof value !== "string" || !/^(?:UTC|[A-Za-z]+(?:\/[A-Za-z0-9_+-]+)+)$/.test(value)) return false;
28
+ // An engine without ECMA-402 has no zone database: nothing it holds is a zone it knows.
29
+ if (typeof Intl === "object" && typeof Intl.DateTimeFormat === "function") {
30
+ try {
31
+ new Intl.DateTimeFormat("en-US", { timeZone: value });
32
+ return true;
33
+ } catch {
34
+ return false;
35
+ }
36
+ }
37
+ return false;
38
+ }
39
+
40
+ let zone = "";
41
+
42
+ /** Set from a load argument's `businessTimeZone`; anything that is not an IANA zone clears it. */
43
+ export function setBusinessTimeZone(value: unknown): void {
44
+ zone = isIanaTimeZone(value) ? value : "";
45
+ }
46
+
47
+ /** The business's IANA zone, or "" when the app has none provisioned. */
48
+ export function businessTimeZone(): string {
49
+ return zone;
50
+ }
51
+
52
+ /** Does `count` take the singular form in the app language? CLDR plural rules, so French "0 point"
53
+ * and "1,5 point" are singular and Hebrew "2" is not. An engine without PluralRules keeps the
54
+ * English rule (exactly one). */
55
+ export function isSingular(count: number, locale = appLocale()): boolean {
56
+ try {
57
+ // An engine without ECMA-402 has no `Intl` at all: it keeps the English rule.
58
+ if (typeof Intl === "object" && typeof Intl.PluralRules === "function") return new Intl.PluralRules(locale).select(count) === "one";
59
+ } catch { /* malformed tag — use the English rule */ }
60
+ return count === 1;
61
+ }
@@ -20,6 +20,8 @@
20
20
  // These helpers are the sanctioned way to format across the whole fleet: real ECMA-402 where it
21
21
  // exists, a deterministic en-US-shaped fallback where it does not, and never a throw.
22
22
 
23
+ import { appLocale } from "./app-locale.js";
24
+
23
25
  /** Is ECMA-402 actually present in THIS engine? Cheap, and safe in a realm without `Intl`. */
24
26
  export function hasIntl(): boolean {
25
27
  return typeof Intl !== "undefined";
@@ -189,7 +191,7 @@ const CURRENCY_DIGITS: Record<string, number> = {
189
191
  export function formatCurrency(
190
192
  amount: number,
191
193
  currency = "USD",
192
- locale = "en",
194
+ locale = appLocale(),
193
195
  /** Omit for the currency's natural digits. Pass 0 to render a whole amount as "$25" rather
194
196
  * than "$25.00" — Intl clamps the minimum down to match, so max<min does not throw here. */
195
197
  maximumFractionDigits?: number,
@@ -258,7 +260,7 @@ function groupThousands(fixed: string): string {
258
260
  * inserted commas into the exponent — `1e21` came out as "1e,+21" and `1e-7` as "1,e-7".
259
261
  * Garbage, and silently so, because nothing in the corpus's tidy test numbers reached it.
260
262
  */
261
- export function formatNumber(value: number, locale = "en"): string {
263
+ export function formatNumber(value: number, locale = appLocale()): string {
262
264
  if (!Number.isFinite(value)) return "";
263
265
  if (hasIntl()) return new Intl.NumberFormat(locale).format(value);
264
266
  // `toFixed` itself returns exponential notation at >=1e21, so anything that big keeps the
@@ -409,7 +411,7 @@ export function compareDateDesc(a: string, b: string): number {
409
411
  // Customers read that as sloppiness, and a whole "₪70" beside "₪69.50" reads as a different
410
412
  // kind of number. So: one money pattern, one clock, one range.
411
413
 
412
- // Money uses `formatCurrency(amount, currency, "en")` — the currency's NATURAL decimals
414
+ // Money uses `formatCurrency(amount, currency)` — English unless the app pins another language, see app-locale — the currency's NATURAL decimals
413
415
  // ("₪70.00", "¥500") — for Shop, Menu and every other price. The one exception is a Bookings
414
416
  // SERVICE price (`_shared/wix-service-price.ts`): it drops the cents of a whole amount ("₪70",
415
417
  // "₪69.50"), the format the redesigned service screen and services list were approved with. It
@@ -12,10 +12,12 @@
12
12
  // and every read returns `fallback` verbatim — routing a worker string through
13
13
  // copyParam is byte-for-byte behavior-preserving.
14
14
  //
15
- // Pure + Hermes-safe (no host globals, no Node APIs, no imports): bundled into
15
+ // Pure + Hermes-safe (no host globals, no Node APIs; its only import is the pure `app-locale` sibling): bundled into
16
16
  // every worker that emits user-facing copy, and copied verbatim into the
17
17
  // generated templates' tier5-src/_shared/.
18
18
 
19
+ import { isSingular, setAppLocale, setBusinessTimeZone } from "./app-locale.js";
20
+
19
21
  /** Customer strings override every read; translated stock is valid only for its
20
22
  * original English fallback. Some existing keys serve more than one message. */
21
23
  export type CopyPackValue = string | { source: string; translation: string };
@@ -29,6 +31,12 @@ let copyReceived = false;
29
31
  * stock fallbacks keep rendering. */
30
32
  export function stashCopy(arg: unknown): void {
31
33
  if (!arg || typeof arg !== "object") return;
34
+ // A param-carrying dispatch names the app language and business zone too (absent: the English house
35
+ // pattern, and no zone).
36
+ if ("copy" in arg || "locale" in arg || "businessTimeZone" in arg) {
37
+ setAppLocale((arg as Record<string, unknown>).locale);
38
+ setBusinessTimeZone((arg as Record<string, unknown>).businessTimeZone);
39
+ }
32
40
  const raw = (arg as Record<string, unknown>).copy;
33
41
  if (typeof raw !== "string" || !raw) return;
34
42
  try {
@@ -77,5 +85,5 @@ export function copyPlural(key: string, fallback: string, count: number): string
77
85
  const pattern = copyParam(key, fallback);
78
86
  const match = /^\{n, plural, one \{([^{}]*)\} other \{([^{}]*)\}\}$/.exec(pattern);
79
87
  if (!match) return copyTemplate(key, fallback, { n: count });
80
- return (count === 1 ? match[1] : match[2])!.replace(/#/g, String(count));
88
+ return (isSingular(count) ? match[1] : match[2])!.replace(/#/g, String(count));
81
89
  }
@@ -598,6 +598,13 @@ export default defineApp({
598
598
  "parentScreenId": "himi_group",
599
599
  "tabId": ""
600
600
  },
601
+ {
602
+ "screenId": "himi_my_groups",
603
+ "isPublic": true,
604
+ "paramKeys": [],
605
+ "parentScreenId": "himi_groups",
606
+ "tabId": ""
607
+ },
601
608
  {
602
609
  "screenId": "himi_cms",
603
610
  "isPublic": true,
@@ -66551,6 +66551,25 @@ const SCREENS = runtimeSetting({
66551
66551
  }
66552
66552
  }
66553
66553
  },
66554
+ {
66555
+ "id": "himi_groups.my_groups",
66556
+ "body": {
66557
+ "package": "himalaya",
66558
+ "type": "Button",
66559
+ "props": {
66560
+ "title": "See my groups",
66561
+ "style": "secondary",
66562
+ "fullWidth": true,
66563
+ "leadingIcon": "person",
66564
+ "action": {
66565
+ "actionId": "himi.open",
66566
+ "params": {
66567
+ "screenId": "himi_my_groups"
66568
+ }
66569
+ }
66570
+ }
66571
+ }
66572
+ },
66554
66573
  {
66555
66574
  "id": "himi_groups.search",
66556
66575
  "body": {
@@ -69599,6 +69618,456 @@ const SCREENS = runtimeSetting({
69599
69618
  "bundleVersion": "0.0.1"
69600
69619
  }
69601
69620
  },
69621
+ "himi_my_groups": {
69622
+ "screenId": "himi_my_groups",
69623
+ "renderer": "sdui_intent",
69624
+ "title": "",
69625
+ "schemaVersion": 1,
69626
+ "cacheControl": {
69627
+ "maxAge": 0,
69628
+ "staleWhileRevalidate": 0
69629
+ },
69630
+ "payload": {
69631
+ "id": "himi_my_groups.root",
69632
+ "body": {
69633
+ "package": "himalaya",
69634
+ "type": "VStack",
69635
+ "props": {
69636
+ "spacing": 16,
69637
+ "alignment": "leading",
69638
+ "children": [
69639
+ {
69640
+ "id": "himi_my_groups.title",
69641
+ "body": {
69642
+ "package": "himalaya",
69643
+ "type": "Text",
69644
+ "props": {
69645
+ "text": "My groups",
69646
+ "style": "title1"
69647
+ }
69648
+ }
69649
+ },
69650
+ {
69651
+ "id": "himi_my_groups.loading",
69652
+ "body": {
69653
+ "package": "himalaya",
69654
+ "type": "Skeleton",
69655
+ "props": {
69656
+ "height": 160,
69657
+ "cornerRadius": 8,
69658
+ "count": 2
69659
+ }
69660
+ },
69661
+ "modifiers": {
69662
+ "hiddenPath": "$service:himiBrandedMyGroups.notLoading"
69663
+ }
69664
+ },
69665
+ {
69666
+ "id": "himi_my_groups.error",
69667
+ "body": {
69668
+ "package": "himalaya",
69669
+ "type": "VStack",
69670
+ "props": {
69671
+ "spacing": 8,
69672
+ "alignment": "leading",
69673
+ "children": [
69674
+ {
69675
+ "id": "",
69676
+ "body": {
69677
+ "package": "himalaya",
69678
+ "type": "Text",
69679
+ "props": {
69680
+ "text": "Your groups are temporarily unavailable.",
69681
+ "style": "bodyEmphasis"
69682
+ }
69683
+ }
69684
+ },
69685
+ {
69686
+ "id": "",
69687
+ "body": {
69688
+ "package": "himalaya",
69689
+ "type": "Text",
69690
+ "props": {
69691
+ "text": "$service:himiBrandedMyGroups.errorText",
69692
+ "style": "footnote",
69693
+ "color": "textSecondary",
69694
+ "collapseWhenEmpty": true
69695
+ }
69696
+ }
69697
+ },
69698
+ {
69699
+ "id": "himi_my_groups.retry",
69700
+ "body": {
69701
+ "package": "himalaya",
69702
+ "type": "Button",
69703
+ "props": {
69704
+ "title": "Try again",
69705
+ "style": "secondary",
69706
+ "action": {
69707
+ "actionId": "tier5.himiBrandedMyGroups.load"
69708
+ }
69709
+ }
69710
+ }
69711
+ }
69712
+ ]
69713
+ }
69714
+ },
69715
+ "modifiers": {
69716
+ "background": {
69717
+ "token": "surfaceElevated"
69718
+ },
69719
+ "border": {
69720
+ "width": 1,
69721
+ "color": {
69722
+ "token": "border"
69723
+ }
69724
+ },
69725
+ "cornerRadius": 4,
69726
+ "padding": {
69727
+ "leading": 16,
69728
+ "trailing": 16,
69729
+ "top": 16,
69730
+ "bottom": 16
69731
+ },
69732
+ "hiddenPath": "$service:himiBrandedMyGroups.notErrored"
69733
+ }
69734
+ },
69735
+ {
69736
+ "id": "himi_my_groups.partial",
69737
+ "body": {
69738
+ "package": "himalaya",
69739
+ "type": "Text",
69740
+ "props": {
69741
+ "text": "$service:himiBrandedMyGroups.partialText",
69742
+ "style": "footnote",
69743
+ "color": "textSecondary",
69744
+ "collapseWhenEmpty": true
69745
+ }
69746
+ },
69747
+ "modifiers": {
69748
+ "hiddenPath": "$service:himiBrandedMyGroups.noPartial"
69749
+ }
69750
+ },
69751
+ {
69752
+ "id": "himi_my_groups.rows",
69753
+ "body": {
69754
+ "package": "himalaya",
69755
+ "type": "Grid",
69756
+ "props": {
69757
+ "columns": 1,
69758
+ "spacing": 10,
69759
+ "itemsPath": "$service:himiBrandedMyGroups.rows",
69760
+ "items": [
69761
+ {
69762
+ "id": "himi_my_groups.row",
69763
+ "body": {
69764
+ "package": "himalaya",
69765
+ "type": "VStack",
69766
+ "props": {
69767
+ "spacing": 9,
69768
+ "alignment": "leading",
69769
+ "children": [
69770
+ {
69771
+ "id": "",
69772
+ "body": {
69773
+ "package": "himalaya",
69774
+ "type": "Image",
69775
+ "props": {
69776
+ "url": "$item.image",
69777
+ "fillWidth": true,
69778
+ "height": 120,
69779
+ "contentMode": "fill",
69780
+ "contentDescription": "$item.title"
69781
+ }
69782
+ },
69783
+ "modifiers": {
69784
+ "cornerRadius": 8,
69785
+ "fillMaxWidth": true,
69786
+ "hiddenPath": "$item.noImage"
69787
+ }
69788
+ },
69789
+ {
69790
+ "id": "himi_my_groups.row.monogram",
69791
+ "body": {
69792
+ "package": "himalaya",
69793
+ "type": "ZStack",
69794
+ "props": {
69795
+ "alignment": "center",
69796
+ "children": [
69797
+ {
69798
+ "id": "",
69799
+ "body": {
69800
+ "package": "himalaya",
69801
+ "type": "Text",
69802
+ "props": {
69803
+ "text": "$item.initial",
69804
+ "style": "display",
69805
+ "color": "textOnAccent",
69806
+ "maxLines": 1
69807
+ }
69808
+ }
69809
+ }
69810
+ ]
69811
+ }
69812
+ },
69813
+ "modifiers": {
69814
+ "fillMaxWidth": true,
69815
+ "height": 120,
69816
+ "background": {
69817
+ "token": "accentPrimary"
69818
+ },
69819
+ "cornerRadius": 8,
69820
+ "hiddenPath": "$item.hasImage"
69821
+ }
69822
+ },
69823
+ {
69824
+ "id": "",
69825
+ "body": {
69826
+ "package": "himalaya",
69827
+ "type": "Text",
69828
+ "props": {
69829
+ "text": "$item.title",
69830
+ "style": "bodyEmphasis",
69831
+ "maxLines": 2
69832
+ }
69833
+ }
69834
+ },
69835
+ {
69836
+ "id": "",
69837
+ "body": {
69838
+ "package": "himalaya",
69839
+ "type": "Text",
69840
+ "props": {
69841
+ "text": "$item.statusLabel",
69842
+ "style": "footnote",
69843
+ "color": "accentPrimary",
69844
+ "maxLines": 1,
69845
+ "collapseWhenEmpty": true
69846
+ }
69847
+ }
69848
+ },
69849
+ {
69850
+ "id": "",
69851
+ "body": {
69852
+ "package": "himalaya",
69853
+ "type": "Text",
69854
+ "props": {
69855
+ "text": "$item.meta",
69856
+ "style": "caption",
69857
+ "color": "textTertiary",
69858
+ "maxLines": 1,
69859
+ "collapseWhenEmpty": true
69860
+ }
69861
+ }
69862
+ }
69863
+ ]
69864
+ }
69865
+ },
69866
+ "modifiers": {
69867
+ "background": {
69868
+ "token": "surfaceElevated"
69869
+ },
69870
+ "border": {
69871
+ "width": 1,
69872
+ "color": {
69873
+ "token": "border"
69874
+ }
69875
+ },
69876
+ "cornerRadius": 8,
69877
+ "padding": {
69878
+ "leading": 12,
69879
+ "trailing": 12,
69880
+ "top": 12,
69881
+ "bottom": 12
69882
+ },
69883
+ "onTap": {
69884
+ "actionId": "himi.open",
69885
+ "params": {
69886
+ "screenId": "$item.detailScreenId",
69887
+ "id": "$item.id"
69888
+ }
69889
+ },
69890
+ "pressFeedback": "scale",
69891
+ "haptic": "light",
69892
+ "accessibilityLabel": "$item.title"
69893
+ }
69894
+ }
69895
+ ]
69896
+ }
69897
+ },
69898
+ "modifiers": {
69899
+ "hiddenPath": "$service:himiBrandedMyGroups.noRows"
69900
+ }
69901
+ },
69902
+ {
69903
+ "id": "himi_my_groups.empty",
69904
+ "body": {
69905
+ "package": "himalaya",
69906
+ "type": "VStack",
69907
+ "props": {
69908
+ "spacing": 8,
69909
+ "alignment": "leading",
69910
+ "children": [
69911
+ {
69912
+ "id": "",
69913
+ "body": {
69914
+ "package": "himalaya",
69915
+ "type": "Text",
69916
+ "props": {
69917
+ "text": "$service:himiBrandedMyGroups.emptyText",
69918
+ "style": "body",
69919
+ "color": "textSecondary",
69920
+ "collapseWhenEmpty": true
69921
+ }
69922
+ }
69923
+ }
69924
+ ]
69925
+ }
69926
+ },
69927
+ "modifiers": {
69928
+ "background": {
69929
+ "token": "surfaceElevated"
69930
+ },
69931
+ "border": {
69932
+ "width": 1,
69933
+ "color": {
69934
+ "token": "border"
69935
+ }
69936
+ },
69937
+ "cornerRadius": 4,
69938
+ "padding": {
69939
+ "leading": 16,
69940
+ "trailing": 16,
69941
+ "top": 16,
69942
+ "bottom": 16
69943
+ },
69944
+ "fillMaxWidth": true,
69945
+ "hiddenPath": "$service:himiBrandedMyGroups.noEmpty"
69946
+ }
69947
+ },
69948
+ {
69949
+ "id": "himi_my_groups.member_gate",
69950
+ "body": {
69951
+ "package": "himalaya",
69952
+ "type": "VStack",
69953
+ "props": {
69954
+ "spacing": 10,
69955
+ "alignment": "center",
69956
+ "children": [
69957
+ {
69958
+ "id": "",
69959
+ "body": {
69960
+ "package": "himalaya",
69961
+ "type": "Icon",
69962
+ "props": {
69963
+ "name": "person",
69964
+ "size": 28,
69965
+ "tint": "accentPrimary"
69966
+ }
69967
+ },
69968
+ "modifiers": {
69969
+ "accessibilityRole": "decorative"
69970
+ }
69971
+ },
69972
+ {
69973
+ "id": "himi_my_groups.member_gate_title",
69974
+ "body": {
69975
+ "package": "himalaya",
69976
+ "type": "Text",
69977
+ "props": {
69978
+ "text": "Sign in to see your groups",
69979
+ "style": "bodyEmphasis"
69980
+ }
69981
+ }
69982
+ },
69983
+ {
69984
+ "id": "",
69985
+ "body": {
69986
+ "package": "himalaya",
69987
+ "type": "Text",
69988
+ "props": {
69989
+ "text": "The groups you belong to show up here once you sign in.",
69990
+ "style": "footnote",
69991
+ "color": "textSecondary"
69992
+ }
69993
+ }
69994
+ },
69995
+ {
69996
+ "id": "himi_my_groups.member_gate_signin",
69997
+ "body": {
69998
+ "package": "himalaya",
69999
+ "type": "Button",
70000
+ "props": {
70001
+ "title": "Sign in",
70002
+ "style": "primary",
70003
+ "fullWidth": true,
70004
+ "action": {
70005
+ "actionId": "himi.open",
70006
+ "params": {
70007
+ "screenId": "himi_sign_in",
70008
+ "mode": "signin",
70009
+ "intent": "groups",
70010
+ "returnScreenId": "himi_my_groups",
70011
+ "modal": "1"
70012
+ },
70013
+ "presentation": "sheet"
70014
+ }
70015
+ }
70016
+ }
70017
+ }
70018
+ ]
70019
+ }
70020
+ },
70021
+ "modifiers": {
70022
+ "background": {
70023
+ "token": "surfaceElevated"
70024
+ },
70025
+ "border": {
70026
+ "width": 1,
70027
+ "color": {
70028
+ "token": "border"
70029
+ }
70030
+ },
70031
+ "cornerRadius": 16,
70032
+ "padding": {
70033
+ "leading": 16,
70034
+ "trailing": 16,
70035
+ "top": 20,
70036
+ "bottom": 20
70037
+ },
70038
+ "fillMaxWidth": true,
70039
+ "hiddenPath": "$service:himiBrandedMyGroups.noSignIn"
70040
+ }
70041
+ }
70042
+ ]
70043
+ }
70044
+ },
70045
+ "modifiers": {
70046
+ "background": {
70047
+ "token": "surfacePrimary"
70048
+ },
70049
+ "padding": {
70050
+ "leading": 16,
70051
+ "trailing": 16,
70052
+ "top": 18,
70053
+ "bottom": 28
70054
+ },
70055
+ "onAppear": {
70056
+ "actionId": "tier5.himiBrandedMyGroups.load"
70057
+ }
70058
+ }
70059
+ },
70060
+ "logicBundle": {
70061
+ "url": "http://localhost:8190/v1/bundles/himi-branded-lite-my-groups?integrity=",
70062
+ "integrity": "",
70063
+ "contentType": "application/javascript+ts-bundle",
70064
+ "declaredCapabilities": [
70065
+ "wix_api"
70066
+ ],
70067
+ "minBinaryVersion": "0.1.0",
70068
+ "bundleVersion": "0.0.1"
70069
+ }
70070
+ },
69602
70071
  "himi_faq": {
69603
70072
  "screenId": "himi_faq",
69604
70073
  "renderer": "sdui_intent",
@@ -172,6 +172,9 @@
172
172
  "himi_my_events": {
173
173
  "displayName": "My Events"
174
174
  },
175
+ "himi_my_groups": {
176
+ "displayName": "My Groups"
177
+ },
175
178
  "himi_my_subscriptions": {
176
179
  "displayName": "My Subscriptions"
177
180
  },