@wix/himalaya-cli 0.2026.0 → 0.2028.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.
@@ -20,7 +20,22 @@ export interface AlertOptions {
20
20
  confirm?: AlertConfirm;
21
21
  /** Up to three buttons, replacing the four options above; see `AlertButtonOptions`. */
22
22
  buttons?: AlertButtonOptions[];
23
+ /** BI id (see `BiArg`). */
24
+ id?: string;
25
+ /** BI args (see `BiArg`). */
26
+ args?: Record<string, BiArg>;
23
27
  }
28
+ /** #6879 — one BI arg of an alert's or snackbar's `id` report; any other value is left out.
29
+ *
30
+ * `id` is 1–64 of `[A-Za-z0-9_.-]` (any other id rejects `invalid_bi_id`, and nothing is shown). When the
31
+ * user presses an alert's button the host reports `ui.alert.answer` with `{ id, buttonId, ...args }` to the
32
+ * platform action map, which an entry names with `when: { id, buttonId }`; a tap on a snackbar's `action`
33
+ * reports `ui.snackbar.action` with `buttonId: "action"`. Only a press reports: a popup the host clears, or
34
+ * a snackbar that times out, reports nothing. A dismissal is not a press, with two exceptions: the web
35
+ * host's scrim tap / Escape, and Android's back on an N-button alert, run the cancel button and so report
36
+ * `cancel`. Android's back on a plain alert reports nothing, and iOS has no dismissal gesture. Only a
37
+ * worker's popup reports. A number rides as its text. */
38
+ export type BiArg = string | number | boolean;
24
39
  /** #4659 — `"cancel"` (at most one) sits in the cancel position and is what dismissal by scrim, back
25
40
  * or Esc resolves as; `"destructive"` draws with the `danger` token. Default `"default"`. */
26
41
  export type AlertButtonRole = "default" | "cancel" | "destructive";
@@ -95,6 +110,10 @@ export interface SnackbarOptions {
95
110
  * must name an `actionId`: an awaited result carries no gesture credit (RFC 0074 §7), so its
96
111
  * View has to run as an action of its own. */
97
112
  action?: SnackbarAction;
113
+ /** BI id: a tap on `action` reports `ui.snackbar.action` (see `BiArg`). */
114
+ id?: string;
115
+ /** BI args for `id`'s report (not the action's args). */
116
+ args?: Record<string, BiArg>;
98
117
  }
