@ng-native/device 0.29.0 → 0.30.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/README.md CHANGED
@@ -48,8 +48,8 @@ setup, and one nobody injects is never constructed.
48
48
  - [Device](https://ng-native.com/packages/device)
49
49
  - [Testing with services](https://ng-native.com/packages/testing/testing-services), for
50
50
  overriding a service's `SOURCE` token without a device underneath it
51
- - [Root README](https://github.com/ng-native/ng-native/blob/main/README.md) and
52
- [ARCHITECTURE.md](https://github.com/ng-native/ng-native/blob/main/docs/ARCHITECTURE.md)
51
+ - [Root README](https://github.com/coralogix/ng-native/blob/main/README.md) and
52
+ [ARCHITECTURE.md](https://github.com/coralogix/ng-native/blob/main/docs/ARCHITECTURE.md)
53
53
 
54
54
  ## License
55
55
 
@@ -125,10 +125,10 @@ export class Accessibility {
125
125
  announce(message) {
126
126
  this.source.announce(message);
127
127
  }
128
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Accessibility, deps: [], target: i0.ɵɵFactoryTarget.Service });
129
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: Accessibility });
128
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Accessibility, deps: [], target: i0.ɵɵFactoryTarget.Service });
129
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: Accessibility });
130
130
  }
131
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Accessibility, decorators: [{
131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Accessibility, decorators: [{
132
132
  type: Service
133
133
  }], ctorParameters: () => [] });
134
134
  //# sourceMappingURL=accessibility.js.map
@@ -58,10 +58,10 @@ export class AppLifecycle {
58
58
  clearTimeout(timer);
59
59
  }
60
60
  }
61
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: AppLifecycle, deps: [], target: i0.ɵɵFactoryTarget.Service });
62
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: AppLifecycle });
61
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: AppLifecycle, deps: [], target: i0.ɵɵFactoryTarget.Service });
62
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: AppLifecycle });
63
63
  }
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: AppLifecycle, decorators: [{
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: AppLifecycle, decorators: [{
65
65
  type: Service
66
66
  }] });
67
67
  //# sourceMappingURL=app-lifecycle.js.map
package/dist/app-state.js CHANGED
@@ -38,10 +38,10 @@ export class AppState {
38
38
  constructor() {
39
39
  inject(DestroyRef).onDestroy(this.source.subscribe((state) => this.state.set(state)));
40
40
  }
41
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: AppState, deps: [], target: i0.ɵɵFactoryTarget.Service });
42
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: AppState });
41
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: AppState, deps: [], target: i0.ɵɵFactoryTarget.Service });
42
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: AppState });
43
43
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: AppState, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: AppState, decorators: [{
45
45
  type: Service
46
46
  }], ctorParameters: () => [] });
47
47
  //# sourceMappingURL=app-state.js.map
