@wix/himalaya-cli 0.1580.0 → 0.1582.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.
Files changed (43) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/app-config.d.ts +18 -3
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +3 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/network/src/index.d.ts +39 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +2 -1
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/capabilities.generated.d.ts +2 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +1 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +12 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/validator.d.ts +6 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +1 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +1 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +1 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +1 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +1 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +1 -0
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +1 -0
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/network.mjs +45 -0
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +1 -0
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +1 -0
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +1 -0
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +1 -0
  21. package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +4 -0
  22. package/dist/cli.mjs +16481 -16739
  23. package/dist/preview-assets.generated.bin +0 -0
  24. package/guides/app-config.md +1 -1
  25. package/guides/component-reference.json +5 -3
  26. package/guides/component-reference.md +10 -2
  27. package/guides/designing-himi-screens.md +24 -0
  28. package/guides/importable-sdks.md +1 -0
  29. package/guides/sdk-reference.json +38 -1
  30. package/guides/tier-5-add-a-screen.md +32 -0
  31. package/guides/web-page-sdk-reference.md +1 -0
  32. package/package.json +2 -2
  33. package/templates/beauty-salon/dev/index.ts +197 -304
  34. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +44 -13
  35. package/templates/branded-lite/dev/index.ts +197 -304
  36. package/templates/branded-lite/l10n/en.json +2 -2
  37. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +49 -17
  38. package/templates/gym-fitness/dev/index.ts +197 -304
  39. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +44 -13
  40. package/templates/portfolio-creative/dev/index.ts +197 -304
  41. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +44 -13
  42. package/templates/retail-store/dev/index.ts +197 -304
  43. package/templates/retail-store/tier5-src/himi-store-product/index.ts +49 -17
@@ -16,6 +16,8 @@ export interface LinkableScreen {
16
16
  paramKeys: string[];
17
17
  parentScreenId: string;
18
18
  tabId: string;
19
+ /** #4656 — an external link to this screen asks for a sign-in first. Always served (false by default). */
20
+ requiresAuth: boolean;
19
21
  }
