@wix/himalaya-cli 0.1870.0 → 0.1872.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 (497) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +3 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/portfolio/src/index.d.ts +19 -0
  3. package/dist/cli.mjs +90 -39
  4. package/fixtures/wix-canned.json +8 -0
  5. package/guides/android-ux.md +3 -2
  6. package/guides/designing-himi-screens.md +10 -4
  7. package/guides/ios-ux.md +3 -2
  8. package/guides/release-notes.md +18 -0
  9. package/guides/sdk-reference.json +8 -1
  10. package/package.json +2 -2
  11. package/template-icons/professional-services.png +0 -0
  12. package/templates/bare-fashion/config.ts +37 -2
  13. package/templates/bare-fashion/dev/index.ts +4006 -48
  14. package/templates/bare-fashion/himalaya.content.json +15 -0
  15. package/templates/bare-fashion/tier5-src/_shared/collection-contract.ts +6 -1
  16. package/templates/bare-fashion/tier5-src/_shared/member-account-routes.ts +56 -0
  17. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  18. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  19. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  20. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  21. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  22. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  23. package/templates/beauty-salon/tier5-src/_shared/collection-contract.ts +6 -1
  24. package/templates/beauty-salon/tier5-src/_shared/himi-events.ts +27 -0
  25. package/templates/beauty-salon-owner/tier5-src/_shared/collection-contract.ts +6 -1
  26. package/templates/beauty-salon-owner/tier5-src/_shared/himi-events.ts +27 -0
  27. package/templates/branded-lite/dev/index.ts +22 -1
  28. package/templates/branded-lite/l10n/ar.json +10 -0
  29. package/templates/branded-lite/l10n/cs.json +10 -0
  30. package/templates/branded-lite/l10n/da.json +10 -0
  31. package/templates/branded-lite/l10n/de.json +10 -0
  32. package/templates/branded-lite/l10n/el.json +10 -0
  33. package/templates/branded-lite/l10n/es.json +10 -0
  34. package/templates/branded-lite/l10n/fi.json +10 -0
  35. package/templates/branded-lite/l10n/fr.json +10 -0
  36. package/templates/branded-lite/l10n/he.json +8 -0
  37. package/templates/branded-lite/l10n/hu.json +10 -0
  38. package/templates/branded-lite/l10n/id.json +10 -0
  39. package/templates/branded-lite/l10n/it.json +10 -0
  40. package/templates/branded-lite/l10n/ja.json +10 -0
  41. package/templates/branded-lite/l10n/ko.json +10 -0
  42. package/templates/branded-lite/l10n/lt.json +10 -0
  43. package/templates/branded-lite/l10n/nl.json +10 -0
  44. package/templates/branded-lite/l10n/no.json +10 -0
  45. package/templates/branded-lite/l10n/pl.json +10 -0
  46. package/templates/branded-lite/l10n/pt.json +10 -0
  47. package/templates/branded-lite/l10n/ru.json +10 -0
  48. package/templates/branded-lite/l10n/sv.json +10 -0
  49. package/templates/branded-lite/l10n/th.json +10 -0
  50. package/templates/branded-lite/l10n/tr.json +10 -0
  51. package/templates/branded-lite/l10n/uk.json +10 -0
  52. package/templates/branded-lite/l10n/vi.json +10 -0
  53. package/templates/branded-lite/l10n/zh.json +10 -0
  54. package/templates/branded-lite/tier5-src/_shared/collection-contract.ts +6 -1
  55. package/templates/branded-lite/tier5-src/_shared/himi-events.ts +27 -0
  56. package/templates/branded-lite/tier5-src/_shared/portfolio-details.ts +70 -0
  57. package/templates/branded-lite/tier5-src/himi-branded-lite-coupons/index.ts +13 -2
  58. package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio/index.ts +90 -9
  59. package/templates/branded-lite/tier5-src/himi-branded-lite-portfolio-project/index.ts +53 -4
  60. package/templates/branded-lite/tier5-src/himi-events-detail/index.ts +3 -1
  61. package/templates/branded-lite/tier5-src/himi-events-list/index.ts +38 -8
  62. package/templates/branded-lite/tier5-src/himi-events-my-events/index.ts +4 -2
  63. package/templates/brandy/tier5-src/_shared/collection-contract.ts +6 -1
  64. package/templates/community-club/dev/index.ts +20 -0
  65. package/templates/community-club/l10n/ar.json +10 -0
  66. package/templates/community-club/l10n/cs.json +10 -0
  67. package/templates/community-club/l10n/da.json +10 -0
  68. package/templates/community-club/l10n/de.json +10 -0
  69. package/templates/community-club/l10n/el.json +10 -0
  70. package/templates/community-club/l10n/es.json +10 -0
  71. package/templates/community-club/l10n/fi.json +10 -0
  72. package/templates/community-club/l10n/fr.json +10 -0
  73. package/templates/community-club/l10n/he.json +8 -0
  74. package/templates/community-club/l10n/hu.json +10 -0
  75. package/templates/community-club/l10n/id.json +10 -0
  76. package/templates/community-club/l10n/it.json +10 -0
  77. package/templates/community-club/l10n/ja.json +10 -0
  78. package/templates/community-club/l10n/ko.json +10 -0
  79. package/templates/community-club/l10n/lt.json +10 -0
  80. package/templates/community-club/l10n/nl.json +10 -0
  81. package/templates/community-club/l10n/no.json +10 -0
  82. package/templates/community-club/l10n/pl.json +10 -0
  83. package/templates/community-club/l10n/pt.json +10 -0
  84. package/templates/community-club/l10n/ru.json +10 -0
  85. package/templates/community-club/l10n/sv.json +10 -0
  86. package/templates/community-club/l10n/th.json +10 -0
  87. package/templates/community-club/l10n/tr.json +10 -0
  88. package/templates/community-club/l10n/uk.json +10 -0
  89. package/templates/community-club/l10n/vi.json +10 -0
  90. package/templates/community-club/l10n/zh.json +10 -0
  91. package/templates/community-club/tier5-src/_shared/collection-contract.ts +6 -1
  92. package/templates/community-club/tier5-src/_shared/himi-events.ts +27 -0
  93. package/templates/community-club/tier5-src/himi-events-detail/index.ts +3 -1
  94. package/templates/community-club/tier5-src/himi-events-list/index.ts +38 -8
  95. package/templates/community-club/tier5-src/himi-events-my-events/index.ts +4 -2
  96. package/templates/community-club-owner/tier5-src/_shared/collection-contract.ts +6 -1
  97. package/templates/community-club-owner/tier5-src/_shared/himi-events.ts +27 -0
  98. package/templates/conference/config.ts +43 -1
  99. package/templates/conference/dev/index.ts +4147 -0
  100. package/templates/conference/himalaya.content.json +18 -0
  101. package/templates/conference/tier5-src/_shared/collection-contract.ts +6 -1
  102. package/templates/conference/tier5-src/_shared/himi-events.ts +27 -0
  103. package/templates/conference/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  104. package/templates/conference/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  105. package/templates/conference/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  106. package/templates/conference/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  107. package/templates/conference/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  108. package/templates/conference/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  109. package/templates/conference/tier5-src/himi-events-detail/index.ts +3 -1
  110. package/templates/conference/tier5-src/himi-events-list/index.ts +38 -8
  111. package/templates/conference/tier5-src/himi-events-my-events/index.ts +4 -2
  112. package/templates/conference/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  113. package/templates/events-meetups/dev/index.ts +20 -0
  114. package/templates/events-meetups/l10n/ar.json +10 -0
  115. package/templates/events-meetups/l10n/cs.json +10 -0
  116. package/templates/events-meetups/l10n/da.json +10 -0
  117. package/templates/events-meetups/l10n/de.json +10 -0
  118. package/templates/events-meetups/l10n/el.json +10 -0
  119. package/templates/events-meetups/l10n/es.json +10 -0
  120. package/templates/events-meetups/l10n/fi.json +10 -0
  121. package/templates/events-meetups/l10n/fr.json +10 -0
  122. package/templates/events-meetups/l10n/he.json +8 -0
  123. package/templates/events-meetups/l10n/hu.json +10 -0
  124. package/templates/events-meetups/l10n/id.json +10 -0
  125. package/templates/events-meetups/l10n/it.json +10 -0
  126. package/templates/events-meetups/l10n/ja.json +10 -0
  127. package/templates/events-meetups/l10n/ko.json +10 -0
  128. package/templates/events-meetups/l10n/lt.json +10 -0
  129. package/templates/events-meetups/l10n/nl.json +10 -0
  130. package/templates/events-meetups/l10n/no.json +10 -0
  131. package/templates/events-meetups/l10n/pl.json +10 -0
  132. package/templates/events-meetups/l10n/pt.json +10 -0
  133. package/templates/events-meetups/l10n/ru.json +10 -0
  134. package/templates/events-meetups/l10n/sv.json +10 -0
  135. package/templates/events-meetups/l10n/th.json +10 -0
  136. package/templates/events-meetups/l10n/tr.json +10 -0
  137. package/templates/events-meetups/l10n/uk.json +10 -0
  138. package/templates/events-meetups/l10n/vi.json +10 -0
  139. package/templates/events-meetups/l10n/zh.json +10 -0
  140. package/templates/events-meetups/tier5-src/_shared/collection-contract.ts +6 -1
  141. package/templates/events-meetups/tier5-src/_shared/himi-events.ts +27 -0
  142. package/templates/events-meetups/tier5-src/himi-events-detail/index.ts +3 -1
  143. package/templates/events-meetups/tier5-src/himi-events-list/index.ts +38 -8
  144. package/templates/events-meetups/tier5-src/himi-events-my-events/index.ts +4 -2
  145. package/templates/events-meetups-owner/tier5-src/_shared/collection-contract.ts +6 -1
  146. package/templates/events-meetups-owner/tier5-src/_shared/himi-events.ts +27 -0
  147. package/templates/fitness-gym/tier5-src/_shared/collection-contract.ts +6 -1
  148. package/templates/gym-fitness/dev/index.ts +20 -0
  149. package/templates/gym-fitness/l10n/ar.json +10 -0
  150. package/templates/gym-fitness/l10n/cs.json +10 -0
  151. package/templates/gym-fitness/l10n/da.json +10 -0
  152. package/templates/gym-fitness/l10n/de.json +10 -0
  153. package/templates/gym-fitness/l10n/el.json +10 -0
  154. package/templates/gym-fitness/l10n/es.json +10 -0
  155. package/templates/gym-fitness/l10n/fi.json +10 -0
  156. package/templates/gym-fitness/l10n/fr.json +10 -0
  157. package/templates/gym-fitness/l10n/he.json +8 -0
  158. package/templates/gym-fitness/l10n/hu.json +10 -0
  159. package/templates/gym-fitness/l10n/id.json +10 -0
  160. package/templates/gym-fitness/l10n/it.json +10 -0
  161. package/templates/gym-fitness/l10n/ja.json +10 -0
  162. package/templates/gym-fitness/l10n/ko.json +10 -0
  163. package/templates/gym-fitness/l10n/lt.json +10 -0
  164. package/templates/gym-fitness/l10n/nl.json +10 -0
  165. package/templates/gym-fitness/l10n/no.json +10 -0
  166. package/templates/gym-fitness/l10n/pl.json +10 -0
  167. package/templates/gym-fitness/l10n/pt.json +10 -0
  168. package/templates/gym-fitness/l10n/ru.json +10 -0
  169. package/templates/gym-fitness/l10n/sv.json +10 -0
  170. package/templates/gym-fitness/l10n/th.json +10 -0
  171. package/templates/gym-fitness/l10n/tr.json +10 -0
  172. package/templates/gym-fitness/l10n/uk.json +10 -0
  173. package/templates/gym-fitness/l10n/vi.json +10 -0
  174. package/templates/gym-fitness/l10n/zh.json +10 -0
  175. package/templates/gym-fitness/tier5-src/_shared/collection-contract.ts +6 -1
  176. package/templates/gym-fitness/tier5-src/_shared/himi-events.ts +27 -0
  177. package/templates/gym-fitness/tier5-src/himi-events-detail/index.ts +3 -1
  178. package/templates/gym-fitness/tier5-src/himi-events-list/index.ts +38 -8
  179. package/templates/gym-fitness/tier5-src/himi-events-my-events/index.ts +4 -2
  180. package/templates/gym-fitness-owner/tier5-src/_shared/collection-contract.ts +6 -1
  181. package/templates/gym-fitness-owner/tier5-src/_shared/himi-events.ts +27 -0
  182. package/templates/medical-services/config.ts +42 -0
  183. package/templates/medical-services/dev/index.ts +4136 -0
  184. package/templates/medical-services/himalaya.content.json +18 -0
  185. package/templates/medical-services/tier5-src/_shared/collection-contract.ts +6 -1
  186. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  187. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  188. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  189. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  190. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  191. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  192. package/templates/medical-services/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  193. package/templates/nonprofit-cause/dev/index.ts +20 -0
  194. package/templates/nonprofit-cause/l10n/ar.json +10 -0
  195. package/templates/nonprofit-cause/l10n/cs.json +10 -0
  196. package/templates/nonprofit-cause/l10n/da.json +10 -0
  197. package/templates/nonprofit-cause/l10n/de.json +10 -0
  198. package/templates/nonprofit-cause/l10n/el.json +10 -0
  199. package/templates/nonprofit-cause/l10n/es.json +10 -0
  200. package/templates/nonprofit-cause/l10n/fi.json +10 -0
  201. package/templates/nonprofit-cause/l10n/fr.json +10 -0
  202. package/templates/nonprofit-cause/l10n/he.json +8 -0
  203. package/templates/nonprofit-cause/l10n/hu.json +10 -0
  204. package/templates/nonprofit-cause/l10n/id.json +10 -0
  205. package/templates/nonprofit-cause/l10n/it.json +10 -0
  206. package/templates/nonprofit-cause/l10n/ja.json +10 -0
  207. package/templates/nonprofit-cause/l10n/ko.json +10 -0
  208. package/templates/nonprofit-cause/l10n/lt.json +10 -0
  209. package/templates/nonprofit-cause/l10n/nl.json +10 -0
  210. package/templates/nonprofit-cause/l10n/no.json +10 -0
  211. package/templates/nonprofit-cause/l10n/pl.json +10 -0
  212. package/templates/nonprofit-cause/l10n/pt.json +10 -0
  213. package/templates/nonprofit-cause/l10n/ru.json +10 -0
  214. package/templates/nonprofit-cause/l10n/sv.json +10 -0
  215. package/templates/nonprofit-cause/l10n/th.json +10 -0
  216. package/templates/nonprofit-cause/l10n/tr.json +10 -0
  217. package/templates/nonprofit-cause/l10n/uk.json +10 -0
  218. package/templates/nonprofit-cause/l10n/vi.json +10 -0
  219. package/templates/nonprofit-cause/l10n/zh.json +10 -0
  220. package/templates/nonprofit-cause/tier5-src/_shared/collection-contract.ts +6 -1
  221. package/templates/nonprofit-cause/tier5-src/_shared/himi-events.ts +27 -0
  222. package/templates/nonprofit-cause/tier5-src/himi-events-detail/index.ts +3 -1
  223. package/templates/nonprofit-cause/tier5-src/himi-events-list/index.ts +38 -8
  224. package/templates/nonprofit-cause/tier5-src/himi-events-my-events/index.ts +4 -2
  225. package/templates/nonprofit-cause-owner/tier5-src/_shared/collection-contract.ts +6 -1
  226. package/templates/nonprofit-cause-owner/tier5-src/_shared/himi-events.ts +27 -0
  227. package/templates/owner-lite/tier5-src/_shared/collection-contract.ts +6 -1
  228. package/templates/owner-lite/tier5-src/_shared/himi-events.ts +27 -0
  229. package/templates/personal-fitness-trainer/tier5-src/_shared/collection-contract.ts +6 -1
  230. package/templates/podcast-creator/dev/index.ts +20 -0
  231. package/templates/podcast-creator/l10n/ar.json +10 -0
  232. package/templates/podcast-creator/l10n/cs.json +10 -0
  233. package/templates/podcast-creator/l10n/da.json +10 -0
  234. package/templates/podcast-creator/l10n/de.json +10 -0
  235. package/templates/podcast-creator/l10n/el.json +10 -0
  236. package/templates/podcast-creator/l10n/es.json +10 -0
  237. package/templates/podcast-creator/l10n/fi.json +10 -0
  238. package/templates/podcast-creator/l10n/fr.json +10 -0
  239. package/templates/podcast-creator/l10n/he.json +8 -0
  240. package/templates/podcast-creator/l10n/hu.json +10 -0
  241. package/templates/podcast-creator/l10n/id.json +10 -0
  242. package/templates/podcast-creator/l10n/it.json +10 -0
  243. package/templates/podcast-creator/l10n/ja.json +10 -0
  244. package/templates/podcast-creator/l10n/ko.json +10 -0
  245. package/templates/podcast-creator/l10n/lt.json +10 -0
  246. package/templates/podcast-creator/l10n/nl.json +10 -0
  247. package/templates/podcast-creator/l10n/no.json +10 -0
  248. package/templates/podcast-creator/l10n/pl.json +10 -0
  249. package/templates/podcast-creator/l10n/pt.json +10 -0
  250. package/templates/podcast-creator/l10n/ru.json +10 -0
  251. package/templates/podcast-creator/l10n/sv.json +10 -0
  252. package/templates/podcast-creator/l10n/th.json +10 -0
  253. package/templates/podcast-creator/l10n/tr.json +10 -0
  254. package/templates/podcast-creator/l10n/uk.json +10 -0
  255. package/templates/podcast-creator/l10n/vi.json +10 -0
  256. package/templates/podcast-creator/l10n/zh.json +10 -0
  257. package/templates/podcast-creator/tier5-src/_shared/collection-contract.ts +6 -1
  258. package/templates/podcast-creator/tier5-src/_shared/himi-events.ts +27 -0
  259. package/templates/podcast-creator/tier5-src/himi-events-detail/index.ts +3 -1
  260. package/templates/podcast-creator/tier5-src/himi-events-list/index.ts +38 -8
  261. package/templates/podcast-creator/tier5-src/himi-events-my-events/index.ts +4 -2
  262. package/templates/podcast-creator-owner/tier5-src/_shared/collection-contract.ts +6 -1
  263. package/templates/podcast-creator-owner/tier5-src/_shared/himi-events.ts +27 -0
  264. package/templates/portfolio-creative/dev/index.ts +22 -1
  265. package/templates/portfolio-creative/l10n/ar.json +10 -0
  266. package/templates/portfolio-creative/l10n/cs.json +10 -0
  267. package/templates/portfolio-creative/l10n/da.json +10 -0
  268. package/templates/portfolio-creative/l10n/de.json +10 -0
  269. package/templates/portfolio-creative/l10n/el.json +10 -0
  270. package/templates/portfolio-creative/l10n/es.json +10 -0
  271. package/templates/portfolio-creative/l10n/fi.json +10 -0
  272. package/templates/portfolio-creative/l10n/fr.json +10 -0
  273. package/templates/portfolio-creative/l10n/he.json +8 -0
  274. package/templates/portfolio-creative/l10n/hu.json +10 -0
  275. package/templates/portfolio-creative/l10n/id.json +10 -0
  276. package/templates/portfolio-creative/l10n/it.json +10 -0
  277. package/templates/portfolio-creative/l10n/ja.json +10 -0
  278. package/templates/portfolio-creative/l10n/ko.json +10 -0
  279. package/templates/portfolio-creative/l10n/lt.json +10 -0
  280. package/templates/portfolio-creative/l10n/nl.json +10 -0
  281. package/templates/portfolio-creative/l10n/no.json +10 -0
  282. package/templates/portfolio-creative/l10n/pl.json +10 -0
  283. package/templates/portfolio-creative/l10n/pt.json +10 -0
  284. package/templates/portfolio-creative/l10n/ru.json +10 -0
  285. package/templates/portfolio-creative/l10n/sv.json +10 -0
  286. package/templates/portfolio-creative/l10n/th.json +10 -0
  287. package/templates/portfolio-creative/l10n/tr.json +10 -0
  288. package/templates/portfolio-creative/l10n/uk.json +10 -0
  289. package/templates/portfolio-creative/l10n/vi.json +10 -0
  290. package/templates/portfolio-creative/l10n/zh.json +10 -0
  291. package/templates/portfolio-creative/tier5-src/_shared/collection-contract.ts +6 -1
  292. package/templates/portfolio-creative/tier5-src/_shared/himi-events.ts +27 -0
  293. package/templates/portfolio-creative/tier5-src/_shared/portfolio-details.ts +70 -0
  294. package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio/index.ts +90 -9
  295. package/templates/portfolio-creative/tier5-src/himi-branded-lite-portfolio-project/index.ts +53 -4
  296. package/templates/portfolio-creative/tier5-src/himi-events-detail/index.ts +3 -1
  297. package/templates/portfolio-creative/tier5-src/himi-events-list/index.ts +38 -8
  298. package/templates/portfolio-creative/tier5-src/himi-events-my-events/index.ts +4 -2
  299. package/templates/portfolio-creative-owner/tier5-src/_shared/collection-contract.ts +6 -1
  300. package/templates/portfolio-creative-owner/tier5-src/_shared/himi-events.ts +27 -0
  301. package/templates/professional-services/README.md +55 -0
  302. package/templates/professional-services/config.ts +436 -0
  303. package/templates/professional-services/dev/index.ts +44772 -0
  304. package/templates/professional-services/himalaya.content.json +100 -0
  305. package/templates/professional-services/himalaya.template.json +16 -0
  306. package/templates/professional-services/icon.png +0 -0
  307. package/templates/professional-services/platforms.json +1 -0
  308. package/templates/professional-services/tier5-src/_shared/app-locale.ts +70 -0
  309. package/templates/professional-services/tier5-src/_shared/booking-location.ts +147 -0
  310. package/templates/professional-services/tier5-src/_shared/booking-session.ts +224 -0
  311. package/templates/professional-services/tier5-src/_shared/branded-lite-hosted.ts +282 -0
  312. package/templates/professional-services/tier5-src/_shared/branded-load-state.ts +109 -0
  313. package/templates/professional-services/tier5-src/_shared/business-chat-copy.ts +40 -0
  314. package/templates/professional-services/tier5-src/_shared/business-chat-history.ts +51 -0
  315. package/templates/professional-services/tier5-src/_shared/business-chat-message-model.ts +177 -0
  316. package/templates/professional-services/tier5-src/_shared/business-chat-model.ts +56 -0
  317. package/templates/professional-services/tier5-src/_shared/business-chat-presenter.ts +587 -0
  318. package/templates/professional-services/tier5-src/_shared/business-chat-transport.ts +164 -0
  319. package/templates/professional-services/tier5-src/_shared/chat-live.ts +242 -0
  320. package/templates/professional-services/tier5-src/_shared/collection-contract.ts +232 -0
  321. package/templates/professional-services/tier5-src/_shared/collection-query.ts +201 -0
  322. package/templates/professional-services/tier5-src/_shared/collection-service.ts +429 -0
  323. package/templates/professional-services/tier5-src/_shared/detail-presence.ts +51 -0
  324. package/templates/professional-services/tier5-src/_shared/engine-intl.ts +538 -0
  325. package/templates/professional-services/tier5-src/_shared/event-registration.ts +86 -0
  326. package/templates/professional-services/tier5-src/_shared/events-inline-options.ts +77 -0
  327. package/templates/professional-services/tier5-src/_shared/faq-list.ts +405 -0
  328. package/templates/professional-services/tier5-src/_shared/featured-event.ts +63 -0
  329. package/templates/professional-services/tier5-src/_shared/group-member-count.ts +15 -0
  330. package/templates/professional-services/tier5-src/_shared/group-privacy.ts +14 -0
  331. package/templates/professional-services/tier5-src/_shared/guest-sign-in.ts +36 -0
  332. package/templates/professional-services/tier5-src/_shared/himi-account.ts +222 -0
  333. package/templates/professional-services/tier5-src/_shared/himi-blog-hidden.ts +66 -0
  334. package/templates/professional-services/tier5-src/_shared/himi-blog-post-row.ts +214 -0
  335. package/templates/professional-services/tier5-src/_shared/himi-blog-saved.ts +64 -0
  336. package/templates/professional-services/tier5-src/_shared/himi-booking-saved.ts +88 -0
  337. package/templates/professional-services/tier5-src/_shared/himi-bookings.ts +318 -0
  338. package/templates/professional-services/tier5-src/_shared/himi-copy.ts +123 -0
  339. package/templates/professional-services/tier5-src/_shared/himi-events.ts +92 -0
  340. package/templates/professional-services/tier5-src/_shared/himi-media.ts +33 -0
  341. package/templates/professional-services/tier5-src/_shared/himi-store.ts +7 -0
  342. package/templates/professional-services/tier5-src/_shared/himi-text.ts +24 -0
  343. package/templates/professional-services/tier5-src/_shared/host-events.ts +66 -0
  344. package/templates/professional-services/tier5-src/_shared/hosted-checkout.ts +70 -0
  345. package/templates/professional-services/tier5-src/_shared/iap-attendance-form.ts +106 -0
  346. package/templates/professional-services/tier5-src/_shared/iap-attendance-purchase.ts +235 -0
  347. package/templates/professional-services/tier5-src/_shared/iap-attendance.ts +38 -0
  348. package/templates/professional-services/tier5-src/_shared/iap-worker.ts +127 -0
  349. package/templates/professional-services/tier5-src/_shared/inbox-rooms.ts +163 -0
  350. package/templates/professional-services/tier5-src/_shared/local-preferences.ts +38 -0
  351. package/templates/professional-services/tier5-src/_shared/member-access.ts +63 -0
  352. package/templates/professional-services/tier5-src/_shared/member-account-routes.ts +56 -0
  353. package/templates/professional-services/tier5-src/_shared/member-avatar.ts +76 -0
  354. package/templates/professional-services/tier5-src/_shared/member-bookings.ts +107 -0
  355. package/templates/professional-services/tier5-src/_shared/member-read.ts +82 -0
  356. package/templates/professional-services/tier5-src/_shared/member-screen.ts +99 -0
  357. package/templates/professional-services/tier5-src/_shared/notification-target.ts +141 -0
  358. package/templates/professional-services/tier5-src/_shared/offset-page.ts +10 -0
  359. package/templates/professional-services/tier5-src/_shared/online-actions.ts +76 -0
  360. package/templates/professional-services/tier5-src/_shared/owner-load-error.ts +348 -0
  361. package/templates/professional-services/tier5-src/_shared/payment-setup.ts +6 -0
  362. package/templates/professional-services/tier5-src/_shared/portfolio-details.ts +70 -0
  363. package/templates/professional-services/tier5-src/_shared/pricing-plan-display.ts +64 -0
  364. package/templates/professional-services/tier5-src/_shared/relative-time.ts +21 -0
  365. package/templates/professional-services/tier5-src/_shared/result-snackbar.ts +26 -0
  366. package/templates/professional-services/tier5-src/_shared/rich-body.ts +78 -0
  367. package/templates/professional-services/tier5-src/_shared/rich-content-link.ts +34 -0
  368. package/templates/professional-services/tier5-src/_shared/sign-in-sheet.ts +18 -0
  369. package/templates/professional-services/tier5-src/_shared/staff-name.ts +18 -0
  370. package/templates/professional-services/tier5-src/_shared/weekly-goal.ts +111 -0
  371. package/templates/professional-services/tier5-src/_shared/wix-bi.ts +85 -0
  372. package/templates/professional-services/tier5-src/_shared/wix-member-links.ts +114 -0
  373. package/templates/professional-services/tier5-src/_shared/wix-service-price.ts +146 -0
  374. package/templates/professional-services/tier5-src/business-chat/index.ts +797 -0
  375. package/templates/professional-services/tier5-src/business-contact/index.ts +6 -0
  376. package/templates/professional-services/tier5-src/himi-blog-feed/index.ts +444 -0
  377. package/templates/professional-services/tier5-src/himi-blog-post/index.ts +1239 -0
  378. package/templates/professional-services/tier5-src/himi-booking-account/index.ts +278 -0
  379. package/templates/professional-services/tier5-src/himi-booking-bookings/index.ts +475 -0
  380. package/templates/professional-services/tier5-src/himi-booking-service/index.ts +1197 -0
  381. package/templates/professional-services/tier5-src/himi-booking-services/index.ts +795 -0
  382. package/templates/professional-services/tier5-src/himi-booking-time/index.ts +1840 -0
  383. package/templates/professional-services/tier5-src/himi-branded-lite-coupons/index.ts +96 -0
  384. package/templates/professional-services/tier5-src/himi-branded-lite-faq/index.ts +6 -0
  385. package/templates/professional-services/tier5-src/himi-branded-lite-file-share/index.ts +12 -0
  386. package/templates/professional-services/tier5-src/himi-branded-lite-group/index.ts +310 -0
  387. package/templates/professional-services/tier5-src/himi-branded-lite-group-about/index.ts +240 -0
  388. package/templates/professional-services/tier5-src/himi-branded-lite-my-groups/index.ts +237 -0
  389. package/templates/professional-services/tier5-src/himi-branded-lite-notifications/index.ts +263 -0
  390. package/templates/professional-services/tier5-src/himi-branded-lite-plans/index.ts +498 -0
  391. package/templates/professional-services/tier5-src/himi-branded-lite-portfolio/index.ts +136 -0
  392. package/templates/professional-services/tier5-src/himi-branded-lite-portfolio-project/index.ts +198 -0
  393. package/templates/professional-services/tier5-src/himi-events-detail/index.ts +1306 -0
  394. package/templates/professional-services/tier5-src/himi-events-list/index.ts +171 -0
  395. package/templates/professional-services/tier5-src/himi-events-my-events/index.ts +227 -0
  396. package/templates/professional-services/tier5-src/himi-events-rsvp/index.ts +230 -0
  397. package/templates/professional-services/tier5-src/himi-professional-services-community/index.ts +318 -0
  398. package/templates/professional-services/tier5-src/himi-professional-services-home/index.ts +772 -0
  399. package/templates/professional-services/tier5-src/himi-store-account/index.ts +1514 -0
  400. package/templates/professional-services/tier5-src/wix-spaces-coupon-detail/index.ts +43 -0
  401. package/templates/professional-services/tier5-src/wix-spaces-my-subscriptions/index.ts +89 -0
  402. package/templates/professional-services/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
  403. package/templates/professional-services/tokens.json +456 -0
  404. package/templates/restaurant/dev/index.ts +20 -0
  405. package/templates/restaurant/l10n/ar.json +10 -0
  406. package/templates/restaurant/l10n/cs.json +10 -0
  407. package/templates/restaurant/l10n/da.json +10 -0
  408. package/templates/restaurant/l10n/de.json +10 -0
  409. package/templates/restaurant/l10n/el.json +10 -0
  410. package/templates/restaurant/l10n/es.json +10 -0
  411. package/templates/restaurant/l10n/fi.json +10 -0
  412. package/templates/restaurant/l10n/fr.json +10 -0
  413. package/templates/restaurant/l10n/he.json +8 -0
  414. package/templates/restaurant/l10n/hu.json +10 -0
  415. package/templates/restaurant/l10n/id.json +10 -0
  416. package/templates/restaurant/l10n/it.json +10 -0
  417. package/templates/restaurant/l10n/ja.json +10 -0
  418. package/templates/restaurant/l10n/ko.json +10 -0
  419. package/templates/restaurant/l10n/lt.json +10 -0
  420. package/templates/restaurant/l10n/nl.json +10 -0
  421. package/templates/restaurant/l10n/no.json +10 -0
  422. package/templates/restaurant/l10n/pl.json +10 -0
  423. package/templates/restaurant/l10n/pt.json +10 -0
  424. package/templates/restaurant/l10n/ru.json +10 -0
  425. package/templates/restaurant/l10n/sv.json +10 -0
  426. package/templates/restaurant/l10n/th.json +10 -0
  427. package/templates/restaurant/l10n/tr.json +10 -0
  428. package/templates/restaurant/l10n/uk.json +10 -0
  429. package/templates/restaurant/l10n/vi.json +10 -0
  430. package/templates/restaurant/l10n/zh.json +10 -0
  431. package/templates/restaurant/tier5-src/_shared/collection-contract.ts +6 -1
  432. package/templates/restaurant/tier5-src/_shared/himi-events.ts +27 -0
  433. package/templates/restaurant/tier5-src/himi-events-detail/index.ts +3 -1
  434. package/templates/restaurant/tier5-src/himi-events-list/index.ts +38 -8
  435. package/templates/restaurant/tier5-src/himi-events-my-events/index.ts +4 -2
  436. package/templates/restaurant-owner/tier5-src/_shared/collection-contract.ts +6 -1
  437. package/templates/restaurant-owner/tier5-src/_shared/himi-events.ts +27 -0
  438. package/templates/retail-store/tier5-src/_shared/collection-contract.ts +6 -1
  439. package/templates/retail-store/tier5-src/_shared/himi-events.ts +27 -0
  440. package/templates/retail-store-owner/tier5-src/_shared/collection-contract.ts +6 -1
  441. package/templates/retail-store-owner/tier5-src/_shared/himi-events.ts +27 -0
  442. package/templates/salon-spa/config.ts +42 -0
  443. package/templates/salon-spa/dev/index.ts +4136 -0
  444. package/templates/salon-spa/himalaya.content.json +18 -0
  445. package/templates/salon-spa/tier5-src/_shared/collection-contract.ts +6 -1
  446. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  447. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  448. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  449. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  450. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  451. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  452. package/templates/salon-spa/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  453. package/templates/wholesale-store/config.ts +43 -1
  454. package/templates/wholesale-store/dev/index.ts +4136 -0
  455. package/templates/wholesale-store/himalaya.content.json +18 -0
  456. package/templates/wholesale-store/tier5-src/_shared/collection-contract.ts +6 -1
  457. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/blocked-members.ts +295 -0
  458. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/index.ts +58 -0
  459. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/login-info.ts +274 -0
  460. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/personal-info.ts +881 -0
  461. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/privacy.ts +139 -0
  462. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/shared.ts +136 -0
  463. package/templates/wholesale-store/tier5-src/wix-spaces-delete-account/index.ts +59 -0
  464. package/templates/yoga-studio/dev/index.ts +20 -0
  465. package/templates/yoga-studio/l10n/ar.json +10 -0
  466. package/templates/yoga-studio/l10n/cs.json +10 -0
  467. package/templates/yoga-studio/l10n/da.json +10 -0
  468. package/templates/yoga-studio/l10n/de.json +10 -0
  469. package/templates/yoga-studio/l10n/el.json +10 -0
  470. package/templates/yoga-studio/l10n/es.json +10 -0
  471. package/templates/yoga-studio/l10n/fi.json +10 -0
  472. package/templates/yoga-studio/l10n/fr.json +10 -0
  473. package/templates/yoga-studio/l10n/he.json +8 -0
  474. package/templates/yoga-studio/l10n/hu.json +10 -0
  475. package/templates/yoga-studio/l10n/id.json +10 -0
  476. package/templates/yoga-studio/l10n/it.json +10 -0
  477. package/templates/yoga-studio/l10n/ja.json +10 -0
  478. package/templates/yoga-studio/l10n/ko.json +10 -0
  479. package/templates/yoga-studio/l10n/lt.json +10 -0
  480. package/templates/yoga-studio/l10n/nl.json +10 -0
  481. package/templates/yoga-studio/l10n/no.json +10 -0
  482. package/templates/yoga-studio/l10n/pl.json +10 -0
  483. package/templates/yoga-studio/l10n/pt.json +10 -0
  484. package/templates/yoga-studio/l10n/ru.json +10 -0
  485. package/templates/yoga-studio/l10n/sv.json +10 -0
  486. package/templates/yoga-studio/l10n/th.json +10 -0
  487. package/templates/yoga-studio/l10n/tr.json +10 -0
  488. package/templates/yoga-studio/l10n/uk.json +10 -0
  489. package/templates/yoga-studio/l10n/vi.json +10 -0
  490. package/templates/yoga-studio/l10n/zh.json +10 -0
  491. package/templates/yoga-studio/tier5-src/_shared/collection-contract.ts +6 -1
  492. package/templates/yoga-studio/tier5-src/_shared/himi-events.ts +27 -0
  493. package/templates/yoga-studio/tier5-src/himi-events-detail/index.ts +3 -1
  494. package/templates/yoga-studio/tier5-src/himi-events-list/index.ts +38 -8
  495. package/templates/yoga-studio/tier5-src/himi-events-my-events/index.ts +4 -2
  496. package/templates/yoga-studio-owner/tier5-src/_shared/collection-contract.ts +6 -1
  497. package/templates/yoga-studio-owner/tier5-src/_shared/himi-events.ts +27 -0
