@wix/himalaya-cli 0.1455.0 → 0.1457.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.
@@ -120,6 +120,7 @@ export interface WebViewConfig {
120
120
  maxMessageBytes?: number;
121
121
  rateLimitMaxCalls?: number;
122
122
  rateLimitWindowMs?: number;
123
+ profile?: "" | "app_content";
123
124
  };
124
125
  contentFilterRules?: string;
125
126
  appBoundDomains?: string[];
@@ -143,6 +144,11 @@ export interface WebViewConfig {
143
144
  hideHostedSiteMenu?: boolean;
144
145
  sessionBridge?: boolean;
145
146
  hostedSiteAdapter?: "" | "wix" | "base44";
147
+ originIsolation?: "" | "shared" | "per_instance";
148
+ framePolicy?: "" | "content";
149
+ storageSeed?: {
150
+ snapshotPath?: string;
151
+ };
146
152
  }
147
153
  export declare function vstack(props: {
148
154
  spacing?: number;
@@ -835,6 +841,7 @@ export declare function carousel(props: {
835
841
  onChange?: ActionShape;
836
842
  autoplayIntervalMs?: number;
837
843
  itemsPath?: string;
844
+ liveWindow?: number;
838
845
  }, opts?: {
839
846
  id?: string;
840
847
  }): Component;
@@ -843,6 +850,7 @@ export declare function pager(props: {
843
850
  currentIndex?: number;
844
851
  onChange?: ActionShape;
845
852
  showIndicator?: boolean;
853
+ liveWindow?: number;
846
854
  }, opts?: {
847
855
  id?: string;
848
856
  }): Component;
@@ -1626,6 +1634,13 @@ export declare function webView(props: {
1626
1634
  scrollEnabled?: boolean;
1627
1635
  config?: WebViewConfig;
1628
1636
  capabilitiesRequired?: string[];
1637
+ bridge?: "" | "worker";
1638
+ instanceId?: string;
1639
+ activePath?: string;
1640
+ mutedPath?: string;
1641
+ reloadKeyPath?: string;
1642
+ fill?: boolean;
1643
+ heightPath?: string;
1629
1644
  }, opts?: {
1630
1645
  id?: string;
1631
1646
  }): Component;
@@ -22,3 +22,5 @@ export * from "./app-identity.js";
22
22
  export * from "./app-registry-client.js";
23
23
  export * from "./site-shell.js";
24
24
  export * from "./site-menu.js";
25
+ export * from "./webview-embedded.js";
26
+ export * from "./webview-origin.js";
@@ -1204,12 +1204,16 @@ export interface CarouselProps {
1204
1204
  autoplayIntervalMs?: number;
1205
1205
  /** `$service:` binding → a live array to render as slides (overrides `items`). */
1206
1206
  itemsPath?: string;
1207
+ /** RFC 0073 §4.5 — 0 (default) = all slides mounted; N ⇒ mount current ± N, unmount the rest. */
1208
+ liveWindow?: number;
1207
1209
  }
1208
1210
  export interface PagerProps {
1209
1211
  pages: Component[];
1210
1212
  currentIndex?: number;
1211
1213
  onChange?: Action;
1212
1214
  showIndicator?: boolean;
1215
+ /** RFC 0073 §4.5 — as {@link CarouselProps.liveWindow}. */
1216
+ liveWindow?: number;
1213
1217
  }
1214
1218
  export interface StepIndicatorProps {
1215
1219
  steps: string[];
@@ -3206,6 +3210,16 @@ export interface BridgeSecurityConfig {
3206
3210
  rateLimitMaxCalls?: number;
3207
3211
  /** Rate-limit sliding window in ms (default 1000). */
3208
3212
  rateLimitWindowMs?: number;
3213
+ /**
3214
+ * RFC 0073 §4.4 — `""` (default) is today's T4 floor; `"app_content"` raises the caps for content
3215
+ * the app owns the channel to. Explicit `max*` / `rateLimit*` fields still override either profile.
3216
+ */
3217
+ profile?: "" | "app_content";
3218
+ }
3219
+ /** RFC 0073 §4.2 — one-shot storage seed for a `per_instance` origin. */
3220
+ export interface WebStorageSeed {
3221
+ /** `$service:` path to `{ legacy, principal, localStorage?, sessionStorage? }` (§4.2 trust rule). */
3222
+ snapshotPath?: string;
3209
3223
  }
3210
3224
  /**
3211
3225
  * Behavior of a hosted WebView (Tier 3/4 screens via `ScreenDescriptor.webViewConfig`,
@@ -3340,6 +3354,13 @@ export interface WebViewConfig {
3340
3354
  * script, like {@link hideWixAds}. No-op on web (cross-origin iframe).
3341
3355
  */
3342
3356
  hideHostedSiteMenu?: boolean;
3357
+ /** RFC 0073 §4.2 — `""` / `"shared"` (default, today) | `"per_instance"` (own origin + storage per
3358
+ * instance). `""` is the proto3 zero value and means `"shared"`. */
3359
+ originIsolation?: "" | "shared" | "per_instance";
3360
+ /** RFC 0073 §4.3 — `""` (today) | `"content"` (pin the top frame; subframes load freely, never bridged). */
3361
+ framePolicy?: "" | "content";
3362
+ /** RFC 0073 §4.2 — storage migration seed; requires `originIsolation: "per_instance"`. */
3363
+ storageSeed?: WebStorageSeed;
3343
3364
  }
3344
3365
  /**
3345
3366
  * Embeddable WebView component (web-in-SDUI). WebViews have no intrinsic height,
@@ -3358,6 +3379,20 @@ export interface WebViewProps {
3358
3379
  scrollEnabled?: boolean;
3359
3380
  config?: WebViewConfig;
3360
3381
  capabilitiesRequired?: string[];
3382
+ /** `""` (default, no channel) | `"worker"` — channel to the owning screen's worker. */
3383
+ bridge?: "" | "worker";
3384
+ /** Channel + storage identity; default `<screenId>?<args>/<Component.id>` (§4.1, `effectiveWebViewInstanceId`). */
3385
+ instanceId?: string;
3386
+ /** `$service:` bool — false ⇒ inactive (§5.4); unset ⇒ active. */
3387
+ activePath?: string;
3388
+ /** `$service:` bool — true ⇒ all page media muted. */
3389
+ mutedPath?: string;
3390
+ /** `$service:` scalar — any change remounts the document. */
3391
+ reloadKeyPath?: string;
3392
+ /** Take the parent's proposed size (works with weight); beats `height` / `aspectRatio`. */
3393
+ fill?: boolean;
3394
+ /** `$service:` number — live height in points/dp; beats `height`. */
3395
+ heightPath?: string;
3361
3396
  }
3362
3397
  /** RFC 0069 — `ScreenDescriptor.transcriptScroll`. */
3363
3398
  export interface TranscriptScroll {
@@ -1291,6 +1291,10 @@ export declare const screenDescriptorSchema: {
1291
1291
  readonly type: "integer";
1292
1292
  readonly minimum: 1;
1293
1293
  };
1294
+ readonly profile: {
1295
+ readonly type: "string";
1296
+ readonly enum: readonly ["", "app_content"];
1297
+ };
1294
1298
  };
1295
1299
  };