@@ -28,6 +28,15 @@ export interface WindowOptions {
28
28
  readonly resizable?: boolean;
29
29
  /** `transparent` draws content under the title bar; `hidden` also hides the title. */
30
30
  readonly titleBar?: TitleBar;
31
+ /**
32
+ * macOS: where the window controls (close, minimise and zoom) go, as the close button's top-left
33
+ * in points from the window's top-left, with the others beside it, as Electron's option of the
34
+ * same name places them. The title bar grows to hold them. Ignored on Linux and iPadOS.
35
+ */
36
+ readonly trafficLightPosition?: {
37
+ readonly x: number;
38
+ readonly y: number;
39
+ };
31
40
  readonly fullScreen?: boolean;
32
41
  /**
33
42
  * Whether the window's frame is saved and restored on the next launch. On by default for the
@@ -520,10 +520,10 @@ export class AppWindows {
520
520
  ngOnDestroy() {
521
521
  this.unsubscribe?.();
522
522
  }
523
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: AppWindows, deps: [], target: i0.ɵɵFactoryTarget.Service });
524
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: AppWindows });
523
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: AppWindows, deps: [], target: i0.ɵɵFactoryTarget.Service });
524
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: AppWindows });
525
525
  }
526
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: AppWindows, decorators: [{
526
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: AppWindows, decorators: [{
527
527
  type: Service
528
528
  }] });
529
529
  //# sourceMappingURL=app-windows.js.map
@@ -1 +1 @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AmB;QACzB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;QACtF,CAAC;IACH,CAAC;IAED,oFAAoF;IACpF,WAAW;QACT,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;IACvB,CAAC;uGA1hBU,UAAU;wGAAV,UAAU;;2FAAV,UAAU;kBADtB,OAAO","sourcesContent":["/**\n * Several windows from one Angular app: desktop windows on macOS and scenes on iPadOS.\n *\n * Every window is a root view on its own native surface, joined to the one app: root services, the\n * one Router and one change detection are shared, and each window has an element injector that\n * provides `CURRENT_WINDOW`. A route window renders a named outlet of the app's Router, which\n * `WINDOW_NAVIGATOR` navigates; a component window renders a component with its inputs.\n * `@ng-native/platform` mounts each through `WINDOW_MOUNTER`.\n *\n * On iPhone and Android `available()` is false and `open` resolves to null, as an inert call does.\n *\n * The host contract is `NativeWindows`, below: the host opens and closes surfaces when asked, and\n * reports what the user does to them. The rules (guards, the last window, a Dock reopen, quitting)\n * are here, so every OS that has windows follows the same ones.\n */\nimport {\n InjectionToken,\n Service,\n computed,\n inject,\n makeEnvironmentProviders,\n signal,\n type Binding,\n type EnvironmentProviders,\n type Provider,\n type Signal,\n type Type,\n} from '@angular/core';\nimport { AppLifecycle } from './app-lifecycle.ts';\nimport { injectOs, isDesktopOs } from './os.ts';\nimport { reactNative } from './react-native.ts';\nimport { WINDOW_NAVIGATOR } from './window-navigator.ts';\nimport { RESTORABLE_WINDOWS, WINDOW_RESTORE_STORE, type RestoredWindow } from './window-restore.ts';\n\nexport type TitleBar = 'default' | 'transparent' | 'hidden';\n\n/** How a window opens. Sizes are in points; each left out is the host's default. */\nexport interface WindowOptions {\n readonly title?: string;\n readonly width?: number;\n readonly height?: number;\n readonly minWidth?: number;\n readonly minHeight?: number;\n readonly maxWidth?: number;\n readonly maxHeight?: number;\n readonly resizable?: boolean;\n /** `transparent` draws content under the title bar; `hidden` also hides the title. */\n readonly titleBar?: TitleBar;\n readonly fullScreen?: boolean;\n /**\n * Whether the window's frame is saved and restored on the next launch. On by default for the\n * main window, route windows and component windows with a `restoreKey`.\n */\n readonly autosave?: boolean;\n}\n\n/** A window rendering a component. */\nexport interface ComponentWindowOptions extends WindowOptions {\n /** Set on the component before its first change detection. */\n readonly inputs?: Readonly<Record<string, unknown>>;\n /**\n * What the window is restored by, after a reload or a relaunch: on macOS and iPadOS it opens\n * again with the same `inputs`, which must then survive `JSON.stringify`, where\n * `provideRestorableWindows` names its component. Without one, a reload closes the window. One key is one window: opening\n * a key that is open brings that window to the front.\n */\n readonly restoreKey?: string;\n}\n\n/** A window rendering the named outlet `outlet` of the app's Router, at `path`. */\nexport interface RouteWindowOptions extends WindowOptions {\n readonly outlet: string;\n readonly path: string;\n}\n\n/** The main window's options, as `provideMainWindow` takes them. */\nexport interface MainWindowOptions extends WindowOptions {\n /**\n * The main window's saved frame key on macOS and Linux. Defaults to `main`. Use a key distinct\n * from the app's other windows, and change it to start with a fresh frame on the next launch.\n */\n readonly restoreKey?: string;\n /**\n * Whether the main window opens at launch. True by default; false for an app that lives in the\n * menu bar or the tray, which opens it with `AppWindows.openMain()`.\n */\n readonly autoOpen?: boolean;\n}\n\n/** One open window. */\nexport interface AppWindow {\n /** The surface the window renders on. */\n readonly surface: number;\n /** `main`, the outlet's name for a route window, or the `restoreKey`; null otherwise. */\n readonly key: string | null;\n readonly title: Signal<string>;\n setTitle(title: string): void;\n /** Whether it is the key window. */\n readonly focused: Signal<boolean>;\n focus(): void;\n /** Close it, as the user would: every `canClose` guard is asked first. Resolves whether it closed. */\n close(): Promise<boolean>;\n /**\n * Ask `guard` before the window closes, by the user or by `close()`, and before the app quits.\n * Answers the function that removes it; a component removes its guard as it is destroyed.\n */\n canClose(guard: CloseGuard): () => void;\n /** Settles when the window has closed. */\n readonly closed: Promise<void>;\n}\n\nexport type CloseGuard = () => boolean | Promise<boolean>;\n\n/**\n * What the host is asked to open. `key` is what the frame autosaves under, or null for none.\n */\nexport interface NativeWindowRequest extends Omit<WindowOptions, 'title' | 'autosave'> {\n readonly key: string | null;\n readonly title: string;\n}\n\n/**\n * What the host tells the app. A `resize` for a surface `open` has not resolved to a mounted window\n * yet is kept for the window made on it. The host never closes a window or quits on its own: it sends\n * `closeRequest` for the close button and Cmd-W, and `quitRequest` for Cmd-Q, a logout or an\n * update's relaunch, and waits for `close` or `answerQuit`. `closed` reports a window the OS\n * closed itself (an iPadOS scene swiped away), which no guard can keep.\n */\nexport type NativeWindowEvent =\n | { readonly type: 'focus'; readonly surface: number | null }\n | {\n readonly type: 'resize';\n readonly surface: number;\n readonly width: number;\n readonly height: number;\n readonly scale?: number;\n }\n | { readonly type: 'closeRequest'; readonly surface: number }\n | { readonly type: 'closed'; readonly surface: number }\n /**\n * Cmd-Q, a logout or an update's relaunch. `terminate` is a SIGTERM: run only the `willQuit`\n * handlers, ask no `canClose` guard, and answer true. The host ends after two seconds anyway.\n */\n | { readonly type: 'quitRequest'; readonly terminate?: boolean }\n /** A Dock click, or the app opened again, with no window visible. */\n | { readonly type: 'reopen' }\n /**\n * iPadOS: a window the user made from the system (New Window, or the app opened again with none\n * open). The app opens the main window in it, or brings the main window forward, and the host\n * then closes the window the user made.\n */\n | { readonly type: 'newWindow' };\n\n/**\n * The host's windows: the desktop host on macOS, and on iPadOS the components pod, whose windows\n * are scenes. iPadOS asks no app before it closes a scene, so it sends `closed` and never\n * `closeRequest`, and it has no quitting, so never `quitRequest`. The module is\n * `NgNativeWindows`, whose constant `multipleWindows` says whether the OS has windows at all,\n * and whose events arrive as `ngNativeWindows` on `DeviceEventEmitter`.\n */\nexport interface NativeWindows {\n /**\n * Open a window with its own surface, shown when the surface's first frame commits so it never\n * shows at the wrong size. Resolves the surface's id, or null where the host would not.\n */\n open(request: NativeWindowRequest): Promise<number | null>;\n /** Close the window on `surface` and stop its surface. */\n close(surface: number): void;\n focus(surface: number): void;\n setTitle(surface: number, title: string): void;\n /** Start quitting, as Cmd-Q does: the host answers with a `quitRequest`. */\n quit(): void;\n /** Answer a `quitRequest`: true quits, after which the host tears the runtime down in order. */\n answerQuit(proceed: boolean): void;\n subscribe(listener: (event: NativeWindowEvent) => void): () => void;\n}\n\ninterface WindowsTurboModule {\n getConstants?(): { multipleWindows?: boolean };\n open?(request: NativeWindowRequest): Promise<number | null>;\n close?(surface: number): void;\n focus?(surface: number): void;\n setTitle?(surface: number, title: string): void;\n quit?(): void;\n answerQuit?(proceed: boolean): void;\n}\n\n/**\n * The runnable each window's surface runs on an iPad, where the host makes the surface through\n * React Native's own host: it renders nothing, as the window's root is mounted from the app.\n */\nconst WINDOW_RUNNABLE = 'NgNativeWindow';\n\n/**\n * The host's module, or null where the OS has one window: phones, Android, Expo Go, an older\n * host. Registers the windows' runnable where there is one.\n */\nexport function windowsSource(): NativeWindows | null {\n const native = reactNative();\n const module = native?.TurboModuleRegistry?.get?.('NgNativeWindows') as\n WindowsTurboModule | null | undefined;\n if (!module?.getConstants?.().multipleWindows) return null;\n native?.AppRegistry?.registerRunnable(WINDOW_RUNNABLE, () => {});\n return {\n open: async (request) => (await module.open?.(request)) ?? null,\n close: (surface) => module.close?.(surface),\n focus: (surface) => module.focus?.(surface),\n setTitle: (surface, title) => module.setTitle?.(surface, title),\n quit: () => module.quit?.(),\n answerQuit: (proceed) => module.answerQuit?.(proceed),\n subscribe: (listener) => {\n const subscription = native?.DeviceEventEmitter?.addListener('ngNativeWindows', (event) =>\n listener(event as NativeWindowEvent),\n );\n return () => subscription?.remove();\n },\n };\n}\n\n/** One window's mount, as `WINDOW_MOUNTER` answers it. */\nexport interface WindowMount {\n /** Tell the window's engine its new size, which its media queries resolve against. */\n resize(size: { width: number; height: number; scale?: number }): void;\n /** Destroy what the window renders, and stop its engine taking events. */\n destroy(): void;\n}\n\n/**\n * How a window's root is rendered on its surface. `@ng-native/platform` provides it: the\n * component is created in the app's environment injector, under an element injector with the\n * window's renderer, engine and `providers` (which hold `CURRENT_WINDOW`), and attached to the\n * app's one change detection. `main` is the app's root component, which the app's bootstrap\n * listeners (the Router's initial navigation) are told of the first time it mounts.\n */\nexport interface WindowMounter {\n mount(\n surface: number,\n component: Type<unknown>,\n options: {\n readonly inputs?: Readonly<Record<string, unknown>>;\n /** The main window's: what `mount` was given for the root component. */\n readonly bindings?: Binding[];\n readonly providers: Provider[];\n readonly main?: boolean;\n },\n ): WindowMount;\n}\n\n/** The platform's `WindowMounter`, or null where nothing can mount a window: a test with none. */\nexport const WINDOW_MOUNTER = new InjectionToken<WindowMounter | null>(\n 'angular-native.windowMounter',\n { factory: () => null },\n);\n\n/** The window a component is rendered in, or null outside one: every app with one surface. */\nexport const CURRENT_WINDOW = new InjectionToken<AppWindow | null>('angular-native.currentWindow', {\n factory: () => null,\n});\n\n/** What `provideMainWindow` was given. */\nexport const MAIN_WINDOW_OPTIONS = new InjectionToken<MainWindowOptions>(\n 'angular-native.mainWindowOptions',\n { factory: () => ({}) },\n);\n\n/**\n * Configure the main window, which renders the app's root component: its size and title bar, and\n * with `autoOpen: false` that the app starts with no window. Where the OS has one window, only\n * `autoOpen` is read, and it is ignored there: the app's one surface is its window.\n */\nexport function provideMainWindow(options: MainWindowOptions): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: MAIN_WINDOW_OPTIONS, useValue: options }]);\n}\n\n/** An open window and what it needs to close. */\ninterface Open {\n readonly handle: AppWindow;\n /** How it opens again after a reload, or null where it does not. */\n restore: RestoredWindow | null;\n readonly guards: Set<CloseGuard>;\n readonly outlet: string | undefined;\n readonly closedNow: () => void;\n mount: WindowMount | null;\n closing: boolean;\n}\n\n@Service()\nexport class AppWindows {\n /** Overridden in a test with a fake host. */\n static readonly SOURCE = new InjectionToken<NativeWindows | null>(\n 'angular-native.windowsSource',\n { factory: windowsSource },\n );\n\n private readonly native = inject(AppWindows.SOURCE);\n private readonly mounter = inject(WINDOW_MOUNTER);\n private readonly navigator = inject(WINDOW_NAVIGATOR);\n private readonly lifecycle = inject(AppLifecycle);\n private readonly mainOptions = inject(MAIN_WINDOW_OPTIONS);\n private readonly desktop = isDesktopOs(injectOs());\n private readonly store = inject(WINDOW_RESTORE_STORE);\n private readonly restorable = new Map(\n (inject(RESTORABLE_WINDOWS, { optional: true }) ?? []).flatMap((components) =>\n Object.entries(components),\n ),\n );\n\n /**\n * Whether the OS has windows the app can open: macOS, and iPadOS with the components pod and the\n * config plugin's `ios.multipleWindows`.\n */\n readonly available: Signal<boolean> = signal(this.native !== null).asReadonly();\n\n private readonly open$ = signal<readonly Open[]>([]);\n private readonly focusedSurface = signal<number | null>(null);\n\n /** Every open window, in the order they opened. */\n readonly windows: Signal<readonly AppWindow[]> = computed(() =>\n this.open$().map((open) => open.handle),\n );\n\n /** The key window, or null when none is: the app is in the background, or has no window. */\n readonly focused: Signal<AppWindow | null> = computed(\n () => this.windows().find((one) => one.surface === this.focusedSurface()) ?? null,\n );\n\n private main: {\n component: Type<unknown>;\n inputs?: Readonly<Record<string, unknown>>;\n bindings?: Binding[];\n } | null = null;\n\n /**\n * The last size the host sent for a surface no window is on yet. iPadOS sends a reclaimed\n * window's size as it answers `open`, which can be heard before the window is mounted; the mount\n * takes it once it is made. Gone when the surface closes, or a window is made on it.\n */\n private readonly earlySizes = new Map<\n number,\n { width: number; height: number; scale?: number | undefined }\n >();\n\n /** The open in flight for each key, so a second open of the key waits for it. */\n private readonly opening = new Map<string, Promise<unknown>>();\n\n /**\n * The quit being decided or finished: `finishing` is set once its `willQuit` handlers run, by its\n * guards agreeing or by a SIGTERM that arrived while they decided.\n */\n private quitting: { finishing: Promise<void> | null } | null = null;\n\n private readonly unsubscribe = this.native?.subscribe((event) => this.hostSaid(event)) ?? null;\n\n /**\n * Start the app on an OS with windows: `component` is the app's root, which the main window\n * renders, and which opens now unless `provideMainWindow({ autoOpen: false })`. What\n * `@ng-native/platform`'s `mount` calls in place of rendering the root on the app's surface,\n * with the `inputs` and `bindings` it was given for the root.\n */\n launch(\n component: Type<unknown>,\n inputs?: Readonly<Record<string, unknown>>,\n bindings?: Binding[],\n ): void {\n this.main = { component, ...(inputs && { inputs }), ...(bindings && { bindings }) };\n const restoring = this.store?.read() ?? [];\n const autoOpen = this.mainOptions.autoOpen !== false;\n if (autoOpen) void this.openMain();\n // The main window opens anyway where it opens by itself.\n void this.reopen(restoring.filter((window) => !autoOpen || window.kind !== 'main'));\n }\n\n /**\n * Open again the windows the app had open when it last stopped: the host keeps them through a\n * reload until their keys are opened again, and closes them otherwise.\n */\n private async reopen(windows: readonly RestoredWindow[]): Promise<void> {\n for (const window of windows) {\n try {\n if (window.kind === 'main') {\n await this.openMain();\n } else if (window.kind === 'route') {\n await this.open({ ...window.options, outlet: window.outlet, path: window.path });\n } else {\n const component = this.restorable.get(window.component);\n if (!component) continue;\n await this.open(component, {\n ...window.options,\n restoreKey: window.key,\n ...(window.inputs && { inputs: window.inputs }),\n });\n }\n } catch (error) {\n console.error('[angular-native] A window could not open again after a reload:', error);\n }\n }\n }\n\n /** Write down which windows open again, in the order they opened. */\n private remember(): void {\n this.store?.write(this.open$().flatMap((open) => (open.restore ? [open.restore] : [])));\n }\n\n /** How a component window opens again, or null where it cannot: no name, or inputs JSON drops. */\n private restoreFor(\n component: Type<unknown>,\n key: string,\n inputs: Readonly<Record<string, unknown>> | undefined,\n options: WindowOptions,\n ): RestoredWindow | null {\n const name = [...this.restorable].find(([, one]) => one === component)?.[0];\n if (name === undefined) {\n console.warn(\n `[angular-native] The window '${key}' will not open again after a reload: name its ` +\n 'component with provideRestorableWindows({ ... }).',\n );\n return null;\n }\n let copied: Readonly<Record<string, unknown>> | undefined;\n try {\n copied = inputs && (JSON.parse(JSON.stringify(inputs)) as Record<string, unknown>);\n } catch {\n console.warn(\n `[angular-native] The window '${key}' will not open again after a reload: its inputs ` +\n 'cannot be written as JSON.',\n );\n return null;\n }\n return { kind: 'component', key, component: name, ...(copied && { inputs: copied }), options };\n }\n\n /**\n * Open the main window, or bring it to the front where it is open. Null where the OS has no\n * windows, or before the app has launched.\n */\n openMain(): Promise<AppWindow | null> {\n return this.reserve('main', async () => {\n const existing = this.byKey('main');\n if (existing) return this.front(existing);\n if (!this.main) return null;\n const { autoOpen: _autoOpen, restoreKey, ...options } = this.mainOptions;\n return this.openWindow(this.main.component, {\n ...options,\n key: 'main',\n frameKey: this.desktop ? restoreKey : undefined,\n inputs: this.main.inputs,\n ...(this.main.bindings && { bindings: this.main.bindings }),\n main: true,\n restore: () => ({ kind: 'main' }),\n });\n });\n }\n\n /**\n * Run `opening` once every open of `key` already in flight has settled, so that it finds the\n * window they opened rather than opening a second one for the key.\n */\n private async reserve<T>(key: string, opening: () => Promise<T>): Promise<T> {\n for (let pending = this.opening.get(key); pending; pending = this.opening.get(key)) {\n await pending.catch(() => undefined);\n }\n const running = opening();\n this.opening.set(key, running);\n try {\n return await running;\n } finally {\n if (this.opening.get(key) === running) this.opening.delete(key);\n }\n }\n\n /**\n * Open a window. With a component, a window rendering it, as many as are asked for. With a\n * route, the window for that outlet, navigated to `path`; the outlet's window is brought to the\n * front and navigated where it is open already, since a route window is one of a kind\n * (Preferences). Resolves null where the OS has no windows, or the host would not open one.\n * Rejects once a quit has passed every window's guards and runs `willQuit`.\n */\n open(component: Type<unknown>, options?: ComponentWindowOptions): Promise<AppWindow | null>;\n open(route: RouteWindowOptions): Promise<AppWindow | null>;\n async open(\n target: Type<unknown> | RouteWindowOptions,\n options: ComponentWindowOptions = {},\n ): Promise<AppWindow | null> {\n if (typeof target === 'function') {\n const { inputs, restoreKey, ...rest } = options;\n const opening = () =>\n this.openWindow(target, {\n ...rest,\n key: restoreKey ?? null,\n ...(inputs && { inputs }),\n restore: () =>\n restoreKey === undefined ? null : this.restoreFor(target, restoreKey, inputs, rest),\n });\n if (restoreKey === undefined) return opening();\n return this.reserve(restoreKey, async () => {\n const existing = this.byKey(restoreKey);\n return existing ? this.front(existing) : opening();\n });\n }\n const { outlet, path, ...rest } = target;\n const navigator = this.navigator;\n if (!navigator) {\n console.error(\n `[angular-native] A route window for '${outlet}' needs the native router: ` +\n 'provideNativeRouter() provides what navigates its outlet.',\n );\n return null;\n }\n const restore: RestoredWindow = { kind: 'route', outlet, path, options: rest };\n return this.reserve(outlet, async () => {\n const existing = this.byKey(outlet);\n if (existing) {\n // A refused navigation leaves the window where it was, and so what it restores to.\n if (await navigator.navigate(outlet, path)) {\n const open = this.find(existing.surface);\n if (open) open.restore = restore;\n this.remember();\n }\n return this.front(existing);\n }\n const window = navigator.window(outlet);\n const opened = await this.openWindow(window.component, {\n ...rest,\n key: outlet,\n outlet,\n providers: window.providers,\n restore: () => restore,\n });\n if (opened) await navigator.navigate(outlet, path);\n return opened;\n });\n }\n\n /**\n * Start quitting the app, as Cmd-Q does: every window's `canClose` guard, then the `willQuit`\n * handlers, then the app quits. One guard that says no keeps the app running. Does nothing where\n * the OS has no windows, since iOS and Android end an app themselves.\n */\n quit(): void {\n this.native?.quit();\n }\n\n private async openWindow(\n component: Type<unknown>,\n options: WindowOptions & {\n key: string | null;\n frameKey?: string | undefined;\n inputs?: Readonly<Record<string, unknown>> | undefined;\n bindings?: Binding[];\n outlet?: string;\n providers?: Provider[];\n main?: boolean;\n /** How the window opens again after a reload, worked out once it has opened. */\n restore?: () => RestoredWindow | null;\n },\n ): Promise<AppWindow | null> {\n const native = this.native;\n const mounter = this.mounter;\n if (!native || !mounter) return null;\n this.refuseWhileQuitting();\n const {\n key,\n frameKey = key,\n inputs,\n bindings,\n outlet,\n providers,\n main,\n autosave,\n title = '',\n restore,\n ...frame\n } = options;\n const surface = await native.open({\n ...frame,\n key: autosave === false ? null : frameKey,\n title,\n });\n if (surface === null) return null;\n const early = this.earlySizes.get(surface);\n this.earlySizes.delete(surface);\n // One the host opened as the quit began goes again.\n if (this.closing) {\n native.close(surface);\n this.refuseWhileQuitting();\n }\n const open = this.track(surface, key, outlet, title);\n open.restore = restore?.() ?? null;\n this.remember();\n this.mountIn(open, mounter, component, { inputs, bindings, providers, main });\n if (early) open.mount?.resize(early);\n return open.handle;\n }\n\n /**\n * Render `component` in the window. Where it throws, the mounter has taken down what it made,\n * and the window goes too, forgotten for a reload, before the error goes on.\n */\n private mountIn(\n open: Open,\n mounter: WindowMounter,\n component: Type<unknown>,\n options: {\n inputs?: Readonly<Record<string, unknown>> | undefined;\n bindings?: Binding[] | undefined;\n providers?: Provider[] | undefined;\n main?: boolean | undefined;\n },\n ): void {\n const { inputs, bindings, providers = [], main } = options;\n try {\n open.mount = mounter.mount(open.handle.surface, component, {\n ...(inputs && { inputs }),\n ...(bindings && { bindings }),\n providers: [{ provide: CURRENT_WINDOW, useValue: open.handle }, ...providers],\n ...(main && { main }),\n });\n } catch (error) {\n this.closeNow(open.handle.surface, true);\n throw error;\n }\n }\n\n /** Make the handle for a window that has opened on `surface`, and list it. */\n private track(\n surface: number,\n key: string | null,\n outlet: string | undefined,\n title: string,\n ): Open {\n const native = this.native!;\n const guards = new Set<CloseGuard>();\n const titleSignal = signal(title);\n let closedNow!: () => void;\n const closed = new Promise<void>((resolve) => (closedNow = resolve));\n const handle: AppWindow = {\n surface,\n key,\n title: titleSignal.asReadonly(),\n setTitle: (next) => {\n titleSignal.set(next);\n native.setTitle(surface, next);\n },\n focused: computed(() => this.focusedSurface() === surface),\n focus: () => native.focus(surface),\n close: () => this.closeAsked(surface),\n canClose: (guard) => {\n guards.add(guard);\n return () => void guards.delete(guard);\n },\n closed,\n };\n const open: Open = {\n handle,\n restore: null,\n guards,\n outlet,\n closedNow,\n mount: null,\n closing: false,\n };\n this.open$.update((all) => [...all, open]);\n return open;\n }\n\n private byKey(key: string): AppWindow | null {\n return this.open$().find((open) => open.handle.key === key)?.handle ?? null;\n }\n\n private front(window: AppWindow): AppWindow {\n window.focus();\n return window;\n }\n\n private find(surface: number): Open | undefined {\n return this.open$().find((open) => open.handle.surface === surface);\n }\n\n private hostSaid(event: NativeWindowEvent): void {\n switch (event.type) {\n case 'focus':\n this.focusedSurface.set(event.surface);\n return;\n case 'resize': {\n const open = this.find(event.surface);\n if (open) open.mount?.resize(event);\n else this.earlySizes.set(event.surface, event);\n return;\n }\n case 'closeRequest':\n void this.closeAsked(event.surface);\n return;\n case 'closed':\n this.earlySizes.delete(event.surface);\n this.closeNow(event.surface, false);\n return;\n case 'quitRequest':\n void this.quitAsked(event.terminate === true);\n return;\n case 'reopen':\n if (!this.open$().length) void this.openMain();\n return;\n case 'newWindow':\n void this.openMain();\n return;\n }\n }\n\n /** Ask a window's guards, and close it if every one agrees. */\n private async closeAsked(surface: number): Promise<boolean> {\n const open = this.find(surface);\n if (!open || open.closing) return false;\n open.closing = true;\n const allowed = await this.guardsAgree(open);\n open.closing = false;\n if (!allowed || !this.find(surface)) return false;\n this.closeNow(surface, true);\n return true;\n }\n\n private async guardsAgree(open: Open): Promise<boolean> {\n for (const guard of [...open.guards]) {\n try {\n if (!(await guard())) return false;\n } catch (error) {\n // A guard that fails keeps the window, rather than losing what it was guarding.\n console.error('[angular-native] A canClose guard failed:', error);\n return false;\n }\n }\n return true;\n }\n\n /**\n * Take a window down: what it renders, its outlet, the host's window where the app is closing\n * it, then the app itself where that was the last window and the app quits with it.\n */\n private closeNow(surface: number, tellHost: boolean): void {\n const open = this.find(surface);\n if (!open) return;\n this.open$.update((all) => all.filter((one) => one !== open));\n if (open.restore) this.remember();\n if (this.focusedSurface() === surface) this.focusedSurface.set(null);\n open.mount?.destroy();\n open.mount = null;\n if (open.outlet) void this.navigator?.clear(open.outlet);\n if (tellHost) this.native?.close(surface);\n open.closedNow();\n if (!this.open$().length && this.lifecycle.quitWhenLastWindowCloses) this.native?.quit();\n }\n\n /**\n * The host asks to quit: every window's guards, in the order the windows opened, then the\n * `willQuit` handlers, then the answer. One guard that says no keeps the app, and every window.\n * A SIGTERM (`terminate`) skips the guards, and one that arrives while a quit's guards decide\n * finishes that quit, whatever they answer.\n */\n private async quitAsked(terminate: boolean): Promise<void> {\n const current = this.quitting;\n if (current) {\n // One quit at a time: its answer is the host's. A SIGTERM no longer waits for its guards.\n if (terminate) current.finishing ??= this.finishQuit();\n return;\n }\n const quit: { finishing: Promise<void> | null } = { finishing: null };\n this.quitting = quit;\n try {\n // A SIGTERM is no one's choice to veto: no guard is asked, so a dialog cannot hold it.\n const agreed = terminate || (await this.everyWindowAgrees());\n if (!agreed && !quit.finishing) {\n this.native?.answerQuit(false);\n return;\n }\n quit.finishing ??= this.finishQuit();\n await quit.finishing;\n } finally {\n this.quitting = null;\n }\n }\n\n /**\n * Ask each window's guards in turn, including a window that opened while an earlier one's guard\n * decided. False at the first that says no.\n */\n private async everyWindowAgrees(): Promise<boolean> {\n const asked = new Set<Open>();\n for (let open = this.unasked(asked); open; open = this.unasked(asked)) {\n asked.add(open);\n if (!(await this.guardsAgree(open))) return false;\n }\n // In the same turn as the last check, so a window the host finishes opening after it is refused.\n this.closing = true;\n return true;\n }\n\n private unasked(asked: ReadonlySet<Open>): Open | undefined {\n return this.open$().find((open) => !asked.has(open));\n }\n\n private async finishQuit(): Promise<void> {\n // From here the app is quitting: a window opened now would have guards no one asks.\n this.closing = true;\n try {\n await this.lifecycle.runWillQuit();\n this.native?.answerQuit(true);\n } catch (error) {\n // Approved and answered, the app stays closed to new windows until it exits. Only a quit\n // that did not get that far lets them open again.\n this.closing = false;\n throw error;\n }\n }\n\n /** Whether a quit has passed its guards and is running `willQuit`: no window opens then. */\n private closing = false;\n\n private refuseWhileQuitting(): void {\n if (this.closing) {\n throw new Error('[angular-native] A window cannot open while the app is quitting.');\n }\n }\n\n /** Stop listening to the host: for a test that makes the service more than once. */\n ngOnDestroy(): void {\n this.unsubscribe?.();\n }\n}\n"]}
1
+ {"version":3,"file":"app-windows.js","sourceRoot":"","sources":["../src/app-windows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,cAAc,EACd,OAAO,EACP,QAAQ,EACR,MAAM,EACN,wBAAwB,EACxB,MAAM,GAMP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,WAAW,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on macOS and scenes on iPadOS.\n *\n * Every window is a root view on its own native surface, joined to the one app: root services, the\n * one Router and one change detection are shared, and each window has an element injector that\n * provides `CURRENT_WINDOW`. A route window renders a named outlet of the app's Router, which\n * `WINDOW_NAVIGATOR` navigates; a component window renders a component with its inputs.\n * `@ng-native/platform` mounts each through `WINDOW_MOUNTER`.\n *\n * On iPhone and Android `available()` is false and `open` resolves to null, as an inert call does.\n *\n * The host contract is `NativeWindows`, below: the host opens and closes surfaces when asked, and\n * reports what the user does to them. The rules (guards, the last window, a Dock reopen, quitting)\n * are here, so every OS that has windows follows the same ones.\n */\nimport {\n InjectionToken,\n Service,\n computed,\n inject,\n makeEnvironmentProviders,\n signal,\n type Binding,\n type EnvironmentProviders,\n type Provider,\n type Signal,\n type Type,\n} from '@angular/core';\nimport { AppLifecycle } from './app-lifecycle.ts';\nimport { injectOs, isDesktopOs } from './os.ts';\nimport { reactNative } from './react-native.ts';\nimport { WINDOW_NAVIGATOR } from './window-navigator.ts';\nimport { RESTORABLE_WINDOWS, WINDOW_RESTORE_STORE, type RestoredWindow } from './window-restore.ts';\n\nexport type TitleBar = 'default' | 'transparent' | 'hidden';\n\n/** How a window opens. Sizes are in points; each left out is the host's default. */\nexport interface WindowOptions {\n readonly title?: string;\n readonly width?: number;\n readonly height?: number;\n readonly minWidth?: number;\n readonly minHeight?: number;\n readonly maxWidth?: number;\n readonly maxHeight?: number;\n readonly resizable?: boolean;\n /** `transparent` draws content under the title bar; `hidden` also hides the title. */\n readonly titleBar?: TitleBar;\n /**\n * macOS: where the window controls (close, minimise and zoom) go, as the close button's top-left\n * in points from the window's top-left, with the others beside it, as Electron's option of the\n * same name places them. The title bar grows to hold them. Ignored on Linux and iPadOS.\n */\n readonly trafficLightPosition?: { readonly x: number; readonly y: number };\n readonly fullScreen?: boolean;\n /**\n * Whether the window's frame is saved and restored on the next launch. On by default for the\n * main window, route windows and component windows with a `restoreKey`.\n */\n readonly autosave?: boolean;\n}\n\n/** A window rendering a component. */\nexport interface ComponentWindowOptions extends WindowOptions {\n /** Set on the component before its first change detection. */\n readonly inputs?: Readonly<Record<string, unknown>>;\n /**\n * What the window is restored by, after a reload or a relaunch: on macOS and iPadOS it opens\n * again with the same `inputs`, which must then survive `JSON.stringify`, where\n * `provideRestorableWindows` names its component. Without one, a reload closes the window. One key is one window: opening\n * a key that is open brings that window to the front.\n */\n readonly restoreKey?: string;\n}\n\n/** A window rendering the named outlet `outlet` of the app's Router, at `path`. */\nexport interface RouteWindowOptions extends WindowOptions {\n readonly outlet: string;\n readonly path: string;\n}\n\n/** The main window's options, as `provideMainWindow` takes them. */\nexport interface MainWindowOptions extends WindowOptions {\n /**\n * The main window's saved frame key on macOS and Linux. Defaults to `main`. Use a key distinct\n * from the app's other windows, and change it to start with a fresh frame on the next launch.\n */\n readonly restoreKey?: string;\n /**\n * Whether the main window opens at launch. True by default; false for an app that lives in the\n * menu bar or the tray, which opens it with `AppWindows.openMain()`.\n */\n readonly autoOpen?: boolean;\n}\n\n/** One open window. */\nexport interface AppWindow {\n /** The surface the window renders on. */\n readonly surface: number;\n /** `main`, the outlet's name for a route window, or the `restoreKey`; null otherwise. */\n readonly key: string | null;\n readonly title: Signal<string>;\n setTitle(title: string): void;\n /** Whether it is the key window. */\n readonly focused: Signal<boolean>;\n focus(): void;\n /** Close it, as the user would: every `canClose` guard is asked first. Resolves whether it closed. */\n close(): Promise<boolean>;\n /**\n * Ask `guard` before the window closes, by the user or by `close()`, and before the app quits.\n * Answers the function that removes it; a component removes its guard as it is destroyed.\n */\n canClose(guard: CloseGuard): () => void;\n /** Settles when the window has closed. */\n readonly closed: Promise<void>;\n}\n\nexport type CloseGuard = () => boolean | Promise<boolean>;\n\n/**\n * What the host is asked to open. `key` is what the frame autosaves under, or null for none.\n */\nexport interface NativeWindowRequest extends Omit<WindowOptions, 'title' | 'autosave'> {\n readonly key: string | null;\n readonly title: string;\n}\n\n/**\n * What the host tells the app. A `resize` for a surface `open` has not resolved to a mounted window\n * yet is kept for the window made on it. The host never closes a window or quits on its own: it sends\n * `closeRequest` for the close button and Cmd-W, and `quitRequest` for Cmd-Q, a logout or an\n * update's relaunch, and waits for `close` or `answerQuit`. `closed` reports a window the OS\n * closed itself (an iPadOS scene swiped away), which no guard can keep.\n */\nexport type NativeWindowEvent =\n | { readonly type: 'focus'; readonly surface: number | null }\n | {\n readonly type: 'resize';\n readonly surface: number;\n readonly width: number;\n readonly height: number;\n readonly scale?: number;\n }\n | { readonly type: 'closeRequest'; readonly surface: number }\n | { readonly type: 'closed'; readonly surface: number }\n /**\n * Cmd-Q, a logout or an update's relaunch. `terminate` is a SIGTERM: run only the `willQuit`\n * handlers, ask no `canClose` guard, and answer true. The host ends after two seconds anyway.\n */\n | { readonly type: 'quitRequest'; readonly terminate?: boolean }\n /** A Dock click, or the app opened again, with no window visible. */\n | { readonly type: 'reopen' }\n /**\n * iPadOS: a window the user made from the system (New Window, or the app opened again with none\n * open). The app opens the main window in it, or brings the main window forward, and the host\n * then closes the window the user made.\n */\n | { readonly type: 'newWindow' };\n\n/**\n * The host's windows: the desktop host on macOS, and on iPadOS the components pod, whose windows\n * are scenes. iPadOS asks no app before it closes a scene, so it sends `closed` and never\n * `closeRequest`, and it has no quitting, so never `quitRequest`. The module is\n * `NgNativeWindows`, whose constant `multipleWindows` says whether the OS has windows at all,\n * and whose events arrive as `ngNativeWindows` on `DeviceEventEmitter`.\n */\nexport interface NativeWindows {\n /**\n * Open a window with its own surface, shown when the surface's first frame commits so it never\n * shows at the wrong size. Resolves the surface's id, or null where the host would not.\n */\n open(request: NativeWindowRequest): Promise<number | null>;\n /** Close the window on `surface` and stop its surface. */\n close(surface: number): void;\n focus(surface: number): void;\n setTitle(surface: number, title: string): void;\n /** Start quitting, as Cmd-Q does: the host answers with a `quitRequest`. */\n quit(): void;\n /** Answer a `quitRequest`: true quits, after which the host tears the runtime down in order. */\n answerQuit(proceed: boolean): void;\n subscribe(listener: (event: NativeWindowEvent) => void): () => void;\n}\n\ninterface WindowsTurboModule {\n getConstants?(): { multipleWindows?: boolean };\n open?(request: NativeWindowRequest): Promise<number | null>;\n close?(surface: number): void;\n focus?(surface: number): void;\n setTitle?(surface: number, title: string): void;\n quit?(): void;\n answerQuit?(proceed: boolean): void;\n}\n\n/**\n * The runnable each window's surface runs on an iPad, where the host makes the surface through\n * React Native's own host: it renders nothing, as the window's root is mounted from the app.\n */\nconst WINDOW_RUNNABLE = 'NgNativeWindow';\n\n/**\n * The host's module, or null where the OS has one window: phones, Android, Expo Go, an older\n * host. Registers the windows' runnable where there is one.\n */\nexport function windowsSource(): NativeWindows | null {\n const native = reactNative();\n const module = native?.TurboModuleRegistry?.get?.('NgNativeWindows') as\n WindowsTurboModule | null | undefined;\n if (!module?.getConstants?.().multipleWindows) return null;\n native?.AppRegistry?.registerRunnable(WINDOW_RUNNABLE, () => {});\n return {\n open: async (request) => (await module.open?.(request)) ?? null,\n close: (surface) => module.close?.(surface),\n focus: (surface) => module.focus?.(surface),\n setTitle: (surface, title) => module.setTitle?.(surface, title),\n quit: () => module.quit?.(),\n answerQuit: (proceed) => module.answerQuit?.(proceed),\n subscribe: (listener) => {\n const subscription = native?.DeviceEventEmitter?.addListener('ngNativeWindows', (event) =>\n listener(event as NativeWindowEvent),\n );\n return () => subscription?.remove();\n },\n };\n}\n\n/** One window's mount, as `WINDOW_MOUNTER` answers it. */\nexport interface WindowMount {\n /** Tell the window's engine its new size, which its media queries resolve against. */\n resize(size: { width: number; height: number; scale?: number }): void;\n /** Destroy what the window renders, and stop its engine taking events. */\n destroy(): void;\n}\n\n/**\n * How a window's root is rendered on its surface. `@ng-native/platform` provides it: the\n * component is created in the app's environment injector, under an element injector with the\n * window's renderer, engine and `providers` (which hold `CURRENT_WINDOW`), and attached to the\n * app's one change detection. `main` is the app's root component, which the app's bootstrap\n * listeners (the Router's initial navigation) are told of the first time it mounts.\n */\nexport interface WindowMounter {\n mount(\n surface: number,\n component: Type<unknown>,\n options: {\n readonly inputs?: Readonly<Record<string, unknown>>;\n /** The main window's: what `mount` was given for the root component. */\n readonly bindings?: Binding[];\n readonly providers: Provider[];\n readonly main?: boolean;\n },\n ): WindowMount;\n}\n\n/** The platform's `WindowMounter`, or null where nothing can mount a window: a test with none. */\nexport const WINDOW_MOUNTER = new InjectionToken<WindowMounter | null>(\n 'angular-native.windowMounter',\n { factory: () => null },\n);\n\n/** The window a component is rendered in, or null outside one: every app with one surface. */\nexport const CURRENT_WINDOW = new InjectionToken<AppWindow | null>('angular-native.currentWindow', {\n factory: () => null,\n});\n\n/** What `provideMainWindow` was given. */\nexport const MAIN_WINDOW_OPTIONS = new InjectionToken<MainWindowOptions>(\n 'angular-native.mainWindowOptions',\n { factory: () => ({}) },\n);\n\n/**\n * Configure the main window, which renders the app's root component: its size and title bar, and\n * with `autoOpen: false` that the app starts with no window. Where the OS has one window, only\n * `autoOpen` is read, and it is ignored there: the app's one surface is its window.\n */\nexport function provideMainWindow(options: MainWindowOptions): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: MAIN_WINDOW_OPTIONS, useValue: options }]);\n}\n\n/** An open window and what it needs to close. */\ninterface Open {\n readonly handle: AppWindow;\n /** How it opens again after a reload, or null where it does not. */\n restore: RestoredWindow | null;\n readonly guards: Set<CloseGuard>;\n readonly outlet: string | undefined;\n readonly closedNow: () => void;\n mount: WindowMount | null;\n closing: boolean;\n}\n\n@Service()\nexport class AppWindows {\n /** Overridden in a test with a fake host. */\n static readonly SOURCE = new InjectionToken<NativeWindows | null>(\n 'angular-native.windowsSource',\n { factory: windowsSource },\n );\n\n private readonly native = inject(AppWindows.SOURCE);\n private readonly mounter = inject(WINDOW_MOUNTER);\n private readonly navigator = inject(WINDOW_NAVIGATOR);\n private readonly lifecycle = inject(AppLifecycle);\n private readonly mainOptions = inject(MAIN_WINDOW_OPTIONS);\n private readonly desktop = isDesktopOs(injectOs());\n private readonly store = inject(WINDOW_RESTORE_STORE);\n private readonly restorable = new Map(\n (inject(RESTORABLE_WINDOWS, { optional: true }) ?? []).flatMap((components) =>\n Object.entries(components),\n ),\n );\n\n /**\n * Whether the OS has windows the app can open: macOS, and iPadOS with the components pod and the\n * config plugin's `ios.multipleWindows`.\n */\n readonly available: Signal<boolean> = signal(this.native !== null).asReadonly();\n\n private readonly open$ = signal<readonly Open[]>([]);\n private readonly focusedSurface = signal<number | null>(null);\n\n /** Every open window, in the order they opened. */\n readonly windows: Signal<readonly AppWindow[]> = computed(() =>\n this.open$().map((open) => open.handle),\n );\n\n /** The key window, or null when none is: the app is in the background, or has no window. */\n readonly focused: Signal<AppWindow | null> = computed(\n () => this.windows().find((one) => one.surface === this.focusedSurface()) ?? null,\n );\n\n private main: {\n component: Type<unknown>;\n inputs?: Readonly<Record<string, unknown>>;\n bindings?: Binding[];\n } | null = null;\n\n /**\n * The last size the host sent for a surface no window is on yet. iPadOS sends a reclaimed\n * window's size as it answers `open`, which can be heard before the window is mounted; the mount\n * takes it once it is made. Gone when the surface closes, or a window is made on it.\n */\n private readonly earlySizes = new Map<\n number,\n { width: number; height: number; scale?: number | undefined }\n >();\n\n /** The open in flight for each key, so a second open of the key waits for it. */\n private readonly opening = new Map<string, Promise<unknown>>();\n\n /**\n * The quit being decided or finished: `finishing` is set once its `willQuit` handlers run, by its\n * guards agreeing or by a SIGTERM that arrived while they decided.\n */\n private quitting: { finishing: Promise<void> | null } | null = null;\n\n private readonly unsubscribe = this.native?.subscribe((event) => this.hostSaid(event)) ?? null;\n\n /**\n * Start the app on an OS with windows: `component` is the app's root, which the main window\n * renders, and which opens now unless `provideMainWindow({ autoOpen: false })`. What\n * `@ng-native/platform`'s `mount` calls in place of rendering the root on the app's surface,\n * with the `inputs` and `bindings` it was given for the root.\n */\n launch(\n component: Type<unknown>,\n inputs?: Readonly<Record<string, unknown>>,\n bindings?: Binding[],\n ): void {\n this.main = { component, ...(inputs && { inputs }), ...(bindings && { bindings }) };\n const restoring = this.store?.read() ?? [];\n const autoOpen = this.mainOptions.autoOpen !== false;\n if (autoOpen) void this.openMain();\n // The main window opens anyway where it opens by itself.\n void this.reopen(restoring.filter((window) => !autoOpen || window.kind !== 'main'));\n }\n\n /**\n * Open again the windows the app had open when it last stopped: the host keeps them through a\n * reload until their keys are opened again, and closes them otherwise.\n */\n private async reopen(windows: readonly RestoredWindow[]): Promise<void> {\n for (const window of windows) {\n try {\n if (window.kind === 'main') {\n await this.openMain();\n } else if (window.kind === 'route') {\n await this.open({ ...window.options, outlet: window.outlet, path: window.path });\n } else {\n const component = this.restorable.get(window.component);\n if (!component) continue;\n await this.open(component, {\n ...window.options,\n restoreKey: window.key,\n ...(window.inputs && { inputs: window.inputs }),\n });\n }\n } catch (error) {\n console.error('[angular-native] A window could not open again after a reload:', error);\n }\n }\n }\n\n /** Write down which windows open again, in the order they opened. */\n private remember(): void {\n this.store?.write(this.open$().flatMap((open) => (open.restore ? [open.restore] : [])));\n }\n\n /** How a component window opens again, or null where it cannot: no name, or inputs JSON drops. */\n private restoreFor(\n component: Type<unknown>,\n key: string,\n inputs: Readonly<Record<string, unknown>> | undefined,\n options: WindowOptions,\n ): RestoredWindow | null {\n const name = [...this.restorable].find(([, one]) => one === component)?.[0];\n if (name === undefined) {\n console.warn(\n `[angular-native] The window '${key}' will not open again after a reload: name its ` +\n 'component with provideRestorableWindows({ ... }).',\n );\n return null;\n }\n let copied: Readonly<Record<string, unknown>> | undefined;\n try {\n copied = inputs && (JSON.parse(JSON.stringify(inputs)) as Record<string, unknown>);\n } catch {\n console.warn(\n `[angular-native] The window '${key}' will not open again after a reload: its inputs ` +\n 'cannot be written as JSON.',\n );\n return null;\n }\n return { kind: 'component', key, component: name, ...(copied && { inputs: copied }), options };\n }\n\n /**\n * Open the main window, or bring it to the front where it is open. Null where the OS has no\n * windows, or before the app has launched.\n */\n openMain(): Promise<AppWindow | null> {\n return this.reserve('main', async () => {\n const existing = this.byKey('main');\n if (existing) return this.front(existing);\n if (!this.main) return null;\n const { autoOpen: _autoOpen, restoreKey, ...options } = this.mainOptions;\n return this.openWindow(this.main.component, {\n ...options,\n key: 'main',\n frameKey: this.desktop ? restoreKey : undefined,\n inputs: this.main.inputs,\n ...(this.main.bindings && { bindings: this.main.bindings }),\n main: true,\n restore: () => ({ kind: 'main' }),\n });\n });\n }\n\n /**\n * Run `opening` once every open of `key` already in flight has settled, so that it finds the\n * window they opened rather than opening a second one for the key.\n */\n private async reserve<T>(key: string, opening: () => Promise<T>): Promise<T> {\n for (let pending = this.opening.get(key); pending; pending = this.opening.get(key)) {\n await pending.catch(() => undefined);\n }\n const running = opening();\n this.opening.set(key, running);\n try {\n return await running;\n } finally {\n if (this.opening.get(key) === running) this.opening.delete(key);\n }\n }\n\n /**\n * Open a window. With a component, a window rendering it, as many as are asked for. With a\n * route, the window for that outlet, navigated to `path`; the outlet's window is brought to the\n * front and navigated where it is open already, since a route window is one of a kind\n * (Preferences). Resolves null where the OS has no windows, or the host would not open one.\n * Rejects once a quit has passed every window's guards and runs `willQuit`.\n */\n open(component: Type<unknown>, options?: ComponentWindowOptions): Promise<AppWindow | null>;\n open(route: RouteWindowOptions): Promise<AppWindow | null>;\n async open(\n target: Type<unknown> | RouteWindowOptions,\n options: ComponentWindowOptions = {},\n ): Promise<AppWindow | null> {\n if (typeof target === 'function') {\n const { inputs, restoreKey, ...rest } = options;\n const opening = () =>\n this.openWindow(target, {\n ...rest,\n key: restoreKey ?? null,\n ...(inputs && { inputs }),\n restore: () =>\n restoreKey === undefined ? null : this.restoreFor(target, restoreKey, inputs, rest),\n });\n if (restoreKey === undefined) return opening();\n return this.reserve(restoreKey, async () => {\n const existing = this.byKey(restoreKey);\n return existing ? this.front(existing) : opening();\n });\n }\n const { outlet, path, ...rest } = target;\n const navigator = this.navigator;\n if (!navigator) {\n console.error(\n `[angular-native] A route window for '${outlet}' needs the native router: ` +\n 'provideNativeRouter() provides what navigates its outlet.',\n );\n return null;\n }\n const restore: RestoredWindow = { kind: 'route', outlet, path, options: rest };\n return this.reserve(outlet, async () => {\n const existing = this.byKey(outlet);\n if (existing) {\n // A refused navigation leaves the window where it was, and so what it restores to.\n if (await navigator.navigate(outlet, path)) {\n const open = this.find(existing.surface);\n if (open) open.restore = restore;\n this.remember();\n }\n return this.front(existing);\n }\n const window = navigator.window(outlet);\n const opened = await this.openWindow(window.component, {\n ...rest,\n key: outlet,\n outlet,\n providers: window.providers,\n restore: () => restore,\n });\n if (opened) await navigator.navigate(outlet, path);\n return opened;\n });\n }\n\n /**\n * Start quitting the app, as Cmd-Q does: every window's `canClose` guard, then the `willQuit`\n * handlers, then the app quits. One guard that says no keeps the app running. Does nothing where\n * the OS has no windows, since iOS and Android end an app themselves.\n */\n quit(): void {\n this.native?.quit();\n }\n\n private async openWindow(\n component: Type<unknown>,\n options: WindowOptions & {\n key: string | null;\n frameKey?: string | undefined;\n inputs?: Readonly<Record<string, unknown>> | undefined;\n bindings?: Binding[];\n outlet?: string;\n providers?: Provider[];\n main?: boolean;\n /** How the window opens again after a reload, worked out once it has opened. */\n restore?: () => RestoredWindow | null;\n },\n ): Promise<AppWindow | null> {\n const native = this.native;\n const mounter = this.mounter;\n if (!native || !mounter) return null;\n this.refuseWhileQuitting();\n const {\n key,\n frameKey = key,\n inputs,\n bindings,\n outlet,\n providers,\n main,\n autosave,\n title = '',\n restore,\n ...frame\n } = options;\n const surface = await native.open({\n ...frame,\n key: autosave === false ? null : frameKey,\n title,\n });\n if (surface === null) return null;\n const early = this.earlySizes.get(surface);\n this.earlySizes.delete(surface);\n // One the host opened as the quit began goes again.\n if (this.closing) {\n native.close(surface);\n this.refuseWhileQuitting();\n }\n const open = this.track(surface, key, outlet, title);\n open.restore = restore?.() ?? null;\n this.remember();\n this.mountIn(open, mounter, component, { inputs, bindings, providers, main });\n if (early) open.mount?.resize(early);\n return open.handle;\n }\n\n /**\n * Render `component` in the window. Where it throws, the mounter has taken down what it made,\n * and the window goes too, forgotten for a reload, before the error goes on.\n */\n private mountIn(\n open: Open,\n mounter: WindowMounter,\n component: Type<unknown>,\n options: {\n inputs?: Readonly<Record<string, unknown>> | undefined;\n bindings?: Binding[] | undefined;\n providers?: Provider[] | undefined;\n main?: boolean | undefined;\n },\n ): void {\n const { inputs, bindings, providers = [], main } = options;\n try {\n open.mount = mounter.mount(open.handle.surface, component, {\n ...(inputs && { inputs }),\n ...(bindings && { bindings }),\n providers: [{ provide: CURRENT_WINDOW, useValue: open.handle }, ...providers],\n ...(main && { main }),\n });\n } catch (error) {\n this.closeNow(open.handle.surface, true);\n throw error;\n }\n }\n\n /** Make the handle for a window that has opened on `surface`, and list it. */\n private track(\n surface: number,\n key: string | null,\n outlet: string | undefined,\n title: string,\n ): Open {\n const native = this.native!;\n const guards = new Set<CloseGuard>();\n const titleSignal = signal(title);\n let closedNow!: () => void;\n const closed = new Promise<void>((resolve) => (closedNow = resolve));\n const handle: AppWindow = {\n surface,\n key,\n title: titleSignal.asReadonly(),\n setTitle: (next) => {\n titleSignal.set(next);\n native.setTitle(surface, next);\n },\n focused: computed(() => this.focusedSurface() === surface),\n focus: () => native.focus(surface),\n close: () => this.closeAsked(surface),\n canClose: (guard) => {\n guards.add(guard);\n return () => void guards.delete(guard);\n },\n closed,\n };\n const open: Open = {\n handle,\n restore: null,\n guards,\n outlet,\n closedNow,\n mount: null,\n closing: false,\n };\n this.open$.update((all) => [...all, open]);\n return open;\n }\n\n private byKey(key: string): AppWindow | null {\n return this.open$().find((open) => open.handle.key === key)?.handle ?? null;\n }\n\n private front(window: AppWindow): AppWindow {\n window.focus();\n return window;\n }\n\n private find(surface: number): Open | undefined {\n return this.open$().find((open) => open.handle.surface === surface);\n }\n\n private hostSaid(event: NativeWindowEvent): void {\n switch (event.type) {\n case 'focus':\n this.focusedSurface.set(event.surface);\n return;\n case 'resize': {\n const open = this.find(event.surface);\n if (open) open.mount?.resize(event);\n else this.earlySizes.set(event.surface, event);\n return;\n }\n case 'closeRequest':\n void this.closeAsked(event.surface);\n return;\n case 'closed':\n this.earlySizes.delete(event.surface);\n this.closeNow(event.surface, false);\n return;\n case 'quitRequest':\n void this.quitAsked(event.terminate === true);\n return;\n case 'reopen':\n if (!this.open$().length) void this.openMain();\n return;\n case 'newWindow':\n void this.openMain();\n return;\n }\n }\n\n /** Ask a window's guards, and close it if every one agrees. */\n private async closeAsked(surface: number): Promise<boolean> {\n const open = this.find(surface);\n if (!open || open.closing) return false;\n open.closing = true;\n const allowed = await this.guardsAgree(open);\n open.closing = false;\n if (!allowed || !this.find(surface)) return false;\n this.closeNow(surface, true);\n return true;\n }\n\n private async guardsAgree(open: Open): Promise<boolean> {\n for (const guard of [...open.guards]) {\n try {\n if (!(await guard())) return false;\n } catch (error) {\n // A guard that fails keeps the window, rather than losing what it was guarding.\n console.error('[angular-native] A canClose guard failed:', error);\n return false;\n }\n }\n return true;\n }\n\n /**\n * Take a window down: what it renders, its outlet, the host's window where the app is closing\n * it, then the app itself where that was the last window and the app quits with it.\n */\n private closeNow(surface: number, tellHost: boolean): void {\n const open = this.find(surface);\n if (!open) return;\n this.open$.update((all) => all.filter((one) => one !== open));\n if (open.restore) this.remember();\n if (this.focusedSurface() === surface) this.focusedSurface.set(null);\n open.mount?.destroy();\n open.mount = null;\n if (open.outlet) void this.navigator?.clear(open.outlet);\n if (tellHost) this.native?.close(surface);\n open.closedNow();\n if (!this.open$().length && this.lifecycle.quitWhenLastWindowCloses) this.native?.quit();\n }\n\n /**\n * The host asks to quit: every window's guards, in the order the windows opened, then the\n * `willQuit` handlers, then the answer. One guard that says no keeps the app, and every window.\n * A SIGTERM (`terminate`) skips the guards, and one that arrives while a quit's guards decide\n * finishes that quit, whatever they answer.\n */\n private async quitAsked(terminate: boolean): Promise<void> {\n const current = this.quitting;\n if (current) {\n // One quit at a time: its answer is the host's. A SIGTERM no longer waits for its guards.\n if (terminate) current.finishing ??= this.finishQuit();\n return;\n }\n const quit: { finishing: Promise<void> | null } = { finishing: null };\n this.quitting = quit;\n try {\n // A SIGTERM is no one's choice to veto: no guard is asked, so a dialog cannot hold it.\n const agreed = terminate || (await this.everyWindowAgrees());\n if (!agreed && !quit.finishing) {\n this.native?.answerQuit(false);\n return;\n }\n quit.finishing ??= this.finishQuit();\n await quit.finishing;\n } finally {\n this.quitting = null;\n }\n }\n\n /**\n * Ask each window's guards in turn, including a window that opened while an earlier one's guard\n * decided. False at the first that says no.\n */\n private async everyWindowAgrees(): Promise<boolean> {\n const asked = new Set<Open>();\n for (let open = this.unasked(asked); open; open = this.unasked(asked)) {\n asked.add(open);\n if (!(await this.guardsAgree(open))) return false;\n }\n // In the same turn as the last check, so a window the host finishes opening after it is refused.\n this.closing = true;\n return true;\n }\n\n private unasked(asked: ReadonlySet<Open>): Open | undefined {\n return this.open$().find((open) => !asked.has(open));\n }\n\n private async finishQuit(): Promise<void> {\n // From here the app is quitting: a window opened now would have guards no one asks.\n this.closing = true;\n try {\n await this.lifecycle.runWillQuit();\n this.native?.answerQuit(true);\n } catch (error) {\n // Approved and answered, the app stays closed to new windows until it exits. Only a quit\n // that did not get that far lets them open again.\n this.closing = false;\n throw error;\n }\n }\n\n /** Whether a quit has passed its guards and is running `willQuit`: no window opens then. */\n private closing = false;\n\n private refuseWhileQuitting(): void {\n if (this.closing) {\n throw new Error('[angular-native] A window cannot open while the app is quitting.');\n }\n }\n\n /** Stop listening to the host: for a test that makes the service more than once. */\n ngOnDestroy(): void {\n this.unsubscribe?.();\n }\n}\n"]}
@@ -85,10 +85,10 @@ export class ColorScheme {
85
85
  constructor() {
86
86
  inject(DestroyRef).onDestroy(this.source.subscribe((scheme) => this.scheme.set(scheme)));
87
87
  }
88
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ColorScheme, deps: [], target: i0.ɵɵFactoryTarget.Service });
89
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: ColorScheme });
88
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: ColorScheme, deps: [], target: i0.ɵɵFactoryTarget.Service });
89
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: ColorScheme });
90
90
  }
