@wix/himalaya-cli 0.1034.0 → 0.1036.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 (234) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +7 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/events/src/display.d.ts +13 -1
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-events.mjs +28 -6
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores-collections.mjs +1 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-stores.mjs +7 -1
  6. package/dist/cli.mjs +25 -19
  7. package/dist/preview-assets.generated.bin +0 -0
  8. package/guides/sdk-reference.json +16 -4
  9. package/package.json +2 -2
  10. package/templates/beauty-salon/dev/index.ts +72 -175
  11. package/templates/beauty-salon/tier5-src/_shared/collection-contract.ts +16 -9
  12. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +19 -5
  13. package/templates/beauty-salon/tier5-src/_shared/engine-intl.ts +51 -0
  14. package/templates/beauty-salon/tier5-src/_shared/himi-restaurants.ts +4 -4
  15. package/templates/beauty-salon/tier5-src/_shared/owner-load-error.ts +49 -0
  16. package/templates/beauty-salon/tier5-src/_shared/wix-service-price.ts +1 -1
  17. package/templates/beauty-salon/tier5-src/himi-branded-lite-info/index.ts +5 -2
  18. package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  19. package/templates/beauty-salon/tier5-src/wix-spaces-collections/index.ts +1 -1
  20. package/templates/beauty-salon/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  21. package/templates/beauty-salon-owner/dev/index.ts +84 -599
  22. package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +22 -6
  23. package/templates/beauty-salon-owner/tier5-src/_shared/collection-contract.ts +16 -9
  24. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +19 -5
  25. package/templates/beauty-salon-owner/tier5-src/_shared/engine-intl.ts +51 -0
  26. package/templates/beauty-salon-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  27. package/templates/branded-lite/dev/index.ts +178 -264
  28. package/templates/branded-lite/tier5-src/_shared/collection-contract.ts +16 -9
  29. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +19 -5
  30. package/templates/branded-lite/tier5-src/_shared/engine-intl.ts +51 -0
  31. package/templates/branded-lite/tier5-src/_shared/himi-restaurants.ts +4 -4
  32. package/templates/branded-lite/tier5-src/_shared/owner-load-error.ts +49 -0
  33. package/templates/branded-lite/tier5-src/_shared/wix-service-price.ts +1 -1
  34. package/templates/branded-lite/tier5-src/himi-branded-lite-cms/index.ts +5 -5
  35. package/templates/branded-lite/tier5-src/himi-branded-lite-coupons/index.ts +33 -7
  36. package/templates/branded-lite/tier5-src/himi-branded-lite-donations/index.ts +3 -3
  37. package/templates/branded-lite/tier5-src/himi-branded-lite-forms/index.ts +11 -10
  38. package/templates/branded-lite/tier5-src/himi-branded-lite-giftcards/index.ts +3 -3
  39. package/templates/branded-lite/tier5-src/himi-branded-lite-info/index.ts +5 -2
  40. package/templates/branded-lite/tier5-src/himi-branded-lite-invoices/index.ts +3 -3
  41. package/templates/branded-lite/tier5-src/himi-branded-lite-loyalty/index.ts +1 -1
  42. package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  43. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +1 -1
  44. package/templates/branded-lite/tier5-src/himi-branded-lite-reserve/index.ts +5 -3
  45. package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +1 -1
  46. package/templates/branded-lite/tier5-src/himi-events-list/index.ts +20 -4
  47. package/templates/branded-lite/tier5-src/himi-events-my-events/index.ts +2 -2
  48. package/templates/branded-lite/tier5-src/wix-spaces-collections/index.ts +1 -1
  49. package/templates/branded-lite/tier5-src/wix-spaces-forum/index.ts +7 -1
  50. package/templates/branded-lite/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  51. package/templates/community-club/dev/index.ts +62 -81
  52. package/templates/community-club/tier5-src/_shared/collection-contract.ts +16 -9
  53. package/templates/community-club/tier5-src/_shared/collection-service.ts +19 -5
  54. package/templates/community-club/tier5-src/_shared/engine-intl.ts +51 -0
  55. package/templates/community-club/tier5-src/_shared/himi-restaurants.ts +4 -4
  56. package/templates/community-club/tier5-src/_shared/owner-load-error.ts +49 -0
  57. package/templates/community-club/tier5-src/_shared/wix-service-price.ts +1 -1
  58. package/templates/community-club/tier5-src/himi-branded-lite-cms/index.ts +5 -5
  59. package/templates/community-club/tier5-src/himi-branded-lite-info/index.ts +5 -2
  60. package/templates/community-club/tier5-src/himi-events-detail/index.ts +1 -1
  61. package/templates/community-club/tier5-src/himi-events-list/index.ts +20 -4
  62. package/templates/community-club/tier5-src/himi-events-my-events/index.ts +2 -2
  63. package/templates/community-club/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  64. package/templates/community-club-owner/dev/index.ts +84 -599
  65. package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +22 -6
  66. package/templates/community-club-owner/tier5-src/_shared/collection-contract.ts +16 -9
  67. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +19 -5
  68. package/templates/community-club-owner/tier5-src/_shared/engine-intl.ts +51 -0
  69. package/templates/community-club-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  70. package/templates/community-club-owner/tier5-src/himi-owner-lite-events/index.ts +1 -0
  71. package/templates/events-meetups/dev/index.ts +60 -79
  72. package/templates/events-meetups/tier5-src/_shared/collection-contract.ts +16 -9
  73. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +19 -5
  74. package/templates/events-meetups/tier5-src/_shared/engine-intl.ts +51 -0
  75. package/templates/events-meetups/tier5-src/_shared/himi-restaurants.ts +4 -4
  76. package/templates/events-meetups/tier5-src/_shared/owner-load-error.ts +49 -0
  77. package/templates/events-meetups/tier5-src/_shared/wix-service-price.ts +1 -1
  78. package/templates/events-meetups/tier5-src/himi-branded-lite-info/index.ts +5 -2
  79. package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +1 -1
  80. package/templates/events-meetups/tier5-src/himi-events-list/index.ts +20 -4
  81. package/templates/events-meetups/tier5-src/himi-events-my-events/index.ts +2 -2
  82. package/templates/events-meetups/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  83. package/templates/events-meetups-owner/dev/index.ts +84 -543
  84. package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +22 -6
  85. package/templates/events-meetups-owner/tier5-src/_shared/collection-contract.ts +16 -9
  86. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +19 -5
  87. package/templates/events-meetups-owner/tier5-src/_shared/engine-intl.ts +51 -0
  88. package/templates/events-meetups-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  89. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-events/index.ts +1 -0
  90. package/templates/gym-fitness/dev/index.ts +73 -204
  91. package/templates/gym-fitness/tier5-src/_shared/collection-contract.ts +16 -9
  92. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +19 -5
  93. package/templates/gym-fitness/tier5-src/_shared/engine-intl.ts +51 -0
  94. package/templates/gym-fitness/tier5-src/_shared/himi-restaurants.ts +4 -4
  95. package/templates/gym-fitness/tier5-src/_shared/owner-load-error.ts +49 -0
  96. package/templates/gym-fitness/tier5-src/_shared/wix-service-price.ts +1 -1
  97. package/templates/gym-fitness/tier5-src/himi-branded-lite-info/index.ts +5 -2
  98. package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  99. package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +1 -1
  100. package/templates/gym-fitness/tier5-src/himi-events-list/index.ts +20 -4
  101. package/templates/gym-fitness/tier5-src/himi-events-my-events/index.ts +2 -2
  102. package/templates/gym-fitness/tier5-src/wix-spaces-collections/index.ts +1 -1
  103. package/templates/gym-fitness/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  104. package/templates/gym-fitness-owner/dev/index.ts +84 -627
  105. package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +22 -6
  106. package/templates/gym-fitness-owner/tier5-src/_shared/collection-contract.ts +16 -9
  107. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +19 -5
  108. package/templates/gym-fitness-owner/tier5-src/_shared/engine-intl.ts +51 -0
  109. package/templates/gym-fitness-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  110. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-events/index.ts +1 -0
  111. package/templates/himi-chat/tier5-src/_shared/owner-load-error.ts +49 -0
  112. package/templates/nonprofit-cause/dev/index.ts +71 -90
  113. package/templates/nonprofit-cause/tier5-src/_shared/collection-contract.ts +16 -9
  114. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +19 -5
  115. package/templates/nonprofit-cause/tier5-src/_shared/engine-intl.ts +51 -0
  116. package/templates/nonprofit-cause/tier5-src/_shared/himi-restaurants.ts +4 -4
  117. package/templates/nonprofit-cause/tier5-src/_shared/owner-load-error.ts +49 -0
  118. package/templates/nonprofit-cause/tier5-src/_shared/wix-service-price.ts +1 -1
  119. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-info/index.ts +5 -2
  120. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  121. package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +1 -1
  122. package/templates/nonprofit-cause/tier5-src/himi-events-list/index.ts +20 -4
  123. package/templates/nonprofit-cause/tier5-src/himi-events-my-events/index.ts +2 -2
  124. package/templates/nonprofit-cause/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  125. package/templates/nonprofit-cause-owner/dev/index.ts +84 -571
  126. package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +22 -6
  127. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-contract.ts +16 -9
  128. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +19 -5
  129. package/templates/nonprofit-cause-owner/tier5-src/_shared/engine-intl.ts +51 -0
  130. package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  131. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-events/index.ts +1 -0
  132. package/templates/owner-lite/dev/index.ts +84 -627
  133. package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +22 -6
  134. package/templates/owner-lite/tier5-src/_shared/collection-contract.ts +16 -9
  135. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +19 -5
  136. package/templates/owner-lite/tier5-src/_shared/engine-intl.ts +51 -0
  137. package/templates/owner-lite/tier5-src/_shared/owner-load-error.ts +49 -0
  138. package/templates/owner-lite/tier5-src/himi-owner-lite-events/index.ts +1 -0
  139. package/templates/podcast-creator/dev/index.ts +71 -90
  140. package/templates/podcast-creator/tier5-src/_shared/collection-contract.ts +16 -9
  141. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +19 -5
  142. package/templates/podcast-creator/tier5-src/_shared/engine-intl.ts +51 -0
  143. package/templates/podcast-creator/tier5-src/_shared/himi-restaurants.ts +4 -4
  144. package/templates/podcast-creator/tier5-src/_shared/owner-load-error.ts +49 -0
  145. package/templates/podcast-creator/tier5-src/_shared/wix-service-price.ts +1 -1
  146. package/templates/podcast-creator/tier5-src/himi-branded-lite-info/index.ts +5 -2
  147. package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  148. package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +1 -1
  149. package/templates/podcast-creator/tier5-src/himi-events-list/index.ts +20 -4
  150. package/templates/podcast-creator/tier5-src/himi-events-my-events/index.ts +2 -2
  151. package/templates/podcast-creator/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  152. package/templates/podcast-creator-owner/dev/index.ts +84 -599
  153. package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +22 -6
  154. package/templates/podcast-creator-owner/tier5-src/_shared/collection-contract.ts +16 -9
  155. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +19 -5
  156. package/templates/podcast-creator-owner/tier5-src/_shared/engine-intl.ts +51 -0
  157. package/templates/podcast-creator-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  158. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-events/index.ts +1 -0
  159. package/templates/portfolio-creative/dev/index.ts +62 -137
  160. package/templates/portfolio-creative/tier5-src/_shared/collection-contract.ts +16 -9
  161. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +19 -5
  162. package/templates/portfolio-creative/tier5-src/_shared/engine-intl.ts +51 -0
  163. package/templates/portfolio-creative/tier5-src/_shared/himi-restaurants.ts +4 -4
  164. package/templates/portfolio-creative/tier5-src/_shared/owner-load-error.ts +49 -0
  165. package/templates/portfolio-creative/tier5-src/_shared/wix-service-price.ts +1 -1
  166. package/templates/portfolio-creative/tier5-src/himi-branded-lite-info/index.ts +5 -2
  167. package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +1 -1
  168. package/templates/portfolio-creative/tier5-src/himi-events-list/index.ts +20 -4
  169. package/templates/portfolio-creative/tier5-src/himi-events-my-events/index.ts +2 -2
  170. package/templates/portfolio-creative/tier5-src/wix-spaces-collections/index.ts +1 -1
  171. package/templates/portfolio-creative/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  172. package/templates/portfolio-creative-owner/dev/index.ts +84 -599
  173. package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +22 -6
  174. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-contract.ts +16 -9
  175. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +19 -5
  176. package/templates/portfolio-creative-owner/tier5-src/_shared/engine-intl.ts +51 -0
  177. package/templates/portfolio-creative-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  178. package/templates/restaurant/dev/index.ts +124 -101
  179. package/templates/restaurant/tier5-src/_shared/collection-contract.ts +16 -9
  180. package/templates/restaurant/tier5-src/_shared/collection-service.ts +19 -5
  181. package/templates/restaurant/tier5-src/_shared/engine-intl.ts +51 -0
  182. package/templates/restaurant/tier5-src/_shared/himi-restaurants.ts +4 -4
  183. package/templates/restaurant/tier5-src/_shared/owner-load-error.ts +49 -0
  184. package/templates/restaurant/tier5-src/_shared/wix-service-price.ts +1 -1
  185. package/templates/restaurant/tier5-src/himi-branded-lite-info/index.ts +5 -2
  186. package/templates/restaurant/tier5-src/himi-branded-lite-reserve/index.ts +5 -3
  187. package/templates/restaurant/tier5-src/himi-events-detail/index.ts +1 -1
  188. package/templates/restaurant/tier5-src/himi-events-list/index.ts +20 -4
  189. package/templates/restaurant/tier5-src/himi-events-my-events/index.ts +2 -2
  190. package/templates/restaurant/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  191. package/templates/restaurant-owner/dev/index.ts +84 -627
  192. package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +22 -6
  193. package/templates/restaurant-owner/tier5-src/_shared/collection-contract.ts +16 -9
  194. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +19 -5
  195. package/templates/restaurant-owner/tier5-src/_shared/engine-intl.ts +51 -0
  196. package/templates/restaurant-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  197. package/templates/restaurant-owner/tier5-src/himi-owner-lite-events/index.ts +1 -0
  198. package/templates/retail-store/dev/index.ts +59 -106
  199. package/templates/retail-store/tier5-src/_shared/collection-contract.ts +16 -9
  200. package/templates/retail-store/tier5-src/_shared/collection-service.ts +19 -5
  201. package/templates/retail-store/tier5-src/_shared/engine-intl.ts +51 -0
  202. package/templates/retail-store/tier5-src/_shared/himi-restaurants.ts +4 -4
  203. package/templates/retail-store/tier5-src/_shared/owner-load-error.ts +49 -0
  204. package/templates/retail-store/tier5-src/_shared/wix-service-price.ts +1 -1
  205. package/templates/retail-store/tier5-src/himi-branded-lite-info/index.ts +5 -2
  206. package/templates/retail-store/tier5-src/wix-spaces-collections/index.ts +1 -1
  207. package/templates/retail-store/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  208. package/templates/retail-store-owner/dev/index.ts +84 -571
  209. package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +22 -6
  210. package/templates/retail-store-owner/tier5-src/_shared/collection-contract.ts +16 -9
  211. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +19 -5
  212. package/templates/retail-store-owner/tier5-src/_shared/engine-intl.ts +51 -0
  213. package/templates/retail-store-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  214. package/templates/yoga-studio/dev/index.ts +73 -148
  215. package/templates/yoga-studio/tier5-src/_shared/collection-contract.ts +16 -9
  216. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +19 -5
  217. package/templates/yoga-studio/tier5-src/_shared/engine-intl.ts +51 -0
  218. package/templates/yoga-studio/tier5-src/_shared/himi-restaurants.ts +4 -4
  219. package/templates/yoga-studio/tier5-src/_shared/owner-load-error.ts +49 -0
  220. package/templates/yoga-studio/tier5-src/_shared/wix-service-price.ts +1 -1
  221. package/templates/yoga-studio/tier5-src/himi-branded-lite-info/index.ts +5 -2
  222. package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +1 -1
  223. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +1 -1
  224. package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +1 -1
  225. package/templates/yoga-studio/tier5-src/himi-events-list/index.ts +20 -4
  226. package/templates/yoga-studio/tier5-src/himi-events-my-events/index.ts +2 -2
  227. package/templates/yoga-studio/tier5-src/wix-spaces-whats-new/index.ts +4 -4
  228. package/templates/yoga-studio-owner/dev/index.ts +84 -571
  229. package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +22 -6
  230. package/templates/yoga-studio-owner/tier5-src/_shared/collection-contract.ts +16 -9
  231. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +19 -5
  232. package/templates/yoga-studio-owner/tier5-src/_shared/engine-intl.ts +51 -0
  233. package/templates/yoga-studio-owner/tier5-src/_shared/owner-load-error.ts +49 -0
  234. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-events/index.ts +1 -0
