@wix/himalaya-cli 0.1749.0 → 0.1751.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 (324) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/himi-package.d.ts +478 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/host-compatibility.d.ts +56 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/icon-catalog.generated.d.ts +1 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +156 -8
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +3 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +2 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast-service.d.ts +105 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast.d.ts +116 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +326 -13
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +730 -81
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +155 -0
  14. package/dist/browser-plane/assets.json +5 -5
  15. package/dist/browser-plane/preview-deferred/{b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin → 21f35a12bd94f4ab97a9a75453c4adcadc438daf024a4b1950d5c356c123bd01.bin} +1 -1
  16. package/dist/browser-plane/sw.js +7 -7
  17. package/dist/cli.mjs +44618 -35753
  18. package/dist/preview-assets.generated.bin +0 -0
  19. package/guides/component-reference.json +1 -1
  20. package/guides/component-reference.md +4 -0
  21. package/guides/designing-himi-screens.md +7 -0
  22. package/guides/getting-started.md +5 -1
  23. package/guides/headless-loop.md +1 -1
  24. package/guides/himi-json-output.md +54 -1
  25. package/guides/himi-skill.md +5 -1
  26. package/guides/index.json +6 -0
  27. package/guides/one-app-to-himi-app.md +31 -8
  28. package/guides/qa-builds.md +12 -1
  29. package/guides/recipe-podcast.md +149 -0
  30. package/guides/skill.md +3 -1
  31. package/guides/store-submission.md +149 -34
  32. package/guides/tier-5-add-a-screen.md +16 -2
  33. package/guides/wix-business-context.md +43 -0
  34. package/guides/wix-platform-usage.md +7 -2
  35. package/package.json +10 -10
  36. package/template-icons/fitness-gym.png +0 -0
  37. package/template-icons/personal-fitness-trainer.png +0 -0
  38. package/templates/beauty-salon/config.ts +12 -0
  39. package/templates/beauty-salon/dev/index.ts +1 -1
  40. package/templates/beauty-salon/l10n/en.json +1 -1
  41. package/templates/beauty-salon/tier5-src/_shared/booking-session.ts +3 -1
  42. package/templates/beauty-salon/tier5-src/_shared/business-chat-transport.ts +148 -0
  43. package/templates/beauty-salon/tier5-src/_shared/header-badges.ts +113 -0
  44. package/templates/beauty-salon/tier5-src/_shared/location-pin.ts +97 -0
  45. package/templates/beauty-salon/tier5-src/_shared/member-access.ts +17 -6
  46. package/templates/beauty-salon/tier5-src/_shared/program-fields.ts +16 -0
  47. package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +5 -8
  48. package/templates/beauty-salon/tier5-src/_shared/source-badges.ts +72 -0
  49. package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  50. package/templates/beauty-salon/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  51. package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +13 -4
  52. package/templates/beauty-salon/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  53. package/templates/branded-lite/config.ts +12 -0
  54. package/templates/branded-lite/dev/index.ts +101 -1
  55. package/templates/branded-lite/l10n/en.json +22 -1
  56. package/templates/branded-lite/l10n/es.json +22 -0
  57. package/templates/branded-lite/l10n/fr.json +23 -0
  58. package/templates/branded-lite/l10n/he.json +19 -0
  59. package/templates/branded-lite/tier5-src/_shared/booking-session.ts +3 -1
  60. package/templates/branded-lite/tier5-src/_shared/location-pin.ts +97 -0
  61. package/templates/branded-lite/tier5-src/_shared/member-access.ts +17 -6
  62. package/templates/branded-lite/tier5-src/_shared/program-fields.ts +16 -0
  63. package/templates/branded-lite/tier5-src/_shared/programs-section.ts +5 -8
  64. package/templates/branded-lite/tier5-src/himi-branded-lite-access-nav/index.ts +10 -5
  65. package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  66. package/templates/branded-lite/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  67. package/templates/branded-lite/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
  68. package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +12 -1
  69. package/templates/branded-lite/tier5-src/himi-store-account/index.ts +13 -4
  70. package/templates/branded-lite/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  71. package/templates/brandy/README.md +33 -0
  72. package/templates/brandy/config.ts +51 -7
  73. package/templates/brandy/dev/index.ts +23 -9
  74. package/templates/community-club/l10n/en.json +1 -1
  75. package/templates/community-club/tier5-src/_shared/member-access.ts +17 -6
  76. package/templates/community-club/tier5-src/_shared/program-fields.ts +16 -0
  77. package/templates/community-club/tier5-src/_shared/programs-section.ts +5 -8
  78. package/templates/community-club/tier5-src/himi-store-account/index.ts +13 -4
  79. package/templates/community-club/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  80. package/templates/conference/tier5-src/_shared/member-access.ts +17 -6
  81. package/templates/conference/tier5-src/himi-store-account/index.ts +13 -4
  82. package/templates/events-meetups/l10n/en.json +1 -1
  83. package/templates/events-meetups/tier5-src/_shared/member-access.ts +17 -6
  84. package/templates/events-meetups/tier5-src/_shared/program-fields.ts +16 -0
  85. package/templates/events-meetups/tier5-src/_shared/programs-section.ts +5 -8
  86. package/templates/events-meetups/tier5-src/himi-store-account/index.ts +13 -4
  87. package/templates/events-meetups/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  88. package/templates/fitness-gym/README.md +53 -0
  89. package/templates/fitness-gym/config.ts +560 -0
  90. package/templates/fitness-gym/dev/index.ts +25787 -0
  91. package/templates/fitness-gym/himalaya.content.json +64 -0
  92. package/templates/fitness-gym/himalaya.template.json +15 -0
  93. package/templates/fitness-gym/icon.png +0 -0
  94. package/templates/fitness-gym/platforms.json +1 -0
  95. package/templates/fitness-gym/tier5-src/_shared/app-locale.ts +61 -0
  96. package/templates/fitness-gym/tier5-src/_shared/booking-location.ts +147 -0
  97. package/templates/fitness-gym/tier5-src/_shared/booking-session.ts +224 -0
  98. package/templates/fitness-gym/tier5-src/_shared/branded-lite-hosted.ts +280 -0
  99. package/templates/fitness-gym/tier5-src/_shared/branded-load-state.ts +109 -0
  100. package/templates/fitness-gym/tier5-src/_shared/business-chat-copy.ts +40 -0
  101. package/templates/fitness-gym/tier5-src/_shared/business-chat-history.ts +51 -0
  102. package/templates/fitness-gym/tier5-src/_shared/business-chat-message-model.ts +177 -0
  103. package/templates/fitness-gym/tier5-src/_shared/business-chat-model.ts +56 -0
  104. package/templates/fitness-gym/tier5-src/_shared/business-chat-presenter.ts +576 -0
  105. package/templates/fitness-gym/tier5-src/_shared/business-chat-transport.ts +148 -0
  106. package/templates/fitness-gym/tier5-src/_shared/collection-contract.ts +228 -0
  107. package/templates/fitness-gym/tier5-src/_shared/collection-query.ts +193 -0
  108. package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +400 -0
  109. package/templates/fitness-gym/tier5-src/_shared/detail-presence.ts +51 -0
  110. package/templates/fitness-gym/tier5-src/_shared/engine-intl.ts +523 -0
  111. package/templates/fitness-gym/tier5-src/_shared/himi-account.ts +194 -0
  112. package/templates/fitness-gym/tier5-src/_shared/himi-booking-saved.ts +88 -0
  113. package/templates/fitness-gym/tier5-src/_shared/himi-bookings.ts +318 -0
  114. package/templates/fitness-gym/tier5-src/_shared/himi-copy.ts +116 -0
  115. package/templates/fitness-gym/tier5-src/_shared/himi-media.ts +29 -0
  116. package/templates/fitness-gym/tier5-src/_shared/himi-store.ts +7 -0
  117. package/templates/fitness-gym/tier5-src/_shared/himi-text.ts +24 -0
  118. package/templates/fitness-gym/tier5-src/_shared/host-events.ts +66 -0
  119. package/templates/fitness-gym/tier5-src/_shared/hosted-checkout.ts +70 -0
  120. package/templates/fitness-gym/tier5-src/_shared/iap-attendance-form.ts +106 -0
  121. package/templates/fitness-gym/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
  122. package/templates/fitness-gym/tier5-src/_shared/iap-attendance.ts +38 -0
  123. package/templates/fitness-gym/tier5-src/_shared/iap-worker.ts +127 -0
  124. package/templates/fitness-gym/tier5-src/_shared/inbox-rooms.ts +68 -0
  125. package/templates/fitness-gym/tier5-src/_shared/local-preferences.ts +38 -0
  126. package/templates/fitness-gym/tier5-src/_shared/member-access.ts +63 -0
  127. package/templates/fitness-gym/tier5-src/_shared/member-account-routes.ts +52 -0
  128. package/templates/fitness-gym/tier5-src/_shared/member-bookings.ts +107 -0
  129. package/templates/fitness-gym/tier5-src/_shared/member-screen.ts +99 -0
  130. package/templates/fitness-gym/tier5-src/_shared/notification-target.ts +141 -0
  131. package/templates/fitness-gym/tier5-src/_shared/offset-page.ts +10 -0
  132. package/templates/fitness-gym/tier5-src/_shared/online-actions.ts +76 -0
  133. package/templates/fitness-gym/tier5-src/_shared/owner-load-error.ts +348 -0
  134. package/templates/fitness-gym/tier5-src/_shared/payment-setup.ts +6 -0
  135. package/templates/fitness-gym/tier5-src/_shared/pricing-plan-display.ts +64 -0
  136. package/templates/fitness-gym/tier5-src/_shared/program-description.ts +11 -0
  137. package/templates/fitness-gym/tier5-src/_shared/program-fields.ts +16 -0
  138. package/templates/fitness-gym/tier5-src/_shared/program-standing.ts +46 -0
  139. package/templates/fitness-gym/tier5-src/_shared/rich-body.ts +78 -0
  140. package/templates/fitness-gym/tier5-src/_shared/rich-content-link.ts +34 -0
  141. package/templates/fitness-gym/tier5-src/_shared/sign-in-sheet.ts +18 -0
  142. package/templates/fitness-gym/tier5-src/_shared/staff-name.ts +18 -0
  143. package/templates/fitness-gym/tier5-src/_shared/weekly-goal.ts +107 -0
  144. package/templates/fitness-gym/tier5-src/_shared/wix-bi.ts +85 -0
  145. package/templates/fitness-gym/tier5-src/_shared/wix-member-links.ts +114 -0
  146. package/templates/fitness-gym/tier5-src/_shared/wix-service-price.ts +146 -0
  147. package/templates/fitness-gym/tier5-src/business-chat/index.ts +732 -0
  148. package/templates/fitness-gym/tier5-src/business-contact/index.ts +6 -0
  149. package/templates/fitness-gym/tier5-src/himi-booking-account/index.ts +267 -0
  150. package/templates/fitness-gym/tier5-src/himi-booking-bookings/index.ts +468 -0
  151. package/templates/fitness-gym/tier5-src/himi-booking-service/index.ts +1190 -0
  152. package/templates/fitness-gym/tier5-src/himi-booking-services/index.ts +791 -0
  153. package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +1729 -0
  154. package/templates/fitness-gym/tier5-src/himi-branded-lite-agenda/index.ts +988 -0
  155. package/templates/fitness-gym/tier5-src/himi-branded-lite-member-programs/index.ts +656 -0
  156. package/templates/fitness-gym/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
  157. package/templates/fitness-gym/tier5-src/himi-branded-lite-plans/index.ts +495 -0
  158. package/templates/fitness-gym/tier5-src/himi-branded-lite-program/facts.ts +52 -0
  159. package/templates/fitness-gym/tier5-src/himi-branded-lite-program/index.ts +845 -0
  160. package/templates/fitness-gym/tier5-src/himi-fitcoach-goal/index.ts +191 -0
  161. package/templates/fitness-gym/tier5-src/himi-fitcoach-home/index.ts +619 -0
  162. package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +1007 -0
  163. package/templates/fitness-gym/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
  164. package/templates/fitness-gym/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
  165. package/templates/fitness-gym/tokens.json +414 -0
  166. package/templates/gym-fitness/config.ts +12 -0
  167. package/templates/gym-fitness/dev/index.ts +1 -1
  168. package/templates/gym-fitness/l10n/en.json +1 -1
  169. package/templates/gym-fitness/tier5-src/_shared/booking-session.ts +3 -1
  170. package/templates/gym-fitness/tier5-src/_shared/business-chat-transport.ts +148 -0
  171. package/templates/gym-fitness/tier5-src/_shared/header-badges.ts +113 -0
  172. package/templates/gym-fitness/tier5-src/_shared/location-pin.ts +97 -0
  173. package/templates/gym-fitness/tier5-src/_shared/member-access.ts +17 -6
  174. package/templates/gym-fitness/tier5-src/_shared/program-fields.ts +16 -0
  175. package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +5 -8
  176. package/templates/gym-fitness/tier5-src/_shared/source-badges.ts +72 -0
  177. package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  178. package/templates/gym-fitness/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  179. package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +13 -4
  180. package/templates/gym-fitness/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  181. package/templates/medical-services/dev/index.ts +2 -1
  182. package/templates/medical-services/tier5-src/_shared/booking-session.ts +3 -1
  183. package/templates/medical-services/tier5-src/_shared/member-access.ts +17 -6
  184. package/templates/medical-services/tier5-src/himi-booking-account/index.ts +16 -1
  185. package/templates/medical-services/tier5-src/himi-store-account/index.ts +13 -4
  186. package/templates/nonprofit-cause/l10n/en.json +1 -1
  187. package/templates/nonprofit-cause/tier5-src/_shared/member-access.ts +17 -6
  188. package/templates/nonprofit-cause/tier5-src/_shared/program-fields.ts +16 -0
  189. package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +5 -8
  190. package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +13 -4
  191. package/templates/nonprofit-cause/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  192. package/templates/personal-fitness-trainer/README.md +51 -0
  193. package/templates/personal-fitness-trainer/config.ts +343 -0
  194. package/templates/personal-fitness-trainer/dev/index.ts +24813 -0
  195. package/templates/personal-fitness-trainer/himalaya.content.json +79 -0
  196. package/templates/personal-fitness-trainer/himalaya.template.json +14 -0
  197. package/templates/personal-fitness-trainer/icon.png +0 -0
  198. package/templates/personal-fitness-trainer/platforms.json +3 -0
  199. package/templates/personal-fitness-trainer/splash.json +3 -0
  200. package/templates/personal-fitness-trainer/tier5-src/_shared/app-locale.ts +61 -0
  201. package/templates/personal-fitness-trainer/tier5-src/_shared/booking-location.ts +147 -0
  202. package/templates/personal-fitness-trainer/tier5-src/_shared/booking-session.ts +224 -0
  203. package/templates/personal-fitness-trainer/tier5-src/_shared/branded-lite-hosted.ts +280 -0
  204. package/templates/personal-fitness-trainer/tier5-src/_shared/branded-load-state.ts +109 -0
  205. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-copy.ts +40 -0
  206. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-history.ts +51 -0
  207. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-message-model.ts +177 -0
  208. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-model.ts +56 -0
  209. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-presenter.ts +576 -0
  210. package/templates/personal-fitness-trainer/tier5-src/_shared/business-chat-transport.ts +148 -0
  211. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-contract.ts +228 -0
  212. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-query.ts +193 -0
  213. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-service.ts +400 -0
  214. package/templates/personal-fitness-trainer/tier5-src/_shared/detail-presence.ts +51 -0
  215. package/templates/personal-fitness-trainer/tier5-src/_shared/empty-flags.ts +33 -0
  216. package/templates/personal-fitness-trainer/tier5-src/_shared/engine-intl.ts +523 -0
  217. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-account.ts +194 -0
  218. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-booking-saved.ts +88 -0
  219. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-bookings.ts +318 -0
  220. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-copy.ts +116 -0
  221. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-layouts.ts +142 -0
  222. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-store.ts +7 -0
  223. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-text.ts +24 -0
  224. package/templates/personal-fitness-trainer/tier5-src/_shared/host-events.ts +66 -0
  225. package/templates/personal-fitness-trainer/tier5-src/_shared/hosted-checkout.ts +70 -0
  226. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-form.ts +106 -0
  227. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
  228. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance.ts +38 -0
  229. package/templates/personal-fitness-trainer/tier5-src/_shared/iap-worker.ts +127 -0
  230. package/templates/personal-fitness-trainer/tier5-src/_shared/inbox-rooms.ts +68 -0
  231. package/templates/personal-fitness-trainer/tier5-src/_shared/local-preferences.ts +38 -0
  232. package/templates/personal-fitness-trainer/tier5-src/_shared/member-access.ts +63 -0
  233. package/templates/personal-fitness-trainer/tier5-src/_shared/member-account-routes.ts +52 -0
  234. package/templates/personal-fitness-trainer/tier5-src/_shared/member-bookings.ts +107 -0
  235. package/templates/personal-fitness-trainer/tier5-src/_shared/member-screen.ts +99 -0
  236. package/templates/personal-fitness-trainer/tier5-src/_shared/offset-page.ts +10 -0
  237. package/templates/personal-fitness-trainer/tier5-src/_shared/online-actions.ts +76 -0
  238. package/templates/personal-fitness-trainer/tier5-src/_shared/owner-load-error.ts +348 -0
  239. package/templates/personal-fitness-trainer/tier5-src/_shared/payment-setup.ts +6 -0
  240. package/templates/personal-fitness-trainer/tier5-src/_shared/pricing-plan-display.ts +64 -0
  241. package/templates/personal-fitness-trainer/tier5-src/_shared/rich-body.ts +78 -0
  242. package/templates/personal-fitness-trainer/tier5-src/_shared/rich-content-link.ts +34 -0
  243. package/templates/personal-fitness-trainer/tier5-src/_shared/sign-in-sheet.ts +18 -0
  244. package/templates/personal-fitness-trainer/tier5-src/_shared/staff-name.ts +18 -0
  245. package/templates/personal-fitness-trainer/tier5-src/_shared/video-caption.ts +21 -0
  246. package/templates/personal-fitness-trainer/tier5-src/_shared/weekly-goal.ts +107 -0
  247. package/templates/personal-fitness-trainer/tier5-src/_shared/wix-bi.ts +85 -0
  248. package/templates/personal-fitness-trainer/tier5-src/_shared/wix-service-price.ts +146 -0
  249. package/templates/personal-fitness-trainer/tier5-src/business-chat/index.ts +732 -0
  250. package/templates/personal-fitness-trainer/tier5-src/business-contact/index.ts +6 -0
  251. package/templates/personal-fitness-trainer/tier5-src/himi-booking-bookings/index.ts +468 -0
  252. package/templates/personal-fitness-trainer/tier5-src/himi-booking-service/index.ts +1190 -0
  253. package/templates/personal-fitness-trainer/tier5-src/himi-booking-services/index.ts +791 -0
  254. package/templates/personal-fitness-trainer/tier5-src/himi-booking-time/index.ts +1729 -0
  255. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +242 -0
  256. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/index.ts +1094 -0
  257. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-agenda/index.ts +988 -0
  258. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-appearance/index.ts +94 -0
  259. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-notifsettings/index.ts +173 -0
  260. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-plans/index.ts +495 -0
  261. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-splash/index.ts +35 -0
  262. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +226 -0
  263. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-videos/index.ts +145 -0
  264. package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-home/index.ts +70 -0
  265. package/templates/personal-fitness-trainer/tier5-src/himi-fitness-trainer-profile/index.ts +53 -0
  266. package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +1007 -0
  267. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-app-language/index.ts +73 -0
  268. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  269. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
  270. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
  271. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-view-profile/index.ts +119 -0
  272. package/templates/personal-fitness-trainer/tokens.json +381 -0
  273. package/templates/podcast-creator/dev/index.ts +100 -0
  274. package/templates/podcast-creator/l10n/en.json +22 -1
  275. package/templates/podcast-creator/l10n/es.json +22 -0
  276. package/templates/podcast-creator/l10n/fr.json +18 -0
  277. package/templates/podcast-creator/l10n/he.json +15 -0
  278. package/templates/podcast-creator/tier5-src/_shared/member-access.ts +17 -6
  279. package/templates/podcast-creator/tier5-src/_shared/program-fields.ts +16 -0
  280. package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +5 -8
  281. package/templates/podcast-creator/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
  282. package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +13 -4
  283. package/templates/podcast-creator/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  284. package/templates/portfolio-creative/l10n/en.json +1 -1
  285. package/templates/portfolio-creative/tier5-src/_shared/member-access.ts +17 -6
  286. package/templates/portfolio-creative/tier5-src/_shared/program-fields.ts +16 -0
  287. package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +5 -8
  288. package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +13 -4
  289. package/templates/portfolio-creative/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  290. package/templates/restaurant/l10n/en.json +1 -1
  291. package/templates/restaurant/tier5-src/_shared/member-access.ts +17 -6
  292. package/templates/restaurant/tier5-src/_shared/program-fields.ts +16 -0
  293. package/templates/restaurant/tier5-src/_shared/programs-section.ts +5 -8
  294. package/templates/restaurant/tier5-src/himi-store-account/index.ts +13 -4
  295. package/templates/restaurant/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  296. package/templates/retail-store/l10n/en.json +1 -1
  297. package/templates/retail-store/tier5-src/_shared/member-access.ts +17 -6
  298. package/templates/retail-store/tier5-src/_shared/program-fields.ts +16 -0
  299. package/templates/retail-store/tier5-src/_shared/programs-section.ts +5 -8
  300. package/templates/retail-store/tier5-src/himi-store-account/index.ts +13 -4
  301. package/templates/retail-store/tier5-src/wix-spaces-view-profile/index.ts +68 -55
  302. package/templates/salon-spa/dev/index.ts +1 -1
  303. package/templates/salon-spa/tier5-src/_shared/booking-session.ts +3 -1
  304. package/templates/salon-spa/tier5-src/_shared/member-access.ts +17 -6
  305. package/templates/salon-spa/tier5-src/himi-booking-account/index.ts +16 -1
  306. package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  307. package/templates/salon-spa/tier5-src/himi-store-account/index.ts +13 -4
  308. package/templates/wholesale-store/tier5-src/_shared/member-access.ts +17 -6
  309. package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +13 -4
  310. package/templates/yoga-studio/config.ts +12 -0
  311. package/templates/yoga-studio/dev/index.ts +1 -1
  312. package/templates/yoga-studio/l10n/en.json +1 -1
  313. package/templates/yoga-studio/tier5-src/_shared/booking-session.ts +3 -1
  314. package/templates/yoga-studio/tier5-src/_shared/business-chat-transport.ts +148 -0
  315. package/templates/yoga-studio/tier5-src/_shared/header-badges.ts +113 -0
  316. package/templates/yoga-studio/tier5-src/_shared/location-pin.ts +97 -0
  317. package/templates/yoga-studio/tier5-src/_shared/member-access.ts +17 -6
  318. package/templates/yoga-studio/tier5-src/_shared/program-fields.ts +16 -0
  319. package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +5 -8
  320. package/templates/yoga-studio/tier5-src/_shared/source-badges.ts +72 -0
  321. package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  322. package/templates/yoga-studio/tier5-src/himi-branded-lite-nav/index.ts +152 -0
  323. package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +13 -4
  324. package/templates/yoga-studio/tier5-src/wix-spaces-view-profile/index.ts +68 -55
