@wix/himalaya-cli 0.1662.0 → 0.1664.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 (87) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +6 -2
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +6 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +3 -2
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +3 -2
  5. package/dist/browser-plane/assets.json +5 -5
  6. package/dist/browser-plane/preview-deferred/{5fe817d61d13666ee8e6951d96a873f768ef305462735f6030cce105f1c21488.bin → 7700021a25a8d932331f2abf6ba6c2f13b2a18cabfc4ce8b02aa0ed1ae973ffc.bin} +1 -1
  7. package/dist/browser-plane/sw.js +8 -8
  8. package/dist/cli.mjs +308 -92
  9. package/dist/preview-assets.generated.bin +0 -0
  10. package/fixtures/wix-canned.json +3 -0
  11. package/guides/component-reference.json +1 -1
  12. package/guides/component-reference.md +1 -0
  13. package/guides/one-app-section-mappings.md +3 -4
  14. package/guides/one-app-to-himi-app.md +20 -1
  15. package/package.json +2 -2
  16. package/templates/beauty-salon/config.ts +1 -1
  17. package/templates/beauty-salon/l10n/en.json +1 -1
  18. package/templates/beauty-salon/recipes/announcement-card.json +72 -0
  19. package/templates/beauty-salon/tier5-src/_shared/announcement-section.ts +122 -0
  20. package/templates/beauty-salon/tier5-src/_shared/engine-intl.ts +3 -4
  21. package/templates/beauty-salon-owner/tier5-src/_shared/engine-intl.ts +3 -4
  22. package/templates/branded-lite/config.ts +1 -1
  23. package/templates/branded-lite/dev/index.ts +214 -122
  24. package/templates/branded-lite/l10n/en.json +18 -25
  25. package/templates/branded-lite/l10n/he.json +22 -17
  26. package/templates/branded-lite/recipes/announcement-card.json +72 -0
  27. package/templates/branded-lite/tier5-src/_shared/announcement-section.ts +122 -0
  28. package/templates/branded-lite/tier5-src/_shared/engine-intl.ts +3 -4
  29. package/templates/branded-lite/tier5-src/wix-spaces-member-detail/index.ts +144 -75
  30. package/templates/community-club/config.ts +1 -1
  31. package/templates/community-club/l10n/en.json +1 -1
  32. package/templates/community-club/recipes/announcement-card.json +72 -0
  33. package/templates/community-club/tier5-src/_shared/announcement-section.ts +122 -0
  34. package/templates/community-club/tier5-src/_shared/engine-intl.ts +3 -4
  35. package/templates/community-club-owner/tier5-src/_shared/engine-intl.ts +3 -4
  36. package/templates/conference/tier5-src/_shared/engine-intl.ts +3 -4
  37. package/templates/events-meetups/config.ts +1 -1
  38. package/templates/events-meetups/l10n/en.json +1 -1
  39. package/templates/events-meetups/recipes/announcement-card.json +72 -0
  40. package/templates/events-meetups/tier5-src/_shared/announcement-section.ts +122 -0
  41. package/templates/events-meetups/tier5-src/_shared/engine-intl.ts +3 -4
  42. package/templates/events-meetups-owner/tier5-src/_shared/engine-intl.ts +3 -4
  43. package/templates/gym-fitness/config.ts +1 -1
  44. package/templates/gym-fitness/l10n/en.json +1 -1
  45. package/templates/gym-fitness/recipes/announcement-card.json +72 -0
  46. package/templates/gym-fitness/tier5-src/_shared/announcement-section.ts +122 -0
  47. package/templates/gym-fitness/tier5-src/_shared/engine-intl.ts +3 -4
  48. package/templates/gym-fitness-owner/tier5-src/_shared/engine-intl.ts +3 -4
  49. package/templates/nonprofit-cause/config.ts +1 -1
  50. package/templates/nonprofit-cause/l10n/en.json +1 -1
  51. package/templates/nonprofit-cause/recipes/announcement-card.json +72 -0
  52. package/templates/nonprofit-cause/tier5-src/_shared/announcement-section.ts +122 -0
  53. package/templates/nonprofit-cause/tier5-src/_shared/engine-intl.ts +3 -4
  54. package/templates/nonprofit-cause-owner/tier5-src/_shared/engine-intl.ts +3 -4
  55. package/templates/owner-lite/tier5-src/_shared/engine-intl.ts +3 -4
  56. package/templates/podcast-creator/config.ts +1 -1
  57. package/templates/podcast-creator/l10n/en.json +1 -1
  58. package/templates/podcast-creator/recipes/announcement-card.json +72 -0
  59. package/templates/podcast-creator/tier5-src/_shared/announcement-section.ts +122 -0
  60. package/templates/podcast-creator/tier5-src/_shared/engine-intl.ts +3 -4
  61. package/templates/podcast-creator-owner/tier5-src/_shared/engine-intl.ts +3 -4
  62. package/templates/portfolio-creative/config.ts +1 -1
  63. package/templates/portfolio-creative/l10n/en.json +1 -1
  64. package/templates/portfolio-creative/recipes/announcement-card.json +72 -0
  65. package/templates/portfolio-creative/tier5-src/_shared/announcement-section.ts +122 -0
  66. package/templates/portfolio-creative/tier5-src/_shared/engine-intl.ts +3 -4
  67. package/templates/portfolio-creative-owner/tier5-src/_shared/engine-intl.ts +3 -4
  68. package/templates/restaurant/config.ts +1 -1
  69. package/templates/restaurant/l10n/en.json +1 -1
  70. package/templates/restaurant/recipes/announcement-card.json +72 -0
  71. package/templates/restaurant/tier5-src/_shared/announcement-section.ts +122 -0
  72. package/templates/restaurant/tier5-src/_shared/engine-intl.ts +3 -4
  73. package/templates/restaurant-owner/tier5-src/_shared/engine-intl.ts +3 -4
  74. package/templates/retail-store/config.ts +1 -1
  75. package/templates/retail-store/l10n/en.json +1 -1
  76. package/templates/retail-store/recipes/announcement-card.json +72 -0
  77. package/templates/retail-store/tier5-src/_shared/announcement-section.ts +122 -0
  78. package/templates/retail-store/tier5-src/_shared/engine-intl.ts +3 -4
  79. package/templates/retail-store-owner/tier5-src/_shared/engine-intl.ts +3 -4
  80. package/templates/salon-spa/tier5-src/_shared/engine-intl.ts +3 -4
  81. package/templates/wholesale-store/tier5-src/_shared/engine-intl.ts +3 -4
  82. package/templates/yoga-studio/config.ts +1 -1
  83. package/templates/yoga-studio/l10n/en.json +1 -1
  84. package/templates/yoga-studio/recipes/announcement-card.json +72 -0
  85. package/templates/yoga-studio/tier5-src/_shared/announcement-section.ts +122 -0
  86. package/templates/yoga-studio/tier5-src/_shared/engine-intl.ts +3 -4
  87. package/templates/yoga-studio-owner/tier5-src/_shared/engine-intl.ts +3 -4
