@wix/himalaya-cli 0.1801.0 → 0.1803.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/builder.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +24 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +22 -3
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +20 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +48 -9
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +41 -7
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{ec390e530da7eb0a2f0efa0267b2fb63e1c4f79d4695418e4a97274d92816788.bin → fea87cf4a45bd9c7c2bc067b03e7d7a0ba320b18781d10153457cd5e2747b4b9.bin} +1 -1
- package/dist/browser-plane/sw.js +8 -8
- package/dist/cli.mjs +121 -70
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/release-notes.md +15 -0
- package/guides/web-page-native-sdk.md +31 -0
- package/guides/wix-business-context.md +1 -1
- package/package.json +2 -2
- package/templates/brandy/README.md +47 -8
- package/templates/brandy/provisioning.json +1 -1
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -3796,7 +3796,11 @@ export interface WebViewConfig {
|
|
|
3796
3796
|
* RFC 0062 — hide the hosted site's OWN menu (its mobile menu button and horizontal menu) on
|
|
3797
3797
|
* every page, a tab's root page included, while the header itself stays for its logo, cart and
|
|
3798
3798
|
* member avatar: the native tabs and drawer already carry the site's pages. Binary-shipped
|
|
3799
|
-
* script, like {@link hideWixAds}.
|
|
3799
|
+
* script, like {@link hideWixAds}. It also marks the page's root element `data-himi-native-nav`
|
|
3800
|
+
* (from document start on iOS/macOS, as the page is first shown on Android), so a site that knows it
|
|
3801
|
+
* runs in the app can hide its own menu with CSS (`[data-himi-native-nav] .my-menu { display: none }`)
|
|
3802
|
+
* — the way a Base44
|
|
3803
|
+
* or other site hides a menu the Wix markers cannot find. No-op on web (cross-origin iframe).
|
|
3800
3804
|
*/
|
|
3801
3805
|
hideHostedSiteMenu?: boolean;
|
|
3802
3806
|
/** RFC 0073 §4.2 — `""` / `"shared"` (default, today) | `"per_instance"` (own origin + storage per
|
|
@@ -3806,7 +3810,26 @@ export interface WebViewConfig {
|
|
|
3806
3810
|
framePolicy?: "" | "content";
|
|
3807
3811
|
/** RFC 0073 §4.2 — storage migration seed; requires `originIsolation: "per_instance"`. */
|
|
3808
3812
|
storageSeed?: WebStorageSeed;
|
|
3813
|
+
/**
|
|
3814
|
+
* RFC 0062 — CSS selectors of the hosted site's elements to hide, on every page: a menu the Wix
|
|
3815
|
+
* markers miss, a Base44 or other site's own navigation, a banner. DATA, never script: the binary
|
|
3816
|
+
* ships the hider that hides each match (`display:none`) and keeps it hidden as the page mutates, so
|
|
3817
|
+
* an owner can change the list over the air (invariant 15). An invalid selector is skipped; the host
|
|
3818
|
+
* applies at most {@link HIDE_SELECTORS_MAX} of at most {@link HIDE_SELECTOR_MAX_LENGTH} characters
|
|
3819
|
+
* each. No-op on web (cross-origin iframe).
|
|
3820
|
+
*/
|
|
3821
|
+
hideSelectors?: string[];
|
|
3822
|
+
/**
|
|
3823
|
+
* RFC 0062 — which platform the site shell's page runs on (`siteWebViewPreset` sets it). Descriptive:
|
|
3824
|
+
* it turns nothing on natively. The web host reads it to load a Wix page's mobile layout
|
|
3825
|
+
* (`showMobileView`), which it otherwise inferred from the Wix-only hider flags. `""` ⇒ not a site
|
|
3826
|
+
* shell page.
|
|
3827
|
+
*/
|
|
3828
|
+
siteKind?: "" | "wix" | "base44" | "web";
|
|
3809
3829
|
}
|
|
3830
|
+
/** The most {@link WebViewConfig.hideSelectors} a host applies, and the longest selector it accepts. */
|
|
3831
|
+
export declare const HIDE_SELECTORS_MAX = 32;
|
|
3832
|
+
export declare const HIDE_SELECTOR_MAX_LENGTH = 200;
|
|
3810
3833
|
/**
|
|
3811
3834
|
* Embeddable WebView component (web-in-SDUI). WebViews have no intrinsic height,
|
|
3812
3835
|
* so exactly one of `height` / `aspectRatio` must be set; inner scroll is off by
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts
CHANGED
|
@@ -52,14 +52,20 @@ export interface SitePage {
|
|
|
52
52
|
}
|
|
53
53
|
/** What the shell hides from the hosted site so the native chrome is the only chrome.
|
|
54
54
|
* Every flag defaults to `true` (hidden) for a Wix or Base44 site, and to `false` for a `"web"`
|
|
55
|
-
* site, whose markup the shell knows nothing about (see {@link resolveSiteChrome})
|
|
55
|
+
* site, whose markup the shell knows nothing about (see {@link resolveSiteChrome});
|
|
56
|
+
* {@link hideSelectors} defaults to none. */
|
|
56
57
|
export interface SiteChrome {
|
|
57
58
|
/** The site's own header on inner pages. A tab's root page keeps it, for its logo, cart and
|
|
58
59
|
* member avatar — see {@link hideSiteMenu} for its menu. */
|
|
59
60
|
hideSiteHeader?: boolean;
|
|
60
61
|
/** The site's own menu (mobile menu button + horizontal menu) on EVERY page, root included:
|
|
61
62
|
* the native tabs and drawer already list the site's pages, so it would be a second menu.
|
|
62
|
-
* Wix
|
|
63
|
+
* On a Wix site the binary hides Wix's own menu markers. On every kind the page's root element
|
|
64
|
+
* is also marked `data-himi-native-nav` (from document start on iOS/macOS, as the page is first
|
|
65
|
+
* shown on Android), so a Base44 or other site that cooperates hides its own menu with one CSS
|
|
66
|
+
* rule (a non-Wix site has
|
|
67
|
+
* none of the Wix markers; for a site that cannot change, list its menu in
|
|
68
|
+
* {@link hideSelectors}). */
|
|
63
69
|
hideSiteMenu?: boolean;
|
|
64
70
|
/** The site's footer. */
|
|
65
71
|
hideSiteFooter?: boolean;
|
|
@@ -67,7 +73,18 @@ export interface SiteChrome {
|
|
|
67
73
|
* default is hidden, and an owner (or a policy decision) can turn it back on
|
|
68
74
|
* without a new binary, because the flag rides the OTA descriptor. */
|
|
69
75
|
hideWixAds?: boolean;
|
|
76
|
+
/** CSS selectors of more of the site's elements to hide on every page: a menu the Wix markers
|
|
77
|
+
* miss, a Base44 or other site's navigation, a banner. Data the binary-shipped hider reads, never
|
|
78
|
+
* script, so it changes over the air like the flags. At most {@link HIDE_SELECTORS_MAX}, each at
|
|
79
|
+
* most {@link HIDE_SELECTOR_MAX_LENGTH} characters; a selector the page's browser cannot parse is
|
|
80
|
+
* skipped there. A page's `webView.hideSelectors` replaces the list for that page. */
|
|
81
|
+
hideSelectors?: readonly string[];
|
|
70
82
|
}
|
|
83
|
+
/** {@link SiteChrome.hideSelectors} checked and cleaned: each selector trimmed, empty and repeated ones
|
|
84
|
+
* dropped. Throws on a list that is not strings, on more than {@link HIDE_SELECTORS_MAX} selectors, on
|
|
85
|
+
* one longer than {@link HIDE_SELECTOR_MAX_LENGTH} characters, and on a control character (a
|
|
86
|
+
* selector is one line). Absent ⇒ `[]`. */
|
|
87
|
+
export declare function normalizeHideSelectors(list: unknown, where?: string): string[];
|
|
71
88
|
/** Which native chrome frames the site. Rides the served `navigation.navKind`, so changing it is
|
|
72
89
|
* an OTA config change, never a new binary.
|
|
73
90
|
* - `auto` (default): bottom tabs on a phone and a sidebar rail on a regular size class
|
|
@@ -248,7 +265,9 @@ export declare function siteScreenId(page: Pick<SitePage, "id">): string;
|
|
|
248
265
|
* default, RFC 0062 §6) and `false` for a `"web"` site: the header and footer hiders fall back to
|
|
249
266
|
* the page's first `<header>` / last `<footer>`, which on an arbitrary site may be an article's,
|
|
250
267
|
* so they run only when the owner turns them on. `kind` absent ⇒ the Wix/Base44 default. */
|
|
251
|
-
export declare function resolveSiteChrome(chrome: SiteChrome | undefined, kind?: SiteKind): Required<SiteChrome
|
|
268
|
+
export declare function resolveSiteChrome(chrome: SiteChrome | undefined, kind?: SiteKind): Required<Omit<SiteChrome, "hideSelectors">> & {
|
|
269
|
+
hideSelectors: string[];
|
|
270
|
+
};
|
|
252
271
|
/**
|
|
253
272
|
* The WebView behaviour every site tab shares. Derived from the demo app's Site tab
|
|
254
273
|
* (`buildWebViewSiteApp`), which runs a real Wix site this way on both platforms:
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts
CHANGED
|
@@ -1842,6 +1842,16 @@ export declare const screenDescriptorSchema: {
|
|
|
1842
1842
|
};
|
|
1843
1843
|
};
|
|
1844
1844
|
};
|
|
1845
|
+
readonly hideSelectors: {
|
|
1846
|
+
readonly type: "array";
|
|
1847
|
+
readonly items: {
|
|
1848
|
+
readonly type: "string";
|
|
1849
|
+
};
|
|
1850
|
+
};
|
|
1851
|
+
readonly siteKind: {
|
|
1852
|
+
readonly type: "string";
|
|
1853
|
+
readonly enum: readonly ["", "wix", "base44", "web"];
|
|
1854
|
+
};
|
|
1845
1855
|
};
|
|
1846
1856
|
};
|
|
1847
1857
|
};
|
|
@@ -3511,6 +3521,16 @@ export declare const widgetSnapshotSchema: {
|
|
|
3511
3521
|
};
|
|
3512
3522
|
};
|
|
3513
3523
|
};
|
|
3524
|
+
readonly hideSelectors: {
|
|
3525
|
+
readonly type: "array";
|
|
3526
|
+
readonly items: {
|
|
3527
|
+
readonly type: "string";
|
|
3528
|
+
};
|
|
3529
|
+
};
|
|
3530
|
+
readonly siteKind: {
|
|
3531
|
+
readonly type: "string";
|
|
3532
|
+
readonly enum: readonly ["", "wix", "base44", "web"];
|
|
3533
|
+
};
|
|
3514
3534
|
};
|
|
3515
3535
|
};
|
|
3516
3536
|
};
|
|
@@ -6887,6 +6887,8 @@ var RICH_CONTENT_EDITOR_TOOLS = ["bold", "italic", "underline", "heading", "bull
|
|
|
6887
6887
|
function resolveTabBarPresentation(raw) {
|
|
6888
6888
|
return raw === "kit" ? "kit" : "native";
|
|
6889
6889
|
}
|
|
6890
|
+
var HIDE_SELECTORS_MAX = 32;
|
|
6891
|
+
var HIDE_SELECTOR_MAX_LENGTH = 200;
|
|
6890
6892
|
|
|
6891
6893
|
// ../../core/ts/src/stream-policy.ts
|
|
6892
6894
|
var STREAM_POLICY_VERSION = 1;
|
|
@@ -9991,7 +9993,10 @@ var screenDescriptorSchema = {
|
|
|
9991
9993
|
properties: {
|
|
9992
9994
|
snapshotPath: { type: "string" }
|
|
9993
9995
|
}
|
|
9994
|
-
}
|
|
9996
|
+
},
|
|
9997
|
+
// RFC 0062 — owner selectors for the binary-shipped selector hider (55) and the site's kind (56).
|
|
9998
|
+
hideSelectors: { type: "array", items: { type: "string" } },
|
|
9999
|
+
siteKind: { type: "string", enum: ["", "wix", "base44", "web"] }
|
|
9995
10000
|
}
|
|
9996
10001
|
}
|
|
9997
10002
|
}
|
|
@@ -14990,8 +14995,8 @@ var isBridged = (props) => props.bridge === "worker";
|
|
|
14990
14995
|
var isPrimary = (props) => props.role === "primary";
|
|
14991
14996
|
var configOf = (props) => isRec2(props.config) ? props.config : {};
|
|
14992
14997
|
var hasWeight = (modifiers) => typeof modifiers.weight === "number" && Number.isFinite(modifiers.weight) && modifiers.weight > 0;
|
|
14993
|
-
var SITE_CONFIG_FIELDS = ["hostedSiteAdapter", "sessionBridge", "hideHostedSiteHeader", "hideHostedSiteFooter", "hideHostedSiteMenu", "hideWixAds"];
|
|
14994
|
-
var siteConfigFields = (config) => SITE_CONFIG_FIELDS.filter((k) => config[k] === true || typeof config[k] === "string" && config[k] !== "");
|
|
14998
|
+
var SITE_CONFIG_FIELDS = ["hostedSiteAdapter", "sessionBridge", "hideHostedSiteHeader", "hideHostedSiteFooter", "hideHostedSiteMenu", "hideWixAds", "hideSelectors"];
|
|
14999
|
+
var siteConfigFields = (config) => SITE_CONFIG_FIELDS.filter((k) => config[k] === true || typeof config[k] === "string" && config[k] !== "" || Array.isArray(config[k]) && config[k].length > 0);
|
|
14995
15000
|
var isPerInstance = (props) => configOf(props).originIsolation === "per_instance";
|
|
14996
15001
|
var isLiteral = (v) => typeof v === "string" && v !== "" && !v.startsWith("$");
|
|
14997
15002
|
var isItemDerived = (v) => typeof v === "string" && /\$item\.[A-Za-z0-9_]/.test(v);
|
|
@@ -15440,6 +15445,23 @@ function assertSiteKind(kind) {
|
|
|
15440
15445
|
throw new Error(`site kind ${JSON.stringify(kind)} must be one of ${SITE_KINDS.map((k) => JSON.stringify(k)).join(", ")}`);
|
|
15441
15446
|
}
|
|
15442
15447
|
}
|
|
15448
|
+
function normalizeHideSelectors(list, where = "site chrome.hideSelectors") {
|
|
15449
|
+
if (list === void 0 || list === null) return [];
|
|
15450
|
+
if (!Array.isArray(list)) throw new Error(`${where} must be a list of CSS selectors`);
|
|
15451
|
+
const out = [];
|
|
15452
|
+
for (const raw of list) {
|
|
15453
|
+
if (typeof raw !== "string") throw new Error(`${where} must hold strings, got ${JSON.stringify(raw)}`);
|
|
15454
|
+
const sel = raw.trim();
|
|
15455
|
+
if (sel === "") continue;
|
|
15456
|
+
if (sel.length > HIDE_SELECTOR_MAX_LENGTH) {
|
|
15457
|
+
throw new Error(`${where} selector ${JSON.stringify(sel.slice(0, 40))}\u2026 is longer than ${HIDE_SELECTOR_MAX_LENGTH} characters`);
|
|
15458
|
+
}
|
|
15459
|
+
if (/[\u0000-\u001f\u007f\u2028\u2029]/.test(sel)) throw new Error(`${where} selector ${JSON.stringify(sel)} holds a control character`);
|
|
15460
|
+
if (!out.includes(sel)) out.push(sel);
|
|
15461
|
+
}
|
|
15462
|
+
if (out.length > HIDE_SELECTORS_MAX) throw new Error(`${where} has ${out.length} selectors; at most ${HIDE_SELECTORS_MAX}`);
|
|
15463
|
+
return out;
|
|
15464
|
+
}
|
|
15443
15465
|
var SITE_LAYOUTS = ["auto", "tabs", "drawer", "sidebar", "single"];
|
|
15444
15466
|
var SITE_PAGE_TITLES = ["auto", "always", "never"];
|
|
15445
15467
|
var SITE_TOP_BAR_MAX_ACTIONS = 3;
|
|
@@ -15517,7 +15539,8 @@ function resolveSiteChrome(chrome, kind) {
|
|
|
15517
15539
|
hideSiteHeader: chrome?.hideSiteHeader ?? hide,
|
|
15518
15540
|
hideSiteMenu: chrome?.hideSiteMenu ?? hide,
|
|
15519
15541
|
hideSiteFooter: chrome?.hideSiteFooter ?? hide,
|
|
15520
|
-
hideWixAds: chrome?.hideWixAds ?? hide
|
|
15542
|
+
hideWixAds: chrome?.hideWixAds ?? hide,
|
|
15543
|
+
hideSelectors: normalizeHideSelectors(chrome?.hideSelectors)
|
|
15521
15544
|
};
|
|
15522
15545
|
}
|
|
15523
15546
|
function siteWebViewPreset(site) {
|
|
@@ -15534,8 +15557,13 @@ function siteWebViewPreset(site) {
|
|
|
15534
15557
|
hideHostedSiteFooter: chrome.hideSiteFooter,
|
|
15535
15558
|
// Wix ads only exist on Wix free sites; a Base44 or `"web"` site never gets the Wix selectors.
|
|
15536
15559
|
hideWixAds: site.kind === "wix" && chrome.hideWixAds,
|
|
15537
|
-
// The site's own menu duplicates the native tabs/drawer.
|
|
15538
|
-
|
|
15560
|
+
// The site's own menu duplicates the native tabs/drawer. The host hides Wix's menu markers
|
|
15561
|
+
// (absent anywhere else) and marks the page `data-himi-native-nav` for a site that hides its own.
|
|
15562
|
+
hideHostedSiteMenu: chrome.hideSiteMenu,
|
|
15563
|
+
// The owner's own selectors, for what no built-in hider knows. Data only (invariant 15).
|
|
15564
|
+
...chrome.hideSelectors.length > 0 ? { hideSelectors: chrome.hideSelectors } : {},
|
|
15565
|
+
// Descriptive: the web host loads a Wix page's mobile layout from it (webViewFrameUrl).
|
|
15566
|
+
siteKind: site.kind,
|
|
15539
15567
|
// RFC 0062 §5.8 — a Base44 app is signed in natively and its session carried into the page.
|
|
15540
15568
|
// The host still refuses unless the app declares the `base44` capability. A Wix site bridges
|
|
15541
15569
|
// only when its app signs members in natively (`site.sessionBridge`); the host additionally
|
|
@@ -15583,9 +15611,15 @@ function siteScreenTopBar(site, showsTitle, pageId) {
|
|
|
15583
15611
|
return { ...kept.length > 0 ? { actions: kept } : {}, ...showsTitle ? {} : { titleDisplay: "hidden" } };
|
|
15584
15612
|
}
|
|
15585
15613
|
function enforceSiteKind(site, config) {
|
|
15586
|
-
|
|
15587
|
-
|
|
15588
|
-
|
|
15614
|
+
const selectors = config.hideSelectors === void 0 ? {} : (() => {
|
|
15615
|
+
const list = normalizeHideSelectors(config.hideSelectors, "site page webView.hideSelectors");
|
|
15616
|
+
return list.length > 0 ? { hideSelectors: list } : {};
|
|
15617
|
+
})();
|
|
15618
|
+
const { hideSelectors: _selectors, ...kept } = config;
|
|
15619
|
+
const scoped = { ...kept, ...selectors, siteKind: site.kind };
|
|
15620
|
+
if (site.kind !== "web") return scoped;
|
|
15621
|
+
const { hostedSiteAdapter: _adapter, sessionBridge: _bridge, ...rest } = scoped;
|
|
15622
|
+
return { ...rest, hideWixAds: false };
|
|
15589
15623
|
}
|
|
15590
15624
|
function defineSiteTab(site, page) {
|
|
15591
15625
|
assertSitePage(page);
|
|
@@ -15967,12 +16001,14 @@ function assertSiteShellConfig(site, opts) {
|
|
|
15967
16001
|
if (!Array.isArray(site.pages) || site.pages.length === 0) {
|
|
15968
16002
|
throw new Error("a site shell needs at least one page");
|
|
15969
16003
|
}
|
|
16004
|
+
normalizeHideSelectors(site.chrome?.hideSelectors);
|
|
15970
16005
|
const seen = /* @__PURE__ */ new Set();
|
|
15971
16006
|
for (const page of site.pages) {
|
|
15972
16007
|
assertSitePage(page);
|
|
15973
16008
|
if (seen.has(page.id)) throw new Error(`site page id ${page.id} is declared twice`);
|
|
15974
16009
|
seen.add(page.id);
|
|
15975
16010
|
sitePageUrl(site.origin, page.path);
|
|
16011
|
+
normalizeHideSelectors(page.webView?.hideSelectors, `site page ${page.id} webView.hideSelectors`);
|
|
15976
16012
|
}
|
|
15977
16013
|
for (const [key, path] of Object.entries(site.memberPages ?? {})) {
|
|
15978
16014
|
if (typeof path !== "string" || !path) throw new Error(`site memberPages.${key} must be a path`);
|
|
@@ -16588,6 +16624,8 @@ export {
|
|
|
16588
16624
|
DUAL_FORM_NODE_RENDERER,
|
|
16589
16625
|
DUAL_FORM_T3_RENDERER,
|
|
16590
16626
|
FixtureValidator,
|
|
16627
|
+
HIDE_SELECTORS_MAX,
|
|
16628
|
+
HIDE_SELECTOR_MAX_LENGTH,
|
|
16591
16629
|
ICON_CATALOG,
|
|
16592
16630
|
ICON_FALLBACK,
|
|
16593
16631
|
ICON_GLYPH_SCALE_MAX,
|
|
@@ -16740,6 +16778,7 @@ export {
|
|
|
16740
16778
|
localeChoiceSource,
|
|
16741
16779
|
mergeIdiomOverlay,
|
|
16742
16780
|
mergeSiteMenu,
|
|
16781
|
+
normalizeHideSelectors,
|
|
16743
16782
|
normalizeInternalEmailDomain,
|
|
16744
16783
|
normalizeServeApp,
|
|
16745
16784
|
normalizeSiteMenu,
|
|
@@ -6884,6 +6884,8 @@ var require_dist = __commonJS({
|
|
|
6884
6884
|
|
|
6885
6885
|
// ../../core/ts/src/schema.ts
|
|
6886
6886
|
var RICH_CONTENT_EDITOR_TOOLS = ["bold", "italic", "underline", "heading", "bullet", "ordered", "quote", "link", "image", "divider", "undo", "redo"];
|
|
6887
|
+
var HIDE_SELECTORS_MAX = 32;
|
|
6888
|
+
var HIDE_SELECTOR_MAX_LENGTH = 200;
|
|
6887
6889
|
|
|
6888
6890
|
// ../../core/data-resources/src/schema.ts
|
|
6889
6891
|
var KV_DEFAULT_MAX_VALUE_BYTES = 64 * 1024;
|
|
@@ -8003,7 +8005,10 @@ var screenDescriptorSchema = {
|
|
|
8003
8005
|
properties: {
|
|
8004
8006
|
snapshotPath: { type: "string" }
|
|
8005
8007
|
}
|
|
8006
|
-
}
|
|
8008
|
+
},
|
|
8009
|
+
// RFC 0062 — owner selectors for the binary-shipped selector hider (55) and the site's kind (56).
|
|
8010
|
+
hideSelectors: { type: "array", items: { type: "string" } },
|
|
8011
|
+
siteKind: { type: "string", enum: ["", "wix", "base44", "web"] }
|
|
8007
8012
|
}
|
|
8008
8013
|
}
|
|
8009
8014
|
}
|
|
@@ -8724,6 +8729,23 @@ function assertSiteKind(kind) {
|
|
|
8724
8729
|
throw new Error(`site kind ${JSON.stringify(kind)} must be one of ${SITE_KINDS.map((k) => JSON.stringify(k)).join(", ")}`);
|
|
8725
8730
|
}
|
|
8726
8731
|
}
|
|
8732
|
+
function normalizeHideSelectors(list, where = "site chrome.hideSelectors") {
|
|
8733
|
+
if (list === void 0 || list === null) return [];
|
|
8734
|
+
if (!Array.isArray(list)) throw new Error(`${where} must be a list of CSS selectors`);
|
|
8735
|
+
const out = [];
|
|
8736
|
+
for (const raw of list) {
|
|
8737
|
+
if (typeof raw !== "string") throw new Error(`${where} must hold strings, got ${JSON.stringify(raw)}`);
|
|
8738
|
+
const sel = raw.trim();
|
|
8739
|
+
if (sel === "") continue;
|
|
8740
|
+
if (sel.length > HIDE_SELECTOR_MAX_LENGTH) {
|
|
8741
|
+
throw new Error(`${where} selector ${JSON.stringify(sel.slice(0, 40))}\u2026 is longer than ${HIDE_SELECTOR_MAX_LENGTH} characters`);
|
|
8742
|
+
}
|
|
8743
|
+
if (/[\u0000-\u001f\u007f\u2028\u2029]/.test(sel)) throw new Error(`${where} selector ${JSON.stringify(sel)} holds a control character`);
|
|
8744
|
+
if (!out.includes(sel)) out.push(sel);
|
|
8745
|
+
}
|
|
8746
|
+
if (out.length > HIDE_SELECTORS_MAX) throw new Error(`${where} has ${out.length} selectors; at most ${HIDE_SELECTORS_MAX}`);
|
|
8747
|
+
return out;
|
|
8748
|
+
}
|
|
8727
8749
|
function normalizeSiteOrigin(origin) {
|
|
8728
8750
|
const raw = (typeof origin === "string" ? origin : "").trim();
|
|
8729
8751
|
let url;
|
|
@@ -8779,7 +8801,8 @@ function resolveSiteChrome(chrome, kind) {
|
|
|
8779
8801
|
hideSiteHeader: chrome?.hideSiteHeader ?? hide,
|
|
8780
8802
|
hideSiteMenu: chrome?.hideSiteMenu ?? hide,
|
|
8781
8803
|
hideSiteFooter: chrome?.hideSiteFooter ?? hide,
|
|
8782
|
-
hideWixAds: chrome?.hideWixAds ?? hide
|
|
8804
|
+
hideWixAds: chrome?.hideWixAds ?? hide,
|
|
8805
|
+
hideSelectors: normalizeHideSelectors(chrome?.hideSelectors)
|
|
8783
8806
|
};
|
|
8784
8807
|
}
|
|
8785
8808
|
function siteWebViewPreset(site) {
|
|
@@ -8796,8 +8819,13 @@ function siteWebViewPreset(site) {
|
|
|
8796
8819
|
hideHostedSiteFooter: chrome.hideSiteFooter,
|
|
8797
8820
|
// Wix ads only exist on Wix free sites; a Base44 or `"web"` site never gets the Wix selectors.
|
|
8798
8821
|
hideWixAds: site.kind === "wix" && chrome.hideWixAds,
|
|
8799
|
-
// The site's own menu duplicates the native tabs/drawer.
|
|
8800
|
-
|
|
8822
|
+
// The site's own menu duplicates the native tabs/drawer. The host hides Wix's menu markers
|
|
8823
|
+
// (absent anywhere else) and marks the page `data-himi-native-nav` for a site that hides its own.
|
|
8824
|
+
hideHostedSiteMenu: chrome.hideSiteMenu,
|
|
8825
|
+
// The owner's own selectors, for what no built-in hider knows. Data only (invariant 15).
|
|
8826
|
+
...chrome.hideSelectors.length > 0 ? { hideSelectors: chrome.hideSelectors } : {},
|
|
8827
|
+
// Descriptive: the web host loads a Wix page's mobile layout from it (webViewFrameUrl).
|
|
8828
|
+
siteKind: site.kind,
|
|
8801
8829
|
// RFC 0062 §5.8 — a Base44 app is signed in natively and its session carried into the page.
|
|
8802
8830
|
// The host still refuses unless the app declares the `base44` capability. A Wix site bridges
|
|
8803
8831
|
// only when its app signs members in natively (`site.sessionBridge`); the host additionally
|
|
@@ -8829,9 +8857,15 @@ function siteWebViewPreset(site) {
|
|
|
8829
8857
|
};
|
|
8830
8858
|
}
|
|
8831
8859
|
function enforceSiteKind(site, config) {
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
|
|
8860
|
+
const selectors = config.hideSelectors === void 0 ? {} : (() => {
|
|
8861
|
+
const list = normalizeHideSelectors(config.hideSelectors, "site page webView.hideSelectors");
|
|
8862
|
+
return list.length > 0 ? { hideSelectors: list } : {};
|
|
8863
|
+
})();
|
|
8864
|
+
const { hideSelectors: _selectors, ...kept } = config;
|
|
8865
|
+
const scoped = { ...kept, ...selectors, siteKind: site.kind };
|
|
8866
|
+
if (site.kind !== "web") return scoped;
|
|
8867
|
+
const { hostedSiteAdapter: _adapter, sessionBridge: _bridge, ...rest } = scoped;
|
|
8868
|
+
return { ...rest, hideWixAds: false };
|
|
8835
8869
|
}
|
|
8836
8870
|
var SITE_PAGE_NODE_ID = "site_page_view";
|
|
8837
8871
|
function primarySiteWebView(url, config, id, label2, capabilitiesRequired, bridge) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"files": [
|
|
3
3
|
{
|
|
4
4
|
"name": "sw.js",
|
|
5
|
-
"bytes":
|
|
5
|
+
"bytes": 2607316
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "host.html",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bytes": 24320
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"name": "preview-deferred/
|
|
24
|
+
"name": "preview-deferred/fea87cf4a45bd9c7c2bc067b03e7d7a0ba320b18781d10153457cd5e2747b4b9.bin",
|
|
25
25
|
"bytes": 488215
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
],
|
|
80
80
|
"deferred": [
|
|
81
81
|
{
|
|
82
|
-
"key": "assets/pdf-
|
|
82
|
+
"key": "assets/pdf-qhkzriYt.js",
|
|
83
83
|
"contentType": "application/javascript; charset=utf-8",
|
|
84
|
-
"sha256": "
|
|
85
|
-
"file": "preview-deferred/
|
|
84
|
+
"sha256": "fea87cf4a45bd9c7c2bc067b03e7d7a0ba320b18781d10153457cd5e2747b4b9",
|
|
85
|
+
"file": "preview-deferred/fea87cf4a45bd9c7c2bc067b03e7d7a0ba320b18781d10153457cd5e2747b4b9.bin"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"key": "assets/pdf.worker.min-BGnVRhRG.js",
|