91
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: ColorScheme, decorators: [{
91
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: ColorScheme, decorators: [{
92
92
  type: Service
93
93
  }], ctorParameters: () => [] });
94
94
  //# sourceMappingURL=color-scheme.js.map
@@ -174,10 +174,10 @@ export class DeepLinks {
174
174
  openSettings() {
175
175
  this.source.openSettings?.();
176
176
  }
177
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DeepLinks, deps: [], target: i0.ɵɵFactoryTarget.Service });
178
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: DeepLinks });
177
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: DeepLinks, deps: [], target: i0.ɵɵFactoryTarget.Service });
178
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: DeepLinks });
179
179
  }
180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DeepLinks, decorators: [{
180
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: DeepLinks, decorators: [{
181
181
  type: Service
182
182
  }], ctorParameters: () => [] });
183
183
  //# sourceMappingURL=deep-links.js.map
package/dist/dev-menu.js CHANGED
@@ -69,10 +69,10 @@ export class DevMenu {
69
69
  reload(reason = 'requested by the app') {
70
70
  this.source.menu?.reload(reason);
71
71
  }
72
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DevMenu, deps: [], target: i0.ɵɵFactoryTarget.Service });
73
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: DevMenu });
72
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: DevMenu, deps: [], target: i0.ɵɵFactoryTarget.Service });
73
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: DevMenu });
74
74
  }
