@wix/himalaya-cli 0.1750.0 → 0.1752.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 (185) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +1 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +3 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +16 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/himi-package.d.ts +478 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/host-compatibility.d.ts +56 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/icon-catalog.generated.d.ts +1 -1
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +4 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +154 -7
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +3 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/index.d.ts +1 -1
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/native-engine.d.ts +49 -3
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/copy.generated.d.ts +16 -1
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/auth/src/feedback.d.ts +1 -1
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +2 -0
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast-service.d.ts +105 -0
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/podcast.d.ts +116 -0
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/auth.mjs +27 -2
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +326 -13
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +757 -83
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +156 -0
  22. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth/worker.mjs +133 -13
  23. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth.mjs +139 -13
  24. package/dist/browser-plane/assets.json +5 -5
  25. package/dist/browser-plane/preview-deferred/{b40ea5d0d6251898ff5617139fde8be008dd11e99a70b14c1052093685401700.bin → 2671d1cadb15daa5e59440f4c924e30c221ab3d405e8a56a0ab1cdbe4764af3d.bin} +1 -1
  26. package/dist/browser-plane/sw.js +7 -7
  27. package/dist/cli.mjs +37219 -33014
  28. package/dist/preview-assets.generated.bin +0 -0
  29. package/guides/app-config.md +1 -1
  30. package/guides/component-reference.json +1 -1
  31. package/guides/component-reference.md +4 -0
  32. package/guides/designing-himi-screens.md +7 -0
  33. package/guides/getting-started.md +2 -0
  34. package/guides/headless-loop.md +1 -1
  35. package/guides/himi-json-output.md +25 -3
  36. package/guides/himi-skill.md +2 -0
  37. package/guides/index.json +6 -0
  38. package/guides/push-cli-onboarding.md +13 -0
  39. package/guides/qa-builds.md +15 -2
  40. package/guides/recipe-podcast.md +149 -0
  41. package/guides/releasing-with-himi-serve.md +51 -0
  42. package/guides/store-submission.md +46 -1
  43. package/guides/tier-5-add-a-screen.md +16 -2
  44. package/guides/wix-business-context.md +29 -0
  45. package/guides/wix-platform-usage.md +7 -2
  46. package/package.json +10 -10
  47. package/template-icons/fitness-gym.png +0 -0
  48. package/templates/beauty-salon/dev/index.ts +1 -1
  49. package/templates/beauty-salon/l10n/en.json +1 -1
  50. package/templates/beauty-salon/tier5-src/_shared/program-fields.ts +16 -0
  51. package/templates/beauty-salon/tier5-src/_shared/programs-section.ts +5 -8
  52. package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  53. package/templates/branded-lite/dev/index.ts +101 -1
  54. package/templates/branded-lite/l10n/en.json +22 -1
  55. package/templates/branded-lite/l10n/es.json +22 -0
  56. package/templates/branded-lite/l10n/fr.json +18 -0
  57. package/templates/branded-lite/l10n/he.json +15 -0
  58. package/templates/branded-lite/tier5-src/_shared/program-fields.ts +16 -0
  59. package/templates/branded-lite/tier5-src/_shared/programs-section.ts +5 -8
  60. package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  61. package/templates/branded-lite/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
  62. package/templates/brandy/README.md +33 -0
  63. package/templates/brandy/config.ts +51 -7
  64. package/templates/brandy/dev/index.ts +23 -9
  65. package/templates/community-club/l10n/en.json +1 -1
  66. package/templates/community-club/tier5-src/_shared/program-fields.ts +16 -0
  67. package/templates/community-club/tier5-src/_shared/programs-section.ts +5 -8
  68. package/templates/events-meetups/l10n/en.json +1 -1
  69. package/templates/events-meetups/tier5-src/_shared/program-fields.ts +16 -0
  70. package/templates/events-meetups/tier5-src/_shared/programs-section.ts +5 -8
  71. package/templates/fitness-gym/README.md +53 -0
  72. package/templates/fitness-gym/config.ts +560 -0
  73. package/templates/fitness-gym/dev/index.ts +25787 -0
  74. package/templates/fitness-gym/himalaya.content.json +64 -0
  75. package/templates/fitness-gym/himalaya.template.json +15 -0
  76. package/templates/fitness-gym/icon.png +0 -0
  77. package/templates/fitness-gym/platforms.json +1 -0
  78. package/templates/fitness-gym/tier5-src/_shared/app-locale.ts +61 -0
  79. package/templates/fitness-gym/tier5-src/_shared/booking-location.ts +147 -0
  80. package/templates/fitness-gym/tier5-src/_shared/booking-session.ts +224 -0
  81. package/templates/fitness-gym/tier5-src/_shared/branded-lite-hosted.ts +280 -0
  82. package/templates/fitness-gym/tier5-src/_shared/branded-load-state.ts +109 -0
  83. package/templates/fitness-gym/tier5-src/_shared/business-chat-copy.ts +40 -0
  84. package/templates/fitness-gym/tier5-src/_shared/business-chat-history.ts +51 -0
  85. package/templates/fitness-gym/tier5-src/_shared/business-chat-message-model.ts +177 -0
  86. package/templates/fitness-gym/tier5-src/_shared/business-chat-model.ts +56 -0
  87. package/templates/fitness-gym/tier5-src/_shared/business-chat-presenter.ts +576 -0
  88. package/templates/fitness-gym/tier5-src/_shared/business-chat-transport.ts +148 -0
  89. package/templates/fitness-gym/tier5-src/_shared/collection-contract.ts +228 -0
  90. package/templates/fitness-gym/tier5-src/_shared/collection-query.ts +193 -0
  91. package/templates/fitness-gym/tier5-src/_shared/collection-service.ts +400 -0
  92. package/templates/fitness-gym/tier5-src/_shared/detail-presence.ts +51 -0
  93. package/templates/fitness-gym/tier5-src/_shared/engine-intl.ts +523 -0
  94. package/templates/fitness-gym/tier5-src/_shared/himi-account.ts +194 -0
  95. package/templates/fitness-gym/tier5-src/_shared/himi-booking-saved.ts +88 -0
  96. package/templates/fitness-gym/tier5-src/_shared/himi-bookings.ts +318 -0
  97. package/templates/fitness-gym/tier5-src/_shared/himi-copy.ts +116 -0
  98. package/templates/fitness-gym/tier5-src/_shared/himi-media.ts +29 -0
  99. package/templates/fitness-gym/tier5-src/_shared/himi-store.ts +7 -0
  100. package/templates/fitness-gym/tier5-src/_shared/himi-text.ts +24 -0
  101. package/templates/fitness-gym/tier5-src/_shared/host-events.ts +66 -0
  102. package/templates/fitness-gym/tier5-src/_shared/hosted-checkout.ts +70 -0
  103. package/templates/fitness-gym/tier5-src/_shared/iap-attendance-form.ts +106 -0
  104. package/templates/fitness-gym/tier5-src/_shared/iap-attendance-purchase.ts +216 -0
  105. package/templates/fitness-gym/tier5-src/_shared/iap-attendance.ts +38 -0
  106. package/templates/fitness-gym/tier5-src/_shared/iap-worker.ts +127 -0
  107. package/templates/fitness-gym/tier5-src/_shared/inbox-rooms.ts +68 -0
  108. package/templates/fitness-gym/tier5-src/_shared/local-preferences.ts +38 -0
  109. package/templates/fitness-gym/tier5-src/_shared/member-access.ts +63 -0
  110. package/templates/fitness-gym/tier5-src/_shared/member-account-routes.ts +52 -0
  111. package/templates/fitness-gym/tier5-src/_shared/member-bookings.ts +107 -0
  112. package/templates/fitness-gym/tier5-src/_shared/member-screen.ts +99 -0
  113. package/templates/fitness-gym/tier5-src/_shared/notification-target.ts +141 -0
  114. package/templates/fitness-gym/tier5-src/_shared/offset-page.ts +10 -0
  115. package/templates/fitness-gym/tier5-src/_shared/online-actions.ts +76 -0
  116. package/templates/fitness-gym/tier5-src/_shared/owner-load-error.ts +348 -0
  117. package/templates/fitness-gym/tier5-src/_shared/payment-setup.ts +6 -0
  118. package/templates/fitness-gym/tier5-src/_shared/pricing-plan-display.ts +64 -0
  119. package/templates/fitness-gym/tier5-src/_shared/program-description.ts +11 -0
  120. package/templates/fitness-gym/tier5-src/_shared/program-fields.ts +16 -0
  121. package/templates/fitness-gym/tier5-src/_shared/program-standing.ts +46 -0
  122. package/templates/fitness-gym/tier5-src/_shared/rich-body.ts +78 -0
  123. package/templates/fitness-gym/tier5-src/_shared/rich-content-link.ts +34 -0
  124. package/templates/fitness-gym/tier5-src/_shared/sign-in-sheet.ts +18 -0
  125. package/templates/fitness-gym/tier5-src/_shared/staff-name.ts +18 -0
  126. package/templates/fitness-gym/tier5-src/_shared/weekly-goal.ts +107 -0
  127. package/templates/fitness-gym/tier5-src/_shared/wix-bi.ts +85 -0
  128. package/templates/fitness-gym/tier5-src/_shared/wix-member-links.ts +114 -0
  129. package/templates/fitness-gym/tier5-src/_shared/wix-service-price.ts +146 -0
  130. package/templates/fitness-gym/tier5-src/business-chat/index.ts +732 -0
  131. package/templates/fitness-gym/tier5-src/business-contact/index.ts +6 -0
  132. package/templates/fitness-gym/tier5-src/himi-booking-account/index.ts +267 -0
  133. package/templates/fitness-gym/tier5-src/himi-booking-bookings/index.ts +468 -0
  134. package/templates/fitness-gym/tier5-src/himi-booking-service/index.ts +1190 -0
  135. package/templates/fitness-gym/tier5-src/himi-booking-services/index.ts +791 -0
  136. package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +1729 -0
  137. package/templates/fitness-gym/tier5-src/himi-branded-lite-agenda/index.ts +988 -0
  138. package/templates/fitness-gym/tier5-src/himi-branded-lite-member-programs/index.ts +656 -0
  139. package/templates/fitness-gym/tier5-src/himi-branded-lite-notifications/index.ts +256 -0
  140. package/templates/fitness-gym/tier5-src/himi-branded-lite-plans/index.ts +495 -0
  141. package/templates/fitness-gym/tier5-src/himi-branded-lite-program/facts.ts +52 -0
  142. package/templates/fitness-gym/tier5-src/himi-branded-lite-program/index.ts +845 -0
  143. package/templates/fitness-gym/tier5-src/himi-fitcoach-goal/index.ts +190 -0
  144. package/templates/fitness-gym/tier5-src/himi-fitcoach-home/index.ts +619 -0
  145. package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +1007 -0
  146. package/templates/fitness-gym/tier5-src/wix-spaces-my-subscriptions/index.ts +84 -0
  147. package/templates/fitness-gym/tier5-src/wix-spaces-subscription-detail/index.ts +139 -0
  148. package/templates/fitness-gym/tokens.json +414 -0
  149. package/templates/gym-fitness/dev/index.ts +1 -1
  150. package/templates/gym-fitness/l10n/en.json +1 -1
  151. package/templates/gym-fitness/tier5-src/_shared/program-fields.ts +16 -0
  152. package/templates/gym-fitness/tier5-src/_shared/programs-section.ts +5 -8
  153. package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  154. package/templates/medical-services/dev/index.ts +2 -1
  155. package/templates/medical-services/tier5-src/himi-booking-account/index.ts +16 -1
  156. package/templates/nonprofit-cause/l10n/en.json +1 -1
  157. package/templates/nonprofit-cause/tier5-src/_shared/program-fields.ts +16 -0
  158. package/templates/nonprofit-cause/tier5-src/_shared/programs-section.ts +5 -8
  159. package/templates/personal-fitness-trainer/dev/index.ts +2 -2
  160. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  161. package/templates/podcast-creator/dev/index.ts +100 -0
  162. package/templates/podcast-creator/l10n/en.json +22 -1
  163. package/templates/podcast-creator/l10n/es.json +22 -0
  164. package/templates/podcast-creator/l10n/fr.json +18 -0
  165. package/templates/podcast-creator/l10n/he.json +15 -0
  166. package/templates/podcast-creator/tier5-src/_shared/program-fields.ts +16 -0
  167. package/templates/podcast-creator/tier5-src/_shared/programs-section.ts +5 -8
  168. package/templates/podcast-creator/tier5-src/himi-branded-lite-podcasts/index.ts +14 -234
  169. package/templates/portfolio-creative/l10n/en.json +1 -1
  170. package/templates/portfolio-creative/tier5-src/_shared/program-fields.ts +16 -0
  171. package/templates/portfolio-creative/tier5-src/_shared/programs-section.ts +5 -8
  172. package/templates/restaurant/l10n/en.json +1 -1
  173. package/templates/restaurant/tier5-src/_shared/program-fields.ts +16 -0
  174. package/templates/restaurant/tier5-src/_shared/programs-section.ts +5 -8
  175. package/templates/retail-store/l10n/en.json +1 -1
  176. package/templates/retail-store/tier5-src/_shared/program-fields.ts +16 -0
  177. package/templates/retail-store/tier5-src/_shared/programs-section.ts +5 -8
  178. package/templates/salon-spa/dev/index.ts +1 -1
  179. package/templates/salon-spa/tier5-src/himi-booking-account/index.ts +16 -1
  180. package/templates/salon-spa/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
  181. package/templates/yoga-studio/dev/index.ts +1 -1
  182. package/templates/yoga-studio/l10n/en.json +1 -1
  183. package/templates/yoga-studio/tier5-src/_shared/program-fields.ts +16 -0
  184. package/templates/yoga-studio/tier5-src/_shared/programs-section.ts +5 -8
  185. package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +37 -4
