@wix/himalaya-cli 0.1747.0 → 0.1749.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 (381) hide show
  1. package/bin/himi +16 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +9 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +34 -8
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +45 -18
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/l10n.mjs +1 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +36 -14
  8. package/dist/browser-plane/assets.json +7 -7
  9. package/dist/browser-plane/preview-deferred/{63821bbb8f637899037252154a5587f0596e4b537173c7f50551f9e44f7c22c0.bin → b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin} +1 -1
  10. package/dist/browser-plane/sw.js +6 -6
  11. package/dist/browser-plane/t5-frame.html +1 -1
  12. package/dist/browser-plane/t5-worker-frame.html +1 -1
  13. package/dist/cli.mjs +2616 -1883
  14. package/dist/preview-assets.generated.bin +0 -0
  15. package/guides/component-reference.json +1 -1
  16. package/guides/component-reference.md +9 -0
  17. package/guides/one-app-to-himi-app.md +11 -6
  18. package/guides/wix-business-context.md +25 -1
  19. package/guides/wix-site-to-himi-app.md +2 -1
  20. package/package.json +2 -2
  21. package/template-icons/medical-services.png +0 -0
  22. package/templates/beauty-salon/dev/index.ts +1 -0
  23. package/templates/beauty-salon/l10n/en.json +6 -0
  24. package/templates/beauty-salon/l10n/fr.json +36 -5
  25. package/templates/beauty-salon/l10n/he.json +29 -4
  26. package/templates/beauty-salon/recipes/blog-hero.json +95 -0
  27. package/templates/beauty-salon/recipes/blog-list-thumb-start.json +177 -147
  28. package/templates/beauty-salon/recipes/blog-list.json +172 -142
  29. package/templates/beauty-salon/recipes/events-inline-list.json +30 -5
  30. package/templates/beauty-salon/recipes/events-inline.json +30 -5
  31. package/templates/beauty-salon/recipes/faq-list.json +503 -0
  32. package/templates/beauty-salon/recipes/groups-list.json +196 -0
  33. package/templates/beauty-salon/recipes/products-carousel.json +141 -0
  34. package/templates/beauty-salon/recipes/products-grid.json +143 -0
  35. package/templates/beauty-salon/tier5-src/_shared/blog-list.ts +9 -9
  36. package/templates/beauty-salon/tier5-src/_shared/events-inline.ts +7 -5
  37. package/templates/beauty-salon/tier5-src/_shared/faq-list.ts +405 -0
  38. package/templates/beauty-salon/tier5-src/_shared/groups-section.ts +110 -0
  39. package/templates/beauty-salon/tier5-src/_shared/member-bookings.ts +17 -4
  40. package/templates/beauty-salon/tier5-src/_shared/member-row-extras.ts +10 -2
  41. package/templates/beauty-salon/tier5-src/_shared/members-directory.ts +9 -5
  42. package/templates/beauty-salon/tier5-src/_shared/products-section.ts +76 -0
  43. package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +2 -2
  44. package/templates/beauty-salon/tier5-src/_shared/staff-name.ts +18 -0
  45. package/templates/beauty-salon/tier5-src/himi-booking-bookings/index.ts +6 -2
  46. package/templates/beauty-salon/tier5-src/himi-booking-service/index.ts +7 -2
  47. package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +6 -4
  48. package/templates/beauty-salon-owner/dev/index.ts +54 -0
  49. package/templates/beauty-salon-owner/tier5-src/_shared/aria-chat.ts +30 -4
  50. package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  51. package/templates/branded-lite/dev/index.ts +1 -0
  52. package/templates/branded-lite/l10n/fr.json +15 -5
  53. package/templates/branded-lite/l10n/he.json +12 -4
  54. package/templates/branded-lite/recipes/blog-hero.json +95 -0
  55. package/templates/branded-lite/recipes/blog-list-thumb-start.json +177 -147
  56. package/templates/branded-lite/recipes/blog-list.json +172 -142
  57. package/templates/branded-lite/recipes/events-inline-list.json +30 -5
  58. package/templates/branded-lite/recipes/events-inline.json +30 -5
  59. package/templates/branded-lite/recipes/faq-list.json +503 -0
  60. package/templates/branded-lite/recipes/groups-list.json +196 -0
  61. package/templates/branded-lite/recipes/products-carousel.json +141 -0
  62. package/templates/branded-lite/recipes/products-grid.json +143 -0
  63. package/templates/branded-lite/tier5-src/_shared/blog-list.ts +9 -9
  64. package/templates/branded-lite/tier5-src/_shared/events-inline.ts +7 -5
  65. package/templates/branded-lite/tier5-src/_shared/faq-list.ts +405 -0
  66. package/templates/branded-lite/tier5-src/_shared/groups-section.ts +110 -0
  67. package/templates/branded-lite/tier5-src/_shared/member-bookings.ts +17 -4
  68. package/templates/branded-lite/tier5-src/_shared/member-row-extras.ts +10 -2
  69. package/templates/branded-lite/tier5-src/_shared/members-directory.ts +9 -5
  70. package/templates/branded-lite/tier5-src/_shared/products-section.ts +76 -0
  71. package/templates/branded-lite/tier5-src/_shared/programs-section.ts +2 -2
  72. package/templates/branded-lite/tier5-src/_shared/staff-name.ts +18 -0
  73. package/templates/branded-lite/tier5-src/himi-booking-bookings/index.ts +6 -2
  74. package/templates/branded-lite/tier5-src/himi-booking-service/index.ts +7 -2
  75. package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +6 -4
  76. package/templates/branded-lite/tier5-src/himi-branded-lite-faq/index.ts +5 -369
  77. package/templates/brandy/README.md +46 -5
  78. package/templates/brandy/config.ts +11 -0
  79. package/templates/brandy/himalaya.template.json +1 -1
  80. package/templates/community-club/dev/index.ts +1 -0
  81. package/templates/community-club/l10n/fr.json +25 -5
  82. package/templates/community-club/l10n/he.json +20 -4
  83. package/templates/community-club/recipes/blog-hero.json +95 -0
  84. package/templates/community-club/recipes/blog-list-thumb-start.json +177 -147
  85. package/templates/community-club/recipes/blog-list.json +172 -142
  86. package/templates/community-club/recipes/events-inline-list.json +30 -5
  87. package/templates/community-club/recipes/events-inline.json +30 -5
  88. package/templates/community-club/recipes/faq-list.json +503 -0
  89. package/templates/community-club/recipes/groups-list.json +196 -0
  90. package/templates/community-club/recipes/products-carousel.json +141 -0
  91. package/templates/community-club/recipes/products-grid.json +143 -0
  92. package/templates/community-club/tier5-src/_shared/blog-list.ts +9 -9
  93. package/templates/community-club/tier5-src/_shared/events-inline.ts +7 -5
  94. package/templates/community-club/tier5-src/_shared/faq-list.ts +405 -0
  95. package/templates/community-club/tier5-src/_shared/groups-section.ts +110 -0
  96. package/templates/community-club/tier5-src/_shared/member-bookings.ts +17 -4
  97. package/templates/community-club/tier5-src/_shared/member-row-extras.ts +10 -2
  98. package/templates/community-club/tier5-src/_shared/members-directory.ts +9 -5
  99. package/templates/community-club/tier5-src/_shared/products-section.ts +76 -0
  100. package/templates/community-club/tier5-src/_shared/programs-section.ts +2 -2
  101. package/templates/community-club-owner/dev/index.ts +54 -0
  102. package/templates/community-club-owner/tier5-src/_shared/aria-chat.ts +30 -4
  103. package/templates/community-club-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  104. package/templates/conference/dev/index.ts +1 -0
  105. package/templates/events-meetups/dev/index.ts +1 -0
  106. package/templates/events-meetups/l10n/fr.json +25 -5
  107. package/templates/events-meetups/l10n/he.json +20 -4
  108. package/templates/events-meetups/recipes/blog-hero.json +95 -0
  109. package/templates/events-meetups/recipes/blog-list-thumb-start.json +177 -147
  110. package/templates/events-meetups/recipes/blog-list.json +172 -142
  111. package/templates/events-meetups/recipes/events-inline-list.json +30 -5
  112. package/templates/events-meetups/recipes/events-inline.json +30 -5
  113. package/templates/events-meetups/recipes/faq-list.json +503 -0
  114. package/templates/events-meetups/recipes/groups-list.json +196 -0
  115. package/templates/events-meetups/recipes/products-carousel.json +141 -0
  116. package/templates/events-meetups/recipes/products-grid.json +143 -0
  117. package/templates/events-meetups/tier5-src/_shared/blog-list.ts +9 -9
  118. package/templates/events-meetups/tier5-src/_shared/events-inline.ts +7 -5
  119. package/templates/events-meetups/tier5-src/_shared/faq-list.ts +405 -0
  120. package/templates/events-meetups/tier5-src/_shared/groups-section.ts +110 -0
  121. package/templates/events-meetups/tier5-src/_shared/member-bookings.ts +17 -4
  122. package/templates/events-meetups/tier5-src/_shared/member-row-extras.ts +10 -2
  123. package/templates/events-meetups/tier5-src/_shared/members-directory.ts +9 -5
  124. package/templates/events-meetups/tier5-src/_shared/products-section.ts +76 -0
  125. package/templates/events-meetups/tier5-src/_shared/programs-section.ts +2 -2
  126. package/templates/events-meetups-owner/dev/index.ts +54 -0
  127. package/templates/events-meetups-owner/tier5-src/_shared/aria-chat.ts +30 -4
  128. package/templates/events-meetups-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  129. package/templates/gym-fitness/dev/index.ts +1 -0
  130. package/templates/gym-fitness/l10n/en.json +6 -0
  131. package/templates/gym-fitness/l10n/fr.json +36 -5
  132. package/templates/gym-fitness/l10n/he.json +29 -4
  133. package/templates/gym-fitness/recipes/blog-hero.json +95 -0
  134. package/templates/gym-fitness/recipes/blog-list-thumb-start.json +177 -147
  135. package/templates/gym-fitness/recipes/blog-list.json +172 -142
  136. package/templates/gym-fitness/recipes/events-inline-list.json +30 -5
  137. package/templates/gym-fitness/recipes/events-inline.json +30 -5
  138. package/templates/gym-fitness/recipes/faq-list.json +503 -0
  139. package/templates/gym-fitness/recipes/groups-list.json +196 -0
  140. package/templates/gym-fitness/recipes/products-carousel.json +141 -0
  141. package/templates/gym-fitness/recipes/products-grid.json +143 -0
  142. package/templates/gym-fitness/tier5-src/_shared/blog-list.ts +9 -9
  143. package/templates/gym-fitness/tier5-src/_shared/events-inline.ts +7 -5
  144. package/templates/gym-fitness/tier5-src/_shared/faq-list.ts +405 -0
  145. package/templates/gym-fitness/tier5-src/_shared/groups-section.ts +110 -0
  146. package/templates/gym-fitness/tier5-src/_shared/member-bookings.ts +17 -4
  147. package/templates/gym-fitness/tier5-src/_shared/member-row-extras.ts +10 -2
  148. package/templates/gym-fitness/tier5-src/_shared/members-directory.ts +9 -5
  149. package/templates/gym-fitness/tier5-src/_shared/products-section.ts +76 -0
  150. package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +2 -2
  151. package/templates/gym-fitness/tier5-src/_shared/staff-name.ts +18 -0
  152. package/templates/gym-fitness/tier5-src/himi-booking-bookings/index.ts +6 -2
  153. package/templates/gym-fitness/tier5-src/himi-booking-service/index.ts +7 -2
  154. package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +6 -4
  155. package/templates/gym-fitness-owner/dev/index.ts +54 -0
  156. package/templates/gym-fitness-owner/tier5-src/_shared/aria-chat.ts +30 -4
  157. package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  158. package/templates/medical-services/README.md +53 -0
  159. package/templates/medical-services/config.ts +320 -0
  160. package/templates/medical-services/dev/index.ts +17783 -0
  161. package/templates/medical-services/himalaya.content.json +46 -0
  162. package/templates/medical-services/himalaya.template.json +14 -0
  163. package/templates/medical-services/icon.png +0 -0
  164. package/templates/medical-services/platforms.json +1 -0
  165. package/templates/medical-services/tier5-src/_shared/app-locale.ts +61 -0
  166. package/templates/medical-services/tier5-src/_shared/booking-location.ts +147 -0
  167. package/templates/medical-services/tier5-src/_shared/booking-session.ts +222 -0
  168. package/templates/medical-services/tier5-src/_shared/branded-lite-hosted.ts +280 -0
  169. package/templates/medical-services/tier5-src/_shared/branded-load-state.ts +109 -0
  170. package/templates/medical-services/tier5-src/_shared/business-chat-copy.ts +40 -0
  171. package/templates/medical-services/tier5-src/_shared/business-chat-history.ts +51 -0
  172. package/templates/medical-services/tier5-src/_shared/business-chat-message-model.ts +177 -0
  173. package/templates/medical-services/tier5-src/_shared/business-chat-model.ts +56 -0
  174. package/templates/medical-services/tier5-src/_shared/business-chat-presenter.ts +576 -0
  175. package/templates/medical-services/tier5-src/_shared/business-chat-transport.ts +148 -0
  176. package/templates/medical-services/tier5-src/_shared/collection-contract.ts +228 -0
  177. package/templates/medical-services/tier5-src/_shared/collection-query.ts +193 -0
  178. package/templates/medical-services/tier5-src/_shared/collection-service.ts +400 -0
  179. package/templates/medical-services/tier5-src/_shared/engine-intl.ts +523 -0
  180. package/templates/medical-services/tier5-src/_shared/faq-list.ts +405 -0
  181. package/templates/medical-services/tier5-src/_shared/himi-account.ts +194 -0
  182. package/templates/medical-services/tier5-src/_shared/himi-booking-saved.ts +88 -0
  183. package/templates/medical-services/tier5-src/_shared/himi-bookings.ts +318 -0
  184. package/templates/medical-services/tier5-src/_shared/himi-copy.ts +116 -0
  185. package/templates/medical-services/tier5-src/_shared/himi-store.ts +7 -0
  186. package/templates/medical-services/tier5-src/_shared/himi-text.ts +24 -0
  187. package/templates/medical-services/tier5-src/_shared/host-events.ts +66 -0
  188. package/templates/medical-services/tier5-src/_shared/hosted-checkout.ts +70 -0
  189. package/templates/medical-services/tier5-src/_shared/iap-attendance-form.ts +106 -0
  190. package/templates/medical-services/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
  191. package/templates/medical-services/tier5-src/_shared/iap-attendance.ts +38 -0
  192. package/templates/medical-services/tier5-src/_shared/iap-worker.ts +127 -0
  193. package/templates/medical-services/tier5-src/_shared/inbox-rooms.ts +68 -0
  194. package/templates/medical-services/tier5-src/_shared/local-preferences.ts +38 -0
  195. package/templates/medical-services/tier5-src/_shared/member-access.ts +52 -0
  196. package/templates/medical-services/tier5-src/_shared/member-account-routes.ts +52 -0
  197. package/templates/medical-services/tier5-src/_shared/member-bookings.ts +107 -0
  198. package/templates/medical-services/tier5-src/_shared/member-screen.ts +99 -0
  199. package/templates/medical-services/tier5-src/_shared/notification-target.ts +141 -0
  200. package/templates/medical-services/tier5-src/_shared/offset-page.ts +10 -0
  201. package/templates/medical-services/tier5-src/_shared/online-actions.ts +76 -0
  202. package/templates/medical-services/tier5-src/_shared/owner-load-error.ts +348 -0
  203. package/templates/medical-services/tier5-src/_shared/payment-setup.ts +6 -0
  204. package/templates/medical-services/tier5-src/_shared/rich-body.ts +78 -0
  205. package/templates/medical-services/tier5-src/_shared/rich-content-link.ts +34 -0
  206. package/templates/medical-services/tier5-src/_shared/sign-in-sheet.ts +18 -0
  207. package/templates/medical-services/tier5-src/_shared/staff-name.ts +18 -0
  208. package/templates/medical-services/tier5-src/_shared/weekly-goal.ts +107 -0
  209. package/templates/medical-services/tier5-src/_shared/wix-bi.ts +85 -0
  210. package/templates/medical-services/tier5-src/_shared/wix-member-links.ts +114 -0
  211. package/templates/medical-services/tier5-src/_shared/wix-service-price.ts +146 -0
  212. package/templates/medical-services/tier5-src/business-chat/index.ts +732 -0
  213. package/templates/medical-services/tier5-src/himi-booking-account/index.ts +252 -0
  214. package/templates/medical-services/tier5-src/himi-booking-bookings/index.ts +468 -0
  215. package/templates/medical-services/tier5-src/himi-booking-service/index.ts +1190 -0
  216. package/templates/medical-services/tier5-src/himi-booking-services/index.ts +791 -0
  217. package/templates/medical-services/tier5-src/himi-booking-time/index.ts +1729 -0
  218. package/templates/medical-services/tier5-src/himi-branded-lite-faq/index.ts +6 -0
  219. package/templates/medical-services/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
  220. package/templates/medical-services/tier5-src/himi-clinic-home/index.ts +389 -0
  221. package/templates/medical-services/tier5-src/himi-store-account/index.ts +998 -0
  222. package/templates/medical-services/tokens.json +418 -0
  223. package/templates/nonprofit-cause/dev/index.ts +1 -0
  224. package/templates/nonprofit-cause/l10n/fr.json +25 -5
  225. package/templates/nonprofit-cause/l10n/he.json +20 -4
  226. package/templates/nonprofit-cause/recipes/blog-hero.json +95 -0
  227. package/templates/nonprofit-cause/recipes/blog-list-thumb-start.json +177 -147
  228. package/templates/nonprofit-cause/recipes/blog-list.json +172 -142
  229. package/templates/nonprofit-cause/recipes/events-inline-list.json +30 -5
  230. package/templates/nonprofit-cause/recipes/events-inline.json +30 -5
  231. package/templates/nonprofit-cause/recipes/faq-list.json +503 -0
  232. package/templates/nonprofit-cause/recipes/groups-list.json +196 -0
  233. package/templates/nonprofit-cause/recipes/products-carousel.json +141 -0
  234. package/templates/nonprofit-cause/recipes/products-grid.json +143 -0
  235. package/templates/nonprofit-cause/tier5-src/_shared/blog-list.ts +9 -9
  236. package/templates/nonprofit-cause/tier5-src/_shared/events-inline.ts +7 -5
  237. package/templates/nonprofit-cause/tier5-src/_shared/faq-list.ts +405 -0
  238. package/templates/nonprofit-cause/tier5-src/_shared/groups-section.ts +110 -0
  239. package/templates/nonprofit-cause/tier5-src/_shared/member-bookings.ts +17 -4
  240. package/templates/nonprofit-cause/tier5-src/_shared/member-row-extras.ts +10 -2
  241. package/templates/nonprofit-cause/tier5-src/_shared/members-directory.ts +9 -5
  242. package/templates/nonprofit-cause/tier5-src/_shared/products-section.ts +76 -0
  243. package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +2 -2
  244. package/templates/nonprofit-cause-owner/dev/index.ts +54 -0
  245. package/templates/nonprofit-cause-owner/tier5-src/_shared/aria-chat.ts +30 -4
  246. package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  247. package/templates/owner-lite/dev/index.ts +54 -0
  248. package/templates/owner-lite/tier5-src/_shared/aria-chat.ts +30 -4
  249. package/templates/owner-lite/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  250. package/templates/podcast-creator/dev/index.ts +1 -0
  251. package/templates/podcast-creator/l10n/fr.json +35 -5
  252. package/templates/podcast-creator/l10n/he.json +28 -4
  253. package/templates/podcast-creator/recipes/blog-hero.json +95 -0
  254. package/templates/podcast-creator/recipes/blog-list-thumb-start.json +177 -147
  255. package/templates/podcast-creator/recipes/blog-list.json +172 -142
  256. package/templates/podcast-creator/recipes/events-inline-list.json +30 -5
  257. package/templates/podcast-creator/recipes/events-inline.json +30 -5
  258. package/templates/podcast-creator/recipes/faq-list.json +503 -0
  259. package/templates/podcast-creator/recipes/groups-list.json +196 -0
  260. package/templates/podcast-creator/recipes/products-carousel.json +141 -0
  261. package/templates/podcast-creator/recipes/products-grid.json +143 -0
  262. package/templates/podcast-creator/tier5-src/_shared/blog-list.ts +9 -9
  263. package/templates/podcast-creator/tier5-src/_shared/events-inline.ts +7 -5
  264. package/templates/podcast-creator/tier5-src/_shared/faq-list.ts +405 -0
  265. package/templates/podcast-creator/tier5-src/_shared/groups-section.ts +110 -0
  266. package/templates/podcast-creator/tier5-src/_shared/member-bookings.ts +17 -4
  267. package/templates/podcast-creator/tier5-src/_shared/member-row-extras.ts +10 -2
  268. package/templates/podcast-creator/tier5-src/_shared/members-directory.ts +9 -5
  269. package/templates/podcast-creator/tier5-src/_shared/products-section.ts +76 -0
  270. package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +2 -2
  271. package/templates/podcast-creator-owner/dev/index.ts +54 -0
  272. package/templates/podcast-creator-owner/tier5-src/_shared/aria-chat.ts +30 -4
  273. package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  274. package/templates/portfolio-creative/dev/index.ts +1 -0
  275. package/templates/portfolio-creative/l10n/fr.json +25 -5
  276. package/templates/portfolio-creative/l10n/he.json +20 -4
  277. package/templates/portfolio-creative/recipes/blog-hero.json +95 -0
  278. package/templates/portfolio-creative/recipes/blog-list-thumb-start.json +177 -147
  279. package/templates/portfolio-creative/recipes/blog-list.json +172 -142
  280. package/templates/portfolio-creative/recipes/events-inline-list.json +30 -5
  281. package/templates/portfolio-creative/recipes/events-inline.json +30 -5
  282. package/templates/portfolio-creative/recipes/faq-list.json +503 -0
  283. package/templates/portfolio-creative/recipes/groups-list.json +196 -0
  284. package/templates/portfolio-creative/recipes/products-carousel.json +141 -0
  285. package/templates/portfolio-creative/recipes/products-grid.json +143 -0
  286. package/templates/portfolio-creative/tier5-src/_shared/blog-list.ts +9 -9
  287. package/templates/portfolio-creative/tier5-src/_shared/events-inline.ts +7 -5
  288. package/templates/portfolio-creative/tier5-src/_shared/faq-list.ts +405 -0
  289. package/templates/portfolio-creative/tier5-src/_shared/groups-section.ts +110 -0
  290. package/templates/portfolio-creative/tier5-src/_shared/member-bookings.ts +17 -4
  291. package/templates/portfolio-creative/tier5-src/_shared/member-row-extras.ts +10 -2
  292. package/templates/portfolio-creative/tier5-src/_shared/members-directory.ts +9 -5
  293. package/templates/portfolio-creative/tier5-src/_shared/products-section.ts +76 -0
  294. package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +2 -2
  295. package/templates/portfolio-creative-owner/dev/index.ts +54 -0
  296. package/templates/portfolio-creative-owner/tier5-src/_shared/aria-chat.ts +30 -4
  297. package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  298. package/templates/restaurant/dev/index.ts +1 -0
  299. package/templates/restaurant/l10n/fr.json +35 -5
  300. package/templates/restaurant/l10n/he.json +28 -4
  301. package/templates/restaurant/recipes/blog-hero.json +95 -0
  302. package/templates/restaurant/recipes/blog-list-thumb-start.json +177 -147
  303. package/templates/restaurant/recipes/blog-list.json +172 -142
  304. package/templates/restaurant/recipes/events-inline-list.json +30 -5
  305. package/templates/restaurant/recipes/events-inline.json +30 -5
  306. package/templates/restaurant/recipes/faq-list.json +503 -0
  307. package/templates/restaurant/recipes/groups-list.json +196 -0
  308. package/templates/restaurant/recipes/products-carousel.json +141 -0
  309. package/templates/restaurant/recipes/products-grid.json +143 -0
  310. package/templates/restaurant/tier5-src/_shared/blog-list.ts +9 -9
  311. package/templates/restaurant/tier5-src/_shared/events-inline.ts +7 -5
  312. package/templates/restaurant/tier5-src/_shared/faq-list.ts +405 -0
  313. package/templates/restaurant/tier5-src/_shared/groups-section.ts +110 -0
  314. package/templates/restaurant/tier5-src/_shared/member-bookings.ts +17 -4
  315. package/templates/restaurant/tier5-src/_shared/member-row-extras.ts +10 -2
  316. package/templates/restaurant/tier5-src/_shared/members-directory.ts +9 -5
  317. package/templates/restaurant/tier5-src/_shared/products-section.ts +76 -0
  318. package/templates/restaurant/tier5-src/_shared/programs-section.ts +2 -2
  319. package/templates/restaurant-owner/dev/index.ts +54 -0
  320. package/templates/restaurant-owner/tier5-src/_shared/aria-chat.ts +30 -4
  321. package/templates/restaurant-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  322. package/templates/retail-store/dev/index.ts +1 -0
  323. package/templates/retail-store/l10n/fr.json +25 -5
  324. package/templates/retail-store/l10n/he.json +20 -4
  325. package/templates/retail-store/recipes/blog-hero.json +95 -0
  326. package/templates/retail-store/recipes/blog-list-thumb-start.json +177 -147
  327. package/templates/retail-store/recipes/blog-list.json +172 -142
  328. package/templates/retail-store/recipes/events-inline-list.json +30 -5
  329. package/templates/retail-store/recipes/events-inline.json +30 -5
  330. package/templates/retail-store/recipes/faq-list.json +503 -0
  331. package/templates/retail-store/recipes/groups-list.json +196 -0
  332. package/templates/retail-store/recipes/products-carousel.json +141 -0
  333. package/templates/retail-store/recipes/products-grid.json +143 -0
  334. package/templates/retail-store/tier5-src/_shared/blog-list.ts +9 -9
  335. package/templates/retail-store/tier5-src/_shared/events-inline.ts +7 -5
  336. package/templates/retail-store/tier5-src/_shared/faq-list.ts +405 -0
  337. package/templates/retail-store/tier5-src/_shared/groups-section.ts +110 -0
  338. package/templates/retail-store/tier5-src/_shared/member-bookings.ts +17 -4
  339. package/templates/retail-store/tier5-src/_shared/member-row-extras.ts +10 -2
  340. package/templates/retail-store/tier5-src/_shared/members-directory.ts +9 -5
  341. package/templates/retail-store/tier5-src/_shared/products-section.ts +76 -0
  342. package/templates/retail-store/tier5-src/_shared/programs-section.ts +2 -2
  343. package/templates/retail-store-owner/dev/index.ts +54 -0
  344. package/templates/retail-store-owner/tier5-src/_shared/aria-chat.ts +30 -4
  345. package/templates/retail-store-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
  346. package/templates/salon-spa/dev/index.ts +1 -0
  347. package/templates/salon-spa/tier5-src/_shared/member-bookings.ts +17 -4
  348. package/templates/salon-spa/tier5-src/_shared/staff-name.ts +18 -0
  349. package/templates/salon-spa/tier5-src/himi-booking-bookings/index.ts +6 -2
  350. package/templates/salon-spa/tier5-src/himi-booking-service/index.ts +7 -2
  351. package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +6 -4
  352. package/templates/wholesale-store/dev/index.ts +1 -0
  353. package/templates/yoga-studio/dev/index.ts +1 -0
  354. package/templates/yoga-studio/l10n/en.json +6 -0
  355. package/templates/yoga-studio/l10n/fr.json +46 -5
  356. package/templates/yoga-studio/l10n/he.json +37 -4
  357. package/templates/yoga-studio/recipes/blog-hero.json +95 -0
  358. package/templates/yoga-studio/recipes/blog-list-thumb-start.json +177 -147
  359. package/templates/yoga-studio/recipes/blog-list.json +172 -142
  360. package/templates/yoga-studio/recipes/events-inline-list.json +30 -5
  361. package/templates/yoga-studio/recipes/events-inline.json +30 -5
  362. package/templates/yoga-studio/recipes/faq-list.json +503 -0
  363. package/templates/yoga-studio/recipes/groups-list.json +196 -0
  364. package/templates/yoga-studio/recipes/products-carousel.json +141 -0
  365. package/templates/yoga-studio/recipes/products-grid.json +143 -0
  366. package/templates/yoga-studio/tier5-src/_shared/blog-list.ts +9 -9
  367. package/templates/yoga-studio/tier5-src/_shared/events-inline.ts +7 -5
  368. package/templates/yoga-studio/tier5-src/_shared/faq-list.ts +405 -0
  369. package/templates/yoga-studio/tier5-src/_shared/groups-section.ts +110 -0
  370. package/templates/yoga-studio/tier5-src/_shared/member-bookings.ts +17 -4
  371. package/templates/yoga-studio/tier5-src/_shared/member-row-extras.ts +10 -2
  372. package/templates/yoga-studio/tier5-src/_shared/members-directory.ts +9 -5
  373. package/templates/yoga-studio/tier5-src/_shared/products-section.ts +76 -0
  374. package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +2 -2
  375. package/templates/yoga-studio/tier5-src/_shared/staff-name.ts +18 -0
  376. package/templates/yoga-studio/tier5-src/himi-booking-bookings/index.ts +6 -2
  377. package/templates/yoga-studio/tier5-src/himi-booking-service/index.ts +7 -2
  378. package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +6 -4
  379. package/templates/yoga-studio-owner/dev/index.ts +54 -0
  380. package/templates/yoga-studio-owner/tier5-src/_shared/aria-chat.ts +30 -4
  381. package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-aria/index.ts +29 -0
