@ng-native/device 0.26.1 → 0.27.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/dist/accessibility.d.ts +5 -3
- package/dist/accessibility.js +5 -0
- package/dist/accessibility.js.map +1 -1
- package/dist/desktop-options.d.ts +5 -0
- package/dist/desktop-options.js +6 -1
- package/dist/desktop-options.js.map +1 -1
- package/dist/dialogs.js +4 -2
- package/dist/dialogs.js.map +1 -1
- package/dist/dock.d.ts +2 -0
- package/dist/dock.js +4 -1
- package/dist/dock.js.map +1 -1
- package/dist/menu-model.d.ts +11 -9
- package/dist/menu-model.js +72 -9
- package/dist/menu-model.js.map +1 -1
- package/dist/menus.js +2 -2
- package/dist/menus.js.map +1 -1
- package/dist/os-support.d.ts +1 -1
- package/dist/os-support.js +188 -62
- package/dist/os-support.js.map +1 -1
- package/dist/os-version.d.ts +3 -1
- package/dist/os-version.js +3 -1
- package/dist/os-version.js.map +1 -1
- package/dist/os.d.ts +5 -3
- package/dist/os.js +5 -3
- package/dist/os.js.map +1 -1
- package/dist/processes.d.ts +2 -0
- package/dist/processes.js +4 -1
- package/dist/processes.js.map +1 -1
- package/dist/safe-area.d.ts +12 -3
- package/dist/safe-area.js +16 -4
- package/dist/safe-area.js.map +1 -1
- package/dist/sharing.js +4 -3
- package/dist/sharing.js.map +1 -1
- package/dist/spawn-rules.js +8 -0
- package/dist/spawn-rules.js.map +1 -1
- package/dist/tray.d.ts +6 -3
- package/dist/tray.js +8 -4
- package/dist/tray.js.map +1 -1
- package/dist/vibration.d.ts +1 -1
- package/dist/vibration.js +3 -3
- package/dist/vibration.js.map +1 -1
- package/dist/window-restore.js +1 -1
- package/dist/window-restore.js.map +1 -1
- package/package.json +2 -2
package/dist/window-restore.js
CHANGED
|
@@ -21,7 +21,7 @@ const SETTINGS_KEY = 'ngNative.windows';
|
|
|
21
21
|
*/
|
|
22
22
|
function settingsStore() {
|
|
23
23
|
const os = injectOs();
|
|
24
|
-
if (os !== 'macos' && os !== 'ios')
|
|
24
|
+
if (os !== 'macos' && os !== 'linux' && os !== 'ios')
|
|
25
25
|
return null;
|
|
26
26
|
const settings = reactNative()?.Settings;
|
|
27
27
|
if (!settings)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window-restore.js","sourceRoot":"","sources":["../src/window-restore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,cAAc,EACd,wBAAwB,GAGzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA2BhD,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAExC;;;;GAIG;AACH,SAAS,aAAa;IACpB,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IACtB,IAAI,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"window-restore.js","sourceRoot":"","sources":["../src/window-restore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,cAAc,EACd,wBAAwB,GAGzB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA2BhD,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAExC;;;;GAIG;AACH,SAAS,aAAa;IACpB,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IACtB,IAAI,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAClE,MAAM,QAAQ,GAAG,WAAW,EAAE,EAAE,QAAQ,CAAC;IACzC,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC3B,OAAO;QACL,IAAI,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open again after a reload or a relaunch, and what they rendered.\n *\n * The host, on macOS and on iPadOS, keeps a window that has a key across a reload, and closes it\n * unless the reloaded app opens that key again within a few seconds. So `AppWindows` writes down each window\n * with a key as it opens and forgets it as it closes, and a starting app opens every one it finds:\n * the main window, a route window at the path it was last opened at, and a `restoreKey` component\n * window with its inputs. A relaunch takes the same path, with the frames the host autosaved.\n *\n * A component is written down by the name `provideRestorableWindows` gives it, since a class name\n * does not survive minifying.\n */\nimport {\n InjectionToken,\n makeEnvironmentProviders,\n type EnvironmentProviders,\n type Type,\n} from '@angular/core';\nimport { injectOs } from './os.ts';\nimport { reactNative } from './react-native.ts';\nimport type { WindowOptions } from './app-windows.ts';\n\n/** One window to open again. */\nexport type RestoredWindow =\n | { readonly kind: 'main' }\n | {\n readonly kind: 'route';\n readonly outlet: string;\n readonly path: string;\n readonly options: WindowOptions;\n }\n | {\n readonly kind: 'component';\n readonly key: string;\n /** The name `provideRestorableWindows` gave the component. */\n readonly component: string;\n readonly inputs?: Readonly<Record<string, unknown>>;\n readonly options: WindowOptions;\n };\n\n/** Where the windows to open again are kept between one run of the app and the next. */\nexport interface WindowRestoreStore {\n read(): readonly RestoredWindow[];\n write(windows: readonly RestoredWindow[]): void;\n}\n\nconst SETTINGS_KEY = 'ngNative.windows';\n\n/**\n * React Native's `Settings`, the app's user defaults, on macOS and iOS; null elsewhere. On iPadOS\n * the host keeps a window's scene across a reload, as the desktop host keeps the window, until the\n * reloaded app opens its key again.\n */\nfunction settingsStore(): WindowRestoreStore | null {\n const os = injectOs();\n if (os !== 'macos' && os !== 'linux' && os !== 'ios') return null;\n const settings = reactNative()?.Settings;\n if (!settings) return null;\n return {\n read: () => {\n const saved = settings.get(SETTINGS_KEY);\n let records: unknown = saved;\n if (typeof saved === 'string') {\n try {\n records = JSON.parse(saved);\n } catch {\n return [];\n }\n }\n // A list as a property list too: what an earlier version saved still opens. Only records,\n // since a value written outside the app can hold anything.\n return Array.isArray(records)\n ? records.filter(\n (window): window is RestoredWindow => typeof window === 'object' && window !== null,\n )\n : [];\n },\n // As JSON: a property list drops null, from an object and from an array, so a window's inputs\n // would not come back as they were given.\n write: (windows) => settings.set({ [SETTINGS_KEY]: JSON.stringify(windows) }),\n };\n}\n\n/** The store `AppWindows` keeps its windows in. Overridden in a test with one in memory. */\nexport const WINDOW_RESTORE_STORE = new InjectionToken<WindowRestoreStore | null>(\n 'angular-native.windowRestoreStore',\n { factory: settingsStore },\n);\n\n/** The components a `restoreKey` window may render, named by `provideRestorableWindows`. */\nexport const RESTORABLE_WINDOWS = new InjectionToken<Readonly<Record<string, Type<unknown>>>[]>(\n 'angular-native.restorableWindows',\n);\n\n/**\n * Name the components that `AppWindows.open(component, { restoreKey })` may open, so the window\n * opens again after a reload or a relaunch: `provideRestorableWindows({ note: NoteWindow })`. Its\n * inputs are written down too, so they have to survive `JSON.stringify`.\n */\nexport function provideRestorableWindows(\n components: Readonly<Record<string, Type<unknown>>>,\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: RESTORABLE_WINDOWS, useValue: components, multi: true },\n ]);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-native/device",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Angular Native device services: keyboard, screen, color scheme, app state, accessibility, hardware back and deep links.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"type": "module",
|
|
18
18
|
"main": "dist/index.js",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ng-native/fabric": "0.
|
|
20
|
+
"@ng-native/fabric": "0.27.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@angular/core": "^22.0.0",
|