Binary file
@@ -1632,6 +1632,9 @@
1632
1632
  "total": 2
1633
1633
  }
1634
1634
  },
1635
+ "POST /members/v2/abouts/query": { "memberAbouts": [] },
1636
+ "GET /members/v3/badges": { "badges": [] },
1637
+ "POST /members/v3/badges/members": { "memberBadgeIds": [] },
1635
1638
  "GET /members/v1/members/mem-0001": {
1636
1639
  "member": {
1637
1640
  "id": "mem-0001",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_comment": "GENERATED by core/web-embed/authoring/gen-reference.mjs from core/ts/src/schema.ts — do not hand-edit. The schema is the source of truth; regenerate on schema changes.",
3
3
  "schemaSource": "core/ts/src/schema.ts",
4
- "bindingGrammar": "$service:<service>.<path> (worker state) · $item.<field> (list row) · $flag:<key> (feature flag) · $env:<key> (client environment — #1056). Bindings resolve in the text/value props marked 'binding-aware' below — INCLUDING Modifiers token refs — but only `background` and `border.color`, which are the two whose token a binding actually fills: a worker can drive per-item theming (e.g. a game board's per-square color), not just text. `shadow` is NOT binding-aware on any renderer, and a gradient is driven by its own `backgroundGradientPath` prop resolving to a gradient token NAME, not by a binding inside a token ref — so `shadow: { token: \"$item.x\" }` and `backgroundGradient: { token: \"$item.x\" }` keep the sentinel and silently lose the per-item styling. Colour slots split by LEVEL, not by component: inside modifiers a colour is a TokenRef OBJECT ({ token: \"…\" }), inside props it is a bare TokenName STRING — there is no modifiers.color or modifiers.tint (see the 'Token slots' section in component-reference.md). A few input props render the LITERAL and are NOT binding-aware — notably SearchField.placeholder and Chip.label; SearchField.value is live and binding-aware like other content props. Bindings also CANNOT target strict-enum fields (style, size, alignment, severity, presentation, contentMode, …) — those fail at render, not validation. $env: is client-resolved (no worker) and valid in modifiers.hiddenPath and FragmentSlot.casePath ONLY — keys reduceMotion/colorScheme/sizeClass/isRTL/keyboardVisible, e.g. hiddenPath:\"$env:reduceMotion\" or hiddenPath:\"$env:colorScheme==light\", casePath:\"$env:colorScheme\"; unknown key fails open (shown / defaultCase).",
4
+ "bindingGrammar": "$service:<service>.<path> (worker state) · $item.<field> (list row) · $flag:<key> (feature flag) · $env:<key> (client environment — #1056). Bindings resolve in the text/value props marked 'binding-aware' below — INCLUDING Modifiers token refs — but only `background` and `border.color`, which are the two whose token a binding actually fills: a worker can drive per-item theming (e.g. a game board's per-square color), not just text. `shadow` is NOT binding-aware on any renderer, and a gradient is driven by its own `backgroundGradientPath` prop resolving to a gradient token NAME, not by a binding inside a token ref — so `shadow: { token: \"$item.x\" }` and `backgroundGradient: { token: \"$item.x\" }` keep the sentinel and silently lose the per-item styling. Colour slots split by LEVEL, not by component: inside modifiers a colour is a TokenRef OBJECT ({ token: \"…\" }), inside props it is a bare TokenName STRING — there is no modifiers.color or modifiers.tint (see the 'Token slots' section in component-reference.md). A few input props render the LITERAL and are NOT binding-aware — notably SearchField.placeholder and Chip.label (a bound collection row may use $item. because row values are substituted before decode; $service: is still not supported there); SearchField.value is live and binding-aware like other content props. Bindings also CANNOT target strict-enum fields (style, size, alignment, severity, presentation, contentMode, …) — those fail at render, not validation. $env: is client-resolved (no worker) and valid in modifiers.hiddenPath and FragmentSlot.casePath ONLY — keys reduceMotion/colorScheme/sizeClass/isRTL/keyboardVisible, e.g. hiddenPath:\"$env:reduceMotion\" or hiddenPath:\"$env:colorScheme==light\", casePath:\"$env:colorScheme\"; unknown key fails open (shown / defaultCase).",
5
5
  "componentCount": 90,
6
6
  "notImplementedComponents": [
7
7
  "Text",
@@ -8,6 +8,7 @@ Binding grammar: `$service:<service>.<path>` (worker state) · `$item.<field>` (
8
8
  Bindings resolve in the text/value props marked **binding-aware** below — **including two `Modifiers` token refs**, `background` and `border.color`, which are the only two whose token a binding actually fills: a worker can drive per-item **theming** (e.g. a game board's per-square color, `background: { token: "$item.bg" }`), not just text content. `shadow` and `backgroundGradient` are `TokenRef`s but are **not** binding-aware on any renderer — `shadow: { token: "$item.x" }` keeps the sentinel as a literal token name and silently loses the per-item styling, and a gradient is driven by its own `backgroundGradientPath` prop resolving to a gradient token NAME, not by a binding inside a token ref.
9
9
  `$env:` is **client-resolved** (no worker) and valid in `modifiers.hiddenPath` and `FragmentSlot.casePath` **only** — keys `reduceMotion` / `colorScheme` / `sizeClass` / `isRTL` / `keyboardVisible` (an on-screen keyboard is up — `hiddenPath: "$env:keyboardVisible"` hides a header while typing), with an optional `==`/`!=` comparison (e.g. `hiddenPath: "$env:reduceMotion"`, `hiddenPath: "$env:colorScheme==light"`, `casePath: "$env:colorScheme"`). An unknown key fails open (shown / `defaultCase`).
10
10
  A few input props render the **literal** and are **not** binding-aware — notably `SearchField.placeholder` and `Chip.label`. `SearchField.value` is live/binding-aware like other content props.
11
+ Within a bound collection's item template, `$item.` values are substituted before decoding, so a row's `Chip.label: "$item.title"` works. This does not make these props subscribe to `$service:`, and an item binding outside a row still renders literally.
11
12
  They **cannot target strict-enum fields** (`style`, `size`, `alignment`, `severity`, `presentation`, `contentMode`, …) — those fail at render time, not validation.
12
13
 
13
14
  The **Index** column below lists each component's bindable props — both `*Path` fields and
@@ -22,11 +22,11 @@ Source snapshots: Catalyst `617c06d43d2a5608b6876d724553269b1e5346f0`; Himalaya
22
22
 
23
23
  | Classification | Definitions |
24
24
  | --- | ---: |
25
- | Module | 13 |
25
+ | Module | 14 |
26
26
  | Primitive | 7 |
27
27
  | Composition | 9 |
28
28
  | Partial | 25 |
29
- | Empty | 23 |
29
+ | Empty | 22 |
30
30
  | Total | 77 |
31
31
 
32
32
  ## Mappings by server group
@@ -221,7 +221,7 @@ carousel placement remain separate gaps; the mappings above stay Partial.
221
221
  | --- | --- | --- | --- | --- | --- |
222
222
  | `platform_general_contact_section` | `wix.platform.general.contact_section` | [Core Text/Button/Map composition](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/builder.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Inline composition | Composition | Compose the supplied business contact/address/description and source visibility/get-in-touch settings. Wire phone/email/URL/chat actions to existing target capabilities; the Structure alone may need business contact values supplied alongside it. |
223
223
  | `platform_general_upcoming_section` | `wix.platform.general.upcoming_section` | [My Bookings data](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/tier5-bundles-src/himi-booking-bookings/index.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") + [existing home modules](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/home-modules-screen.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Existing base; adaptation needed | Partial | Reuse real member upcoming-booking logic and compose the source strip/limit. Preserve visitor/access behavior and the original agenda CTA; this does not resolve the separate Bookings agenda gap. |
224
- | `platform_general_announcement_section` | `wix.platform.general.announcement_section` | | | Empty | No live source business-announcement implementation was verified. The Spaces dashboard contains seeded announcement text; the Branded home uses a Blog post title; platform new-release announcements are a different entity. |
224
+ | `platform_general_announcement_section` | `wix.platform.general.announcement_section` | `announcement-section` shared module + `announcement-card` recipe, mapped by `himi one-app generate` | Inline section; the content is read at runtime, never baked at migration time | Module | The latest announcement (title, rich body, creator, date) through the one read-only call the native app makes: `GET https://manage.wix.com/_api/mobile-apps-announcements/v1/announcements/latest?includeReaderData=false`, authorized with the app's own signed instance (Member when signed in, else Visitor). `includeReaderData` stays false (true needs the One App manage permission and answers 403); `AddCurrentMemberAsReader` is a write and is never called. Known server behaviour, shared with the native app: a site with no announcement gets its default welcome text saved once by this read, so do not call it during migration collection or validation. The section has no settings. The announcement `content` is a DraftJS raw state for announcements written in the app (shown as plain text) or a Ricos document (shown rich). Native hosts send the consumer credential to exactly this GET path only (the `isSupportedConsumerEndpoint` family in `WixApiCapability`, Android and Swift), so a phone shows the section from the first Player/app native release that carries that entry; the local web preview (`himi run`) needs nothing. |
225
225
  | `platform_general_members_section` | `membersArea.MembersAboutWidget` | [Member data](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/tier5-bundles-src/wix-spaces-members/index.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") + [existing member avatars/home composition](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/home-modules-screen.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Inline composition | Composition | Reuse member rows/avatar presentation and the member-directory destination. Preserve source strip/title/count/privacy settings rather than copying seeded dashboard members. |
226
226
  | `platform_elements_divider_section` | `wix.platform.elements.divider_section` | [Core Divider / layout modifiers](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/builder.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Inline primitive | Primitive | Translate orientation/style/spacing from instance settings where supported and retain section margins. |
227
227
  | `platform_elements_image_section` | `wix.platform.elements.image_section` | [Core Image](https://github.com/wix-private/himalaya/blob/97f1542f2f7d6e8cb7a902b912c87dcaa37e5a67/core/dev-server/src/builder.ts "audience-lint-ok: optional pinned upstream evidence, not a local authoring dependency") | Inline primitive | Primitive | Translate media URL, aspect/crop ratio, fill/fit, corner radius, alt text and configured click action; preserve sizing and accessibility. |
@@ -392,7 +392,6 @@ These are the exact definitions whose target cells above remain empty. “Not fo
392
392
  | `photoalbum-section-definitions.json` | `photoAlbums_list_section` | Existing Photo Albums code is an empty-state placeholder with no album API wired. Pro Gallery uses a different data source and is not a substitute; choose an implementation explicitly. |
393
393
  | `photoalbum-section-definitions.json` | `photoAlbums_photos_list` | Existing Photo Albums code is an empty-state placeholder with no album API wired. Pro Gallery uses a different data source and is not a substitute; choose an implementation explicitly. |
394
394
  | `photoalbum-section-definitions.json` | `photoAlbums_carousel_section` | Existing Photo Albums code is an empty-state placeholder with no album API wired. Pro Gallery uses a different data source and is not a substitute; choose an implementation explicitly. |
395
- | `platform-section-definitions.json` | `platform_general_announcement_section` | No live source business-announcement implementation was verified. The Spaces dashboard contains seeded announcement text; the Branded home uses a Blog post title; platform new-release announcements are a different entity. |
396
395
  | `platform-section-definitions.json` | `platform_ai_generated_section` | No verified interpreter for the source AI-generated section payload/runtime was found. The presence of Tier-5 or WebView support does not establish payload compatibility. |
397
396
  | `platform-section-definitions.json` | `platform_elements_embed_code_section` | Core WebView supports inlineHtml, but the source embed-code settings/runtime contract was not verified. Leave this mapping empty instead of assuming arbitrary source embed payloads are compatible. |
398
397
  | `stores-section-definitions.json` | `stores_wishlist_section` | The existing himi_saved_products feature is device-local saved products, not a verified account-backed Wix Stores wishlist. Do not substitute those semantics without the user's choice. |
@@ -363,6 +363,10 @@ Verify probe behavior in the service contract, not just its HTTP method. Some
363
363
  legacy GET routes initialize missing records. In particular, announcement
364
364
  latest/list reads can create a default announcement; avoid those during migration
365
365
  collection and validation. A verified read of a referenced, known record is safer.
366
+ The one place the migration does read announcements is the generated app itself: `generate` maps
367
+ `platform_general_announcement_section` to the shared announcement block, whose worker reads the latest announcement at runtime
368
+ with the one read-only call the native app makes (see the section mappings reference). It never calls `AddCurrentMemberAsReader`
369
+ (a write) and never asks for reader data.
366
370
 
367
371
  `source-graph.json` is a basic relationship index, not the completed plan. The
368
372
  agent must still resolve business CTA contracts, toolbar actions and inheritance,
@@ -1349,6 +1353,14 @@ So generate descriptors as data and write them with the CLI:
1349
1353
  himi template screens --upsert --from .himi/one-app/gen/screens.json
1350
1354
  ```
1351
1355
 
1356
+ `generate` owns a few load parameters on three template screens: `categoryId` on `himi_shop`, and `title`, `groupListLabel` and
1357
+ `pageSize` on `himi_groups_feed` / `himi_groups`. The scaffold ships none of them; a run writes the ones a page's source gives and
1358
+ clears the ones no page owns any more, so do not hand-add these keys there.
1359
+
1360
+ `generate` also fills the `route` rows of `ONE-APP-COVERAGE.json` for the source screens it mapped (`target.screenId` is the screen of
1361
+ the source screen's first visible page), creating the ledger when it is absent; `himi one-app validate-topbar` reads them. A source
1362
+ screen none of whose pages became a screen keeps a blank row, which the validator names.
1363
+
1352
1364
  The file is one JSON object, `{ "<screenId>": <ScreenDescriptor>, … }`. Each existing
1353
1365
  id is replaced in place; each new id is added and registered in
1354
1366
  `navigation.linkableScreens`. One invalid entry refuses the batch and restores every
@@ -1378,6 +1390,11 @@ with its filled variant when there is one) and repoints every `linkableScreens`
1378
1390
  - a screen the More tab lists takes the More tab's id (only when there is a More tab);
1379
1391
  - any other screen takes `""`, the default stack.
1380
1392
 
1393
+ A page the source navigation lists (its `navigation-plan.json` tabs, or the bottom tabs of a source that has its own) that
1394
+ `generate` could not turn into a screen is refused with `pages_without_screen`, which names every such page, and nothing is
1395
+ written: a bar that silently lacks a source page is not the source's navigation. Map the sections `generate` reports under
1396
+ `unmapped` and run it again. No placeholder screen is added for them.
1397
+
1381
1398
  A tab for a screen the app does not define is refused with `screen_missing` and nothing is written: write the generated
1382
1399
  screens first, and keep any template screen a tab opens when you trim. A source icon with no catalog match is reported
1383
1400
  under `gaps` and gets a neutral icon; choose a better one in `config.ts`. The drawer is not touched.
@@ -1795,7 +1812,9 @@ evaluates (`svc.load();` at the bottom of the file — the pattern every migrati
1795
1812
  worker uses); the screen descriptor names nothing, but the read runs as soon as the
1796
1813
  screen boots the worker. Each boot path must be a catalogue or directory read.
1797
1814
  Stop if one submits, orders, books, pays, or calls a getter known to mutate on read
1798
- (such as the legacy announcement default getter). Then review the recorded and
1815
+ (such as the legacy announcement default getter) from the migration's own collection or tests. The one expected exception is the
1816
+ generated announcement block's runtime read of the latest announcement (see the section mappings reference), which belongs to the
1817
+ app and runs on a device or live preview, never during collection, validation or `himi test`. Then review the recorded and
1799
1818
  refused requests. Keep actual recordings
1800
1819
  under `.himi/one-app/fixtures/net-mocks.json`. For local test/render discovery,
1801
1820
  make `dev/net-mocks.json` a relative symlink to that private file: the source
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1662.0",
3
+ "version": "0.1664.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": [
@@ -72,5 +72,5 @@
72
72
  "artifactId": "himalaya-cli"
73
73
  }
74
74
  },
75
- "falconPackageHash": "4d3f3e985b8a80b1afaca3b94bff7fb078c805dbfd5f07c3e5c7a1f7"
75
+ "falconPackageHash": "3a4ff81dda3bb37e8c0b80b2e739c4cadbfabc1dee0b3c84fc65f394"
76
76
  }
@@ -37,7 +37,7 @@ export default defineApp({
37
37
  actions: "http://localhost:8190/v1/actions",
38
38
  sync: "http://localhost:8190/v1/sync",
39
39
  },
40
- capabilities: ["live_activity","push","share","secure_storage","open_url","calendar","local_database","wix_api","wix_platform","app_info","iap","release_control","clipboard","theme","ui","wix_cashier"],
40
+ capabilities: ["live_activity","push","share","ui","secure_storage","open_url","calendar","local_database","wix_api","wix_platform","app_info","iap","release_control","clipboard","theme","wix_cashier"],
41
41
  cache: {
42
42
  "rules": [
43
43
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$source": "en",
3
- "$generated": "2026-11-11T11:23:33.664Z",
3
+ "$generated": "2026-11-11T20:18:46.092Z",
4
4
  "messages": {
5
5
  "h_0028d743eb44": {
6
6
  "source": "Sale",
@@ -0,0 +1,72 @@
1
+ {
2
+ "_recipe": "The business's latest announcement (title, rich body, creator and date), read at runtime. Service: registerAnnouncementSection(svc). Hidden whole while there is nothing to show.",
3
+ "_placeholders": {
4
+ "svc": "service name the page worker registered with registerAnnouncementSection",
5
+ "id": "unique node id prefix (e.g. the screen id)",
6
+ "heading": "the source section's own title when it shows one, else an empty string"
7
+ },
8
+ "node": {
9
+ "id": "{{id}}.announcement",
10
+ "body": {
11
+ "package": "himalaya",
12
+ "type": "VStack",
13
+ "props": {
14
+ "spacing": 8,
15
+ "alignment": "leading",
16
+ "children": [
17
+ {
18
+ "id": "{{id}}.heading",
19
+ "body": { "package": "himalaya", "type": "Text", "props": { "text": "{{heading}}", "style": "title3", "collapseWhenEmpty": true } }
20
+ },
21
+ {
22
+ "id": "{{id}}.title",
23
+ "body": { "package": "himalaya", "type": "Text", "props": { "text": "$service:{{svc}}.title", "style": "bodyEmphasis", "collapseWhenEmpty": true } },
24
+ "modifiers": { "hiddenPath": "$service:{{svc}}.noTitle" }
25
+ },
26
+ {
27
+ "id": "{{id}}.body_rich",
28
+ "body": {
29
+ "package": "himalaya",
30
+ "type": "RichContent",
31
+ "props": {
32
+ "documentJsonPath": "$service:{{svc}}.bodyJson",
33
+ "onLink": { "actionId": "tier5.{{svc}}.openLink" },
34
+ "fallback": { "id": "{{id}}.body_rich_fallback", "body": { "package": "himalaya", "type": "Text", "props": { "text": "$service:{{svc}}.body", "style": "body", "color": "textSecondary" } } }
35
+ }
36
+ },
37
+ "modifiers": { "hiddenPath": "$service:{{svc}}.noBodyJson" }
38
+ },
39
+ {
40
+ "id": "{{id}}.body",
41
+ "body": { "package": "himalaya", "type": "Text", "props": { "text": "$service:{{svc}}.body", "style": "body", "color": "textSecondary", "collapseWhenEmpty": true } },
42
+ "modifiers": { "hiddenPath": "$service:{{svc}}.hasBodyJson" }
43
+ },
44
+ {
45
+ "id": "{{id}}.meta",
46
+ "body": {
47
+ "package": "himalaya",
48
+ "type": "HStack",
49
+ "props": {
50
+ "spacing": 8,
51
+ "alignment": "center",
52
+ "children": [
53
+ {
54
+ "id": "{{id}}.creator",
55
+ "body": { "package": "himalaya", "type": "Text", "props": { "text": "$service:{{svc}}.creator", "style": "caption", "color": "textSecondary", "collapseWhenEmpty": true } },
56
+ "modifiers": { "hiddenPath": "$service:{{svc}}.noCreator" }
57
+ },
58
+ {
59
+ "id": "{{id}}.created",
60
+ "body": { "package": "himalaya", "type": "Text", "props": { "text": "$service:{{svc}}.created", "style": "caption", "color": "textSecondary", "collapseWhenEmpty": true } },
61
+ "modifiers": { "hiddenPath": "$service:{{svc}}.noCreated" }
62
+ }
63
+ ]
64
+ }
65
+ }
66
+ }
67
+ ]
68
+ }
69
+ },
70
+ "modifiers": { "hiddenPath": "$service:{{svc}}.noAnnouncement", "padding": { "leading": 16, "trailing": 16, "top": 16, "bottom": 16 } }
71
+ }
72
+ }
@@ -0,0 +1,122 @@
1
+ // The INLINE announcement section: the business's latest announcement, read at RUNTIME (never baked at migration time) and
2
+ // shown next to other sections. It is the call the native Branded app's announcement section makes
3
+ // (wix-one-app-member-view, Announcement/serverApiService.ts `fetchLatestAnnouncement`): one GET of the latest announcement with the
4
+ // app's own signed instance (Member when signed in, else Visitor), which the `wixApi` bridge attaches.
5
+ //
6
+ // READ-ONLY, ALWAYS: `includeReaderData` stays false (true needs the One App manage permission and answers 403), and nothing here
7
+ // ever marks an announcement as seen (`AddCurrentMemberAsReader` is a write). Known server behaviour, shared with the native app: a
8
+ // site that has no announcement yet gets its default welcome text saved once, by this very read.
9
+ // A phone sends the signed instance to this URL only because the native hosts (Android and Swift `WixApiCapability`) allow exactly this
10
+ // GET (host, path, method and the reader-data-off query) for the consumer providers; a build without that entry refuses the read and the
11
+ // section shows nothing. The local web preview has no such list.
12
+ // The `announcement-card` recipe is the card that reads it, bound as `$service:<serviceName>.*`.
13
+ import { defineService } from "@himalaya/state";
14
+ import { richBody } from "./rich-body.js";
15
+ import { formatDateMedium } from "./engine-intl.js";
16
+ import { openRichLink } from "./rich-content-link.js";
17
+
18
+ /** The one call: the latest announcement, without the reader data. */
19
+ export const LATEST_ANNOUNCEMENT_URL = "https://manage.wix.com/_api/mobile-apps-announcements/v1/announcements/latest?includeReaderData=false";
20
+
21
+ interface LatestAnnouncementResponse {
22
+ announcement?: {
23
+ title?: unknown;
24
+ /** The announcement's content: a DraftJS raw state for announcements written in the app, or a Ricos document (as a Struct). */
25
+ content?: unknown;
26
+ createdDate?: unknown;
27
+ creatorMemberProfileData?: { nickname?: unknown; imageUrl?: unknown };
28
+ };
29
+ }
30
+
31
+ export interface AnnouncementState {
32
+ status: "loading" | "ready" | "error";
33
+ hasAnnouncement: boolean; noAnnouncement: boolean;
34
+ title: string; noTitle: boolean;
35
+ /** The rich body as one document string (RichContent draws nothing for ""), and its plain text, shown when there is no document. */
36
+ bodyJson: string; hasBodyJson: boolean; noBodyJson: boolean;
37
+ body: string; noBody: boolean;
38
+ created: string; noCreated: boolean;
39
+ creator: string; noCreator: boolean;
40
+ creatorImage: string; noCreatorImage: boolean;
41
+ isLoading: boolean; notLoading: boolean;
42
+ isErrored: boolean; notErrored: boolean;
43
+ }
44
+
45
+ const text = (value: unknown): string => (typeof value === "string" ? value.trim() : "");
46
+
47
+ /** The plain text of a DraftJS raw state (`{ blocks: [{ text }], entityMap }`), which is what the service's `content` really is for
48
+ * announcements written in the app (observed on a live site, 2026-11-11), or undefined when `content` is not one. Only the blocks' own
49
+ * text is read: the entity map (links, images) is never followed. */
50
+ function draftPlainText(content: unknown): string | undefined {
51
+ let doc = content;
52
+ if (typeof doc === "string") { try { doc = JSON.parse(doc); } catch { return undefined; } }
53
+ const blocks = (doc as { blocks?: unknown } | null | undefined)?.blocks;
54
+ if (!Array.isArray(blocks)) return undefined;
55
+ return blocks.map((block) => text((block as { text?: unknown } | null)?.text)).filter(Boolean).join("\n\n");
56
+ }
57
+
58
+ function derive(status: AnnouncementState["status"], fields: { title?: string; bodyJson?: string; body?: string; created?: string; creator?: string; creatorImage?: string } = {}): AnnouncementState {
59
+ const title = fields.title ?? "", bodyJson = fields.bodyJson ?? "", body = fields.body ?? "", created = fields.created ?? "";
60
+ const creator = fields.creator ?? "", creatorImage = fields.creatorImage ?? "";
61
+ const hasAnnouncement = status === "ready" && !!(title || bodyJson || body);
62
+ return {
63
+ status, hasAnnouncement, noAnnouncement: !hasAnnouncement,
64
+ title, noTitle: !title,
65
+ bodyJson, hasBodyJson: !!bodyJson, noBodyJson: !bodyJson,
66
+ body, noBody: !body,
67
+ created, noCreated: !created,
68
+ creator, noCreator: !creator,
69
+ creatorImage, noCreatorImage: !creatorImage,
70
+ isLoading: status === "loading", notLoading: status !== "loading",
71
+ isErrored: status === "error", notErrored: status !== "error",
72
+ };
73
+ }
74
+
75
+ /** The state for a latest-announcement response: an empty or missing announcement shows nothing, never a placeholder. */
76
+ export function announcementState(response: unknown): AnnouncementState {
77
+ const announcement = (response as LatestAnnouncementResponse | undefined)?.announcement;
78
+ if (!announcement || typeof announcement !== "object") return derive("ready");
79
+ // A DraftJS body shows as its plain text; a Ricos body keeps its rich document.
80
+ const draft = draftPlainText(announcement.content);
81
+ const rich = draft !== undefined ? { bodyJson: "", bodyText: draft } : richBody(announcement.content);
82
+ const when = typeof announcement.createdDate === "string" ? new Date(announcement.createdDate) : undefined;
83
+ const image = text(announcement.creatorMemberProfileData?.imageUrl);
84
+ return derive("ready", {
85
+ title: text(announcement.title),
86
+ bodyJson: rich.bodyJson, body: rich.bodyText,
87
+ created: when && !Number.isNaN(when.getTime()) ? formatDateMedium(when) : "",
88
+ creator: text(announcement.creatorMemberProfileData?.nickname),
89
+ // An avatar is shown only from an https URL.
90
+ creatorImage: /^https:\/\//i.test(image) ? image : "",
91
+ });
92
+ }
93
+
94
+ /** `options` is the generator's uniform second argument; the section has no settings of its own, so nothing is read from it. */
95
+ export function registerAnnouncementSection(serviceName: string, _options: object = {}) {
96
+ // The failure path reads the CURRENT state, not the snapshot the call began with: a refresh that fails after another load already
97
+ // showed an announcement must not erase it.
98
+ let current: () => AnnouncementState = () => derive("loading");
99
+ const handle = defineService<AnnouncementState, { load: (state: AnnouncementState) => Promise<AnnouncementState>; openLink: (state: AnnouncementState, arg?: unknown) => Promise<AnnouncementState> }>(serviceName, {
100
+ state: derive("loading"),
101
+ actions: {
102
+ load: async () => {
103
+ // A failed refresh (offline, a 5xx) keeps an announcement that is already showing: only a screen with nothing to show goes to error.
104
+ const failed = (): AnnouncementState => { const now = current(); return now.hasAnnouncement ? now : derive("error"); };
105
+ try {
106
+ const api = (globalThis as { himalaya?: { wixApi?: { call: (method: string, path: string) => Promise<unknown> } } }).himalaya?.wixApi;
107
+ if (!api) return failed();
108
+ return announcementState(await api.call("GET", LATEST_ANNOUNCEMENT_URL));
109
+ } catch {
110
+ return failed();
111
+ }
112
+ },
113
+ // A link tapped inside the rich body: only http(s), mailto and tel links open (the shared rich-link rule).
114
+ openLink: async (state, arg) => {
115
+ await openRichLink(arg);
116
+ return state;
117
+ },
118
+ },
119
+ });
120
+ current = () => handle.getState() as AnnouncementState;
121
+ return handle;
122
+ }
@@ -94,11 +94,10 @@ export function formatDateMedium(date: Date, locale = appLocale(), timeZone?: st
94
94
  return `${MONTHS_SHORT[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}`;
95
95
  }
96
96
 
97
- /** `{ month: "short", year: "numeric" }` — "Jan 2026". */
97
+ /** `{ month: "short", year: "numeric" }` — "Jul 2026", without parsing a localized day.
98
+ * Like the other date helpers, an engine without Intl keeps the documented en-US fallback. */
98
99
  export function formatMonthYear(date: Date, locale = "en-US", timeZone?: string): string {
99
- if (hasIntl()) {
100
- return dateFormat(locale, { month: "short", year: "numeric" }, timeZone).format(date);
101
- }
100
+ if (hasIntl()) return dateFormat(locale, { month: "short", year: "numeric" }, timeZone).format(date);
102
101
  return `${MONTHS_SHORT[date.getMonth()]} ${date.getFullYear()}`;
103
102
  }
104
103
 
@@ -94,11 +94,10 @@ export function formatDateMedium(date: Date, locale = appLocale(), timeZone?: st
94
94
  return `${MONTHS_SHORT[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}`;
95
95
  }
96
96
 
97
- /** `{ month: "short", year: "numeric" }` — "Jan 2026". */
97
+ /** `{ month: "short", year: "numeric" }` — "Jul 2026", without parsing a localized day.
98
+ * Like the other date helpers, an engine without Intl keeps the documented en-US fallback. */
98
99
  export function formatMonthYear(date: Date, locale = "en-US", timeZone?: string): string {
99
- if (hasIntl()) {
100
- return dateFormat(locale, { month: "short", year: "numeric" }, timeZone).format(date);
101
- }
100
+ if (hasIntl()) return dateFormat(locale, { month: "short", year: "numeric" }, timeZone).format(date);
102
101
  return `${MONTHS_SHORT[date.getMonth()]} ${date.getFullYear()}`;
103
102
  }
104
103
 
@@ -37,7 +37,7 @@ export default defineApp({
37
37
  actions: "http://localhost:8190/v1/actions",
38
38
  sync: "http://localhost:8190/v1/sync",
39
39
  },
40
- capabilities: ["live_activity","push","share","secure_storage","open_url","calendar","local_database","media_playback","wix_api","wix_platform","app_info","iap","release_control","clipboard","motion","wix_chat","theme","ui","wix_cashier"],
40
+ capabilities: ["live_activity","push","share","ui","secure_storage","open_url","calendar","local_database","media_playback","wix_api","wix_platform","app_info","iap","release_control","clipboard","motion","wix_chat","theme","wix_cashier"],
41
41
  cache: {
42
42
  "rules": [
43
43
  {