75
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DevMenu, decorators: [{
75
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: DevMenu, decorators: [{
76
76
  type: Service
77
77
  }] });
78
78
  //# sourceMappingURL=dev-menu.js.map
package/dist/dialogs.js CHANGED
@@ -140,10 +140,10 @@ export class Dialogs {
140
140
  notify(message, options = {}) {
141
141
  this.native?.toast?.(message, options.long ?? false);
142
142
  }
143
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Dialogs, deps: [], target: i0.ɵɵFactoryTarget.Service });
144
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: Dialogs });
143
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Dialogs, deps: [], target: i0.ɵɵFactoryTarget.Service });
144
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: Dialogs });
145
145
  }
146
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Dialogs, decorators: [{
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Dialogs, decorators: [{
147
147
  type: Service
148
148
  }] });
149
149
  /**
package/dist/direction.js CHANGED
@@ -50,10 +50,10 @@ export class Direction {
50
50
  constructor() {
51
51
  inject(DestroyRef).onDestroy(this.source.subscribe((direction) => this.direction.set(direction)));
52
52
  }
53
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Direction, deps: [], target: i0.ɵɵFactoryTarget.Service });
54
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: Direction });
53
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Direction, deps: [], target: i0.ɵɵFactoryTarget.Service });
54
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: Direction });
55
55
  }
56
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Direction, decorators: [{
56
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Direction, decorators: [{
57
57
  type: Service
58
58
  }], ctorParameters: () => [] });
59
59
  //# sourceMappingURL=direction.js.map
package/dist/dock.js CHANGED
@@ -64,10 +64,10 @@ export class Dock {
64
64
  ngOnDestroy() {
65
65
  this.unsubscribe?.();
66
66
  }
67
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Dock, deps: [], target: i0.ɵɵFactoryTarget.Service });
68
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: Dock });
67
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Dock, deps: [], target: i0.ɵɵFactoryTarget.Service });
68
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: Dock });
69
69
  }
70
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Dock, decorators: [{
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Dock, decorators: [{
71
71
  type: Service
72
72
  }] });
73
73
  //# sourceMappingURL=dock.js.map
@@ -65,10 +65,10 @@ export class DragAndDrop {
65
65
  ngOnDestroy() {
66
66
  this.unsubscribe?.();
67
67
  }
68
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DragAndDrop, deps: [], target: i0.ɵɵFactoryTarget.Service });
69
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: DragAndDrop });
68
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: DragAndDrop, deps: [], target: i0.ɵɵFactoryTarget.Service });
69
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: DragAndDrop });
70
70
  }
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: DragAndDrop, decorators: [{
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: DragAndDrop, decorators: [{
72
72
  type: Service
73
73
  }] });
74
74
  //# sourceMappingURL=drag-and-drop.js.map
@@ -41,10 +41,10 @@ export class HardwareBack {
41
41
  const inFront = callerInFront();
42
42
  return this.source.subscribe(() => (inFront?.() ?? true) && handler());
43
43
  }
44
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: HardwareBack, deps: [], target: i0.ɵɵFactoryTarget.Service });
45
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: HardwareBack });
44
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: HardwareBack, deps: [], target: i0.ɵɵFactoryTarget.Service });
45
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: HardwareBack });
46
46
  }
47
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: HardwareBack, decorators: [{
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: HardwareBack, decorators: [{
48
48
  type: Service
49
49
  }] });
50
50
  /** Whether the screen the caller is on is in front, or null where nothing says: outside an injection context, or one with no screen. */