@@ -0,0 +1,76 @@
1
+ // A page's products section as a registrable service: the first products of a source collection, as tiles that open the product.
2
+ // categoryId -> the source section's collection (unset: the whole catalog, the "All Products" collection),
3
+ // limit -> how many tiles (the section is a rail or a short grid, not the shop); `noMore` is false when the collection has more,
4
+ // which is when the section's See All button (to the shop, on this collection) shows.
5
+ // A page worker registers it under a service name; the descriptor binds `$service:<serviceName>.*` (recipes products-carousel / products-grid).
6
+ import { defineService } from "@himalaya/state";
7
+ import { searchStoreProducts, productImage, productPrice, type StoreProduct } from "./himi-store.js";
8
+ import { copyParam, stashCopy } from "./himi-copy.js";
9
+
10
+ export interface ProductsSectionOptions {
11
+ /** The source collection's id; unset reads the whole catalog. */
12
+ categoryId?: string;
13
+ /** How many products to show. */
14
+ limit?: number;
15
+ }
16
+
17
+ export interface ProductRow {
18
+ id: string; name: string; price: string;
19
+ image: string; initial: string; hasImage: boolean; noImage: boolean;
20
+ /** The product screen a tile opens; the tile binds `id` as its nav param. */
21
+ detailScreenId: string;
22
+ }
23
+
24
+ export interface ProductsSectionState {
25
+ status: "loading" | "ready" | "error";
26
+ rows: ProductRow[];
27
+ emptyText: string;
28
+ notLoading: boolean; notErrored: boolean; noRows: boolean; noEmpty: boolean;
29
+ /** false when the collection has more products than the section shows. */
30
+ noMore: boolean;
31
+ }
32
+
33
+ const DEFAULT_LIMIT = 8;
34
+ /** A 156pt tile at 3x: the shared list size (1000px) would ship far more pixels than a rail shows. */
35
+ const TILE_IMAGE = { width: 480, height: 480, quality: 85 };
36
+
37
+ function rowOf(product: StoreProduct): ProductRow {
38
+ const name = (product.name ?? "").trim();
39
+ const image = productImage(product, TILE_IMAGE);
40
+ return {
41
+ id: product.id ?? "", name, price: productPrice(product),
42
+ image, initial: (name[0] ?? "#").toUpperCase(), hasImage: !!image, noImage: !image,
43
+ detailScreenId: "himi_product",
44
+ };
45
+ }
46
+
47
+ export function registerProductsSection(serviceName: string, options: ProductsSectionOptions = {}) {
48
+ const limit = options.limit ?? DEFAULT_LIMIT;
49
+ const view = (status: ProductsSectionState["status"], rows: ProductRow[], more: boolean): ProductsSectionState => ({
50
+ status, rows,
51
+ emptyText: status === "ready" && !rows.length
52
+ ? options.categoryId ? copyParam("shop.emptyCategoryText", "No products in this category yet.") : copyParam("shop.emptyText", "No products are published yet.")
53
+ : "",
54
+ notLoading: status !== "loading", notErrored: status !== "error",
55
+ noRows: !rows.length, noEmpty: !(status === "ready" && !rows.length),
56
+ noMore: !more,
57
+ });
58
+ return defineService<ProductsSectionState, { load: (state: ProductsSectionState, arg?: unknown) => Promise<ProductsSectionState> }>(serviceName, {
59
+ state: view("loading", [], false),
60
+ actions: {
61
+ load: async (_state, arg) => {
62
+ stashCopy(arg);
63
+ try {
64
+ const response = await searchStoreProducts({ limit, ...(options.categoryId ? { categoryId: options.categoryId } : {}) });
65
+ const rows = (response.products ?? []).filter((product) => product.id).slice(0, limit).map(rowOf);
66
+ const total = response.pagingMetadata?.total;
67
+ const more = response.pagingMetadata?.hasNext === true || (typeof total === "number" && total > rows.length);
68
+ return view("ready", rows, more);
69
+ } catch (error) {
70
+ console.warn("products_section: the products could not be read", error);
71
+ return view("error", [], false);
72
+ }
73
+ },
74
+ },
75
+ });
76
+ }
@@ -28,7 +28,7 @@ import { descriptionBody } from "./rich-body.js";
28
28
  import { programDescription } from "./program-description.js";
