@wix/himalaya-cli 0.1168.0 → 0.1169.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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +18 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +31 -0
- package/dist/cli.mjs +341 -155
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/wix-business-context.md +1 -1
- package/package.json +2 -2
- package/templates/brandy/config.ts +7 -2
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts
CHANGED
|
@@ -36,6 +36,16 @@ export interface SiteChrome {
|
|
|
36
36
|
* without a new binary, because the flag rides the OTA descriptor. */
|
|
37
37
|
hideWixAds?: boolean;
|
|
38
38
|
}
|
|
39
|
+
/** Which native chrome frames the site. Rides the served `navigation.navKind`, so changing it is
|
|
40
|
+
* an OTA config change, never a new binary.
|
|
41
|
+
* - `auto` (default): bottom tabs on a phone and a sidebar rail on a regular size class
|
|
42
|
+
* (`responsive`) — or, when the site has at most one tab, no tab bar at all (`single`: one
|
|
43
|
+
* stack, the drawer lists every page). A bar holding a single tab is chrome with no choice in it.
|
|
44
|
+
* - `tabs`: bottom tabs on every size class. `sidebar`: the rail on every size class.
|
|
45
|
+
* - `drawer`: no tab bar; the drawer is the primary navigation and re-roots on each pick.
|
|
46
|
+
* - `single`: no tab bar; one stack, and drawer picks push onto it. */
|
|
47
|
+
export type SiteLayout = "auto" | "tabs" | "drawer" | "sidebar" | "single";
|
|
48
|
+
export declare const SITE_LAYOUTS: readonly SiteLayout[];
|
|
39
49
|
/** The whole site as a shell sees it. Mirrors the `site` block of a site-shell app's
|
|
40
50
|
* `provisioning.json`. */
|
|
41
51
|
export interface SiteShellConfig {
|
|
@@ -45,6 +55,8 @@ export interface SiteShellConfig {
|
|
|
45
55
|
kind: SiteKind;
|
|
46
56
|
pages: readonly SitePage[];
|
|
47
57
|
chrome?: SiteChrome;
|
|
58
|
+
/** Absent ⇒ `"auto"`. See {@link SiteLayout}. */
|
|
59
|
+
layout?: SiteLayout;
|
|
48
60
|
}
|
|
49
61
|
/** At most four site tabs; the rest belong in the drawer. Four, not the usual phone-bar five,
|
|
50
62
|
* because every tab keeps its WebView warm (`keepAlive`) and the native keep-alive stores
|
|
@@ -140,6 +152,12 @@ export interface SiteLinkTarget {
|
|
|
140
152
|
* `<user>.wixsite.com` host `/my-site/../other` is somebody else's site.
|
|
141
153
|
*/
|
|
142
154
|
export declare function resolveSiteLink(url: string, site: SiteNavConfig | undefined): SiteLinkTarget | null;
|
|
155
|
+
/** The `navigation.navKind` a site's {@link SiteLayout} asks for. */
|
|
156
|
+
export declare function siteNavKind(site: SiteShellConfig): "responsive" | "single" | "bottomTabs" | "drawer" | "sidebar";
|
|
157
|
+
/** Sidebar-rail items for a site: EVERY page the drawer lists, under its tab id. The native rail
|
|
158
|
+
* otherwise derives from the (at most four) tabs and suppresses the drawer, so a `drawer`
|
|
159
|
+
* page would be unreachable on a tablet and under `layout: "sidebar"`. */
|
|
160
|
+
export declare function siteSidebar(site: SiteShellConfig): NavTabItem[];
|
|
143
161
|
/** Tab-bar and drawer items for a site. Pages beyond {@link SITE_SHELL_MAX_TABS} that
|
|
144
162
|
* asked for a tab fall into the drawer rather than disappearing. */
|
|
145
163
|
export declare function siteNav(site: SiteShellConfig): {
|
|
@@ -13088,6 +13088,7 @@ var AppRegistryClient = class {
|
|
|
13088
13088
|
};
|
|
13089
13089
|
|
|
13090
13090
|
// ../../core/ts/src/site-shell.ts
|
|
13091
|
+
var SITE_LAYOUTS = ["auto", "tabs", "drawer", "sidebar", "single"];
|
|
13091
13092
|
var SITE_SHELL_MAX_TABS = 4;
|
|
13092
13093
|
var SITE_SCREEN_PREFIX = "site_";
|
|
13093
13094
|
var SITE_PAGE_SCREEN_ID = "site_page";
|
|
@@ -13300,6 +13301,27 @@ function resolveSiteLink(url, site) {
|
|
|
13300
13301
|
const screenId = best?.screenId || site.fallbackScreenId || (site.routes ?? []).find((route) => route?.screenId && pathSegments(siteRoutePath(route.path ?? "")).length === 0)?.screenId;
|
|
13301
13302
|
return screenId ? { screenId, url: url.trim() } : null;
|
|
13302
13303
|
}
|
|
13304
|
+
function siteNavKind(site) {
|
|
13305
|
+
const layout = site.layout ?? "auto";
|
|
13306
|
+
switch (layout) {
|
|
13307
|
+
case "auto":
|
|
13308
|
+
return siteNav(site).tabs.length <= 1 ? "single" : "responsive";
|
|
13309
|
+
case "tabs":
|
|
13310
|
+
return "bottomTabs";
|
|
13311
|
+
case "drawer":
|
|
13312
|
+
return "drawer";
|
|
13313
|
+
case "sidebar":
|
|
13314
|
+
return "sidebar";
|
|
13315
|
+
case "single":
|
|
13316
|
+
return "single";
|
|
13317
|
+
default:
|
|
13318
|
+
throw new Error(`site layout ${JSON.stringify(layout)} must be one of ${SITE_LAYOUTS.join(", ")}`);
|
|
13319
|
+
}
|
|
13320
|
+
}
|
|
13321
|
+
function siteSidebar(site) {
|
|
13322
|
+
assertSiteShellConfig(site);
|
|
13323
|
+
return site.pages.filter((page) => (page.placement ?? "tab") !== "overflow").map((page) => ({ id: page.id, screenId: siteScreenId(page), label: page.title, icon: page.icon ?? "globe" }));
|
|
13324
|
+
}
|
|
13303
13325
|
function siteNav(site) {
|
|
13304
13326
|
assertSiteShellConfig(site);
|
|
13305
13327
|
const tabs = [];
|
|
@@ -13320,6 +13342,9 @@ function assertSitePage(page) {
|
|
|
13320
13342
|
if (!page || typeof page.id !== "string" || !PAGE_ID.test(page.id)) {
|
|
13321
13343
|
throw new Error(`site page id ${JSON.stringify(page?.id)} must match ${PAGE_ID}`);
|
|
13322
13344
|
}
|
|
13345
|
+
if (page.id.startsWith("drawer_")) {
|
|
13346
|
+
throw new Error(`site page id ${JSON.stringify(page.id)} must not start with "drawer_" (reserved for drawer and native rows)`);
|
|
13347
|
+
}
|
|
13323
13348
|
if (siteScreenId(page) === SITE_PAGE_SCREEN_ID) {
|
|
13324
13349
|
throw new Error(`site page id "page" is reserved for the ${SITE_PAGE_SCREEN_ID} fallback screen`);
|
|
13325
13350
|
}
|
|
@@ -13342,6 +13367,9 @@ function assertSiteShellConfig(site) {
|
|
|
13342
13367
|
seen.add(page.id);
|
|
13343
13368
|
sitePageUrl(site.origin, page.path);
|
|
13344
13369
|
}
|
|
13370
|
+
if (site.layout !== void 0 && !SITE_LAYOUTS.includes(site.layout)) {
|
|
13371
|
+
throw new Error(`site layout ${JSON.stringify(site.layout)} must be one of ${SITE_LAYOUTS.join(", ")}`);
|
|
13372
|
+
}
|
|
13345
13373
|
if (!site.pages.some((page) => (page.placement ?? "tab") === "tab")) {
|
|
13346
13374
|
throw new Error('a site shell needs at least one page with placement "tab"');
|
|
13347
13375
|
}
|
|
@@ -13380,6 +13408,7 @@ export {
|
|
|
13380
13408
|
PROJECTION_SNAPSHOT_SIZE,
|
|
13381
13409
|
RICH_CONTENT_EDITOR_TOOLS,
|
|
13382
13410
|
RTL_LOCALES,
|
|
13411
|
+
SITE_LAYOUTS,
|
|
13383
13412
|
SITE_PAGE_SCREEN_ID,
|
|
13384
13413
|
SITE_SCREEN_PREFIX,
|
|
13385
13414
|
SITE_SHELL_MAX_TABS,
|
|
@@ -13471,9 +13500,11 @@ export {
|
|
|
13471
13500
|
siteLinkableScreens,
|
|
13472
13501
|
siteNav,
|
|
13473
13502
|
siteNavConfig,
|
|
13503
|
+
siteNavKind,
|
|
13474
13504
|
sitePageUrl,
|
|
13475
13505
|
siteScreenId,
|
|
13476
13506
|
siteScreens,
|
|
13507
|
+
siteSidebar,
|
|
13477
13508
|
siteWebViewPreset,
|
|
13478
13509
|
stripOriginParams,
|
|
13479
13510
|
summarize,
|