@wix/himalaya-cli 0.1851.0 → 0.1853.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 (510) 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/ts/src/schema.d.ts +13 -3
  3. package/dist/browser-plane/assets.json +5 -5
  4. package/dist/browser-plane/preview-deferred/{166f7ee733ea8d0fe7bba8b796232efd4f5413e22af4a8aeee20cae1069b2fd6.bin → fb500748f6c4768468f2e7f985aa67c38633077c7a98caaa6b500c7b00eea8e9.bin} +1 -1
  5. package/dist/browser-plane/sw.js +7 -7
  6. package/dist/cli.mjs +10136 -9601
  7. package/dist/preview-assets.generated.bin +0 -0
  8. package/guides/component-index.md +1 -1
  9. package/guides/component-reference.json +2 -2
  10. package/guides/component-reference.md +8 -1
  11. package/guides/designing-himi-screens.md +5 -1
  12. package/guides/himi-json-output.md +13 -3
  13. package/guides/one-app-section-mappings.md +1 -1
  14. package/guides/one-app-to-himi-app.md +60 -10
  15. package/guides/sdk-reference.json +2 -2
  16. package/package.json +2 -2
  17. package/template-icons/bare-fashion.png +0 -0
  18. package/templates/bare-fashion/README.md +52 -0
  19. package/templates/bare-fashion/config.ts +474 -0
  20. package/templates/bare-fashion/dev/index.ts +16526 -0
  21. package/templates/bare-fashion/himalaya.content.json +70 -0
  22. package/templates/bare-fashion/himalaya.template.json +18 -0
  23. package/templates/bare-fashion/icon.png +0 -0
  24. package/templates/bare-fashion/platforms.json +3 -0
  25. package/templates/bare-fashion/tier5-src/_shared/app-locale.ts +70 -0
  26. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-address-book.ts +116 -0
  27. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-address-countries.ts +261 -0
  28. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-bag-count.ts +24 -0
  29. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-categories.ts +48 -0
  30. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-facets.ts +265 -0
  31. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-load-error.ts +38 -0
  32. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-product-card.ts +136 -0
  33. package/templates/bare-fashion/tier5-src/_shared/bare-fashion-store-options.ts +129 -0
  34. package/templates/bare-fashion/tier5-src/_shared/branded-lite-hosted.ts +282 -0
  35. package/templates/bare-fashion/tier5-src/_shared/collection-contract.ts +228 -0
  36. package/templates/bare-fashion/tier5-src/_shared/collection-query.ts +201 -0
  37. package/templates/bare-fashion/tier5-src/_shared/collection-service.ts +429 -0
  38. package/templates/bare-fashion/tier5-src/_shared/engine-intl.ts +529 -0
  39. package/templates/bare-fashion/tier5-src/_shared/himi-account.ts +209 -0
  40. package/templates/bare-fashion/tier5-src/_shared/himi-copy.ts +123 -0
  41. package/templates/bare-fashion/tier5-src/_shared/himi-layouts.ts +142 -0
  42. package/templates/bare-fashion/tier5-src/_shared/himi-store-categories.ts +108 -0
  43. package/templates/bare-fashion/tier5-src/_shared/himi-store-saved.ts +57 -0
  44. package/templates/bare-fashion/tier5-src/_shared/himi-store.ts +7 -0
  45. package/templates/bare-fashion/tier5-src/_shared/himi-text.ts +24 -0
  46. package/templates/bare-fashion/tier5-src/_shared/hosted-checkout.ts +70 -0
  47. package/templates/bare-fashion/tier5-src/_shared/live-session.ts +172 -0
  48. package/templates/bare-fashion/tier5-src/_shared/local-preferences.ts +38 -0
  49. package/templates/bare-fashion/tier5-src/_shared/member-access.ts +63 -0
  50. package/templates/bare-fashion/tier5-src/_shared/member-avatar.ts +76 -0
  51. package/templates/bare-fashion/tier5-src/_shared/member-orders.ts +8 -0
  52. package/templates/bare-fashion/tier5-src/_shared/online-actions.ts +76 -0
  53. package/templates/bare-fashion/tier5-src/_shared/owner-load-error.ts +348 -0
  54. package/templates/bare-fashion/tier5-src/himi-bare-fashion-account/index.ts +127 -0
  55. package/templates/bare-fashion/tier5-src/himi-bare-fashion-address-form/index.ts +367 -0
  56. package/templates/bare-fashion/tier5-src/himi-bare-fashion-addresses/index.ts +202 -0
  57. package/templates/bare-fashion/tier5-src/himi-bare-fashion-appearance/index.ts +73 -0
  58. package/templates/bare-fashion/tier5-src/himi-bare-fashion-cart/index.ts +540 -0
  59. package/templates/bare-fashion/tier5-src/himi-bare-fashion-collection/index.ts +111 -0
  60. package/templates/bare-fashion/tier5-src/himi-bare-fashion-home/index.ts +241 -0
  61. package/templates/bare-fashion/tier5-src/himi-bare-fashion-nav/index.ts +56 -0
  62. package/templates/bare-fashion/tier5-src/himi-bare-fashion-order/index.ts +437 -0
  63. package/templates/bare-fashion/tier5-src/himi-bare-fashion-product/index.ts +650 -0
  64. package/templates/bare-fashion/tier5-src/himi-bare-fashion-products/index.ts +142 -0
  65. package/templates/bare-fashion/tier5-src/himi-bare-fashion-saved/index.ts +45 -0
  66. package/templates/bare-fashion/tier5-src/himi-bare-fashion-search/index.ts +199 -0
  67. package/templates/bare-fashion/tier5-src/himi-bare-fashion-shop/index.ts +79 -0
  68. package/templates/bare-fashion/tier5-src/himi-bare-fashion-sign-in/index.ts +269 -0
  69. package/templates/bare-fashion/tier5-src/himi-bare-fashion-wallet/index.ts +224 -0
  70. package/templates/bare-fashion/tier5-src/himi-branded-lite-info/index.ts +209 -0
  71. package/templates/bare-fashion/tier5-src/himi-branded-lite-orders/index.ts +327 -0
  72. package/templates/bare-fashion/tier5-src/wix-spaces-collections/index.ts +48 -0
  73. package/templates/bare-fashion/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  74. package/templates/bare-fashion/tier5-src/wix-spaces-view-profile/index.ts +119 -0
  75. package/templates/bare-fashion/tokens.json +348 -0
  76. package/templates/beauty-salon/dev/index.ts +223 -0
  77. package/templates/beauty-salon/l10n/ar.json +6 -0
  78. package/templates/beauty-salon/l10n/cs.json +6 -0
  79. package/templates/beauty-salon/l10n/da.json +6 -0
  80. package/templates/beauty-salon/l10n/de.json +6 -0
  81. package/templates/beauty-salon/l10n/el.json +6 -0
  82. package/templates/beauty-salon/l10n/en.json +9 -2
  83. package/templates/beauty-salon/l10n/es.json +6 -0
  84. package/templates/beauty-salon/l10n/fi.json +6 -0
  85. package/templates/beauty-salon/l10n/fr.json +6 -0
  86. package/templates/beauty-salon/l10n/he.json +5 -0
  87. package/templates/beauty-salon/l10n/hu.json +6 -0
  88. package/templates/beauty-salon/l10n/id.json +6 -0
  89. package/templates/beauty-salon/l10n/it.json +6 -0
  90. package/templates/beauty-salon/l10n/ja.json +6 -0
  91. package/templates/beauty-salon/l10n/ko.json +6 -0
  92. package/templates/beauty-salon/l10n/lt.json +6 -0
  93. package/templates/beauty-salon/l10n/nl.json +6 -0
  94. package/templates/beauty-salon/l10n/no.json +6 -0
  95. package/templates/beauty-salon/l10n/pl.json +6 -0
  96. package/templates/beauty-salon/l10n/pt.json +6 -0
  97. package/templates/beauty-salon/l10n/ru.json +6 -0
  98. package/templates/beauty-salon/l10n/sv.json +6 -0
  99. package/templates/beauty-salon/l10n/th.json +6 -0
  100. package/templates/beauty-salon/l10n/tr.json +6 -0
  101. package/templates/beauty-salon/l10n/uk.json +6 -0
  102. package/templates/beauty-salon/l10n/vi.json +6 -0
  103. package/templates/beauty-salon/l10n/zh.json +6 -0
  104. package/templates/beauty-salon/tier5-src/_shared/collection-query.ts +8 -0
  105. package/templates/beauty-salon/tier5-src/_shared/collection-service.ts +7 -1
  106. package/templates/beauty-salon/tier5-src/_shared/lifecycle.ts +15 -0
  107. package/templates/beauty-salon/tier5-src/_shared/nav-member-avatar.ts +92 -0
  108. package/templates/beauty-salon/tier5-src/himi-branded-lite-nav/index.ts +15 -6
  109. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +26 -1
  110. package/templates/beauty-salon-owner/tier5-src/_shared/collection-query.ts +8 -0
  111. package/templates/beauty-salon-owner/tier5-src/_shared/collection-service.ts +7 -1
  112. package/templates/branded-lite/dev/index.ts +2167 -0
  113. package/templates/branded-lite/l10n/ar.json +6 -0
  114. package/templates/branded-lite/l10n/cs.json +6 -0
  115. package/templates/branded-lite/l10n/da.json +6 -0
  116. package/templates/branded-lite/l10n/de.json +6 -0
  117. package/templates/branded-lite/l10n/el.json +6 -0
  118. package/templates/branded-lite/l10n/en.json +12 -5
  119. package/templates/branded-lite/l10n/es.json +6 -0
  120. package/templates/branded-lite/l10n/fi.json +6 -0
  121. package/templates/branded-lite/l10n/fr.json +6 -0
  122. package/templates/branded-lite/l10n/he.json +5 -0
  123. package/templates/branded-lite/l10n/hu.json +6 -0
  124. package/templates/branded-lite/l10n/id.json +6 -0
  125. package/templates/branded-lite/l10n/it.json +6 -0
  126. package/templates/branded-lite/l10n/ja.json +6 -0
  127. package/templates/branded-lite/l10n/ko.json +6 -0
  128. package/templates/branded-lite/l10n/lt.json +6 -0
  129. package/templates/branded-lite/l10n/nl.json +6 -0
  130. package/templates/branded-lite/l10n/no.json +6 -0
  131. package/templates/branded-lite/l10n/pl.json +6 -0
  132. package/templates/branded-lite/l10n/pt.json +6 -0
  133. package/templates/branded-lite/l10n/ru.json +6 -0
  134. package/templates/branded-lite/l10n/sv.json +6 -0
  135. package/templates/branded-lite/l10n/th.json +6 -0
  136. package/templates/branded-lite/l10n/tr.json +6 -0
  137. package/templates/branded-lite/l10n/uk.json +6 -0
  138. package/templates/branded-lite/l10n/vi.json +6 -0
  139. package/templates/branded-lite/l10n/zh.json +6 -0
  140. package/templates/branded-lite/recipes/upcoming-bookings.json +118 -6
  141. package/templates/branded-lite/tier5-src/_shared/access-gates.ts +0 -13
  142. package/templates/branded-lite/tier5-src/_shared/collection-query-legacy.ts +7 -0
  143. package/templates/branded-lite/tier5-src/_shared/collection-query.ts +7 -0
  144. package/templates/branded-lite/tier5-src/_shared/collection-service.ts +7 -1
  145. package/templates/branded-lite/tier5-src/_shared/events-inline-options.ts +55 -3
  146. package/templates/branded-lite/tier5-src/_shared/events-inline.ts +5 -3
  147. package/templates/branded-lite/tier5-src/_shared/guest-sign-in.ts +36 -0
  148. package/templates/branded-lite/tier5-src/_shared/lifecycle.ts +15 -0
  149. package/templates/branded-lite/tier5-src/_shared/nav-member-avatar.ts +92 -0
  150. package/templates/branded-lite/tier5-src/_shared/upcoming-bookings-section.ts +15 -4
  151. package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +14 -9
  152. package/templates/branded-lite/tier5-src/himi-branded-lite-inbox/index.ts +6 -1
  153. package/templates/branded-lite/tier5-src/himi-branded-lite-nav/index.ts +15 -6
  154. package/templates/branded-lite/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
  155. package/templates/branded-lite/tier5-src/himi-events-list/index.ts +17 -0
  156. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +26 -1
  157. package/templates/brandy/tier5-src/_shared/collection-query-legacy.ts +7 -0
  158. package/templates/brandy/tier5-src/_shared/collection-query.ts +7 -0
  159. package/templates/brandy/tier5-src/_shared/collection-service.ts +7 -1
  160. package/templates/brandy/tier5-src/_shared/guest-sign-in.ts +36 -0
  161. package/templates/brandy/tier5-src/himi-branded-lite-inbox/index.ts +6 -1
  162. package/templates/brandy/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
  163. package/templates/brandy/tier5-src/himi-store-account/index.ts +26 -1
  164. package/templates/community-club/dev/index.ts +223 -0
  165. package/templates/community-club/l10n/ar.json +6 -0
  166. package/templates/community-club/l10n/cs.json +6 -0
  167. package/templates/community-club/l10n/da.json +6 -0
  168. package/templates/community-club/l10n/de.json +6 -0
  169. package/templates/community-club/l10n/el.json +6 -0
  170. package/templates/community-club/l10n/en.json +9 -2
  171. package/templates/community-club/l10n/es.json +6 -0
  172. package/templates/community-club/l10n/fi.json +6 -0
  173. package/templates/community-club/l10n/fr.json +6 -0
  174. package/templates/community-club/l10n/he.json +5 -0
  175. package/templates/community-club/l10n/hu.json +6 -0
  176. package/templates/community-club/l10n/id.json +6 -0
  177. package/templates/community-club/l10n/it.json +6 -0
  178. package/templates/community-club/l10n/ja.json +6 -0
  179. package/templates/community-club/l10n/ko.json +6 -0
  180. package/templates/community-club/l10n/lt.json +6 -0
  181. package/templates/community-club/l10n/nl.json +6 -0
  182. package/templates/community-club/l10n/no.json +6 -0
  183. package/templates/community-club/l10n/pl.json +6 -0
  184. package/templates/community-club/l10n/pt.json +6 -0
  185. package/templates/community-club/l10n/ru.json +6 -0
  186. package/templates/community-club/l10n/sv.json +6 -0
  187. package/templates/community-club/l10n/th.json +6 -0
  188. package/templates/community-club/l10n/tr.json +6 -0
  189. package/templates/community-club/l10n/uk.json +6 -0
  190. package/templates/community-club/l10n/vi.json +6 -0
  191. package/templates/community-club/l10n/zh.json +6 -0
  192. package/templates/community-club/tier5-src/_shared/collection-query.ts +8 -0
  193. package/templates/community-club/tier5-src/_shared/collection-service.ts +7 -1
  194. package/templates/community-club/tier5-src/_shared/events-inline-options.ts +77 -0
  195. package/templates/community-club/tier5-src/himi-events-list/index.ts +17 -0
  196. package/templates/community-club/tier5-src/himi-store-account/index.ts +26 -1
  197. package/templates/community-club-owner/tier5-src/_shared/collection-query.ts +8 -0
  198. package/templates/community-club-owner/tier5-src/_shared/collection-service.ts +7 -1
  199. package/templates/conference/tier5-src/_shared/collection-query.ts +8 -0
  200. package/templates/conference/tier5-src/_shared/collection-service.ts +7 -1
  201. package/templates/conference/tier5-src/_shared/events-inline-options.ts +77 -0
  202. package/templates/conference/tier5-src/himi-events-list/index.ts +17 -0
  203. package/templates/conference/tier5-src/himi-store-account/index.ts +26 -1
  204. package/templates/events-meetups/dev/index.ts +142 -0
  205. package/templates/events-meetups/l10n/ar.json +6 -0
  206. package/templates/events-meetups/l10n/cs.json +6 -0
  207. package/templates/events-meetups/l10n/da.json +6 -0
  208. package/templates/events-meetups/l10n/de.json +6 -0
  209. package/templates/events-meetups/l10n/el.json +6 -0
  210. package/templates/events-meetups/l10n/en.json +8 -1
  211. package/templates/events-meetups/l10n/es.json +6 -0
  212. package/templates/events-meetups/l10n/fi.json +6 -0
  213. package/templates/events-meetups/l10n/fr.json +6 -0
  214. package/templates/events-meetups/l10n/he.json +5 -0
  215. package/templates/events-meetups/l10n/hu.json +6 -0
  216. package/templates/events-meetups/l10n/id.json +6 -0
  217. package/templates/events-meetups/l10n/it.json +6 -0
  218. package/templates/events-meetups/l10n/ja.json +6 -0
  219. package/templates/events-meetups/l10n/ko.json +6 -0
  220. package/templates/events-meetups/l10n/lt.json +6 -0
  221. package/templates/events-meetups/l10n/nl.json +6 -0
  222. package/templates/events-meetups/l10n/no.json +6 -0
  223. package/templates/events-meetups/l10n/pl.json +6 -0
  224. package/templates/events-meetups/l10n/pt.json +6 -0
  225. package/templates/events-meetups/l10n/ru.json +6 -0
  226. package/templates/events-meetups/l10n/sv.json +6 -0
  227. package/templates/events-meetups/l10n/th.json +6 -0
  228. package/templates/events-meetups/l10n/tr.json +6 -0
  229. package/templates/events-meetups/l10n/uk.json +6 -0
  230. package/templates/events-meetups/l10n/vi.json +6 -0
  231. package/templates/events-meetups/l10n/zh.json +6 -0
  232. package/templates/events-meetups/tier5-src/_shared/collection-query.ts +8 -0
  233. package/templates/events-meetups/tier5-src/_shared/collection-service.ts +7 -1
  234. package/templates/events-meetups/tier5-src/_shared/events-inline-options.ts +77 -0
  235. package/templates/events-meetups/tier5-src/himi-events-list/index.ts +17 -0
  236. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +26 -1
  237. package/templates/events-meetups-owner/tier5-src/_shared/collection-query.ts +8 -0
  238. package/templates/events-meetups-owner/tier5-src/_shared/collection-service.ts +7 -1
  239. package/templates/fitness-gym/tier5-src/_shared/collection-query.ts +8 -0
  240. package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +7 -1
  241. package/templates/fitness-gym/tier5-src/_shared/guest-sign-in.ts +36 -0
  242. package/templates/fitness-gym/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
  243. package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +26 -1
  244. package/templates/gym-fitness/dev/index.ts +385 -0
  245. package/templates/gym-fitness/l10n/ar.json +6 -0
  246. package/templates/gym-fitness/l10n/cs.json +6 -0
  247. package/templates/gym-fitness/l10n/da.json +6 -0
  248. package/templates/gym-fitness/l10n/de.json +6 -0
  249. package/templates/gym-fitness/l10n/el.json +6 -0
  250. package/templates/gym-fitness/l10n/en.json +9 -2
  251. package/templates/gym-fitness/l10n/es.json +6 -0
  252. package/templates/gym-fitness/l10n/fi.json +6 -0
  253. package/templates/gym-fitness/l10n/fr.json +6 -0
  254. package/templates/gym-fitness/l10n/he.json +5 -0
  255. package/templates/gym-fitness/l10n/hu.json +6 -0
  256. package/templates/gym-fitness/l10n/id.json +6 -0
  257. package/templates/gym-fitness/l10n/it.json +6 -0
  258. package/templates/gym-fitness/l10n/ja.json +6 -0
  259. package/templates/gym-fitness/l10n/ko.json +6 -0
  260. package/templates/gym-fitness/l10n/lt.json +6 -0
  261. package/templates/gym-fitness/l10n/nl.json +6 -0
  262. package/templates/gym-fitness/l10n/no.json +6 -0
  263. package/templates/gym-fitness/l10n/pl.json +6 -0
  264. package/templates/gym-fitness/l10n/pt.json +6 -0
  265. package/templates/gym-fitness/l10n/ru.json +6 -0
  266. package/templates/gym-fitness/l10n/sv.json +6 -0
  267. package/templates/gym-fitness/l10n/th.json +6 -0
  268. package/templates/gym-fitness/l10n/tr.json +6 -0
  269. package/templates/gym-fitness/l10n/uk.json +6 -0
  270. package/templates/gym-fitness/l10n/vi.json +6 -0
  271. package/templates/gym-fitness/l10n/zh.json +6 -0
  272. package/templates/gym-fitness/tier5-src/_shared/collection-query.ts +8 -0
  273. package/templates/gym-fitness/tier5-src/_shared/collection-service.ts +7 -1
  274. package/templates/gym-fitness/tier5-src/_shared/events-inline-options.ts +77 -0
  275. package/templates/gym-fitness/tier5-src/_shared/lifecycle.ts +15 -0
  276. package/templates/gym-fitness/tier5-src/_shared/nav-member-avatar.ts +92 -0
  277. package/templates/gym-fitness/tier5-src/himi-branded-lite-nav/index.ts +15 -6
  278. package/templates/gym-fitness/tier5-src/himi-events-list/index.ts +17 -0
  279. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +26 -1
  280. package/templates/gym-fitness-owner/tier5-src/_shared/collection-query.ts +8 -0
  281. package/templates/gym-fitness-owner/tier5-src/_shared/collection-service.ts +7 -1
  282. package/templates/medical-services/tier5-src/_shared/collection-query.ts +8 -0
  283. package/templates/medical-services/tier5-src/_shared/collection-service.ts +7 -1
  284. package/templates/medical-services/tier5-src/_shared/guest-sign-in.ts +36 -0
  285. package/templates/medical-services/tier5-src/himi-branded-lite-notifications/index.ts +8 -1
  286. package/templates/medical-services/tier5-src/himi-store-account/index.ts +26 -1
  287. package/templates/nonprofit-cause/dev/index.ts +223 -0
  288. package/templates/nonprofit-cause/l10n/ar.json +6 -0
  289. package/templates/nonprofit-cause/l10n/cs.json +6 -0
  290. package/templates/nonprofit-cause/l10n/da.json +6 -0
  291. package/templates/nonprofit-cause/l10n/de.json +6 -0
  292. package/templates/nonprofit-cause/l10n/el.json +6 -0
  293. package/templates/nonprofit-cause/l10n/en.json +8 -1
  294. package/templates/nonprofit-cause/l10n/es.json +6 -0
  295. package/templates/nonprofit-cause/l10n/fi.json +6 -0
  296. package/templates/nonprofit-cause/l10n/fr.json +6 -0
  297. package/templates/nonprofit-cause/l10n/he.json +5 -0
  298. package/templates/nonprofit-cause/l10n/hu.json +6 -0
  299. package/templates/nonprofit-cause/l10n/id.json +6 -0
  300. package/templates/nonprofit-cause/l10n/it.json +6 -0
  301. package/templates/nonprofit-cause/l10n/ja.json +6 -0
  302. package/templates/nonprofit-cause/l10n/ko.json +6 -0
  303. package/templates/nonprofit-cause/l10n/lt.json +6 -0
  304. package/templates/nonprofit-cause/l10n/nl.json +6 -0
  305. package/templates/nonprofit-cause/l10n/no.json +6 -0
  306. package/templates/nonprofit-cause/l10n/pl.json +6 -0
  307. package/templates/nonprofit-cause/l10n/pt.json +6 -0
  308. package/templates/nonprofit-cause/l10n/ru.json +6 -0
  309. package/templates/nonprofit-cause/l10n/sv.json +6 -0
  310. package/templates/nonprofit-cause/l10n/th.json +6 -0
  311. package/templates/nonprofit-cause/l10n/tr.json +6 -0
  312. package/templates/nonprofit-cause/l10n/uk.json +6 -0
  313. package/templates/nonprofit-cause/l10n/vi.json +6 -0
  314. package/templates/nonprofit-cause/l10n/zh.json +6 -0
  315. package/templates/nonprofit-cause/tier5-src/_shared/collection-query.ts +8 -0
  316. package/templates/nonprofit-cause/tier5-src/_shared/collection-service.ts +7 -1
  317. package/templates/nonprofit-cause/tier5-src/_shared/events-inline-options.ts +77 -0
  318. package/templates/nonprofit-cause/tier5-src/himi-events-list/index.ts +17 -0
  319. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +26 -1
  320. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-query.ts +8 -0
  321. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-service.ts +7 -1
  322. package/templates/owner-lite/tier5-src/_shared/collection-query.ts +8 -0
  323. package/templates/owner-lite/tier5-src/_shared/collection-service.ts +7 -1
  324. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-query.ts +8 -0
  325. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-service.ts +7 -1
  326. package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +26 -1
  327. package/templates/podcast-creator/dev/index.ts +223 -0
  328. package/templates/podcast-creator/l10n/ar.json +6 -0
  329. package/templates/podcast-creator/l10n/cs.json +6 -0
  330. package/templates/podcast-creator/l10n/da.json +6 -0
  331. package/templates/podcast-creator/l10n/de.json +6 -0
  332. package/templates/podcast-creator/l10n/el.json +6 -0
  333. package/templates/podcast-creator/l10n/en.json +8 -1
  334. package/templates/podcast-creator/l10n/es.json +6 -0
  335. package/templates/podcast-creator/l10n/fi.json +6 -0
  336. package/templates/podcast-creator/l10n/fr.json +6 -0
  337. package/templates/podcast-creator/l10n/he.json +5 -0
  338. package/templates/podcast-creator/l10n/hu.json +6 -0
  339. package/templates/podcast-creator/l10n/id.json +6 -0
  340. package/templates/podcast-creator/l10n/it.json +6 -0
  341. package/templates/podcast-creator/l10n/ja.json +6 -0
  342. package/templates/podcast-creator/l10n/ko.json +6 -0
  343. package/templates/podcast-creator/l10n/lt.json +6 -0
  344. package/templates/podcast-creator/l10n/nl.json +6 -0
  345. package/templates/podcast-creator/l10n/no.json +6 -0
  346. package/templates/podcast-creator/l10n/pl.json +6 -0
  347. package/templates/podcast-creator/l10n/pt.json +6 -0
  348. package/templates/podcast-creator/l10n/ru.json +6 -0
  349. package/templates/podcast-creator/l10n/sv.json +6 -0
  350. package/templates/podcast-creator/l10n/th.json +6 -0
  351. package/templates/podcast-creator/l10n/tr.json +6 -0
  352. package/templates/podcast-creator/l10n/uk.json +6 -0
  353. package/templates/podcast-creator/l10n/vi.json +6 -0
  354. package/templates/podcast-creator/l10n/zh.json +6 -0
  355. package/templates/podcast-creator/tier5-src/_shared/collection-query.ts +8 -0
  356. package/templates/podcast-creator/tier5-src/_shared/collection-service.ts +7 -1
  357. package/templates/podcast-creator/tier5-src/_shared/events-inline-options.ts +77 -0
  358. package/templates/podcast-creator/tier5-src/himi-events-list/index.ts +17 -0
  359. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +26 -1
  360. package/templates/podcast-creator-owner/tier5-src/_shared/collection-query.ts +8 -0
  361. package/templates/podcast-creator-owner/tier5-src/_shared/collection-service.ts +7 -1
  362. package/templates/portfolio-creative/dev/index.ts +142 -0
  363. package/templates/portfolio-creative/l10n/ar.json +6 -0
  364. package/templates/portfolio-creative/l10n/cs.json +6 -0
  365. package/templates/portfolio-creative/l10n/da.json +6 -0
  366. package/templates/portfolio-creative/l10n/de.json +6 -0
  367. package/templates/portfolio-creative/l10n/el.json +6 -0
  368. package/templates/portfolio-creative/l10n/en.json +8 -1
  369. package/templates/portfolio-creative/l10n/es.json +6 -0
  370. package/templates/portfolio-creative/l10n/fi.json +6 -0
  371. package/templates/portfolio-creative/l10n/fr.json +6 -0
  372. package/templates/portfolio-creative/l10n/he.json +5 -0
  373. package/templates/portfolio-creative/l10n/hu.json +6 -0
  374. package/templates/portfolio-creative/l10n/id.json +6 -0
  375. package/templates/portfolio-creative/l10n/it.json +6 -0
  376. package/templates/portfolio-creative/l10n/ja.json +6 -0
  377. package/templates/portfolio-creative/l10n/ko.json +6 -0
  378. package/templates/portfolio-creative/l10n/lt.json +6 -0
  379. package/templates/portfolio-creative/l10n/nl.json +6 -0
  380. package/templates/portfolio-creative/l10n/no.json +6 -0
  381. package/templates/portfolio-creative/l10n/pl.json +6 -0
  382. package/templates/portfolio-creative/l10n/pt.json +6 -0
  383. package/templates/portfolio-creative/l10n/ru.json +6 -0
  384. package/templates/portfolio-creative/l10n/sv.json +6 -0
  385. package/templates/portfolio-creative/l10n/th.json +6 -0
  386. package/templates/portfolio-creative/l10n/tr.json +6 -0
  387. package/templates/portfolio-creative/l10n/uk.json +6 -0
  388. package/templates/portfolio-creative/l10n/vi.json +6 -0
  389. package/templates/portfolio-creative/l10n/zh.json +6 -0
  390. package/templates/portfolio-creative/tier5-src/_shared/collection-query.ts +8 -0
  391. package/templates/portfolio-creative/tier5-src/_shared/collection-service.ts +7 -1
  392. package/templates/portfolio-creative/tier5-src/_shared/events-inline-options.ts +77 -0
  393. package/templates/portfolio-creative/tier5-src/himi-events-list/index.ts +17 -0
  394. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +26 -1
  395. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-query.ts +8 -0
  396. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-service.ts +7 -1
  397. package/templates/restaurant/dev/index.ts +142 -0
  398. package/templates/restaurant/l10n/ar.json +6 -0
  399. package/templates/restaurant/l10n/cs.json +6 -0
  400. package/templates/restaurant/l10n/da.json +6 -0
  401. package/templates/restaurant/l10n/de.json +6 -0
  402. package/templates/restaurant/l10n/el.json +6 -0
  403. package/templates/restaurant/l10n/en.json +9 -2
  404. package/templates/restaurant/l10n/es.json +6 -0
  405. package/templates/restaurant/l10n/fi.json +6 -0
  406. package/templates/restaurant/l10n/fr.json +6 -0
  407. package/templates/restaurant/l10n/he.json +5 -0
  408. package/templates/restaurant/l10n/hu.json +6 -0
  409. package/templates/restaurant/l10n/id.json +6 -0
  410. package/templates/restaurant/l10n/it.json +6 -0
  411. package/templates/restaurant/l10n/ja.json +6 -0
  412. package/templates/restaurant/l10n/ko.json +6 -0
  413. package/templates/restaurant/l10n/lt.json +6 -0
  414. package/templates/restaurant/l10n/nl.json +6 -0
  415. package/templates/restaurant/l10n/no.json +6 -0
  416. package/templates/restaurant/l10n/pl.json +6 -0
  417. package/templates/restaurant/l10n/pt.json +6 -0
  418. package/templates/restaurant/l10n/ru.json +6 -0
  419. package/templates/restaurant/l10n/sv.json +6 -0
  420. package/templates/restaurant/l10n/th.json +6 -0
  421. package/templates/restaurant/l10n/tr.json +6 -0
  422. package/templates/restaurant/l10n/uk.json +6 -0
  423. package/templates/restaurant/l10n/vi.json +6 -0
  424. package/templates/restaurant/l10n/zh.json +6 -0
  425. package/templates/restaurant/tier5-src/_shared/collection-query.ts +8 -0
  426. package/templates/restaurant/tier5-src/_shared/collection-service.ts +7 -1
  427. package/templates/restaurant/tier5-src/_shared/events-inline-options.ts +77 -0
  428. package/templates/restaurant/tier5-src/himi-events-list/index.ts +17 -0
  429. package/templates/restaurant/tier5-src/himi-store-account/index.ts +26 -1
  430. package/templates/restaurant-owner/tier5-src/_shared/collection-query.ts +8 -0
  431. package/templates/restaurant-owner/tier5-src/_shared/collection-service.ts +7 -1
  432. package/templates/retail-store/dev/index.ts +142 -0
  433. package/templates/retail-store/l10n/ar.json +6 -0
  434. package/templates/retail-store/l10n/cs.json +6 -0
  435. package/templates/retail-store/l10n/da.json +6 -0
  436. package/templates/retail-store/l10n/de.json +6 -0
  437. package/templates/retail-store/l10n/el.json +6 -0
  438. package/templates/retail-store/l10n/en.json +8 -1
  439. package/templates/retail-store/l10n/es.json +6 -0
  440. package/templates/retail-store/l10n/fi.json +6 -0
  441. package/templates/retail-store/l10n/fr.json +6 -0
  442. package/templates/retail-store/l10n/he.json +5 -0
  443. package/templates/retail-store/l10n/hu.json +6 -0
  444. package/templates/retail-store/l10n/id.json +6 -0
  445. package/templates/retail-store/l10n/it.json +6 -0
  446. package/templates/retail-store/l10n/ja.json +6 -0
  447. package/templates/retail-store/l10n/ko.json +6 -0
  448. package/templates/retail-store/l10n/lt.json +6 -0
  449. package/templates/retail-store/l10n/nl.json +6 -0
  450. package/templates/retail-store/l10n/no.json +6 -0
  451. package/templates/retail-store/l10n/pl.json +6 -0
  452. package/templates/retail-store/l10n/pt.json +6 -0
  453. package/templates/retail-store/l10n/ru.json +6 -0
  454. package/templates/retail-store/l10n/sv.json +6 -0
  455. package/templates/retail-store/l10n/th.json +6 -0
  456. package/templates/retail-store/l10n/tr.json +6 -0
  457. package/templates/retail-store/l10n/uk.json +6 -0
  458. package/templates/retail-store/l10n/vi.json +6 -0
  459. package/templates/retail-store/l10n/zh.json +6 -0
  460. package/templates/retail-store/tier5-src/_shared/collection-query-legacy.ts +7 -0
  461. package/templates/retail-store/tier5-src/_shared/collection-query.ts +7 -0
  462. package/templates/retail-store/tier5-src/_shared/collection-service.ts +7 -1
  463. package/templates/retail-store/tier5-src/himi-store-account/index.ts +26 -1
  464. package/templates/retail-store-owner/tier5-src/_shared/collection-query.ts +8 -0
  465. package/templates/retail-store-owner/tier5-src/_shared/collection-service.ts +7 -1
  466. package/templates/salon-spa/tier5-src/_shared/collection-query.ts +8 -0
  467. package/templates/salon-spa/tier5-src/_shared/collection-service.ts +7 -1
  468. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +26 -1
  469. package/templates/wholesale-store/tier5-src/_shared/collection-query-legacy.ts +7 -0
  470. package/templates/wholesale-store/tier5-src/_shared/collection-query.ts +7 -0
  471. package/templates/wholesale-store/tier5-src/_shared/collection-service.ts +7 -1
  472. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +26 -1
  473. package/templates/yoga-studio/dev/index.ts +304 -0
  474. package/templates/yoga-studio/l10n/ar.json +6 -0
  475. package/templates/yoga-studio/l10n/cs.json +6 -0
  476. package/templates/yoga-studio/l10n/da.json +6 -0
  477. package/templates/yoga-studio/l10n/de.json +6 -0
  478. package/templates/yoga-studio/l10n/el.json +6 -0
  479. package/templates/yoga-studio/l10n/en.json +10 -3
  480. package/templates/yoga-studio/l10n/es.json +6 -0
  481. package/templates/yoga-studio/l10n/fi.json +6 -0
  482. package/templates/yoga-studio/l10n/fr.json +6 -0
  483. package/templates/yoga-studio/l10n/he.json +5 -0
  484. package/templates/yoga-studio/l10n/hu.json +6 -0
  485. package/templates/yoga-studio/l10n/id.json +6 -0
  486. package/templates/yoga-studio/l10n/it.json +6 -0
  487. package/templates/yoga-studio/l10n/ja.json +6 -0
  488. package/templates/yoga-studio/l10n/ko.json +6 -0
  489. package/templates/yoga-studio/l10n/lt.json +6 -0
  490. package/templates/yoga-studio/l10n/nl.json +6 -0
  491. package/templates/yoga-studio/l10n/no.json +6 -0
  492. package/templates/yoga-studio/l10n/pl.json +6 -0
  493. package/templates/yoga-studio/l10n/pt.json +6 -0
  494. package/templates/yoga-studio/l10n/ru.json +6 -0
  495. package/templates/yoga-studio/l10n/sv.json +6 -0
  496. package/templates/yoga-studio/l10n/th.json +6 -0
  497. package/templates/yoga-studio/l10n/tr.json +6 -0
  498. package/templates/yoga-studio/l10n/uk.json +6 -0
  499. package/templates/yoga-studio/l10n/vi.json +6 -0
  500. package/templates/yoga-studio/l10n/zh.json +6 -0
  501. package/templates/yoga-studio/tier5-src/_shared/collection-query.ts +8 -0
  502. package/templates/yoga-studio/tier5-src/_shared/collection-service.ts +7 -1
  503. package/templates/yoga-studio/tier5-src/_shared/events-inline-options.ts +77 -0
  504. package/templates/yoga-studio/tier5-src/_shared/lifecycle.ts +15 -0
  505. package/templates/yoga-studio/tier5-src/_shared/nav-member-avatar.ts +92 -0
  506. package/templates/yoga-studio/tier5-src/himi-branded-lite-nav/index.ts +15 -6
  507. package/templates/yoga-studio/tier5-src/himi-events-list/index.ts +17 -0
  508. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +26 -1
  509. package/templates/yoga-studio-owner/tier5-src/_shared/collection-query.ts +8 -0
  510. package/templates/yoga-studio-owner/tier5-src/_shared/collection-service.ts +7 -1
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "__HIMI_APP_NAME__",
3
+ "screens": {
4
+ "himi_account": {
5
+ "displayName": "Account"
6
+ },
7
+ "himi_address_form": {
8
+ "displayName": "Address Form"
9
+ },
10
+ "himi_addresses": {
11
+ "displayName": "Addresses"
12
+ },
13
+ "himi_app_info": {
14
+ "displayName": "App Info"
15
+ },
16
+ "himi_appearance": {
17
+ "displayName": "Appearance"
18
+ },
19
+ "himi_branded_home": {
20
+ "displayName": "Home"
21
+ },
22
+ "himi_cart": {
23
+ "displayName": "Cart"
24
+ },
25
+ "himi_collection": {
26
+ "displayName": "Collection"
27
+ },
28
+ "himi_collections": {
29
+ "displayName": "Collections"
30
+ },
31
+ "himi_delete_account": {
32
+ "displayName": "Delete Account"
33
+ },
34
+ "himi_help": {
35
+ "displayName": "Help"
36
+ },
37
+ "himi_order": {
38
+ "displayName": "Order"
39
+ },
40
+ "himi_orders": {
41
+ "displayName": "Orders"
42
+ },
43
+ "himi_product": {
44
+ "displayName": "Product Details"
45
+ },
46
+ "himi_products": {
47
+ "displayName": "Products"
48
+ },
49
+ "himi_saved_products": {
50
+ "displayName": "Favorites"
51
+ },
52
+ "himi_search": {
53
+ "displayName": "Search"
54
+ },
55
+ "himi_shop": {
56
+ "displayName": "Shop"
57
+ },
58
+ "himi_sign_in": {
59
+ "displayName": "Sign In"
60
+ },
61
+ "himi_view_profile": {
62
+ "displayName": "View Profile"
63
+ },
64
+ "himi_wallet": {
65
+ "displayName": "Wallet"
66
+ }
67
+ },
68
+ "icon": "icon.png",
69
+ "target": "prod"
70
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "title": "BARE Fashion Store",
3
+ "description": "A mobile storefront for fashion, apparel and accessories brands on Wix Stores: new arrivals and clothing collections by category, product details with sizes and colours, favorites, a cart with Wix checkout, orders, and the brand's story and policies. Black-and-white editorial design. Boots as a visitor; members sign in for orders and saved addresses.",
4
+ "tags": [
5
+ "fashion",
6
+ "apparel",
7
+ "clothing",
8
+ "retail",
9
+ "storefront",
10
+ "wix",
11
+ "consumer",
12
+ "vertical:fashion",
13
+ "stores",
14
+ "cart",
15
+ "orders"
16
+ ],
17
+ "category": "shopping"
18
+ }
Binary file
@@ -0,0 +1,3 @@
1
+ {
2
+ "web": true
3
+ }
@@ -0,0 +1,70 @@
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
+ }
62
+
63
+ /** The CLDR plural category of `count` in the app language (`zero`, `one`, `two`, `few`, `many` or `other`). An engine
64
+ * without PluralRules keeps the English rule: `one` for exactly one, else `other`. */
65
+ export function pluralCategory(count: number, locale = appLocale()): string {
66
+ try {
67
+ if (typeof Intl === "object" && typeof Intl.PluralRules === "function") return new Intl.PluralRules(locale).select(count);
68
+ } catch { /* malformed tag — use the English rule */ }
69
+ return count === 1 ? "one" : "other";
70
+ }
@@ -0,0 +1,116 @@
1
+ // The signed-in member's address book: the Wix Addresses service (wix.addresses.api.v1).
2
+ // The site's My Addresses page and Wix checkout use the same service, so an address saved
3
+ // in the app shows on the site and in checkout. No generated SDK client covers it, so the
4
+ // calls go through the raw `wixCall` transport with the member's session.
5
+ //
6
+ // Workers cannot message each other. The form screen bumps one on-device row after a save,
7
+ // and the list screen polls that row (a local read, no network) to know when to reload.
8
+ import { wixCall } from "@himalaya/wix-ecom";
9
+ import { getAll, upsert, type DbEntity } from "@himalaya/local-db";
10
+ import { COUNTRIES, type CountryRow } from "./bare-fashion-address-countries.js";
11
+
12
+ const BASE = "/addresses-web/api/v1/addresses";
13
+
14
+ export interface WixAddress {
15
+ id?: string | null;
16
+ fullName?: { firstName?: string; lastName?: string };
17
+ /** ISO 3166 alpha-3 ("IRL"). Read code also accepts alpha-2. */
18
+ country?: string | null;
19
+ /** Region key with no country prefix ("NY"). */
20
+ subdivision?: string | null;
21
+ city?: string | null;
22
+ zipCode?: string | null;
23
+ phoneNumber?: string | null;
24
+ company?: string | null;
25
+ email?: string | null;
26
+ addressLine1?: string | null;
27
+ addressLine2?: string | null;
28
+ street?: { name?: string; number?: string; apt?: string | null };
29
+ }
30
+
31
+ export interface AddressList {
32
+ addresses: WixAddress[];
33
+ defaultAddressId: string;
34
+ }
35
+
36
+ export async function listAddresses(): Promise<AddressList> {
37
+ const res = await wixCall<{ addresses?: WixAddress[]; defaultAddressId?: string }>("GET", BASE);
38
+ return { addresses: (res?.addresses ?? []).filter((a) => !!a.id), defaultAddressId: res?.defaultAddressId ?? "" };
39
+ }
40
+
41
+ export async function getAddress(id: string): Promise<{ address?: WixAddress; isDefault: boolean }> {
42
+ const res = await wixCall<{ address?: WixAddress; isDefaultAddress?: boolean }>("GET", `${BASE}/${encodeURIComponent(id)}`);
43
+ return { address: res?.address, isDefault: res?.isDefaultAddress === true };
44
+ }
45
+
46
+ /** Wix makes the first address the default, whatever `setAsDefault` says. */
47
+ export async function createAddress(address: WixAddress, setAsDefault: boolean): Promise<string> {
48
+ const res = await wixCall<{ id?: string }>("POST", BASE, { address, setAsDefault });
49
+ return res?.id ?? "";
50
+ }
51
+
52
+ export async function updateAddress(address: WixAddress, fieldMask: string[], setAsDefault: boolean): Promise<void> {
53
+ await wixCall("PATCH", `${BASE}/${encodeURIComponent(String(address.id))}`, { address, fieldMask, setAsDefault });
54
+ }
55
+
56
+ export async function deleteAddress(id: string): Promise<void> {
57
+ await wixCall("DELETE", `${BASE}/${encodeURIComponent(id)}`);
58
+ }
59
+
60
+ export async function setDefaultAddress(id: string): Promise<void> {
61
+ await wixCall("POST", `${BASE}/default`, { id });
62
+ }
63
+
64
+ // ── Change signal ─────────────────────────────────────────────────────────────────────
65
+ const SIGNAL_ENTITY = "address_book";
66
+ const SIGNAL_ROW = "rev";
67
+
68
+ export async function bumpAddressBook(): Promise<void> {
69
+ try { await upsert(SIGNAL_ENTITY, { id: SIGNAL_ROW, rev: String(Date.now()) } as unknown as DbEntity); } catch { /* local_database not granted */ }
70
+ }
71
+
72
+ export async function readAddressBookRev(): Promise<string> {
73
+ try {
74
+ const rows = (await getAll(SIGNAL_ENTITY)) as unknown as { id: string; rev?: string }[];
75
+ return rows.find((r) => r.id === SIGNAL_ROW)?.rev ?? "";
76
+ } catch {
77
+ return "";
78
+ }
79
+ }
80
+
81
+ // ── Countries and display ─────────────────────────────────────────────────────────────
82
+ export function countryByCode(code: string | null | undefined): CountryRow | undefined {
83
+ const c = String(code ?? "").trim().toUpperCase();
84
+ if (!c) return undefined;
85
+ return COUNTRIES.find((row) => row[0] === c) ?? COUNTRIES.find((row) => row[1] === c);
86
+ }
87
+
88
+ export function regionName(country: CountryRow | undefined, key: string | null | undefined): string {
89
+ const k = String(key ?? "").trim();
90
+ if (!k) return "";
91
+ const bare = k.includes("-") ? k.slice(k.indexOf("-") + 1) : k;
92
+ return country?.[6].find(([rk]) => rk === bare)?.[1] ?? bare;
93
+ }
94
+
95
+ export function fullNameOf(a: WixAddress): string {
96
+ return [a.fullName?.firstName, a.fullName?.lastName].map((p) => (p ?? "").trim()).filter(Boolean).join(" ");
97
+ }
98
+
99
+ /** The street line. Some countries store street name and number instead of line 1. */
100
+ export function streetLineOf(a: WixAddress): string {
101
+ const line1 = (a.addressLine1 ?? "").trim();
102
+ if (line1) return line1;
103
+ return [a.street?.name, a.street?.number].map((p) => (p ?? "").trim()).filter(Boolean).join(" ");
104
+ }
105
+
106
+ /** "Dublin, Dublin D02 X285" — city, then region and postal code. */
107
+ export function cityLineOf(a: WixAddress): string {
108
+ const country = countryByCode(a.country);
109
+ const region = regionName(country, a.subdivision);
110
+ const tail = [region, (a.zipCode ?? "").trim()].filter(Boolean).join(" ");
111
+ return [(a.city ?? "").trim(), tail].filter(Boolean).join(", ");
112
+ }
113
+
114
+ export function countryNameOf(a: WixAddress): string {
115
+ return countryByCode(a.country)?.[2] ?? String(a.country ?? "");
116
+ }