29
29
  import { isNotFoundError } from "./detail-presence.js";
30
30
  import { copyParam, copyTemplate, stashCopy } from "./himi-copy.js";
31
- import { formatCurrency, formatDateMedium } from "./engine-intl.js";
31
+ import { formatCurrency, formatDateMedium, formatNumber } from "./engine-intl.js";
32
32
  import { iapPriceCopy, resetUnhydratedKeysOnOlderRuntime } from "./iap-worker.js";
33
33
 
34
34
  const PAGE_SIZE = 20;
@@ -256,7 +256,7 @@ function accessLine(p: WixProgram, participants: number | undefined): string {
256
256
  if (participants === undefined) return label;
257
257
  const count = participants === 1
258
258
  ? copyParam("memberPrograms.participantsOne", "1 participant")
259
- : copyTemplate("memberPrograms.participantsMany", "{count} participants", { count: participants });
259
+ : copyTemplate("memberPrograms.participantsMany", "{count} participants", { count: formatNumber(participants) });
260
260
  return `${label} · ${count}`;
261
261
  }
262
262
 
@@ -0,0 +1,18 @@
1
+ // How a staff member's name splits into words for initials and short names, shared by every
2
+ // worker that shows Bookings staff (himi-booking-service, himi-clinic-home), so a doctor's
3
+ // initials read the same on every screen ("Dr. John Wang, MD" is "JW" everywhere).
4
+
5
+ /** A courtesy title a staff name may start with ("Dr. John Wang"): not a name of its own. */
6
+ const TITLE = /^(dr|prof|mr|mrs|ms|mx)\.?$/i;
7
+ /** A credential or suffix a staff name may end with ("John Wang, MD", "Martin King Jr."). No
8
+ * "Do" or "Pa": they are surnames too ("Anh Do"). */
9
+ const SUFFIX = /^(md|phd|dds|dmd|rn|np|jr|sr|ii|iii|iv)\.?$/i;
10
+
11
+ /** The name's words without a leading title or trailing credentials, commas dropped. A one-word
12
+ * name keeps its word, title or not. */
13
+ export function nameWords(name: string): { title: string; words: string[] } {
14
+ const words = name.split(/\s+/).map((word) => word.replace(/,+$/, "")).filter(Boolean);
15
+ const title = words.length > 1 && TITLE.test(words[0]!) ? words.shift()! : "";
16
+ while (words.length > 1 && SUFFIX.test(words[words.length - 1]!)) words.pop();
17
+ return { title, words };
18
+ }
@@ -6,7 +6,7 @@ import { wixMediaUrl, WIX_LIST_IMAGE } from "@himalaya/wix-media";
6
6
  import { navigate } from "@himalaya/state";