@@ -0,0 +1,70 @@
1
+ // A Wix Portfolio project's free "details" rows (label + text), read the same way by every worker
2
+ // that shows a project: the list, the detail and a template's Home rail.
3
+ //
4
+ // Wix Portfolio has no field of its own for a location, a client, a year or a duration. Owners keep
5
+ // them as details with those labels. A worker maps the four known labels to their places (a
6
+ // location line, three fact chips) and shows any other detail as a plain row under the
7
+ // description. Labels match case-insensitively; a detail with no text (and no link text) is skipped.
8
+ import type { WixPortfolioCollection, WixPortfolioProject, WixPortfolioProjectDetail } from "@himalaya/wix-portfolio";
9
+
10
+ export interface ProjectFact { id: string; label: string; value: string; icon: string }
11
+ export interface ProjectDetailRow { id: string; label: string; value: string }
12
+ export interface ProjectDetails {
13
+ /** The "Location" detail ("" when the project has none). */
14
+ location: string;
15
+ /** Client, Year and Duration, in that order, only those the project has. */
16
+ facts: ProjectFact[];
17
+ /** Every other detail, in the owner's order. */
18
+ others: ProjectDetailRow[];
19
+ }
20
+
21
+ /** The fact chips' labels and glyphs, in display order (glyphs from the icon catalog). */
22
+ const FACT_LABELS: Array<{ key: string; icon: string }> = [
23
+ { key: "client", icon: "person" },
24
+ { key: "year", icon: "calendar" },
25
+ { key: "duration", icon: "clock" },
26
+ ];
27
+
28
+ const clean = (value: unknown): string => (typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "");
29
+
30
+ function valueOf(detail: WixPortfolioProjectDetail): string {
31
+ return clean(detail.text) || clean(detail.link?.text);
32
+ }
33
+
34
+ export function projectDetails(project: Pick<WixPortfolioProject, "details"> | undefined): ProjectDetails {
35
+ const rows = (Array.isArray(project?.details) ? project!.details : [])
36
+ .map((detail, i) => ({ i, label: clean(detail?.label), value: valueOf(detail ?? {}) }))
37
+ .filter((row) => row.label && row.value);
38
+ const byKey = new Map<string, { i: number; label: string; value: string }>();
39
+ for (const row of rows) {
40
+ const key = row.label.toLowerCase();
41
+ if (!byKey.has(key)) byKey.set(key, row);
42
+ }
43
+ const location = byKey.get("location")?.value ?? "";
44
+ const facts: ProjectFact[] = FACT_LABELS.flatMap(({ key, icon }) => {
45
+ const row = byKey.get(key);
46
+ return row ? [{ id: `fact-${key}`, label: row.label, value: row.value, icon }] : [];
47
+ });
48
+ const used = new Set(["location", ...FACT_LABELS.map((f) => f.key)].map((key) => byKey.get(key)?.i).filter((i) => i !== undefined));
49
+ const others = rows.filter((row) => !used.has(row.i)).map((row) => ({ id: `detail-${row.i}`, label: row.label, value: row.value }));
50
+ return { location, facts, others };
51
+ }
52
+
53
+ /** The visible collections by id ("Strategy", "Operations"…); hidden ones are left out. */
54
+ export function collectionNames(collections: readonly WixPortfolioCollection[] | undefined): Map<string, string> {
55
+ const out = new Map<string, string>();
56
+ for (const c of collections ?? []) {
57
+ const title = clean(c?.title);
58
+ if (c?.id && title && c.hidden !== true) out.set(c.id, title);
59
+ }
60
+ return out;
61
+ }
62
+
63
+ /** The project's first visible collection name ("" when it is in none). */
64
+ export function projectCollection(project: Pick<WixPortfolioProject, "collectionIds"> | undefined, names: Map<string, string>): { id: string; name: string } {
65
+ for (const id of project?.collectionIds ?? []) {
66
+ const name = names.get(id);
67
+ if (name) return { id, name };
68
+ }
69
+ return { id: "", name: "" };
70
+ }
@@ -1,9 +1,15 @@
1
1
  import { descriptionBody } from "../_shared/rich-body.js";