1296
1300
  readonly contentFilterRules: {
@@ -1366,6 +1370,23 @@ export declare const screenDescriptorSchema: {
1366
1370
  readonly hideHostedSiteMenu: {
1367
1371
  readonly type: "boolean";
1368
1372
  };
1373
+ readonly originIsolation: {
1374
+ readonly type: "string";
1375
+ readonly enum: readonly ["", "shared", "per_instance"];
1376
+ };
1377
+ readonly framePolicy: {
1378
+ readonly type: "string";
1379
+ readonly enum: readonly ["", "content"];
1380
+ };
1381
+ readonly storageSeed: {
1382
+ readonly type: "object";
1383
+ readonly additionalProperties: false;
1384
+ readonly properties: {
1385
+ readonly snapshotPath: {
1386
+ readonly type: "string";
1387
+ };
1388
+ };
1389
+ };
1369
1390
  };
1370
1391
  };
1371
1392
  };
@@ -2541,6 +2562,10 @@ export declare const widgetSnapshotSchema: {
2541
2562
  readonly type: "integer";
2542
2563
  readonly minimum: 1;
2543
2564
  };
2565
+ readonly profile: {
2566
+ readonly type: "string";
2567
+ readonly enum: readonly ["", "app_content"];
2568
+ };
2544
2569
  };
2545
2570
  };
2546
2571
  readonly contentFilterRules: {
@@ -2616,6 +2641,23 @@ export declare const widgetSnapshotSchema: {
2616
2641
  readonly hideHostedSiteMenu: {
2617
2642
  readonly type: "boolean";
2618
2643
  };
2644
+ readonly originIsolation: {
2645
+ readonly type: "string";
2646
+ readonly enum: readonly ["", "shared", "per_instance"];
2647
+ };
2648
+ readonly framePolicy: {
2649
+ readonly type: "string";
2650
+ readonly enum: readonly ["", "content"];
2651
+ };
2652
+ readonly storageSeed: {
2653
+ readonly type: "object";
2654
+ readonly additionalProperties: false;
2655
+ readonly properties: {
2656
+ readonly snapshotPath: {
2657
+ readonly type: "string";
2658
+ };
2659
+ };
2660
+ };
2619
2661
  };
2620
2662
  };
2621
2663
  };