@@ -305,6 +305,35 @@ Each page becomes one screen that carries two forms (`siteScreens(site)` in `@wi
305
305
 
306
306
  The block is validated with the shell's own rules before it is written. Only a site shell ever receives it: the analysis leaves it out for any other target, and the merge drops it for a shell whose committed contract has no `site`. `--apply` onto a site shell without a `site` block in the overlay is refused (`site_shell_needs_site`), because it would keep the previous website: in the repo, `--shell brandy` would ship the shell's demo site under the customer's brand; off-repo, the package would keep its last site. The one other `site` block is the `--site-pages` one below.
307
307
 
308
+ #### Top-bar icons and native pages
309
+
310
+ Three optional parts of a site shell's `site` block add or trim native chrome with no code. The analysis never writes them, and a re-run keeps them, along with each page's `showTitle`. Page references follow their page by its path when the re-derived map renumbers ids, and one whose page is gone is dropped with a warning. In a content package they live in its `provisioning.json`: edit them there. A re-run reads them from it (an overlay copy that disagrees is replaced, with a warning), and `--apply` keeps them even when it points the package at a new website, such as the template's placeholder. Without a package, the analysis overlay holds them, and analyzing a different website from the same folder leaves them out, since they name the old site's pages and links:
311
+
312
+ ```json
313
+ "topBar": { "actions": [
314
+ { "id": "cart", "icon": "cart", "label": "Cart", "target": { "page": "cart" } },
315
+ { "id": "alerts", "icon": "bell", "label": "Notifications", "target": { "screen": "himi_notification_settings" } },
316
+ { "id": "insta", "icon": "photo", "label": "Instagram", "target": { "url": "https://instagram.com/yourshop" } }
317
+ ] },
318
+ "nativePages": [
319
+ { "id": "rewards", "screenId": "rewards", "title": "Rewards", "icon": "star", "placement": "tab", "after": "home" }
320
+ ]
321
+ ```
322
+
323
+ - **`topBar.actions`**: up to three trailing icons, served app-wide as `navigation.topBarDefault` (`siteTopBarDefault(site)`), so every screen without a top bar of its own shows them. `label` is the icon's accessible name. A `target` is exactly one of:
324
+ - `page`: a site page id of any placement. An `overflow` page has no row but can still be a target, for example the site's cart page.
325
+ - `screen`: a native page's `screenId`, or a native screen the shell serves itself (`himi_notification_settings`, and the Account screen when a member binding is set).
326
+ - `url`: an https page off the site. The icon opens the same "Open in browser?" prompt an off-site link in a site page shows. A URL on the site is refused: declare it as a page instead.
327
+
328
+ A target that is a tab switches to that tab (`himi.tab`). Any other target opens its screen (`himi.open`), and so does every target under the `drawer` and `single` layouts, which have no tab bar. Under `menuSource: "runtime"`, a site page target is always opened rather than switched to, because the site's own menu may move that page out of the tab bar on a later launch. On the page or native screen an icon opens, the bar leaves that icon out, so tapping it cannot push a second copy of it. A native screen that draws a top bar of its own keeps it as the author wrote it. A `url` with a `.` or `..` path segment is refused.
329
+ - **`nativePages`**: the author's own Tier-5 screens as rows. Each one is a `tab`, `drawer` or `overflow` entry (an `overflow` entry is linkable only). They join the tab bar, drawer and rail with the site's pages, after the page named by `after` (default: after all of them, and never before `home`). Tabs count toward the four-tab limit together with the site's tabs. The WebView keep-alive cap only concerns site tabs, because a native tab keeps no WebView. Every native page is in `linkableScreens`. It is private by default: a link from outside the app (a website link, another app) to `<scheme>://screen/<screenId>` opens it only when the page sets `"public": true`. `"requiresAuth": true` implies public and signs the user in first. It needs a sign-in that gates deep links, which today means a Wix member binding. Any other app refuses it, a Base44 site included, rather than open the screen signed out. A native page that places the built-in Notifications or Account screen stays public unless it sets `"public": false`, which turns off outside links to that screen. A public native page opens on its tab when it has one. Under the `drawer`, `single` and one-tab `auto` layouts, where there is no tab to select, the link pushes it instead. Account deletion (`himi_delete_account`) cannot be placed. An id must differ from every site page's id and must not start with `drawer_`. A `screenId` must not start with `site_`.
330
+
331
+ The contract only places a native page. Its descriptor and worker come from the content package's own `dev/index.ts`, which checks that every placed screen is one it builds (`assertSiteNativePagesBuilt`), so `himi build`, `validate`, `render` and `push` refuse a native page whose screen is missing. The shared contract parser and the dist projection cannot see the content, so they check only the shape, the ids and the targets. Both fields survive `himi push` → `himi dist --shell brandy`: the projection keeps them with the rest of the site block, and a top-bar URL must also pass the bake-safe URL rule (https, with no query string).
332
+
333
+ - **`pageTitle`** decides where a site page's screen draws its title in the top bar. `"auto"` (the default) draws none on a page that a tab, rail or drawer row opens, because the row's label already names it. It still draws one on an `overflow` page and on the page a link opens (`site_page`, which shows the page's own document title). `"always"` draws every title, which was the only behaviour before this setting, and `"never"` draws none. Under `menuSource: "runtime"`, `"auto"` keeps every title: the live menu can drop a page's row, so the build cannot know which titles a row repeats. A page's own `showTitle: true | false` wins over the rule. A hidden title is `topBar.titleDisplay: "hidden"` on that screen: nothing is drawn and the space is collapsed, but screen readers still announce the title as the screen's name. Because a screen's own `topBar` replaces `navigation.topBarDefault`, such a screen also carries the `topBar.actions` icons, so they stay on it. Website pages in a native app (`--site-pages`) keep their titles unless the block sets `pageTitle`.
334
+
335
+ A cart badge on a top-bar icon is not supported yet. The site's cart count (the `site.cart` event) reaches only the worker of the page's own screen, not the app-level navigation worker that drives top-bar badges.
336
+
308
337
  ### Pages with no native screen: `--site-pages`
309
338
 
310
339
  Branded Lite renders the site with its own screens, so by default `--apply` adds no website page. `--site-pages` is the opt-in for the site's pages that have no native screen: each one opens the website, as a website page in the drawer.
@@ -17,6 +17,8 @@ served flags and `i18n`, `ping` and `deeplink` always answer from the seam. This
17
17
  2. The worker's descriptor lists `"wix_platform"` in `logic_bundle.declared_capabilities`
18
18
  — otherwise every call fails closed (SDK-import check + native-registry check, RFC 0002
19
19
  invariant 24).
20
+ 3. To translate app copy with `t()` from `@himalaya/l10n`, also list `"l10n"` in
21
+ `declared_capabilities`. Without it, importing `@himalaya/l10n` throws when the worker starts.
20
22
 
21
23
  ## Import + call
22
24
 
@@ -31,7 +33,10 @@ await bi.click("cta_start", "home");
31
33
  const variant = await experiments.conduct("specs.ai", "false"); // → { spec, variant }
32
34
  if (await flags.isEnabled("specs.newCheckout")) { /* … */ }
33
35
 
34
- // i18n
36
+ // i18n: the platform locale seam. For your app's own copy, use `t()` from `@himalaya/l10n`
37
+ // instead; it is synchronous and its catalog is resident in every worker (iOS, macOS, Android, web).
38
+ // It needs the `l10n` capability (see Prerequisites):
39
+ // import { t } from "@himalaya/l10n"; const title = t("home.title");
35
40
  const label = await i18n.t("home.title", "Your agents");
36
41
 
37
42
  // auth / identity
@@ -52,7 +57,7 @@ await monitoring.captureError("thing failed", { code: "E1" });
52
57
  | `bi` | `track(evid, params?)`, `pageView(name)`, `click(name, page?)`, `log(v2Event)` ([below](#bilog--a-typed-wix-bi-logger-v2-event)) |
53
58
  | `experiments` | `conduct(spec, fallback?)`, `isEnabled(spec)`, `exposure(spec, variant)` |
54
59
  | `flags` | `isEnabled(spec, fallback?)`, `value(spec, fallback?)`, `all()` |
55
- | `i18n` | `t(key, fallback?)`, `locale()` |
60
+ | `i18n` | `t(key, fallback?)`, `locale()`. For app copy, prefer the synchronous `t()` from `@himalaya/l10n` |
56
61
  | `ping` | `register()`, `status()` |
57
62
  | `deeplink` | `resolveDeferred()` |
58
63
  | `session` | `headers()`, `signedInstanceStatus()` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1750.0",
3
+ "version": "0.1752.0",
4
4
  "type": "module",
5
5
  "description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
6
6
  "keywords": [
@@ -62,14 +62,14 @@
62
62
  "@anthropic-ai/mcpb": "2.1.2",
63
63
  "@himalaya/data-resources": "0.0.0",
64
64
  "@types/wawoff2": "^1.0.2",
65
- "@wix/asc": "0.4.14",
66
- "@wix/asc-api": "0.4.14",
67
- "@wix/asc-core": "0.4.14",
68
- "@wix/asc-jobs": "0.4.14",
69
- "@wix/asc-mcp": "0.4.14",
70
- "@wix/asc-web": "0.4.14",
71
- "@wix/gplay-api": "0.4.14",
72
- "@wix/gplay-jobs": "0.4.14",
65
+ "@wix/asc": "0.4.15",
66
+ "@wix/asc-api": "0.4.15",
67
+ "@wix/asc-core": "0.4.15",
68
+ "@wix/asc-jobs": "0.4.15",
69
+ "@wix/asc-mcp": "0.4.15",
70
+ "@wix/asc-web": "0.4.15",
71
+ "@wix/gplay-api": "0.4.15",
72
+ "@wix/gplay-jobs": "0.4.15",
73
73
  "@wix/himalaya": "0.1.0"
74
74
  },
75
75
  "publishConfig": {
@@ -82,5 +82,5 @@
82
82
  "artifactId": "himalaya-cli"
83
83
  }
84
84
  },
85
- "falconPackageHash": "937360c400b7b452f72da763e3889ea0e056e4a16fd58b49442d4ee1"
85
+ "falconPackageHash": "88829bcebae37fdbdc23997d9a9a3e45022b83d12c70aaed01b8dc27"
86
86
  }
Binary file
@@ -25168,7 +25168,7 @@ const SCREENS = runtimeSetting({
25168
25168
  }
25169
25169
  },
25170
25170
  "modifiers": {
25171
- "width": 64
25171
+ "width": 80
25172
25172
  }
25173
25173
  },
25174
25174
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$source": "en",
3
- "$generated": "2026-11-15T09:24:42.792Z",
3
+ "$generated": "2026-11-17T08:26:59.985Z",
4
4
  "messages": {
5
5
  "h_0028d743eb44": {
6
6
  "source": "Sale",
@@ -0,0 +1,16 @@
1
+ // How a worker reads an Online Program's lifecycle and name. Wix returns them in more than one
2
+ // shape (v3 `status` or `state`; `description.title`, `settings.title`, a flat `title` or
3
+ // `details.title`), so every screen that lists programs reads them here, the same way.
4
+ import type { WixProgram } from "@himalaya/wix-online-programs";
5
+ import { cleanTitle } from "./himi-text.js";
6
+
7
+ export function programStatus(p: WixProgram): string {
8
+ return (p.status ?? p.state ?? "").toUpperCase();
9
+ }
10
+ export const isProgramEnded = (p: WixProgram): boolean => programStatus(p) === "ENDED" || programStatus(p) === "FINISHED";
11
+ export const isProgramDraft = (p: WixProgram): boolean => programStatus(p) === "DRAFT";
12
+
13
+ /** The program's own name, cleaned; "" when it has none (the caller picks its own fallback word). */
14
+ export function programName(p: WixProgram): string {
15
+ return cleanTitle(p.description?.title ?? p.settings?.title ?? p.title ?? p.details?.title);
16
+ }
@@ -22,7 +22,8 @@ import { iapPriceFields, onlineProgramItem, type IapPollDirective } from "@himal
22
22
  import { createIapCommerce } from "@himalaya/iap-checkout";
23
23
  import { createCollectionQuery, type CollectionPage, type CollectionQueryState } from "./collection-query.js";
24
24
  import { memberAccess, memberAccessChanged, memberAccessDenied, type MemberAccess } from "./member-access.js";
25
- import { cleanTitle, initials } from "./himi-text.js";
25
+ import { initials } from "./himi-text.js";
26
+ import { isProgramDraft, isProgramEnded, programName } from "./program-fields.js";
26
27
  import { programImage } from "./himi-media.js";
27
28
  import { descriptionBody } from "./rich-body.js";
28
29
  import { programDescription } from "./program-description.js";
@@ -125,19 +126,15 @@ export interface State {
125
126
  const full = (p: WixProgram): WixProgramFull => p as WixProgramFull;
126
127
 
127
128
  function programTitle(p: WixProgram): string {
128
- return cleanTitle(p.description?.title ?? p.settings?.title ?? p.title ?? p.details?.title)
129
- || copyParam("memberPrograms.programFallbackName", "Program");
129
+ return programName(p) || copyParam("memberPrograms.programFallbackName", "Program");
130
130
  }
131
131
  function programDetails(p: WixProgram): string {
132
132
  // The body may be a Ricos document or serialized text: read it the way the catalog and detail do.
133
133
  const raw = descriptionBody(programDescription(p)).bodyText.replace(/\s+/g, " ").trim();
134
134
  return raw.length > 140 ? `${raw.slice(0, 139).trimEnd()}…` : raw;
135
135
  }
136
- function programStatus(p: WixProgram): string {
137
- return (p.status ?? p.state ?? "").toUpperCase();
138
- }
139
- const isEnded = (p: WixProgram) => programStatus(p) === "ENDED" || programStatus(p) === "FINISHED";
140
- const isDraft = (p: WixProgram) => programStatus(p) === "DRAFT";
136
+ const isEnded = isProgramEnded;
137
+ const isDraft = isProgramDraft;
141
138
  function accessType(p: WixProgram): string {
142
139
  return (full(p).restrictions?.accessType ?? "PUBLIC").toUpperCase();
143
140
  }
@@ -126,6 +126,14 @@ interface S extends LoadFlags {
126
126
  /** A location is chosen and has no session in the loaded days: its own empty state. */
127
127
  locationEmpty: boolean;
128
128
  notLocationEmpty: boolean;
129
+ /** The optional "All · Booked" filter, for an app that asks for it (`load` param `filters: "1"`):
130
+ * "booked" lists only the member's own sessions (booked or on the waitlist). Off by default, so
131
+ * an app that does not bind it lists every session, as before. */
132
+ filter?: "all" | "booked";
133
+ hideFilter?: boolean;
134
+ /** The booked filter is on and the member has no session in the loaded days. */
135
+ bookedEmpty?: boolean;
136
+ notBookedEmpty?: boolean;
129
137
  }
130
138
 
131
139
  const flag = (on: boolean): string => (on ? "true" : "");
@@ -300,6 +308,10 @@ let quietUntil = 0;
300
308
  * it. Cleared by the list's own scroll and a calendar tap, whose plain day the renderer compares
301
309
  * with what it reported (an echo of the member's own scroll never moves the list). */
302
310
  let scrollNonce = 0;
311
+ /** The "All · Booked" filter: offered when the screen's load asks for it, and the member's choice. */
312
+ let filtersOn = false;
313
+ /** The member the "Booked" choice was made by: another member (or a sign-out) opens on "All". */
314
+ let bookedFilterFor = "";
303
315
  let busy = false;
304
316
  /** An Add to Calendar flow is running (a permission prompt, a save, the calendar page). Its own
305
317
  * flag, not `busy`: the session sheet must still close while it runs. */
@@ -428,14 +440,22 @@ function derive(s: S): S {
428
440
  // From today on (the loaded days never start before it), at the chosen location. The list is
429
441
  // one run of days: a tap on the calendar SCROLLS it to a day, and scrolling it moves the
430
442
  // selection, so it never starts at the selected day (the days above it would vanish).
431
- const shown = sessions.filter((x) => x.day >= s.today && (!locationKey || x.locationKey === locationKey));
443
+ const bookedOnly = filtersOn && !!member?.email && bookedFilterFor === member.email;
444
+ const mine = (x: Session) => { const p = places.get(x.key)?.place; return p === "booked" || p === "waitlisted"; };
445
+ const shown = sessions.filter((x) => x.day >= s.today && (!locationKey || x.locationKey === locationKey) && (!bookedOnly || mine(x)));
432
446
  const events = rowsOk === false ? [] : shown.map((x, i) => eventOf(x, places.get(x.key), shown[i + 1]?.day !== x.day));
433
447
  const sheet = sessions.find((x) => x.key === sheetKey);
434
448
  const sheetPlace = sheet ? places.get(sheet.key)?.place ?? "" : "";
435
449
  const loaded = s.status === "ready" && rowsOk !== false && !!services;
436
- const locationEmpty = loaded && !!locationKey && shown.length === 0;
450
+ const locationEmpty = loaded && !!locationKey && shown.length === 0 && !bookedOnly;
451
+ const bookedEmpty = loaded && bookedOnly && shown.length === 0;
437
452
  return {
438
453
  ...s,
454
+ filter: bookedOnly ? "booked" : "all",
455
+ // A visitor has no sessions of their own: the filter shows only to a signed-in member.
456
+ hideFilter: !filtersOn || !member?.email,
457
+ bookedEmpty,
458
+ notBookedEmpty: !bookedEmpty,
439
459
  ...locationMenu(choices, chosenLocation.id),
440
460
  locationSheetOpen: locationSheet,
441
461
  locationEmpty,
@@ -449,7 +469,7 @@ function derive(s: S): S {
449
469
  signedIn: !!member?.email,
450
470
  updateRequired: rowsOk === false,
451
471
  listHidden: s.busy === true || rowsOk === false || events.length === 0,
452
- ...emptyFlags(loaded && services!.length === 0, loaded && services!.length > 0 && events.length === 0 && !locationEmpty),
472
+ ...emptyFlags(loaded && services!.length === 0, loaded && services!.length > 0 && events.length === 0 && !locationEmpty && !bookedEmpty),
453
473
  sheetOpen: !!sheet && !!sheetPlace,
454
474
  sheetTitle: sheet?.title ?? "",
455
475
  sheetWhen: sheet ? joined(dayLabel(sheet.start, { absolute: true }), timeLabel(sheet.start), lengthLabel(sheet.start, sheet.end)) : "",
@@ -630,6 +650,7 @@ function initial(): S {
630
650
  sheetOpen: false, sheetTitle: "", sheetWhen: "", sheetMeta: "", sheetHideCalendar: true, sheetHideCancel: true, sheetHideLeave: true, sheetBusy: false, sheetServiceId: "", sheetSessionId: "", sheetStart: "",
631
651
  locationOptions: [], locationLabel: "", locationA11y: "", hasLocationMenu: false, noLocationMenu: true,
632
652
  locationActive: false, noLocationActive: true, locationSheetOpen: false, locationEmpty: false, notLocationEmpty: true,
653
+ filter: "all", hideFilter: true, bookedEmpty: false, notBookedEmpty: true,
633
654
  };
634
655
  }
635
656
 
@@ -673,10 +694,13 @@ const svc = defineService<S, {
673
694
  openLocations: (s: S) => S;
674
695
  closeLocations: (s: S) => S;
675
696
  selectLocation: (s: S, p?: unknown) => Promise<S | undefined>;
697
+ setFilter: (s: S, p?: unknown) => S;
676
698
  }>("himiBrandedAgenda", {
677
699
  // An action's result belongs to that visit: a cold start must not replay it from saved state,
678
700
  // nor reopen the location sheet.
679
- notHydrated: ["resultOpen", "resultOpenB", "resultText", "resultOk", "resultInfo", "locationSheetOpen"],
701
+ notHydrated: ["resultOpen", "resultOpenB", "resultText", "resultOk", "resultInfo", "locationSheetOpen", "filter", "hideFilter", "bookedEmpty", "notBookedEmpty"],
702
+ // The optional Booked filter is the member's choice for this run: never written to the device.
703
+ notPersisted: ["filter", "hideFilter", "bookedEmpty", "notBookedEmpty"],
680
704
  state: initial(),
681
705
  actions: {
682
706
  load: async (s, p) => {
@@ -688,6 +712,7 @@ const svc = defineService<S, {
688
712
  }
689
713
  const signInScreen = argOf(p, "signInScreenId");
690
714
  if (/^[a-z][a-z0-9_]{0,63}$/.test(signInScreen)) signInScreenId = signInScreen;
715
+ if (argOf(p, "filters") === "1") filtersOn = true;
691
716
  const fw = Number(argOf(p, "firstWeekday") || s.firstWeekday);
692
717
  const today = dayKey(new Date());
693
718
  // First appearance: open on this week. A re-appearance keeps the member's place and
@@ -932,6 +957,14 @@ const svc = defineService<S, {
932
957
  locationSheet = true;
933
958
  return derive({ ...s, ...wanted });
934
959
  },
960
+ // The "All · Booked" filter (a segmented control's id, or `{ id }`). A list of the member's own
961
+ // sessions, from the same loaded days; the calendar's dots follow it.
962
+ setFilter: (s, p) => {
963
+ const id = typeof p === "string" ? p : argOf(p, "id") || argOf(p, "value") || argOf(p, "selectedId");
964
+ if (id !== "all" && id !== "booked") return s;
965
+ bookedFilterFor = id === "booked" ? member?.email ?? "" : "";
966
+ return derive({ ...s, ...wanted });
967
+ },
935
968
  closeLocations: (s) => {
936
969
  if (!locationSheet) return s;
937
970
  locationSheet = false;
@@ -26781,7 +26781,7 @@ const SCREENS = runtimeSetting({
26781
26781
  }
26782
26782
  },
26783
26783
  "modifiers": {
26784
- "width": 64
26784
+ "width": 80
26785
26785
  }
26786
26786
  },
26787
26787
  {
@@ -84941,6 +84941,41 @@ const SCREENS = runtimeSetting({
84941
84941
  "props": {
84942
84942
  "spacing": 8,
84943
84943
  "children": [
84944
+ {
84945
+ "id": "himi_podcasts.mini_player_previous",
84946
+ "body": {
84947
+ "package": "himalaya",
84948
+ "type": "Button",
84949
+ "props": {
84950
+ "title": "Previous",
84951
+ "leadingIcon": "skip_previous",
84952
+ "iconOnly": true,
84953
+ "style": "plain",
84954
+ "action": {
84955
+ "actionId": "tier5.himiBrandedPodcasts.previousEpisode"
84956
+ }
84957
+ }
84958
+ }
84959
+ },
84960
+ {
84961
+ "id": "himi_podcasts.mini_player_back",
84962
+ "body": {
84963
+ "package": "himalaya",
84964
+ "type": "Button",
84965
+ "props": {
84966
+ "title": "Back 15 seconds",
84967
+ "leadingIcon": "undo",
84968
+ "iconOnly": true,
84969
+ "style": "plain",
84970
+ "action": {
84971
+ "actionId": "tier5.himiBrandedPodcasts.seekBy",
84972
+ "params": {
84973
+ "deltaMs": "-15000"
84974
+ }
84975
+ }
84976
+ }
84977
+ }
84978
+ },
84944
84979
  {
84945
84980
  "id": "himi_podcasts.mini_player_toggle",
84946
84981
  "body": {
@@ -84956,6 +84991,25 @@ const SCREENS = runtimeSetting({
84956
84991
  }
84957
84992
  }
84958
84993
  },
84994
+ {
84995
+ "id": "himi_podcasts.mini_player_forward",
84996
+ "body": {
84997
+ "package": "himalaya",
84998
+ "type": "Button",
84999
+ "props": {
85000
+ "title": "Forward 30 seconds",
85001
+ "leadingIcon": "refresh",
85002
+ "iconOnly": true,
85003
+ "style": "plain",
85004
+ "action": {
85005
+ "actionId": "tier5.himiBrandedPodcasts.seekBy",
85006
+ "params": {
85007
+ "deltaMs": "30000"
85008
+ }
85009
+ }
85010
+ }
85011
+ }
85012
+ },
84959
85013
  {
84960
85014
  "id": "himi_podcasts.mini_player_next",
84961
85015
  "body": {
@@ -84975,6 +85029,52 @@ const SCREENS = runtimeSetting({
84975
85029
  }
84976
85030
  }
84977
85031
  },
85032
+ {
85033
+ "id": "himi_podcasts.playback_error",
85034
+ "body": {
85035
+ "package": "himalaya",
85036
+ "type": "VStack",
85037
+ "props": {
85038
+ "spacing": 6,
85039
+ "alignment": "leading",
85040
+ "children": [
85041
+ {
85042
+ "id": "",
85043
+ "body": {
85044
+ "package": "himalaya",
85045
+ "type": "Text",
85046
+ "props": {
85047
+ "text": "$service:himiBrandedPodcasts.playbackErrorText",
85048
+ "style": "footnote",
85049
+ "color": "danger",
85050
+ "collapseWhenEmpty": true
85051
+ }
85052
+ }
85053
+ },
85054
+ {
85055
+ "id": "himi_podcasts.playback_retry",
85056
+ "body": {
85057
+ "package": "himalaya",
85058
+ "type": "Button",
85059
+ "props": {
85060
+ "title": "Try again",
85061
+ "style": "secondary",
85062
+ "action": {
85063
+ "actionId": "tier5.himiBrandedPodcasts.retryPlayback"
85064
+ }
85065
+ }
85066
+ },
85067
+ "modifiers": {
85068
+ "hiddenPath": "$service:himiBrandedPodcasts.hidePlaybackRetry"
85069
+ }
85070
+ }
85071
+ ]
85072
+ }
85073
+ },
85074
+ "modifiers": {
85075
+ "hiddenPath": "$service:himiBrandedPodcasts.hidePlaybackError"
85076
+ }
85077
+ },
84978
85078
  {
84979
85079
  "id": "himi_podcasts.mini_player_progress",
84980
85080
  "body": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$source": "en",
3
- "$generated": "2026-11-15T09:24:42.792Z",
3
+ "$generated": "2026-11-17T08:26:59.985Z",
4
4
  "messages": {
5
5
  "h_00234c88e324": {
6
6
  "source": "This site's galleries couldn't be loaded.",
@@ -865,6 +865,13 @@
865
865
  "key": "inbox.unavailableBody",
866
866
  "keyOrigin": "string-table"
867
867
  },
868
+ "h_30668dc2c5d0": {
869
+ "source": "Forward 30 seconds",
870
+ "kind": "Button.title",
871
+ "translation": "",
872
+ "key": "podcasts.seekForwardCta",
873
+ "keyOrigin": "string-table"
874
+ },
868
875
  "h_308922d5c12d": {
869
876
  "source": "We show the bookings made with your email.",
870
877
  "kind": "EmptyState.subtitle",
@@ -1430,6 +1437,13 @@
1430
1437
  "key": "steps.connectCta",
1431
1438
  "keyOrigin": "string-table"
1432
1439
  },
1440
+ "h_50f94286ba30": {
1441
+ "source": "Previous",
1442
+ "kind": "Button.title",
1443
+ "translation": "",
1444
+ "key": "podcasts.previousCta",
1445
+ "keyOrigin": "string-table"
1446
+ },
1433
1447
  "h_511ad20c03e6": {
1434
1448
  "source": "This form is no longer available.",
1435
1449
  "kind": "Text.text",
@@ -1791,6 +1805,13 @@
1791
1805
  "key": "plans.errorTitle",
1792
1806
  "keyOrigin": "string-table"
1793
1807
  },
1808
+ "h_6a20b2e95b10": {
1809
+ "source": "Back 15 seconds",
1810
+ "kind": "Button.title",
1811
+ "translation": "",
1812
+ "key": "podcasts.seekBackCta",
1813
+ "keyOrigin": "string-table"
1814
+ },
1794
1815
  "h_6a72085653e4": {
1795
1816
  "source": "All",
1796
1817
  "kind": "atom.label",
@@ -32,6 +32,24 @@
32
32
  "key": "program.cancelRequestFailedMessage",
33
33
  "translation": "No se ha podido cancelar la solicitud. Inténtalo de nuevo."
34
34
  },
35
+ "h_30668dc2c5d0": {
36
+ "source": "Forward 30 seconds",
37
+ "key": "podcasts.seekForwardCta",
38
+ "translation": "Avanzar 30 segundos",
39
+ "origin": "machine"
40
+ },
41
+ "h_50f94286ba30": {
42
+ "source": "Previous",
43
+ "key": "podcasts.previousCta",
44
+ "translation": "Anterior",
45
+ "origin": "machine"
46
+ },
47
+ "h_6a20b2e95b10": {
48
+ "source": "Back 15 seconds",
49
+ "key": "podcasts.seekBackCta",
50
+ "translation": "Retroceder 15 segundos",
51
+ "origin": "machine"
52
+ },
35
53
  "h_0d049cb0b019": {
36
54
  "source": "This site is not accepting online payments. Go back or contact the business for other payment options.",
37
55
  "translation": "Este sitio no acepta pagos en línea. Vuelve atrás o contacta con el negocio para consultar otras opciones de pago."
@@ -43,6 +61,10 @@
43
61
  "h_17e8af827ec8": {
44
62
  "source": "Select {option}",
45
63
  "translation": "Selecciona {option}"
64
+ },
65
+ "h_5d12bd53552c": {
66
+ "source": "Play",
67
+ "translation": "Reproducir"
46
68
  }
47
69
  }
48
70
  }
@@ -4124,6 +4124,24 @@
4124
4124
  "translation": "Rechercher des documents",
4125
4125
  "origin": "machine"
4126
4126
  },
4127
+ "h_30668dc2c5d0": {
4128
+ "source": "Forward 30 seconds",
4129
+ "key": "podcasts.seekForwardCta",
4130
+ "translation": "Avancer de 30 secondes",
4131
+ "origin": "machine"
4132
+ },
4133
+ "h_50f94286ba30": {
4134
+ "source": "Previous",
4135
+ "key": "podcasts.previousCta",
4136
+ "translation": "Précédent",
4137
+ "origin": "machine"
4138
+ },
4139
+ "h_6a20b2e95b10": {
4140
+ "source": "Back 15 seconds",
4141
+ "key": "podcasts.seekBackCta",
4142
+ "translation": "Reculer de 15 secondes",
4143
+ "origin": "machine"
4144
+ },
4127
4145
  "h_03e89418ffdf": {
4128
4146
  "source": "Your Home",
4129
4147
  "translation": "Votre accueil",
@@ -3465,6 +3465,21 @@
3465
3465
  "key": "fileShare.searchPlaceholder",
3466
3466
  "translation": "חיפוש מסמכים"
3467
3467
  },
3468
+ "h_30668dc2c5d0": {
3469
+ "source": "Forward 30 seconds",
3470
+ "key": "podcasts.seekForwardCta",
3471
+ "translation": "קדימה 30 שניות"
3472
+ },
3473
+ "h_50f94286ba30": {
3474
+ "source": "Previous",
3475
+ "key": "podcasts.previousCta",
3476
+ "translation": "הקודם"
3477
+ },
3478
+ "h_6a20b2e95b10": {
3479
+ "source": "Back 15 seconds",
3480
+ "key": "podcasts.seekBackCta",
3481
+ "translation": "אחורה 15 שניות"
3482
+ },
3468
3483
  "h_03e89418ffdf": {
3469
3484
  "source": "Your Home",
3470
3485
  "translation": "הבית שלך"
@@ -0,0 +1,16 @@
1
+ // How a worker reads an Online Program's lifecycle and name. Wix returns them in more than one
2
+ // shape (v3 `status` or `state`; `description.title`, `settings.title`, a flat `title` or
3
+ // `details.title`), so every screen that lists programs reads them here, the same way.
4
+ import type { WixProgram } from "@himalaya/wix-online-programs";
5
+ import { cleanTitle } from "./himi-text.js";
6
+
7
+ export function programStatus(p: WixProgram): string {
8
+ return (p.status ?? p.state ?? "").toUpperCase();
9
+ }
10
+ export const isProgramEnded = (p: WixProgram): boolean => programStatus(p) === "ENDED" || programStatus(p) === "FINISHED";
11
+ export const isProgramDraft = (p: WixProgram): boolean => programStatus(p) === "DRAFT";
12
+
13
+ /** The program's own name, cleaned; "" when it has none (the caller picks its own fallback word). */
14
+ export function programName(p: WixProgram): string {
15
+ return cleanTitle(p.description?.title ?? p.settings?.title ?? p.title ?? p.details?.title);
16
+ }
@@ -22,7 +22,8 @@ import { iapPriceFields, onlineProgramItem, type IapPollDirective } from "@himal
22
22
  import { createIapCommerce } from "@himalaya/iap-checkout";
23
23
  import { createCollectionQuery, type CollectionPage, type CollectionQueryState } from "./collection-query.js";
24
24
  import { memberAccess, memberAccessChanged, memberAccessDenied, type MemberAccess } from "./member-access.js";
25
- import { cleanTitle, initials } from "./himi-text.js";
25
+ import { initials } from "./himi-text.js";
26
+ import { isProgramDraft, isProgramEnded, programName } from "./program-fields.js";
26
27
  import { programImage } from "./himi-media.js";
27
28
  import { descriptionBody } from "./rich-body.js";
28
29
  import { programDescription } from "./program-description.js";
@@ -125,19 +126,15 @@ export interface State {
125
126
  const full = (p: WixProgram): WixProgramFull => p as WixProgramFull;
126
127
 
127
128
  function programTitle(p: WixProgram): string {
128
- return cleanTitle(p.description?.title ?? p.settings?.title ?? p.title ?? p.details?.title)
129
- || copyParam("memberPrograms.programFallbackName", "Program");
129
+ return programName(p) || copyParam("memberPrograms.programFallbackName", "Program");
130
130
  }
131
131
  function programDetails(p: WixProgram): string {
132
132
  // The body may be a Ricos document or serialized text: read it the way the catalog and detail do.
133
133
  const raw = descriptionBody(programDescription(p)).bodyText.replace(/\s+/g, " ").trim();
134
134
  return raw.length > 140 ? `${raw.slice(0, 139).trimEnd()}…` : raw;
135
135
  }
136
- function programStatus(p: WixProgram): string {
137
- return (p.status ?? p.state ?? "").toUpperCase();
138
- }
139
- const isEnded = (p: WixProgram) => programStatus(p) === "ENDED" || programStatus(p) === "FINISHED";
140
- const isDraft = (p: WixProgram) => programStatus(p) === "DRAFT";
136
+ const isEnded = isProgramEnded;
137
+ const isDraft = isProgramDraft;
141
138
  function accessType(p: WixProgram): string {
142
139
  return (full(p).restrictions?.accessType ?? "PUBLIC").toUpperCase();
143
140
  }