package/dist/index.d.ts CHANGED
@@ -40,6 +40,7 @@ export { macosPermissions, type ExpoPermissionConfig, type MacosPermissions, } f
40
40
  export { Menus, menuActionId, menusSource, serializeMenu, type NativeMenuEntry, type NativeMenuEvent, type NativeMenus, type NativeWindowHistory, type NativeShortcut, type SerializedMenu, } from './menus.ts';
41
41
  export { Dock, type NativeDock } from './dock.ts';
42
42
  export { nativeSplitViews } from './split-views.ts';
43
+ export { KEYBOARD_FOCUS, reportKeyboardFocusable } from './keyboard-focus.ts';
43
44
  export { DragAndDrop, dragAndDropSource, type NativeDragAndDrop, type NativeDragItem, type NativeDropEvent, } from './drag-and-drop.ts';
44
45
  export { UndoStack, type NativeUndo, type NativeUndoEvent, type UndoAction } from './undo-stack.ts';
45
46
  export { OS_SUPPORT, SUPPORT_OSES, platformsLine, supportRowOf, type OsSupportRow, type SupportOs, } from './os-support.ts';
package/dist/index.js CHANGED
@@ -39,6 +39,7 @@ export { macosPermissions, } from "./desktop-permissions.js";
39
39
  export { Menus, menuActionId, menusSource, serializeMenu, } from "./menus.js";
