@wix/himalaya-cli 0.1719.0 → 0.1721.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/dev-server/src/app-config.d.ts +1 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-module.d.ts +3 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/provisioning-facts.d.ts +48 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
- package/dist/cli.mjs +205 -57
- package/guides/one-app-to-himi-app.md +23 -0
- package/package.json +2 -2
|
@@ -138,6 +138,7 @@ export interface NavigationConfig {
|
|
|
138
138
|
cashierConfig?: import("@wix/himalaya/core").CashierConfig;
|
|
139
139
|
base44Config?: import("@wix/himalaya/core").Base44Config;
|
|
140
140
|
wixIapConfig?: import("@wix/himalaya/core").WixIapConfig;
|
|
141
|
+
contract?: import("./provisioning-facts.js").ServedReleaseContract;
|
|
141
142
|
wixPlatformConfig?: WixPlatformConfig;
|
|
142
143
|
devGatewayConfig?: DevGatewayConfig;
|
|
143
144
|
dataSchema?: import("@wix/himalaya/core").DataSchemaConfig;
|
|
@@ -199,6 +199,9 @@ export interface DerivedAppMeta {
|
|
|
199
199
|
* `development-site` is not). Resolves a frog `mobileAppId` template such as Branded Lite's
|
|
200
200
|
* `brandedLite_{msid}`: the binary is bound by its Headless clientId and holds no msid. */
|
|
201
201
|
provisionedMsid?: string;
|
|
202
|
+
/** `provisioning.json`'s contract blocks for a site package (RFC 0079 §10), served as the
|
|
203
|
+
* app-config's `contract` for the dist projection. Read from disk at load time. */
|
|
204
|
+
releaseContract?: import("./provisioning-facts.js").ServedReleaseContract;
|
|
202
205
|
/** Forwarded from AppConfig.control for the OTA app-config channel. */
|
|
203
206
|
control?: import("@wix/himalaya/core").AppControl;
|
|
204
207
|
/** Forwarded from AppConfig.appLinkHosts for the OTA app-config channel. */
|
|
@@ -1,7 +1,54 @@
|
|
|
1
1
|
export interface ProvisioningFacts {
|
|
2
2
|
siteId?: string;
|
|
3
3
|
installedVerticals?: string[];
|
|
4
|
+
/** RFC 0079 §10 — the content package's contract blocks, served in its app-config as `contract`
|
|
5
|
+
* so the dist projection can read them. Present only for a package that carries a site block. */
|
|
6
|
+
contract?: ServedReleaseContract;
|
|
4
7
|
}
|
|
5
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* The contract blocks a release serves in its app-config (`contract`), for serve-control's dist
|
|
10
|
+
* projection (core/serve-control/src/dist-contract.ts, `releaseContractBlocksOf` in
|
|
11
|
+
* tools/mobile-dist/dist-contract-merge.ts) — RFC 0079 §10 "Dist": a website-only release on the
|
|
12
|
+
* Branded Lite shell bakes ITS site, binding and identity, never the shell's reference ones.
|
|
13
|
+
*
|
|
14
|
+
* Copied, not validated: the projection validates every value it bakes (all or nothing) and refuses
|
|
15
|
+
* a contract that is present but invalid, so this module stays a plain reader. Only the keys below
|
|
16
|
+
* are copied — a provisioning file carries much more (location, hours, FAQ, …) that has no business
|
|
17
|
+
* in a served document.
|
|
18
|
+
*/
|
|
19
|
+
export interface ServedReleaseContract {
|
|
20
|
+
/** The site-shell `site` block (`origin`, `kind`, `pages`, …), as the package wrote it. */
|
|
21
|
+
site: Record<string, unknown>;
|
|
22
|
+
/** `bindings { wix, base44 }` and the older top-level spellings, as written: the projection folds
|
|
23
|
+
* them with the shared rule (two that disagree are refused, never resolved). */
|
|
24
|
+
bindings?: Record<string, unknown>;
|
|
25
|
+
wix?: Record<string, unknown>;
|
|
26
|
+
base44?: Record<string, unknown>;
|
|
27
|
+
/** The public identity fields the shared contract names beside `appName` (which the app-config's
|
|
28
|
+
* `name` already carries). A non-object `identity` is served AS WRITTEN, so the projection refuses
|
|
29
|
+
* it instead of quietly baking neutral values over a typo. */
|
|
30
|
+
identity?: Partial<Record<(typeof SERVED_IDENTITY_KEYS)[number], unknown>> | ServedMalformedBlock;
|
|
31
|
+
/** `branding.secondaryColor` only — the primary colour and the icon come from the release's
|
|
32
|
+
* tokens and icon. */
|
|
33
|
+
branding?: {
|
|
34
|
+
secondaryColor?: unknown;
|
|
35
|
+
} | ServedMalformedBlock;
|
|
36
|
+
/** A native app with website pages names its verticals and CMS collections beside its site. */
|
|
37
|
+
installedVerticals?: unknown[];
|
|
38
|
+
cmsCollections?: unknown[];
|
|
39
|
+
}
|
|
40
|
+
/** A block the package wrote with the wrong type (a string, a number, an array): served as written,
|
|
41
|
+
* for the projection to refuse. */
|
|
42
|
+
export type ServedMalformedBlock = string | number | boolean | unknown[];
|
|
43
|
+
/** The identity fields a release's served contract carries. */
|
|
44
|
+
export declare const SERVED_IDENTITY_KEYS: readonly ["businessName", "tagline", "supportUrl", "privacyUrl", "termsUrl"];
|
|
45
|
+
/**
|
|
46
|
+
* The served contract of a parsed provisioning document, or undefined when it carries no site
|
|
47
|
+
* block. "A site block" is decided by shape only — an object naming an `origin` and a `pages` list —
|
|
48
|
+
* so a malformed one is still SERVED and the projection refuses it, rather than this reader quietly
|
|
49
|
+
* dropping it and the build inheriting the shell's reference site. Pure.
|
|
50
|
+
*/
|
|
51
|
+
export declare function servedReleaseContractOf(raw: unknown): ServedReleaseContract | undefined;
|
|
52
|
+
/** `<dir>/provisioning.json`'s site, verticals and (for a site package) contract blocks. A missing or unreadable file, or a field of
|
|
6
53
|
* the wrong type, reads as absent: the file is a build input, never a reason to fail one. */
|
|
7
54
|
export declare function readProvisioningFacts(dir: string): ProvisioningFacts;
|
|
@@ -9602,6 +9602,7 @@ function deriveAppMeta(name, m, platforms = {}, provisioning = {}) {
|
|
|
9602
9602
|
...config.push?.screens ? { pushScreens: config.push.screens } : {},
|
|
9603
9603
|
...provisioning.installedVerticals ? { installedVerticals: provisioning.installedVerticals } : {},
|
|
9604
9604
|
...isMetaSiteId(provisioning.siteId) ? { provisionedMsid: provisioning.siteId } : {},
|
|
9605
|
+
...provisioning.contract ? { releaseContract: provisioning.contract } : {},
|
|
9605
9606
|
control: config.control,
|
|
9606
9607
|
appLinkHosts: config.appLinkHosts,
|
|
9607
9608
|
permissionCopy: config.permissionCopy,
|
package/dist/cli.mjs
CHANGED
|
@@ -4700,7 +4700,6 @@ function assertSiteShellConfig(site, opts) {
|
|
|
4700
4700
|
var SITE_LAYOUTS, SITE_SHELL_MAX_TABS, SITE_SCREEN_PREFIX, SITE_PAGE_SCREEN_ID, BASE44_ORIGINS, PAGE_ID, SITE_PAGE_NODE_ID, SITE_SCREEN_FORMS, SITE_NODE_SCREEN_RENDERER;
|
|
4701
4701
|
var init_site_shell = __esm({
|
|
4702
4702
|
"../../core/ts/src/site-shell.ts"() {
|
|
4703
|
-
"use strict";
|
|
4704
4703
|
init_define_HHP_CATALOG();
|
|
4705
4704
|
init_site_screen_form();
|
|
4706
4705
|
init_webview_embedded();
|
|
@@ -11822,6 +11821,7 @@ function deriveAppMeta(name, m2, platforms = {}, provisioning = {}) {
|
|
|
11822
11821
|
...config.push?.screens ? { pushScreens: config.push.screens } : {},
|
|
11823
11822
|
...provisioning.installedVerticals ? { installedVerticals: provisioning.installedVerticals } : {},
|
|
11824
11823
|
...isMetaSiteId(provisioning.siteId) ? { provisionedMsid: provisioning.siteId } : {},
|
|
11824
|
+
...provisioning.contract ? { releaseContract: provisioning.contract } : {},
|
|
11825
11825
|
control: config.control,
|
|
11826
11826
|
appLinkHosts: config.appLinkHosts,
|
|
11827
11827
|
permissionCopy: config.permissionCopy,
|
|
@@ -11879,6 +11879,30 @@ var init_app_module = __esm({
|
|
|
11879
11879
|
// ../../core/dev-server/src/provisioning-facts.ts
|
|
11880
11880
|
import { readFileSync as readFileSync15 } from "node:fs";
|
|
11881
11881
|
import { resolve as resolve13 } from "node:path";
|
|
11882
|
+
function servedReleaseContractOf(raw) {
|
|
11883
|
+
if (!isPlainObject(raw)) return void 0;
|
|
11884
|
+
const site = raw.site;
|
|
11885
|
+
if (!isPlainObject(site) || !("origin" in site) || !("pages" in site)) return void 0;
|
|
11886
|
+
const contract = { site: jsonCopy(site) };
|
|
11887
|
+
for (const key4 of ["bindings", "wix", "base44"]) {
|
|
11888
|
+
if (raw[key4] != null) contract[key4] = jsonCopy(raw[key4]);
|
|
11889
|
+
}
|
|
11890
|
+
if (isPlainObject(raw.identity)) {
|
|
11891
|
+
const identity = {};
|
|
11892
|
+
for (const key4 of SERVED_IDENTITY_KEYS) if (raw.identity[key4] != null) identity[key4] = jsonCopy(raw.identity[key4]);
|
|
11893
|
+
if (Object.keys(identity).length) contract.identity = identity;
|
|
11894
|
+
} else if (raw.identity != null) {
|
|
11895
|
+
contract.identity = jsonCopy(raw.identity);
|
|
11896
|
+
}
|
|
11897
|
+
if (isPlainObject(raw.branding)) {
|
|
11898
|
+
if (raw.branding.secondaryColor != null) contract.branding = { secondaryColor: jsonCopy(raw.branding.secondaryColor) };
|
|
11899
|
+
} else if (raw.branding != null) {
|
|
11900
|
+
contract.branding = jsonCopy(raw.branding);
|
|
11901
|
+
}
|
|
11902
|
+
if (Array.isArray(raw.installedVerticals)) contract.installedVerticals = jsonCopy(raw.installedVerticals);
|
|
11903
|
+
if (Array.isArray(raw.cmsCollections)) contract.cmsCollections = jsonCopy(raw.cmsCollections);
|
|
11904
|
+
return contract;
|
|
11905
|
+
}
|
|
11882
11906
|
function readProvisioningFacts(dir) {
|
|
11883
11907
|
let raw;
|
|
11884
11908
|
try {
|
|
@@ -11888,14 +11912,20 @@ function readProvisioningFacts(dir) {
|
|
|
11888
11912
|
}
|
|
11889
11913
|
if (!raw || typeof raw !== "object") return {};
|
|
11890
11914
|
const { siteId, installedVerticals } = raw;
|
|
11915
|
+
const contract = servedReleaseContractOf(raw);
|
|
11891
11916
|
return {
|
|
11892
11917
|
...typeof siteId === "string" && siteId ? { siteId } : {},
|
|
11893
|
-
...Array.isArray(installedVerticals) ? { installedVerticals: installedVerticals.filter((v2) => typeof v2 === "string") } : {}
|
|
11918
|
+
...Array.isArray(installedVerticals) ? { installedVerticals: installedVerticals.filter((v2) => typeof v2 === "string") } : {},
|
|
11919
|
+
...contract ? { contract } : {}
|
|
11894
11920
|
};
|
|
11895
11921
|
}
|
|
11922
|
+
var SERVED_IDENTITY_KEYS, isPlainObject, jsonCopy;
|
|
11896
11923
|
var init_provisioning_facts = __esm({
|
|
11897
11924
|
"../../core/dev-server/src/provisioning-facts.ts"() {
|
|
11898
11925
|
init_define_HHP_CATALOG();
|
|
11926
|
+
SERVED_IDENTITY_KEYS = ["businessName", "tagline", "supportUrl", "privacyUrl", "termsUrl"];
|
|
11927
|
+
isPlainObject = (value2) => !!value2 && typeof value2 === "object" && !Array.isArray(value2);
|
|
11928
|
+
jsonCopy = (value2) => JSON.parse(JSON.stringify(value2));
|
|
11899
11929
|
}
|
|
11900
11930
|
});
|
|
11901
11931
|
|
|
@@ -32298,6 +32328,44 @@ var init_capabilities_generated = __esm({
|
|
|
32298
32328
|
}
|
|
32299
32329
|
});
|
|
32300
32330
|
|
|
32331
|
+
// ../native-config/site-contract-fields.ts
|
|
32332
|
+
var SITE_CHROME_FLAGS, PAGE_WEBVIEW_BOOLEANS, PAGE_WEBVIEW_STRINGS, SITE_MEMBER_PAGE_KEYS, SITE_STRING_FIELDS, SITE_BOOLEAN_FIELDS;
|
|
32333
|
+
var init_site_contract_fields = __esm({
|
|
32334
|
+
"../native-config/site-contract-fields.ts"() {
|
|
32335
|
+
init_define_HHP_CATALOG();
|
|
32336
|
+
SITE_CHROME_FLAGS = ["hideSiteHeader", "hideSiteMenu", "hideSiteFooter", "hideWixAds"];
|
|
32337
|
+
PAGE_WEBVIEW_BOOLEANS = [
|
|
32338
|
+
"pullToRefresh",
|
|
32339
|
+
"showProgressBar",
|
|
32340
|
+
"hideHostedSiteHeader",
|
|
32341
|
+
"hideHostedSiteFooter",
|
|
32342
|
+
"hideHostedSiteMenu",
|
|
32343
|
+
"hideWixAds",
|
|
32344
|
+
"immersive",
|
|
32345
|
+
"keepAlive"
|
|
32346
|
+
];
|
|
32347
|
+
PAGE_WEBVIEW_STRINGS = ["loadingText", "errorTitle"];
|
|
32348
|
+
SITE_MEMBER_PAGE_KEYS = ["orders", "bookings"];
|
|
32349
|
+
SITE_STRING_FIELDS = {
|
|
32350
|
+
origin: "url",
|
|
32351
|
+
kind: "id",
|
|
32352
|
+
layout: "id",
|
|
32353
|
+
menuSource: "id",
|
|
32354
|
+
"pages[].id": "id",
|
|
32355
|
+
"pages[].title": "text",
|
|
32356
|
+
"pages[].path": "path",
|
|
32357
|
+
"pages[].icon": "id",
|
|
32358
|
+
"pages[].placement": "id",
|
|
32359
|
+
...Object.fromEntries(PAGE_WEBVIEW_STRINGS.map((key4) => [`pages[].webView.${key4}`, "text"])),
|
|
32360
|
+
...Object.fromEntries(SITE_MEMBER_PAGE_KEYS.map((key4) => [`memberPages.${key4}`, "path"]))
|
|
32361
|
+
};
|
|
32362
|
+
SITE_BOOLEAN_FIELDS = /* @__PURE__ */ new Set([
|
|
32363
|
+
...SITE_CHROME_FLAGS.map((key4) => `chrome.${key4}`),
|
|
32364
|
+
...PAGE_WEBVIEW_BOOLEANS.map((key4) => `pages[].webView.${key4}`)
|
|
32365
|
+
]);
|
|
32366
|
+
}
|
|
32367
|
+
});
|
|
32368
|
+
|
|
32301
32369
|
// ../native-config/site-contract.ts
|
|
32302
32370
|
function defaultWebSdkBundle(capabilities) {
|
|
32303
32371
|
return capabilities.length === 1 && capabilities[0] === "health" ? HEALTH_PROOF_BUNDLE : companionBundleName(capabilities);
|
|
@@ -32369,13 +32437,14 @@ var init_site_contract = __esm({
|
|
|
32369
32437
|
init_known();
|
|
32370
32438
|
init_capabilities_generated();
|
|
32371
32439
|
init_page_worker();
|
|
32440
|
+
init_site_contract_fields();
|
|
32372
32441
|
HEALTH_PROOF_BUNDLE = "himi-webview-health";
|
|
32373
32442
|
GENERATED_PREFIX = "himi-webview-page-";
|
|
32374
32443
|
}
|
|
32375
32444
|
});
|
|
32376
32445
|
|
|
32377
32446
|
// ../native-config/binding-spellings.ts
|
|
32378
|
-
function
|
|
32447
|
+
function isPlainObject2(value2) {
|
|
32379
32448
|
return value2 !== null && typeof value2 === "object" && !Array.isArray(value2);
|
|
32380
32449
|
}
|
|
32381
32450
|
function blank(value2) {
|
|
@@ -32388,10 +32457,10 @@ function sameValue(field, a3, b3) {
|
|
|
32388
32457
|
return JSON.stringify(a3) === JSON.stringify(b3);
|
|
32389
32458
|
}
|
|
32390
32459
|
function mergeBlock(key4, legacy, nested) {
|
|
32391
|
-
if (nested != null && !
|
|
32460
|
+
if (nested != null && !isPlainObject2(nested)) throw new Error(`provisioning.bindings.${key4} must be an object`);
|
|
32392
32461
|
if (legacy == null) return nested ?? void 0;
|
|
32393
32462
|
if (nested == null) return legacy;
|
|
32394
|
-
if (!
|
|
32463
|
+
if (!isPlainObject2(legacy)) return legacy;
|
|
32395
32464
|
const merged = { ...legacy };
|
|
32396
32465
|
for (const [field, value2] of Object.entries(nested)) {
|
|
32397
32466
|
if (blank(value2)) continue;
|
|
@@ -32408,7 +32477,7 @@ function mergeBlock(key4, legacy, nested) {
|
|
|
32408
32477
|
function bindingsEnvelope(input) {
|
|
32409
32478
|
const raw = input.bindings;
|
|
32410
32479
|
if (raw == null) return void 0;
|
|
32411
|
-
if (!
|
|
32480
|
+
if (!isPlainObject2(raw)) throw new Error("provisioning.bindings must be an object");
|
|
32412
32481
|
for (const key4 of Object.keys(raw)) {
|
|
32413
32482
|
if (!BINDING_KEYS.includes(key4)) {
|
|
32414
32483
|
throw new Error(`provisioning.bindings.${key4} is not a binding (allowed: ${BINDING_KEYS.join(", ")})`);
|
|
@@ -37053,6 +37122,7 @@ function deriveNavigationConfig(app2, bundleCtx) {
|
|
|
37053
37122
|
if (app2.cashier !== void 0) config.cashierConfig = app2.cashier;
|
|
37054
37123
|
if (app2.base44 !== void 0) config.base44Config = { appId: app2.base44.appId, ...app2.base44.serverUrl !== void 0 ? { serverUrl: app2.base44.serverUrl } : {} };
|
|
37055
37124
|
if (app2.wixIap !== void 0) config.wixIapConfig = app2.wixIap;
|
|
37125
|
+
if (app2.releaseContract !== void 0) config.contract = app2.releaseContract;
|
|
37056
37126
|
if (app2.wixPlatform !== void 0) config.wixPlatformConfig = app2.wixPlatform;
|
|
37057
37127
|
if (app2.devGateway !== void 0) config.devGatewayConfig = app2.devGateway;
|
|
37058
37128
|
if (app2.dataSchema !== void 0) config.dataSchema = app2.dataSchema;
|
|
@@ -37527,11 +37597,11 @@ function selectIdiomOverlay(doc, ctx = {}) {
|
|
|
37527
37597
|
];
|
|
37528
37598
|
return candidates.find((c2) => authored(overlays, c2));
|
|
37529
37599
|
}
|
|
37530
|
-
function
|
|
37600
|
+
function isPlainObject3(v2) {
|
|
37531
37601
|
return v2 !== null && typeof v2 === "object" && !Array.isArray(v2);
|
|
37532
37602
|
}
|
|
37533
37603
|
function deepMerge(base2, overlay) {
|
|
37534
|
-
if (!
|
|
37604
|
+
if (!isPlainObject3(overlay) || !isPlainObject3(base2)) return overlay;
|
|
37535
37605
|
const out2 = { ...base2 };
|
|
37536
37606
|
for (const [key4, value2] of Object.entries(overlay)) {
|
|
37537
37607
|
if (UNSAFE_KEYS.has(key4)) continue;
|
|
@@ -37543,12 +37613,12 @@ function mergeIdiomOverlay(base2, overlay) {
|
|
|
37543
37613
|
const merged = deepMerge(base2, overlay);
|
|
37544
37614
|
const baseColors = base2.colors;
|
|
37545
37615
|
const overlayColors = overlay.colors;
|
|
37546
|
-
if (
|
|
37616
|
+
if (isPlainObject3(baseColors) && isPlainObject3(overlayColors)) {
|
|
37547
37617
|
const colors = { ...merged.colors };
|
|
37548
37618
|
for (const [name, value2] of Object.entries(overlayColors)) {
|
|
37549
37619
|
if (UNSAFE_KEYS.has(name)) continue;
|
|
37550
37620
|
const was = Object.hasOwn(baseColors, name) ? baseColors[name] : void 0;
|
|
37551
|
-
if (typeof was === "string" &&
|
|
37621
|
+
if (typeof was === "string" && isPlainObject3(value2)) colors[name] = { light: was, ...value2 };
|
|
37552
37622
|
}
|
|
37553
37623
|
merged.colors = colors;
|
|
37554
37624
|
}
|
|
@@ -178540,7 +178610,7 @@ function resolveDistBase44Binding(app2, added, binding2) {
|
|
|
178540
178610
|
if (!binding2) {
|
|
178541
178611
|
throw new DistBindingError(
|
|
178542
178612
|
"base44_binding_missing",
|
|
178543
|
-
`${app2}: this release declares base44 but its dist contract carries no Base44 binding (base44.appId beside a site of kind "base44") \u2014 the verbs would have no Base44 app to talk to, so the build stops. The serve plane
|
|
178613
|
+
`${app2}: this release declares base44 but its dist contract carries no Base44 binding (base44.appId beside a site of kind "base44") \u2014 the verbs would have no Base44 app to talk to, so the build stops. The serve plane projects one only for a release that serves a Base44 binding and a base44 site it can verify (RFC 0079 phase 6).`
|
|
178544
178614
|
);
|
|
178545
178615
|
}
|
|
178546
178616
|
const serverOk = binding2.serverUrl === void 0 || bakeableHttpsOrigin(binding2.serverUrl) === binding2.serverUrl;
|
|
@@ -178553,6 +178623,13 @@ function resolveDistBase44Binding(app2, added, binding2) {
|
|
|
178553
178623
|
`${app2}: a dist build's Base44 site must be https://<tenant>.base44.app (the session bridge writes the user's Base44 token into it), got: ${binding2.siteOrigin}`
|
|
178554
178624
|
);
|
|
178555
178625
|
}
|
|
178626
|
+
const v2 = binding2.siteVerified;
|
|
178627
|
+
if (!v2 || v2.origin !== binding2.siteOrigin || v2.appId !== binding2.appId) {
|
|
178628
|
+
throw new DistBindingError(
|
|
178629
|
+
"base44_binding_unverified",
|
|
178630
|
+
`${app2}: the Base44 binding's site ${JSON.stringify(binding2.siteOrigin)} is not verified to be app ${JSON.stringify(binding2.appId)}'s own Base44 tenant (no matching siteVerified marker from the serve plane: ${JSON.stringify(v2 ?? null)}) \u2014 the session bridge would trust it, so the build stops.`
|
|
178631
|
+
);
|
|
178632
|
+
}
|
|
178556
178633
|
return binding2;
|
|
178557
178634
|
}
|
|
178558
178635
|
function distBootInfo(dist, base44Binding) {
|
|
@@ -179758,7 +179835,7 @@ async function navIssues(dir, strict) {
|
|
|
179758
179835
|
if (captcha && captcha.code !== "captcha_auth_site_case" && !issues.some((i2) => i2.ruleCode === "push-auth-site"))
|
|
179759
179836
|
push("warning", "auth-captcha-site", captcha.message);
|
|
179760
179837
|
if (nav === void 0 || nav === null) return issues;
|
|
179761
|
-
if (!
|
|
179838
|
+
if (!isPlainObject4(nav)) {
|
|
179762
179839
|
error("nav-not-an-object", `navigation must be an object (got ${Array.isArray(nav) ? "array" : typeof nav}).`);
|
|
179763
179840
|
return issues;
|
|
179764
179841
|
}
|
|
@@ -179788,18 +179865,18 @@ async function navIssues(dir, strict) {
|
|
|
179788
179865
|
for (const key4 of ITEMS_BLOCKS) {
|
|
179789
179866
|
const block = nav[key4];
|
|
179790
179867
|
if (block === void 0) continue;
|
|
179791
|
-
if (!
|
|
179868
|
+
if (!isPlainObject4(block) || !Array.isArray(block.items)) {
|
|
179792
179869
|
error(
|
|
179793
179870
|
"nav-chrome-shape",
|
|
179794
|
-
`navigation.${key4} must be an object with an \`items\` array \u2014 \`${key4}: { items: [ \u2026 ] }\` (got ${Array.isArray(block) ? "an array" :
|
|
179871
|
+
`navigation.${key4} must be an object with an \`items\` array \u2014 \`${key4}: { items: [ \u2026 ] }\` (got ${Array.isArray(block) ? "an array" : isPlainObject4(block) ? "an object with no `items` array" : typeof block}). The server forwards this verbatim, so the shell finds no destinations and draws none.`
|
|
179795
179872
|
);
|
|
179796
179873
|
}
|
|
179797
179874
|
}
|
|
179798
|
-
if (ITEMS_BLOCKS.some((key4) =>
|
|
179875
|
+
if (ITEMS_BLOCKS.some((key4) => isPlainObject4(nav[key4]) && Array.isArray(nav[key4].items))) {
|
|
179799
179876
|
const tabIds = /* @__PURE__ */ new Set();
|
|
179800
|
-
const authoredTabs =
|
|
179877
|
+
const authoredTabs = isPlainObject4(nav.tabBar) && Array.isArray(nav.tabBar.items) ? nav.tabBar.items : [];
|
|
179801
179878
|
authoredTabs.forEach((tab, index) => {
|
|
179802
|
-
const id =
|
|
179879
|
+
const id = isPlainObject4(tab) ? tab.id : void 0;
|
|
179803
179880
|
if (typeof id !== "string" || !id.trim()) {
|
|
179804
179881
|
error("nav-tab-id-invalid", `navigation.tabBar.items[${index}].id must be a non-empty string.`);
|
|
179805
179882
|
} else if (tabIds.has(id)) {
|
|
@@ -179810,7 +179887,7 @@ async function navIssues(dir, strict) {
|
|
|
179810
179887
|
});
|
|
179811
179888
|
const ids2 = (key4) => {
|
|
179812
179889
|
const block = nav[key4];
|
|
179813
|
-
return
|
|
179890
|
+
return isPlainObject4(block) && Array.isArray(block.items) ? block.items.filter((item2) => isPlainObject4(item2) && !(key4 === "drawer" && (item2.role === "section" || item2.role === "note"))).map((item2) => item2.id).filter((id) => typeof id === "string" && !!id.trim()) : [];
|
|
179814
179891
|
};
|
|
179815
179892
|
const drawerIds = ids2("drawer");
|
|
179816
179893
|
const sidebarIds = ids2("sidebar");
|
|
@@ -179818,8 +179895,8 @@ async function navIssues(dir, strict) {
|
|
|
179818
179895
|
const platforms = readLocalPlatforms(dir);
|
|
179819
179896
|
for (const surface of PREVIEW_SURFACES) {
|
|
179820
179897
|
if (!isTargeted(surface, platforms) || surface.gate.kind === "family" || surface.gate.kind === "projection") continue;
|
|
179821
|
-
const entry =
|
|
179822
|
-
const requested =
|
|
179898
|
+
const entry = isPlainObject4(nav.surfaces) ? nav.surfaces[surface.id] : void 0;
|
|
179899
|
+
const requested = isPlainObject4(entry) ? entry.destinations : void 0;
|
|
179823
179900
|
if (requested != null && (!Array.isArray(requested) || requested.some((id) => typeof id !== "string" || !id.trim()))) {
|
|
179824
179901
|
error("nav-surface-destinations-shape", `navigation.surfaces.${surface.id}.destinations must be an array of non-empty destination IDs.`);
|
|
179825
179902
|
}
|
|
@@ -179835,7 +179912,7 @@ async function navIssues(dir, strict) {
|
|
|
179835
179912
|
for (const id of active2) destinationIds.add(id);
|
|
179836
179913
|
}
|
|
179837
179914
|
if (Array.isArray(nav.linkableScreens)) nav.linkableScreens.forEach((link3, index) => {
|
|
179838
|
-
if (!
|
|
179915
|
+
if (!isPlainObject4(link3) || link3.tabId == null || link3.tabId === "") return;
|
|
179839
179916
|
if (typeof link3.tabId !== "string" || !destinationIds.has(link3.tabId)) {
|
|
179840
179917
|
error("nav-linkable-tab-unknown", `navigation.linkableScreens[${index}].tabId ${JSON.stringify(link3.tabId)} does not name a selectable primary navigation destination on any enabled surface. Use the app's actual id (${[...destinationIds].map((id) => JSON.stringify(id)).join(", ") || "none declared"}), not a leftover template id.`);
|
|
179841
179918
|
}
|
|
@@ -179860,7 +179937,7 @@ async function navIssues(dir, strict) {
|
|
|
179860
179937
|
}
|
|
179861
179938
|
for (const message2 of navSharedIdErrors(nav)) error("nav-row-id-shadows-tab", `navigation.${message2}`);
|
|
179862
179939
|
const topBarDefault = nav.topBarDefault;
|
|
179863
|
-
if (
|
|
179940
|
+
if (isPlainObject4(topBarDefault)) {
|
|
179864
179941
|
for (const key4 of SCREEN_ONLY_TOP_BAR_KEYS) {
|
|
179865
179942
|
const value2 = topBarDefault[key4];
|
|
179866
179943
|
if (value2 === void 0 || value2 === null || value2 === "" || key4 === "scrollBehavior" && value2 === "pinned") continue;
|
|
@@ -179870,7 +179947,7 @@ async function navIssues(dir, strict) {
|
|
|
179870
179947
|
);
|
|
179871
179948
|
}
|
|
179872
179949
|
}
|
|
179873
|
-
if (
|
|
179950
|
+
if (isPlainObject4(topBarDefault)) {
|
|
179874
179951
|
const align = topBarDefault.titleAlign;
|
|
179875
179952
|
if (typeof align === "string" && align !== "" && align !== "auto") {
|
|
179876
179953
|
warn4(
|
|
@@ -179885,7 +179962,7 @@ async function navIssues(dir, strict) {
|
|
|
179885
179962
|
if (effectiveBottomTabs && !declaresOtherChrome && itemCount(nav.tabBar) === 0) {
|
|
179886
179963
|
const linkables = Array.isArray(nav.linkableScreens) ? nav.linkableScreens : [];
|
|
179887
179964
|
const topLevel = new Set(
|
|
179888
|
-
linkables.filter((s5) =>
|
|
179965
|
+
linkables.filter((s5) => isPlainObject4(s5) && !s5.parentScreenId).map((s5) => String(s5.screenId ?? ""))
|
|
179889
179966
|
);
|
|
179890
179967
|
topLevel.delete("");
|
|
179891
179968
|
if (topLevel.size > 1) {
|
|
@@ -179903,9 +179980,9 @@ async function navIssues(dir, strict) {
|
|
|
179903
179980
|
return issues;
|
|
179904
179981
|
}
|
|
179905
179982
|
function pushRouteIssues(push, nav, provisioning, warn4) {
|
|
179906
|
-
if (!
|
|
179983
|
+
if (!isPlainObject4(push) || push.payloadAdapter !== "wix-ping") return;
|
|
179907
179984
|
if (derivesWixPushRoutes(push, provisioning.installedVerticals)) return;
|
|
179908
|
-
const routes = Array.isArray(push.routes) ? push.routes.filter(
|
|
179985
|
+
const routes = Array.isArray(push.routes) ? push.routes.filter(isPlainObject4) : [];
|
|
179909
179986
|
if (routes.length === 0) {
|
|
179910
179987
|
const derivable = push.routes === void 0 ? ` Or leave push.routes out and record the site's verticals with \`himi site analyze --apply\`: the build then derives the routes from provisioning.json and the app's screens.` : "";
|
|
179911
179988
|
warn4(
|
|
@@ -179914,10 +179991,10 @@ function pushRouteIssues(push, nav, provisioning, warn4) {
|
|
|
179914
179991
|
);
|
|
179915
179992
|
return;
|
|
179916
179993
|
}
|
|
179917
|
-
const linkables =
|
|
179994
|
+
const linkables = isPlainObject4(nav) ? nav.linkableScreens : void 0;
|
|
179918
179995
|
if (!Array.isArray(linkables)) return;
|
|
179919
179996
|
const declared = new Set(
|
|
179920
|
-
linkables.filter(
|
|
179997
|
+
linkables.filter(isPlainObject4).map((s5) => String(s5.screenId ?? ""))
|
|
179921
179998
|
);
|
|
179922
179999
|
for (const route of routes) {
|
|
179923
180000
|
const screenId = /:\/\/screen\/([^?]+)/.exec(String(route.link ?? ""))?.[1];
|
|
@@ -179930,7 +180007,7 @@ function pushRouteIssues(push, nav, provisioning, warn4) {
|
|
|
179930
180007
|
}
|
|
179931
180008
|
}
|
|
179932
180009
|
function pushLinkPrefixIssues(push, provisioning, warn4) {
|
|
179933
|
-
if (!
|
|
180010
|
+
if (!isPlainObject4(push) || push.linkPrefixes === void 0) return;
|
|
179934
180011
|
if (!Array.isArray(push.linkPrefixes)) {
|
|
179935
180012
|
warn4(
|
|
179936
180013
|
"push-link-prefixes-invalid",
|
|
@@ -179975,7 +180052,7 @@ function wixLinkSpacePrefix(prefix) {
|
|
|
179975
180052
|
return adaptPayloadLink(probe2, "wix-ping").adapted && !adaptPayloadLink(probe2, "").adapted;
|
|
179976
180053
|
}
|
|
179977
180054
|
function pushScreenMapIssues(push, provisioning, warn4) {
|
|
179978
|
-
if (!
|
|
180055
|
+
if (!isPlainObject4(push) || !isPlainObject4(push.screens)) return;
|
|
179979
180056
|
const destinations2 = WIX_MEMBER_PUSH_DESTINATIONS.map((d2) => d2.id);
|
|
179980
180057
|
const unknown = Object.keys(push.screens).filter((key4) => !destinations2.includes(key4));
|
|
179981
180058
|
if (unknown.length) {
|
|
@@ -179990,9 +180067,9 @@ function pushScreenMapIssues(push, provisioning, warn4) {
|
|
|
179990
180067
|
}
|
|
179991
180068
|
}
|
|
179992
180069
|
function pushAuthIssues(push, auth, provisioning, warn4) {
|
|
179993
|
-
if (!
|
|
179994
|
-
if (
|
|
179995
|
-
const memberLogin =
|
|
180070
|
+
if (!isPlainObject4(push) || push.registrar !== "wix-ping") return;
|
|
180071
|
+
if (isPlainObject4(auth) && auth.providerId === "wix-native" && isPlainObject4(auth.config) && auth.config.mode === "owner") return;
|
|
180072
|
+
const memberLogin = isPlainObject4(auth) && auth.providerId === "wix-consumer" && isPlainObject4(auth.config) ? auth.config : void 0;
|
|
179996
180073
|
const siteId = typeof memberLogin?.siteId === "string" ? memberLogin.siteId : void 0;
|
|
179997
180074
|
const problem = !memberLogin ? "auth is not a Wix member login (WixConsumerAuthProvider), so the device never registers" : !siteId ? "auth (WixConsumerAuthProvider) names no siteId, so the device never registers" : provisioning.siteId && siteId !== provisioning.siteId ? `auth's siteId "${siteId}" is not provisioning.json's "${provisioning.siteId}", so the device registers under another site's push credentials` : void 0;
|
|
179998
180075
|
if (!problem) return;
|
|
@@ -180002,10 +180079,10 @@ function pushAuthIssues(push, auth, provisioning, warn4) {
|
|
|
180002
180079
|
);
|
|
180003
180080
|
}
|
|
180004
180081
|
function placeholderLogin(auth) {
|
|
180005
|
-
return
|
|
180082
|
+
return isPlainObject4(auth) && isPlainObject4(auth.config) && auth.config.clientId === PLACEHOLDER_CLIENT_ID;
|
|
180006
180083
|
}
|
|
180007
180084
|
function pushFamilyIssues(push, warn4) {
|
|
180008
|
-
if (!
|
|
180085
|
+
if (!isPlainObject4(push) || push.registrar !== "wix-ping" || typeof push.pingAppName !== "string") return;
|
|
180009
180086
|
const replacement = replacementPingFamily(push.pingAppName);
|
|
180010
180087
|
if (!replacement) return;
|
|
180011
180088
|
warn4(
|
|
@@ -180038,8 +180115,8 @@ function unmappedAdvisory({ destination, vertical, reason, screenId, paramKey })
|
|
|
180038
180115
|
function navSharedIdErrors(nav) {
|
|
180039
180116
|
const items = (key4) => {
|
|
180040
180117
|
const block = nav[key4];
|
|
180041
|
-
const list4 =
|
|
180042
|
-
return Array.isArray(list4) ? list4.flatMap((x2, i2) =>
|
|
180118
|
+
const list4 = isPlainObject4(block) ? block.items : void 0;
|
|
180119
|
+
return Array.isArray(list4) ? list4.flatMap((x2, i2) => isPlainObject4(x2) ? [[x2, i2]] : []) : [];
|
|
180043
180120
|
};
|
|
180044
180121
|
const tabScreens = /* @__PURE__ */ new Map();
|
|
180045
180122
|
for (const [tab] of items("tabBar")) if (typeof tab.id === "string" && !tabScreens.has(tab.id)) tabScreens.set(tab.id, tab.screenId);
|
|
@@ -180058,7 +180135,7 @@ function navSharedIdErrors(nav) {
|
|
|
180058
180135
|
}
|
|
180059
180136
|
return out2;
|
|
180060
180137
|
}
|
|
180061
|
-
var NAVIGATION_KEYS, NAV_KINDS, ITEMS_BLOCKS, SERVED_ONLY_NAV_KEYS, MISPLACED_TOP_LEVEL_KEYS, SCREEN_ONLY_TOP_BAR_KEYS,
|
|
180138
|
+
var NAVIGATION_KEYS, NAV_KINDS, ITEMS_BLOCKS, SERVED_ONLY_NAV_KEYS, MISPLACED_TOP_LEVEL_KEYS, SCREEN_ONLY_TOP_BAR_KEYS, isPlainObject4, itemCount;
|
|
180062
180139
|
var init_nav_lint = __esm({
|
|
180063
180140
|
"src/nav-lint.ts"() {
|
|
180064
180141
|
init_define_HHP_CATALOG();
|
|
@@ -180122,8 +180199,8 @@ var init_nav_lint = __esm({
|
|
|
180122
180199
|
"linkableScreens"
|
|
180123
180200
|
];
|
|
180124
180201
|
SCREEN_ONLY_TOP_BAR_KEYS = ["scrollBehavior", "dirtyPath", "visibilityPath"];
|
|
180125
|
-
|
|
180126
|
-
itemCount = (v2) =>
|
|
180202
|
+
isPlainObject4 = (v2) => typeof v2 === "object" && v2 !== null && !Array.isArray(v2);
|
|
180203
|
+
itemCount = (v2) => isPlainObject4(v2) && Array.isArray(v2.items) ? v2.items.length : 0;
|
|
180127
180204
|
}
|
|
180128
180205
|
});
|
|
180129
180206
|
|
|
@@ -254983,6 +255060,7 @@ function generateScreens(input) {
|
|
|
254983
255060
|
}));
|
|
254984
255061
|
const taken = new Set(input.takenScreenIds ?? []);
|
|
254985
255062
|
const fellBack = /* @__PURE__ */ new Set();
|
|
255063
|
+
const paramLinked = /* @__PURE__ */ new Set();
|
|
254986
255064
|
const out2 = {
|
|
254987
255065
|
screens: {},
|
|
254988
255066
|
routes: [],
|
|
@@ -255023,7 +255101,11 @@ function generateScreens(input) {
|
|
|
255023
255101
|
continue;
|
|
255024
255102
|
}
|
|
255025
255103
|
const verticals = new Set(elements.map((e2) => TEMPLATE_VERTICALS[str13(obj6(sections2[str13(e2.elementId)]).sectionDefinitionId)]));
|
|
255026
|
-
|
|
255104
|
+
const distinctLinks = elements.length > 1 && elements.every((e2) => FALLBACK_TARGETS[str13(obj6(sections2[str13(e2.elementId)]).sectionDefinitionId)]?.params) && new Set(elements.map((e2) => {
|
|
255105
|
+
const section3 = obj6(sections2[str13(e2.elementId)]);
|
|
255106
|
+
return JSON.stringify(TEMPLATE_PARAMS[str13(section3.sectionDefinitionId)]?.(section3, obj6(section3.settings)) ?? {});
|
|
255107
|
+
})).size > 1;
|
|
255108
|
+
if (verticals.size === 1 && !verticals.has(void 0) && !distinctLinks) {
|
|
255027
255109
|
const first = obj6(sections2[str13(elements[0].elementId)]);
|
|
255028
255110
|
const type2 = str13(first.sectionDefinitionId);
|
|
255029
255111
|
const params = TEMPLATE_PARAMS[type2]?.(first, obj6(first.settings));
|
|
@@ -255047,6 +255129,7 @@ function generateScreens(input) {
|
|
|
255047
255129
|
}
|
|
255048
255130
|
continue;
|
|
255049
255131
|
}
|
|
255132
|
+
for (const reason of SCREEN_ADAPTATIONS[type2]?.(obj6(first.settings)) ?? []) out2.gaps.push({ page: label4, sectionId: str13(elements[0].elementId), sectionDefinitionId: type2, reason });
|
|
255050
255133
|
out2.routes.push({ layoutItemId, label: label4, screenId: screenId2, kind: "template", ...params && Object.keys(params).length ? { params } : {} });
|
|
255051
255134
|
continue;
|
|
255052
255135
|
}
|
|
@@ -255117,12 +255200,16 @@ function generateScreens(input) {
|
|
|
255117
255200
|
const sibling = fallback.sibling ? items.find((other) => other !== layoutItemId && arr(obj6(layoutItems[other]).elements).some((e2) => str13(obj6(sections2[str13(obj6(e2).elementId)]).sectionDefinitionId) === fallback.sibling)) : void 0;
|
|
255118
255201
|
fellBack.add(`${layoutItemId}|${type2}`);
|
|
255119
255202
|
const target = `${ROUTE_PLACEHOLDER}${sibling ?? ""}|${fallback.screen}|${fallback.sibling ?? ""}`;
|
|
255120
|
-
const
|
|
255203
|
+
const values = fallback.params?.(obj6(section3.settings)) ?? {};
|
|
255204
|
+
const passed = values.categoryId !== void 0 ? { ...values, categoryActivation: sectionNodeId } : values;
|
|
255205
|
+
if (fallback.params) paramLinked.add(fallback.screen);
|
|
255206
|
+
const title = section3.showTitle === false ? "" : str13(section3.title).trim() || label4;
|
|
255121
255207
|
children2.push(vstack(`${sectionNodeId}.box`, [
|
|
255122
|
-
text22(`${sectionNodeId}.title`, title, "title3"),
|
|
255123
|
-
node(`${sectionNodeId}.all`, "Button", { title: "See All", style: "secondary", size: "md", fullWidth: true, action: { actionId: "himi.open", params: { screenId: target } } })
|
|
255208
|
+
...title ? [text22(`${sectionNodeId}.title`, title, "title3")] : [],
|
|
255209
|
+
node(`${sectionNodeId}.all`, "Button", { title: "See All", style: "secondary", size: "md", fullWidth: true, action: { actionId: "himi.open", params: { screenId: target, ...passed } } })
|
|
255124
255210
|
], 12, inset(16, 16)));
|
|
255125
255211
|
out2.gaps.push({ page: label4, sectionId, sectionDefinitionId: type2, reason: `${reasons.join("; ")}. Shown as its title and a See All link instead of the data.` });
|
|
255212
|
+
for (const reason of SCREEN_ADAPTATIONS[type2]?.(obj6(section3.settings)) ?? []) out2.gaps.push({ page: label4, sectionId, sectionDefinitionId: type2, reason });
|
|
255126
255213
|
return;
|
|
255127
255214
|
}
|
|
255128
255215
|
if (Array.isArray(built)) children2.push(...built);
|
|
@@ -255164,7 +255251,7 @@ function generateScreens(input) {
|
|
|
255164
255251
|
if (!demoted) break;
|
|
255165
255252
|
}
|
|
255166
255253
|
mergePageWorkers(out2);
|
|
255167
|
-
markSharedTemplateParams(out2);
|
|
255254
|
+
markSharedTemplateParams(out2, paramLinked);
|
|
255168
255255
|
const pointerPart = (id) => id.replaceAll("~", "~0").replaceAll("/", "~1");
|
|
255169
255256
|
const screenOfPage = new Map(out2.routes.filter((r3) => r3.screenId).map((r3) => [r3.layoutItemId, r3.screenId]));
|
|
255170
255257
|
const mapRow = (source2, screenId) => {
|
|
@@ -255198,11 +255285,11 @@ function generateScreens(input) {
|
|
|
255198
255285
|
resolveRoutePlaceholders(out2, fellBack, slugs, hasTabBar, pageOfScreen);
|
|
255199
255286
|
return out2;
|
|
255200
255287
|
}
|
|
255201
|
-
function markSharedTemplateParams(out2) {
|
|
255288
|
+
function markSharedTemplateParams(out2, paramLinked) {
|
|
255202
255289
|
const users = /* @__PURE__ */ new Map();
|
|
255203
255290
|
for (const route of out2.routes) if (route.kind === "template" && route.screenId) users.set(route.screenId, [...users.get(route.screenId) ?? [], route]);
|
|
255204
|
-
for (const routes of users
|
|
255205
|
-
if (routes.length < 2) continue;
|
|
255291
|
+
for (const [screenId, routes] of users) {
|
|
255292
|
+
if (routes.length < 2 && !paramLinked.has(screenId)) continue;
|
|
255206
255293
|
for (const route of routes) {
|
|
255207
255294
|
if (!route.params) continue;
|
|
255208
255295
|
route.openOnly = true;
|
|
@@ -255235,7 +255322,8 @@ function resolveRoutePlaceholders(out2, fellBack, slugs, hasTabBar, pageOfScreen
|
|
|
255235
255322
|
const retarget = (tap) => {
|
|
255236
255323
|
const target = resolve116(str13(obj6(tap.params).screenId));
|
|
255237
255324
|
const tab = tabOfScreen.get(target);
|
|
255238
|
-
|
|
255325
|
+
const carries = Object.keys(obj6(tap.params)).some((key4) => key4 !== "screenId");
|
|
255326
|
+
return tab && !carries ? { actionId: "himi.tab", params: { tab } } : { ...tap, params: { ...obj6(tap.params), screenId: target } };
|
|
255239
255327
|
};
|
|
255240
255328
|
const isPlaceholderTap = (v2) => !!v2 && typeof v2 === "object" && str13(obj6(obj6(v2).params).screenId).startsWith(ROUTE_PLACEHOLDER);
|
|
255241
255329
|
const isDeadButton = (v2) => {
|
|
@@ -255340,7 +255428,7 @@ function addNavigation(out2, plan, taken) {
|
|
|
255340
255428
|
out2.routes.push({ layoutItemId: "(more)", label: "More", screenId, kind: "generated" });
|
|
255341
255429
|
out2.tabs.push({ layoutItemId: "(more)", label: "More", screenId });
|
|
255342
255430
|
}
|
|
255343
|
-
var TEMPLATE_SCREEN_PARAM_KEYS, SYSTEM_ALL_PRODUCTS_ID, TEMPLATE_PARAMS, FALLBACK_TARGETS, NO_INLINE_SECTION, ROUTE_PLACEHOLDER, BOTTOM_TABS_BEFORE_MORE, TEMPLATE_VERTICALS, TEMPLATE_FALLBACKS, MODULES, obj6, arr, str13, node, text22, vstack, hstack, inset, openUrl2, youtubeIdOf, DIRECT_VIDEO_FILE, dialUrl, mailUrl, BUSINESS_CHAT_SCREEN, sourceTap, HANDLERS, MERGED_PAGES_BUNDLE, chevron;
|
|
255431
|
+
var TEMPLATE_SCREEN_PARAM_KEYS, SYSTEM_ALL_PRODUCTS_ID, collectionParams, TEMPLATE_PARAMS, countOf2, SCREEN_ADAPTATIONS, FALLBACK_TARGETS, NO_INLINE_SECTION, ROUTE_PLACEHOLDER, BOTTOM_TABS_BEFORE_MORE, TEMPLATE_VERTICALS, TEMPLATE_FALLBACKS, MODULES, obj6, arr, str13, node, text22, vstack, hstack, inset, openUrl2, youtubeIdOf, DIRECT_VIDEO_FILE, dialUrl, mailUrl, BUSINESS_CHAT_SCREEN, sourceTap, HANDLERS, MERGED_PAGES_BUNDLE, chevron;
|
|
255344
255432
|
var init_generate2 = __esm({
|
|
255345
255433
|
"src/one-app/generate.ts"() {
|
|
255346
255434
|
init_define_HHP_CATALOG();
|
|
@@ -255353,17 +255441,51 @@ var init_generate2 = __esm({
|
|
|
255353
255441
|
himi_groups: ["title", "groupListLabel", "pageSize"]
|
|
255354
255442
|
};
|
|
255355
255443
|
SYSTEM_ALL_PRODUCTS_ID = "00000000-000000-000000-000000000001";
|
|
255444
|
+
collectionParams = (st2) => {
|
|
255445
|
+
const id = str13(obj6(st2.collection).id).trim();
|
|
255446
|
+
return id && id !== SYSTEM_ALL_PRODUCTS_ID ? { categoryId: id } : {};
|
|
255447
|
+
};
|
|
255356
255448
|
TEMPLATE_PARAMS = {
|
|
255357
255449
|
groups_feed_section: (_section, st2) => ({
|
|
255358
255450
|
...str13(st2.sectionTitle).trim() ? { title: str13(st2.sectionTitle).trim() } : {},
|
|
255359
255451
|
...str13(st2.openGroupListButtonText).trim() ? { groupListLabel: str13(st2.openGroupListButtonText).trim() } : {},
|
|
255360
255452
|
...Number.isInteger(st2.postNumber) ? { pageSize: st2.postNumber } : {}
|
|
255361
255453
|
}),
|
|
255362
|
-
|
|
255363
|
-
|
|
255364
|
-
|
|
255365
|
-
|
|
255366
|
-
|
|
255454
|
+
stores_products_grid_section: (_section, st2) => collectionParams(st2),
|
|
255455
|
+
stores_products_carousel_section: (_section, st2) => collectionParams(st2)
|
|
255456
|
+
};
|
|
255457
|
+
countOf2 = (value2) => typeof value2 === "string" ? /^\d+$/.test(value2) ? Number(value2) : void 0 : Number.isSafeInteger(value2) && value2 > 0 ? value2 : void 0;
|
|
255458
|
+
SCREEN_ADAPTATIONS = {
|
|
255459
|
+
upcoming_bookings_section: (st2) => [
|
|
255460
|
+
...obj6(st2.previousBookings).enabled === false ? ["the source has no previous bookings; himi_bookings has an Upcoming and a Past tab"] : [],
|
|
255461
|
+
...str13(obj6(st2.emptyState).text).trim() ? [`the source's empty text "${str13(obj6(st2.emptyState).text).trim()}" is not set on himi_bookings, which has its own`] : []
|
|
255462
|
+
],
|
|
255463
|
+
platform_paid_plans_section: (st2) => {
|
|
255464
|
+
const chosen = arr(st2.selectedPlanIds).length;
|
|
255465
|
+
return chosen ? [`the source shows only its ${chosen} chosen plan(s); himi_plans takes no plan selection and shows every plan`] : [];
|
|
255466
|
+
},
|
|
255467
|
+
groups_list_section: (st2) => {
|
|
255468
|
+
const chosen = arr(st2.groupsIds).length, max = countOf2(st2.maxGroups);
|
|
255469
|
+
return [
|
|
255470
|
+
...chosen ? [`the source shows only its ${chosen} chosen group(s); himi_groups takes no group selection and lists every group`] : [],
|
|
255471
|
+
...max !== void 0 ? [`the source shows at most ${max} group(s) and a "${str13(st2.expandButtonText).trim() || "View All"}" button; himi_groups lists every group`] : []
|
|
255472
|
+
];
|
|
255473
|
+
},
|
|
255474
|
+
faq_list_section: (st2) => {
|
|
255475
|
+
const limit = countOf2(obj6(st2.questions).NumberOfFAQs);
|
|
255476
|
+
return [
|
|
255477
|
+
...limit !== void 0 ? [`the source shows ${limit} question(s); himi_faq lists every question`] : [],
|
|
255478
|
+
...Object.keys(obj6(st2.categories)).length ? ["the source limits its questions to chosen categories; himi_faq takes no category selection and lists every category"] : []
|
|
255479
|
+
];
|
|
255480
|
+
},
|
|
255481
|
+
newBlog_postlist_carousel_full_section: (st2) => {
|
|
255482
|
+
const content = obj6(st2.contentSettings), limit = countOf2(content.postsPerCategory), category = str13(content.categoryId).trim();
|
|
255483
|
+
return [
|
|
255484
|
+
...category && category !== "all" ? [`the source shows only the posts of category ${category}; himi_blog does not open on a given category and shows every post`] : [],
|
|
255485
|
+
...content.featuredOnly === true ? ["the source shows only featured posts; himi_blog shows every post"] : [],
|
|
255486
|
+
"the source shows its posts as a carousel; himi_blog is the full post list",
|
|
255487
|
+
...limit !== void 0 ? [`the source shows only ${limit} post(s); himi_blog lists every post`] : []
|
|
255488
|
+
];
|
|
255367
255489
|
}
|
|
255368
255490
|
};
|
|
255369
255491
|
FALLBACK_TARGETS = {
|
|
@@ -255380,7 +255502,16 @@ var init_generate2 = __esm({
|
|
|
255380
255502
|
progallery_carousel_section: { screen: "himi_galleries", needsScreen: true },
|
|
255381
255503
|
achievements_participant_carousel_section: { screen: "himi_member_programs", needsScreen: true },
|
|
255382
255504
|
groups_cards_section: { screen: "himi_groups", needsScreen: true },
|
|
255383
|
-
newBlog_search_section: { screen: "himi_blog", needsScreen: true }
|
|
255505
|
+
newBlog_search_section: { screen: "himi_blog", needsScreen: true },
|
|
255506
|
+
// Sections that ARE a template screen (`TEMPLATE_VERTICALS`): on a page of other sections they keep their place as a title and a link.
|
|
255507
|
+
upcoming_bookings_section: { screen: "himi_bookings", needsScreen: true },
|
|
255508
|
+
memberships_packages_section: { screen: "himi_my_subscriptions", needsScreen: true },
|
|
255509
|
+
platform_paid_plans_section: { screen: "himi_plans", needsScreen: true },
|
|
255510
|
+
groups_list_section: { screen: "himi_groups", needsScreen: true },
|
|
255511
|
+
faq_list_section: { screen: "himi_faq", needsScreen: true },
|
|
255512
|
+
newBlog_postlist_carousel_full_section: { screen: "himi_blog", needsScreen: true },
|
|
255513
|
+
stores_products_grid_section: { screen: "himi_shop", needsScreen: true, params: collectionParams },
|
|
255514
|
+
stores_products_carousel_section: { screen: "himi_shop", needsScreen: true, params: collectionParams }
|
|
255384
255515
|
};
|
|
255385
255516
|
NO_INLINE_SECTION = "its data has no inline section yet";
|
|
255386
255517
|
ROUTE_PLACEHOLDER = "@route:";
|
|
@@ -255391,7 +255522,14 @@ var init_generate2 = __esm({
|
|
|
255391
255522
|
loyalty_status_section: "himi_loyalty",
|
|
255392
255523
|
loyalty_offering_section: "himi_loyalty",
|
|
255393
255524
|
stores_products_grid_section: "himi_shop",
|
|
255394
|
-
|
|
255525
|
+
stores_products_carousel_section: "himi_shop",
|
|
255526
|
+
bookings_services_list_section: "himi_services",
|
|
255527
|
+
upcoming_bookings_section: "himi_bookings",
|
|
255528
|
+
memberships_packages_section: "himi_my_subscriptions",
|
|
255529
|
+
platform_paid_plans_section: "himi_plans",
|
|
255530
|
+
groups_list_section: "himi_groups",
|
|
255531
|
+
faq_list_section: "himi_faq",
|
|
255532
|
+
newBlog_postlist_carousel_full_section: "himi_blog"
|
|
255395
255533
|
};
|
|
255396
255534
|
TEMPLATE_FALLBACKS = { himi_groups_feed: "himi_groups" };
|
|
255397
255535
|
MODULES = {
|
|
@@ -255603,6 +255741,16 @@ var init_generate2 = __esm({
|
|
|
255603
255741
|
achievements_participant_carousel_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "achievements_participant_carousel_section", NO_INLINE_SECTION),
|
|
255604
255742
|
groups_cards_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "groups_cards_section", NO_INLINE_SECTION),
|
|
255605
255743
|
newBlog_search_section: (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, "newBlog_search_section", NO_INLINE_SECTION),
|
|
255744
|
+
...Object.fromEntries([
|
|
255745
|
+
"upcoming_bookings_section",
|
|
255746
|
+
"memberships_packages_section",
|
|
255747
|
+
"platform_paid_plans_section",
|
|
255748
|
+
"groups_list_section",
|
|
255749
|
+
"faq_list_section",
|
|
255750
|
+
"newBlog_postlist_carousel_full_section",
|
|
255751
|
+
"stores_products_grid_section",
|
|
255752
|
+
"stores_products_carousel_section"
|
|
255753
|
+
].map((type2) => [type2, (_id, _s2, _st, _i2, ctx, elementId) => ctx.unsupported(elementId, type2, NO_INLINE_SECTION)])),
|
|
255606
255754
|
// One chosen group: the title and a button that opens that group (the template's group screen takes the id).
|
|
255607
255755
|
single_group_feed_section: (id, s5, st2, _i2, ctx, elementId) => {
|
|
255608
255756
|
const groupId = str13(st2.groupId);
|
|
@@ -191,6 +191,29 @@ no adaptation waiver, and this checklist must not force the disabled control on.
|
|
|
191
191
|
Data/access-dependent controls need the relevant source state; never fabricate
|
|
192
192
|
participants or derive program completion from a badge title.
|
|
193
193
|
|
|
194
|
+
### Sections whose screen already exists
|
|
195
|
+
|
|
196
|
+
`himi one-app generate` connects these sections to a screen the template already ships. It builds nothing for them:
|
|
197
|
+
a page made only of the section opens the screen as its tab, and beside other sections the page keeps the source's title
|
|
198
|
+
(only when the source shows it) and a **See All** button to the screen.
|
|
199
|
+
|
|
200
|
+
| Source section | Screen | What the section passes |
|
|
201
|
+
| --- | --- | --- |
|
|
202
|
+
| `upcoming_bookings_section` | `himi_bookings` | nothing |
|
|
203
|
+
| `memberships_packages_section` | `himi_my_subscriptions` | nothing |
|
|
204
|
+
| `platform_paid_plans_section` | `himi_plans` | nothing: the screen takes no plan selection |
|
|
205
|
+
| `groups_list_section` | `himi_groups` | nothing: no group selection or count |
|
|
206
|
+
| `faq_list_section` | `himi_faq` | nothing: no question count or category selection |
|
|
207
|
+
| `newBlog_postlist_carousel_full_section` | `himi_blog` | nothing: the screen does not open on a category |
|
|
208
|
+
| `stores_products_grid_section`, `stores_products_carousel_section` | `himi_shop` | `categoryId`: the section's collection (Wix's "All Products" collection is the shop's own All chip) |
|
|
209
|
+
|
|
210
|
+
A screen that cannot follow a setting would show more or other content than the source, so `generate` reports one **gap** per
|
|
211
|
+
such setting (a chosen plan or group list, a question or post count, a category, featured-only posts, previous bookings, an empty
|
|
212
|
+
text). Record each as an `adapted` row in the coverage ledger; never leave it unsaid. A scaffold without the screen reports
|
|
213
|
+
the section as unmapped, and `apply-navigation` keeps refusing it. A link that passes a collection opens the shop screen
|
|
214
|
+
instead of selecting its tab, so the collection arrives; the shop screen then carries no collection of its own.
|
|
215
|
+
Forum, `performance_tracker_section` and `platform_general_upcoming_section` have no screen and stay unmapped.
|
|
216
|
+
|
|
194
217
|
### Preserve section visibility across authentication
|
|
195
218
|
|
|
196
219
|
The eight member-only rows above are supported by the shared visibility recipe below;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1721.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": "
|
|
84
|
+
"falconPackageHash": "cbcd5e2e66f59a44a35b3d23405145cc806c06e882ccd40f93ed729d"
|
|
85
85
|
}
|