7
7
  import { copyParam, copyTemplate } from "../_shared/himi-copy.js";
8
8
  import { memberAccess, assertMemberAccess, memberAccessChanged, memberAccessDenied, type MemberAccess } from "../_shared/member-access.js";
9
- import { fetchMemberBookings, CANCELLED_STATUSES, type MemberBookingRow } from "../_shared/member-bookings.js";
9
+ import { fetchMemberBookings, CANCELLED_STATUSES, UNCONFIRMED_STATUSES, type MemberBookingRow } from "../_shared/member-bookings.js";
10
10
  import { emitHostEvent } from "../_shared/host-events.js";
11
11
  import { formatClock, formatClockRange, formatDateMedium, formatMonthDay, formatWeekdayMonthDay, formatWeekdayMonthDayLong } from "../_shared/engine-intl.js";
12
12
  import { parseWeeklyGoal, weeklyGoalProgress, weeklySessionsFromPages } from "../_shared/weekly-goal.js";
@@ -133,6 +133,7 @@ function tagOf(row: MemberBookingRow): string {
133
133
  case "CANCELED": case "CANCELLED": return copyParam("bookings.statusCancelled", "Canceled");
134
134
  case "DECLINED": return copyParam("bookings.statusDeclined", "Declined");
135
135
  }