@@ -11,7 +11,7 @@ import { wixMediaUrl, type WixImageSize } from "@himalaya/wix-media";
11
11
  // copier recognizes + carries the dependency; resolves to the same file here
12
12
  // and in the scaffolded tier5-src/_shared/ layout.
13
13
  import { cleanTitle, initials } from "../_shared/himi-text.js";
14
- import { formatCurrency } from "../_shared/engine-intl.js";
14
+ import { formatCurrency, normalizeFormattedPrice } from "../_shared/engine-intl.js";
15
15
 
16
16
  /** One dish tile/row: the media-XOR-initials card contract every himi list
17
17
  * uses, plus a formatted price line and the templated detail screen id. */
@@ -97,13 +97,13 @@ export function itemPriceLine(item: WixItem): string {
97
97
  | { price?: unknown; currency?: unknown; formattedPrice?: unknown }
98
98
  | undefined;
99
99
  const formatted = typeof info?.formattedPrice === "string" ? info.formattedPrice.trim() : "";
100
- if (formatted) return formatted;
100
+ if (formatted) return normalizeFormattedPrice(formatted);
101
101
  const price = info?.price;
102
102
  if (price == null || price === "" || Number.isNaN(Number(price))) return "";
103
103
  const currency = typeof info?.currency === "string" ? info.currency : "";
104
104
  if (!currency) return `${price}`;
105
105
  try {
106
- return formatCurrency(Number(price), currency, "en", Number(price) % 1 === 0 ? 0 : 2);
106
+ return formatCurrency(Number(price), currency, "en");
107
107
  } catch {
108
108
  return `${price}`;
109
109
  }
@@ -149,7 +149,7 @@ export function itemPriceVariants(item: WixItem): Array<{ id: string; name: stri
149
149
  let priceLine = `${price}`;
150
150
  if (currency) {
151
151
  try {
152
- priceLine = formatCurrency(Number(price), currency, "en", Number(price) % 1 === 0 ? 0 : 2);
152
+ priceLine = formatCurrency(Number(price), currency, "en");
153
153
  } catch { /* keep the bare amount */ }
154
154
  }
155
155
  rows.push({ id: typeof node.id === "string" && node.id ? node.id : `variant-${index}`, name: name || "Option", priceLine });
@@ -74,6 +74,54 @@ const SITE_CONTEXT_CODES = ["MISSING_METASITE_ID", "MISSING_REQUEST_SITE_CONTEXT
74
74
  * message and starts being a payload dump. */
75
75
  const MAX_RAW = 200;
76
76
 
77
+ /**
78
+ * A TRANSPORT failure: the request never got an HTTP answer at all.
79
+ *
80
+ * Each host describes one in its own platform's words, and every one of them is a
81
+ * diagnostic dump rather than a message. iOS's JSWorker hands a worker the Swift
82
+ * description of the `NSError` —
83
+ * `Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server."
84
+ * UserInfo={… NSErrorFailingURLStringKey=http://127.0.0.1:8178/__dev/wix/proxy, …}`
85
+ * — which Aria painted verbatim: the domain, the code, and the local server's
86
+ * own URL. Android's bridge carries the `java.net` exception text, and a browser's
87
+ * fetch rejects with "Failed to fetch" / "Load failed" / "NetworkError …".
88
+ *
89
+ * Only a message with NO HTTP status qualifies: a status means Wix answered, and
90
+ * that case keeps its own reductions below.
91
+ */
92
+ const TRANSPORT = [
93
+ /\bError Domain=\w+/, // any Cocoa NSError description
94
+ /\bNSURLErrorDomain\b/,
95
+ /\bjava\.(?:net|io)\.\w+(?:Exception|Error)\b/,
96
+ /\b(?:UnknownHost|Connect|SocketTimeout|NoRouteToHost|SSLHandshake)Exception\b/,
97
+ // Android's WebViewJSWorker bridges `e.message ?: e.javaClass.simpleName`, so
98
+ // the class name is usually absent and only OkHttp's own message arrives.
99
+ /^Failed to connect to \S/,
100
+ /^Unable to resolve host\b/,
101
+ /\b(?:Connection refused|Network is unreachable|Software caused connection abort)\b/,
102
+ /^(?:timeout|Read timed out|connect timed out)$/i,
103
+ /\bFailed to fetch\b/,
104
+ /\bNetworkError when attempting to fetch\b/,
105
+ /^(?:TypeError: )?Load failed$/,
106
+ /\bnet::ERR_[A-Z_]+/,
107
+ ];
108
+
109
+ /** Did this failure happen below HTTP — no answer from Wix at all? */
110
+ export function isTransportFailure(e: unknown): boolean {
111
+ const msg = String((e as Error)?.message ?? e ?? "");
112
+ if (STATUS.test(msg)) return false;
113
+ return TRANSPORT.some((re) => re.test(msg));
114
+ }
115
+
116
+ /** The one sentence for a transport failure. Copy-as-configuration: the key is
117
+ * under `ownerCommon.`, which every owner screen (Aria included) forwards. */
118
+ export function ownerTransportFailureText(): string {
119
+ return copyParam(
120
+ "ownerCommon.networkUnreachable",
121
+ "Couldn’t reach Wix. Check your connection and try again.",
122
+ );
123
+ }
124
+
77
125
  /**
78
126
  * Reduce a wire failure to something a PERSON can read.
79
127
  *
@@ -85,6 +133,7 @@ const MAX_RAW = 200;
85
133
  * markup; a long non-HTML body is truncated for the same reason.
86
134
  */
87
135
  function humanWireError(msg: string): string {
136
+ if (isTransportFailure(msg)) return ownerTransportFailureText();
88
137
  const status = STATUS.exec(msg)?.[1];
89
138
  // A JSON ENVELOPE or a NAMED REASON CODE is the machine's word for it, and the
90
139
  // owner gets neither. Both reductions used to live in `ownerDisplayError` only,
@@ -119,7 +119,7 @@ export function formatServicePrice(service: unknown): string {
119
119
  if (amount == null) return "";
120
120
  const currency = serviceCurrency(service);
121
121
  try {
122
- return formatCurrency(amount, currency, "en", 0);
122
+ return formatCurrency(amount, currency, "en");
123
123
  } catch {
124
124
  return `${amount}`;
125
125
  }
@@ -112,7 +112,10 @@ const svc = defineService<State, {
112
112
  // Probe before revealing anything picker-shaped (spec R8) — on a customer build this
113
113
  // stays false and the whole subtree is hidden.
114
114
  const canPick = await pickerAvailable();
115
- next = { ...next, pickerAvailable: canPick, pickerHidden: !canPick };
115
+ // The runtime line names the internal platform ("HimalayaCore 0.0.1") — a number for
116
+ // whoever debugs the build, not for a white-label app's customer ([branded-lite-qa]
117
+ // #3002/#3083). It shows only on a build that opted into the QA picker.
118
+ next = { ...next, pickerAvailable: canPick, pickerHidden: !canPick, runtimeLine: canPick ? next.runtimeLine : "" };
116
119
  if (canPick) {
117
120
  // `active()` is more precise than app-info's releasePinned: it also says WHICH pin
118
121
  // (user vs baked) is holding the release.
@@ -122,7 +125,7 @@ const svc = defineService<State, {
122
125
  }
123
126
  }
124
127
  } catch {
125
- next = { ...next, pickerAvailable: false, pickerHidden: true };
128
+ next = { ...next, pickerAvailable: false, pickerHidden: true, runtimeLine: "" };
126
129
  }
127
130
  return next;
128
131
  },
@@ -78,7 +78,7 @@ function money(plan: WixPlan): string {
78
78
  const raw = price?.value;
79
79
  if (raw == null || raw === "" || Number.isNaN(Number(raw))) return "";
80
80
  try {
81
- return formatCurrency(Number(raw), price?.currency || "USD", "en", Number(raw) % 1 === 0 ? 0 : 2);
81
+ return formatCurrency(Number(raw), price?.currency || "USD", "en");
82
82
  } catch {
83
83
  return `${raw}`;
84
84
  }
@@ -162,7 +162,7 @@ function tierPrice(t: WixAvailableTicket): string {
162
162
  // as "25" — a price that reads as a quantity, and nothing downstream could tell it was a
163
163
  // formatting failure. `formatCurrency` uses real Intl where it exists and a symbol-carrying
164
164
  // fallback where it does not, diffed against ECMA-402 in engine-intl-fallback.test.ts.
165
- return formatCurrency(Number(raw), t.price?.currency || "USD", "en", Number(raw) % 1 === 0 ? 0 : 2);
165
+ return formatCurrency(Number(raw), t.price?.currency || "USD", "en");
166
166
  }
167
167
 
168
168
  function tierAvailable(t: WixAvailableTicket): boolean {
@@ -35,16 +35,32 @@ const svc = defineBackendCollection<S, EventRow>("himiEvents", {
35
35
  id: row => row.id,
36
36
  errorMessage: () => copyParam("events.errorText", "Events could not be loaded."),
37
37
  async cached(criteria) {
38
- if (criteria.query || criteria.filter !== "all" || criteria.sort !== "default") return undefined;
39
- return { items: await readCached(), nextCursor: "", metadata: { fromCache: true } };
38
+ // The list now OPENS on Upcoming, so the default view must keep its offline-first paint:
39
+ // serve the cache for it too, minus the rows that have finished.
40
+ const upcoming = criteria.filter === "value:Upcoming";
41
+ if (criteria.query || (criteria.filter !== "all" && !upcoming) || criteria.sort !== "default") return undefined;
42
+ const rows = await readCached();
43
+ return { items: upcoming ? rows.filter((row) => row.statusLabel !== "Past") : rows, nextCursor: "", metadata: { fromCache: true } };
40
44
  },
41
45
  async fetch(criteria, cursor) {
42
46
  if (!cursor) queryNow = new Date().toISOString();
43
47
  if (criteria.filter === "saved" && !criteria.savedIds.length) return { items: [], nextCursor: "" };
44
48
  const filter: Record<string, unknown> = { status: { $ne: "DRAFT" } };
45
- if (criteria.query) filter.title = { $eq: criteria.query };
49
+ // Prefix, not exact: the placeholder says "Search events", and an exact-title match returned
50
+ // nothing for "Harvest" when the event is "Harvest Tasting".
51
+ if (criteria.query) filter.title = { $startsWith: criteria.query };
46
52
  if (criteria.filter === "saved") filter.id = { $in: criteria.savedIds };
47
- if (criteria.filter === "value:Upcoming") filter["dateAndTimeSettings.startDate"] = { $gte: queryNow };
53
+ // Upcoming = not started yet OR not finished yet: an event in progress (a festival on its
54
+ // second day) is still on. The start-date arm is what keeps a START-ONLY event (no endDate
55
+ // — valid in Wix Events) in the list; a filter on endDate alone dropped it from both views.
56
+ // Past stays "has started", so an in-progress event may appear under both; its row is only
57
+ // marked "Past" once it has actually finished (`eventIsPast`).
58
+ if (criteria.filter === "value:Upcoming") {
59
+ filter.$or = [
60
+ { "dateAndTimeSettings.startDate": { $gte: queryNow } },
61
+ { "dateAndTimeSettings.endDate": { $gte: queryNow } },
62
+ ];
63
+ }
48
64
  if (criteria.filter === "value:Past") filter["dateAndTimeSettings.startDate"] = { $lt: queryNow };
49
65
  const res = await queryEvents({ limit: 50, offset: Number(cursor || 0), query: { filter,
50
66
  sort: [{ fieldName: criteria.sort === "default" ? "dateAndTimeSettings.startDate" : "title", order: criteria.sort === "za" ? "DESC" : "ASC" }, { fieldName: "id", order: "ASC" }] } });
@@ -63,9 +63,9 @@ async function identityLine(): Promise<string> {
63
63
  const identity = await dispatch("himi.wix.memberIdentity") as { email?: string } | null;
64
64
  return identity?.email
65
65
  ? copyTemplate("myEvents.signedInAs", "Signed in as {email}", { email: identity.email })
66
- : copyParam("myEvents.identityGuest", "RSVPs saved on this device — not yet your full Wix Events history.");
66
+ : copyParam("myEvents.identityGuest", "RSVPs you confirm on this device appear here.");
67
67
  } catch {
68
- return copyParam("myEvents.identityGuest", "RSVPs saved on this device — not yet your full Wix Events history.");
68
+ return copyParam("myEvents.identityGuest", "RSVPs you confirm on this device appear here.");
69
69
  }
70
70
  }
71
71
 
@@ -26,7 +26,7 @@ function fromCategory(c: StoreCategory): Row {
26
26
  function fromCollection(c: WixCollection): Row {
27
27
  const cc = c as unknown as { id?: string; name?: string; numberOfProducts?: number };
28
28
  const n = cc.numberOfProducts;
29
- return { id: cc.id || cc.name || "collection", name: cc.name || "Collection", subtitle: n != null ? `${n} ${n === 1 ? "product" : "products"}` : "" };
29
+ return { id: cc.id || cc.name || "collection", name: cc.name || "Collection", subtitle: n != null && n > 0 ? `${n} ${n === 1 ? "product" : "products"}` : "" };
30
30
  }
31
31
 
32
32
  type Loaded = { ok: true; rows: Row[] } | { ok: false; error: string };
@@ -4,7 +4,7 @@ import { withEmptyFlags } from "../_shared/empty-flags.js";
4
4
  import { listAnnouncements, type WixAnnouncement } from "@himalaya/wix-new-releases";
5
5
 
6
6
  interface Row { id: string; name: string; subtitle: string }
7
- interface S { status: "loading" | "ready"; items: Row[]; emptyText: string }
7
+ interface S { status: "loading" | "ready"; items: Row[]; emptyText: string; /** hiddenWhen hides on true: the empty card shows only once loaded AND empty. */ noEmpty: boolean }
8
8
 
9
9
  function norm(a: WixAnnouncement, i: number): Row {
10
10
  const aa = a as unknown as { id?: string; title?: string; bodyText?: string; description?: string };
@@ -12,14 +12,14 @@ function norm(a: WixAnnouncement, i: number): Row {
12
12
  }
13
13
 
14
14
  const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesWhatsNew", withEmptyFlags({
15
- state: { status: "loading", items: [], emptyText: "" },
15
+ state: { status: "loading", items: [], emptyText: "", noEmpty: true },
16
16
  actions: {
17
17
  load: async (s) => {
18
18
  try {
19
19
  const r = await listAnnouncements(20);
20
20
  const items = (((r as unknown as { announcements?: WixAnnouncement[] }).announcements) ?? []).map(norm);
21
- return { status: "ready", items, emptyText: items.length ? "" : "Nothing new right now" };
22
- } catch { return { ...s, status: "ready", items: [], emptyText: "Nothing new right now" }; }
21
+ return { status: "ready", items, emptyText: items.length ? "" : "Nothing new right now", noEmpty: items.length > 0 };
22
+ } catch { return { ...s, status: "ready", items: [], emptyText: "Nothing new right now", noEmpty: false }; }
23
23
  },
24
24
  },
25
25
  }, { items: "noItems" }));