20
22
  export interface FrogTelemetryConfig {
21
23
  src: number;
@@ -234,6 +236,16 @@ export interface NavBundleContext {
234
236
  serverBaseUrl: string;
235
237
  bundleIntegrity(bundleName: string): string | null;
236
238
  }
239
+ /** #4656 — `requiresAuth: true` on a linkable screen of an app with no `auth` block can never be
240
+ * satisfied: there is no sign-in to present, so the native coordinator applies the link as if the
241
+ * flag were unset. One message per such screen; empty when nothing is wrong. A warning, never a
242
+ * failure — the link still opens. */
243
+ export declare function requiresAuthLinkableProblems(auth: {
244
+ providerId?: string;
245
+ } | null | undefined, linkables: readonly {
246
+ screenId: string;
247
+ requiresAuth?: boolean;
248
+ }[] | undefined): string[];
237
249
  /** The push block an app serves, and what a derived route table could not cover. */
238
250
  export interface ServedPush {
239
251
  push?: import("@wix/himalaya/core").PushConfig;
@@ -289,20 +301,23 @@ export interface AppConfigDocument {
289
301
  * `/v1/boot` uses this too, so the first-paint optimization cannot drift from
290
302
  * the authoritative per-document fallback in locale handling, overrides, or
291
303
  * navigation-bundle expansion. */
292
- /** Every linkable-screen entry with all five fields — the defaults Kotlin and Swift apply. Binaries
293
- * shipped before #3318 decode a linkable screen with all five REQUIRED and drop the whole
294
- * NavigationConfig when one is missing, so nothing served may carry a partial entry. */
304
+ /** Every linkable-screen entry with all its fields — the defaults Kotlin and Swift apply. Binaries
305
+ * shipped before #3318 decode a linkable screen with the first five REQUIRED and drop the whole
306
+ * NavigationConfig when one is missing, so nothing served may carry a partial entry.
307
+ * `requiresAuth` (#4656) is newer: older binaries ignore the unknown key, newer ones default it. */
295
308
  export declare function completeLinkableScreens<T extends {
296
309
  screenId: string;
297
310
  isPublic?: boolean;
298
311
  paramKeys?: string[];
299
312
  parentScreenId?: string;
300
313
  tabId?: string;
314
+ requiresAuth?: boolean;
301
315
  }>(list: readonly T[]): (T & {
302
316
  isPublic: boolean;
303
317
  paramKeys: string[];
304
318
  parentScreenId: string;
305
319
  tabId: string;
320
+ requiresAuth: boolean;
306
321
  })[];
307
322
  /** A merged (overridden) config with its linkable screens completed — ONE rule for every place that
308
323
  * shows or serves the effective config, so the admin view and the device payload cannot diverge. */
@@ -528,6 +528,7 @@ export declare function button(props: {
528
528
  leadingIcon?: string;
529
529
  trailingIcon?: string;
530
530
  loading?: boolean;
531
+ loadingPath?: string;
531
532
  size?: "sm" | "md" | "lg";
532
533
  fullWidth?: boolean;
533
534
  iconOnly?: boolean;
@@ -908,6 +909,8 @@ export declare function segmentedControl(props: {
908
909
  }): Component;
909
910
  export declare function carousel(props: {
910
911
  items: Component[];
912
+ paged?: boolean;
913
+ currentIndexPath?: string;
911
914
  currentIndex?: number;
912
915
  onChange?: ActionShape;
913
916
  autoplayIntervalMs?: number;
@@ -0,0 +1,39 @@
1
+ /** What kind of link carries the traffic. `"none"` when offline; `"unknown"` when the
2
+ * platform cannot say (most desktop browsers). */
3
+ export type NetworkType = "wifi" | "cellular" | "ethernet" | "other" | "none" | "unknown";
4
+ /** One reading of the device's connectivity. */
5
+ export interface NetworkStatus {
6
+ /** The device has a usable network path. */
7
+ online: boolean;
8
+ type: NetworkType;
9
+ /** The link is metered / costly (cellular, a personal hotspot). Best-effort. */
10
+ expensive: boolean;
11
+ /** The user asked to save data (iOS Low Data Mode, Android Data Saver, web Save-Data). Best-effort. */
12
+ constrained: boolean;
13
+ }
14
+ /** Coerce whatever crossed the bridge into a well-formed {@link NetworkStatus}. A malformed
15
+ * or missing field degrades to the honest default rather than throwing. */
16
+ export declare function normalizeNetworkStatus(raw: unknown): NetworkStatus;
17
+ /** Read the current connectivity. */
18
+ export declare function status(): Promise<NetworkStatus>;
19
+ /**
20
+ * Have `handler` (`"<service>.<action>"`) invoked with the new {@link NetworkStatus} on each
21
+ * CHANGE. Changes are debounced 500 ms and a reading equal to the last one delivered is
22
+ * suppressed, so a flapping interface does not storm the reducer. The subscription lives
23
+ * as long as the calling worker and is released when it is torn down. Subscribing the same
24
+ * handler twice is idempotent.
25
+ *
26
+ * Resolves with the status at the moment of subscribing, so the screen can paint the
27
+ * current state without waiting for the first change.
28
+ *
29
+ * ```ts
30
+ * import { subscribe } from "@wix/himalaya/network";
31
+ *
32
+ * init: (s) => {
33
+ * subscribe("net.changed").then((now) => net.changed(now)).catch(() => {});
34
+ * return s;
35
+ * },
36
+ * changed: (s, status) => ({ ...s, online: status.online, type: status.type }),
37
+ * ```
38
+ */
39
+ export declare function subscribe(handler: string): Promise<NetworkStatus>;
@@ -23,6 +23,7 @@ export declare const CAPABILITY_REGISTRY: {
23
23
  readonly location: readonly ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"];
24
24
  readonly media_playback: readonly ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"];
25
25
  readonly motion: readonly ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"];
26
+ readonly network: readonly ["status", "subscribe"];
26
27
  readonly on_device_ai: readonly ["availability", "generateText"];
27
28
  readonly open_url: readonly ["canOpen", "open"];
28
29
  readonly pdf: readonly ["isAvailable", "open"];
@@ -42,7 +43,7 @@ export declare const CAPABILITY_REGISTRY: {
42
43
  readonly wix_chat: readonly ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"];
43
44
  };
44
45
  /** A capability id backed by an @himalaya/* SDK binding. */
45
- export type SdkCapability = "app_info" | "audio_record" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "keyboard" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "theme" | "ui" | "wix_cashier" | "wix_chat";
46
+ export type SdkCapability = "app_info" | "audio_record" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "keyboard" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "network" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "theme" | "ui" | "wix_cashier" | "wix_chat";
46
47
  /** All `capability.<id>.<verb>` action ids, flattened (the worker-bridge wire vocabulary). */
47
48
  export declare const CAPABILITY_ACTION_IDS: readonly string[];
48
49
  /** Capability id → the @himalaya/* package(s) a worker imports to reach it — every dispatch
@@ -21,6 +21,7 @@ import type * as LocalDatabaseSdk from "@wix/himalaya/local-db";
21
21
  import type * as LocationSdk from "@wix/himalaya/location";
22
22
  import type * as MediaPlaybackSdk from "@wix/himalaya/media-playback";
23
23
  import type * as MotionSdk from "@wix/himalaya/motion";
24
+ import type * as NetworkSdk from "@wix/himalaya/network";
24
25
  import type * as OnDeviceAiSdk from "@wix/himalaya/on-device-ai";
25
26
  import type * as OpenUrlSdk from "@wix/himalaya/open-url";
26
27
  import type * as PdfSdk from "@wix/himalaya/pdf";
@@ -73,6 +74,7 @@ export interface HimalayaPageCapabilities {
73
74
  readonly "location": PageModule<typeof LocationSdk> & PageEvents;
74
75
  readonly "media_playback": PageModule<typeof MediaPlaybackSdk> & PageEvents;
75
76
  readonly "motion": PageModule<typeof MotionSdk> & PageEvents;
77
+ readonly "network": PageModule<typeof NetworkSdk> & PageEvents;
76
78
  readonly "on_device_ai": PageModule<typeof OnDeviceAiSdk> & PageEvents;
77
79
  readonly "open_url": PageModule<typeof OpenUrlSdk> & PageEvents;
78
80
  readonly "pdf": PageModule<typeof PdfSdk> & PageEvents;
@@ -791,7 +791,7 @@ export interface OrientationEnvelope {
791
791
  export declare const DEFAULT_ORIENTATION_ENVELOPE: Required<OrientationEnvelope>;
792
792
  /** Fill in the absent families. Total, so callers never branch on `undefined`. */
793
793
  export declare function resolveOrientationEnvelope(env?: OrientationEnvelope): Required<OrientationEnvelope>;
794
- export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "theme" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "wix_cashier" | "wix_chat" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "godot" | "base44" | "animation";
794
+ export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "theme" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "network" | "wix_cashier" | "wix_chat" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "godot" | "base44" | "animation";
795
795
  /** `defineApp({ wixIap })` — the purchases-service app a build binds this app to. */
796
796
  export interface WixIapConfig {
797
797
  /** The purchases service's app UUID, registered on the app's own auth site. Not a secret. */
@@ -142,6 +142,8 @@ export interface Shadow {
142
142
  y?: number;
143
143
  }
144
144
  export interface Modifiers {
145
+ /** Changing non-empty token: scroll this node into view and move accessibility focus to it. */
146
+ scrollIntoViewPath?: string;
145
147
  padding?: EdgeInsets;
146
148
  background?: TokenRef;
147
149
  cornerRadius?: number;
@@ -811,6 +813,8 @@ export interface ButtonProps {
811
813
  cornerRadius?: number;
812
814
  /** #1049 — minimum height (pt/dp/px). */
813
815
  minHeight?: number;
816
+ /** Live loading bool; OR with literal loading. */
817
+ loadingPath?: string;
814
818
  }
815
819
  export type Keyboard = "default" | "email" | "phone" | "number" | "url" | "decimal";
816
820
  export type AutoCapitalization = "none" | "words" | "sentences" | "characters";
@@ -1258,6 +1262,10 @@ export interface SegmentedControlProps {
1258
1262
  optionsPath?: string;
1259
1263
  }
1260
1264
  export interface CarouselProps {
1265
+ /** Opt-in paging for itemsPath; absent preserves the horizontal card rail. */
1266
+ paged?: boolean;
1267
+ /** Worker-driven page index; clamped to the current page count. */
1268
+ currentIndexPath?: string;
1261
1269
  items: Component[];
1262
1270
  currentIndex?: number;
1263
1271
  onChange?: Action;
@@ -3234,6 +3242,10 @@ export interface LinkableScreen {
3234
3242
  paramKeys: string[];
3235
3243
  parentScreenId: string;
3236
3244
  tabId: string;
3245
+ /** #4656 — a signed-in user is required: an external link / push route to this screen while
3246
+ * signed out presents the sign-in first, then continues to it. Absent ⇒ false. Needs an
3247
+ * `auth` block (validator warns otherwise). */
3248
+ requiresAuth?: boolean;
3237
3249
  }
3238
3250
  export type RendererKind = "sdui_intent" | "sdui_layout" | "webview_native_bridge" | "webview_ds";
3239
3251
  export interface CacheControl {
@@ -797,6 +797,9 @@ export declare const screenDescriptorSchema: {
797
797
  readonly type: "object";
798
798
  readonly additionalProperties: false;
799
799
  readonly properties: {
800
+ readonly scrollIntoViewPath: {
801
+ readonly type: "string";
802
+ };
800
803
  readonly padding: {
801
804
  readonly $ref: "#/$defs/edgeInsets";
802
805
  };
@@ -2223,6 +2226,9 @@ export declare const widgetSnapshotSchema: {
2223
2226
  readonly type: "object";
2224
2227
  readonly additionalProperties: false;
2225
2228
  readonly properties: {
2229
+ readonly scrollIntoViewPath: {
2230
+ readonly type: "string";
2231
+ };
2226
2232
  readonly padding: {
2227
2233
  readonly $ref: "#/$defs/edgeInsets";
2228
2234
  };
@@ -38,6 +38,7 @@ var CAPABILITY_REGISTRY = {
38
38
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
39
39
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
40
40
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
41
+ "network": ["status", "subscribe"],
41
42
  "on_device_ai": ["availability", "generateText"],
42
43
  "open_url": ["canOpen", "open"],
43
44
  "pdf": ["isAvailable", "open"],
@@ -38,6 +38,7 @@ var CAPABILITY_REGISTRY = {
38
38
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
39
39
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
40
40
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
41
+ "network": ["status", "subscribe"],
41
42
  "on_device_ai": ["availability", "generateText"],
42
43
  "open_url": ["canOpen", "open"],
43
44
  "pdf": ["isAvailable", "open"],
@@ -38,6 +38,7 @@ var CAPABILITY_REGISTRY = {
38
38
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
39
39
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
40
40
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
41
+ "network": ["status", "subscribe"],
41
42
  "on_device_ai": ["availability", "generateText"],
42
43
  "open_url": ["canOpen", "open"],
43
44
  "pdf": ["isAvailable", "open"],
@@ -38,6 +38,7 @@ var CAPABILITY_REGISTRY = {
38
38
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
39
39
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
40
40
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
41
+ "network": ["status", "subscribe"],
41
42
  "on_device_ai": ["availability", "generateText"],
42
43
  "open_url": ["canOpen", "open"],
43
44
  "pdf": ["isAvailable", "open"],
@@ -8853,6 +8853,7 @@ var screenDescriptorSchema = {
8853
8853
  type: "object",
8854
8854
  additionalProperties: false,
8855
8855
  properties: {
8856
+ scrollIntoViewPath: { type: "string" },
8856
8857
  padding: { $ref: "#/$defs/edgeInsets" },
8857
8858
  background: { $ref: "#/$defs/tokenRef" },
8858
8859
  cornerRadius: { type: "integer", minimum: 0 },
@@ -38,6 +38,7 @@ var CAPABILITY_REGISTRY = {
38
38
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
39
39
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
40
40
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
41
+ "network": ["status", "subscribe"],
41
42
  "on_device_ai": ["availability", "generateText"],
42
43
  "open_url": ["canOpen", "open"],
43
44
  "pdf": ["isAvailable", "open"],
@@ -38,6 +38,7 @@ var CAPABILITY_REGISTRY = {
38
38
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
39
39
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
40
40
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
41
+ "network": ["status", "subscribe"],
41
42
  "on_device_ai": ["availability", "generateText"],
42
43
  "open_url": ["canOpen", "open"],
43
44
  "pdf": ["isAvailable", "open"],
@@ -0,0 +1,45 @@
1
+ // ../../core/sdk/dispatch/src/index.ts
2
+ function dispatch(handlerId, params, _options) {
3
+ const himalaya = globalThis.himalaya;
4
+ if (!himalaya) {
5
+ return Promise.reject(
6
+ new Error("@himalaya/dispatch: called outside a Himalaya runtime. This bundle must run inside a JSWorker (Tier 5).")
7
+ );
8
+ }
9
+ const stringParams = {};
10
+ if (params) {
11
+ for (const [k, v] of Object.entries(params)) stringParams[k] = String(v);
12
+ }
13
+ return himalaya.dispatch(handlerId, stringParams);
14
+ }
15
+
16
+ // ../../core/sdk/network/src/index.ts
17
+ var TYPES = ["wifi", "cellular", "ethernet", "other", "none", "unknown"];
18
+ function normalizeNetworkStatus(raw) {
19
+ const r = raw && typeof raw === "object" ? raw : {};
20
+ const online = r.online === true || r.online === "true";
21
+ const type = TYPES.includes(r.type) ? r.type : "unknown";
22
+ return {
23
+ online,
24
+ // An offline device has no link, whatever a stale `type` said.
25
+ type: online ? type === "none" ? "unknown" : type : "none",
26
+ expensive: online && (r.expensive === true || r.expensive === "true"),
27
+ constrained: online && (r.constrained === true || r.constrained === "true")
28
+ };
29
+ }
30
+ async function status() {
31
+ return normalizeNetworkStatus(await dispatch("capability.network.status", {}));
32
+ }
33
+ async function subscribe(handler) {
34
+ const parts = handler.split(".");
35
+ if (parts.length !== 2 || parts.some((part) => part.trim().length === 0)) {
36
+ throw new Error('network.subscribe: handler must be "<service>.<action>"');
37
+ }
38
+ return normalizeNetworkStatus(await dispatch("capability.network.subscribe", { onChange: handler }));
39
+ }
40
+ export {
41
+ normalizeNetworkStatus,
42
+ status,
43
+ subscribe
44
+ };
45
+ //# sourceMappingURL=network.mjs.map
@@ -38,6 +38,7 @@ var CAPABILITY_REGISTRY = {
38
38
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
39
39
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
40
40
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
41
+ "network": ["status", "subscribe"],
41
42
  "on_device_ai": ["availability", "generateText"],
42
43
  "open_url": ["canOpen", "open"],
43
44
  "pdf": ["isAvailable", "open"],
@@ -23,6 +23,7 @@ var CAPABILITY_REGISTRY = {
23
23
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
24
24
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
25
25
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
26
+ "network": ["status", "subscribe"],
26
27
  "on_device_ai": ["availability", "generateText"],
27
28
  "open_url": ["canOpen", "open"],
28
29
  "pdf": ["isAvailable", "open"],
@@ -7425,6 +7425,7 @@ var screenDescriptorSchema = {
7425
7425
  type: "object",
7426
7426
  additionalProperties: false,
7427
7427
  properties: {
7428
+ scrollIntoViewPath: { type: "string" },
7428
7429
  padding: { $ref: "#/$defs/edgeInsets" },
7429
7430
  background: { $ref: "#/$defs/tokenRef" },
7430
7431
  cornerRadius: { type: "integer", minimum: 0 },
@@ -38,6 +38,7 @@ var CAPABILITY_REGISTRY = {
38
38
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
39
39
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
40
40
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "openStepHistorySetup", "requestPermission", "watchNext", "watchStart", "watchStop"],
41
+ "network": ["status", "subscribe"],
41
42
  "on_device_ai": ["availability", "generateText"],
42
43
  "open_url": ["canOpen", "open"],
43
44
  "pdf": ["isAvailable", "open"],
@@ -170,6 +170,10 @@
170
170
  "types": "./dist/_types/core/sdk/motion/src/index.d.ts",
171
171
  "import": "./dist/motion.mjs"
172
172
  },
173
+ "./network": {
174
+ "types": "./dist/_types/core/sdk/network/src/index.d.ts",
175
+ "import": "./dist/network.mjs"
176
+ },
173
177
  "./on-device-ai": {
174
178
  "types": "./dist/_types/core/sdk/on-device-ai/src/index.d.ts",
175
179
  "import": "./dist/on-device-ai.mjs"