40
40
  export { Dock } from "./dock.js";
41
41
  export { nativeSplitViews } from "./split-views.js";
42
+ export { KEYBOARD_FOCUS, reportKeyboardFocusable } from "./keyboard-focus.js";
42
43
  export { DragAndDrop, dragAndDropSource, } from "./drag-and-drop.js";
43
44
  export { UndoStack } from "./undo-stack.js";
44
45
  export { OS_SUPPORT, SUPPORT_OSES, platformsLine, supportRowOf, } from "./os-support.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAuC,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAuC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAuB,MAAM,iBAAiB,CAAC;AACzF,OAAO,EACL,SAAS,GAIV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,GAGlB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAA0C,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,OAAO,EAAmC,MAAM,cAAc,CAAC;AACxE,OAAO,EACL,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAyC,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAwB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAA2B,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EACL,eAAe,EACf,QAAQ,EACR,cAAc,GAIf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,QAAQ,EAA2B,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,EAA4C,MAAM,aAAa,CAAC;AAC9F,OAAO,EACL,SAAS,EACT,eAAe,GAKhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,cAAc,GAEf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,m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B,CAAC;AACpG,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,YAAY,GAGb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,EAAoB,MAAM,YAAY,CAAC;AACrD,OAAO,EACL,IAAI,GAKL,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAwB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EACL,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EAajB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,GAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAA2B,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAoB,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAwB,MAAM,wBAAwB,CAAC;AACjF,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GAGzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAqB,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,0BAA0B,EAC1B,UAAU,GAMX,MAAM,2BAA2B,CAAC","sourcesContent":["/**\n * The host: the device, the operating system, and the user's settings.\n *\n * Every capability here is a service with its own factory, so injecting one is the whole setup\n * and one nobody injects is never constructed. Off a device each falls back to doing nothing,\n * which is what makes the whole package importable by the test suite.\n */\nexport {\n Accessibility,\n type AccessibilitySettings,\n type AccessibilitySource,\n} from './accessibility.ts';\nexport { AppState, type AppStateSource, type AppStatus } from './app-state.ts';\nexport { ColorScheme, type ColorSchemeSource, type Scheme } from './color-scheme.ts';\nexport {\n currentConditions,\n deviceTokens,\n hairlineTokens,\n watchConditions,\n type WatchOptions,\n} from './conditions.ts';\nexport { DeepLinks, deepLinkSource, pathOf, type DeepLinkSource } from './deep-links.ts';\nexport {\n Direction,\n type DirectionContext,\n type DirectionSource,\n type LayoutDirection,\n} from './direction.ts';\nexport {\n androidPermission,\n type AndroidPermissions,\n type PermissionAnswer,\n} from './android-permissions.ts';\nexport { DevMenu, type DevMenuSource, type NativeDevMenu } from './dev-menu.ts';\nexport { Dialogs, type Choice, type NativeDialogs } from './dialogs.ts';\nexport {\n LayoutAnimation,\n type LayoutChange,\n type LayoutEasing,\n type NativeLayoutAnimation,\n} from './layout-animation.ts';\nexport { Sharing, type NativeSharing, type ShareRequest } from './sharing.ts';\nexport { Vibration, type NativeVibration } from './vibration.ts';\nexport { HardwareBack, hardwareBackSource, type HardwareBackSource } from './hardware-back.ts';\nexport {\n KEYBOARD_MOTION,\n Keyboard,\n keyboardSource,\n type KeyboardMetrics,\n type KeyboardMotion,\n type KeyboardSource,\n} from './keyboard.ts';\nexport type { NativeKeyboardEvent } from './react-native.ts';\nexport { SafeArea, type Frame, type Insets } from './safe-area.ts';\nexport { COMPACT_WIDTH, Screen, type ScreenSource, type Size, type Sizes } from './screen.ts';\nexport {\n StatusBar,\n statusBarSource,\n type PlatformStatusBarStyle,\n type StatusBarSource,\n type StatusBarState,\n type StatusBarStyle,\n} from './status-bar.ts';\nexport {\n TopClaim,\n WindowClaims,\n onWindowFront,\n sharedBySource,\n type Claim,\n} from './window-claims.ts';\nexport {\n NavigationBar,\n navigationBarSource,\n type NavigationBarSource,\n type NavigationBarState,\n type NavigationBarStyle,\n} from './navigation-bar.ts';\nexport { SCREEN_IN_FRONT } from './screen-in-front.ts';\nexport { SCREEN_SHOWN } from './screen-shown.ts';\nexport { IN_FORM_SHEET } from './in-form-sheet.ts';\nexport { outputListened } from './output-listened.ts';\nexport { NATIVE_HISTORY } from './native-history.ts';\nexport { APPLE, DESKTOP, OS, OS_NAMES, type OsName } from './os.ts';\nexport {\n MENU_MODEL,\n createMenuModel,\n defaultMenuBar,\n isSeparator,\n mergeMenuBar,\n menuModelInTreeOrder,\n treeOrder,\n type MenuEntry,\n type MenuGroupModel,\n type MenuGroupRole,\n type MenuItemModel,\n type MenuModel,\n type MenuRole,\n type MenuSeparator,\n} from './menu-model.ts';\nexport {\n isEditingShortcut,\n matchesShortcut,\n navigationShortcut,\n parseShortcut,\n shortcutFires,\n type KeyChord,\n type ParsedShortcut,\n type ShortcutOs,\n} from './shortcut.ts';\nexport {\n Processes,\n UndeclaredCapabilityError,\n type ChildProcess,\n type NativeProcesses,\n type ProcessEvent,\n type ProcessExit,\n type SpawnOptions,\n} from './processes.ts';\nexport {\n SEARCH_PATH,\n SpawnRuleError,\n compileCapability,\n filterEnvironment,\n matchArguments,\n matchSpawn,\n parseArgument,\n programProblem,\n resolveProgram,\n type ArgumentRule,\n type CompiledCapability,\n type PlaceholderValues,\n type ProgramLookup,\n type SpawnCapability,\n type SpawnMatch,\n} from './spawn-rules.ts';\nexport {\n desktopOptionProblems,\n pathAllowed,\n pathProblem,\n validateDesktopOptions,\n type DesktopCapabilities,\n type DesktopOptions,\n type DocumentType,\n type PathCapability,\n} from './desktop-options.ts';\nexport {\n macosPermissions,\n type ExpoPermissionConfig,\n type MacosPermissions,\n} from './desktop-permissions.ts';\nexport {\n Menus,\n menuActionId,\n menusSource,\n serializeMenu,\n type NativeMenuEntry,\n type NativeMenuEvent,\n type NativeMenus,\n type NativeWindowHistory,\n type NativeShortcut,\n type SerializedMenu,\n} from './menus.ts';\nexport { Dock, type NativeDock } from './dock.ts';\nexport { nativeSplitViews } from './split-views.ts';\nexport {\n DragAndDrop,\n dragAndDropSource,\n type NativeDragAndDrop,\n type NativeDragItem,\n type NativeDropEvent,\n} from './drag-and-drop.ts';\nexport { UndoStack, type NativeUndo, type NativeUndoEvent, type UndoAction } from './undo-stack.ts';\nexport {\n OS_SUPPORT,\n SUPPORT_OSES,\n platformsLine,\n supportRowOf,\n type OsSupportRow,\n type SupportOs,\n} from './os-support.ts';\nexport { Shell, type NativeShell } from './shell.ts';\nexport {\n Tray,\n type NativeTray,\n type NativeTrayEvent,\n type NativeTrayIcon,\n type TrayIconModel,\n} from './tray.ts';\nexport { SIDEBAR_SELECTION } from './sidebar-selection.ts';\nexport { expoViewName } from './expo-view-name.ts';\nexport { hostInputNames, ownHost } from './own-host.ts';\nexport { WINDOW_NAVIGATOR, type WindowNavigator } from './window-navigator.ts';\nexport {\n AppWindows,\n CURRENT_WINDOW,\n MAIN_WINDOW_OPTIONS,\n WINDOW_MOUNTER,\n provideMainWindow,\n type AppWindow,\n type CloseGuard,\n type ComponentWindowOptions,\n type MainWindowOptions,\n type NativeWindowEvent,\n type NativeWindowRequest,\n type NativeWindows,\n type RouteWindowOptions,\n type TitleBar,\n type WindowMount,\n type WindowMounter,\n type WindowOptions,\n windowsSource,\n} from './app-windows.ts';\nexport {\n APP_LIFECYCLE_OPTIONS,\n AppLifecycle,\n WILL_QUIT_DEADLINE_MS,\n provideAppLifecycle,\n quitsWithLastWindow,\n type AppLifecycleOptions,\n} from './app-lifecycle.ts';\nexport { OS_VERSION } from './os-version.ts';\nexport { injectToken, type InjectTokenOptions } from './inject-token.ts';\nexport { type ControlSize } from './control-size.ts';\nexport { SVG_ICON_RENDERER, type SvgIconRenderer } from './svg-icon-renderer.ts';\nexport {\n RESTORABLE_WINDOWS,\n WINDOW_RESTORE_STORE,\n provideRestorableWindows,\n type RestoredWindow,\n type WindowRestoreStore,\n} from './window-restore.ts';\nexport { buildMenuTemplate, type MenuTemplate } from './menu-template.ts';\nexport {\n INTERACTION_OBSERVERS,\n MAX_TEXT_LENGTH,\n describeElement,\n interactionObservers,\n notifyInteraction,\n provideInteractionObserver,\n textWithin,\n type InteractionDirection,\n type InteractionEvent,\n type InteractionGesture,\n type InteractionObserver,\n type InteractionType,\n} from './interaction-observer.ts';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACL,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAuC,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAuC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAuB,MAAM,iBAAiB,CAAC;AACzF,OAAO,EACL,SAAS,GAIV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iBAAiB,GAGlB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAA0C,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,OAAO,EAAmC,MAAM,cAAc,CAAC;AACxE,OAAO,EACL,eAAe,GAIhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAyC,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAwB,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAA2B,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EACL,eAAe,EACf,QAAQ,EACR,cAAc,GAIf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,QAAQ,EAA2B,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,EAA4C,MAAM,aAAa,CAAC;AAC9F,OAAO,EACL,SAAS,EACT,eAAe,GAKhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,aAAa,EAC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":["/**\n * The host: the device, the operating system, and the user's settings.\n *\n * Every capability here is a service with its own factory, so injecting one is the whole setup\n * and one nobody injects is never constructed. Off a device each falls back to doing nothing,\n * which is what makes the whole package importable by the test suite.\n */\nexport {\n Accessibility,\n type AccessibilitySettings,\n type AccessibilitySource,\n} from './accessibility.ts';\nexport { AppState, type AppStateSource, type AppStatus } from './app-state.ts';\nexport { ColorScheme, type ColorSchemeSource, type Scheme } from './color-scheme.ts';\nexport {\n currentConditions,\n deviceTokens,\n hairlineTokens,\n watchConditions,\n type WatchOptions,\n} from './conditions.ts';\nexport { DeepLinks, deepLinkSource, pathOf, type DeepLinkSource } from './deep-links.ts';\nexport {\n Direction,\n type DirectionContext,\n type DirectionSource,\n type LayoutDirection,\n} from './direction.ts';\nexport {\n androidPermission,\n type AndroidPermissions,\n type PermissionAnswer,\n} from './android-permissions.ts';\nexport { DevMenu, type DevMenuSource, type NativeDevMenu } from './dev-menu.ts';\nexport { Dialogs, type Choice, type NativeDialogs } from './dialogs.ts';\nexport {\n LayoutAnimation,\n type LayoutChange,\n type LayoutEasing,\n type NativeLayoutAnimation,\n} from './layout-animation.ts';\nexport { Sharing, type NativeSharing, type ShareRequest } from './sharing.ts';\nexport { Vibration, type NativeVibration } from './vibration.ts';\nexport { HardwareBack, hardwareBackSource, type HardwareBackSource } from './hardware-back.ts';\nexport {\n KEYBOARD_MOTION,\n Keyboard,\n keyboardSource,\n type KeyboardMetrics,\n type KeyboardMotion,\n type KeyboardSource,\n} from './keyboard.ts';\nexport type { NativeKeyboardEvent } from './react-native.ts';\nexport { SafeArea, type Frame, type Insets } from './safe-area.ts';\nexport { COMPACT_WIDTH, Screen, type ScreenSource, type Size, type Sizes } from './screen.ts';\nexport {\n StatusBar,\n statusBarSource,\n type PlatformStatusBarStyle,\n type StatusBarSource,\n type StatusBarState,\n type StatusBarStyle,\n} from './status-bar.ts';\nexport {\n TopClaim,\n WindowClaims,\n onWindowFront,\n sharedBySource,\n type Claim,\n} from './window-claims.ts';\nexport {\n NavigationBar,\n navigationBarSource,\n type NavigationBarSource,\n type NavigationBarState,\n type NavigationBarStyle,\n} from './navigation-bar.ts';\nexport { SCREEN_IN_FRONT } from './screen-in-front.ts';\nexport { SCREEN_SHOWN } from './screen-shown.ts';\nexport { IN_FORM_SHEET } from './in-form-sheet.ts';\nexport { outputListened } from './output-listened.ts';\nexport { NATIVE_HISTORY } from './native-history.ts';\nexport { APPLE, DESKTOP, OS, OS_NAMES, type OsName } from './os.ts';\nexport {\n MENU_MODEL,\n createMenuModel,\n defaultMenuBar,\n isSeparator,\n mergeMenuBar,\n menuModelInTreeOrder,\n treeOrder,\n type MenuEntry,\n type MenuGroupModel,\n type MenuGroupRole,\n type MenuItemModel,\n type MenuModel,\n type MenuRole,\n type MenuSeparator,\n} from './menu-model.ts';\nexport {\n isEditingShortcut,\n matchesShortcut,\n navigationShortcut,\n parseShortcut,\n shortcutFires,\n type KeyChord,\n type ParsedShortcut,\n type ShortcutOs,\n} from './shortcut.ts';\nexport {\n Processes,\n UndeclaredCapabilityError,\n type ChildProcess,\n type NativeProcesses,\n type ProcessEvent,\n type ProcessExit,\n type SpawnOptions,\n} from './processes.ts';\nexport {\n SEARCH_PATH,\n SpawnRuleError,\n compileCapability,\n filterEnvironment,\n matchArguments,\n matchSpawn,\n parseArgument,\n programProblem,\n resolveProgram,\n type ArgumentRule,\n type CompiledCapability,\n type PlaceholderValues,\n type ProgramLookup,\n type SpawnCapability,\n type SpawnMatch,\n} from './spawn-rules.ts';\nexport {\n desktopOptionProblems,\n pathAllowed,\n pathProblem,\n validateDesktopOptions,\n type DesktopCapabilities,\n type DesktopOptions,\n type DocumentType,\n type PathCapability,\n} from './desktop-options.ts';\nexport {\n macosPermissions,\n type ExpoPermissionConfig,\n type MacosPermissions,\n} from './desktop-permissions.ts';\nexport {\n Menus,\n menuActionId,\n menusSource,\n serializeMenu,\n type NativeMenuEntry,\n type NativeMenuEvent,\n type NativeMenus,\n type NativeWindowHistory,\n type NativeShortcut,\n type SerializedMenu,\n} from './menus.ts';\nexport { Dock, type NativeDock } from './dock.ts';\nexport { nativeSplitViews } from './split-views.ts';\nexport { KEYBOARD_FOCUS, reportKeyboardFocusable } from './keyboard-focus.ts';\nexport {\n DragAndDrop,\n dragAndDropSource,\n type NativeDragAndDrop,\n type NativeDragItem,\n type NativeDropEvent,\n} from './drag-and-drop.ts';\nexport { UndoStack, type NativeUndo, type NativeUndoEvent, type UndoAction } from './undo-stack.ts';\nexport {\n OS_SUPPORT,\n SUPPORT_OSES,\n platformsLine,\n supportRowOf,\n type OsSupportRow,\n type SupportOs,\n} from './os-support.ts';\nexport { Shell, type NativeShell } from './shell.ts';\nexport {\n Tray,\n type NativeTray,\n type NativeTrayEvent,\n type NativeTrayIcon,\n type TrayIconModel,\n} from './tray.ts';\nexport { SIDEBAR_SELECTION } from './sidebar-selection.ts';\nexport { expoViewName } from './expo-view-name.ts';\nexport { hostInputNames, ownHost } from './own-host.ts';\nexport { WINDOW_NAVIGATOR, type WindowNavigator } from './window-navigator.ts';\nexport {\n AppWindows,\n CURRENT_WINDOW,\n MAIN_WINDOW_OPTIONS,\n WINDOW_MOUNTER,\n provideMainWindow,\n type AppWindow,\n type CloseGuard,\n type ComponentWindowOptions,\n type MainWindowOptions,\n type NativeWindowEvent,\n type NativeWindowRequest,\n type NativeWindows,\n type RouteWindowOptions,\n type TitleBar,\n type WindowMount,\n type WindowMounter,\n type WindowOptions,\n windowsSource,\n} from './app-windows.ts';\nexport {\n APP_LIFECYCLE_OPTIONS,\n AppLifecycle,\n WILL_QUIT_DEADLINE_MS,\n provideAppLifecycle,\n quitsWithLastWindow,\n type AppLifecycleOptions,\n} from './app-lifecycle.ts';\nexport { OS_VERSION } from './os-version.ts';\nexport { injectToken, type InjectTokenOptions } from './inject-token.ts';\nexport { type ControlSize } from './control-size.ts';\nexport { SVG_ICON_RENDERER, type SvgIconRenderer } from './svg-icon-renderer.ts';\nexport {\n RESTORABLE_WINDOWS,\n WINDOW_RESTORE_STORE,\n provideRestorableWindows,\n type RestoredWindow,\n type WindowRestoreStore,\n} from './window-restore.ts';\nexport { buildMenuTemplate, type MenuTemplate } from './menu-template.ts';\nexport {\n INTERACTION_OBSERVERS,\n MAX_TEXT_LENGTH,\n describeElement,\n interactionObservers,\n notifyInteraction,\n provideInteractionObserver,\n textWithin,\n type InteractionDirection,\n type InteractionEvent,\n type InteractionGesture,\n type InteractionObserver,\n type InteractionType,\n} from './interaction-observer.ts';\n"]}
