@wix/himalaya-cli 0.1405.0 → 0.1407.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.
@@ -8271,7 +8271,88 @@ var screenDescriptorSchema = {
8271
8271
  properties: {
8272
8272
  actions: { type: "array", items: { $ref: "#/$defs/topBarAction" } },
8273
8273
  leading: { type: "string" },
8274
- style: { type: "string" }
8274
+ style: { type: "string" },
8275
+ // RFC 0066 §1 (fields 4–8) + the "top-bar gap items" amendment (#4414, fields
8276
+ // 10–14). Discriminators stay free strings (invariant 6). Field 9 (`searchable`)
8277
+ // arrives with the RFC 0010 search implementation.
8278
+ items: { type: "array", items: { $ref: "#/$defs/toolbarItem" } },
8279
+ titleDisplay: { type: "string" },
8280
+ subtitle: { type: "string" },
8281
+ visibility: { type: "string" },
8282
+ background: { $ref: "#/$defs/tokenRef" },
8283
+ logo: { $ref: "#/$defs/topBarLogo" },
8284
+ titleMenu: { $ref: "#/$defs/topBarTitleMenu" },
8285
+ subtitlePath: { type: "string" },
8286
+ scrollBehavior: { type: "string" },
8287
+ dirtyPath: { type: "string" }
8288
+ }
8289
+ },
8290
+ toolbarItem: {
8291
+ type: "object",
8292
+ additionalProperties: false,
8293
+ required: ["id"],
8294
+ properties: {
8295
+ id: { type: "string", minLength: 1 },
8296
+ placement: { type: "string" },
8297
+ label: { type: "string" },
8298
+ icon: { type: "string" },
8299
+ onTap: { $ref: "#/$defs/action" },
8300
+ role: { type: "string" },
8301
+ disabled: { type: "boolean" },
8302
+ disabledPath: { type: "string" },
8303
+ menu: { type: "array", items: { $ref: "#/$defs/topBarMenuItem" } },
8304
+ content: { $ref: "#/$defs/component" },
8305
+ loadingPath: { type: "string" },
8306
+ avatar: { $ref: "#/$defs/toolbarAvatar" },
8307
+ labelPath: { type: "string" }
8308
+ }
8309
+ },
8310
+ toolbarAvatar: {
8311
+ type: "object",
8312
+ additionalProperties: false,
8313
+ properties: {
8314
+ imageUrl: { type: "string" },
8315
+ initials: { type: "string" },
8316
+ imageUrlPath: { type: "string" },
8317
+ initialsPath: { type: "string" }
8318
+ }
8319
+ },
8320
+ topBarLogo: {
8321
+ type: "object",
8322
+ additionalProperties: false,
8323
+ properties: {
8324
+ imageUrl: { type: "string" },
8325
+ imageUrlDark: { type: "string" },
8326
+ imageAsset: { type: "string" },
8327
+ name: { type: "string" },
8328
+ placement: { type: "string" },
8329
+ imageUrlPath: { type: "string" },
8330
+ accessibilityLabel: { type: "string" }
8331
+ }
8332
+ },
8333
+ topBarTitleMenu: {
8334
+ type: "object",
8335
+ additionalProperties: false,
8336
+ properties: {
8337
+ items: { type: "array", items: { $ref: "#/$defs/topBarMenuItem" } },
8338
+ selectedId: { type: "string" },
8339
+ selectedIdPath: { type: "string" },
8340
+ accessibilityLabel: { type: "string" }
8341
+ }
8342
+ },
8343
+ // The proto `MenuItem` (id, label, icon, destructive, disabled, action), as the
8344
+ // top bar carries it outside a Menu component's props.
8345
+ topBarMenuItem: {
8346
+ type: "object",
8347
+ additionalProperties: false,
8348
+ required: ["id", "label"],
8349
+ properties: {
8350
+ id: { type: "string", minLength: 1 },
8351
+ label: { type: "string" },
8352
+ icon: { type: "string" },
8353
+ destructive: { type: "boolean" },
8354
+ disabled: { type: "boolean" },
8355
+ action: { $ref: "#/$defs/action" }
8275
8356
  }
8276
8357
  },
