@wix/himalaya-cli 0.1700.0 → 0.1702.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.
@@ -1,4 +1,4 @@
1
- import { type RichContentEditorTool, type WorkerSubtreePolicy } from "@wix/himalaya/core";
1
+ import { type RichContentEditorTool, type SitePageNodeSpec, type SitePageSite, type WorkerSubtreePolicy } from "@wix/himalaya/core";
2
2
  export type { RichContentEditorTool };
3
3
  export interface Component {
4
4
  id: string;
@@ -1811,6 +1811,25 @@ export declare function webView(props: {
1811
1811
  }, opts?: {
1812
1812
  id?: string;
1813
1813
  }): Component;
1814
+ /**
1815
+ * RFC 0079 §3 — one page of the customer's website as a node of an SDUI screen, with native UI
1816
+ * around it. Not a new component: it emits a `WebView` with `role: "primary"`, `fill: true`,
1817
+ * `scrollEnabled: true` and `modifiers.weight: 1`, whose `url` is `path` joined onto `site.origin`
1818
+ * and whose `config` is the site preset (`siteWebViewPreset(site)`) with `page.webView` merged over
1819
+ * it — the same page a site-shell tab loads. `site` is the app's `site` block (a `SiteShellConfig`).
1820
+ * `title` is the page's accessible name (`modifiers.accessibilityLabel`); absent, the site's host.
1821
+ *
1822
+ * ```ts
1823
+ * vstack({ children: [header, sitePage(site, { path: "/book-online", title: "Book" }), stickyBar] })
1824
+ * ```
1825
+ *
1826
+ * Put it at the screen root or directly in a root VStack / HStack / ZStack, once per screen; the
1827
+ * validator rejects it inside a LazyList, Pager, Carousel or CollapsingHeader (RFC 0079 §9).
1828
+ * The id defaults to `SITE_PAGE_NODE_ID`. Delegates to `sitePageNode` (`@wix/himalaya/core`).
1829
+ */
1830
+ export declare function sitePage(site: SitePageSite, page: SitePageNodeSpec, opts?: {
1831
+ id?: string;
1832
+ }): Component;
1814
1833
  /** One selectable day in a `dateStrip`. Mirrors what @himalaya/time emits. */
1815
1834
  export interface DateStripDay {
1816
1835
  /** Local "YYYY-MM-DD" day key — the value handed to `onSelect`. */
@@ -1,12 +1,14 @@
1
1
  import type { IconName } from "./icon-catalog.generated.js";
2
- import type { DrawerItem, LinkableScreen, NavTabItem, ScreenDescriptor, SiteNavConfig, WebViewConfig } from "./schema.js";
2
+ import type { Component, DrawerItem, LinkableScreen, NavTabItem, ScreenDescriptor, SiteNavConfig, WebViewConfig } from "./schema.js";
3
3
  /** Which hosting platform the site runs on. Selects origin allow-lists (and, once
4
4
  * RFC 0062 phase 2 lands, the binary-shipped page adapter). */
5
5
  export type SiteKind = "wix" | "base44";
6
6
  /** Where a page lives in the native chrome. `overflow` pages are routable (deep links,
7
7
  * in-site links) but get no tab and no drawer row. */
8
8
  export type SitePagePlacement = "tab" | "drawer" | "overflow";
9
- /** One page of the customer's site, as the app presents it. */
9
+ /** One page of the customer's site, as the app presents it — a page SPEC in the `site` block.
10
+ * Not the RFC 0079 `sitePage` builder (`@wix/himalaya/sdui`), which emits a page as an SDUI node
11
+ * ({@link sitePageNode}). */
10
12
  export interface SitePage {
11
13
  /** Stable id — becomes the tab id and the `site_<id>` screen id. `[a-z0-9_]+`. */
12
14
  id: string;
@@ -146,9 +148,76 @@ export declare function defineSiteTab(site: SiteShellConfig, page: SitePage): Sc
146
148
  * routing). Not kept alive: each routed link mounts it fresh, so it never shows the previous
147
149
  * link's page while the new one loads. */
148
150
  export declare function defineSitePageScreen(site: SiteShellConfig): ScreenDescriptor;
151
+ /** The part of a {@link SiteShellConfig} a single site page needs: the preset is resolved against
152
+ * it ({@link siteWebViewPreset}) and the page URL joined onto its origin ({@link sitePageUrl}).
153
+ * A whole `SiteShellConfig` — the `site` block an app's config exports — fits. */
154
+ export type SitePageSite = Pick<SiteShellConfig, "origin" | "kind" | "chrome" | "sessionBridge">;
155
+ /** What {@link sitePageNode} (and the `sitePage` builder) takes: one page of the site, by path. */
156
+ export interface SitePageNodeSpec {
157
+ /** Path relative to the site's base URL — the same rule as {@link SitePage.path}: never a full
158
+ * URL, never outside the site. */
159
+ path: string;
160
+ /** The page's accessible name — what a screen reader announces for the WebView
161
+ * (`modifiers.accessibilityLabel`; RFC 0058 §3.3 requires one on every `WebView`). Copy from the
162
+ * provisioning file, like {@link SitePage.title}. Absent or blank ⇒ the site's host. */
163
+ title?: string;
164
+ /** Overrides merged OVER the site preset, like {@link SitePage.webView}. */
165
+ webView?: Partial<WebViewConfig>;
166
+ }
167
+ /** The component id every site-page node gets unless the author names one. A screen has one
168
+ * primary node (RFC 0079 §9), so a fixed id is unique and stays a stable test id (invariant 27).
169
+ * The node's WebView identity is the host screen's id (§5.1), never this. */
170
+ export declare const SITE_PAGE_NODE_ID = "site_page_view";
171
+ /** How {@link siteScreens} serves a site page: `"t3"` — a Tier-3 screen
172
+ * (`renderer: "webview_native_bridge"`), what every shipped binary renders — or `"node"` — an SDUI
173
+ * screen whose root is the primary WebView node (RFC 0079 §8), for a binary that ships RFC 0079 §5. */
174
+ export type SiteScreenForm = "t3" | "node";
175
+ export declare const SITE_SCREEN_FORMS: readonly SiteScreenForm[];
176
+ /** The renderer a node-form site screen carries: an SDUI screen with a payload and no logic bundle.
177
+ * `sdui_layout`, not `sdui_intent`: the payload is an exact layout (the page, and any native header
178
+ * or footer around it), and `sdui_layout` is what a binary falls back to for a renderer value it
179
+ * does not know, so it is the one every binary can draw (#4496). */
180
+ export declare const SITE_NODE_SCREEN_RENDERER: "sdui_layout";
181
+ /**
182
+ * One page of the site as an SDUI node — the `WebView` a screen puts its website in, with native UI
183
+ * above, below or over it (RFC 0079 §3). The page URL is {@link sitePageUrl}`(site.origin, page.path)`
184
+ * and the config is {@link siteWebViewPreset}`(site)` with `page.webView` merged over it — exactly
185
+ * what {@link defineSiteTab} gives a Tier-3 tab, so a page moves between the two shapes unchanged.
186
+ *
187
+ * Put it at the screen root, or as a direct child of a root `VStack` (header / page / footer),
188
+ * `HStack` or `ZStack`. Never inside a `LazyList`, `Pager`, `Carousel` or `CollapsingHeader`, and
189
+ * at most one per screen: the validator rejects those (RFC 0079 §9).
190
+ */
191
+ export declare function sitePageNode(site: SitePageSite, page: SitePageNodeSpec, opts?: {
192
+ id?: string;
193
+ }): Component;
194
+ /**
195
+ * Whether a screen is a Tier-3 site screen that desugars into the node form (RFC 0079 §8): a
196
+ * `webview_native_bridge` screen with a `url`, no `logicBundle` (a worker-backed T3 screen keeps its
197
+ * own path until §14 Q1) and no `webViewConfig.internalLinksAsScreens` (a hosted-site stack, §14 Q2).
198
+ * Every screen {@link siteScreens} builds desugars.
199
+ */
200
+ export declare function isDesugarableSiteScreen(descriptor: ScreenDescriptor): boolean;
201
+ /**
202
+ * The T3 → node desugar (RFC 0079 §3, §8). A desugarable Tier-3 site screen
203
+ * ({@link isDesugarableSiteScreen}) comes back as an SDUI screen ({@link SITE_NODE_SCREEN_RENDERER})
204
+ * whose `payload` is the primary WebView node: the screen's `url` and `webViewConfig` verbatim, with
205
+ * `role: "primary"`, `fill` and scrolling on, and the screen's `title` (else the page's host) as the
206
+ * node's accessible name. Every other screen field (id, title, cache control, top bar, …) is kept;
207
+ * `url` and `webViewConfig` move into the node. Any other descriptor comes back unchanged — the same
208
+ * object. Pure: the input is never mutated.
209
+ */
210
+ export declare function desugarSiteScreen(descriptor: ScreenDescriptor): ScreenDescriptor;
211
+ /** Options for {@link siteScreens}. */
212
+ export interface SiteScreensOptions extends SiteShellCheckOptions {
213
+ /** Absent ⇒ `"t3"`. See {@link SiteScreenForm}. */
214
+ form?: SiteScreenForm;
215
+ }
149
216
  /** Every site page's descriptor plus the {@link SITE_PAGE_SCREEN_ID} fallback, keyed by
150
- * screen id. */
151
- export declare function siteScreens(site: SiteShellConfig): Record<string, ScreenDescriptor>;
217
+ * screen id. `form: "node"` serves each one through {@link desugarSiteScreen}: the same pages, as
218
+ * SDUI screens whose root is the primary WebView node (RFC 0079 §8). The fallback keeps
219
+ * `keepAlive: false` in both forms. */
220
+ export declare function siteScreens(site: SiteShellConfig, opts?: SiteScreensOptions): Record<string, ScreenDescriptor>;
152
221
  /** `NavigationConfig.site` for a site shell (RFC 0062 site routing): the site's origins, one
153
222
  * route per page, and {@link SITE_PAGE_SCREEN_ID} as the fallback. Feed it to
154
223
  * `defineApp({ navigation: { site } })`; every platform resolves links against it. */
@@ -185,9 +254,16 @@ export declare function siteNavKind(site: SiteShellConfig): "responsive" | "sing
185
254
  export declare function siteSidebar(site: SiteShellConfig): NavTabItem[];
186
255
  /** Tab-bar and drawer items for a site. Pages beyond {@link SITE_SHELL_MAX_TABS} that
187
256
  * asked for a tab fall into the drawer rather than disappearing. */
188
- export declare function siteNav(site: SiteShellConfig): {
257
+ export declare function siteNav(site: SiteShellConfig, opts?: SiteShellCheckOptions): {
189
258
  tabs: NavTabItem[];
190
259
  drawer: DrawerItem[];
191
260
  };
261
+ /** Options for {@link assertSiteShellConfig} (and the builders that run it). */
262
+ export interface SiteShellCheckOptions {
263
+ /** Absent or `true` ⇒ at least one page must have `placement: "tab"`, as a site shell needs. A
264
+ * host whose own native screens own the tab bar (RFC 0079 phase 3 — branded-lite with website
265
+ * pages in its drawer) passes `false`: its site block may be drawer-only. */
266
+ requireTab?: boolean;
267
+ }
192
268
  /** Throws with a legible message on a site description no shell can build from. */
193
- export declare function assertSiteShellConfig(site: SiteShellConfig): void;
269
+ export declare function assertSiteShellConfig(site: SiteShellConfig, opts?: SiteShellCheckOptions): void;
@@ -14481,11 +14481,59 @@ function defineSitePageScreen(site) {
14481
14481
  webViewConfig: { ...preset, keepAlive: false }
14482
14482
  };
14483
14483
  }
14484
- function siteScreens(site) {
14485
- assertSiteShellConfig(site);
14484
+ var SITE_PAGE_NODE_ID = "site_page_view";
14485
+ var SITE_SCREEN_FORMS = ["t3", "node"];
14486
+ var SITE_NODE_SCREEN_RENDERER = "sdui_layout";
14487
+ function primarySiteWebView(url, config, id, label2) {
14488
+ return {
14489
+ id,
14490
+ body: {
14491
+ package: "himalaya",
14492
+ type: "WebView",
14493
+ props: { url, role: "primary", fill: true, scrollEnabled: true, ...config ? { config } : {} }
14494
+ },
14495
+ modifiers: { weight: 1, accessibilityLabel: label2?.trim() || hostOf(url) }
14496
+ };
14497
+ }
14498
+ function hostOf(url) {
14499
+ try {
14500
+ return new URL(url).host || url;
14501
+ } catch {
14502
+ return url;
14503
+ }
14504
+ }
14505
+ function sitePageNode(site, page, opts) {
14506
+ if (!site || site.kind !== "wix" && site.kind !== "base44") {
14507
+ throw new Error(`site kind ${JSON.stringify(site?.kind)} must be "wix" or "base44"`);
14508
+ }
14509
+ if (!page || typeof page.path !== "string") {
14510
+ throw new Error("a site page node needs a path");
14511
+ }
14512
+ const url = sitePageUrl(site.origin, page.path);
14513
+ return primarySiteWebView(url, { ...siteWebViewPreset(site), ...page.webView ?? {} }, opts?.id ?? SITE_PAGE_NODE_ID, page.title);
14514
+ }
14515
+ function isDesugarableSiteScreen(descriptor) {
14516
+ return !!descriptor && descriptor.renderer === "webview_native_bridge" && typeof descriptor.url === "string" && descriptor.url !== "" && descriptor.logicBundle === void 0 && descriptor.webViewConfig?.internalLinksAsScreens !== true;
14517
+ }
14518
+ function desugarSiteScreen(descriptor) {
14519
+ if (!isDesugarableSiteScreen(descriptor)) return descriptor;
14520
+ const { url, webViewConfig, ...screen } = descriptor;
14486
14521
  return {
14487
- ...Object.fromEntries(site.pages.map((page) => [siteScreenId(page), defineSiteTab(site, page)])),
14488
- [SITE_PAGE_SCREEN_ID]: defineSitePageScreen(site)
14522
+ ...screen,
14523
+ renderer: SITE_NODE_SCREEN_RENDERER,
14524
+ payload: primarySiteWebView(url, webViewConfig ? { ...webViewConfig } : void 0, SITE_PAGE_NODE_ID, descriptor.title)
14525
+ };
14526
+ }
14527
+ function siteScreens(site, opts) {
14528
+ assertSiteShellConfig(site, opts);
14529
+ const form = opts?.form ?? "t3";
14530
+ if (!SITE_SCREEN_FORMS.includes(form)) {
14531
+ throw new Error(`site screen form ${JSON.stringify(form)} must be one of ${SITE_SCREEN_FORMS.join(", ")}`);
14532
+ }
14533
+ const shape = (d) => form === "node" ? desugarSiteScreen(d) : d;
14534
+ return {
14535
+ ...Object.fromEntries(site.pages.map((page) => [siteScreenId(page), shape(defineSiteTab(site, page))])),
14536
+ [SITE_PAGE_SCREEN_ID]: shape(defineSitePageScreen(site))
14489
14537
  };
14490
14538
  }
14491
14539
  function siteRoutePath(path) {
@@ -14584,8 +14632,8 @@ function siteSidebar(site) {
14584
14632
  assertSiteShellConfig(site);
14585
14633
  return site.pages.filter((page) => (page.placement ?? "tab") !== "overflow").map((page) => ({ id: page.id, screenId: siteScreenId(page), label: page.title, icon: page.icon ?? "globe" }));
14586
14634
  }
14587
- function siteNav(site) {
14588
- assertSiteShellConfig(site);
14635
+ function siteNav(site, opts) {
14636
+ assertSiteShellConfig(site, opts);
14589
14637
  const tabs = [];
14590
14638
  const drawer = [];
14591
14639
  for (const page of site.pages) {
@@ -14614,7 +14662,7 @@ function assertSitePage(page) {
14614
14662
  throw new Error(`site page ${page.id} needs a title`);
14615
14663
  }
14616
14664
  }
14617
- function assertSiteShellConfig(site) {
14665
+ function assertSiteShellConfig(site, opts) {
14618
14666
  normalizeSiteOrigin(site.origin);
14619
14667
  if (site.kind !== "wix" && site.kind !== "base44") {
14620
14668
  throw new Error(`site kind ${JSON.stringify(site.kind)} must be "wix" or "base44"`);
@@ -14639,7 +14687,7 @@ function assertSiteShellConfig(site) {
14639
14687
  if (site.menuSource !== void 0 && site.menuSource !== "contract" && site.menuSource !== "runtime") {
14640
14688
  throw new Error(`site menuSource ${JSON.stringify(site.menuSource)} must be "contract" or "runtime"`);
14641
14689
  }
14642
- if (!site.pages.some((page) => (page.placement ?? "tab") === "tab")) {
14690
+ if (opts?.requireTab !== false && !site.pages.some((page) => (page.placement ?? "tab") === "tab")) {
14643
14691
  throw new Error('a site shell needs at least one page with placement "tab"');
14644
14692
  }
14645
14693
  }
@@ -15376,7 +15424,10 @@ export {
15376
15424
  SITE_MENU_SYSTEM_SEGMENT,
15377
15425
  SITE_MENU_SYSTEM_TITLE,
15378
15426
  SITE_NAV_LINKS_JS,
15427
+ SITE_NODE_SCREEN_RENDERER,
15428
+ SITE_PAGE_NODE_ID,
15379
15429
  SITE_PAGE_SCREEN_ID,
15430
+ SITE_SCREEN_FORMS,
15380
15431
  SITE_SCREEN_PREFIX,
15381
15432
  SITE_SHELL_MAX_TABS,
15382
15433
  SIZE_CLASS_BREAKPOINTS,
@@ -15432,6 +15483,7 @@ export {
15432
15483
  defineApp,
15433
15484
  defineSitePageScreen,
15434
15485
  defineSiteTab,
15486
+ desugarSiteScreen,
15435
15487
  effectiveFieldRule,
15436
15488
  effectiveWebViewInstanceId,
15437
15489
  errorMessageFor,
@@ -15447,6 +15499,7 @@ export {
15447
15499
  impliedKeyboard,
15448
15500
  isComponentAllowed,
15449
15501
  isComponentAllowedForFamily,
15502
+ isDesugarableSiteScreen,
15450
15503
  isInternalEmail,
15451
15504
  isPlayerRequirements,
15452
15505
  isRTL,
@@ -15506,6 +15559,7 @@ export {
15506
15559
  siteNav,
15507
15560
  siteNavConfig,
15508
15561
  siteNavKind,
15562
+ sitePageNode,
15509
15563
  sitePageUrl,
15510
15564
  siteScreenId,
15511
15565
  siteScreens,
@@ -8338,6 +8338,136 @@ function workerSubtreePolicyErrors(policy) {
8338
8338
  return out;
8339
8339
  }
8340
8340
 
8341
+ // ../../core/ts/src/site-shell.ts
8342
+ function normalizeSiteOrigin(origin) {
8343
+ const raw = (typeof origin === "string" ? origin : "").trim();
8344
+ let url;
8345
+ try {
8346
+ url = new URL(raw);
8347
+ } catch {
8348
+ throw new Error(`site origin ${JSON.stringify(origin)} is not a URL`);
8349
+ }
8350
+ if (url.protocol !== "https:") {
8351
+ throw new Error(`site origin ${JSON.stringify(origin)} must be https`);
8352
+ }
8353
+ if (url.username || url.password) {
8354
+ throw new Error(`site origin ${JSON.stringify(origin)} must not carry credentials`);
8355
+ }
8356
+ if (url.search || url.hash) {
8357
+ throw new Error(`site origin ${JSON.stringify(origin)} must not carry a query or fragment`);
8358
+ }
8359
+ const path = url.pathname.replace(/\/+$/, "");
8360
+ return `https://${url.host.toLowerCase()}${path}`;
8361
+ }
8362
+ function siteAllowedOrigins(origin, kind) {
8363
+ const base = new URL(normalizeSiteOrigin(origin));
8364
+ const host = base.host;
8365
+ const path = base.pathname.replace(/\/+$/, "");
8366
+ const hosts = [host];
8367
+ const isWixFreeHost = host.endsWith(".wixsite.com") || host.endsWith(".wixstudio.com");
8368
+ if (!isWixFreeHost && kind === "wix") hosts.push(host.startsWith("www.") ? host.slice(4) : `www.${host}`);
8369
+ return hosts.map((h) => `https://${h}${path}/`);
8370
+ }
8371
+ function sitePageUrl(origin, path) {
8372
+ const base = normalizeSiteOrigin(origin);
8373
+ const raw = (typeof path === "string" ? path : "").trim();
8374
+ if (/^[a-z][a-z0-9+.-]*:/i.test(raw) || raw.startsWith("//")) {
8375
+ throw new Error(`site page path ${JSON.stringify(path)} must be relative to the site`);
8376
+ }
8377
+ if (raw.includes("\\")) {
8378
+ throw new Error(`site page path ${JSON.stringify(path)} must not contain a backslash`);
8379
+ }
8380
+ const trimmed = raw.replace(/^\/+/, "");
8381
+ const joined = trimmed ? `${base}/${trimmed}` : base;
8382
+ const resolved = new URL(joined);
8383
+ const baseUrl = new URL(base);
8384
+ const basePath = baseUrl.pathname.replace(/\/+$/, "");
8385
+ const inside = resolved.pathname === basePath || resolved.pathname === `${basePath}/` || resolved.pathname.startsWith(`${basePath}/`);
8386
+ if (resolved.host !== baseUrl.host || !inside) {
8387
+ throw new Error(`site page path ${JSON.stringify(path)} resolves outside the site`);
8388
+ }
8389
+ return joined;
8390
+ }
8391
+ function resolveSiteChrome(chrome) {
8392
+ return {
8393
+ hideSiteHeader: chrome?.hideSiteHeader ?? true,
8394
+ hideSiteMenu: chrome?.hideSiteMenu ?? true,
8395
+ hideSiteFooter: chrome?.hideSiteFooter ?? true,
8396
+ hideWixAds: chrome?.hideWixAds ?? true
8397
+ };
8398
+ }
8399
+ function siteWebViewPreset(site) {
8400
+ const chrome = resolveSiteChrome(site.chrome);
8401
+ return {
8402
+ layout: "inset",
8403
+ immersive: true,
8404
+ // Chrome hiding is binary-shipped (RFC 0062): only these flags travel over the air, so an
8405
+ // owner can flip one without a new build, and no page script is served OTA (invariant 15).
8406
+ hideHostedSiteHeader: chrome.hideSiteHeader,
8407
+ hideHostedSiteFooter: chrome.hideSiteFooter,
8408
+ // Wix ads only exist on Wix free sites; a Base44 site never gets the Wix selectors.
8409
+ hideWixAds: site.kind === "wix" && chrome.hideWixAds,
8410
+ // The site's own menu duplicates the native tabs/drawer. Wix markers only, like the ads.
8411
+ hideHostedSiteMenu: site.kind === "wix" && chrome.hideSiteMenu,
8412
+ // RFC 0062 §5.8 — a Base44 app is signed in natively and its session carried into the page.
8413
+ // The host still refuses unless the app declares the `base44` capability. A Wix site bridges
8414
+ // only when its app signs members in natively (`site.sessionBridge`); the host additionally
8415
+ // needs the app's baked site and its Wix member login installed.
8416
+ ...site.kind === "base44" ? { hostedSiteAdapter: "base44", sessionBridge: true } : {},
8417
+ ...site.kind === "wix" && site.sessionBridge ? { hostedSiteAdapter: "wix", sessionBridge: true } : {},
8418
+ pullToRefresh: true,
8419
+ showProgressBar: true,
8420
+ syncStatusBarAppearance: true,
8421
+ allowedOrigins: siteAllowedOrigins(site.origin, site.kind),
8422
+ externalLinks: "system_browser",
8423
+ promptBeforeExternalLink: true,
8424
+ // A real external site, not Himalaya screens — its links stay in its WebView.
8425
+ interceptInternalLinks: false,
8426
+ floatingBackButton: { enabled: true },
8427
+ autoReloadOnCrash: true,
8428
+ domStorageEnabled: true,
8429
+ // A live site, not app-bundled content: honor its HTTP caching. The default
8430
+ // (`respectHttpCache` unset) is offline-first — iOS applies that to the top-level page only, but
8431
+ // Android's WebView cache mode governs EVERY request, so a hosted site's API fetches, scripts and
8432
+ // page data came from cache regardless of expiry, cookies or CORS headers: a signed-in member got
8433
+ // the visitor's cached member state back (the site flipped them to its login wall), and a cached
8434
+ // non-CORS response replayed for a CORS fetch left the page blank (#3700).
8435
+ respectHttpCache: true,
8436
+ // Each tab keeps its own warm WebView across tab switches (keyed by screen id on both
8437
+ // platforms; see SITE_SHELL_MAX_TABS for why the tab count stays within the store's cap).
8438
+ keepAlive: true
8439
+ };
8440
+ }
8441
+ var SITE_PAGE_NODE_ID = "site_page_view";
8442
+ function primarySiteWebView(url, config, id, label2) {
8443
+ return {
8444
+ id,
8445
+ body: {
8446
+ package: "himalaya",
8447
+ type: "WebView",
8448
+ props: { url, role: "primary", fill: true, scrollEnabled: true, ...config ? { config } : {} }
8449
+ },
8450
+ modifiers: { weight: 1, accessibilityLabel: label2?.trim() || hostOf(url) }
8451
+ };
8452
+ }
8453
+ function hostOf(url) {
8454
+ try {
8455
+ return new URL(url).host || url;
8456
+ } catch {
8457
+ return url;
8458
+ }
8459
+ }
8460
+ function sitePageNode(site, page, opts) {
8461
+ if (!site || site.kind !== "wix" && site.kind !== "base44") {
8462
+ throw new Error(`site kind ${JSON.stringify(site?.kind)} must be "wix" or "base44"`);
8463
+ }
8464
+ if (!page || typeof page.path !== "string") {
8465
+ throw new Error("a site page node needs a path");
8466
+ }
8467
+ const url = sitePageUrl(site.origin, page.path);
8468
+ return primarySiteWebView(url, { ...siteWebViewPreset(site), ...page.webView ?? {} }, opts?.id ?? SITE_PAGE_NODE_ID, page.title);
8469
+ }
8470
+
8341
8471
  // ../../core/ts/src/rich-content-limits.generated.ts
8342
8472
  var RICH_CONTENT_LIMITS = Object.freeze({ maxBytes: 262144, maxNodes: 5e3, maxDepth: 16 });
8343
8473
 
@@ -9340,6 +9470,9 @@ function webView(props, opts) {
9340
9470
  body: { package: "himalaya", type: "WebView", props }
9341
9471
  };
9342
9472
  }
9473
+ function sitePage(site, page, opts) {
9474
+ return sitePageNode(site, page, opts);
9475
+ }
9343
9476
  function dateStrip(props, opts) {
9344
9477
  const selected = props.selectedPath ?? props.selectedId;
9345
9478
  return filterChips(
@@ -9598,6 +9731,7 @@ export {
9598
9731
  segmentedControl,
9599
9732
  selectionControl,
9600
9733
  shape,
9734
+ sitePage,
9601
9735
  skRect,
9602
9736
  skeleton,
9603
9737
  slider,