@@ -0,0 +1,13 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ /**
3
+ * Tells `@ng-native/components`' pod whether the view with react tag `tag` takes the focus of an
4
+ * iPad's hardware keyboard, which React Native's iOS views never do: its iOS props have no
5
+ * `focusable`. The pod's `NgNativeKeyboardFocus` module lets the view be focused, draws the focus
6
+ * halo, and presses it on Space and Return. Nothing off iOS, in Expo Go, or without the pod.
7
+ */
8
+ export declare function reportKeyboardFocusable(tag: number, focusable: boolean): void;
9
+ /**
10
+ * Where a view says whether it takes an iPad hardware keyboard's focus: `reportKeyboardFocusable`,
11
+ * which a test replaces to hear what views report.
12
+ */
13
+ export declare const KEYBOARD_FOCUS: InjectionToken<(tag: number, focusable: boolean) => void>;
@@ -0,0 +1,22 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ import { platformOs } from "./os.js";
3
+ import { reactNative } from "./react-native.js";
4
+ /**
5
+ * Tells `@ng-native/components`' pod whether the view with react tag `tag` takes the focus of an
6
+ * iPad's hardware keyboard, which React Native's iOS views never do: its iOS props have no
7
+ * `focusable`. The pod's `NgNativeKeyboardFocus` module lets the view be focused, draws the focus
8
+ * halo, and presses it on Space and Return. Nothing off iOS, in Expo Go, or without the pod.
9
+ */
10
+ export function reportKeyboardFocusable(tag, focusable) {
11
+ // Only iOS has the module: asking elsewhere logs that it is missing.
12
+ if (platformOs() !== 'ios')
13
+ return;
14
+ const module = reactNative()?.TurboModuleRegistry?.get?.('NgNativeKeyboardFocus');
15
+ module?.setFocusable?.(tag, focusable);
16
+ }
17
+ /**
18
+ * Where a view says whether it takes an iPad hardware keyboard's focus: `reportKeyboardFocusable`,
19
+ * which a test replaces to hear what views report.
20
+ */
21
+ export const KEYBOARD_FOCUS = new InjectionToken('angular-native.keyboard-focus', { providedIn: 'root', factory: () => reportKeyboardFocusable });
22
+ //# sourceMappingURL=keyboard-focus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboard-focus.js","sourceRoot":"","sources":["../src/keyboard-focus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAMhD;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAW,EAAE,SAAkB;IACrE,qEAAqE;IACrE,IAAI,UAAU,EAAE,KAAK,KAAK;QAAE,OAAO;IACnC,MAAM,MAAM,GAAG,WAAW,EAAE,EAAE,mBAAmB,EAAE,GAAG,EAAE,CAAC,uBAAuB,CACxC,CAAC;IACzC,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,CAC9C,+BAA+B,EAC/B,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,uBAAuB,EAAE,CAC/D,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { platformOs } from './os.ts';\nimport { reactNative } from './react-native.ts';\n\ninterface KeyboardFocusModule {\n setFocusable?(tag: number, focusable: boolean): void;\n}\n\n/**\n * Tells `@ng-native/components`' pod whether the view with react tag `tag` takes the focus of an\n * iPad's hardware keyboard, which React Native's iOS views never do: its iOS props have no\n * `focusable`. The pod's `NgNativeKeyboardFocus` module lets the view be focused, draws the focus\n * halo, and presses it on Space and Return. Nothing off iOS, in Expo Go, or without the pod.\n */\nexport function reportKeyboardFocusable(tag: number, focusable: boolean): void {\n // Only iOS has the module: asking elsewhere logs that it is missing.\n if (platformOs() !== 'ios') return;\n const module = reactNative()?.TurboModuleRegistry?.get?.('NgNativeKeyboardFocus') as\n KeyboardFocusModule | null | undefined;\n module?.setFocusable?.(tag, focusable);\n}\n\n/**\n * Where a view says whether it takes an iPad hardware keyboard's focus: `reportKeyboardFocusable`,\n * which a test replaces to hear what views report.\n */\nexport const KEYBOARD_FOCUS = new InjectionToken<(tag: number, focusable: boolean) => void>(\n 'angular-native.keyboard-focus',\n { providedIn: 'root', factory: () => reportKeyboardFocusable },\n);\n"]}
package/dist/keyboard.js CHANGED
@@ -218,10 +218,10 @@ export class Keyboard {
218
218
  this.engine?.blurFocused();
219
219
  this.source.dismiss();
220
220
  }
221
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Keyboard, deps: [], target: i0.ɵɵFactoryTarget.Service });
222
- static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.2.0", ngImport: i0, type: Keyboard });
221
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Keyboard, deps: [], target: i0.ɵɵFactoryTarget.Service });
222
+ static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.3.0", ngImport: i0, type: Keyboard });
223
223
  }
224
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: Keyboard, decorators: [{
224
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: Keyboard, decorators: [{
225
225
  type: Service
226
226
  }], ctorParameters: () => [] });
227
227
  //# sourceMappingURL=keyboard.js.map