@@ -1,246 +1,26 @@
1
- import { descriptionBody } from "../_shared/rich-body.js";
2
- // himi-branded-lite-podcasts — live RSS episodes with a persistent queue and
3
- // the shared native/web media playback transport.
1
+ // himi-branded-lite-podcasts — live RSS episodes played in the app. The loader and the player
2
+ // are the shared `createPodcastService` (`@wix/himalaya/screens`), the same code a generated app
3
+ // imports; this worker only adds Branded Lite's collection chrome and per-account persistence.
4
+ import { createPodcastService } from "@himalaya/screens";
4
5
  import { defineService } from "../_shared/collection-service.js";
6
+ import { copyParam } from "../_shared/himi-copy.js";
7
+ import { descriptionBody } from "../_shared/rich-body.js";
5
8
  import { localPreferences, type PreferenceRuntime } from "../_shared/local-preferences.js";
6
- import { pause, play, setQueue, skip, status as playbackStatus, subscribeStatus, type MediaPlaybackStatus, type MediaQueueItem } from "@himalaya/media-playback";
7
-
8
- const PODCASTS_FEED_GRAPHQL = "https://podcasts.wix.com/api/feed/graphql";
9
- const EPISODES_QUERY = `
10
- query PodcastEpisodes($url: String!, $limit: Int) {
11
- episodes(url: $url, limit: $limit) {
12
- id title date duration image descriptionExcerpt(length: 220) playback { url type length }
13
- }
14
- }
15
- `;
16
-
17
- type WixApi = { call: (method: string, path: string, body?: unknown, headers?: Record<string, string>) => Promise<unknown> };
18
- interface Episode {
19
- id?: string;
20
- title?: string;
21
- date?: string;
22
- duration?: string;
23
- image?: string;
24
- descriptionExcerpt?: string;
25
- playback?: { url?: string; type?: string; length?: number };
26
- }
27
- interface FeedResponse {
28
- data?: { episodes?: Episode[] | null } | null;
29
- episodes?: Episode[] | null;
30
- errors?: Array<{ message?: string }>;
31
- }
32
- interface Row {
33
- id: string;
34
- title: string;
35
- subtitle: string;
36
- image: string;
37
- description: string;
38
- audioUrl: string;
39
- durationMs: number;
40
- progressLabel: string;
41
- }
42
- interface S {
43
- status: "loading" | "ready" | "error";
44
- episodes: Row[];
45
- emptyText: string;
46
- isMock: boolean;
47
- notMock: boolean;
48
- mockBanner: string;
49
- queue: string[];
50
- queueLabel: string;
51
- nowId: string;
52
- nowTitle: string;
53
- nowSubtitle: string;
54
- isPlaying: boolean;
55
- playLabel: string;
56
- playIcon: string;
57
- positionMs: number;
58
- durationMs: number;
59
- progress: number;
60
- progressLabel: string;
61
- hidePlayer: boolean;
62
- }
63
9
 