99
118
  export interface SnackbarAction {
100
119
  /** The button's text — also its VoiceOver / TalkBack / screen-reader label. At most 24
@@ -2693,6 +2693,16 @@ function createInviteService(opts) {
2693
2693
  }
2694
2694
 
2695
2695
  // ../../core/sdk/ui/src/index.ts
2696
+ function biParams(id2, args) {
2697
+ if (id2 === void 0) return {};
2698
+ if (typeof id2 !== "string" || !/^[A-Za-z0-9_.-]{1,64}$/.test(id2)) throw new Error("invalid_bi_id");
2699
+ const kept = {};
2700
+ for (const [k, v] of Object.entries(args ?? {})) {
2701
+ if (typeof v === "string" || typeof v === "boolean") kept[k] = v;
2702
+ else if (typeof v === "number" && Number.isFinite(v)) kept[k] = Number.isInteger(v) && Math.abs(v) < 1e15 ? String(Math.trunc(v)) : String(v);
2703
+ }
2704
+ return Object.keys(kept).length ? { biId: id2, biArgs: JSON.stringify(kept) } : { biId: id2 };
2705
+ }
2696
2706
  var SNACKBAR_LIMITS = {
2697
2707
  messageLines: 2,
2698
2708
  labelChars: 24,
@@ -2713,7 +2723,7 @@ function snackbarLabel(label) {
2713
2723
  return chars.length <= SNACKBAR_LIMITS.labelChars ? chars.join("") : `${chars.slice(0, SNACKBAR_LIMITS.labelChars - 1).join("")}\u2026`;
2714
2724
  }
2715
2725
  async function snackbar(options) {
2716
- const params = { message: options.message ?? "" };
2726
+ const params = { message: options.message ?? "", ...biParams(options.id, options.args) };
2717
2727
  if (options.tone) params.tone = options.tone;
2718
2728
  const durationMs = snackbarDurationMs(options.durationMs, !!options.action);
2719
2729
  if (durationMs !== void 0) params.durationMs = durationMs;
@@ -14,8 +14,18 @@ function dispatch(handlerId, params, _options) {
14
14
  }
15
15
 
16
16
  // ../../core/sdk/ui/src/index.ts
17
+ function biParams(id, args) {
18
+ if (id === void 0) return {};
19
+ if (typeof id !== "string" || !/^[A-Za-z0-9_.-]{1,64}$/.test(id)) throw new Error("invalid_bi_id");
20
+ const kept = {};
21
+ for (const [k, v] of Object.entries(args ?? {})) {
22
+ if (typeof v === "string" || typeof v === "boolean") kept[k] = v;
23
+ else if (typeof v === "number" && Number.isFinite(v)) kept[k] = Number.isInteger(v) && Math.abs(v) < 1e15 ? String(Math.trunc(v)) : String(v);
24
+ }
25
+ return Object.keys(kept).length ? { biId: id, biArgs: JSON.stringify(kept) } : { biId: id };
26
+ }
17
27
  async function alert(options) {
18
- const params = { title: options.title ?? "" };
28
+ const params = { title: options.title ?? "", ...biParams(options.id, options.args) };
19
29
  if (options.message) params.message = options.message;
20
30
  if (options.buttons) {
21
31
  params.buttons = JSON.stringify(options.buttons.map(({ id, label, role, actionId, args }) => ({
@@ -63,7 +73,7 @@ function snackbarLabel(label) {
63
73
  return chars.length <= SNACKBAR_LIMITS.labelChars ? chars.join("") : `${chars.slice(0, SNACKBAR_LIMITS.labelChars - 1).join("")}\u2026`;
64
74
  }
65
75
  async function snackbar(options) {
66
- const params = { message: options.message ?? "" };
76
+ const params = { message: options.message ?? "", ...biParams(options.id, options.args) };
67
77
  if (options.tone) params.tone = options.tone;
68
78
  const durationMs = snackbarDurationMs(options.durationMs, !!options.action);
69
79
  if (durationMs !== void 0) params.durationMs = durationMs;
@@ -2,7 +2,7 @@
2
2
  "files": [
3
3
  {
4
4
  "name": "sw.js",
5
- "bytes": 2844348
5
+ "bytes": 2847320
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/0053531a0cb26d4293937d4021578c4c8b6e7fb5f2199a593995336ead10cc38.bin",
24
+ "name": "preview-deferred/233161e2f9055b01a1ee4261f3780909d2db313aefc225ddd44304de668ba29e.bin",
25
25
  "bytes": 488215
26
26
  },
27
27
  {
@@ -79,10 +79,10 @@
79
79
  ],
80
80
  "deferred": [
81
81
  {
82
- "key": "assets/pdf-UNbRm9v0.js",
82
+ "key": "assets/pdf-B1dyWaaR.js",
83
83
  "contentType": "application/javascript; charset=utf-8",
84
- "sha256": "0053531a0cb26d4293937d4021578c4c8b6e7fb5f2199a593995336ead10cc38",
85
- "file": "preview-deferred/0053531a0cb26d4293937d4021578c4c8b6e7fb5f2199a593995336ead10cc38.bin"
84
+ "sha256": "233161e2f9055b01a1ee4261f3780909d2db313aefc225ddd44304de668ba29e",
85
+ "file": "preview-deferred/233161e2f9055b01a1ee4261f3780909d2db313aefc225ddd44304de668ba29e.bin"
86
86
  },
87
87
  {
88
88
  "key": "assets/pdf.worker.min-BGnVRhRG.js",