@wix/himalaya-cli 0.1079.0 → 0.1081.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 +20 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +62 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts +0 -14
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +36 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/rich-content/src/display.d.ts +26 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/rich-content/src/index.d.ts +79 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +25 -49
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +508 -41
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-rich-content.mjs +345 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +4 -0
- package/dist/cli.mjs +2043 -1280
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/component-reference.json +10 -1
- package/guides/component-reference.md +20 -2
- package/guides/importable-sdks.md +1 -0
- package/guides/index.json +1 -1
- package/guides/sdk-reference.json +74 -1
- package/guides/splash-screens.md +13 -1
- package/package.json +2 -2
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/community-club-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/community-club-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/community-club-owner/tier5-src/himi-owner-lite-event-form/index.ts +2 -2
- package/templates/events-meetups-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/events-meetups-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-event-form/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-event-form/index.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-event-form/index.ts +2 -2
- package/templates/owner-lite/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/owner-lite/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/owner-lite/tier5-src/himi-owner-lite-event-form/index.ts +2 -2
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-event-form/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/restaurant-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/restaurant-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-event-form/index.ts +2 -2
- package/templates/retail-store-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/retail-store-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-post-content.ts +7 -26
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-rich-guard.ts +12 -41
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-event-form/index.ts +2 -2
|
@@ -134,6 +134,8 @@ export interface WebViewConfig {
|
|
|
134
134
|
internalLinksAsScreens?: boolean;
|
|
135
135
|
respectHttpCache?: boolean;
|
|
136
136
|
coverBandColor?: string;
|
|
137
|
+
hideWixAds?: boolean;
|
|
138
|
+
hideHostedSiteFooter?: boolean;
|
|
137
139
|
}
|
|
138
140
|
export declare function vstack(props: {
|
|
139
141
|
spacing?: number;
|
|
@@ -378,6 +380,24 @@ export declare function dataTable(props: {
|
|
|
378
380
|
}, opts?: {
|
|
379
381
|
id?: string;
|
|
380
382
|
}): Component;
|
|
383
|
+
/**
|
|
384
|
+
* RFC 0063 — a Wix Ricos document rendered natively (never a WebView). Pass exactly one of
|
|
385
|
+
* `documentJsonPath` (`$service:<service>.<path>` / `$item.<field>` → the JSON string a worker
|
|
386
|
+
* published, e.g. `encodeRichContent(doc).json`) or `documentJson` (a literal seed document).
|
|
387
|
+
* The id is REQUIRED: child test ids are `<id>/<blockId>` (invariant 27). `onLink` receives
|
|
388
|
+
* `args.url`; without it http(s) links open in the in-app browser. `fallback` renders when the
|
|
389
|
+
* document is rejected (over budget / invalid); nothing inside the document is ever resolved
|
|
390
|
+
* as a binding.
|
|
391
|
+
*/
|
|
392
|
+
export declare function richContent(props: {
|
|
393
|
+
documentJsonPath?: string;
|
|
394
|
+
documentJson?: string;
|
|
395
|
+
onLink?: ActionShape;
|
|
396
|
+
fallback?: Component;
|
|
397
|
+
}, opts: {
|
|
398
|
+
id: string;
|
|
399
|
+
modifiers?: NonNullable<Component["modifiers"]>;
|
|
400
|
+
}): Component;
|
|
381
401
|
export declare function spacer(opts?: {
|
|
382
402
|
id?: string;
|
|
383
403
|
value?: string;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -1519,6 +1519,23 @@ export interface DataTableProps {
|
|
|
1519
1519
|
maxRows?: number;
|
|
1520
1520
|
zebra?: boolean;
|
|
1521
1521
|
}
|
|
1522
|
+
/**
|
|
1523
|
+
* RFC 0063 — a Wix Ricos rich-content document rendered natively: headings, lists, links,
|
|
1524
|
+
* images, galleries, video, tables and link cards (never a WebView). The document travels as a
|
|
1525
|
+
* JSON STRING so every renderer caps its bytes before parsing (RFC 0046's precedent) and a
|
|
1526
|
+
* `$item.` row substitution carries it intact. Exactly one of `documentJsonPath` /
|
|
1527
|
+
* `documentJson` is set. Nothing inside the document is ever resolved as a binding.
|
|
1528
|
+
*/
|
|
1529
|
+
export interface RichContentProps {
|
|
1530
|
+
/** `$service:<svc>.<path>` or `$item.<field>` → the UTF-8 JSON of `{ nodes, metadata?, documentStyle? }`. */
|
|
1531
|
+
documentJsonPath?: string;
|
|
1532
|
+
/** Literal document JSON (seed / offline). */
|
|
1533
|
+
documentJson?: string;
|
|
1534
|
+
/** Dispatched on a link, button or card tap with `args.url`. Absent ⇒ http(s) opens the in-app browser. */
|
|
1535
|
+
onLink?: Action;
|
|
1536
|
+
/** Rendered when the document is rejected (over budget / invalid). Absent ⇒ nothing. */
|
|
1537
|
+
fallback?: Component;
|
|
1538
|
+
}
|
|
1522
1539
|
/**
|
|
1523
1540
|
* A recorded-audio message bubble — waveform, play/pause, scrubber, duration and
|
|
1524
1541
|
* playback rate (messenger design G4).
|
|
@@ -2324,6 +2341,10 @@ export type CoreComponentBody = {
|
|
|
2324
2341
|
package: "himalaya";
|
|
2325
2342
|
type: "DataTable";
|
|
2326
2343
|
props: DataTableProps;
|
|
2344
|
+
} | {
|
|
2345
|
+
package: "himalaya";
|
|
2346
|
+
type: "RichContent";
|
|
2347
|
+
props: RichContentProps;
|
|
2327
2348
|
} | {
|
|
2328
2349
|
package: "himalaya";
|
|
2329
2350
|
type: "VoiceNote";
|
|
@@ -2708,7 +2729,12 @@ export interface SplashConfig {
|
|
|
2708
2729
|
/** Hard ceiling on the readiness hold, ms — a stuck boot can never wedge the
|
|
2709
2730
|
* UI. 0 / absent ⇒ 3000. Clamped client-side to [0, 8000]. */
|
|
2710
2731
|
maxHoldMs?: number;
|
|
2732
|
+
/** RFC 0062 — what readiness waits for beyond the seed. Absent / "" ⇒ seeded is
|
|
2733
|
+
* enough. "first_content" ⇒ also the first WebView page (a site shell), still
|
|
2734
|
+
* under `maxHoldMs`. Unknown coalesces to "" on device. */
|
|
2735
|
+
readySignal?: SplashReadySignal;
|
|
2711
2736
|
}
|
|
2737
|
+
export type SplashReadySignal = "" | "first_content";
|
|
2712
2738
|
export interface DeepLinkPattern {
|
|
2713
2739
|
/** e.g. "wix-owner://blog/post/:id" */
|
|
2714
2740
|
pattern: string;
|
|
@@ -2913,9 +2939,44 @@ export interface WebViewConfig {
|
|
|
2913
2939
|
* cover is recreated on every present, so without this each open is a cold reload
|
|
2914
2940
|
* (multi-second for a heavy SPA). With it, the host caches the WebView per screenId
|
|
2915
2941
|
* (LRU) and re-shows the already-loaded page instantly — in-app login/session and
|
|
2916
|
-
* scroll position are preserved.
|
|
2942
|
+
* scroll position are preserved. Both platforms (WebViewKeepAliveStore, keyed by screen id).
|
|
2917
2943
|
*/
|
|
2918
2944
|
keepAlive?: boolean;
|
|
2945
|
+
/**
|
|
2946
|
+
* Pin an uncooperative hosted site's own header (`position: relative` on mobile, so it
|
|
2947
|
+
* scrolls away) to the top while the page scrolls — an app-like sticky menu. Injected CSS
|
|
2948
|
+
* makes it `position: sticky` under the safe-area inset with an opaque background.
|
|
2949
|
+
*/
|
|
2950
|
+
pinHostedHeader?: boolean;
|
|
2951
|
+
/**
|
|
2952
|
+
* Turn internal navigations (real links + Wix SPA pushState routes) into native pushed
|
|
2953
|
+
* WebView screens with native back/close, kept warm in an LRU pool. Enable only on
|
|
2954
|
+
* hosted-site covers. See docs/webview-internal-links-as-screens.md.
|
|
2955
|
+
*/
|
|
2956
|
+
internalLinksAsScreens?: boolean;
|
|
2957
|
+
/**
|
|
2958
|
+
* Honour the origin's HTTP caching (revalidate per Cache-Control). Default prefers a cached
|
|
2959
|
+
* copy for a faster load; set true for screens that must always be fresh. An explicit
|
|
2960
|
+
* `cacheMode` still wins.
|
|
2961
|
+
*/
|
|
2962
|
+
respectHttpCache?: boolean;
|
|
2963
|
+
/**
|
|
2964
|
+
* Fallback band colour (any CSS colour). The dynamic band reads the site's own
|
|
2965
|
+
* `<meta name="theme-color">`; this colour is used until/when the site declares none. On
|
|
2966
|
+
* web (a cross-origin iframe can't be read) it is the only band source.
|
|
2967
|
+
*/
|
|
2968
|
+
coverBandColor?: string;
|
|
2969
|
+
/**
|
|
2970
|
+
* RFC 0062 — hide the Wix free-site ads banner (`WIX_ADS`) and keep it hidden as the page
|
|
2971
|
+
* mutates. The script ships in the app binary; only this flag travels over the air, so an
|
|
2972
|
+
* owner can turn ads back on without a new build. No-op on web (cross-origin iframe).
|
|
2973
|
+
*/
|
|
2974
|
+
hideWixAds?: boolean;
|
|
2975
|
+
/**
|
|
2976
|
+
* RFC 0062 — hide the hosted site's OWN footer (the native chrome replaces it). Binary-shipped
|
|
2977
|
+
* script, like {@link hideHostedSiteHeader}. No-op on web (cross-origin iframe).
|
|
2978
|
+
*/
|
|
2979
|
+
hideHostedSiteFooter?: boolean;
|
|
2919
2980
|
}
|
|
2920
2981
|
/**
|
|
2921
2982
|
* Embeddable WebView component (web-in-SDUI). WebViews have no intrinsic height,
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/site-shell.d.ts
CHANGED
|
@@ -87,20 +87,6 @@ export declare function siteAllowedOrigins(origin: string, kind: SiteKind): stri
|
|
|
87
87
|
export declare function sitePageUrl(origin: string, path: string): string;
|
|
88
88
|
/** `site_<page.id>`. */
|
|
89
89
|
export declare function siteScreenId(page: Pick<SitePage, "id">): string;
|
|
90
|
-
/**
|
|
91
|
-
* Hide the hosted site's footer and/or the Wix ads banner, and keep them hidden as the
|
|
92
|
-
* page mutates. Ported from `generateElementHidingScript` in the Wix RN app
|
|
93
|
-
* (`@wix/hybrid-mobile-platform`), minus the header branch — header hiding is the
|
|
94
|
-
* native `hideHostedSiteHeader` path, which keeps the home page's header.
|
|
95
|
-
*
|
|
96
|
-
* Interim delivery: this rides `injectJsDocumentEnd`. RFC 0062 phase 2 replaces it
|
|
97
|
-
* with a binary-shipped adapter selected by id (`hostedSiteAdapter` + `hideWixAds`),
|
|
98
|
-
* so no raw page script travels over the air.
|
|
99
|
-
*/
|
|
100
|
-
export declare function siteChromeHidingScript(options: {
|
|
101
|
-
hideFooter: boolean;
|
|
102
|
-
hideWixAds: boolean;
|
|
103
|
-
}): string;
|
|
104
90
|
/** Resolved chrome flags — every absent flag is `true`. */
|
|
105
91
|
export declare function resolveSiteChrome(chrome: SiteChrome | undefined): Required<SiteChrome>;
|
|
106
92
|
/**
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts
CHANGED
|
@@ -1033,6 +1033,24 @@ export declare const screenDescriptorSchema: {
|
|
|
1033
1033
|
readonly keepAlive: {
|
|
1034
1034
|
readonly type: "boolean";
|
|
1035
1035
|
};
|
|
1036
|
+
readonly pinHostedHeader: {
|
|
1037
|
+
readonly type: "boolean";
|
|
1038
|
+
};
|
|
1039
|
+
readonly internalLinksAsScreens: {
|
|
1040
|
+
readonly type: "boolean";
|
|
1041
|
+
};
|
|
1042
|
+
readonly respectHttpCache: {
|
|
1043
|
+
readonly type: "boolean";
|
|
1044
|
+
};
|
|
1045
|
+
readonly coverBandColor: {
|
|
1046
|
+
readonly type: "string";
|
|
1047
|
+
};
|
|
1048
|
+
readonly hideWixAds: {
|
|
1049
|
+
readonly type: "boolean";
|
|
1050
|
+
};
|
|
1051
|
+
readonly hideHostedSiteFooter: {
|
|
1052
|
+
readonly type: "boolean";
|
|
1053
|
+
};
|
|
1036
1054
|
};
|
|
1037
1055
|
};
|
|
1038
1056
|
};
|
|
@@ -1976,6 +1994,24 @@ export declare const widgetSnapshotSchema: {
|
|
|
1976
1994
|
readonly keepAlive: {
|
|
1977
1995
|
readonly type: "boolean";
|
|
1978
1996
|
};
|
|
1997
|
+
readonly pinHostedHeader: {
|
|
1998
|
+
readonly type: "boolean";
|
|
1999
|
+
};
|
|
2000
|
+
readonly internalLinksAsScreens: {
|
|
2001
|
+
readonly type: "boolean";
|
|
2002
|
+
};
|
|
2003
|
+
readonly respectHttpCache: {
|
|
2004
|
+
readonly type: "boolean";
|
|
2005
|
+
};
|
|
2006
|
+
readonly coverBandColor: {
|
|
2007
|
+
readonly type: "string";
|
|
2008
|
+
};
|
|
2009
|
+
readonly hideWixAds: {
|
|
2010
|
+
readonly type: "boolean";
|
|
2011
|
+
};
|
|
2012
|
+
readonly hideHostedSiteFooter: {
|
|
2013
|
+
readonly type: "boolean";
|
|
2014
|
+
};
|
|
1979
2015
|
};
|
|
1980
2016
|
};
|
|
1981
2017
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type ImageHolder = {
|
|
2
|
+
image?: {
|
|
3
|
+
src?: {
|
|
4
|
+
url?: unknown;
|
|
5
|
+
id?: unknown;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
} | undefined;
|
|
9
|
+
/** Trims ASCII whitespace only — the set every platform's trim agrees on. Used for LINKS: the viewer applies the
|
|
10
|
+
* link rule to the value itself, so anything else at the ends (a BOM, a no-break space) stays and the rule then
|
|
11
|
+
* refuses it, rather than one renderer's trim accepting it. Media references are instead normalized by
|
|
12
|
+
* normalizeMediaRef, which trims fully: the encoder repairs media (ids resolved, Wix urls sized and upgraded) and
|
|
13
|
+
* emits the normalized value, so the url a renderer later checks carries no padding for any trim to disagree on. */
|
|
14
|
+
export declare function trimAscii(s: string): string;
|
|
15
|
+
/** A link as the viewer emits it: the trimmed value when it passes the link rule (http(s) with a host, mailto,
|
|
16
|
+
* tel), undefined when it does not. */
|
|
17
|
+
export declare function cleanLink(url: unknown): string | undefined;
|
|
18
|
+
/** The sized https URL for the image a Ricos holder points at (`imageData`, `{ image: galleryItem.image.media }`,
|
|
19
|
+
* `{ image: videoData.thumbnail }`): a Wix id or Wix URL is sized to `width` by wixMediaUrl, other https URLs pass
|
|
20
|
+
* through unchanged, anything else (non-Wix http, data:, relative, unknown) is "". */
|
|
21
|
+
export declare function ricosImageUrl(holder: ImageHolder, width: number): string;
|
|
22
|
+
/** A URL the viewer can show for a Ricos video `src`, decided in the viewer's order: an http(s) YouTube or Vimeo
|
|
23
|
+
* link that passes the link rule is a card (its url a link, ASCII-trimmed); any other https url is played natively
|
|
24
|
+
* (media, normalized); a Wix video id becomes its video.wixstatic.com file. "" otherwise — including a card-host
|
|
25
|
+
* url that fails the link rule, which never gets a second chance as media. */
|
|
26
|
+
export declare function ricosVideoUrl(src: unknown): string;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** One Ricos node: a block (PARAGRAPH, HEADING, IMAGE, …) or an inline TEXT run. Type-specific data
|
|
2
|
+
* (`imageData`, `headingData`, …) rides along as extra keys. */
|
|
3
|
+
export type RicosNode = {
|
|
4
|
+
type?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
nodes?: RicosNode[];
|
|
7
|
+
textData?: {
|
|
8
|
+
text?: string;
|
|
9
|
+
decorations?: {
|
|
10
|
+
type: string;
|
|
11
|
+
linkData?: {
|
|
12
|
+
link?: {
|
|
13
|
+
url?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
[k: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
/** A Ricos document with its `nodes` checked to be an array (what parseRicosJson and plainTextToRicos return). */
|
|
21
|
+
export type RicosDocument = {
|
|
22
|
+
nodes: RicosNode[];
|
|
23
|
+
metadata?: unknown;
|
|
24
|
+
documentStyle?: unknown;
|
|
25
|
+
};
|
|
26
|
+
/** Any Ricos-shaped value, as Wix APIs return it (a blog post's `richContent`, an event's description) — their
|
|
27
|
+
* generated types declare `nodes` loosely, so the helpers accept it as is and check the shape at runtime. */
|
|
28
|
+
export type RicosInput = {
|
|
29
|
+
nodes?: unknown;
|
|
30
|
+
metadata?: unknown;
|
|
31
|
+
documentStyle?: unknown;
|
|
32
|
+
};
|
|
33
|
+
/** Why a document is not shown: the viewer draws its fallback instead and reports only this code. */
|
|
34
|
+
export type RejectReason = "invalid_json" | "too_large" | "too_many_nodes" | "too_deep" | "not_a_document";
|
|
35
|
+
/** The RichContent viewer's ceilings; every renderer rejects a document past any of them. Kept equal to the platform limits file by a test. */
|
|
36
|
+
export declare const RICH_CONTENT_LIMITS: {
|
|
37
|
+
readonly maxBytes: 262144;
|
|
38
|
+
readonly maxNodes: 5000;
|
|
39
|
+
readonly maxDepth: 16;
|
|
40
|
+
};
|
|
41
|
+
/** Reads a Ricos document from a JSON string or an already-parsed object (page messages arrive as either,
|
|
42
|
+
* depending on the platform). Returns null for empty input, invalid JSON, or anything without a `nodes` array. */
|
|
43
|
+
export declare function parseRicosJson(value: unknown): RicosDocument | null;
|
|
44
|
+
/** Plain text of a document. Paragraphs, headings and loose text runs are blocks joined by a blank line; runs
|
|
45
|
+
* inside a block join with nothing between them, so a word split across bold and plain runs stays one word.
|
|
46
|
+
* Media and other nodes contribute only the text nested inside them. Malformed parts (a non-object node, a
|
|
47
|
+
* `nodes` that is not an array) contribute nothing — it never throws. */
|
|
48
|
+
export declare function ricosToPlainText(doc: RicosInput | null | undefined): string;
|
|
49
|
+
/** A document of undecorated paragraphs, one per blank-line-separated block of `text` — the inverse of
|
|
50
|
+
* ricosToPlainText for plain text. An empty string gives one empty paragraph. */
|
|
51
|
+
export declare function plainTextToRicos(text: string): RicosDocument;
|
|
52
|
+
/** True when a plain-text editor can rewrite the document without losing anything: no document styling, and
|
|
53
|
+
* only paragraphs of undecorated text runs whose paragraph settings are the defaults a plain paragraph carries
|
|
54
|
+
* (`{ textStyle: { textAlignment: "AUTO" }, indentation: 0 }`, or none). A heading, list, link, bold run,
|
|
55
|
+
* media node, alignment or indent makes it rich. A missing or empty document (no `nodes`, or `[]`) is plain —
|
|
56
|
+
* there is nothing in it to lose. Anything malformed is not: a value that is not a document object (a JSON
|
|
57
|
+
* string, an array), or `nodes` that is not an array, so a caller holding the wrong shape never overwrites it. */
|
|
58
|
+
export declare function isPlainRicos(doc: RicosInput | null | undefined): boolean;
|
|
59
|
+
/** True when an HTML description has no formatting to protect: empty, text with no tag in it (a lone `<` in
|
|
60
|
+
* prose is text), or exactly one attribute-free `<p>` around text with no inner tags. A form that edits plain
|
|
61
|
+
* text may overwrite only these. */
|
|
62
|
+
export declare function htmlIsTrivial(html: string | null | undefined): boolean;
|
|
63
|
+
/** Prepares a Ricos document for the RichContent viewer; bind the returned `json` as `documentJsonPath`.
|
|
64
|
+
* Wix media ids become sized https URLs (`imageWidth`, default and maximum 1400 px; galleries and posters at most
|
|
65
|
+
* 1000). Block ids follow the viewer's own rule on the encoded document — a block's missing, all-digits-and-dots
|
|
66
|
+
* or repeated id becomes its path index there ("0.2.1") — so every renderer shows the same ids and encoding twice
|
|
67
|
+
* changes nothing. Images, galleries and videos without https media (an http YouTube or Vimeo link is kept: the
|
|
68
|
+
* viewer shows it as a card), buttons without an http(s)/mailto/tel link, any other link url with a disallowed
|
|
69
|
+
* scheme (link decorations, card and image links) and inline HTML (`htmlData.html`, an embed's `oembed.html`) are
|
|
70
|
+
* removed; an allowed link is emitted trimmed of surrounding whitespace, as the viewer emits it. Text is never
|
|
71
|
+
* changed. Keys are sorted, so equal documents encode to equal strings. The input is not
|
|
72
|
+
* modified. A missing or empty document gives `{ json: "" }`; a non-document or one past the viewer's limits gives
|
|
73
|
+
* `{ json: "", rejected }` (checked in the order not_a_document, too_deep, too_large, too_many_nodes). */
|
|
74
|
+
export declare function encodeRichContent(doc: RicosInput | null | undefined, opts?: {
|
|
75
|
+
imageWidth?: number;
|
|
76
|
+
}): {
|
|
77
|
+
json: string;
|
|
78
|
+
rejected?: RejectReason;
|
|
79
|
+
};
|
|
@@ -7606,6 +7606,7 @@ function validateConfigShape(config) {
|
|
|
7606
7606
|
var SPLASH_MIN_VISIBLE_MS_MAX = 2e3;
|
|
7607
7607
|
var SPLASH_MAX_HOLD_MS_MAX = 8e3;
|
|
7608
7608
|
var SPLASH_LAYOUTS = ["centered", "centeredStacked", "logoOnly"];
|
|
7609
|
+
var SPLASH_READY_SIGNALS = ["", "first_content"];
|
|
7609
7610
|
function validateA11y(a11y) {
|
|
7610
7611
|
if (!a11y || typeof a11y !== "object" || Array.isArray(a11y)) {
|
|
7611
7612
|
throw new Error('defineApp: a11y must be an object like { enforce: "warn" }.');
|
|
@@ -7739,6 +7740,11 @@ function validateSplash(splash, colors, tokensPath) {
|
|
|
7739
7740
|
`defineApp: splash.layout "${splash.layout}" is not one of ${SPLASH_LAYOUTS.join(", ")}.`
|
|
7740
7741
|
);
|
|
7741
7742
|
}
|
|
7743
|
+
if (splash.readySignal !== void 0 && !SPLASH_READY_SIGNALS.includes(splash.readySignal)) {
|
|
7744
|
+
throw new Error(
|
|
7745
|
+
`defineApp: splash.readySignal "${splash.readySignal}" is not one of "", "first_content".`
|
|
7746
|
+
);
|
|
7747
|
+
}
|
|
7742
7748
|
for (const [field, value, max] of [
|
|
7743
7749
|
["logoWidth", splash.logoWidth, 1024],
|
|
7744
7750
|
["minVisibleMs", splash.minVisibleMs, SPLASH_MIN_VISIBLE_MS_MAX],
|
|
@@ -8534,9 +8540,17 @@ var screenDescriptorSchema = {
|
|
|
8534
8540
|
hideHostedSiteHeader: { type: "boolean" },
|
|
8535
8541
|
immersive: { type: "boolean" },
|
|
8536
8542
|
showCloseButton: { type: "boolean" },
|
|
8537
|
-
// Keep the native WebView instance warm across re-presentations
|
|
8538
|
-
//
|
|
8539
|
-
keepAlive: { type: "boolean" }
|
|
8543
|
+
// Keep the native WebView instance warm across re-presentations and tab switches
|
|
8544
|
+
// (per screen id, LRU — WebViewKeepAliveStore on both platforms).
|
|
8545
|
+
keepAlive: { type: "boolean" },
|
|
8546
|
+
// Hosted-site polish — native hosts honoured these before the validator knew them.
|
|
8547
|
+
pinHostedHeader: { type: "boolean" },
|
|
8548
|
+
internalLinksAsScreens: { type: "boolean" },
|
|
8549
|
+
respectHttpCache: { type: "boolean" },
|
|
8550
|
+
coverBandColor: { type: "string" },
|
|
8551
|
+
// RFC 0062 — binary-shipped chrome hiding for a hosted site (no page script over the air).
|
|
8552
|
+
hideWixAds: { type: "boolean" },
|
|
8553
|
+
hideHostedSiteFooter: { type: "boolean" }
|
|
8540
8554
|
}
|
|
8541
8555
|
}
|
|
8542
8556
|
}
|
|
@@ -8668,6 +8682,8 @@ var CORE_COMPONENTS = /* @__PURE__ */ new Set([
|
|
|
8668
8682
|
"himalaya.DonutChart",
|
|
8669
8683
|
"himalaya.Legend",
|
|
8670
8684
|
"himalaya.DataTable",
|
|
8685
|
+
// Rich content — RFC 0063
|
|
8686
|
+
"himalaya.RichContent",
|
|
8671
8687
|
// Recorded-audio bubble — messenger design G4
|
|
8672
8688
|
"himalaya.VoiceNote",
|
|
8673
8689
|
"himalaya.Marquee",
|
|
@@ -13034,47 +13050,6 @@ function sitePageUrl(origin, path) {
|
|
|
13034
13050
|
function siteScreenId(page) {
|
|
13035
13051
|
return `${SITE_SCREEN_PREFIX}${page.id}`;
|
|
13036
13052
|
}
|
|
13037
|
-
function siteChromeHidingScript(options) {
|
|
13038
|
-
if (!options.hideFooter && !options.hideWixAds) return "";
|
|
13039
|
-
return `(function(){
|
|
13040
|
-
if (window.__himiSiteChromeHider) return;
|
|
13041
|
-
window.__himiSiteChromeHider = true;
|
|
13042
|
-
var HIDE_FOOTER = ${options.hideFooter ? "true" : "false"};
|
|
13043
|
-
var HIDE_ADS = ${options.hideWixAds ? "true" : "false"};
|
|
13044
|
-
function hide(el, collapse) {
|
|
13045
|
-
if (!el) return;
|
|
13046
|
-
el.style.display = 'none';
|
|
13047
|
-
el.style.visibility = 'hidden';
|
|
13048
|
-
if (collapse) { el.style.height = '0px'; el.style.overflow = 'hidden'; }
|
|
13049
|
-
}
|
|
13050
|
-
function pass() {
|
|
13051
|
-
if (HIDE_FOOTER) {
|
|
13052
|
-
hide(document.getElementsByTagName('footer')[0] ||
|
|
13053
|
-
document.querySelector('footer[id^="comp-"]') ||
|
|
13054
|
-
document.querySelector('[class*="wixui-footer"]') ||
|
|
13055
|
-
document.querySelector('[data-mesh-id*="SITE_FOOTER"]') ||
|
|
13056
|
-
document.querySelector('[id*="SITE_FOOTER"]'), false);
|
|
13057
|
-
}
|
|
13058
|
-
if (HIDE_ADS) {
|
|
13059
|
-
hide(document.getElementById('WIX_ADS') ||
|
|
13060
|
-
document.querySelector('.WIX_ADS') ||
|
|
13061
|
-
document.querySelector('[class*="WIX_ADS"]'), true);
|
|
13062
|
-
}
|
|
13063
|
-
}
|
|
13064
|
-
var scheduled = false;
|
|
13065
|
-
function schedule() {
|
|
13066
|
-
if (scheduled) return;
|
|
13067
|
-
scheduled = true;
|
|
13068
|
-
requestAnimationFrame(function(){ scheduled = false; pass(); });
|
|
13069
|
-
}
|
|
13070
|
-
function start() {
|
|
13071
|
-
pass();
|
|
13072
|
-
new MutationObserver(schedule).observe(document.documentElement, { childList: true, subtree: true });
|
|
13073
|
-
}
|
|
13074
|
-
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start);
|
|
13075
|
-
else start();
|
|
13076
|
-
})();`;
|
|
13077
|
-
}
|
|
13078
13053
|
function resolveSiteChrome(chrome) {
|
|
13079
13054
|
return {
|
|
13080
13055
|
hideSiteHeader: chrome?.hideSiteHeader ?? true,
|
|
@@ -13084,11 +13059,15 @@ function resolveSiteChrome(chrome) {
|
|
|
13084
13059
|
}
|
|
13085
13060
|
function siteWebViewPreset(site) {
|
|
13086
13061
|
const chrome = resolveSiteChrome(site.chrome);
|
|
13087
|
-
|
|
13088
|
-
const config = {
|
|
13062
|
+
return {
|
|
13089
13063
|
layout: "inset",
|
|
13090
13064
|
immersive: true,
|
|
13065
|
+
// Chrome hiding is binary-shipped (RFC 0062): only these flags travel over the air, so an
|
|
13066
|
+
// owner can flip one without a new build, and no page script is served OTA (invariant 15).
|
|
13091
13067
|
hideHostedSiteHeader: chrome.hideSiteHeader,
|
|
13068
|
+
hideHostedSiteFooter: chrome.hideSiteFooter,
|
|
13069
|
+
// Wix ads only exist on Wix free sites; a Base44 site never gets the Wix selectors.
|
|
13070
|
+
hideWixAds: site.kind === "wix" && chrome.hideWixAds,
|
|
13092
13071
|
pullToRefresh: true,
|
|
13093
13072
|
showProgressBar: true,
|
|
13094
13073
|
syncStatusBarAppearance: true,
|
|
@@ -13104,8 +13083,6 @@ function siteWebViewPreset(site) {
|
|
|
13104
13083
|
// platforms; see SITE_SHELL_MAX_TABS for why the tab count stays within the store's cap).
|
|
13105
13084
|
keepAlive: true
|
|
13106
13085
|
};
|
|
13107
|
-
if (hidingScript) config.injectJsDocumentEnd = hidingScript;
|
|
13108
|
-
return config;
|
|
13109
13086
|
}
|
|
13110
13087
|
function defineSiteTab(site, page) {
|
|
13111
13088
|
assertSitePage(page);
|
|
@@ -13285,7 +13262,6 @@ export {
|
|
|
13285
13262
|
selectIdiomOverlay,
|
|
13286
13263
|
shouldRevealError,
|
|
13287
13264
|
siteAllowedOrigins,
|
|
13288
|
-
siteChromeHidingScript,
|
|
13289
13265
|
siteHost,
|
|
13290
13266
|
siteNav,
|
|
13291
13267
|
sitePageUrl,
|