2
2
  // himi-branded-lite-portfolio — real, public Wix Portfolio projects.
3
3
  // Empty and error states stay explicit; media IDs are normalized for every host.
4
+ //
5
+ // Collections: each row names its first visible collection (`collection`), and `collections` are
6
+ // the filter chips (All + each collection that holds a listed project). `projects` is the list for
7
+ // the chip that is on; "all" (the default) is every project, as before.
4
8
  import { defineService } from "../_shared/collection-service.js";
5
- import { listProjects, portfolioCoverRef, type WixPortfolioProject } from "@himalaya/wix-portfolio";
9
+ import { listCollections, listProjects, portfolioCoverRef, type WixPortfolioProject } from "@himalaya/wix-portfolio";
6
10
  import { wixMediaUrl } from "@himalaya/wix-media";
11
+ import { copyParam, stashCopy } from "../_shared/himi-copy.js";
12
+ import { collectionNames, projectCollection, projectDetails } from "../_shared/portfolio-details.js";
7
13
 
8
14
  interface Row {
9
15
  id: string;
@@ -13,7 +19,18 @@ interface Row {
13
19
  initial: string;
14
20
  hasImage: boolean;
15
21
  noImage: boolean;
22
+ /** The project's collection name ("" when it is in none). */
23
+ collection: string;
24
+ collectionId: string;
25
+ hasCollection: boolean;
26
+ noCollection: boolean;
27
+ /** The "Location" detail ("" when none). */
28
+ location: string;
29
+ noLocation: boolean;
16
30
  }
31
+ /** `notSelected` is `selected`'s inverse, so a chip row can hide its "on" variant with `hiddenWhen`. */
32
+ interface Chip { id: string; label: string; selected: boolean; notSelected: boolean }
33
+ const chipOf = (id: string, label: string, selected: boolean): Chip => ({ id, label, selected, notSelected: !selected });
17
34
  interface S {
18
35
  status: "loading" | "ready" | "error";
19
36
  projects: Row[];
@@ -21,11 +38,31 @@ interface S {
21
38
  isMock: boolean;
22
39
  notMock: boolean;
23
40
  mockBanner: string;
41
+ /** All + one chip per collection that holds a listed project; [] when there is none. */
42
+ collections: Chip[];
43
+ noCollections: boolean;
44
+ selectedCollection: string;
45
+ /** State gates for a screen's skeleton, error and empty components. */
46
+ isLoading: boolean;
47
+ notLoading: boolean;
48
+ notErrored: boolean;
49
+ /** False only when the read is done and found no project at all. Not `noEmpty`: the collection
50
+ * chrome reads a top-level `noEmpty: false` as "the domain shows its own empty state" and hides
51
+ * its designed one (collection-service `noEmptySource`). */
52
+ noEmptyProjects: boolean;
24
53
  }
25
54
 
26
- function norm(project: WixPortfolioProject): Row {
55
+ const gates = (status: S["status"], empty: boolean) => ({
56
+ isLoading: status === "loading", notLoading: status !== "loading", notErrored: status !== "error", noEmptyProjects: !(status === "ready" && empty),
57
+ });
58
+
59
+ const ALL = "all";
60
+
61
+ function norm(project: WixPortfolioProject, names: Map<string, string>): Row {
27
62
  const title = (project.title || "Project").trim() || "Project";
28
63
  const image = wixMediaUrl(portfolioCoverRef(project.coverImage));
64
+ const collection = projectCollection(project, names);
65
+ const location = projectDetails(project).location;
29
66
  return {
30
67
  id: project.id || project.slug || title,
31
68
  title,
@@ -34,21 +71,65 @@ function norm(project: WixPortfolioProject): Row {
34
71
  initial: (title[0] || "#").toUpperCase(),
35
72
  hasImage: Boolean(image),
36
73
  noImage: !image,
74
+ collection: collection.name,
75
+ collectionId: collection.id,
76
+ hasCollection: Boolean(collection.name),
77
+ noCollection: !collection.name,
78
+ location,
79
+ noLocation: !location,
37
80
  };
38
81
  }
39
82
 
40
- const svc = defineService<S, { load: (s: S) => Promise<S> }>("himiBrandedPortfolio", {
41
- state: { status: "loading", projects: [], emptyText: "", isMock: false, notMock: true, mockBanner: "" },
83
+ /** Every row read by the last load; `projects` is this list filtered by the chip that is on. */
84
+ let allRows: Row[] = [];
85
+
86
+ function chipsFor(rows: Row[], names: Map<string, string>, selected: string): Chip[] {
87
+ const used = [...names.entries()].filter(([id]) => rows.some((row) => row.collectionId === id));
88
+ // One collection only: a chip row with "All" and that one says nothing.
89
+ if (used.length < 2) return [];
90
+ return [
91
+ chipOf(ALL, copyParam("portfolio.allChip", "All"), selected === ALL),
92
+ ...used.map(([id, label]) => chipOf(id, label, selected === id)),
93
+ ];
94
+ }
95
+
96
+ function view(s: S, selected: string, names?: Map<string, string>): S {
97
+ const chips = names ? chipsFor(allRows, names, selected) : s.collections.map((chip) => chipOf(chip.id, chip.label, chip.id === selected));
98
+ const valid = selected === ALL || chips.some((chip) => chip.id === selected) ? selected : ALL;
99
+ const projects = valid === ALL ? allRows : allRows.filter((row) => row.collectionId === valid);
100
+ return {
101
+ ...s,
102
+ projects,
103
+ collections: valid === selected ? chips : chips.map((chip) => chipOf(chip.id, chip.label, chip.id === ALL)),
104
+ noCollections: chips.length === 0,
105
+ selectedCollection: valid,
106
+ };
107
+ }
108
+
109
+ const svc = defineService<S, { load: (s: S, arg?: unknown) => Promise<S>; setCollection: (s: S, arg?: unknown) => S }>("himiBrandedPortfolio", {
110
+ state: { status: "loading", projects: [], emptyText: "", isMock: false, notMock: true, mockBanner: "", collections: [], noCollections: true, selectedCollection: ALL, ...gates("loading", true) },
42
111
  actions: {
43
- load: async (s) => {
112
+ load: async (s, arg) => {
113
+ stashCopy(arg);
44
114
  try {
45
- const response = await listProjects(50);
46
- const projects = (response.projects ?? []).filter((project) => project.hidden !== true).map(norm);
47
- return { ...s, status: "ready", projects, emptyText: projects.length ? "" : "No published projects are available yet.", isMock: false, notMock: true, mockBanner: "" };
115
+ const [response, collections] = await Promise.all([
116
+ listProjects(50),
117
+ // The chips are extra: a failed collections read leaves the list without them.
118
+ listCollections(100).then((r) => r.collections ?? []).catch(() => []),
119
+ ]);
120
+ const names = collectionNames(collections);
121
+ allRows = (response.projects ?? []).filter((project) => project.hidden !== true).map((project) => norm(project, names));
122
+ return view({ ...s, status: "ready", emptyText: allRows.length ? "" : "No published projects are available yet.", isMock: false, notMock: true, mockBanner: "", ...gates("ready", allRows.length === 0) }, s.selectedCollection || ALL, names);
48
123
  } catch {
49
- return { ...s, status: "error", projects: [], emptyText: "Portfolio projects could not be loaded. Try again.", isMock: false, notMock: true, mockBanner: "" };
124
+ allRows = [];
125
+ return { ...s, status: "error", projects: [], emptyText: "Portfolio projects could not be loaded. Try again.", isMock: false, notMock: true, mockBanner: "", collections: [], noCollections: true, selectedCollection: ALL, ...gates("error", true) };
50
126
  }
51
127
  },
128
+ // A chip tap: { id } — "all" or a collection id.
129
+ setCollection: (s, arg) => {
130
+ const id = (arg as { id?: unknown } | undefined)?.id;
131
+ return view(s, typeof id === "string" && id ? id : ALL);
132
+ },
52
133
  },
53
134
  });
54
135
  svc.load();
@@ -2,8 +2,16 @@ import { descriptionBody } from "../_shared/rich-body.js";
2
2
  // himi-branded-lite-portfolio-project — real Wix Portfolio project detail.
3
3
  // The public project row is resolved again from Wix, then its ordered project
4
4
  // items supply the actual image/video/text story. No sample project is invented.
5
+ //
6
+ // The project's collection (`collection`), its "Location" detail (`location`), its Client, Year and
7
+ // Duration details as fact chips (`facts`) and every other detail (`details`) come from the same
8
+ // list read (_shared/portfolio-details.ts). Each collapses when the project has none. `share`
9
+ // opens the system share sheet with the project's page on the site when Wix gives one, else the
10
+ // site's own address when the screen passes it (`siteUrl` load param); with neither, no share.
5
11
  import { defineService } from "@himalaya/state";
6
- import { listProjectItems, listProjects, portfolioCoverRef, type WixPortfolioProjectItem } from "@himalaya/wix-portfolio";
12
+ import { listCollections, listProjectItems, listProjects, portfolioCoverRef, type WixPortfolioProjectItem } from "@himalaya/wix-portfolio";
13
+ import { share as shareSheet } from "@himalaya/share";
14
+ import { collectionNames, projectCollection, projectDetails, type ProjectDetailRow, type ProjectFact } from "../_shared/portfolio-details.js";
7
15
  import { wixMediaUrl, WIX_DETAIL_IMAGE } from "@himalaya/wix-media";
8
16
  import { copyParam, stashCopy } from "../_shared/himi-copy.js";
9
17
  import { presence, type PresenceFlags } from "../_shared/detail-presence.js";
@@ -41,8 +49,24 @@ interface State extends PresenceFlags {
41
49
  noItems: boolean;
42
50
  hideContent: boolean;
43
51
  noEmpty: boolean;
52
+ collection: string;
53
+ noCollection: boolean;
54
+ location: string;
55
+ noLocation: boolean;
56
+ facts: ProjectFact[];
57
+ noFacts: boolean;
58
+ details: ProjectDetailRow[];
59
+ noDetails: boolean;
60
+ /** The project's page on the published site ("" when Wix gives none: no share). */
61
+ shareUrl: string;
62
+ noShare: boolean;
44
63
  }
45
64
 
65
+ const NO_DETAILS = {
66
+ collection: "", noCollection: true, location: "", noLocation: true, facts: [] as ProjectFact[], noFacts: true,
67
+ details: [] as ProjectDetailRow[], noDetails: true, shareUrl: "", noShare: true,
68
+ };
69
+
46
70
  function inputId(): string {
47
71
  const input = (globalThis as { himalaya?: { input?: { id?: unknown } } }).himalaya?.input;
48
72
  return typeof input?.id === "string" ? input.id : "";
@@ -101,15 +125,22 @@ function unavailableProject(state: State, status: "ready" | "error", id: string,
101
125
  coverImage: "",
102
126
  items: [],
103
127
  emptyText,
128
+ ...NO_DETAILS,
104
129
  // A project that is not there is `missing`; one that failed to load is not — the
105
130
  // error card speaks, and nothing claims the project was removed.
106
131
  ...presence(status === "ready" ? "missing" : "failed"),
107
132
  });
108
133
  }
109
134
 
110
- const svc = defineService<State, { load: (state: State, arg?: unknown) => Promise<State> }>("himiBrandedPortfolioProject", {
135
+ /** A project page on the web (https only): the share sheet carries nothing else. */
136
+ function shareUrlOf(raw: unknown): string {
137
+ const url = typeof raw === "string" ? raw.trim() : "";
138
+ return /^https:\/\/[^\s]+$/i.test(url) ? url : "";
139
+ }
140
+
141
+ const svc = defineService<State, { load: (state: State, arg?: unknown) => Promise<State>; share: (state: State) => Promise<State> }>("himiBrandedPortfolioProject", {
111
142
  state: derive({
112
- status: "loading", id: "", title: "", initial: "", description: "", coverImage: "", items: [], emptyText: "",
143
+ status: "loading", id: "", title: "", initial: "", description: "", coverImage: "", items: [], emptyText: "", ...NO_DETAILS,
113
144
  isLoading: true, notLoading: false, isErrored: false, notErrored: true,
114
145
  hasCover: false, noCover: true, hasItems: false, noItems: true, hideContent: true, noEmpty: true, ...presence("loading"),
115
146
  }),
@@ -119,7 +150,11 @@ const svc = defineService<State, { load: (state: State, arg?: unknown) => Promis
119
150
  const id = inputId();
120
151
  if (!id) return unavailableProject(state, "ready", "", copyParam("portfolioProject.emptyText", "This project is no longer available."));
121
152
  try {
122
- const projects = await listProjects(100);
153
+ const [projects, collections] = await Promise.all([
154
+ listProjects(100),
155
+ // The collection name is extra: a failed read leaves the project without it.
156
+ listCollections(100).then((r) => r.collections ?? []).catch(() => []),
157
+ ]);
123
158
  const project = (projects.projects ?? []).find((candidate) => candidate.id === id && candidate.hidden !== true);
124
159
  if (!project) return unavailableProject(state, "ready", id, copyParam("portfolioProject.emptyText", "This project is no longer available."));
125
160
  const response = await listProjectItems(id, 100);
@@ -127,6 +162,10 @@ const svc = defineService<State, { load: (state: State, arg?: unknown) => Promis
127
162
  .slice()
128
163
  .sort((a, b) => (a.sortOrder ?? 0) - (b.sortOrder ?? 0))
129
164
  .map(row);
165
+ const details = projectDetails(project);
166
+ const collection = projectCollection(project, collectionNames(collections)).name;
167
+ // A site with no Portfolio page gives no project url: the site itself is what to share.
168
+ const shareUrl = shareUrlOf(project.url) || shareUrlOf((arg as { siteUrl?: unknown } | undefined)?.siteUrl);
130
169
  return derive({
131
170
  ...state,
132
171
  status: "ready",
@@ -137,12 +176,22 @@ const svc = defineService<State, { load: (state: State, arg?: unknown) => Promis
137
176
  coverImage: wixMediaUrl(portfolioCoverRef(project.coverImage), WIX_DETAIL_IMAGE),
138
177
  items,
139
178
  emptyText: items.length ? "" : copyParam("portfolioProject.noMediaText", "This project has no published media yet."),
179
+ collection, noCollection: !collection,
180
+ location: details.location, noLocation: !details.location,
181
+ facts: details.facts, noFacts: details.facts.length === 0,
182
+ details: details.others, noDetails: details.others.length === 0,
183
+ shareUrl, noShare: !shareUrl,
140
184
  ...presence("found"),
141
185
  });
142
186
  } catch {
143
187
  return unavailableProject(state, "error", id, copyParam("portfolioProject.errorText", "This project could not be loaded. Try again."));
144
188
  }
145
189
  },
190
+ share: async (state) => {
191
+ if (!state.shareUrl) return state;
192
+ try { await shareSheet({ subject: state.title, text: state.title, url: state.shareUrl }); } catch { /* the sheet is best-effort */ }
193
+ return state;
194
+ },
146
195
  },
147
196
  });
148
197
  svc.load();
@@ -28,6 +28,7 @@ import {
28
28
  eventImage,
29
29
  eventLocation,
30
30
  eventAddress,
31
+ eventCacheTimes,
31
32
  eventMapUrl,
32
33
  eventStartMillis,
33
34
  eventWhen,
@@ -1057,7 +1058,8 @@ const svc: ReturnType<typeof defineService<S, DetailActions>> = defineService<S,
1057
1058
  if (kind === "tickets" && !await priceTicket(e, selectedTicketId, selectionVersion)) return undefined;
1058
1059
  // Write-through: cache the fetched row (same EventRow shape as the list) so a
1059
1060
  // later offline open of this detail can fall back to it.
1060
- await writeCachedRow(normalizeEvent(e));
1061
+ // Its own times ride along, so the list can tell later whether the event is still upcoming (`cachedEventUpcoming`).
1062
+ await writeCachedRow({ ...normalizeEvent(e), ...eventCacheTimes(e) });
1061
1063
  const image = eventImage(e);
1062
1064
  const title = e.title || "";
1063
1065
  const dates = detailDate(e);
@@ -2,11 +2,12 @@
2
2
  import { defineBackendCollection } from "../_shared/collection-service.js";
3
3
  import { queryEvents, type WixEvent } from "@himalaya/wix-events";
4
4
  import { getAll, upsert, type DbEntity } from "@himalaya/local-db";
5
- import { normalizeEvent, type EventRow } from "../_shared/himi-events";
5
+ import { cachedEventUpcoming, eventCacheTimes, normalizeEvent, type EventRow } from "../_shared/himi-events";
6
6
  import { offsetPage } from "../_shared/offset-page.js";
7
7
  import { copyParam } from "../_shared/himi-copy.js";
8
8
  import { eventPageUrlOf, registrationUi } from "../_shared/event-registration.js";
9
9
  import { share as shareSheet } from "@himalaya/share";
10
+ import { memberAvatarSource } from "../_shared/member-avatar.js";
10
11
  import { eventsSelectionFilter, eventsSelectionFromScope, eventsSelectionOf, eventsSelectionScope, type EventsSelection } from "../_shared/events-inline-options.js";
11
12
 
12
13
  // Offline-first (data-offline): the public events list is a read-through catalog —
@@ -54,12 +55,28 @@ async function writeCached(rows: EventRow[]): Promise<void> {
54
55
 
55
56
  interface S {
56
57
  status: "loading" | "ready";
58
+ /** The signed-in member's photo and initials, for a screen that asks for its top-bar avatar. */
59
+ memberImage: string; memberInitials: string;
57
60
  query: string; all: ListEventRow[]; results: ListEventRow[]; emptyText: string; countLabel: string;
58
61
  errored: boolean; notErrored: boolean; isLoading: boolean; notLoading: boolean; noEmpty: boolean;
62
+ /** Upcoming is empty but the site has past events: the empty state says "No upcoming events" and offers
63
+ * `pastEventsLabel` ("See past events"), which switches the list to Past. */
64
+ pastEventsLabel: string; noPastEvents: boolean;
59
65
  nextCursor?: string; complete?: boolean; total?: number; loadingMore?: boolean; pageError?: boolean; fromCache?: boolean;
60
66
  }
61
67
  let queryNow = new Date().toISOString();
62
68
 
69
+ /** Does the site (within the list's selection) have at least one past event? A one-row read of the Past filter, made only
70
+ * when Upcoming is empty. A failed read answers no: the empty state is then the plain one it always was. */
71
+ async function pastEventsExist(scope: string | undefined): Promise<boolean> {
72
+ try {
73
+ const filter: Record<string, unknown> = { status: { $ne: "DRAFT" }, "dateAndTimeSettings.startDate": { $lt: queryNow },
74
+ ...eventsSelectionFilter(eventsSelectionFromScope(scope)) };
75
+ const res = await queryEvents({ limit: 1, offset: 0, query: { filter } });
76
+ return (res.events ?? []).length > 0;
77
+ } catch { return false; }
78
+ }
79
+
63
80
  // A link may open the list on some events only (`categoryIds` / `eventIds`, comma-separated: a See All from a section the app owner
64
81
  // limited to a category). It is the selection of the visit that opened the screen: a visit that names none is the full list again.
65
82
  // A route value is user-controllable text, so only well-formed ids are read (`eventsSelectionIds`). The selection is part of the
@@ -71,22 +88,27 @@ function readSelection(arg?: unknown): EventsSelection {
71
88
  }
72
89
  const svc = defineBackendCollection<S, ListEventRow>("himiEvents", {
73
90
  restorePagesOnLoad: true,
91
+ memberAvatar: memberAvatarSource,
74
92
  onLoad(arg) { selection = readSelection(arg); },
75
93
  scope: () => eventsSelectionScope(selection),
76
- state: { status: "loading", query: "", all: [], results: [], emptyText: "", countLabel: "", errored: false, notErrored: true,
77
- isLoading: true, notLoading: false, noEmpty: true },
94
+ state: { status: "loading", memberImage: "", memberInitials: "", query: "", all: [], results: [], emptyText: "", countLabel: "", errored: false, notErrored: true,
95
+ isLoading: true, notLoading: false, noEmpty: true, pastEventsLabel: "", noPastEvents: true },
78
96
  source: {
79
97
  id: row => row.id,
80
98
  errorMessage: () => copyParam("events.errorText", "Events could not be loaded."),
81
99
  async cached(criteria) {
82
100
  // The list now OPENS on Upcoming, so the default view must keep its offline-first paint:
83
- // serve the cache for it too, minus the rows that have finished.
101
+ // serve the cache for it too, but only the rows the live Upcoming read would return. That is read from the row's own
102
+ // times against NOW (`cachedEventUpcoming`, the `eventIsPast` rule), never from its stored "Past" label: that
103
+ // label was decided when the row was written (a row cached the day before its event ended says "not past"
104
+ // forever) and is localized copy. Painting such a row and then losing it to the live read was the flash.
84
105
  const upcoming = criteria.filter === "value:Upcoming";
85
106
  // The cache holds the whole catalog: a list limited to some events must not paint rows outside the selection first.
86
107
  if (criteria.scope) return undefined;
87
108
  if (criteria.query || (criteria.filter !== "all" && !upcoming) || criteria.sort !== "default") return undefined;
88
109
  const rows = await readCached();
89
- return { items: upcoming ? rows.filter((row) => row.statusLabel !== "Past") : rows, nextCursor: "", metadata: { fromCache: true } };
110
+ const now = Date.now();
111
+ return { items: upcoming ? rows.filter((row) => cachedEventUpcoming(row, now)) : rows, nextCursor: "", metadata: { fromCache: true } };
90
112
  },
91
113
  async fetch(criteria, cursor) {
92
114
  if (!cursor) queryNow = new Date().toISOString();
@@ -113,18 +135,26 @@ const svc = defineBackendCollection<S, ListEventRow>("himiEvents", {
113
135
  const res = await queryEvents({ limit: 50, offset: Number(cursor || 0), fields: ["DETAILS", "REGISTRATION", "URLS"], query: { filter,
114
136
  sort: [{ fieldName: criteria.sort === "default" ? "dateAndTimeSettings.startDate" : "title", order: criteria.sort === "za" ? "DESC" : "ASC" }, { fieldName: "id", order: "ASC" }] } });
115
137
  const raw = res.events ?? [];
116
- const items = raw.filter(row => !!row.id).map(row => withRegistration(row, withDateBadge(normalizeEvent(row))));
138
+ const items = raw.filter(row => !!row.id).map(row => ({ ...withRegistration(row, withDateBadge(normalizeEvent(row))), ...eventCacheTimes(row) }));
117
139
  await writeCached(items);
118
140
  const metadata = (res as { pagingMetadata?: { total?: number } }).pagingMetadata;
119
- return { items, ...offsetPage(cursor, raw.length, 50, metadata), metadata: { fromCache: false } };
141
+ // Upcoming came back empty: ask whether ANY past event exists (one row, same selection), so the empty state can
142
+ // say "No upcoming events" and offer Past instead of "Nothing here yet" over a site that has events. Only for
143
+ // the un-searched first page: a search with no match is the shared "No matching items" state.
144
+ const hasPast = criteria.filter === "value:Upcoming" && !cursor && !criteria.query && raw.length === 0
145
+ ? await pastEventsExist(criteria.scope) : false;
146
+ return { items, ...offsetPage(cursor, raw.length, 50, metadata), metadata: { fromCache: false, hasPast } };
120
147
  },
121
148
  },
122
149
  apply(s, page) {
123
150
  const loading = page.status === "loading", errored = page.status === "error";
151
+ const pastOnly = !loading && !errored && page.items.length === 0 && page.criteria.filter === "value:Upcoming" && page.metadata?.hasPast === true;
124
152
  return { ...s, status: loading ? "loading" : "ready", query: page.criteria.query, all: page.items, results: page.items,
125
153
  nextCursor: page.nextCursor, complete: page.complete, total: page.total, loadingMore: page.loadingMore, pageError: page.pageError,
126
154
  fromCache: page.metadata?.fromCache === true, errored, notErrored: !errored, isLoading: loading, notLoading: !loading,
127
- noEmpty: true, countLabel: "", emptyText: errored ? copyParam("events.errorText", "Events could not be loaded.") : "" };
155
+ noEmpty: true, countLabel: "",
156
+ emptyText: errored ? copyParam("events.errorText", "Events could not be loaded.") : pastOnly ? copyParam("events.noUpcoming", "No upcoming events") : "",
157
+ pastEventsLabel: pastOnly ? copyParam("events.seePast", "See past events") : "", noPastEvents: !pastOnly };
128
158
  },
129
159
  actions: {
130
160
  // Share a card's event: its title and date line, plus the event page when the payload carried one.
@@ -3,7 +3,7 @@ import { defineService } from "@himalaya/state";
3
3
  import { dispatch } from "@himalaya/dispatch";
4
4
  import { queryEvents, type WixEvent } from "@himalaya/wix-events";
5
5
  import { getAll, upsert, type DbEntity } from "@himalaya/local-db";
6
- import { confirmedRsvpIds, eventStartMillis, normalizeEvent, type EventRow } from "../_shared/himi-events";
6
+ import { confirmedRsvpIds, eventCacheTimes, eventStartMillis, normalizeEvent, type EventRow } from "../_shared/himi-events";
7
7
  import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
8
8
  import { memberAccess } from "../_shared/member-access.js";
9
9
  import { readAccess, assertReadAccess, readAccessDenied, readSignInFlags, NO_READ_SIGN_IN } from "../_shared/member-read.js";
@@ -86,7 +86,9 @@ function imminentLabel(start: number | undefined): string {
86
86
 
87
87
  function cachedEventRow(event: WixEvent): CachedEventRow {
88
88
  const row = normalizeEvent(event);
89
- return { ...row, startMillis: eventStartMillis(event), canonicalStatus: row.status };
89
+ // The `events` store is shared with the Events list, which paints a row in Upcoming only when its stored times
90
+ // (`eventCacheTimes`) prove the event has not ended: an upsert without them would hide the row there.
91
+ return { ...row, ...eventCacheTimes(event), startMillis: eventStartMillis(event), canonicalStatus: row.status };
90
92
  }
91
93
 
92
94
  function displayEventRow(event: CachedEventRow): CachedEventRow {
@@ -61,6 +61,11 @@ export interface CollectionConfig {
61
61
  * card the overflow's items were unreachable AND the wrong pattern: shoppers
62
62
  * expect a heart, not a 3-item menu two taps deep. */
63
63
  favoriteToggle?: boolean;
64
+ /** A button in the EMPTY-SOURCE state that moves the list to another view of the same source (Events: "See past
65
+ * events" when Upcoming is empty and Past is not). `labelPath` and `hiddenPath` are top-level STATE fields the domain
66
+ * sets (the label through its copy, hidden until the domain knows the other view has rows); the tap sets the list's
67
+ * filter to `filter` (`collectionCriteria`), which must be one of `filterValues`. */
68
+ emptySourceAction?: { labelPath: string; hiddenPath: string; filter: string };
64
69
  /** A state field the DOMAIN narrows `rows` by (e.g. a category picker). While it is set,
65
70
  * zero rows is a filtered result, not an empty source. */
66
71
  narrowedBy?: string;
@@ -81,7 +86,7 @@ export const COLLECTIONS: Record<string, CollectionConfig> = {
81
86
  himiBookingBookings: { rows: 'rows', title: 'title', subtitle: 'subtitle', metadata: ['status'], view: 'list', backendQuery: true,
82
87
  defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search by booking ID', countNoun: ['booking', 'bookings'], filterValues: ['Upcoming', 'Past', 'Cancelled'],
83
88
  sortLabels: { default: 'Soonest', az: 'Oldest', za: 'Latest' } },
84
- himiEvents: { rows: 'results', title: 'title', subtitle: 'dateLine', image: 'image', dateBadge: { text: 'dateBadge', hidden: 'noDateBadge' }, gridColumns: 1, view: 'grid', backendQuery: true, defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search events', countNoun: ['event', 'events'], filterValues: ['Upcoming', 'Past'], sortLabels: { default: 'Date', az: 'Title A–Z', za: 'Title Z–A' }, primaryVerb: { label: 'Register', labelPath: 'actionLabel', hiddenPath: 'noAction' }, shareAction: 'share', endedWhen: 'isPast' },
89
+ himiEvents: { rows: 'results', title: 'title', subtitle: 'dateLine', image: 'image', dateBadge: { text: 'dateBadge', hidden: 'noDateBadge' }, gridColumns: 1, view: 'grid', backendQuery: true, defaultFilter: 'value:Upcoming', searchPlaceholder: 'Search events', countNoun: ['event', 'events'], filterValues: ['Upcoming', 'Past'], sortLabels: { default: 'Date', az: 'Title A–Z', za: 'Title Z–A' }, primaryVerb: { label: 'Register', labelPath: 'actionLabel', hiddenPath: 'noAction' }, shareAction: 'share', endedWhen: 'isPast', emptySourceAction: { labelPath: 'pastEventsLabel', hiddenPath: 'noPastEvents', filter: 'value:Past' } },
85
90
  himiOwnerLiteProducts: { rows: 'products', title: 'name', subtitle: 'price', image: 'image', view: 'grid', backendQuery: true, countNoun: ['product', 'products'] },
86
91
  himiOwnerModules: { instanceInput: 'module', rows: 'rows', title: 'title', subtitle: 'subtitle', image: 'image', filter: 'statusLabel', view: 'list', paged: true, reviewAction: 'prepareRecord', reviewSelectedAction: 'prepareSelected' },
87
92
  himiOwnerLiteServices: { rows: 'services', title: 'name', subtitle: 'subtitle', view: 'list', backendQuery: true, searchPlaceholder: 'Service name starts with…' },
@@ -11,6 +11,33 @@ export * from "@himalaya/wix-events";
11
11
  // (`globalThis.himalaya.storage` / `.input`), which a published, brand-scrubbed SDK
12
12
  // package must not reference. The himi-events-* bundles import these from this module.
13
13
 
14
+ import { eventEndMillis, eventStartMillis, type WixEvent } from "@himalaya/wix-events";
15
+
16
+ /** The event's own times, kept on the row the `events` local-db store holds (written by the list AND the detail), so a
17
+ * reader can tell at READ time whether the event has finished. The row's `statusLabel` / `isPast` were decided when the
18
+ * row was written, and the label is localized copy (`events.past`): a row stored the day before its event ended still
19
+ * says "not past" today. ISO strings, "" when the event has no such time. */
20
+ export interface EventCacheTimes { startsAt: string; endsAt: string }
21
+
22
+ export function eventCacheTimes(e: WixEvent): EventCacheTimes {
23
+ const iso = (ms: number | undefined) => (ms === undefined ? "" : new Date(ms).toISOString());
24
+ return { startsAt: iso(eventStartMillis(e)), endsAt: iso(eventEndMillis(e)) };
25
+ }
26
+
27
+ /** Would the live Upcoming read return the event of this CACHED row, at `now`? That read asks for a start or an end at
28
+ * or after now, so: its end when it has one, else its start, not before `now` (the `eventIsPast` rule, inverted), read from
29
+ * the row's own stored times. Everything the live read cannot return is `false`, so a cached paint never shows a row that
30
+ * the live answer then removes: a row written before the times were stored (no `startsAt` / `endsAt`), an undated event
31
+ * (to be announced: no time matches the query), and a time that does not parse. */
32
+ export function cachedEventUpcoming(row: unknown, now: number = Date.now()): boolean {
33
+ const r = (row && typeof row === "object" ? row : {}) as Partial<EventCacheTimes>;
34
+ if (typeof r.startsAt !== "string" || typeof r.endsAt !== "string") return false;
35
+ const at = r.endsAt || r.startsAt;
36
+ if (!at) return false;
37
+ const ms = new Date(at).getTime();
38
+ return !Number.isNaN(ms) && ms >= now;
39
+ }
40
+
14
41
  interface StorageLike {
15
42
  getItem(key: string): string | null;
16
43
  setItem(key: string, value: string): void;
@@ -0,0 +1,55 @@
1
+ # __HIMI_APP_NAME__ — from the `professional-services` template
2
+
3
+ A consulting or professional-services firm app over a real Wix site, light with the brand's navy and one bright action blue: a Home that answers a visitor (a photo hero with the free first call, problem-led services, upcoming workshops, case studies, the consultants, testimonials, contact) and a client (Up next — sessions and workshop registrations in one list — the latest chat messages, services and the package); Services — the shared Branded Lite booking flow; Workshops (Wix Events); Community (Wix Groups) with new-post badges and Join in place; Projects (Wix Portfolio) with collections and project facts; Consulting packages (Pricing Plans); Insights, Resources, Coupons, FAQ and About from Profile. Boots as a VISITOR; booking, registering, joining and the chat open Branded Lite's sign-in sheet.
4
+
5
+ Everything here is now yours to edit — screens in `dev/`, logic in `tier5-src/`,
6
+ identity and navigation in `config.ts`, look and feel in `tokens.json`.
7
+
8
+ ## Point at your Wix site
9
+
10
+ Your **Wix Headless `clientId` binds the data** — the visitor token minted from it already
11
+ names your site, so reads need nothing else. Set these before `himi build` / preview so calls
12
+ hit YOUR site (the placeholders are not a real backend):
13
+
14
+ export WIX_CLIENT_ID="<headless-oauth-client-id>"
15
+ export WIX_SITE_URL="https://your-site.wixsite.com/…"
16
+ export WIX_SITE_ID="<metasite-id>"
17
+
18
+ `WIX_SITE_ID` is the site that client belongs to. The member login takes it from the environment
19
+ while `WIX_CLIENT_ID` is the client the config uses. A native build needs it for member sign-up on
20
+ a CAPTCHA-protected site, push registration and in-app purchases.
21
+
22
+ Full details, including how to ship a binary a customer can install against their own
23
+ site: `himi docs branded-lite-site-binding`.
24
+
25
+ ## The loop
26
+
27
+ himi build # compile tier5-src/* -> dist/bundles
28
+ himi validate # screens, bindings and worker boot
29
+ himi render <screenId> --tree # render a screen right here, no device needed
30
+ himi test # exercise every action your screens declare
31
+ himi login --browser --target wix # sign in with your Wix account (once)
32
+ # no browser? export WIX_API_KEY, then himi login --wix --target wix
33
+ himi push --draft # publish a DRAFT release + get preview links
34
+
35
+ Build, validate, render and test run entirely on your machine. Only `login` and
36
+ `push` reach Wix. No per-app install is needed: the CLI ships the `@wix/himalaya`
37
+ runtime it compiles against.
38
+
39
+ ## Pattern index — where to look for each recipe
40
+
41
+ | Pattern | Screens |
42
+ |---|---|
43
+ | One Home for a client and a visitor (sections that collapse fully) | himi_ps_home |
44
+ | A header row drawn in the content, over a photo hero (no top bar) | himi_ps_home |
45
+ | Sessions and workshop registrations merged into one Up next list | himi_ps_home up next |
46
+ | A chat preview card with an unread count and a tap-to-open input row | himi_ps_home messages |
47
+ | A device-local new-posts badge over a feed (no unread API) | himi_ps_community |
48
+ | Join in place from a list, sign-in sheet for a visitor | himi_ps_community |
49
+ | Portfolio collections as chips and project details as fact chips | himi_portfolio, himi_portfolio_project |
50
+ | Reusing a shared screen in your own words (stock-string copy rewrite) | himi_services, himi_events, himi_blog |
51
+ | Your own design over a shared worker | himi_plans, himi_portfolio, himi_account |
52
+ | Member chat with the business (Wix Inbox) | himi_business_chat |
53
+
54
+ Guides: `himi docs recipe-dynamic-list`, `himi docs tier-5-add-a-screen`,
55
+ `himi docs designing-himi-screens`. Seed references: `himi agent-init`.