8277
8358
  topBarAction: {
@@ -7141,7 +7141,88 @@ var screenDescriptorSchema = {
7141
7141
  properties: {
7142
7142
  actions: { type: "array", items: { $ref: "#/$defs/topBarAction" } },
7143
7143
  leading: { type: "string" },
7144
- style: { type: "string" }
7144
+ style: { type: "string" },
7145
+ // RFC 0066 §1 (fields 4–8) + the "top-bar gap items" amendment (#4414, fields
7146
+ // 10–14). Discriminators stay free strings (invariant 6). Field 9 (`searchable`)
7147
+ // arrives with the RFC 0010 search implementation.
7148
+ items: { type: "array", items: { $ref: "#/$defs/toolbarItem" } },
7149
+ titleDisplay: { type: "string" },
7150
+ subtitle: { type: "string" },
7151
+ visibility: { type: "string" },
7152
+ background: { $ref: "#/$defs/tokenRef" },
7153
+ logo: { $ref: "#/$defs/topBarLogo" },
7154
+ titleMenu: { $ref: "#/$defs/topBarTitleMenu" },
7155
+ subtitlePath: { type: "string" },
7156
+ scrollBehavior: { type: "string" },
7157
+ dirtyPath: { type: "string" }
7158
+ }
7159
+ },
7160
+ toolbarItem: {
7161
+ type: "object",
7162
+ additionalProperties: false,
7163
+ required: ["id"],
7164
+ properties: {
7165
+ id: { type: "string", minLength: 1 },
7166
+ placement: { type: "string" },
7167
+ label: { type: "string" },
7168
+ icon: { type: "string" },
7169
+ onTap: { $ref: "#/$defs/action" },
7170
+ role: { type: "string" },
7171
+ disabled: { type: "boolean" },
7172
+ disabledPath: { type: "string" },
7173
+ menu: { type: "array", items: { $ref: "#/$defs/topBarMenuItem" } },
7174
+ content: { $ref: "#/$defs/component" },
7175
+ loadingPath: { type: "string" },
7176
+ avatar: { $ref: "#/$defs/toolbarAvatar" },
7177
+ labelPath: { type: "string" }
7178
+ }
7179
+ },
7180
+ toolbarAvatar: {
7181
+ type: "object",
7182
+ additionalProperties: false,
7183
+ properties: {
7184
+ imageUrl: { type: "string" },
7185
+ initials: { type: "string" },
7186
+ imageUrlPath: { type: "string" },
7187
+ initialsPath: { type: "string" }
7188
+ }
7189
+ },
7190
+ topBarLogo: {
7191
+ type: "object",
7192
+ additionalProperties: false,
7193
+ properties: {
7194
+ imageUrl: { type: "string" },
7195
+ imageUrlDark: { type: "string" },
7196
+ imageAsset: { type: "string" },
7197
+ name: { type: "string" },
7198
+ placement: { type: "string" },
7199
+ imageUrlPath: { type: "string" },
7200
+ accessibilityLabel: { type: "string" }
7201
+ }
7202
+ },
7203
+ topBarTitleMenu: {
7204
+ type: "object",
7205
+ additionalProperties: false,
7206
+ properties: {
7207
+ items: { type: "array", items: { $ref: "#/$defs/topBarMenuItem" } },
7208
+ selectedId: { type: "string" },
7209
+ selectedIdPath: { type: "string" },
7210
+ accessibilityLabel: { type: "string" }
7211
+ }
7212
+ },
7213
+ // The proto `MenuItem` (id, label, icon, destructive, disabled, action), as the
7214
+ // top bar carries it outside a Menu component's props.
7215
+ topBarMenuItem: {
7216
+ type: "object",
7217
+ additionalProperties: false,
7218
+ required: ["id", "label"],
7219
+ properties: {
7220
+ id: { type: "string", minLength: 1 },
7221
+ label: { type: "string" },
7222
+ icon: { type: "string" },
7223
+ destructive: { type: "boolean" },
7224
+ disabled: { type: "boolean" },
7225
+ action: { $ref: "#/$defs/action" }
7145
7226
  }
7146
7227
  },
7147
7228
  topBarAction: {
@@ -9114,6 +9195,7 @@ function deriveAppMeta(name, m, platforms = {}, provisioning = {}) {
9114
9195
  appIconBadgeSources: config.navigation?.appIconBadgeSources,
9115
9196
  site: config.navigation?.site,
9116
9197
  streamPolicy: config.navigation?.streamPolicy,
9198
+ topBarLogo: config.navigation?.topBarLogo,
9117
9199
  splash: config.splash,
9118
9200
  locale: config.locale,
9119
9201
  deepLinkPatterns: config.navigation?.deepLinkPatterns,
@@ -13,9 +13,39 @@ function dispatch(handlerId, params, _options) {
13
13
  return himalaya.dispatch(handlerId, stringParams);
14
14
  }
15
15
 
16
+ // ../../core/sdk/wix-platform/src/offline.ts
17
+ function bridge() {
18
+ const himalaya = globalThis.himalaya;
19
+ return himalaya ? himalaya.wixApi : void 0;
20
+ }
21
+ async function call(method, path, body, headers) {
22
+ const api = bridge();
23
+ if (!api) throw new Error("wixApi bridge unavailable");
24
+ if (!api.offline) return { status: "sent", value: await api.call(method, path, body, headers) };
25
+ return await api.call(method, path, body, headers, { offline: "queue" });
26
+ }
27
+ function isOfflineWriteBlocked(e) {
28
+ return e?.code === "offline_write_blocked";
29
+ }
30
+ function isOfflineWriteOutcomeUnknown(e) {
31
+ return e?.code === "offline_write_outcome_unknown";
32
+ }
33
+ var offline = {
34
+ call,
35
+ /** This scope's queued writes (no bodies). */
36
+ pending: (opts) => bridge()?.offline?.pending(opts) ?? Promise.resolve([]),
37
+ /** This scope's rejected writes. */
38
+ rejected: () => bridge()?.offline?.rejected() ?? Promise.resolve([]),
39
+ /** Clear one rejected write. A retry is a new write with a new `writeId`. */
40
+ dismiss: (writeId) => bridge()?.offline?.dismiss(writeId) ?? Promise.resolve(false),
41
+ /** `queued`, `applied` and `rejected`, delivered while this worker runs. Returns an unsubscribe. */
42
+ on: (type, cb) => bridge()?.offline?.on(type, cb) ?? (() => {
43
+ })
44
+ };
45
+
16
46
  // ../../core/sdk/wix-platform/src/index.ts
17
47
  var CAP = "capability.wix_platform";
18
- async function call(method, params) {
48
+ async function call2(method, params) {
19
49
  return await dispatch(`${CAP}.${method}`, params);
20
50
  }
21
51
  function wpHost() {
@@ -33,7 +63,7 @@ async function realWix(method, path, body) {
33
63
  var bi = {
34
64
  /** Fire a BI beacon with an explicit Frog `evid` + params. */
35
65
  async track(evid, params) {
36
- const r = await call("biTrack", {
66
+ const r = await call2("biTrack", {
37
67
  evid: String(evid),
38
68
  params: params ? JSON.stringify(params) : ""
39
69
  });
@@ -79,11 +109,11 @@ async function conductCached(ns, spec, fallback, resolve) {
79
109
  return task;
80
110
  }
81
111
  async function resolveExperiment(spec, fallback) {
82
- const r = await call("experimentsConduct", { spec, fallback });
112
+ const r = await call2("experimentsConduct", { spec, fallback });
83
113
  return typeof r?.variant === "string" ? r.variant : null;
84
114
  }
85
115
  async function resolveFlag(spec, fallback) {
86
- const r = await call("flagsIsEnabled", { spec, fallback });
116
+ const r = await call2("flagsIsEnabled", { spec, fallback });
87
117
  return typeof r?.enabled === "boolean" ? String(r.enabled) : null;
88
118
  }
89
119
  var experiments = {
@@ -101,7 +131,7 @@ var experiments = {
101
131
  * (Symphony relies on server-side conduction; this is the generalized app-side
102
132
  * exposure hook.) */
103
133
  async exposure(spec, variant) {
104
- const r = await call("experimentsExposure", { spec, variant });
134
+ const r = await call2("experimentsExposure", { spec, variant });
105
135
  return { ok: r?.ok ?? false };
106
136
  }
107
137
  };
@@ -114,12 +144,12 @@ var flags = {
114
144
  },
115
145
  /** A toggle's raw value (variant string) for non-boolean specs. */
116
146
  async value(spec, fallback = "") {
117
- const r = await call("flagsValue", { spec, fallback });
147
+ const r = await call2("flagsValue", { spec, fallback });
118
148
  return r?.value ?? fallback;
119
149
  },
120
150
  /** All known toggle states (dev/diagnostic). */
121
151
  async all() {
122
- const r = await call("flagsAll");
152
+ const r = await call2("flagsAll");
123
153
  return r?.flags && typeof r.flags === "object" ? r.flags : {};
124
154
  }
125
155
  };
@@ -129,31 +159,31 @@ var i18n = {
129
159
  * has no route on any Wix host a himi app reaches (the same 404 as a made-up path, with or
130
160
  * without a token), so `real.i18n` no longer sends it anywhere — it only ever 404ed. */
131
161
  async t(key, fallback) {
132
- const r = await call("i18nTranslate", { key, fallback: fallback ?? key });
162
+ const r = await call2("i18nTranslate", { key, fallback: fallback ?? key });
133
163
  return r?.value ?? fallback ?? key;
134
164
  },
135
165
  /** Current resolved UI locale (2-letter). */
136
166
  async locale() {
137
- const r = await call("i18nLocale");
167
+ const r = await call2("i18nLocale");
138
168
  return r?.locale ?? "en";
139
169
  }
140
170
  };
141
171
  var ping = {
142
172
  /** Register the device's push token with Wix Ping. */
143
173
  async register() {
144
- const r = await call("pingRegister");
174
+ const r = await call2("pingRegister");
145
175
  return { registered: r?.registered ?? false, token: r?.token ?? "" };
146
176
  },
147
177
  /** Current Ping registration status (no network). */
148
178
  async status() {
149
- const r = await call("pingStatus");
179
+ const r = await call2("pingStatus");
150
180
  return { registered: r?.registered ?? false, token: r?.token ?? "" };
151
181
  }
152
182
  };
153
183
  var deeplink = {
154
184
  /** Resolve a deferred (post-install) deep link via Wix Jot. Null when none. */
155
185
  async resolveDeferred() {
156
- const r = await call("deeplinkResolveDeferred");
186
+ const r = await call2("deeplinkResolveDeferred");
157
187
  return { link: r?.link && r.link.length > 0 ? r.link : null };
158
188
  }
159
189
  };
@@ -161,24 +191,24 @@ var session = {
161
191
  /** The Wix mobile aspect-headers the transport attaches to wix-host requests
162
192
  * (BSI, x-wix-language, mobile-app-version, x-wix-rpc-caller-id, …). */
163
193
  async headers() {
164
- const r = await call("sessionHeaders");
194
+ const r = await call2("sessionHeaders");
165
195
  return r?.headers && typeof r.headers === "object" ? r.headers : {};
166
196
  },
167
197
  /** Whether a per-business signed instance is minted, and for which metaSite. */
168
198
  async signedInstanceStatus() {
169
- const r = await call("sessionSignedInstance");
199
+ const r = await call2("sessionSignedInstance");
170
200
  return { present: r?.present ?? false, msid: r?.msid ?? null };
171
201
  }
172
202
  };
173
203
  async function authTransition(method) {
174
- await call(method);
204
+ await call2(method);
175
205
  dropConductFlights();
176
206
  return auth.getIdentity();
177
207
  }
178
208
  var auth = {
179
209
  /** Current identity (visitor vs member vs owner) + who. */
180
210
  async getIdentity() {
181
- const r = await call("authIdentity");
211
+ const r = await call2("authIdentity");
182
212
  return {
183
213
  authenticated: r?.authenticated ?? false,
184
214
  type: r?.type ?? "anonymous",
@@ -192,7 +222,7 @@ var auth = {
192
222
  },
193
223
  /** The current access/member token (or null when anonymous). */
194
224
  async getAccessToken() {
195
- const r = await call("authAccessToken");
225
+ const r = await call2("authAccessToken");
196
226
  return r?.token && r.token.length > 0 ? r.token : null;
197
227
  },
198
228
  /** Sign in (hosted Wix login → member token). Resolves with the new identity. */
@@ -224,7 +254,7 @@ var auth = {
224
254
  } catch {
225
255
  }
226
256
  }
227
- const r = await call("authSignedInstance", { businessId, type });
257
+ const r = await call2("authSignedInstance", { businessId, type });
228
258
  return r?.signedInstance && r.signedInstance.length > 0 ? r.signedInstance : null;
229
259
  }
230
260
  };
@@ -258,7 +288,7 @@ function parseBusinessInfo(res) {
258
288
  }
259
289
  async function scopeToSite(msid) {
260
290
  try {
261
- const r = await call("siteSetActive", { msid });
291
+ const r = await call2("siteSetActive", { msid });
262
292
  return { ok: !!r?.ok, msid: r?.msid ?? "" };
263
293
  } finally {
264
294
  dropConductFlights();
@@ -271,7 +301,7 @@ var site = {
271
301
  },
272
302
  /** The metaSiteId currently scoped ("" if none). */
273
303
  async activeSite() {
274
- const r = await call("siteActive");
304
+ const r = await call2("siteActive");
275
305
  return r?.msid ?? "";
276
306
  },
277
307
  /** The customer's business/site info (identity + locale + contact) from Wix Site
@@ -328,7 +358,7 @@ var site = {
328
358
  var monitoring = {
329
359
  /** Capture a handled error message (routes to the Sentry telemetry sink). */
330
360
  async captureError(message, extra) {
331
- const r = await call("monitoringCapture", {
361
+ const r = await call2("monitoringCapture", {
332
362
  message,
333
363
  extra: extra ? JSON.stringify(extra) : ""
334
364
  });
@@ -336,7 +366,7 @@ var monitoring = {
336
366
  },
337
367
  /** Capture an exception with an error class + message (crash-style report). */
338
368
  async captureException(errorClass, message, extra) {
339
- const r = await call("monitoringCaptureException", {
369
+ const r = await call2("monitoringCaptureException", {
340
370
  errorClass,
341
371
  message,
342
372
  extra: extra ? JSON.stringify(extra) : ""
@@ -345,15 +375,15 @@ var monitoring = {
345
375
  },
346
376
  /** Associate the current user with subsequent crash reports. */
347
377
  async setUser(userId, traits) {
348
- await call("monitoringSetUser", { userId, traits: traits ? JSON.stringify(traits) : "" });
378
+ await call2("monitoringSetUser", { userId, traits: traits ? JSON.stringify(traits) : "" });
349
379
  },
350
380
  /** Set a scope tag attached to subsequent crash reports. */
351
381
  async setTag(key, value) {
352
- await call("monitoringSetTag", { key, value });
382
+ await call2("monitoringSetTag", { key, value });
353
383
  },
354
384
  /** Drop a breadcrumb onto the crash trail. */
355
385
  async addBreadcrumb(message) {
356
- await call("monitoringBreadcrumb", { message });
386
+ await call2("monitoringBreadcrumb", { message });
357
387
  }
358
388
  };
359
389
  var version = 2;
@@ -365,7 +395,10 @@ export {
365
395
  flags,
366
396
  i18n,
367
397
  isMemberReal,
398
+ isOfflineWriteBlocked,
399
+ isOfflineWriteOutcomeUnknown,
368
400
  monitoring,
401
+ offline,
369
402
  ping,
370
403
  session,
371
404
  site,