@edsis/angular 22.0.72 → 22.0.73

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.
@@ -2,7 +2,8 @@ import * as i0 from '@angular/core';
2
2
  import { InjectionToken, inject, signal, computed, Injectable, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';
3
3
  import { DOCUMENT } from '@angular/common';
4
4
 
5
- const EDSIS_RUNTIME_SCHEMA_VERSION = 1;
5
+ const EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION = 1;
6
+ const EDSIS_RUNTIME_SCHEMA_VERSION = 2;
6
7
  const EDSIS_RUNTIME_PLATFORMS = [
7
8
  'windows',
8
9
  'macos',
@@ -11,6 +12,7 @@ const EDSIS_RUNTIME_PLATFORMS = [
11
12
  'android',
12
13
  'web',
13
14
  ];
15
+ const EDSIS_DEVICE_TYPES = ['browser', 'windows', 'macos', 'android', 'ipados'];
14
16
  const EDSIS_RUNTIME_CAPABILITIES = [
15
17
  'window-controls',
16
18
  'window-layout',
@@ -31,28 +33,38 @@ const RUNTIME_ENVIRONMENTS = new Set([
31
33
  'local',
32
34
  ]);
33
35
  const RUNTIME_PLATFORMS = new Set(EDSIS_RUNTIME_PLATFORMS);
36
+ const DEVICE_TYPES = new Set(EDSIS_DEVICE_TYPES);
34
37
  const DEVICE_FAMILIES = new Set(['desktop', 'tablet', 'responsive']);
35
38
  const UI_PROFILES = new Set(['desktop', 'tablet', 'responsive']);
36
39
  const RUNTIME_CAPABILITIES = new Set(EDSIS_RUNTIME_CAPABILITIES);
37
40
  function isEdsisRuntimeContextV1(value) {
38
- if (!isRecord(value) || value['schemaVersion'] !== EDSIS_RUNTIME_SCHEMA_VERSION) {
41
+ return (isRuntimeContextBase(value, EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION) &&
42
+ resolveDeviceType(value) !== null);
43
+ }
44
+ function isEdsisRuntimeContextV2(value) {
45
+ if (!isRuntimeContextBase(value, EDSIS_RUNTIME_SCHEMA_VERSION)) {
39
46
  return false;
40
47
  }
41
- const app = value['app'];
42
- const capabilities = value['capabilities'];
43
- return (isSetMember(RUNTIME_HOSTS, value['host']) &&
44
- isSetMember(RUNTIME_ENVIRONMENTS, value['environment']) &&
45
- isSetMember(RUNTIME_PLATFORMS, value['platform']) &&
46
- isSetMember(DEVICE_FAMILIES, value['deviceFamily']) &&
47
- isSetMember(UI_PROFILES, value['uiProfile']) &&
48
- isRecord(app) &&
49
- isNonEmptyString(app['identifier']) &&
50
- isNonEmptyString(app['name']) &&
51
- typeof app['version'] === 'string' &&
52
- isNonEmptyString(app['arch']) &&
53
- typeof app['debug'] === 'boolean' &&
54
- Array.isArray(capabilities) &&
55
- capabilities.every((capability) => isSetMember(RUNTIME_CAPABILITIES, capability)));
48
+ const deviceType = value['deviceType'];
49
+ return isSetMember(DEVICE_TYPES, deviceType) && resolveDeviceType(value) === deviceType;
50
+ }
51
+ /** Validate either supported wire schema and normalize it to the immutable V2 contract. */
52
+ function normalizeEdsisRuntimeContext(value) {
53
+ if (isEdsisRuntimeContextV2(value)) {
54
+ return freezeEdsisRuntimeContext(value);
55
+ }
56
+ if (!isEdsisRuntimeContextV1(value)) {
57
+ return null;
58
+ }
59
+ const deviceType = resolveDeviceType(value);
60
+ if (!deviceType) {
61
+ return null;
62
+ }
63
+ return freezeEdsisRuntimeContext({
64
+ ...value,
65
+ schemaVersion: EDSIS_RUNTIME_SCHEMA_VERSION,
66
+ deviceType,
67
+ });
56
68
  }
57
69
  function freezeEdsisRuntimeContext(context) {
58
70
  const capabilities = Object.freeze([...new Set(context.capabilities)]);
@@ -65,6 +77,7 @@ function createBrowserRuntimeContext(environment) {
65
77
  host: 'browser',
66
78
  environment,
67
79
  platform: 'web',
80
+ deviceType: 'browser',
68
81
  deviceFamily: 'responsive',
69
82
  uiProfile: 'responsive',
70
83
  app: {
@@ -77,6 +90,47 @@ function createBrowserRuntimeContext(environment) {
77
90
  capabilities: [],
78
91
  });
79
92
  }
93
+ function isRuntimeContextBase(value, schemaVersion) {
94
+ if (!isRecord(value) || value['schemaVersion'] !== schemaVersion) {
95
+ return false;
96
+ }
97
+ const app = value['app'];
98
+ const capabilities = value['capabilities'];
99
+ return (isSetMember(RUNTIME_HOSTS, value['host']) &&
100
+ isSetMember(RUNTIME_ENVIRONMENTS, value['environment']) &&
101
+ isSetMember(RUNTIME_PLATFORMS, value['platform']) &&
102
+ isSetMember(DEVICE_FAMILIES, value['deviceFamily']) &&
103
+ isSetMember(UI_PROFILES, value['uiProfile']) &&
104
+ isRecord(app) &&
105
+ isNonEmptyString(app['identifier']) &&
106
+ isNonEmptyString(app['name']) &&
107
+ typeof app['version'] === 'string' &&
108
+ isNonEmptyString(app['arch']) &&
109
+ typeof app['debug'] === 'boolean' &&
110
+ Array.isArray(capabilities) &&
111
+ capabilities.every((capability) => isSetMember(RUNTIME_CAPABILITIES, capability)));
112
+ }
113
+ function resolveDeviceType(context) {
114
+ const { host, platform, deviceFamily, uiProfile } = context;
115
+ if (host === 'browser') {
116
+ return platform === 'web' && deviceFamily === 'responsive' && uiProfile === 'responsive'
117
+ ? 'browser'
118
+ : null;
119
+ }
120
+ if (platform === 'windows' && deviceFamily === 'desktop' && uiProfile === 'desktop') {
121
+ return 'windows';
122
+ }
123
+ if (platform === 'macos' && deviceFamily === 'desktop' && uiProfile === 'desktop') {
124
+ return 'macos';
125
+ }
126
+ if (platform === 'android' && deviceFamily === 'tablet' && uiProfile === 'tablet') {
127
+ return 'android';
128
+ }
129
+ if (platform === 'ios' && deviceFamily === 'tablet' && uiProfile === 'tablet') {
130
+ return 'ipados';
131
+ }
132
+ return null;
133
+ }
80
134
  function isRecord(value) {
81
135
  return typeof value === 'object' && value !== null && !Array.isArray(value);
82
136
  }
@@ -97,13 +151,17 @@ class RuntimeContextService {
97
151
  ...(ngDevMode ? [{ debugName: "contextState" }] : /* istanbul ignore next */ []));
98
152
  initialization = null;
99
153
  context = this.contextState.asReadonly();
100
- isDesktopShell = computed(() => this.contextState().host === 'tauri' && this.contextState().uiProfile === 'desktop', /* @ts-ignore */
154
+ deviceType = computed(() => this.contextState().deviceType, /* @ts-ignore */
155
+ ...(ngDevMode ? [{ debugName: "deviceType" }] : /* istanbul ignore next */ []));
156
+ isDesktopShell = computed(() => this.contextState().host === 'tauri' &&
157
+ (this.deviceType() === 'windows' || this.deviceType() === 'macos'), /* @ts-ignore */
101
158
  ...(ngDevMode ? [{ debugName: "isDesktopShell" }] : /* istanbul ignore next */ []));
102
- isTabletShell = computed(() => this.contextState().host === 'tauri' && this.contextState().uiProfile === 'tablet', /* @ts-ignore */
159
+ isTabletShell = computed(() => this.contextState().host === 'tauri' &&
160
+ (this.deviceType() === 'android' || this.deviceType() === 'ipados'), /* @ts-ignore */
103
161
  ...(ngDevMode ? [{ debugName: "isTabletShell" }] : /* istanbul ignore next */ []));
104
- isIPadOS = computed(() => this.isTabletShell() && this.contextState().platform === 'ios', /* @ts-ignore */
162
+ isIPadOS = computed(() => this.deviceType() === 'ipados', /* @ts-ignore */
105
163
  ...(ngDevMode ? [{ debugName: "isIPadOS" }] : /* istanbul ignore next */ []));
106
- isAndroidTablet = computed(() => this.isTabletShell() && this.contextState().platform === 'android', /* @ts-ignore */
164
+ isAndroidTablet = computed(() => this.deviceType() === 'android', /* @ts-ignore */
107
165
  ...(ngDevMode ? [{ debugName: "isAndroidTablet" }] : /* istanbul ignore next */ []));
108
166
  initialize() {
109
167
  this.initialization ??= this.resolveContext();
@@ -118,11 +176,15 @@ class RuntimeContextService {
118
176
  this.applyContext(createBrowserRuntimeContext(this.config.browserEnvironment));
119
177
  return;
120
178
  }
121
- if (isEdsisRuntimeContextV1(windowRef.EDSIS_RUNTIME)) {
122
- this.applyContext(windowRef.EDSIS_RUNTIME);
179
+ const hasNativeHost = hasTauriInternals$1(windowRef);
180
+ const initialContext = normalizeEdsisRuntimeContext(windowRef.EDSIS_RUNTIME);
181
+ if (initialContext &&
182
+ ((hasNativeHost && initialContext.host === 'tauri') ||
183
+ (!hasNativeHost && initialContext.host === 'browser'))) {
184
+ this.applyContext(initialContext);
123
185
  return;
124
186
  }
125
- if (!hasTauriInternals$1(windowRef)) {
187
+ if (!hasNativeHost) {
126
188
  this.applyContext(createBrowserRuntimeContext(this.config.browserEnvironment));
127
189
  return;
128
190
  }
@@ -131,7 +193,10 @@ class RuntimeContextService {
131
193
  if (commandContext)
132
194
  eventContext.cancel();
133
195
  const context = commandContext ?? (await eventContext.promise);
134
- this.applyContext(context ?? createBrowserRuntimeContext(this.config.browserEnvironment));
196
+ if (!context) {
197
+ throw new Error('Tauri runtime did not provide a valid native runtime context.');
198
+ }
199
+ this.applyContext(context);
135
200
  }
136
201
  applyContext(context) {
137
202
  const frozenContext = freezeEdsisRuntimeContext(context);
@@ -140,6 +205,7 @@ class RuntimeContextService {
140
205
  root.dataset['edsisHost'] = frozenContext.host;
141
206
  root.dataset['edsisPlatform'] = frozenContext.platform;
142
207
  root.dataset['edsisDevice'] = frozenContext.deviceFamily;
208
+ root.dataset['edsisDeviceType'] = frozenContext.deviceType;
143
209
  root.dataset['edsisUiProfile'] = frozenContext.uiProfile;
144
210
  }
145
211
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: RuntimeContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -152,7 +218,8 @@ async function invokeRuntimeContext() {
152
218
  try {
153
219
  const { invoke } = await import('@tauri-apps/api/core');
154
220
  const value = await invoke('runtime_context');
155
- return isEdsisRuntimeContextV1(value) ? value : null;
221
+ const context = normalizeEdsisRuntimeContext(value);
222
+ return context?.host === 'tauri' ? context : null;
156
223
  }
157
224
  catch {
158
225
  return null;
@@ -176,7 +243,8 @@ function waitForRuntimeReadyEvent(windowRef, timeoutMs) {
176
243
  };
177
244
  const onRuntimeReady = (event) => {
178
245
  const detail = 'detail' in event ? event.detail : null;
179
- finish(isEdsisRuntimeContextV1(detail) ? detail : null);
246
+ const context = normalizeEdsisRuntimeContext(detail);
247
+ finish(context?.host === 'tauri' ? context : null);
180
248
  };
181
249
  const timeoutId = windowRef.setTimeout(() => finish(null), timeoutMs);
182
250
  windowRef.addEventListener(EDSIS_RUNTIME_READY_EVENT, onRuntimeReady, { once: true });
@@ -199,8 +267,14 @@ class NativeHostService {
199
267
  async startDragging() {
200
268
  if (!this.supports('window-controls'))
201
269
  return;
202
- const { getCurrentWindow } = await import('@tauri-apps/api/window');
203
- await getCurrentWindow().startDragging();
270
+ try {
271
+ const { getCurrentWindow } = await import('@tauri-apps/api/window');
272
+ await getCurrentWindow().startDragging();
273
+ }
274
+ catch {
275
+ const { emit } = await import('@tauri-apps/api/event');
276
+ await emit('edsis:window-drag');
277
+ }
204
278
  }
205
279
  async setNotificationBadge(unreadCount) {
206
280
  if (!this.supports('notification-badge'))
@@ -304,5 +378,5 @@ function provideEdsisRuntime(config = {}) {
304
378
  * Generated bundle index. Do not edit.
305
379
  */
306
380
 
307
- export { EDSIS_RUNTIME_CAPABILITIES, EDSIS_RUNTIME_CONFIG, EDSIS_RUNTIME_PLATFORMS, EDSIS_RUNTIME_READY_EVENT, EDSIS_RUNTIME_SCHEMA_VERSION, EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH, NativeHostService, RuntimeContextService, TabletViewportService, createBrowserRuntimeContext, freezeEdsisRuntimeContext, isEdsisRuntimeContextV1, provideEdsisRuntime, setNativeNotificationBadge };
381
+ export { EDSIS_DEVICE_TYPES, EDSIS_RUNTIME_CAPABILITIES, EDSIS_RUNTIME_CONFIG, EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION, EDSIS_RUNTIME_PLATFORMS, EDSIS_RUNTIME_READY_EVENT, EDSIS_RUNTIME_SCHEMA_VERSION, EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH, NativeHostService, RuntimeContextService, TabletViewportService, createBrowserRuntimeContext, freezeEdsisRuntimeContext, isEdsisRuntimeContextV1, isEdsisRuntimeContextV2, normalizeEdsisRuntimeContext, provideEdsisRuntime, setNativeNotificationBadge };
308
382
  //# sourceMappingURL=edsis-angular-services-runtime.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"edsis-angular-services-runtime.mjs","sources":["../../../library/angular/services/runtime/runtime-context.ts","../../../library/angular/services/runtime/runtime.config.ts","../../../library/angular/services/runtime/runtime-context.service.ts","../../../library/angular/services/runtime/native-host.service.ts","../../../library/angular/services/runtime/tablet-viewport.service.ts","../../../library/angular/services/runtime/runtime.providers.ts","../../../library/angular/services/runtime/edsis-angular-services-runtime.ts"],"sourcesContent":["export const EDSIS_RUNTIME_SCHEMA_VERSION = 1 as const;\n\nexport const EDSIS_RUNTIME_PLATFORMS = [\n 'windows',\n 'macos',\n 'linux',\n 'ios',\n 'android',\n 'web',\n] as const;\n\nexport const EDSIS_RUNTIME_CAPABILITIES = [\n 'window-controls',\n 'window-layout',\n 'app-menu',\n 'tray',\n 'notification-badge',\n 'native-notification',\n 'dialog',\n 'clipboard-text',\n 'open-url',\n 'network-diagnostics',\n 'google-native-sign-in',\n] as const;\n\nexport type EdsisRuntimePlatform = (typeof EDSIS_RUNTIME_PLATFORMS)[number];\nexport type EdsisRuntimeCapability = (typeof EDSIS_RUNTIME_CAPABILITIES)[number];\nexport type EdsisRuntimeEnvironment = 'production' | 'development' | 'local';\nexport type EdsisRuntimeHost = 'tauri' | 'browser';\nexport type EdsisDeviceFamily = 'desktop' | 'tablet' | 'responsive';\nexport type EdsisUiProfile = 'desktop' | 'tablet' | 'responsive';\n\nexport interface EdsisRuntimeContextV1 {\n readonly schemaVersion: 1;\n readonly host: EdsisRuntimeHost;\n readonly environment: EdsisRuntimeEnvironment;\n readonly platform: EdsisRuntimePlatform;\n readonly deviceFamily: EdsisDeviceFamily;\n readonly uiProfile: EdsisUiProfile;\n readonly app: {\n readonly identifier: string;\n readonly name: string;\n readonly version: string;\n readonly arch: string;\n readonly debug: boolean;\n };\n readonly capabilities: readonly EdsisRuntimeCapability[];\n}\n\nconst RUNTIME_HOSTS = new Set<EdsisRuntimeHost>(['tauri', 'browser']);\nconst RUNTIME_ENVIRONMENTS = new Set<EdsisRuntimeEnvironment>([\n 'production',\n 'development',\n 'local',\n]);\nconst RUNTIME_PLATFORMS = new Set<EdsisRuntimePlatform>(EDSIS_RUNTIME_PLATFORMS);\nconst DEVICE_FAMILIES = new Set<EdsisDeviceFamily>(['desktop', 'tablet', 'responsive']);\nconst UI_PROFILES = new Set<EdsisUiProfile>(['desktop', 'tablet', 'responsive']);\nconst RUNTIME_CAPABILITIES = new Set<EdsisRuntimeCapability>(EDSIS_RUNTIME_CAPABILITIES);\n\nexport function isEdsisRuntimeContextV1(value: unknown): value is EdsisRuntimeContextV1 {\n if (!isRecord(value) || value['schemaVersion'] !== EDSIS_RUNTIME_SCHEMA_VERSION) {\n return false;\n }\n\n const app = value['app'];\n const capabilities = value['capabilities'];\n\n return (\n isSetMember(RUNTIME_HOSTS, value['host']) &&\n isSetMember(RUNTIME_ENVIRONMENTS, value['environment']) &&\n isSetMember(RUNTIME_PLATFORMS, value['platform']) &&\n isSetMember(DEVICE_FAMILIES, value['deviceFamily']) &&\n isSetMember(UI_PROFILES, value['uiProfile']) &&\n isRecord(app) &&\n isNonEmptyString(app['identifier']) &&\n isNonEmptyString(app['name']) &&\n typeof app['version'] === 'string' &&\n isNonEmptyString(app['arch']) &&\n typeof app['debug'] === 'boolean' &&\n Array.isArray(capabilities) &&\n capabilities.every((capability) => isSetMember(RUNTIME_CAPABILITIES, capability))\n );\n}\n\nexport function freezeEdsisRuntimeContext(context: EdsisRuntimeContextV1): EdsisRuntimeContextV1 {\n const capabilities = Object.freeze([...new Set(context.capabilities)]);\n const app = Object.freeze({ ...context.app });\n\n return Object.freeze({ ...context, app, capabilities });\n}\n\nexport function createBrowserRuntimeContext(\n environment: EdsisRuntimeEnvironment,\n): EdsisRuntimeContextV1 {\n return freezeEdsisRuntimeContext({\n schemaVersion: EDSIS_RUNTIME_SCHEMA_VERSION,\n host: 'browser',\n environment,\n platform: 'web',\n deviceFamily: 'responsive',\n uiProfile: 'responsive',\n app: {\n identifier: 'web',\n name: 'EDSIS Web',\n version: '',\n arch: 'web',\n debug: environment !== 'production',\n },\n capabilities: [],\n });\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction isSetMember<T extends string>(values: ReadonlySet<T>, value: unknown): value is T {\n return typeof value === 'string' && values.has(value as T);\n}\n","import { InjectionToken } from '@angular/core';\n\nimport type { EdsisRuntimeEnvironment } from './runtime-context';\n\nexport interface EdsisRuntimeConfig {\n readonly browserEnvironment?: EdsisRuntimeEnvironment;\n readonly eventTimeoutMs?: number;\n}\n\nexport interface ResolvedEdsisRuntimeConfig {\n readonly browserEnvironment: EdsisRuntimeEnvironment;\n readonly eventTimeoutMs: number;\n}\n\nexport const EDSIS_RUNTIME_CONFIG = new InjectionToken<ResolvedEdsisRuntimeConfig>(\n 'EDSIS_RUNTIME_CONFIG',\n);\n","import { DOCUMENT } from '@angular/common';\nimport { Injectable, computed, inject, signal } from '@angular/core';\n\nimport {\n createBrowserRuntimeContext,\n freezeEdsisRuntimeContext,\n isEdsisRuntimeContextV1,\n type EdsisRuntimeCapability,\n type EdsisRuntimeContextV1,\n} from './runtime-context';\nimport { EDSIS_RUNTIME_CONFIG } from './runtime.config';\n\nexport const EDSIS_RUNTIME_READY_EVENT = 'edsis:runtime-ready' as const;\n\ndeclare global {\n interface Window {\n readonly EDSIS_RUNTIME?: unknown;\n }\n}\n\n@Injectable()\nexport class RuntimeContextService {\n private readonly documentRef = inject<Document>(DOCUMENT);\n private readonly config = inject(EDSIS_RUNTIME_CONFIG);\n private readonly contextState = signal<EdsisRuntimeContextV1>(\n createBrowserRuntimeContext(this.config.browserEnvironment),\n );\n private initialization: Promise<void> | null = null;\n\n readonly context = this.contextState.asReadonly();\n readonly isDesktopShell = computed(\n () => this.contextState().host === 'tauri' && this.contextState().uiProfile === 'desktop',\n );\n readonly isTabletShell = computed(\n () => this.contextState().host === 'tauri' && this.contextState().uiProfile === 'tablet',\n );\n readonly isIPadOS = computed(\n () => this.isTabletShell() && this.contextState().platform === 'ios',\n );\n readonly isAndroidTablet = computed(\n () => this.isTabletShell() && this.contextState().platform === 'android',\n );\n\n initialize(): Promise<void> {\n this.initialization ??= this.resolveContext();\n return this.initialization;\n }\n\n supports(capability: EdsisRuntimeCapability): boolean {\n return this.contextState().capabilities.includes(capability);\n }\n\n private async resolveContext(): Promise<void> {\n const windowRef = this.documentRef.defaultView;\n\n if (!windowRef) {\n this.applyContext(createBrowserRuntimeContext(this.config.browserEnvironment));\n return;\n }\n\n if (isEdsisRuntimeContextV1(windowRef.EDSIS_RUNTIME)) {\n this.applyContext(windowRef.EDSIS_RUNTIME);\n return;\n }\n\n if (!hasTauriInternals(windowRef)) {\n this.applyContext(createBrowserRuntimeContext(this.config.browserEnvironment));\n return;\n }\n\n const eventContext = waitForRuntimeReadyEvent(windowRef, this.config.eventTimeoutMs);\n const commandContext = await invokeRuntimeContext();\n if (commandContext) eventContext.cancel();\n const context = commandContext ?? (await eventContext.promise);\n\n this.applyContext(context ?? createBrowserRuntimeContext(this.config.browserEnvironment));\n }\n\n private applyContext(context: EdsisRuntimeContextV1): void {\n const frozenContext = freezeEdsisRuntimeContext(context);\n this.contextState.set(frozenContext);\n\n const root = this.documentRef.documentElement;\n root.dataset['edsisHost'] = frozenContext.host;\n root.dataset['edsisPlatform'] = frozenContext.platform;\n root.dataset['edsisDevice'] = frozenContext.deviceFamily;\n root.dataset['edsisUiProfile'] = frozenContext.uiProfile;\n }\n}\n\nasync function invokeRuntimeContext(): Promise<EdsisRuntimeContextV1 | null> {\n try {\n const { invoke } = await import('@tauri-apps/api/core');\n const value = await invoke<unknown>('runtime_context');\n return isEdsisRuntimeContextV1(value) ? value : null;\n } catch {\n return null;\n }\n}\n\nfunction hasTauriInternals(windowRef: Window): boolean {\n const internals = Reflect.get(windowRef, '__TAURI_INTERNALS__');\n return typeof internals === 'object' && internals !== null;\n}\n\nfunction waitForRuntimeReadyEvent(\n windowRef: Window,\n timeoutMs: number,\n): {\n readonly promise: Promise<EdsisRuntimeContextV1 | null>;\n readonly cancel: () => void;\n} {\n let cancel = (): void => undefined;\n const promise = new Promise<EdsisRuntimeContextV1 | null>((resolve) => {\n let settled = false;\n const finish = (context: EdsisRuntimeContextV1 | null): void => {\n if (settled) return;\n settled = true;\n windowRef.removeEventListener(EDSIS_RUNTIME_READY_EVENT, onRuntimeReady);\n windowRef.clearTimeout(timeoutId);\n resolve(context);\n };\n const onRuntimeReady = (event: Event): void => {\n const detail = 'detail' in event ? event.detail : null;\n finish(isEdsisRuntimeContextV1(detail) ? detail : null);\n };\n const timeoutId = windowRef.setTimeout(() => finish(null), timeoutMs);\n\n windowRef.addEventListener(EDSIS_RUNTIME_READY_EVENT, onRuntimeReady, { once: true });\n cancel = () => finish(null);\n });\n\n return { promise, cancel };\n}\n","import { Injectable, inject } from '@angular/core';\n\nimport type { EdsisRuntimeCapability } from './runtime-context';\nimport { RuntimeContextService } from './runtime-context.service';\n\nexport type EdsisWindowControlAction = 'close' | 'minimize' | 'toggle-maximize';\n\n@Injectable()\nexport class NativeHostService {\n private readonly runtime = inject(RuntimeContextService);\n\n supports(capability: EdsisRuntimeCapability): boolean {\n return this.runtime.context().host === 'tauri' && this.runtime.supports(capability);\n }\n\n async emitWindowControl(action: EdsisWindowControlAction): Promise<void> {\n if (!this.supports('window-controls')) return;\n const { emit } = await import('@tauri-apps/api/event');\n await emit('edsis:window-control', action);\n }\n\n async startDragging(): Promise<void> {\n if (!this.supports('window-controls')) return;\n const { getCurrentWindow } = await import('@tauri-apps/api/window');\n await getCurrentWindow().startDragging();\n }\n\n async setNotificationBadge(unreadCount: number): Promise<void> {\n if (!this.supports('notification-badge')) return;\n await invokeNotificationBadge(unreadCount);\n }\n}\n\n/** Browser-safe compatibility helper for callers outside Angular injection. */\nexport async function setNativeNotificationBadge(unreadCount: number): Promise<void> {\n if (typeof window === 'undefined' || !hasTauriInternals(window)) return;\n\n try {\n await invokeNotificationBadge(unreadCount);\n } catch {\n // Native integration is optional for browser consumers and older shells.\n }\n}\n\nasync function invokeNotificationBadge(unreadCount: number): Promise<void> {\n const { invoke } = await import('@tauri-apps/api/core');\n await invoke('set_notification_badge', { unreadCount });\n}\n\nfunction hasTauriInternals(windowRef: Window): boolean {\n const internals = Reflect.get(windowRef, '__TAURI_INTERNALS__');\n return typeof internals === 'object' && internals !== null;\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Injectable, computed, inject, signal } from '@angular/core';\n\nexport const EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH = 600;\n\nexport type TabletViewportBlockReason = 'portrait' | 'too-narrow' | null;\n\n@Injectable()\nexport class TabletViewportService {\n private readonly documentRef = inject<Document>(DOCUMENT);\n private readonly widthState = signal(0);\n private readonly heightState = signal(0);\n private initialized = false;\n\n readonly width = this.widthState.asReadonly();\n readonly height = this.heightState.asReadonly();\n readonly isLandscape = computed(() => this.widthState() >= this.heightState());\n readonly meetsMinimumWidth = computed(\n () => this.widthState() >= EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH,\n );\n readonly blockReason = computed<TabletViewportBlockReason>(() => {\n if (!this.meetsMinimumWidth()) return 'too-narrow';\n if (!this.isLandscape()) return 'portrait';\n return null;\n });\n readonly isSupported = computed(() => this.blockReason() === null);\n\n initialize(): void {\n if (this.initialized) return;\n this.initialized = true;\n\n const windowRef = this.documentRef.defaultView;\n if (!windowRef) return;\n\n const update = (): void => {\n this.widthState.set(windowRef.innerWidth);\n this.heightState.set(windowRef.innerHeight);\n this.documentRef.documentElement.dataset['edsisTabletViewport'] = this.isSupported()\n ? 'supported'\n : 'unsupported';\n };\n\n update();\n windowRef.addEventListener('resize', update, { passive: true });\n windowRef.addEventListener('orientationchange', update, { passive: true });\n }\n}\n","import {\n inject,\n makeEnvironmentProviders,\n provideAppInitializer,\n type EnvironmentProviders,\n} from '@angular/core';\n\nimport {\n EDSIS_RUNTIME_CONFIG,\n type EdsisRuntimeConfig,\n type ResolvedEdsisRuntimeConfig,\n} from './runtime.config';\nimport { NativeHostService } from './native-host.service';\nimport { RuntimeContextService } from './runtime-context.service';\nimport { TabletViewportService } from './tablet-viewport.service';\n\nexport function provideEdsisRuntime(config: EdsisRuntimeConfig = {}): EnvironmentProviders {\n const resolvedConfig: ResolvedEdsisRuntimeConfig = {\n browserEnvironment: config.browserEnvironment ?? 'production',\n eventTimeoutMs: Math.max(0, config.eventTimeoutMs ?? 750),\n };\n\n return makeEnvironmentProviders([\n { provide: EDSIS_RUNTIME_CONFIG, useValue: resolvedConfig },\n RuntimeContextService,\n NativeHostService,\n TabletViewportService,\n provideAppInitializer(() => {\n const runtime = inject(RuntimeContextService);\n const viewport = inject(TabletViewportService);\n return runtime.initialize().then(() => viewport.initialize());\n }),\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["hasTauriInternals"],"mappings":";;;;AAAO,MAAM,4BAA4B,GAAG;AAErC,MAAM,uBAAuB,GAAG;IACrC,SAAS;IACT,OAAO;IACP,OAAO;IACP,KAAK;IACL,SAAS;IACT,KAAK;;AAGA,MAAM,0BAA0B,GAAG;IACxC,iBAAiB;IACjB,eAAe;IACf,UAAU;IACV,MAAM;IACN,oBAAoB;IACpB,qBAAqB;IACrB,QAAQ;IACR,gBAAgB;IAChB,UAAU;IACV,qBAAqB;IACrB,uBAAuB;;AA2BzB,MAAM,aAAa,GAAG,IAAI,GAAG,CAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AACrE,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAA0B;IAC5D,YAAY;IACZ,aAAa;IACb,OAAO;AACR,CAAA,CAAC;AACF,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAuB,uBAAuB,CAAC;AAChF,MAAM,eAAe,GAAG,IAAI,GAAG,CAAoB,C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AAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC/D,QAAA,SAAS,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC5E;uGArCW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAArB,qBAAqB,EAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC;;;ACSK,SAAU,mBAAmB,CAAC,MAAA,GAA6B,EAAE,EAAA;AACjE,IAAA,MAAM,cAAc,GAA+B;AACjD,QAAA,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,IAAI,YAAY;AAC7D,QAAA,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,cAAc,IAAI,GAAG,CAAC;KAC1D;AAED,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,cAAc,EAAE;QAC3D,qBAAqB;QACrB,iBAAiB;QACjB,qBAAqB;QACrB,qBAAqB,CAAC,MAAK;AACzB,YAAA,MAAM,OAAO,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC7C,YAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC9C,YAAA,OAAO,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;AAC/D,QAAA,CAAC,CAAC;AACH,KAAA,CAAC;AACJ;;ACjCA;;AAEG;;;;"}
1
+ {"version":3,"file":"edsis-angular-services-runtime.mjs","sources":["../../../library/angular/services/runtime/runtime-context.ts","../../../library/angular/services/runtime/runtime.config.ts","../../../library/angular/services/runtime/runtime-context.service.ts","../../../library/angular/services/runtime/native-host.service.ts","../../../library/angular/services/runtime/tablet-viewport.service.ts","../../../library/angular/services/runtime/runtime.providers.ts","../../../library/angular/services/runtime/edsis-angular-services-runtime.ts"],"sourcesContent":["export const EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION = 1 as const;\nexport const EDSIS_RUNTIME_SCHEMA_VERSION = 2 as const;\n\nexport const EDSIS_RUNTIME_PLATFORMS = [\n 'windows',\n 'macos',\n 'linux',\n 'ios',\n 'android',\n 'web',\n] as const;\n\nexport const EDSIS_DEVICE_TYPES = ['browser', 'windows', 'macos', 'android', 'ipados'] as const;\n\nexport const EDSIS_RUNTIME_CAPABILITIES = [\n 'window-controls',\n 'window-layout',\n 'app-menu',\n 'tray',\n 'notification-badge',\n 'native-notification',\n 'dialog',\n 'clipboard-text',\n 'open-url',\n 'network-diagnostics',\n 'google-native-sign-in',\n] as const;\n\nexport type EdsisRuntimePlatform = (typeof EDSIS_RUNTIME_PLATFORMS)[number];\nexport type EdsisDeviceType = (typeof EDSIS_DEVICE_TYPES)[number];\nexport type EdsisRuntimeCapability = (typeof EDSIS_RUNTIME_CAPABILITIES)[number];\nexport type EdsisRuntimeEnvironment = 'production' | 'development' | 'local';\nexport type EdsisRuntimeHost = 'tauri' | 'browser';\nexport type EdsisDeviceFamily = 'desktop' | 'tablet' | 'responsive';\nexport type EdsisUiProfile = 'desktop' | 'tablet' | 'responsive';\n\ninterface EdsisRuntimeContextBase {\n readonly host: EdsisRuntimeHost;\n readonly environment: EdsisRuntimeEnvironment;\n readonly platform: EdsisRuntimePlatform;\n readonly deviceFamily: EdsisDeviceFamily;\n readonly uiProfile: EdsisUiProfile;\n readonly app: {\n readonly identifier: string;\n readonly name: string;\n readonly version: string;\n readonly arch: string;\n readonly debug: boolean;\n };\n readonly capabilities: readonly EdsisRuntimeCapability[];\n}\n\n/** Legacy wire payload accepted during the schema V2 migration. */\nexport interface EdsisRuntimeContextV1 extends EdsisRuntimeContextBase {\n readonly schemaVersion: 1;\n}\n\n/** Canonical runtime payload returned to Angular consumers. */\nexport interface EdsisRuntimeContextV2 extends EdsisRuntimeContextBase {\n readonly schemaVersion: 2;\n readonly deviceType: EdsisDeviceType;\n}\n\nexport type EdsisRuntimeContext = EdsisRuntimeContextV2;\nexport type EdsisRuntimeWireContext = EdsisRuntimeContextV1 | EdsisRuntimeContextV2;\n\nconst RUNTIME_HOSTS = new Set<EdsisRuntimeHost>(['tauri', 'browser']);\nconst RUNTIME_ENVIRONMENTS = new Set<EdsisRuntimeEnvironment>([\n 'production',\n 'development',\n 'local',\n]);\nconst RUNTIME_PLATFORMS = new Set<EdsisRuntimePlatform>(EDSIS_RUNTIME_PLATFORMS);\nconst DEVICE_TYPES = new Set<EdsisDeviceType>(EDSIS_DEVICE_TYPES);\nconst DEVICE_FAMILIES = new Set<EdsisDeviceFamily>(['desktop', 'tablet', 'responsive']);\nconst UI_PROFILES = new Set<EdsisUiProfile>(['desktop', 'tablet', 'responsive']);\nconst RUNTIME_CAPABILITIES = new Set<EdsisRuntimeCapability>(EDSIS_RUNTIME_CAPABILITIES);\n\nexport function isEdsisRuntimeContextV1(value: unknown): value is EdsisRuntimeContextV1 {\n return (\n isRuntimeContextBase(value, EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION) &&\n resolveDeviceType(value) !== null\n );\n}\n\nexport function isEdsisRuntimeContextV2(value: unknown): value is EdsisRuntimeContextV2 {\n if (!isRuntimeContextBase(value, EDSIS_RUNTIME_SCHEMA_VERSION)) {\n return false;\n }\n\n const deviceType = value['deviceType'];\n return isSetMember(DEVICE_TYPES, deviceType) && resolveDeviceType(value) === deviceType;\n}\n\n/** Validate either supported wire schema and normalize it to the immutable V2 contract. */\nexport function normalizeEdsisRuntimeContext(value: unknown): EdsisRuntimeContextV2 | null {\n if (isEdsisRuntimeContextV2(value)) {\n return freezeEdsisRuntimeContext(value);\n }\n\n if (!isEdsisRuntimeContextV1(value)) {\n return null;\n }\n\n const deviceType = resolveDeviceType(value);\n if (!deviceType) {\n return null;\n }\n\n return freezeEdsisRuntimeContext({\n ...value,\n schemaVersion: EDSIS_RUNTIME_SCHEMA_VERSION,\n deviceType,\n });\n}\n\nexport function freezeEdsisRuntimeContext<T extends EdsisRuntimeWireContext>(context: T): T {\n const capabilities = Object.freeze([...new Set(context.capabilities)]);\n const app = Object.freeze({ ...context.app });\n\n return Object.freeze({ ...context, app, capabilities }) as unknown as T;\n}\n\nexport function createBrowserRuntimeContext(\n environment: EdsisRuntimeEnvironment,\n): EdsisRuntimeContextV2 {\n return freezeEdsisRuntimeContext({\n schemaVersion: EDSIS_RUNTIME_SCHEMA_VERSION,\n host: 'browser',\n environment,\n platform: 'web',\n deviceType: 'browser',\n deviceFamily: 'responsive',\n uiProfile: 'responsive',\n app: {\n identifier: 'web',\n name: 'EDSIS Web',\n version: '',\n arch: 'web',\n debug: environment !== 'production',\n },\n capabilities: [],\n });\n}\n\nfunction isRuntimeContextBase(\n value: unknown,\n schemaVersion: typeof EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION | typeof EDSIS_RUNTIME_SCHEMA_VERSION,\n): value is Record<string, unknown> & EdsisRuntimeContextBase {\n if (!isRecord(value) || value['schemaVersion'] !== schemaVersion) {\n return false;\n }\n\n const app = value['app'];\n const capabilities = value['capabilities'];\n\n return (\n isSetMember(RUNTIME_HOSTS, value['host']) &&\n isSetMember(RUNTIME_ENVIRONMENTS, value['environment']) &&\n isSetMember(RUNTIME_PLATFORMS, value['platform']) &&\n isSetMember(DEVICE_FAMILIES, value['deviceFamily']) &&\n isSetMember(UI_PROFILES, value['uiProfile']) &&\n isRecord(app) &&\n isNonEmptyString(app['identifier']) &&\n isNonEmptyString(app['name']) &&\n typeof app['version'] === 'string' &&\n isNonEmptyString(app['arch']) &&\n typeof app['debug'] === 'boolean' &&\n Array.isArray(capabilities) &&\n capabilities.every((capability) => isSetMember(RUNTIME_CAPABILITIES, capability))\n );\n}\n\nfunction resolveDeviceType(\n context: Pick<EdsisRuntimeContextBase, 'host' | 'platform' | 'deviceFamily' | 'uiProfile'>,\n): EdsisDeviceType | null {\n const { host, platform, deviceFamily, uiProfile } = context;\n\n if (host === 'browser') {\n return platform === 'web' && deviceFamily === 'responsive' && uiProfile === 'responsive'\n ? 'browser'\n : null;\n }\n\n if (platform === 'windows' && deviceFamily === 'desktop' && uiProfile === 'desktop') {\n return 'windows';\n }\n\n if (platform === 'macos' && deviceFamily === 'desktop' && uiProfile === 'desktop') {\n return 'macos';\n }\n\n if (platform === 'android' && deviceFamily === 'tablet' && uiProfile === 'tablet') {\n return 'android';\n }\n\n if (platform === 'ios' && deviceFamily === 'tablet' && uiProfile === 'tablet') {\n return 'ipados';\n }\n\n return null;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction isSetMember<T extends string>(values: ReadonlySet<T>, value: unknown): value is T {\n return typeof value === 'string' && values.has(value as T);\n}\n","import { InjectionToken } from '@angular/core';\n\nimport type { EdsisRuntimeEnvironment } from './runtime-context';\n\nexport interface EdsisRuntimeConfig {\n readonly browserEnvironment?: EdsisRuntimeEnvironment;\n readonly eventTimeoutMs?: number;\n}\n\nexport interface ResolvedEdsisRuntimeConfig {\n readonly browserEnvironment: EdsisRuntimeEnvironment;\n readonly eventTimeoutMs: number;\n}\n\nexport const EDSIS_RUNTIME_CONFIG = new InjectionToken<ResolvedEdsisRuntimeConfig>(\n 'EDSIS_RUNTIME_CONFIG',\n);\n","import { DOCUMENT } from '@angular/common';\nimport { Injectable, computed, inject, signal } from '@angular/core';\n\nimport {\n createBrowserRuntimeContext,\n freezeEdsisRuntimeContext,\n normalizeEdsisRuntimeContext,\n type EdsisRuntimeCapability,\n type EdsisRuntimeContextV2,\n} from './runtime-context';\nimport { EDSIS_RUNTIME_CONFIG } from './runtime.config';\n\nexport const EDSIS_RUNTIME_READY_EVENT = 'edsis:runtime-ready' as const;\n\ndeclare global {\n interface Window {\n readonly EDSIS_RUNTIME?: unknown;\n }\n}\n\n@Injectable()\nexport class RuntimeContextService {\n private readonly documentRef = inject<Document>(DOCUMENT);\n private readonly config = inject(EDSIS_RUNTIME_CONFIG);\n private readonly contextState = signal<EdsisRuntimeContextV2>(\n createBrowserRuntimeContext(this.config.browserEnvironment),\n );\n private initialization: Promise<void> | null = null;\n\n readonly context = this.contextState.asReadonly();\n readonly deviceType = computed(() => this.contextState().deviceType);\n readonly isDesktopShell = computed(\n () =>\n this.contextState().host === 'tauri' &&\n (this.deviceType() === 'windows' || this.deviceType() === 'macos'),\n );\n readonly isTabletShell = computed(\n () =>\n this.contextState().host === 'tauri' &&\n (this.deviceType() === 'android' || this.deviceType() === 'ipados'),\n );\n readonly isIPadOS = computed(() => this.deviceType() === 'ipados');\n readonly isAndroidTablet = computed(() => this.deviceType() === 'android');\n\n initialize(): Promise<void> {\n this.initialization ??= this.resolveContext();\n return this.initialization;\n }\n\n supports(capability: EdsisRuntimeCapability): boolean {\n return this.contextState().capabilities.includes(capability);\n }\n\n private async resolveContext(): Promise<void> {\n const windowRef = this.documentRef.defaultView;\n\n if (!windowRef) {\n this.applyContext(createBrowserRuntimeContext(this.config.browserEnvironment));\n return;\n }\n\n const hasNativeHost = hasTauriInternals(windowRef);\n const initialContext = normalizeEdsisRuntimeContext(windowRef.EDSIS_RUNTIME);\n\n if (\n initialContext &&\n ((hasNativeHost && initialContext.host === 'tauri') ||\n (!hasNativeHost && initialContext.host === 'browser'))\n ) {\n this.applyContext(initialContext);\n return;\n }\n\n if (!hasNativeHost) {\n this.applyContext(createBrowserRuntimeContext(this.config.browserEnvironment));\n return;\n }\n\n const eventContext = waitForRuntimeReadyEvent(windowRef, this.config.eventTimeoutMs);\n const commandContext = await invokeRuntimeContext();\n if (commandContext) eventContext.cancel();\n const context = commandContext ?? (await eventContext.promise);\n\n if (!context) {\n throw new Error('Tauri runtime did not provide a valid native runtime context.');\n }\n\n this.applyContext(context);\n }\n\n private applyContext(context: EdsisRuntimeContextV2): void {\n const frozenContext = freezeEdsisRuntimeContext(context);\n this.contextState.set(frozenContext);\n\n const root = this.documentRef.documentElement;\n root.dataset['edsisHost'] = frozenContext.host;\n root.dataset['edsisPlatform'] = frozenContext.platform;\n root.dataset['edsisDevice'] = frozenContext.deviceFamily;\n root.dataset['edsisDeviceType'] = frozenContext.deviceType;\n root.dataset['edsisUiProfile'] = frozenContext.uiProfile;\n }\n}\n\nasync function invokeRuntimeContext(): Promise<EdsisRuntimeContextV2 | null> {\n try {\n const { invoke } = await import('@tauri-apps/api/core');\n const value = await invoke<unknown>('runtime_context');\n const context = normalizeEdsisRuntimeContext(value);\n return context?.host === 'tauri' ? context : null;\n } catch {\n return null;\n }\n}\n\nfunction hasTauriInternals(windowRef: Window): boolean {\n const internals = Reflect.get(windowRef, '__TAURI_INTERNALS__');\n return typeof internals === 'object' && internals !== null;\n}\n\nfunction waitForRuntimeReadyEvent(\n windowRef: Window,\n timeoutMs: number,\n): {\n readonly promise: Promise<EdsisRuntimeContextV2 | null>;\n readonly cancel: () => void;\n} {\n let cancel = (): void => undefined;\n const promise = new Promise<EdsisRuntimeContextV2 | null>((resolve) => {\n let settled = false;\n const finish = (context: EdsisRuntimeContextV2 | null): void => {\n if (settled) return;\n settled = true;\n windowRef.removeEventListener(EDSIS_RUNTIME_READY_EVENT, onRuntimeReady);\n windowRef.clearTimeout(timeoutId);\n resolve(context);\n };\n const onRuntimeReady = (event: Event): void => {\n const detail = 'detail' in event ? event.detail : null;\n const context = normalizeEdsisRuntimeContext(detail);\n finish(context?.host === 'tauri' ? context : null);\n };\n const timeoutId = windowRef.setTimeout(() => finish(null), timeoutMs);\n\n windowRef.addEventListener(EDSIS_RUNTIME_READY_EVENT, onRuntimeReady, { once: true });\n cancel = () => finish(null);\n });\n\n return { promise, cancel };\n}\n","import { Injectable, inject } from '@angular/core';\n\nimport type { EdsisRuntimeCapability } from './runtime-context';\nimport { RuntimeContextService } from './runtime-context.service';\n\nexport type EdsisWindowControlAction = 'close' | 'minimize' | 'toggle-maximize';\n\n@Injectable()\nexport class NativeHostService {\n private readonly runtime = inject(RuntimeContextService);\n\n supports(capability: EdsisRuntimeCapability): boolean {\n return this.runtime.context().host === 'tauri' && this.runtime.supports(capability);\n }\n\n async emitWindowControl(action: EdsisWindowControlAction): Promise<void> {\n if (!this.supports('window-controls')) return;\n const { emit } = await import('@tauri-apps/api/event');\n await emit('edsis:window-control', action);\n }\n\n async startDragging(): Promise<void> {\n if (!this.supports('window-controls')) return;\n\n try {\n const { getCurrentWindow } = await import('@tauri-apps/api/window');\n await getCurrentWindow().startDragging();\n } catch {\n const { emit } = await import('@tauri-apps/api/event');\n await emit('edsis:window-drag');\n }\n }\n\n async setNotificationBadge(unreadCount: number): Promise<void> {\n if (!this.supports('notification-badge')) return;\n await invokeNotificationBadge(unreadCount);\n }\n}\n\n/** Browser-safe compatibility helper for callers outside Angular injection. */\nexport async function setNativeNotificationBadge(unreadCount: number): Promise<void> {\n if (typeof window === 'undefined' || !hasTauriInternals(window)) return;\n\n try {\n await invokeNotificationBadge(unreadCount);\n } catch {\n // Native integration is optional for browser consumers and older shells.\n }\n}\n\nasync function invokeNotificationBadge(unreadCount: number): Promise<void> {\n const { invoke } = await import('@tauri-apps/api/core');\n await invoke('set_notification_badge', { unreadCount });\n}\n\nfunction hasTauriInternals(windowRef: Window): boolean {\n const internals = Reflect.get(windowRef, '__TAURI_INTERNALS__');\n return typeof internals === 'object' && internals !== null;\n}\n","import { DOCUMENT } from '@angular/common';\nimport { Injectable, computed, inject, signal } from '@angular/core';\n\nexport const EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH = 600;\n\nexport type TabletViewportBlockReason = 'portrait' | 'too-narrow' | null;\n\n@Injectable()\nexport class TabletViewportService {\n private readonly documentRef = inject<Document>(DOCUMENT);\n private readonly widthState = signal(0);\n private readonly heightState = signal(0);\n private initialized = false;\n\n readonly width = this.widthState.asReadonly();\n readonly height = this.heightState.asReadonly();\n readonly isLandscape = computed(() => this.widthState() >= this.heightState());\n readonly meetsMinimumWidth = computed(\n () => this.widthState() >= EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH,\n );\n readonly blockReason = computed<TabletViewportBlockReason>(() => {\n if (!this.meetsMinimumWidth()) return 'too-narrow';\n if (!this.isLandscape()) return 'portrait';\n return null;\n });\n readonly isSupported = computed(() => this.blockReason() === null);\n\n initialize(): void {\n if (this.initialized) return;\n this.initialized = true;\n\n const windowRef = this.documentRef.defaultView;\n if (!windowRef) return;\n\n const update = (): void => {\n this.widthState.set(windowRef.innerWidth);\n this.heightState.set(windowRef.innerHeight);\n this.documentRef.documentElement.dataset['edsisTabletViewport'] = this.isSupported()\n ? 'supported'\n : 'unsupported';\n };\n\n update();\n windowRef.addEventListener('resize', update, { passive: true });\n windowRef.addEventListener('orientationchange', update, { passive: true });\n }\n}\n","import {\n inject,\n makeEnvironmentProviders,\n provideAppInitializer,\n type EnvironmentProviders,\n} from '@angular/core';\n\nimport {\n EDSIS_RUNTIME_CONFIG,\n type EdsisRuntimeConfig,\n type ResolvedEdsisRuntimeConfig,\n} from './runtime.config';\nimport { NativeHostService } from './native-host.service';\nimport { RuntimeContextService } from './runtime-context.service';\nimport { TabletViewportService } from './tablet-viewport.service';\n\nexport function provideEdsisRuntime(config: EdsisRuntimeConfig = {}): EnvironmentProviders {\n const resolvedConfig: ResolvedEdsisRuntimeConfig = {\n browserEnvironment: config.browserEnvironment ?? 'production',\n eventTimeoutMs: Math.max(0, config.eventTimeoutMs ?? 750),\n };\n\n return makeEnvironmentProviders([\n { provide: EDSIS_RUNTIME_CONFIG, useValue: resolvedConfig },\n RuntimeContextService,\n NativeHostService,\n TabletViewportService,\n provideAppInitializer(() => {\n const runtime = inject(RuntimeContextService);\n const viewport = inject(TabletViewportService);\n return runtime.initialize().then(() => viewport.initialize());\n }),\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["hasTauriInternals"],"mappings":";;;;AAAO,MAAM,mCAAmC,GAAG;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,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,cAAc,EAAE;QAC3D,qBAAqB;QACrB,iBAAiB;QACjB,qBAAqB;QACrB,qBAAqB,CAAC,MAAK;AACzB,YAAA,MAAM,OAAO,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC7C,YAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC9C,YAAA,OAAO,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;AAC/D,QAAA,CAAC,CAAC;AACH,KAAA,CAAC;AACJ;;ACjCA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@edsis/angular",
3
- "version": "22.0.72",
3
+ "version": "22.0.73",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
7
7
  "@angular/forms": ">=22.0.0",
8
8
  "@angular/router": ">=22.0.0",
9
9
  "@tauri-apps/api": ">=2.0.0",
10
- "@edsis/navigation": "^22.0.72",
11
- "@edsis/sdk": "^22.0.72",
12
- "@edsis/theme": "^22.0.72",
13
- "@edsis/component": "^22.0.72",
10
+ "@edsis/navigation": "^22.0.73",
11
+ "@edsis/sdk": "^22.0.73",
12
+ "@edsis/theme": "^22.0.73",
13
+ "@edsis/component": "^22.0.73",
14
14
  "rxjs": ">=7.8.0"
15
15
  },
16
16
  "peerDependenciesMeta": {
@@ -130,7 +130,6 @@ declare class BlockShellNavigationHeaderComponent implements AfterViewInit, OnDe
130
130
  ngOnDestroy(): void;
131
131
  private readonly handleWindowControlClick;
132
132
  private readonly handleWindowDragStart;
133
- private readonly handleWindowDragAreaDoubleClick;
134
133
  private isWindowControlAction;
135
134
  private emitWindowControl;
136
135
  private startDragging;
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { InjectionToken } from '@angular/core';
2
+ import { InjectionToken, EnvironmentProviders } from '@angular/core';
3
3
  import { NavigationOrientation, NavigationType, NavigationPosition, NavigationDockbarMode } from '@edsis/navigation/service';
4
4
  import { LayoutStyle, LayoutSurface, LayoutWidth, LayoutType } from '@edsis/theme/layout/types';
5
5
  import { ThemeMode, ThemeSpace, ThemeRadius, ThemeStyle, ThemeColor, ThemeBrand } from '@edsis/theme/styles';
@@ -80,5 +80,8 @@ declare class AppPreferencesTriggerDirective {
80
80
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AppPreferencesTriggerDirective, "[appPreferencesTrigger]", never, {}, {}, never, never, true, never>;
81
81
  }
82
82
 
83
- export { APP_PREFERENCES_CONFIG, AppPreferencesComponent, AppPreferencesPanelService, AppPreferencesTriggerDirective, provideAppPreferences };
83
+ /** Synchronizes the immutable resolved runtime device into the UI theme device service. */
84
+ declare function provideRuntimeThemeDevice(): EnvironmentProviders;
85
+
86
+ export { APP_PREFERENCES_CONFIG, AppPreferencesComponent, AppPreferencesPanelService, AppPreferencesTriggerDirective, provideAppPreferences, provideRuntimeThemeDevice };
84
87
  export type { AppPreferencesConfig, AppPreferencesDefaults };
@@ -1,17 +1,19 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { InjectionToken, EnvironmentProviders } from '@angular/core';
3
3
 
4
- declare const EDSIS_RUNTIME_SCHEMA_VERSION: 1;
4
+ declare const EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION: 1;
5
+ declare const EDSIS_RUNTIME_SCHEMA_VERSION: 2;
5
6
  declare const EDSIS_RUNTIME_PLATFORMS: readonly ["windows", "macos", "linux", "ios", "android", "web"];
7
+ declare const EDSIS_DEVICE_TYPES: readonly ["browser", "windows", "macos", "android", "ipados"];
6
8
  declare const EDSIS_RUNTIME_CAPABILITIES: readonly ["window-controls", "window-layout", "app-menu", "tray", "notification-badge", "native-notification", "dialog", "clipboard-text", "open-url", "network-diagnostics", "google-native-sign-in"];
7
9
  type EdsisRuntimePlatform = (typeof EDSIS_RUNTIME_PLATFORMS)[number];
10
+ type EdsisDeviceType = (typeof EDSIS_DEVICE_TYPES)[number];
8
11
  type EdsisRuntimeCapability = (typeof EDSIS_RUNTIME_CAPABILITIES)[number];
9
12
  type EdsisRuntimeEnvironment = 'production' | 'development' | 'local';
10
13
  type EdsisRuntimeHost = 'tauri' | 'browser';
11
14
  type EdsisDeviceFamily = 'desktop' | 'tablet' | 'responsive';
12
15
  type EdsisUiProfile = 'desktop' | 'tablet' | 'responsive';
13
- interface EdsisRuntimeContextV1 {
14
- readonly schemaVersion: 1;
16
+ interface EdsisRuntimeContextBase {
15
17
  readonly host: EdsisRuntimeHost;
16
18
  readonly environment: EdsisRuntimeEnvironment;
17
19
  readonly platform: EdsisRuntimePlatform;
@@ -26,9 +28,23 @@ interface EdsisRuntimeContextV1 {
26
28
  };
27
29
  readonly capabilities: readonly EdsisRuntimeCapability[];
28
30
  }
31
+ /** Legacy wire payload accepted during the schema V2 migration. */
32
+ interface EdsisRuntimeContextV1 extends EdsisRuntimeContextBase {
33
+ readonly schemaVersion: 1;
34
+ }
35
+ /** Canonical runtime payload returned to Angular consumers. */
36
+ interface EdsisRuntimeContextV2 extends EdsisRuntimeContextBase {
37
+ readonly schemaVersion: 2;
38
+ readonly deviceType: EdsisDeviceType;
39
+ }
40
+ type EdsisRuntimeContext = EdsisRuntimeContextV2;
41
+ type EdsisRuntimeWireContext = EdsisRuntimeContextV1 | EdsisRuntimeContextV2;
29
42
  declare function isEdsisRuntimeContextV1(value: unknown): value is EdsisRuntimeContextV1;
30
- declare function freezeEdsisRuntimeContext(context: EdsisRuntimeContextV1): EdsisRuntimeContextV1;
31
- declare function createBrowserRuntimeContext(environment: EdsisRuntimeEnvironment): EdsisRuntimeContextV1;
43
+ declare function isEdsisRuntimeContextV2(value: unknown): value is EdsisRuntimeContextV2;
44
+ /** Validate either supported wire schema and normalize it to the immutable V2 contract. */
45
+ declare function normalizeEdsisRuntimeContext(value: unknown): EdsisRuntimeContextV2 | null;
46
+ declare function freezeEdsisRuntimeContext<T extends EdsisRuntimeWireContext>(context: T): T;
47
+ declare function createBrowserRuntimeContext(environment: EdsisRuntimeEnvironment): EdsisRuntimeContextV2;
32
48
 
33
49
  type EdsisWindowControlAction = 'close' | 'minimize' | 'toggle-maximize';
34
50
  declare class NativeHostService {
@@ -64,7 +80,8 @@ declare class RuntimeContextService {
64
80
  private readonly config;
65
81
  private readonly contextState;
66
82
  private initialization;
67
- readonly context: _angular_core.Signal<EdsisRuntimeContextV1>;
83
+ readonly context: _angular_core.Signal<EdsisRuntimeContextV2>;
84
+ readonly deviceType: _angular_core.Signal<"windows" | "macos" | "android" | "browser" | "ipados">;
68
85
  readonly isDesktopShell: _angular_core.Signal<boolean>;
69
86
  readonly isTabletShell: _angular_core.Signal<boolean>;
70
87
  readonly isIPadOS: _angular_core.Signal<boolean>;
@@ -97,5 +114,5 @@ declare class TabletViewportService {
97
114
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<TabletViewportService>;
98
115
  }
99
116
 
100
- export { EDSIS_RUNTIME_CAPABILITIES, EDSIS_RUNTIME_CONFIG, EDSIS_RUNTIME_PLATFORMS, EDSIS_RUNTIME_READY_EVENT, EDSIS_RUNTIME_SCHEMA_VERSION, EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH, NativeHostService, RuntimeContextService, TabletViewportService, createBrowserRuntimeContext, freezeEdsisRuntimeContext, isEdsisRuntimeContextV1, provideEdsisRuntime, setNativeNotificationBadge };
101
- export type { EdsisDeviceFamily, EdsisRuntimeCapability, EdsisRuntimeConfig, EdsisRuntimeContextV1, EdsisRuntimeEnvironment, EdsisRuntimeHost, EdsisRuntimePlatform, EdsisUiProfile, EdsisWindowControlAction, ResolvedEdsisRuntimeConfig, TabletViewportBlockReason };
117
+ export { EDSIS_DEVICE_TYPES, EDSIS_RUNTIME_CAPABILITIES, EDSIS_RUNTIME_CONFIG, EDSIS_RUNTIME_LEGACY_SCHEMA_VERSION, EDSIS_RUNTIME_PLATFORMS, EDSIS_RUNTIME_READY_EVENT, EDSIS_RUNTIME_SCHEMA_VERSION, EDSIS_TABLET_MINIMUM_VIEWPORT_WIDTH, NativeHostService, RuntimeContextService, TabletViewportService, createBrowserRuntimeContext, freezeEdsisRuntimeContext, isEdsisRuntimeContextV1, isEdsisRuntimeContextV2, normalizeEdsisRuntimeContext, provideEdsisRuntime, setNativeNotificationBadge };
118
+ export type { EdsisDeviceFamily, EdsisDeviceType, EdsisRuntimeCapability, EdsisRuntimeConfig, EdsisRuntimeContext, EdsisRuntimeContextV1, EdsisRuntimeContextV2, EdsisRuntimeEnvironment, EdsisRuntimeHost, EdsisRuntimePlatform, EdsisRuntimeWireContext, EdsisUiProfile, EdsisWindowControlAction, ResolvedEdsisRuntimeConfig, TabletViewportBlockReason };