64
- function host(): PreferenceRuntime & { wixApi?: WixApi } {
65
- return (globalThis as { himalaya?: PreferenceRuntime & { wixApi?: WixApi } }).himalaya ?? {};
10
+ function host(): PreferenceRuntime {
11
+ return (globalThis as { himalaya?: PreferenceRuntime }).himalaya ?? {};
66
12
  }
67
- const queuePreference = localPreferences("podcast.queue", (value): string[] => Array.isArray(value)
13
+ const queue = localPreferences("podcast.queue", (value): string[] => Array.isArray(value)
68
14
  ? [...new Set(value.filter((id): id is string => typeof id === "string" && id.length > 0 && id.length <= 512))].slice(0, 100)
69
15
  : [], host());
70
- const progressPreference = localPreferences("podcast.progress", (value): Record<string, number> => {
16
+ const progress = localPreferences("podcast.progress", (value): Record<string, number> => {
71
17
  if (!value || typeof value !== "object" || Array.isArray(value)) return {};
72
18
  return Object.fromEntries(Object.entries(value).filter(([id, position]) => id.length > 0 && id.length <= 512 && typeof position === "number" && Number.isFinite(position) && position >= 1_000));
73
19
  }, host());
74
- let savedQueue = queuePreference.read();
75
- let savedProgress = progressPreference.read();
76
- function persistQueue(value: string[]): void { savedQueue = value; queuePreference.write(value); }
77
- function persistProgress(value: Record<string, number>): void { savedProgress = value; progressPreference.write(value); }
78
- function dateLabel(iso?: string): string {
79
- const parsed = iso ? Date.parse(iso) : NaN;
80
- return Number.isFinite(parsed) ? new Date(parsed).toLocaleDateString(undefined, { month: "short", day: "numeric" }) : "";
81
- }
82
- function durationMs(value?: string): number {
83
- const raw = (value || "").trim();
84
- if (/^\d+$/.test(raw)) return Number(raw) * 1000;
85
- const pieces = raw.split(":").map(Number);
86
- if (pieces.length >= 2 && pieces.every(Number.isFinite)) return pieces.reduce((total, piece) => total * 60 + piece, 0) * 1000;
87
- return 0;
88
- }
89
- function clock(ms: number): string {
90
- const seconds = Math.max(0, Math.round(ms / 1000));
91
- const minutes = Math.floor(seconds / 60);
92
- return `${minutes}:${String(seconds % 60).padStart(2, "0")}`;
93
- }
94
- function norm(episode: Episode): Row | null {
95
- const audioUrl = episode.playback?.url?.trim() || "";
96
- if (!audioUrl) return null;
97
- const duration = durationMs(episode.duration);
98
- return {
99
- id: episode.id || audioUrl,
100
- title: (episode.title || "Episode").trim() || "Episode",
101
- subtitle: [dateLabel(episode.date), duration ? clock(duration) : ""].filter(Boolean).join(" · "),
102
- image: (episode.image || "").trim(),
103
- description: descriptionBody(episode.descriptionExcerpt).bodyText,
104
- audioUrl,
105
- durationMs: duration,
106
- progressLabel: "",
107
- };
108
- }
109
- function queueItems(rows: Row[], ids: string[]): MediaQueueItem[] {
110
- const byId = new Map(rows.map((row) => [row.id, row]));
111
- return ids.flatMap((id) => {
112
- const row = byId.get(id);
113
- return row ? [{ id: row.id, episodeId: row.id, url: row.audioUrl, title: row.title, subtitle: row.subtitle, artworkUrl: row.image, durationMs: row.durationMs }] : [];
114
- });
115
- }
116
- function derive(state: S): S {
117
- const now = state.episodes.find((episode) => episode.id === state.nowId);
118
- const duration = state.durationMs || now?.durationMs || 0;
119
- const episodes = state.episodes.map((episode) => {
120
- const position = savedProgress[episode.id] ?? 0;
121
- const resumable = position >= 1_000 && (!episode.durationMs || position < episode.durationMs - 1_000);
122
- return { ...episode, progressLabel: resumable ? `Continue at ${clock(position)}` : "" };
123
- });
124
- return {
125
- ...state,
126
- episodes,
127
- queueLabel: state.queue.length ? `${state.queue.length} ${state.queue.length === 1 ? "episode" : "episodes"} in queue` : "Queue is empty",
128
- nowTitle: now?.title ?? "",
129
- nowSubtitle: now?.subtitle ?? "",
130
- playLabel: state.isPlaying ? "Pause" : "Play",
131
- playIcon: state.isPlaying ? "pause" : "play",
132
- durationMs: duration,
133
- progress: duration > 0 ? Math.min(1, state.positionMs / duration) : 0,
134
- progressLabel: state.nowId ? `${clock(state.positionMs)} / ${clock(duration)}` : "",
135
- hidePlayer: !state.nowId,
136
- };
137
- }
138
- function idOf(arg: unknown): string {
139
- if (typeof arg === "string") return arg;
140
- return String((arg as { id?: unknown } | undefined)?.id ?? "");
141
- }
142
20
 
143
- const svc = defineService<S, {
144
- load: (s: S, arg?: unknown) => Promise<S>;
145
- playEpisode: (s: S, arg?: unknown) => S;
146
- queueEpisode: (s: S, arg?: unknown) => Promise<S>;
147
- togglePlay: (s: S) => S;
148
- nextEpisode: (s: S) => S;
149
- mediaStatus: (s: S, arg?: MediaPlaybackStatus) => Promise<S>;
150
- }>("himiBrandedPodcasts", {
151
- state: derive({ status: "loading", episodes: [], emptyText: "", isMock: false, notMock: true, mockBanner: "",
152
- queue: savedQueue, queueLabel: "Queue is empty", nowId: "", nowTitle: "", nowSubtitle: "",
153
- isPlaying: false, playLabel: "Play", playIcon: "play", positionMs: 0, durationMs: 0, progress: 0, progressLabel: "", hidePlayer: true }),
154
- actions: {
155
- load: async (s, arg) => {
156
- const configured = typeof (arg as { feedUrl?: unknown } | undefined)?.feedUrl === "string" ? String((arg as { feedUrl: string }).feedUrl).trim() : "";
157
- if (!configured) {
158
- return derive({ ...s, status: "ready", episodes: [], emptyText: "No episodes yet — check back soon.", isMock: false, notMock: true, mockBanner: "" });
159
- }
160
- try {
161
- const api = host().wixApi;
162
- if (!api) throw new Error("Podcast bridge unavailable");
163
- const response = await api.call("POST", PODCASTS_FEED_GRAPHQL, { query: EPISODES_QUERY, variables: { url: configured, limit: 40 } }) as FeedResponse;
164
- if (response.errors?.length) throw new Error(response.errors[0]?.message || "Podcast feed query failed");
165
- const raw = response.data?.episodes ?? response.episodes;
166
- if (!Array.isArray(raw)) throw new Error("Podcast feed returned no episode collection");
167
- const episodes = raw.map(norm).filter((episode): episode is Row => episode !== null);
168
- const persisted = savedQueue.filter((id) => episodes.some((episode) => episode.id === id));
169
- const queue = persisted.length ? persisted : [];
170
- persistQueue(queue);
171
- let snapshot = await playbackStatus().catch(() => undefined);
172
- if (!snapshot?.currentItem && queue.length) {
173
- snapshot = await setQueue(queueItems(episodes, queue), {
174
- startIndex: 0,
175
- startPositionMs: savedProgress[queue[0]!] ?? 0,
176
- autoplay: false,
177
- onStatus: "himiBrandedPodcasts.mediaStatus",
178
- }).catch(() => undefined);
179
- }
180
- return derive({ ...s, status: "ready", episodes, queue, nowId: snapshot?.currentItem?.episodeId ?? snapshot?.currentItem?.id ?? "",
181
- isPlaying: snapshot?.state === "playing", positionMs: snapshot?.positionMs ?? 0, durationMs: snapshot?.durationMs ?? 0,
182
- emptyText: episodes.length ? "" : "No playable episodes are available in this feed.", isMock: false, notMock: true, mockBanner: "" });
183
- } catch {
184
- return derive({ ...s, status: "error", episodes: [], emptyText: "Podcast episodes could not be loaded. Try again.", isMock: false, notMock: true, mockBanner: "" });
185
- }
186
- },
187
- playEpisode: (s, arg) => {
188
- const id = idOf(arg);
189
- const selected = s.episodes.find((episode) => episode.id === id);
190
- if (!selected) return s;
191
- const queue = [id, ...s.queue.filter((queued) => queued !== id)];
192
- persistQueue(queue);
193
- const position = savedProgress[id] ?? 0;
194
- void setQueue(queueItems(s.episodes, queue), { startIndex: 0, startPositionMs: position, autoplay: true, onStatus: "himiBrandedPodcasts.mediaStatus" })
195
- .then((snapshot) => svc.mediaStatus(snapshot)).catch(() => {});
196
- return derive({ ...s, queue, nowId: id, isPlaying: true, positionMs: position, durationMs: selected.durationMs });
197
- },
198
- queueEpisode: async (s, arg) => {
199
- const id = idOf(arg);
200
- if (!s.episodes.some((episode) => episode.id === id) || s.queue.includes(id)) return s;
201
- const queue = [...s.queue, id];
202
- persistQueue(queue);
203
- // Keep the native queue in sync when playback is already active. Preserve
204
- // the current item, position and play/pause state while appending.
205
- const snapshot = await playbackStatus().catch(() => undefined);
206
- const activeId = snapshot?.currentItem?.episodeId ?? snapshot?.currentItem?.id ?? s.nowId;
207
- if (activeId) {
208
- const startIndex = Math.max(0, queue.indexOf(activeId));
209
- const next = await setQueue(queueItems(s.episodes, queue), {
210
- startIndex,
211
- startPositionMs: snapshot?.positionMs ?? s.positionMs,
212
- autoplay: snapshot?.state === "playing" || (!snapshot && s.isPlaying),
213
- onStatus: "himiBrandedPodcasts.mediaStatus",
214
- }).catch(() => undefined);
215
- if (next) return derive({ ...s, queue, nowId: next.currentItem?.episodeId ?? next.currentItem?.id ?? activeId,
216
- isPlaying: next.state === "playing", positionMs: next.positionMs, durationMs: next.durationMs || s.durationMs });
217
- }
218
- return derive({ ...s, queue });
219
- },
220
- togglePlay: (s) => {
221
- if (!s.nowId) return s;
222
- void (s.isPlaying ? pause() : play()).then((snapshot) => svc.mediaStatus(snapshot)).catch(() => {});
223
- return derive({ ...s, isPlaying: !s.isPlaying });
224
- },
225
- nextEpisode: (s) => {
226
- void skip(1).then((snapshot) => svc.mediaStatus(snapshot)).catch(() => {});
227
- return s;
228
- },
229
- mediaStatus: async (s, arg) => {
230
- const snapshot = arg?.state ? arg : await playbackStatus().catch(() => undefined);
231
- if (!snapshot) return s;
232
- const id = snapshot.currentItem?.episodeId ?? snapshot.currentItem?.id ?? s.nowId;
233
- if (id) {
234
- const progress = { ...savedProgress };
235
- if (snapshot.state === "ended" || (snapshot.durationMs > 0 && snapshot.positionMs >= snapshot.durationMs - 1_000)) delete progress[id];
236
- else if (snapshot.positionMs >= 1_000) progress[id] = snapshot.positionMs;
237
- persistProgress(progress);
238
- }
239
- return derive({ ...s, nowId: id, isPlaying: snapshot.state === "playing", positionMs: snapshot.positionMs, durationMs: snapshot.durationMs || s.durationMs });
240
- },
241
- },
21
+ const svc = createPodcastService({
22
+ service: "himiBrandedPodcasts", defineService, queue, progress,
23
+ text: (key, fallback) => copyParam(`podcasts.${key}`, fallback),
24
+ describe: (excerpt) => descriptionBody(excerpt).bodyText,
242
25
  });
243
- // A reopened podcast screen owns a fresh worker. Subscribe at module boot so
244
- // the host immediately replays the active session and continues pushing state.
245
- subscribeStatus("himiBrandedPodcasts.mediaStatus").catch(() => {});
246
26
  export { svc };
@@ -4,6 +4,7 @@
4
4
  // until then the checkout is not composed at all and the screen says buying is not available yet.
5
5
  import { descriptionBody } from "../_shared/rich-body.js";
6
6
  import { defineService } from "@himalaya/state";
7
+ import { memberAccess } from "../_shared/member-access.js";
7
8
  import { iapPriceFields, wixVideoItem, type IapCatalogItem } from "@himalaya/iap";
8
9
  import { createIapCommerce, videosAppleSalesEnabled, wixVideoOrders, type IapPurchaseFields } from "@himalaya/iap-checkout";
9
10
  import { iapPriceCopy, iapPurchaseCopy, resetUnhydratedKeysOnOlderRuntime } from "../_shared/iap-worker.js";
@@ -124,6 +125,16 @@ async function buy(): Promise<undefined> {
124
125
  function unavailable(s: S, kind: S["playbackState"], message: string): S {
125
126
  return { ...s, ...loaded("videos", [], { ...COPY, empty: "" }), items: [], hidePlayer: true, hideNotFound: kind !== "unavailable", noEntity: kind === "unavailable", hideRefresh: kind === "unavailable", emptyText: "", message, playbackState: kind };
126
127
  }
128
+ async function deniedVideo(s: S): Promise<S> {
129
+ const identity = await memberAccess();
130
+ const signedIn = identity.signedIn === true || Boolean(identity.email);
131
+ // A successful public metadata read can still describe a paid video. It does not
132
+ // produce a 401, so explicitly offer the existing sign-in continuation to visitors.
133
+ return { ...unavailable(s, "denied", signedIn
134
+ ? copyParam("video.deniedText", "Your current membership or purchase does not allow this video.")
135
+ : copyParam("video.accessSignInText", "Sign in with an account that has access to this video.")),
136
+ signInRequired: !signedIn, noSignIn: signedIn, hideRefresh: !signedIn };
137
+ }
127
138
  type Actions = {
128
139
  reset: (s: S) => S; publish: (s: S) => S; refreshPrice: (s: S) => Promise<undefined>; start: (s: S) => S; load: (s: S, arg?: unknown) => Promise<undefined>;
129
140
  buy: (s: S) => Promise<undefined>; iapPoll: (s: S) => Promise<undefined>;
@@ -173,7 +184,7 @@ const svc = defineService<S, Actions>("himiBrandedVideo", {
173
184
  unavailable(next, "processing", copyParam("video.processingText", "Video is processing. Try again later.")) :
174
185
  unavailable(next, "unavailable", copyParam("video.unavailableText", "This video is unavailable."));
175
186
  else if (!canWatchVideo(channel, video)) {
176
- next = unavailable(next, "denied", copyParam("video.deniedText", "Your current membership or purchase does not allow this video."));
187
+ next = await deniedVideo(next);
177
188
  nextDetail = wixVideoItem(channel, video);
178
189
  }
179
190
  else {
@@ -565,6 +565,9 @@ interface S extends IapRestoreFields {
565
565
  lastNameFocus: string;
566
566
  emailFocus: string;
567
567
  message: string;
568
+ hideMessage: boolean;
569
+ messageKind: "error" | "success";
570
+ resetSent: boolean;
568
571
  isLoading: boolean;
569
572
  notLoading: boolean;
570
573
  isRegistering: boolean;
@@ -640,6 +643,9 @@ function derive(s: S): S {
640
643
  const name = s.isMember ? greetingName(s.memberName) : "";
641
644
  return {
642
645
  ...s,
646
+ hideMessage: !s.message,
647
+ messageKind: s.resetSent ? "success" : "error",
648
+ resetSent: !!s.message && !!s.resetSent,
643
649
  greeting: name
644
650
  ? copyTemplate("storeAccount.greetingMember", "Hey, {name}", { name })
645
651
  : copyParam("storeAccount.greetingGuest", "Hey, guest"),
@@ -815,7 +821,7 @@ const svc = defineService<S, {
815
821
  restorePublish: (s: S) => S;
816
822
  iapRestore: (s: S) => Promise<undefined>;
817
823
  }>("himiStoreAccount", {
818
- notHydrated: ["password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
824
+ notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
819
825
  state: derive({
820
826
  status: "loading",
821
827
  isMember: false,
@@ -846,6 +852,9 @@ const svc = defineService<S, {
846
852
  lastNameFocus: "",
847
853
  emailFocus: "",
848
854
  message: "",
855
+ hideMessage: true,
856
+ messageKind: "error",
857
+ resetSent: false,
849
858
  isLoading: true,
850
859
  notLoading: false,
851
860
  // The form's first paint is already on its route's mode: only sign-in's route has `mode`.
@@ -942,10 +951,10 @@ const svc = defineService<S, {
942
951
  rejectResult(raw, "reset");
943
952
  if (revision !== editRevision) return derive({ ...svc.getState(), authBusy: false });
944
953
  return derive({ ...svc.getState(), authBusy: false, isRecovering: false,
945
- message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
954
+ resetSent: true, message: copyParam("storeAccount.resetSent", "If that email is registered, a reset link is on its way.") });
946
955
  } catch (error) {
947
956
  return derive({ ...svc.getState(), authBusy: false,
948
- message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
957
+ resetSent: false, message: revision === editRevision ? authFailure(error, "reset", translated).reason : "" });
949
958
  } finally { authInFlight = false; }
950
959
  },
951
960
  signIn: (s) => authenticate(s, "signIn"),
@@ -991,7 +1000,7 @@ const svc = defineService<S, {
991
1000
  },
992
1001
  });
993
1002
 
994
- resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), [...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
1003
+ resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
995
1004
  // `boot` tells settle this is not a visit: the host drops this call's navigation, and the
996
1005
  // appear refresh does the visit's moves.
997
1006
  svc.load({ boot: "1" });
@@ -11,7 +11,7 @@ import { getMyData, displayName } from "@himalaya/wix-users";
11
11
  // `load` has resolved a member, so a guest never glimpses the placeholder avatar while
12
12
  // the membership check is still running; `hideLoading` is false for exactly that moment,
13
13
  // so the screen shows a loading line instead of going blank.
14
- interface S { status: "loading" | "ready"; name: string; handle: string; about: string; initial: string; photo: string; needsSignIn: boolean; noSignIn: boolean; profileHidden: boolean; hideLoading: boolean }
14
+ interface S { status: "loading" | "ready"; name: string; handle: string; about: string; initial: string; photo: string; needsSignIn: boolean; noSignIn: boolean; profileHidden: boolean; hideLoading: boolean; hideError: boolean; hideAbout: boolean }
15
15
 
16
16
  const EMPTY: S = {
17
17
  status: "loading",
@@ -24,6 +24,8 @@ const EMPTY: S = {
24
24
  noSignIn: true,
25
25
  profileHidden: true,
26
26
  hideLoading: false,
27
+ hideError: true,
28
+ hideAbout: false,
27
29
  };
28
30
 
29
31
  // The SAME member check create-post and orders use (`memberAccess`: the host's
@@ -41,66 +43,77 @@ function fromParts(name: string, handleRaw: string, about: string, photo = ""):
41
43
  const clean = name.trim();
42
44
  const handle = "@" + (handleRaw || clean || "member").replace(/\s+/g, "").replace(/^@+/, "").toLowerCase();
43
45
  const initial = (clean.split(/\s+/).filter(Boolean).map((w) => w[0]).join("").slice(0, 2) || "?").toUpperCase();
44
- return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo, needsSignIn: false, noSignIn: true, profileHidden: false, hideLoading: true };
46
+ return { status: "ready", name: clean || "Member", handle, about: about || "No info to display.", initial, photo, needsSignIn: false, noSignIn: true, profileHidden: false, hideLoading: true, hideError: true, hideAbout: false };
45
47
  }
46
48
 
47
- const svc = defineService<S, { load: (s: S) => Promise<S> }>("spacesViewProfile", {
49
+ async function readProfile(): Promise<S> {
50
+ const email = await sessionEmail();
51
+ if (!email) {
52
+ return {
53
+ status: "ready",
54
+ // Kept for hosts without the shared member gate (the Spaces clone renders these
55
+ // fields directly); branded-lite hides the profile block behind `profileHidden`.
56
+ name: "Sign in to view your profile",
57
+ handle: "",
58
+ about: "Your public profile is available after you sign in from Account.",
59
+ initial: "?",
60
+ photo: "",
61
+ needsSignIn: true,
62
+ noSignIn: false,
63
+ profileHidden: true,
64
+ hideLoading: true,
65
+ hideError: true,
66
+ hideAbout: false,
67
+ };
68
+ }
69
+ try {
70
+ const api = wixApi();
71
+ if (api) {
72
+ const res = (await api.call("GET", "/members/v1/members/my?fieldSet=FULL")) as {
73
+ member?: {
74
+ loginEmail?: string;
75
+ contact?: { firstName?: string; lastName?: string };
76
+ profile?: { nickname?: string; slug?: string; title?: string; photo?: { url?: string } };
77
+ };
78
+ };
79
+ const m = res.member;
80
+ if (m) {
81
+ const nick = m.profile?.nickname?.trim() || "";
82
+ const full = [m.contact?.firstName, m.contact?.lastName].filter(Boolean).join(" ").trim();
83
+ const name = full || nick || m.loginEmail || email;
84
+ const slug = m.profile?.slug || nick || name;
85
+ const about = m.profile?.title || "No info to display.";
86
+ return fromParts(name, slug, about, m.profile?.photo?.url || "");
87
+ }
88
+ }
89
+ } catch { /* fall through to users my-data / email */ }
90
+ try {
91
+ const d = await getMyData();
92
+ const name = displayName(d) || email;
93
+ const dd = d as unknown as { nickname?: string; slug?: string; about?: string; aboutPlain?: string; profile?: { photo?: { url?: string } }; photo?: { url?: string } };
94
+ return fromParts(
95
+ name,
96
+ dd.slug || dd.nickname || name,
97
+ dd.aboutPlain || dd.about || "No info to display.",
98
+ dd.profile?.photo?.url || dd.photo?.url || "",
99
+ );
100
+ } catch {
101
+ // Session identity is still known; missing profile data is not an empty biography.
102
+ return { ...fromParts(email, email.split("@")[0] || email, ""), about: "Profile details could not be loaded. Please try again.", hideError: false, hideAbout: true };
103
+ }
104
+ }
105
+ let generation = 0;
106
+ const svc = defineService<S, { load: (s: S) => Promise<S | undefined> }>("spacesViewProfile", {
48
107
  state: { ...EMPTY },
108
+ notHydrated: Object.keys(EMPTY) as (keyof S & string)[],
49
109
  actions: {
50
110
  load: async () => {
51
- const email = await sessionEmail();
52
- if (!email) {
53
- return {
54
- status: "ready",
55
- // Kept for hosts without the shared member gate (the Spaces clone renders these
56
- // fields directly); branded-lite hides the profile block behind `profileHidden`.
57
- name: "Sign in to view your profile",
58
- handle: "",
59
- about: "Your public profile is available after you sign in from Account.",
60
- initial: "?",
61
- photo: "",
62
- needsSignIn: true,
63
- noSignIn: false,
64
- profileHidden: true,
65
- hideLoading: true,
66
- };
67
- }
68
- try {
69
- const api = wixApi();
70
- if (api) {
71
- const res = (await api.call("GET", "/members/v1/members/my?fieldSet=FULL")) as {
72
- member?: {
73
- loginEmail?: string;
74
- contact?: { firstName?: string; lastName?: string };
75
- profile?: { nickname?: string; slug?: string; title?: string; photo?: { url?: string } };
76
- };
77
- };
78
- const m = res.member;
79
- if (m) {
80
- const nick = m.profile?.nickname?.trim() || "";
81
- const full = [m.contact?.firstName, m.contact?.lastName].filter(Boolean).join(" ").trim();
82
- const name = full || nick || m.loginEmail || email;
83
- const slug = m.profile?.slug || nick || name;
84
- const about = m.profile?.title || "No info to display.";
85
- return fromParts(name, slug, about, m.profile?.photo?.url || "");
86
- }
87
- }
88
- } catch { /* fall through to users my-data / email */ }
89
- try {
90
- const d = await getMyData();
91
- const name = displayName(d) || email;
92
- const dd = d as unknown as { nickname?: string; slug?: string; about?: string; aboutPlain?: string; profile?: { photo?: { url?: string } }; photo?: { url?: string } };
93
- return fromParts(
94
- name,
95
- dd.slug || dd.nickname || name,
96
- dd.aboutPlain || dd.about || "No info to display.",
97
- dd.profile?.photo?.url || dd.photo?.url || "",
98
- );
99
- } catch {
100
- return fromParts(email, email.split("@")[0] || email, "No info to display.");
101
- }
111
+ const request = ++generation;
112
+ const next = await readProfile();
113
+ return request === generation ? next : undefined;
102
114
  },
103
115
  },
104
116
  });
105
- svc.load();
117
+ if (!(globalThis as { himalaya?: { hydrationOptOut?: boolean } }).himalaya?.hydrationOptOut) Object.assign(svc.getState(), EMPTY);
118
+ void svc.load();
106
119
  export { svc };
@@ -53,6 +53,39 @@ To review the map first, leave out `--apply`: the block is then only written to
53
53
  `config.ts` validates the block whenever the app loads, so an `http` origin, a duplicate id or a map
54
54
  with no tab fails `himi validate`, `himi render` and `himi push` rather than shipping.
55
55
 
56
+ ## Top-bar icons and your own native screens
57
+
58
+ Optional parts of the `site` block add or trim native chrome, with no code:
59
+
60
+ ```json
61
+ "topBar": { "actions": [
62
+ { "id": "alerts", "icon": "bell", "label": "Notifications", "target": { "screen": "himi_notification_settings" } },
63
+ { "id": "insta", "icon": "photo", "label": "Instagram", "target": { "url": "https://instagram.com/yourshop" } }
64
+ ] },
65
+ "nativePages": [
66
+ { "id": "rewards", "screenId": "rewards", "title": "Rewards", "icon": "star", "placement": "tab", "after": "home" }
67
+ ]
68
+ ```
69
+
70
+ - **`topBar.actions`** puts up to three icons at the trailing end of every screen's top bar. `label` is
71
+ what a screen reader says. A `target` is one of `page` (one of your site's pages, `overflow` ones
72
+ included, such as a cart page), `screen` (a native page's screen, or `himi_notification_settings`), or
73
+ `url` (a page off your site, which opens in the browser after an "Open in browser?" prompt).
74
+ - **`nativePages`** adds your own Tier-5 screens as a `tab`, a `drawer` row or `overflow` (no row, but
75
+ linkable). They sit among your site's pages after the page named in `after`, or after all of them
76
+ when `after` is not set. Tabs count toward the four-tab limit. Add each screen to `dev/index.ts`
77
+ (`screens.exact`), with its worker in `tier5-src/` (`himi docs tier-5-add-a-screen`). `himi validate`
78
+ refuses a native page whose screen is missing. A link to `<scheme>://screen/<screenId>` from outside the
79
+ app, including one on your website, opens the screen only when the page sets `"public": true`. Use
80
+ `"requiresAuth": true` (it implies public) to have a signed-out user sign in first. It needs a sign-in
81
+ that gates links, which this template does not have yet (a Base44 sign-in does not count), so
82
+ `himi validate` refuses it. Notifications is public unless its native page sets
83
+ `"public": false`.
84
+ - **`pageTitle`** (`"auto"`, `"always"` or `"never"`) decides where a page shows its title in the top
85
+ bar. `auto`, the default, hides it on a page that a tab, sidebar or drawer row opens, because the
86
+ row already names it, and shows it on `overflow` pages and pages opened from a link. Set
87
+ `"showTitle": true` or `false` on a page to override the rule for that page.
88
+
56
89
  ## Wrap any website (not on Wix)
57
90
 
58
91
  The same app wraps any https website. Set `"kind": "web"`:
@@ -7,6 +7,7 @@
7
7
  // which derives it from your site's own menu. Inspect the live values any time with
8
8
  // `himi context`; see `himi docs app-config`.
9
9
  import {
10
+ assertSiteNativePagesAuth,
10
11
  assertSiteShellConfig,
11
12
  defineApp,
12
13
  siteLinkableScreens,
@@ -14,6 +15,7 @@ import {
14
15
  siteNavKind,
15
16
  siteSidebar,
16
17
  siteNavConfig,
18
+ siteTopBarDefault,
17
19
  siteWebSdkCompanion,
18
20
  type SiteShellConfig,
19
21
  type SiteWebSdk,
@@ -23,7 +25,29 @@ import provisioning from "./provisioning.json" with { type: "json" };
23
25
 
24
26
  /** Your website and its page map. Validated here, so a mistake in provisioning.json (an http
25
27
  * origin, a duplicate page id, no tab) fails `himi validate`, `render` and `push` instead of
26
- * shipping a broken app. */
28
+ * shipping a broken app.
29
+ *
30
+ * Two optional parts of the block add native chrome, with no code here:
31
+ *
32
+ * "topBar": { "actions": [
33
+ * { "id": "cart", "icon": "cart", "label": "Cart", "target": { "page": "cart" } },
34
+ * { "id": "alerts", "icon": "bell", "label": "Notifications", "target": { "screen": "himi_notification_settings" } },
35
+ * { "id": "insta", "icon": "photo", "label": "Instagram", "target": { "url": "https://instagram.com/yourshop" } }
36
+ * ] },
37
+ * "nativePages": [
38
+ * { "id": "rewards", "screenId": "rewards", "title": "Rewards", "icon": "star", "placement": "tab", "after": "home" }
39
+ * ]
40
+ *
41
+ * `topBar.actions` — up to three trailing icons on every screen. A target opens a site page (`page`,
42
+ * any placement — an `overflow` page has no row), a native screen (`screen`: a native page's screen or
43
+ * `himi_notification_settings`), or an off-site https page in the browser after an "Open in browser?"
44
+ * prompt (`url`).
45
+ * `nativePages` — your own Tier-5 screens as tabs, drawer rows or `overflow` (linkable only), mixed with
46
+ * the site's pages (`after` names the page it follows; absent ⇒ after them all). The screen itself is
47
+ * yours: add it to dev/index.ts. Tabs count toward the four-tab limit together with the site's. A
48
+ * native page is linkable from outside the app (`<scheme>://screen/<screenId>`) only with "public": true.
49
+ * `pageTitle` — "auto" (default: no title on a page a tab, sidebar or drawer row opens; a title on
50
+ * overflow and link-opened pages), "always" or "never"; a page's `showTitle` overrides it. */
27
51
  export const site = provisioning.site as SiteShellConfig;
28
52
  assertSiteShellConfig(site);
29
53
  const nav = siteNav(site);
@@ -89,18 +113,32 @@ const base44Config = base44 === undefined ? undefined
89
113
  /** The native Base44 Account screen's id (shared by every site shell; never `himi_account`). */
90
114
  export const BASE44_ACCOUNT_SCREEN_ID = "himi_base44_account";
91
115
  const notificationsRow = { id: "drawer_notifications", screenId: "himi_notification_settings", label: "Notifications", icon: "bell" as const };
92
- const nativeRows = base44
116
+ /** Screens a native page (`site.nativePages`) already places — Notifications as a tab, say. Its row
117
+ * replaces the app's own: one screen is never listed twice in the drawer, the rail or the links. */
118
+ const placedScreens = new Set((site.nativePages ?? []).map((page) => page.screenId));
119
+ /** …of those, the ones with a row (an `overflow` native page has none, so the app's own row stays). */
120
+ const rowedScreens = new Set((site.nativePages ?? []).filter((page) => (page.placement ?? "tab") !== "overflow").map((page) => page.screenId));
121
+ const nativeRows = (base44
93
122
  ? [{ id: "drawer_account", screenId: BASE44_ACCOUNT_SCREEN_ID, label: "Account", icon: "person" as const }, notificationsRow]
94
- : [notificationsRow];
123
+ : [notificationsRow]).filter((row) => !rowedScreens.has(row.screenId));
95
124
  // The native rows' ids are reserved — the same rule as the Brandy shell's contract parser: a site page
96
125
  // that is not `overflow` gets a row, and one called `notifications` (or `account`, beside the Account
97
126
  // row) would share its row id with the app's own, while navigation finds a destination by row id.
98
127
  const reservedPageIds = base44 ? ["notifications", "account"] : ["notifications"];
99
- for (const page of site.pages) {
128
+ for (const page of [...site.pages, ...(site.nativePages ?? [])]) {
100
129
  if ((page.placement ?? "tab") !== "overflow" && reservedPageIds.includes(page.id)) {
101
130
  throw new Error(`provisioning.json: site page id "${page.id}" is reserved for the app's native ${page.id} screen — rename the page or make it an overflow page`);
102
131
  }
103
132
  }
133
+ /** The native screens this app serves itself, which a top-bar `{ screen }` target may name beside your
134
+ * native pages: Notifications, and a Base44 site's Account. */
135
+ const builtInScreens = ["himi_notification_settings", ...(base44 ? [BASE44_ACCOUNT_SCREEN_ID] : [])];
136
+ /** `site.topBar` as the app-wide top bar (every screen without one of its own). */
137
+ const topBarDefault = siteTopBarDefault(site, { nativeScreens: builtInScreens });
138
+ // A native page's `requiresAuth` needs a sign-in that gates deep links. This app has none (a Wix site is
139
+ // visitor-only, and a Base44 sign-in does not gate links yet), so it refuses the flag rather than open
140
+ // the screen signed out.
141
+ assertSiteNativePagesAuth(site, false);
104
142
 
105
143
  export default defineApp({
106
144
  id: "__HIMI_APP_DOTID__",
@@ -152,15 +190,21 @@ export default defineApp({
152
190
  navKind: siteNavKind(site),
153
191
  scheme: "himalaya-__HIMI_APP_SLUG__",
154
192
  deepLinkPatterns: [],
193
+ // Every page and native page, so a link to <scheme>://screen/<screenId> — from your website too —
194
+ // opens it (its tab, when it has one).
155
195
  linkableScreens: [
156
196
  ...siteLinkableScreens(site),
157
- { screenId: "himi_notification_settings", isPublic: true, paramKeys: [], parentScreenId: "" },
158
- ...(base44 ? [{ screenId: BASE44_ACCOUNT_SCREEN_ID, isPublic: true, paramKeys: [], parentScreenId: "" }] : []),
197
+ ...builtInScreens
198
+ .filter((screenId) => !placedScreens.has(screenId))
199
+ .map((screenId) => ({ screenId, isPublic: true, paramKeys: [], parentScreenId: "" })),
159
200
  ],
201
+ // Your `site.topBar` icons, on every screen that has no top bar of its own.
202
+ topBarDefault,
160
203
  // A notification or app link carrying one of your site's URLs opens that page's tab.
161
204
  site: siteNavConfig(site),
162
205
  tabBar: { items: nav.tabs },
163
- // Your site's drawer pages, then the native screens: Account (a Base44 site) and Notifications.
206
+ // Your site's drawer pages and native pages, then the app's own screens: Account (a Base44 site)
207
+ // and Notifications.
164
208
  drawer: { items: [...nav.drawer, ...nativeRows] },
165
209
  // The rail (tablet, or `layout: "sidebar"`) replaces the drawer, so it lists the same rows.
166
210
  sidebar: { items: [...siteSidebar(site), ...nativeRows] },