@wix/himalaya-cli 0.1713.0 → 0.1715.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 (20) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview/src/dispatcher.d.ts +4 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview/src/index.d.ts +14 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview/src/site-events.d.ts +54 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/capabilities.generated.d.ts +1 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/client.d.ts +24 -1
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/index.d.ts +7 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +2 -1
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +2 -1
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/webview-page.mjs +21 -2
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/webview.mjs +208 -1
  11. package/dist/browser-plane/assets.json +5 -5
  12. package/dist/browser-plane/preview-deferred/{eebfb701744c8f130b659a79b33f563c2a47f5104d624fe7e108a064dce68d1b.bin → beb47fb3bdf1fe461bde8322263c72e10006079380c5551599c470308b4d3e31.bin} +1 -1
  13. package/dist/browser-plane/sw.js +1 -1
  14. package/dist/cli.mjs +260 -214
  15. package/dist/preview-assets.generated.bin +0 -0
  16. package/guides/capabilities.md +1 -1
  17. package/guides/release-notes.md +16 -0
  18. package/guides/sdk-reference.json +29 -1
  19. package/guides/webview-page-sdk.md +47 -0
  20. package/package.json +2 -2
Binary file
@@ -313,7 +313,7 @@ binary carries neither the code nor the store-review footprint of a framework it
313
313
  | live_activity | `live_activity` |
314
314
  | location | `location`, `location_background` |
315
315
  | location_background (iOS) | `location_background` |
316
- | media | `media_playback`, `video_playback` (in-app video, no background audio) |
316
+ | media | `media_playback`, `video_playback` (in-app video: no iOS background audio, no Android media foreground service) |
317
317
  | motion | `motion` |
318
318
  | on_device_ai (iOS) | `on_device_ai` |
319
319
  | push | `push` |
@@ -14,6 +14,22 @@ areas, always in the same order, so you can skim for the one you care about.
14
14
 
15
15
  ---
16
16
 
17
+ ## 2026-11-14
18
+
19
+ ### Logic, data & SDKs
20
+
21
+ - **A worker hears what the website on its screen is doing: the page title, the page path, whether a
22
+ member is signed in to the site, and the Wix cart count.** Subscribe with `onSiteEvent(cb)` from
23
+ `@himalaya/webview` (or read `siteState(instanceId)`) on a screen whose website page is a
24
+ `sitePage(site, { path, bridge: "worker" })` on the site your app is built for, and bind the state to
25
+ native UI: the app-bar title, a cart badge, a "Sign in" row. The app reads the title, path and member
26
+ state itself, so the site needs no edit and the page cannot fake them. On a Wix site the app also reads
27
+ the number on the header cart icon; it is best effort, and `null` means unknown (no cart icon), so hide
28
+ the badge then. Events stop while the page is off your site, and the full state arrives again when it
29
+ comes back. A page that runs `@wix/himalaya/webview-page` (Base44 and others) can add what the app
30
+ cannot see with `himalaya.site.report({ cart, member })`; what the app reads always wins. iOS, macOS and
31
+ Android; nothing arrives on web, where the site is in a cross-origin frame. (#5808)
32
+
17
33
  ## 2026-11-13
18
34
 
19
35
  ### Getting started & the CLI
@@ -6349,6 +6349,13 @@
6349
6349
  "decl": "export {\n PAGE_HANDSHAKE_CAPABILITY,\n PAGE_HANDSHAKE_METHOD,\n type ExposedPageCapability,\n type PageCapabilityRequest,\n type PageCapabilityResponse,\n type PageConsoleEvent,\n type PageCtx,\n type PageLifecycleEvent,\n type PageRequestHandler,\n type PageStream,\n} from \"./dispatcher.js\";",
6350
6350
  "verificationChecked": true
6351
6351
  },
6352
+ {
6353
+ "name": "\"./site-events.js\"",
6354
+ "kind": "reexport",
6355
+ "jsdoc": "",
6356
+ "decl": "export type { SiteEvent, SiteEventName, SiteEventSource, SiteRoute, SiteSnapshot } from \"./site-events.js\";",
6357
+ "verificationChecked": true
6358
+ },
6352
6359
  {
6353
6360
  "name": "postToPage",
6354
6361
  "kind": "function",
@@ -6398,6 +6405,20 @@
6398
6405
  "decl": "export function onPageConsole(cb: (e: PageConsoleEvent) => void): () => void;",
6399
6406
  "verificationChecked": true
6400
6407
  },
6408
+ {
6409
+ "name": "onSiteEvent",
6410
+ "kind": "function",
6411
+ "jsdoc": "/**\n * Observe site events of the screen's SITE-TRUSTED page (a `role: \"primary\"`,\n * `bridge: \"worker\"` site WebView on the site baked into the app): `title`, `route` and `member` from\n * the host, `cart` from the binary's Wix adapter (best effort: `null` is unknown, hide a badge), and\n * whatever the page reports itself with `himalaya.site.report(…)`. Precedence per field: host >\n * adapter > page. Each event carries the merged `state`; the host re-sends a `snapshot` whenever the\n * channel attaches (a mount, a return to the site after leaving it). Without a site-trusted bridge\n * nothing is emitted. Returns an unsubscribe function.\n */",
6412
+ "decl": "export function onSiteEvent(cb: (e: SiteEvent) => void): () => void;",
6413
+ "verificationChecked": true
6414
+ },
6415
+ {
6416
+ "name": "siteState",
6417
+ "kind": "function",
6418
+ "jsdoc": "/** The merged site snapshot of one page instance, or `undefined` before anything was heard from it. */",
6419
+ "decl": "export function siteState(instanceId: string): SiteSnapshot | undefined;",
6420
+ "verificationChecked": true
6421
+ },
6401
6422
  {
6402
6423
  "name": "exposeCapabilitiesToPage",
6403
6424
  "kind": "function",
@@ -6430,7 +6451,7 @@
6430
6451
  "name": "\"./client.js\"",
6431
6452
  "kind": "reexport",
6432
6453
  "jsdoc": "",
6433
- "decl": "export type {\n PageEventHandler,\n WebViewPageError,\n WebViewPageEvent,\n WebViewPageRequest,\n WebViewPageResponse,\n WebViewPageStreamEnvelope,\n} from \"./client.js\";",
6454
+ "decl": "export type {\n PageEventHandler,\n PageSite,\n SiteReport,\n WebViewPageError,\n WebViewPageEvent,\n WebViewPageRequest,\n WebViewPageResponse,\n WebViewPageStreamEnvelope,\n} from \"./client.js\";",
6434
6455
  "verificationChecked": true
6435
6456
  },