136
+ if (UNCONFIRMED_STATUSES.includes(row.statusKey)) return copyParam("bookings.statusUnconfirmed", "Not confirmed");
136
137
  return row.isCourse ? copyParam("bookings.coursePrefix", "Course") : "";
137
138
  }
138
139
 
@@ -194,6 +195,7 @@ function paymentOf(row: MemberBookingRow): string {
194
195
  function noticeOf(row: MemberBookingRow): string {
195
196
  if (row.statusKey === "PENDING" || row.statusKey === "PENDING_APPROVAL") return copyParam("bookings.pendingNotice", "The business must approve this booking. You get an email when they reply.");
196
197
  if (row.statusKey === "WAITING_LIST") return copyParam("bookings.waitlistNotice", "You are on the waitlist. You get an email if a spot opens.");
198
+ if (UNCONFIRMED_STATUSES.includes(row.statusKey)) return copyParam("bookings.unconfirmedNotice", "This booking is not confirmed. If you did not finish checkout, the business did not get it.");
197
199
  return "";
198
200
  }
199
201
 
@@ -314,7 +316,9 @@ const svc = defineBackendCollection<S, MemberBookingRow>("himiBookingBookings",
314
316
  const member = await memberAccess();
315
317
  if (cursor && (!pageMember || pageMember.email !== member.email || pageMember.scope !== member.scope)) throw memberAccessChanged();
316
318
  if (!cursor || !queryNow) queryNow = new Date().toISOString();
317
- const page = await fetchMemberBookings(criteria, cursor, queryNow, member);
319
+ // The list keeps an unconfirmed booking, marked "Not confirmed", so the member can see it
320
+ // and cancel it; Home and the weekly goal leave it out.
321
+ const page = await fetchMemberBookings(criteria, cursor, queryNow, member, { includeUnconfirmed: true });
318
322
  if (cursor) return page;
319
323
  const weekly = weeklyGoal > 0 && member.email ? await fetchWeeklySessionsDone(member, Date.now()) : null;
320
324
  return { ...page, metadata: { ...page.metadata, weeklyDone: weekly } };
@@ -25,6 +25,7 @@ import { formatClock, formatDateMedium, formatMonthDay } from "../_shared/engine
25
25
  import { descriptionBody } from "../_shared/rich-body.js";
26
26
  import { openRichLink } from "../_shared/rich-content-link.js";
27
27
  import { isServiceSaved, toggleSavedService } from "../_shared/himi-booking-saved.js";
28
+ import { nameWords } from "../_shared/staff-name.js";
28
29
 
29
30
  // Offline-first (data-offline): the service detail is a public read-through. On a
30
31
  // fetch failure we fall back to the last-synced row for this service written by
@@ -334,11 +335,15 @@ function locationRows(service: WixService): LocationRow[] {
334
335
  // ---- Staff -----------------------------------------------------------------------
335
336
 
336
337
  function initials(name: string): string {
337
- return name.split(/\s+/).filter(Boolean).slice(0, 2).map((part) => part[0]!.toUpperCase()).join("");
338
+ return nameWords(name).words.slice(0, 2).map((part) => part[0]!.toUpperCase()).join("");
338
339
  }
339
340
 
341
+ /** How a name reads in a short list: the first name ("Noa"), or for a titled name the title and
342
+ * the surname ("Dr. Wang") — the first word alone made a clinic's line "With Dr., Dr. and 2 more". */
340
343
  function firstName(name: string): string {
341
- return name.split(/\s+/)[0] ?? name;
344
+ const { title, words } = nameWords(name);
345
+ if (title) return `${title} ${words[words.length - 1]}`;
346
+ return words[0] ?? name;
342
347
  }
343
348
 
344
349
  /** "With Noa Levi", "With Noa or Dana", "With Noa, Dana and 2 more". Empty when the
@@ -9,7 +9,7 @@ import { addDays as addLocalDays, dayKey, dayLabel, timeLabel, toDate } from "@h
9
9
  import { dispatch } from "@himalaya/dispatch";
10
10
  import { bookSchedule, bookSlot, getService, queryServiceAvailability, registerToWaitlist, type WixBookingSlotFull, type WixSelectedPaymentOption, type WixService } from "@himalaya/wix-bookings";
11
11
  import { createCheckout, createOrder } from "@himalaya/wix-ecom";
12
- import { createRedirectSession, type WixSlot } from "@himalaya/wix-redirects";
12
+ import { createRedirectSession } from "@himalaya/wix-redirects";
13
13
  import { isPaymentSetupFailure, payCashierOrder } from "@himalaya/checkout";
14
14
  import { hostedCheckoutOpener, isHostedWorker } from "../_shared/hosted-checkout.js";
15
15
  import { session as wixPlatformSession } from "@himalaya/wix-platform";
@@ -1633,10 +1633,12 @@ async function bookSelectedIn(s: S): Promise<S> {
1633
1633
  msid: await resolveMsid(),
1634
1634
  // Hosted (Spaces): the host opens this booking's checkout as the lent member.
1635
1635
  ...(hosted ? { openCashier: hostedCheckoutOpener(checkoutId) } : {}),
1636
+ // The site's checkout page for THIS checkout, which already holds the booking made above.
1637
+ // Never `bookingsCheckout`: that opens the site's booking form, which books the slot
1638
+ // again — the form refused it ("There was an issue with booking this service") and the
1639
+ // member could not pay, while the first booking stayed behind unpaid.
1636
1640
  cashierUrl: async () => {
1637
- const redirect = await createRedirectSession(s.isCourse
1638
- ? { ecomCheckout: { checkoutId } }
1639
- : { bookingsCheckout: { slotAvailability: { slot: slot as WixSlot } } });
1641
+ const redirect = await createRedirectSession({ ecomCheckout: { checkoutId } });
1640
1642
  return redirect.redirectSession?.fullUrl;
1641
1643
  },
1642
1644
  });
@@ -1,370 +1,6 @@
1
- import { defineService } from "@himalaya/state";
2
- import {
3
- queryCategories,
4
- queryQuestionEntries,
5
- type WixCategory,
6
- type WixQuestionEntry,
7
- } from "@himalaya/wix-faq";
8
- import { openRichLink } from "../_shared/rich-content-link.js";
9
- import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
1
+ // The himi_faq screen's worker: the shared FAQ service under the screen's own service name. The whole worker lives in
2
+ // `_shared/faq-list.ts` so a migrated page can host the same FAQ next to other sections.
3
+ import { registerFaqList } from "../_shared/faq-list.js";
10
4
 
11
- interface FaqQuestion {
12
- id: string;
13
- categoryId: string;
14
- question: string;
15
- /** The PLAIN_TEXT answer: the RichContent fallback, and what shows with no trusted document. */
16
- answer: string;
17
- /** [rico] #3372 — the RICH_CONTENT answer as ONE document string, used ONLY when its text matches the plain
18
- * answer (a legacy DraftJS record converts unreliably); "" otherwise. */
19
- answerJson: string;
20
- /** answerJson !== "" — gates the plain answer, because RichContent draws nothing for "". */
21
- hasAnswerJson: boolean;
22
- sortOrder?: number;
23
- status: string;
24
- }
25
-
26
- interface FaqCategory {
27
- id: string;
28
- title: string;
29
- sortOrder?: number;
30
- }
31
-
32
- interface QuestionRow {
33
- id: string;
34
- title: string;
35
- answer: string;
36
- answerJson: string;
37
- hasAnswerJson: boolean;
38
- expanded: boolean;
39
- }
40
-
41
- interface CategorySection {
42
- id: string;
43
- title: string;
44
- questions: QuestionRow[];
45
- }
46
-
47
- interface FaqDisplayRow extends QuestionRow {
48
- categoryTitle: string;
49
- categoryHeaderHidden: boolean;
50
- }
51
-
52
- interface FaqState {
53
- status: "loading" | "ready" | "error" | "forbidden" | "notInstalled";
54
- categories: FaqCategory[];
55
- questions: FaqQuestion[];
56
- sections: CategorySection[];
57
- rows: FaqDisplayRow[];
58
- query: string;
59
- expandedIds: string[];
60
- otherTitle: string;
61
- loadingHidden: boolean;
62
- contentHidden: boolean;
63
- emptyHidden: boolean;
64
- errorHidden: boolean;
65
- forbiddenHidden: boolean;
66
- notInstalledHidden: boolean;
67
- }
68
-
69
- const PAGE_SIZE = 100;
70
-
71
- /** Caps on the static pairs, matching `BRANDED_LITE_FAQ_LIMITS` in the app contract. The
72
- * param is re-bounded here because a worker must not trust a descriptor it did not build. */
73
- const STATIC_LIMITS = { pairs: 20, question: 200, answer: 1500 } as const;
74
- const STATIC_CATEGORY: FaqCategory = { id: "himi-static-faq", title: "" };
75
-
76
- /** The site's own FAQ pairs — questions it publishes as page sections rather than
77
- * through the Wix FAQ app, carried in by `site analyze --apply` as the `staticFaq` onAppear
78
- * param (a JSON string: action params are string-valued). They are the FALLBACK: shown only
79
- * when the FAQ app yields no visible question, so an owner-edited Wix FAQ always wins. */
80
- let staticQuestions: FaqQuestion[] = [];
81
-
82
- function parseStaticFaq(raw: unknown): FaqQuestion[] {
83
- let pairs: unknown = raw;
84
- if (typeof raw === "string") {
85
- try {
86
- pairs = JSON.parse(raw);
87
- } catch {
88
- // A malformed param is a DESCRIPTOR bug, not an empty FAQ: there is no fallback to
89
- // offer, so the screen shows exactly what the Wix FAQ read says — its content, its
90
- // empty card, or its error card — rather than pretending the site has no questions.
91
- pairs = undefined;
92
- }
93
- }
94
- if (!Array.isArray(pairs)) return [];
95
- const out: FaqQuestion[] = [];
96
- for (const pair of pairs) {
97
- if (out.length >= STATIC_LIMITS.pairs) break;
98
- const row = pair && typeof pair === "object" ? pair as { q?: unknown; a?: unknown } : {};
99
- const question = typeof row.q === "string" ? row.q.trim().slice(0, STATIC_LIMITS.question) : "";
100
- const answer = typeof row.a === "string" ? row.a.trim().slice(0, STATIC_LIMITS.answer) : "";
101
- if (!question || !answer) continue;
102
- out.push({
103
- id: `himi-static-faq-${out.length}`,
104
- categoryId: STATIC_CATEGORY.id,
105
- question,
106
- answer,
107
- // The site's own pairs are plain strings: there is no document to render.
108
- answerJson: "",
109
- hasAnswerJson: false,
110
- sortOrder: out.length,
111
- status: "VISIBLE",
112
- });
113
- }
114
- return out;
115
- }
116
-
117
- /** The site's pairs as a ready state, or undefined when there are none to fall back to. */
118
- function staticFallback(state: FaqState): FaqState | undefined {
119
- if (!staticQuestions.length) return undefined;
120
- return ready({ ...state, categories: [STATIC_CATEGORY], questions: staticQuestions });
121
- }
122
-
123
- function sortByWixOrder<T extends { id: string; sortOrder?: number }>(left: T, right: T): number {
124
- const a = Number.isFinite(left.sortOrder) ? left.sortOrder! : Number.POSITIVE_INFINITY;
125
- const b = Number.isFinite(right.sortOrder) ? right.sortOrder! : Number.POSITIVE_INFINITY;
126
- return a - b || (left.id < right.id ? -1 : left.id > right.id ? 1 : 0);
127
- }
128
-
129
- function uniqueById<T extends { id: string }>(rows: T[]): T[] {
130
- return [...new Map(rows.filter((row) => row.id).map((row) => [row.id, row])).values()];
131
- }
132
-
133
- function sectionsFor(state: Pick<FaqState, "categories" | "questions" | "query" | "expandedIds" | "otherTitle">): CategorySection[] {
134
- const needle = state.query.trim().toLowerCase();
135
- const visible = state.questions
136
- .filter((row) => row.status.toUpperCase() !== "HIDDEN")
137
- .filter((row) => !needle || `${row.question}\n${row.answer}`.toLowerCase().includes(needle))
138
- .sort(sortByWixOrder);
139
- const expanded = new Set(state.expandedIds);
140
- const known = new Set(state.categories.map((category) => category.id));
141
- const row = (question: FaqQuestion): QuestionRow => ({
142
- id: question.id,
143
- title: question.question,
144
- answer: question.answer,
145
- answerJson: question.answerJson,
146
- hasAnswerJson: question.hasAnswerJson,
147
- expanded: expanded.has(question.id),
148
- });
149
- const sections = state.categories
150
- .slice()
151
- .sort(sortByWixOrder)
152
- .map((category) => ({
153
- id: category.id,
154
- title: category.title,
155
- questions: visible.filter((question) => question.categoryId === category.id).map(row),
156
- }))
157
- .filter((section) => section.questions.length > 0);
158
- const orphaned = visible.filter((question) => !known.has(question.categoryId));
159
- if (orphaned.length) sections.push({ id: "other", title: state.otherTitle, questions: orphaned.map(row) });
160
- return sections;
161
- }
162
-
163
- function ready(state: FaqState): FaqState {
164
- const sections = sectionsFor(state);
165
- const rows = sections.flatMap((section) => section.questions.map((question, index) => ({
166
- ...question,
167
- categoryTitle: section.title,
168
- // An untitled section (the static fallback's) has no header to show.
169
- categoryHeaderHidden: index !== 0 || !section.title,
170
- })));
171
- return {
172
- ...state,
173
- status: "ready",
174
- sections,
175
- rows,
176
- loadingHidden: true,
177
- contentHidden: sections.length === 0,
178
- emptyHidden: sections.length > 0,
179
- errorHidden: true,
180
- forbiddenHidden: true,
181
- notInstalledHidden: true,
182
- };
183
- }
184
-
185
- function failure(state: FaqState, status: FaqState["status"]): FaqState {
186
- return {
187
- ...state,
188
- status,
189
- categories: [],
190
- questions: [],
191
- sections: [],
192
- rows: [],
193
- loadingHidden: true,
194
- contentHidden: true,
195
- emptyHidden: true,
196
- errorHidden: status !== "error",
197
- forbiddenHidden: status !== "forbidden",
198
- notInstalledHidden: status !== "notInstalled",
199
- };
200
- }
201
-
202
- function httpStatus(error: unknown): number | undefined {
203
- if (!error || typeof error !== "object") return undefined;
204
- const row = error as { status?: unknown; statusCode?: unknown; response?: { status?: unknown }; message?: unknown };
205
- for (const value of [row.status, row.statusCode, row.response?.status]) {
206
- if (typeof value === "number") return value;
207
- }
208
- const match = typeof row.message === "string" ? row.message.match(/\b(403|428)\b/) : null;
209
- return match ? Number(match[1]) : undefined;
210
- }
211
-
212
- async function allCategories(): Promise<FaqCategory[]> {
213
- const rows: FaqCategory[] = [];
214
- const seen = new Set<string>();
215
- let cursor = "";
216
- do {
217
- const response = await queryCategories({ query: { cursorPaging: { limit: PAGE_SIZE, ...(cursor ? { cursor } : {}) } } });
218
- rows.push(...(response.categories ?? []).map((category: WixCategory) => ({
219
- id: category.id ?? "",
220
- title: (category.title ?? "").trim() || "Other",
221
- ...(typeof category.sortOrder === "number" ? { sortOrder: category.sortOrder } : {}),
222
- })));
223
- const next = response.pagingMetadata?.cursors?.next ?? "";
224
- if (!next || seen.has(next)) break;
225
- seen.add(next);
226
- cursor = next;
227
- } while (cursor);
228
- return uniqueById(rows);
229
- }
230
-
231
- /** The answer's text with every whitespace run collapsed to one space: PLAIN_TEXT and a document's plain text
232
- * may separate blocks differently ("\n" vs "\n\n"), and that is not a garbled conversion, but a space inside
233
- * the text is content ("New York" is not "NewYork"). */
234
- const normalizeSpace = (text: string): string => text.replace(/\s+/g, " ").trim();
235
-
236
- /** [rico] #3372 — the RICH_CONTENT answer as a document string, trusted ONLY when its text matches the
237
- * PLAIN_TEXT answer. Wix converts a legacy DraftJS answer to Ricos unreliably, and the plain answer is
238
- * the one a visitor has always been shown, so a document that disagrees with it is dropped. */
239
- function richAnswer(plain: string, rich: unknown): string {
240
- // richBody encodes FIRST, so a document past the viewer's limits (too deep included) is rejected without an
241
- // unbounded plain-text walk, and gives "". Answers render in a list, so their media are list-sized.
242
- const { bodyJson, bodyText } = richBody(rich, "", ROW_IMAGE_WIDTH);
243
- return bodyJson && normalizeSpace(bodyText) === normalizeSpace(plain) ? bodyJson : "";
244
- }
245
-
246
- /** Every question entry in one content format, following THAT query's own cursors: a cursor belongs to the
247
- * request that returned it, so the two formats never share one. */
248
- async function entriesIn(contentFormat: "PLAIN_TEXT" | "RICH_CONTENT"): Promise<WixQuestionEntry[]> {
249
- const rows: WixQuestionEntry[] = [];
250
- const seen = new Set<string>();
251
- let cursor = "";
252
- do {
253
- const response = await queryQuestionEntries({
254
- query: {
255
- cursorPaging: { limit: PAGE_SIZE, ...(cursor ? { cursor } : {}) },
256
- filter: { status: { $in: ["VISIBLE", "UNKNOWN"] } },
257
- },
258
- contentFormat,
259
- });
260
- rows.push(...(response.questionEntries ?? []));
261
- const next = response.pagingMetadata?.cursors?.next ?? "";
262
- if (!next || seen.has(next)) break;
263
- seen.add(next);
264
- cursor = next;
265
- } while (cursor);
266
- return rows;
267
- }
268
-
269
- async function allQuestions(): Promise<FaqQuestion[]> {
270
- // Both formats are read in parallel, each paged on its own. PLAIN_TEXT is the list; a RICH_CONTENT read
271
- // that fails only costs the documents — every answer keeps its plain text.
272
- const [plain, rich] = await Promise.all([
273
- entriesIn("PLAIN_TEXT"),
274
- entriesIn("RICH_CONTENT").catch(() => [] as WixQuestionEntry[]),
275
- ]);
276
- const richById = new Map(rich.map((question: WixQuestionEntry) => [question.id ?? "", question.richContent]));
277
- const rows = plain.map((question: WixQuestionEntry) => {
278
- const answer = (question.plainText ?? "").trim();
279
- const answerJson = richAnswer(answer, richById.get(question.id ?? ""));
280
- return {
281
- id: question.id ?? "",
282
- categoryId: question.categoryId ?? "",
283
- question: (question.question ?? "").trim(),
284
- answer,
285
- answerJson,
286
- hasAnswerJson: answerJson !== "",
287
- ...(typeof question.sortOrder === "number" ? { sortOrder: question.sortOrder } : {}),
288
- status: question.status ?? "UNKNOWN",
289
- };
290
- }).filter((question) =>
291
- question.id && question.question && question.status.toUpperCase() !== "HIDDEN",
292
- );
293
- return uniqueById(rows);
294
- }
295
-
296
- const INITIAL: FaqState = {
297
- status: "loading",
298
- categories: [],
299
- questions: [],
300
- sections: [],
301
- rows: [],
302
- query: "",
303
- expandedIds: [],
304
- otherTitle: "Other",
305
- loadingHidden: false,
306
- contentHidden: true,
307
- emptyHidden: true,
308
- errorHidden: true,
309
- forbiddenHidden: true,
310
- notInstalledHidden: true,
311
- };
312
-
313
- let latestState = INITIAL;
314
- let loadGeneration = 0;
315
-
316
- function commit(state: FaqState): FaqState {
317
- latestState = state;
318
- return state;
319
- }
320
-
321
- async function loadFaq(state: FaqState, arg?: { otherCategory?: string; staticFaq?: unknown }): Promise<FaqState> {
322
- latestState = state;
323
- // Only when the caller passed the param: `retry` is dispatched with no params and must keep
324
- // the pairs the screen's onAppear delivered.
325
- if (arg && "staticFaq" in arg) staticQuestions = parseStaticFaq(arg.staticFaq);
326
- const generation = ++loadGeneration;
327
- try {
328
- const [categories, questions] = await Promise.all([allCategories(), allQuestions()]);
329
- if (generation !== loadGeneration) return latestState;
330
- const otherTitle = String(arg?.otherCategory ?? latestState.otherTitle).trim() || latestState.otherTitle;
331
- const live = ready({ ...latestState, categories, questions, otherTitle });
332
- // The Wix FAQ app answered but holds nothing a visitor can see — the site's own pairs,
333
- // when it has any, instead of an empty state over a site whose FAQ is right there.
334
- if (questions.length === 0) return commit(staticFallback(live) ?? live);
335
- return commit(live);
336
- } catch (error) {
337
- if (generation !== loadGeneration) return latestState;
338
- const status = httpStatus(error);
339
- // No FAQ app (428), no visitor access (403) or a failed read: a site whose FAQ is page
340
- // content still has an FAQ to show, so its pairs replace the failure card.
341
- const fallback = staticFallback(latestState);
342
- if (fallback) return commit(fallback);
343
- return commit(failure(latestState, status === 403 ? "forbidden" : status === 428 ? "notInstalled" : "error"));
344
- }
345
- }
346
-
347
- const svc = defineService("himiBrandedFaq", {
348
- state: INITIAL,
349
- actions: {
350
- load: loadFaq,
351
- retry: loadFaq,
352
- search: (state: FaqState, arg?: { value?: string }) => commit(ready({ ...state, query: String(arg?.value ?? "").slice(0, 256) })),
353
- toggle: (state: FaqState, arg?: { id?: string }) => {
354
- const id = String(arg?.id ?? "");
355
- if (!id || !state.questions.some((question) => question.id === id)) return state;
356
- const expandedIds = state.expandedIds.includes(id)
357
- ? state.expandedIds.filter((candidate) => candidate !== id)
358
- : [...state.expandedIds, id];
359
- return commit(ready({ ...state, expandedIds }));
360
- },
361
- // [rico] #3372 — an answer RichContent's on_link: `{ url }` of the tapped link. Only http(s), mailto and
362
- // tel links reach open_url; the FAQ has no message line, so a refused link simply does nothing.
363
- openLink: async (state: FaqState, arg?: unknown) => {
364
- await openRichLink(arg);
365
- return state;
366
- },
367
- },
368
- });
369
-
370
- export { svc, sectionsFor, httpStatus, parseStaticFaq };
5
+ export const svc = registerFaqList("himiBrandedFaq");
6
+ export { sectionsFor, httpStatus, parseStaticFaq } from "../_shared/faq-list.js";
@@ -1,10 +1,10 @@
1
1
  # __HIMI_APP_NAME__ — your website as an app
2
2
 
3
- A **site shell**: your live Wix website, framed as a native app. Every tab and drawer row is one of
3
+ A **site shell**: your live website (on Wix, on Base44, or any other https site), framed as a native app. Every tab and drawer row is one of
4
4
  your site's own pages, shown in a WebView under native navigation chrome and splash in your brand
5
5
  colours. The `site.layout` setting selects `auto`, `tabs`, `drawer`, `sidebar`, or `single`; `auto`
6
6
  removes the tab bar for a one-tab site and keeps its pages reachable through the drawer. The
7
- site's own header, footer and Wix ads are hidden. It is the fastest way to ship an existing
7
+ site's own header, footer and Wix ads are hidden (on a Wix site). It is the fastest way to ship an existing
8
8
  website as an app, and each tab can later be replaced by a native screen.
9
9
 
10
10
  ## Point it at your site
@@ -45,12 +45,52 @@ To review the map first, leave out `--apply`: the block is then only written to
45
45
  `home` must be the first of them: the app opens on its first tab.
46
46
  - **`icon`** is a design-system icon name (`home`, `bag`, `calendar`, `ticket`, `newspaper`, `mail`,
47
47
  `info`, `tag`, `photo`, `person`, `globe`, …).
48
+ - **`kind`** is the platform the site runs on: `wix`, `base44`, or `web` for any other https site
49
+ (see below). `himi site analyze` picks it for you.
48
50
  - **`chrome`** hides the site's own header (on inner pages), its footer and the Wix ads banner.
49
- Every flag defaults to hidden.
51
+ Every flag defaults to hidden on a Wix or Base44 site, and to shown on a `web` site.
50
52
 
51
53
  `config.ts` validates the block whenever the app loads, so an `http` origin, a duplicate id or a map
52
54
  with no tab fails `himi validate`, `himi render` and `himi push` rather than shipping.
53
55
 
56
+ ## Wrap any website (not on Wix)
57
+
58
+ The same app wraps any https website. Set `"kind": "web"`:
59
+
60
+ ```bash
61
+ himi init --template brandy my-site && cd my-site
62
+ # provisioning.json: "site": { "origin": "https://docs.example.com", "kind": "web", "pages": [...] }
63
+ # or derive the pages from the site's header menu: himi site analyze --url https://docs.example.com --apply
64
+ himi run # preview it in the browser
65
+ himi dist --shell brandy --platform ios,android # an installable build
66
+ ```
67
+
68
+ ```json
69
+ "site": {
70
+ "origin": "https://docs.example.com",
71
+ "kind": "web",
72
+ "pages": [
73
+ { "id": "home", "title": "Home", "path": "/", "icon": "home" },
74
+ { "id": "guides", "title": "Guides", "path": "/guides", "icon": "book" },
75
+ { "id": "blog", "title": "Blog", "path": "/blog", "icon": "newspaper" }
76
+ ]
77
+ }
78
+ ```
79
+
80
+ Remove the `chrome` block this template ships (its flags are a Wix site's defaults) or set its
81
+ flags to `false`: on a `web` site an absent flag means "shown". The header and footer hiders fall
82
+ back to the page's first `<header>` and last `<footer>`, which on an arbitrary site can be an
83
+ article's, so turn them on only after checking your site.
84
+
85
+ A `web` site gets nothing Wix-specific: only its own host stays in the app (no `www.` twin, so use
86
+ the host your site actually serves from; every other link asks "Open in browser?"), and no Wix ads
87
+ or menu hiding. It is visitor-only: a `wix` or `base44` binding
88
+ beside it, or `"menuSource": "runtime"`, is refused.
89
+
90
+ **App Store review.** Apple's guideline 4.2 rejects an app that is only a website in a wrapper. The
91
+ native tabs and drawer, and the Notifications screen every site shell has, are what this app adds;
92
+ plan for more native value before you submit.
93
+
54
94
  ## Let your pages call the phone
55
95
 
56
96
  A `webSdk` block in `provisioning.json` lets your site's pages call native features through the
@@ -88,5 +128,6 @@ only happen on a phone:
88
128
  site opens in a new tab follows the browser's popup rules). The "open in your browser?" prompt
89
129
  for off-site links exists only in the native app.
90
130
  - **Native sign-in does not reach the website**, and the site cannot talk to the app.
91
- - **A page whose site refuses to be framed stays blank.** Wix sites allow framing. For a page that
92
- does not, use **Open ↗** above the frame to open it in a new tab.
131
+ - **A page whose site refuses to be framed stays blank.** Wix sites allow framing; many other
132
+ sites (`kind: "web"`) do not. For such a page, use **Open ↗** above the frame to open it in a new
133
+ tab — the native app is not affected.