@@ -0,0 +1,66 @@
1
+ /** Bridged WebViews a screen may mount at once before §4.6 warns. */
2
+ export declare const MAX_SIMULTANEOUS_BRIDGED_WEBVIEWS = 4;
3
+ export interface WebViewEmbeddedFinding {
4
+ severity: "error" | "warning";
5
+ /** Stable id of the §4.6 rule, for tests and tooling; never match on `message`. */
6
+ rule: "bridge_requires_worker" | "template_instance_id" | "duplicate_instance_id" | "instance_id_reused_across_screens" | "storage_seed_requires_per_instance" | "per_instance_with_url" | "fill_with_height" | "too_many_bridged" | "bridged_url_not_allowed" | "unknown_enum_value";
7
+ path: string;
8
+ message: string;
9
+ }
10
+ /** A cross-screen finding: `path` is within the screen named by `screenId`, which travels as its own
11
+ * field so no consumer has to parse it back out of the path. */
12
+ export interface WebViewEmbeddedAppFinding extends WebViewEmbeddedFinding {
13
+ screenId: string;
14
+ }
15
+ /** The wire values of the RFC 0073 string enums — what `WebViewBridge`, `WebOriginIsolation`,
16
+ * `WebFramePolicy` and `BridgeSecurityProfile` decode on iOS and Android. Anything else decodes
17
+ * leniently to the zero value, so `bridge: "Worker"` would silently mean no bridge. */
18
+ export declare const WEBVIEW_EMBEDDED_ENUMS: {
19
+ readonly bridge: readonly ["", "worker"];
20
+ readonly originIsolation: readonly ["", "shared", "per_instance"];
21
+ readonly framePolicy: readonly ["", "content"];
22
+ readonly profile: readonly ["", "app_content"];
23
+ };
24
+ /**
25
+ * `value` as canonical JSON, so two args that are equal as data produce one instance id — and two
26
+ * that differ in type (`"1"` vs `1`) do not: object keys sorted by UTF-16 code unit at EVERY depth
27
+ * (`JSON.stringify` keeps insertion order), no whitespace, `undefined` object members dropped,
28
+ * array order kept. A number is written the way ECMAScript `Number.prototype.toString` writes it —
29
+ * `1`, `1.5`, `0.1`, `-2`, `1e+21`, `1e-7` (an integral double prints with no `.0`; `-0` prints
30
+ * `0`). Strings use `JSON.stringify` escaping. The native ports must match this byte for byte;
31
+ * `webview-embedded-rules.test.ts` pins it.
32
+ *
33
+ * Only JSON data is accepted. Anything JSON cannot represent — a non-finite number, a `bigint`,
34
+ * a function, a symbol, an `undefined` array element or sparse hole, a cyclic value, or an object that is not a plain object or
35
+ * array (`Date`, `Map`, a class instance) — throws a `TypeError`, rather than collapsing to `null`
36
+ * or `{}` and colliding with a different value.
37
+ */
38
+ export declare function canonicalJson(value: unknown): string;
39
+ /** `screen args` in canonical form: keys sorted by code unit, each `k=v` URI-encoded, joined by
40
+ * `&`, where `v` is {@link canonicalJson} of the value — strings included, so `{id: "1"}`
41
+ * (`id=%221%22`) and `{id: 1}` (`id=1`) stay distinct. `undefined` is dropped (it is not an arg);
42
+ * a value that is not JSON data throws, as in {@link canonicalJson}. */
43
+ export declare function canonicalScreenArgs(args: Readonly<Record<string, unknown>> | undefined): string;
44
+ /**
45
+ * RFC 0073 §4.1 — the effective `instance_id` of a WebView: the explicit `instanceId` when the
46
+ * author set one (an app-wide identity chosen on purpose), otherwise
47
+ * `<screenId>?<canonical screen args>/<Component.id>`. Screen id and args are both part of the
48
+ * default because one screen can be mounted twice with different args (RFC 0010).
49
+ */
50
+ export declare function effectiveWebViewInstanceId(screenId: string, args: Readonly<Record<string, unknown>> | undefined, componentId: string, explicitInstanceId?: string): string;
51
+ /**
52
+ * The single-screen §4.6 rules over one screen descriptor. The cross-screen rule (an explicit
53
+ * `per_instance` literal reused for different content) needs every screen, so it is
54
+ * {@link webViewEmbeddedAppFindings}.
55
+ */
56
+ export declare function webViewEmbeddedFindings(descriptor: unknown): WebViewEmbeddedFinding[];
57
+ /**
58
+ * The cross-screen §4.6 rule: an explicit `per_instance` `instanceId` literal is an app-wide storage
59
+ * identity, so reusing it for the SAME content on several screens is intended (one widget, one
60
+ * storage) — reusing it for DIFFERENT content is a warning. Content is the literal `inlineHtml` or
61
+ * `url`; a bound value cannot be compared statically and is skipped.
62
+ */
63
+ export declare function webViewEmbeddedAppFindings(screens: Iterable<{
64
+ screenId: string;
65
+ descriptor: unknown;
66
+ }>): WebViewEmbeddedAppFinding[];
@@ -0,0 +1,7 @@
1
+ /** Whether `url` matches an `allowedOrigins` list — iOS `WebViewOriginPolicy.matches` exactly
2
+ * (Android `allowedOriginMatches` mirrors it), over the RAW url (see `rawUrlParts`):
3
+ * the host or host:port; a scheme-qualified entry ending in `/` as a PATH BOUNDARY, refused
4
+ * outright when the path has a dot segment; any other prefix of the absolute URL that ends at a
5
+ * boundary (`/`, `?`, `#` or the end, or the entry itself ends in `/`); a `*.example.com` /
6
+ * `.example.com` suffix. */
7
+ export declare function webViewOriginAllowed(url: string, origins: readonly string[]): boolean;