6436
6457
  {
@@ -6475,6 +6496,13 @@
6475
6496
  "decl": "export const himalaya = client.merge({}) as HimalayaPageSdk;",
6476
6497
  "verificationChecked": true
6477
6498
  },
6499
+ {
6500
+ "name": "site",
6501
+ "kind": "const",
6502
+ "jsdoc": "/**\n * Report site facts the host cannot see (Base44 and other sites): `cart`, the\n * website's `member`, and — only where no host reports them — `title` and `route`. Fire-and-forget;\n * the host's own title, route and member always win. Same as `himalaya.site.report(fields)`.\n */",
6503
+ "decl": "export const site = client.site;",
6504
+ "verificationChecked": true
6505
+ },
6478
6506
  {
6479
6507
  "name": "health",
6480
6508
  "kind": "const",
@@ -300,6 +300,53 @@ and the site's header, menu, footer and ads stay hidden. The page still cannot n
300
300
  action or call a native capability itself: it reaches native code only through the worker's declared
301
301
  capabilities, as described above. On web there is no channel for a site page.
302
302
 
303
+ ### Site events: title, route, member and cart
304
+
305
+ A trusted site page tells its worker what the website is doing, with no edit to the site. The worker
306
+ subscribes with `onSiteEvent` from `@himalaya/webview`:
307
+
308
+ ```ts
309
+ import { onSiteEvent, siteState } from "@himalaya/webview";
310
+
311
+ onSiteEvent((e) => {
312
+ // e.event: "title" | "route" | "cart" | "member" | "snapshot"
313
+ // e.source: "host" | "adapter" | "page"; e.state: { title, route, cart, member } (null = unknown)
314
+ void svc.site(e.state);
315
+ });
316
+ ```
317
+
318
+ | Event | Payload | Where it comes from |
319
+ |---|---|---|
320
+ | `title` | `{ title }` | the app reads the page's own title |
321
+ | `route` | `{ path, search, sameDocument }` | the app reads the page's own address; `path` is inside the site (`/book-online`), never another site |
322
+ | `member` | `{ signedIn }` | Wix: the app reads the site's member cookie. Base44: the app's own sign-in |
323
+ | `cart` | `{ count }` | Wix only: the app reads the header cart icon. `null` means unknown (no cart icon): hide the badge |
324
+
325
+ - Every event carries the full `state`. When the page comes back onto the site after leaving it, or the
326
+ screen remounts, the worker gets a `snapshot` event, so it never needs to ask. `siteState(instanceId)`
327
+ reads the latest state.
328
+ - Nothing arrives while the page is off the site, and nothing arrives for a page that is not trusted (no
329
+ baked site, or the strict bridge).
330
+ - The Wix cart count is best effort. Wix has no documented way for a site script to read the cart total, so
331
+ the app reads the number on the header cart icon. A site without that icon reports `null`.
332
+ - On web no site events arrive (the site is in a cross-origin frame).
333
+
334
+ Bind the state to native UI: `hostTitle: "$service:shop.pageTitle"` for the app bar, a cart badge on
335
+ `$service:shop.cartCount`, a native "Sign in" row shown when the website's member is signed out.
336
+
337
+ **Other sites (Base44 and any page that runs this SDK).** The title, route and member still come from the app
338
+ with no page code. A page can add what the app cannot see, such as its cart count:
339
+
340
+ ```ts
341
+ import { himalaya } from "@wix/himalaya/webview-page";
342
+
343
+ himalaya.site.report({ cart: 3 }); // or { member: true }, { title }, { route: "/path?x=1" }
344
+ ```
345
+
346
+ `report` is fire-and-forget and returns `false` outside the app. Per field, what the app reads wins over what
347
+ the page reports: a page can never change the title, route or member the app reported. `site` is reserved, so
348
+ a worker cannot register an `onPageRequest("site", …)` namespace.
349
+
303
350
  ## Demo app regression page
304
351
 
305
352
  The demo app hosts a page that calls every capability its iOS and Android boots already
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/himalaya-cli",
3
- "version": "0.1713.0",
3
+ "version": "0.1715.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": [
@@ -81,5 +81,5 @@
81
81
  "artifactId": "himalaya-cli"
82
82
  }
83
83
  },
84
- "falconPackageHash": "2ead352533aec548def8131d1e108ecb28a1b6fc14c7995c5b080fbb"
84
+ "falconPackageHash": "ede96eb5f67640e0ba7234876a57c778a04f4ee0f475082a64844a7a"
85
85
  }