@ng-desktop/platform 0.5.0 → 0.7.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
@@ -18,7 +18,6 @@ import { bootstrapNativeApplication, NATIVE_UI_DIRECTIVES } from '@ng-desktop/pl
18
18
 
19
19
  @Component({
20
20
  selector: 'app-root',
21
- standalone: true,
22
21
  imports: [NATIVE_UI_DIRECTIVES],
23
22
  template: `
24
23
  <ng-window id="win" title="Desktop App">
@@ -1,18 +1,23 @@
1
1
  import { type NativeComputeMatch, type NativeXdgDirKind } from './bridge-fs-compute';
2
2
  export type { NativeComputeMatch, NativeXdgDirKind } from './bridge-fs-compute';
3
+ /** Logical transport category reported to Rust `NativeHttpEngine` and telemetry. */
3
4
  export type NativeHttpCallKind = 'json' | 'graphql' | 'asset' | 'batch' | 'text';
5
+ /** OS network reachability classification exposed by `NativeNetworkService`. */
4
6
  export type NativeConnectivity = 'full' | 'limited' | 'offline';
7
+ /** Snapshot of OS connectivity and metered network status. */
5
8
  export interface NativeNetworkStatus {
6
9
  online: boolean;
7
10
  metered: boolean;
8
11
  connectivity: NativeConnectivity;
9
12
  }
13
+ /** Per-request headers and options passed across `bridge.httpRequest`. */
10
14
  export interface NativeHttpRequestOptions {
11
15
  headers?: Record<string, string>;
12
16
  responseType?: string;
13
17
  callKind?: NativeHttpCallKind;
14
18
  withCredentials?: boolean;
15
19
  }
20
+ /** Global configuration shared with Rust `NativeHttpEngine` (HTTP/2, XSRF, caching). */
16
21
  export interface NativeHttpConfig {
17
22
  platform?: string;
18
23
  useFetchTransport?: boolean;
@@ -163,6 +163,7 @@ export function ensureNgNativeBridge() {
163
163
  },
164
164
  setSystemTheme(theme) {
165
165
  systemTheme = theme === 'light' ? 'light' : 'dark';
166
+ emit(`theme ${systemTheme}`);
166
167
  },
167
168
  getClipboard() {
168
169
  return clipboardText;
@@ -1,4 +1,5 @@
1
1
  import { NgNativeBridge } from './bridge';
2
+ export type SupportedMediaTheme = 'light' | 'dark';
2
3
  export interface ParsedStyleRule {
3
4
  className: string;
4
5
  background: string;
@@ -18,16 +19,28 @@ export interface ParsedStyleRule {
18
19
  minChildren: number | null;
19
20
  maxChildren: number | null;
20
21
  homogeneous: boolean | null;
22
+ pseudoClass: string | null;
23
+ mediaTheme: SupportedMediaTheme | null;
24
+ mediaMinWidth: number | null;
25
+ mediaMaxWidth: number | null;
26
+ opacity: number | null;
27
+ transitionMs: number | null;
28
+ transitionProp: string | null;
21
29
  }
22
30
  export declare function parsePixelInt(raw: string): number | null;
23
31
  export declare function mapAlignKeyword(raw: string): string | null;
32
+ export interface SharedRuntimeCssVars {
33
+ baseVars: Map<string, string>;
34
+ lightVars: Map<string, string>;
35
+ darkVars: Map<string, string>;
36
+ }
24
37
  /**
25
38
  * Parses component CSS rules at runtime into `ParsedStyleRule` descriptors compatible with
26
- * the Rust engine's CSS Flexbox/Grid and typography/radius extension syntax.
39
+ * the Rust engine's CSS Flexbox/Grid, pseudo-classes, `@media`, variables, and encapsulation syntax.
27
40
  */
28
41
  export declare function parseRuntimeStyles(cssSource: string): ParsedStyleRule[];
29
42
  /**
30
- * Formats optional `ParsedStyleRule` layout/typography fields as space-separated `key=value` tokens.
43
+ * Formats optional `ParsedStyleRule` layout/typography/media/pseudo fields as space-separated `key=value` tokens.
31
44
  */
32
45
  export declare function formatParsedStyleExtensions(rule: ParsedStyleRule): string;
33
- export declare function registerParsedStyles(bridge: NgNativeBridge, styles: readonly string[]): void;
46
+ export declare function registerParsedStyles(bridge: NgNativeBridge, styles: readonly string[], scopedClassesByScope?: Map<string, Set<string>>, sharedVars?: SharedRuntimeCssVars): void;