@ng-desktop/platform 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +43 -7
  2. package/fesm2022/bridge-fs-compute.d.ts +1 -1
  3. package/fesm2022/bridge-fs-compute.js +5 -2
  4. package/fesm2022/bridge-sqlite.d.ts +0 -1
  5. package/fesm2022/bridge-sqlite.js +2 -12
  6. package/fesm2022/bridge.d.ts +62 -2
  7. package/fesm2022/bridge.js +406 -219
  8. package/fesm2022/css-style-parser.d.ts +33 -0
  9. package/fesm2022/css-style-parser.js +259 -0
  10. package/fesm2022/ecosystem-compat.d.ts +0 -1
  11. package/fesm2022/ecosystem-compat.js +9 -10
  12. package/fesm2022/image-loader.d.ts +1 -2
  13. package/fesm2022/image-loader.js +1 -2
  14. package/fesm2022/index.d.ts +5 -3
  15. package/fesm2022/index.js +4 -2
  16. package/fesm2022/native-directives.d.ts +188 -0
  17. package/fesm2022/native-directives.js +742 -0
  18. package/fesm2022/native-element.d.ts +7 -2
  19. package/fesm2022/native-element.js +21 -2
  20. package/fesm2022/native-renderer.d.ts +44 -3
  21. package/fesm2022/native-renderer.js +951 -44
  22. package/fesm2022/native-title.d.ts +1 -1
  23. package/fesm2022/native-title.js +17 -5
  24. package/fesm2022/platform.d.ts +2 -2
  25. package/fesm2022/platform.js +8 -2
  26. package/fesm2022/system-providers.d.ts +2 -1
  27. package/fesm2022/system-providers.js +63 -13
  28. package/fesm2022/viewport-scroller.d.ts +2 -1
  29. package/fesm2022/viewport-scroller.js +19 -7
  30. package/fesm2022/virtual-list.component.d.ts +57 -0
  31. package/fesm2022/virtual-list.component.js +200 -0
  32. package/package.json +4 -2
  33. package/fesm2022/bridge-fs-compute.d.ts.map +0 -1
  34. package/fesm2022/bridge-fs-compute.js.map +0 -1
  35. package/fesm2022/bridge-sqlite.d.ts.map +0 -1
  36. package/fesm2022/bridge-sqlite.js.map +0 -1
  37. package/fesm2022/bridge.d.ts.map +0 -1
  38. package/fesm2022/bridge.js.map +0 -1
  39. package/fesm2022/ecosystem-compat.d.ts.map +0 -1
  40. package/fesm2022/ecosystem-compat.js.map +0 -1
  41. package/fesm2022/image-loader.d.ts.map +0 -1
  42. package/fesm2022/image-loader.js.map +0 -1
  43. package/fesm2022/index.d.ts.map +0 -1
  44. package/fesm2022/index.js.map +0 -1
  45. package/fesm2022/native-element.d.ts.map +0 -1
  46. package/fesm2022/native-element.js.map +0 -1
  47. package/fesm2022/native-renderer.d.ts.map +0 -1
  48. package/fesm2022/native-renderer.js.map +0 -1
  49. package/fesm2022/native-title.d.ts.map +0 -1
  50. package/fesm2022/native-title.js.map +0 -1
  51. package/fesm2022/platform.d.ts.map +0 -1
  52. package/fesm2022/platform.js.map +0 -1
  53. package/fesm2022/system-providers.d.ts.map +0 -1
  54. package/fesm2022/system-providers.js.map +0 -1
  55. package/fesm2022/viewport-scroller.d.ts.map +0 -1
  56. package/fesm2022/viewport-scroller.js.map +0 -1
@@ -0,0 +1,259 @@
1
+ const RUNTIME_STYLE_EXTENSIONS = [
2
+ ['borderRadius', 'radius'],
3
+ ['fontSize', 'font-size'],
4
+ ['fontWeight', 'font-weight'],
5
+ ['minWidth', 'min-width'],
6
+ ['minHeight', 'min-height'],
7
+ ['orientation', 'orientation'],
8
+ ['hexpand', 'hexpand'],
9
+ ['vexpand', 'vexpand'],
10
+ ['halign', 'halign'],
11
+ ['valign', 'valign'],
12
+ ['minChildren', 'min-children'],
13
+ ['maxChildren', 'max-children'],
14
+ ['homogeneous', 'homogeneous'],
15
+ ];
16
+ export function parsePixelInt(raw) {
17
+ const parsed = Number.parseInt(raw.trim().replace(/px$/, ''), 10);
18
+ return Number.isFinite(parsed) && parsed >= 0 ? parsed : null;
19
+ }
20
+ export function mapAlignKeyword(raw) {
21
+ switch (raw.trim().toLowerCase()) {
22
+ case 'center':
23
+ return 'center';
24
+ case 'flex-start':
25
+ case 'start':
26
+ return 'start';
27
+ case 'flex-end':
28
+ case 'end':
29
+ return 'end';
30
+ case 'stretch':
31
+ case 'fill':
32
+ return 'fill';
33
+ case 'baseline':
34
+ return 'baseline';
35
+ default:
36
+ return null;
37
+ }
38
+ }
39
+ function applyRuntimeGridColumns(rule, val) {
40
+ const match = val
41
+ .trim()
42
+ .match(/repeat\(\s*(auto-fit|auto-fill|\d+)\s*,\s*(?:minmax\(\s*(\d+)px\s*,[^)]+\)|[^)]+)\)/i);
43
+ if (!match)
44
+ return;
45
+ const track = match[1].toLowerCase();
46
+ if (track === 'auto-fit' || track === 'auto-fill') {
47
+ rule.minChildren = 1;
48
+ rule.maxChildren = 12;
49
+ }
50
+ else {
51
+ const cols = Number.parseInt(track, 10);
52
+ if (!Number.isFinite(cols) || cols < 1)
53
+ return;
54
+ rule.minChildren = cols;
55
+ rule.maxChildren = cols;
56
+ }
57
+ rule.homogeneous = true;
58
+ rule.hexpand = true;
59
+ if (match[2] && rule.minWidth === null) {
60
+ rule.minWidth = Number.parseInt(match[2], 10);
61
+ }
62
+ }
63
+ function applyRuntimeLayoutDeclaration(rule, prop, val) {
64
+ const lower = val.trim().toLowerCase();
65
+ if (prop === 'flex-direction') {
66
+ if (lower.startsWith('row'))
67
+ rule.orientation = 'horizontal';
68
+ else if (lower.startsWith('column'))
69
+ rule.orientation = 'vertical';
70
+ }
71
+ else if (prop === 'flex-wrap' && lower.startsWith('wrap')) {
72
+ rule.minChildren ??= 1;
73
+ rule.maxChildren ??= 12;
74
+ rule.homogeneous = true;
75
+ rule.hexpand = true;
76
+ }
77
+ else if (prop === 'flex' || prop === 'flex-grow') {
78
+ const grow = Number.parseFloat(lower);
79
+ if (Number.isFinite(grow) && grow >= 1)
80
+ rule.hexpand = true;
81
+ if (prop === 'flex') {
82
+ const basisMatch = lower.match(/(\d+)px/);
83
+ if (basisMatch && rule.minWidth === null) {
84
+ rule.minWidth = Number.parseInt(basisMatch[1], 10);
85
+ }
86
+ }
87
+ }
88
+ else if (prop === 'width') {
89
+ if (lower === '100%')
90
+ rule.hexpand = true;
91
+ else {
92
+ const px = parsePixelInt(val);
93
+ if (px !== null && rule.minWidth === null)
94
+ rule.minWidth = px;
95
+ }
96
+ }
97
+ else if (prop === 'height') {
98
+ if (lower === '100%')
99
+ rule.vexpand = true;
100
+ else {
101
+ const px = parsePixelInt(val);
102
+ if (px !== null && rule.minHeight === null)
103
+ rule.minHeight = px;
104
+ }
105
+ }
106
+ else if (prop === 'grid-template-columns') {
107
+ applyRuntimeGridColumns(rule, val);
108
+ }
109
+ else if (prop === 'justify-self') {
110
+ const aligned = mapAlignKeyword(val);
111
+ if (aligned)
112
+ rule.halign = aligned;
113
+ }
114
+ else if (prop === 'align-self') {
115
+ const aligned = mapAlignKeyword(val);
116
+ if (aligned)
117
+ rule.valign = aligned;
118
+ }
119
+ else if (prop === 'justify-content') {
120
+ const aligned = mapAlignKeyword(val);
121
+ if (!rule.hexpand && aligned && rule.halign === null)
122
+ rule.halign = aligned;
123
+ }
124
+ else if (prop === 'align-items') {
125
+ const aligned = mapAlignKeyword(val);
126
+ if (!rule.vexpand && aligned && rule.valign === null)
127
+ rule.valign = aligned;
128
+ }
129
+ }
130
+ /**
131
+ * Parses component CSS rules at runtime into `ParsedStyleRule` descriptors compatible with
132
+ * the Rust engine's CSS Flexbox/Grid and typography/radius extension syntax.
133
+ */
134
+ export function parseRuntimeStyles(cssSource) {
135
+ const cleaned = cssSource
136
+ .replace(/\/\*[\s\S]*?\*\//g, '')
137
+ .replace(/\[_ng(?:content|host)-[^\]]+\]/g, '');
138
+ const rulesByClass = new Map();
139
+ const blockRe = /([^{}@]+)\{([^{}]*)\}/g;
140
+ for (const match of cleaned.matchAll(blockRe)) {
141
+ const selectorList = match[1];
142
+ const body = match[2];
143
+ const declarations = body.split(';');
144
+ for (const rawSelector of selectorList.split(',')) {
145
+ const clsMatch = rawSelector.trim().match(/^\.([a-zA-Z0-9_-]+)$/);
146
+ if (!clsMatch) {
147
+ continue;
148
+ }
149
+ const className = clsMatch[1];
150
+ const rule = rulesByClass.get(className) ?? {
151
+ className,
152
+ background: 'none',
153
+ color: 'none',
154
+ padding: 0,
155
+ spacing: 0,
156
+ borderRadius: null,
157
+ fontSize: null,
158
+ fontWeight: null,
159
+ minWidth: null,
160
+ minHeight: null,
161
+ orientation: null,
162
+ hexpand: null,
163
+ vexpand: null,
164
+ halign: null,
165
+ valign: null,
166
+ minChildren: null,
167
+ maxChildren: null,
168
+ homogeneous: null,
169
+ };
170
+ for (const decl of declarations) {
171
+ const colon = decl.indexOf(':');
172
+ if (colon === -1) {
173
+ continue;
174
+ }
175
+ const prop = decl.slice(0, colon).trim().toLowerCase();
176
+ const val = decl.slice(colon + 1).trim();
177
+ if (!val) {
178
+ continue;
179
+ }
180
+ if (prop === 'background' || prop === 'background-color') {
181
+ rule.background = val;
182
+ }
183
+ else if (prop === 'color') {
184
+ rule.color = val;
185
+ }
186
+ else if (prop === 'padding') {
187
+ const px = parsePixelInt(val);
188
+ if (px !== null)
189
+ rule.padding = px;
190
+ }
191
+ else if (prop === 'gap' || prop === 'spacing') {
192
+ const px = parsePixelInt(val);
193
+ if (px !== null)
194
+ rule.spacing = px;
195
+ }
196
+ else if (prop === 'row-gap' || prop === 'column-gap') {
197
+ if (rule.spacing === 0) {
198
+ const px = parsePixelInt(val);
199
+ if (px !== null)
200
+ rule.spacing = px;
201
+ }
202
+ }
203
+ else if (prop === 'border-radius') {
204
+ const px = parsePixelInt(val);
205
+ if (px !== null)
206
+ rule.borderRadius = px;
207
+ }
208
+ else if (prop === 'font-size') {
209
+ const px = parsePixelInt(val);
210
+ if (px !== null)
211
+ rule.fontSize = px;
212
+ }
213
+ else if (prop === 'font-weight') {
214
+ const kw = val === 'bold' ? 700 : val === 'normal' ? 400 : parsePixelInt(val);
215
+ if (kw !== null)
216
+ rule.fontWeight = kw;
217
+ }
218
+ else if (prop === 'min-width') {
219
+ const px = parsePixelInt(val);
220
+ if (px !== null)
221
+ rule.minWidth = px;
222
+ }
223
+ else if (prop === 'min-height') {
224
+ const px = parsePixelInt(val);
225
+ if (px !== null)
226
+ rule.minHeight = px;
227
+ }
228
+ else {
229
+ applyRuntimeLayoutDeclaration(rule, prop, val);
230
+ }
231
+ }
232
+ rulesByClass.set(className, rule);
233
+ }
234
+ }
235
+ return [...rulesByClass.values()];
236
+ }
237
+ /**
238
+ * Formats optional `ParsedStyleRule` layout/typography fields as space-separated `key=value` tokens.
239
+ */
240
+ export function formatParsedStyleExtensions(rule) {
241
+ const extensions = [];
242
+ for (const [prop, key] of RUNTIME_STYLE_EXTENSIONS) {
243
+ const value = rule[prop];
244
+ if (value !== null && value !== undefined) {
245
+ extensions.push(`${key}=${value}`);
246
+ }
247
+ }
248
+ return extensions.join(' ');
249
+ }
250
+ export function registerParsedStyles(bridge, styles) {
251
+ for (const css of styles) {
252
+ if (typeof css !== 'string' || css.trim().length === 0) {
253
+ continue;
254
+ }
255
+ for (const rule of parseRuntimeStyles(css)) {
256
+ bridge.registerStyle(rule.className, rule.background, rule.color, rule.padding, rule.spacing, formatParsedStyleExtensions(rule));
257
+ }
258
+ }
259
+ }
@@ -96,4 +96,3 @@ export declare const NATIVE_DEVTOOLS_HOOK: InjectionToken<NativeDevToolsHook>;
96
96
  * `@angular/cdk`) work smoothly inside the native desktop runtime.
97
97
  */
98
98
  export declare function provideNativeEcosystemCompat(options?: NativeEcosystemCompatOptions): EnvironmentProviders;
99
- //# sourceMappingURL=ecosystem-compat.d.ts.map
@@ -79,10 +79,10 @@ export class NativeStorage {
79
79
  // Ignore bridge persistence error in restricted sandboxes
80
80
  }
81
81
  }
82
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: NativeStorage, deps: [{ token: NATIVE_BRIDGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
83
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: NativeStorage, providedIn: 'root' });
82
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeStorage, deps: [{ token: NATIVE_BRIDGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
83
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeStorage, providedIn: 'root' });
84
84
  }
85
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: NativeStorage, decorators: [{
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeStorage, decorators: [{
86
86
  type: Injectable,
87
87
  args: [{ providedIn: 'root' }]
88
88
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -116,10 +116,10 @@ export class NativeAriaAnnouncer {
116
116
  history() {
117
117
  return this.announcements;
118
118
  }
119
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: NativeAriaAnnouncer, deps: [{ token: NATIVE_BRIDGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
120
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: NativeAriaAnnouncer, providedIn: 'root' });
119
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeAriaAnnouncer, deps: [{ token: NATIVE_BRIDGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
120
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeAriaAnnouncer, providedIn: 'root' });
121
121
  }
122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: NativeAriaAnnouncer, decorators: [{
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeAriaAnnouncer, decorators: [{
123
123
  type: Injectable,
124
124
  args: [{ providedIn: 'root' }]
125
125
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -167,10 +167,10 @@ export class NativeDevToolsHook {
167
167
  currentState() {
168
168
  return this.latestState;
169
169
  }
170
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: NativeDevToolsHook, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
171
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: NativeDevToolsHook, providedIn: 'root' });
170
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeDevToolsHook, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
171
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeDevToolsHook, providedIn: 'root' });
172
172
  }
173
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.6", ngImport: i0, type: NativeDevToolsHook, decorators: [{
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.3.0", ngImport: i0, type: NativeDevToolsHook, decorators: [{
174
174
  type: Injectable,
175
175
  args: [{ providedIn: 'root' }]
176
176
  }] });
@@ -279,4 +279,3 @@ export function provideNativeEcosystemCompat(options = {}) {
279
279
  { provide: NATIVE_DOCUMENT, useValue: nativeDocument },
280
280
  ]);
281
281
  }
282
- //# sourceMappingURL=ecosystem-compat.js.map
@@ -2,8 +2,7 @@ import { ImageLoader } from '@angular/common';
2
2
  import { EnvironmentProviders } from '@angular/core';
3
3
  /**
4
4
  * Angular `IMAGE_LOADER` backed by the Rust OS asset resolver and disk cache
5
- * (`$XDG_CACHE_HOME/ng-native` and `/tmp/ng_native_pokedex`).
5
+ * (`$XDG_CACHE_HOME/<appId>/images`).
6
6
  */
7
7
  export declare const nativeImageLoader: ImageLoader;
8
8
  export declare function provideNativeImageLoader(): EnvironmentProviders;
9
- //# sourceMappingURL=image-loader.d.ts.map
@@ -3,7 +3,7 @@ import { makeEnvironmentProviders } from '@angular/core';
3
3
  import { ensureNgNativeBridge } from './bridge.js';
4
4
  /**
5
5
  * Angular `IMAGE_LOADER` backed by the Rust OS asset resolver and disk cache
6
- * (`$XDG_CACHE_HOME/ng-native` and `/tmp/ng_native_pokedex`).
6
+ * (`$XDG_CACHE_HOME/<appId>/images`).
7
7
  */
8
8
  export const nativeImageLoader = (config) => {
9
9
  return ensureNgNativeBridge().resolveImageAsset(config.src, config.width);
@@ -11,4 +11,3 @@ export const nativeImageLoader = (config) => {
11
11
  export function provideNativeImageLoader() {
12
12
  return makeEnvironmentProviders([{ provide: IMAGE_LOADER, useValue: nativeImageLoader }]);
13
13
  }
14
- //# sourceMappingURL=image-loader.js.map
@@ -1,10 +1,12 @@
1
- export { ensureNgNativeBridge, type NativeComputeMatch, type NativeConnectivity, type NativeHttpBridgeResponse, type NativeHttpCallKind, type NativeHttpConfig, type NativeHttpRequestOptions, type NativeNetworkStatus, type NativeXdgDirKind, type NgNativeBridge, } from './bridge';
1
+ export { ensureNgNativeBridge, type NativeComputeMatch, type NativeConfirmDialogOptions, type NativeConnectivity, type NativeHttpBridgeResponse, type NativeHttpCallKind, type NativeHttpConfig, type NativeHttpRequestOptions, type NativeMenuItem, type NativeNetworkStatus, type NativeShortcutBinding, type NativeTrayState, type NativeWindowGeometry, type NativeXdgDirKind, type NgNativeBridge, } from './bridge';
2
+ export { formatParsedStyleExtensions, parseRuntimeStyles, type ParsedStyleRule, } from './css-style-parser';
2
3
  export { createNativeDocument, NATIVE_BRIDGE, NATIVE_DEVTOOLS_HOOK, NATIVE_DOCUMENT, NATIVE_STORAGE, NativeAriaAnnouncer, NativeDevToolsHook, NativeStorage, provideNativeEcosystemCompat, type AriaPoliteness, type NativeAriaAnnouncement, type NativeDevToolsConnection, type NativeDevToolsRecord, type NativeDocumentFacade, type NativeEcosystemCompatOptions, } from './ecosystem-compat';
3
4
  export { nativeImageLoader, provideNativeImageLoader } from './image-loader';
5
+ export { NATIVE_UI_DIRECTIVES, NativeContainerDirective, NativeElementDirective, NativeInputWidgetDirective, NativeListDirective, NativeMediaAndMeterDirective, NativeNumericRangeDirective, NativePopoverDirective, NativeTextWidgetDirective, NativeWindowDirective, type NativeAttrInput, type NativeBoolInput, type NativeNumberInput, } from './native-directives';
4
6
  export { getNativeActiveElement, NativeElementNode, setNativeActiveElement, type NativeDomRect, type NativeElementEvent, type NativeEventListener, } from './native-element';
5
- export { NativeRenderer2, NativeRendererFactory2 } from './native-renderer';
7
+ export { HTML_TO_NATIVE_TAG, NativeRenderer2, NativeRendererFactory2, resolveNativeTag, } from './native-renderer';
6
8
  export { NATIVE_WINDOW_NODE_ID, NativeTitleService, provideNativeTitle } from './native-title';
7
9
  export { bootstrapNativeApplication, provideNativePlatform, type NativeBootstrapContext, } from './platform';
8
10
  export { matchesKeyboardEvent, NativeKeyEventsPlugin, NativeSystemErrorHandler, provideNativeErrorHandler, provideNativeKeyEvents, provideSystemLocale, type NativeKeyEventPayload, } from './system-providers';
9
11
  export { NativeViewportScroller, provideNativeViewportScroller } from './viewport-scroller';
10
- //# sourceMappingURL=index.d.ts.map
12
+ export { computeVirtualSliceRange, NativeVirtualListComponent, type NativeVirtualItemContext, type NativeVirtualListEntry, type NativeVirtualRowActivatedEvent, type VirtualSliceRange, } from './virtual-list.component';
package/fesm2022/index.js CHANGED
@@ -1,10 +1,12 @@
1
1
  export { ensureNgNativeBridge, } from './bridge.js';
2
+ export { formatParsedStyleExtensions, parseRuntimeStyles, } from './css-style-parser.js';
2
3
  export { createNativeDocument, NATIVE_BRIDGE, NATIVE_DEVTOOLS_HOOK, NATIVE_DOCUMENT, NATIVE_STORAGE, NativeAriaAnnouncer, NativeDevToolsHook, NativeStorage, provideNativeEcosystemCompat, } from './ecosystem-compat.js';
3
4
  export { nativeImageLoader, provideNativeImageLoader } from './image-loader.js';
5
+ export { NATIVE_UI_DIRECTIVES, NativeContainerDirective, NativeElementDirective, NativeInputWidgetDirective, NativeListDirective, NativeMediaAndMeterDirective, NativeNumericRangeDirective, NativePopoverDirective, NativeTextWidgetDirective, NativeWindowDirective, } from './native-directives.js';
4
6
  export { getNativeActiveElement, NativeElementNode, setNativeActiveElement, } from './native-element.js';
5
- export { NativeRenderer2, NativeRendererFactory2 } from './native-renderer.js';
7
+ export { HTML_TO_NATIVE_TAG, NativeRenderer2, NativeRendererFactory2, resolveNativeTag, } from './native-renderer.js';
6
8
  export { NATIVE_WINDOW_NODE_ID, NativeTitleService, provideNativeTitle } from './native-title.js';
7
9
  export { bootstrapNativeApplication, provideNativePlatform, } from './platform.js';
8
10
  export { matchesKeyboardEvent, NativeKeyEventsPlugin, NativeSystemErrorHandler, provideNativeErrorHandler, provideNativeKeyEvents, provideSystemLocale, } from './system-providers.js';
9
11
  export { NativeViewportScroller, provideNativeViewportScroller } from './viewport-scroller.js';
10
- //# sourceMappingURL=index.js.map
12
+ export { computeVirtualSliceRange, NativeVirtualListComponent, } from './virtual-list.component.js';
@@ -0,0 +1,188 @@
1
+ import * as i0 from "@angular/core";
2
+ export type NativeAttrInput = string | number | boolean | null | undefined;
3
+ export type NativeBoolInput = boolean | string | number | null | undefined;
4
+ export type NativeNumberInput = number | string | null | undefined;
5
+ /**
6
+ * Common layout, visibility, accessibility, and interaction directive covering all native desktop
7
+ * widget elements (`<ng-*>`, `<gtk-*>`, `<adw-*>`).
8
+ */
9
+ export declare class NativeElementDirective {
10
+ private readonly renderer;
11
+ private readonly el;
12
+ set hexpand(val: NativeBoolInput);
13
+ set vexpand(val: NativeBoolInput);
14
+ set halign(val: NativeAttrInput);
15
+ set valign(val: NativeAttrInput);
16
+ set width(val: NativeNumberInput);
17
+ set height(val: NativeNumberInput);
18
+ set minWidth(val: NativeNumberInput);
19
+ set minHeight(val: NativeNumberInput);
20
+ set margin(val: NativeNumberInput);
21
+ set marginTop(val: NativeNumberInput);
22
+ set marginBottom(val: NativeNumberInput);
23
+ set marginStart(val: NativeNumberInput);
24
+ set marginEnd(val: NativeNumberInput);
25
+ set visible(val: NativeBoolInput);
26
+ set sensitive(val: NativeBoolInput);
27
+ set disabled(val: NativeBoolInput);
28
+ set tooltip(val: NativeAttrInput);
29
+ set eventMask(val: NativeAttrInput);
30
+ set dropTarget(val: NativeBoolInput);
31
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeElementDirective, never>;
32
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NativeElementDirective, "ng-window,adw-window,ng-dialog,gtk-dialog,adw-dialog,ng-header-bar,adw-header-bar,gtk-header-bar,ng-scroll,gtk-scrolled-window,ng-box,gtk-box,ng-grid,gtk-grid,ng-separator,gtk-separator,ng-button,gtk-button,ng-label,gtk-label,ng-entry,gtk-entry,ng-switch,gtk-switch,ng-checkbox,ng-check,ng-check-button,gtk-check-button,ng-slider,ng-scale,gtk-scale,ng-select,ng-dropdown,gtk-dropdown,gtk-drop-down,ng-image,adw-image,gtk-picture,ng-picture,ng-level-bar,gtk-level-bar,ng-flow,ng-flow-box,gtk-flow-box,ng-spinner,gtk-spinner,ng-progress-bar,gtk-progress-bar,ng-paned,gtk-paned,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-text-view,gtk-text-view,ng-password-entry,gtk-password-entry,ng-spin-button,gtk-spin-button,ng-search-entry,gtk-search-entry,ng-clamp,adw-clamp,ng-list,ng-table,gtk-list-box,gtk-list-view,ng-popover,gtk-popover,ng-menu,adw-entry-row,adw-password-entry-row,adw-switch-row,adw-combo-row,adw-spin-row", never, { "hexpand": { "alias": "hexpand"; "required": false; }; "vexpand": { "alias": "vexpand"; "required": false; }; "halign": { "alias": "halign"; "required": false; }; "valign": { "alias": "valign"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "minWidth": { "alias": "min-width"; "required": false; }; "minHeight": { "alias": "min-height"; "required": false; }; "margin": { "alias": "margin"; "required": false; }; "marginTop": { "alias": "margin-top"; "required": false; }; "marginBottom": { "alias": "margin-bottom"; "required": false; }; "marginStart": { "alias": "margin-start"; "required": false; }; "marginEnd": { "alias": "margin-end"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; "sensitive": { "alias": "sensitive"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tooltip": { "alias": "tooltip"; "required": false; }; "eventMask": { "alias": "event-mask"; "required": false; }; "dropTarget": { "alias": "drop-target"; "required": false; }; }, {}, never, never, true, never>;
33
+ }
34
+ /**
35
+ * Typed directive for top-level native windows, dialogs, and header bars (`<ng-window>`,
36
+ * `<ng-dialog>`, `<ng-header-bar>`).
37
+ */
38
+ export declare class NativeWindowDirective {
39
+ private readonly renderer;
40
+ private readonly el;
41
+ set title(val: NativeAttrInput);
42
+ set subtitle(val: NativeAttrInput);
43
+ set showTitleButtons(val: NativeBoolInput);
44
+ set icon(val: NativeAttrInput);
45
+ set resizable(val: NativeBoolInput);
46
+ set decorated(val: NativeBoolInput);
47
+ set modal(val: NativeBoolInput);
48
+ set transientForAttr(val: NativeAttrInput);
49
+ set transientFor(val: NativeAttrInput);
50
+ set preventClose(val: NativeBoolInput);
51
+ set preventCloseAttr(val: NativeBoolInput);
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeWindowDirective, never>;
53
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NativeWindowDirective, "ng-window,adw-window,ng-dialog,gtk-dialog,adw-dialog,ng-header-bar,adw-header-bar,gtk-header-bar", never, { "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "showTitleButtons": { "alias": "show-title-buttons"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "decorated": { "alias": "decorated"; "required": false; }; "modal": { "alias": "modal"; "required": false; }; "transientForAttr": { "alias": "transient-for"; "required": false; }; "transientFor": { "alias": "transientFor"; "required": false; }; "preventClose": { "alias": "preventClose"; "required": false; }; "preventCloseAttr": { "alias": "prevent-close"; "required": false; }; }, {}, never, never, true, never>;
54
+ }
55
+ /**
56
+ * Typed directive for native layout containers, grids, flow boxes, split panes, stacks, clamps,
57
+ * scroll viewports, separators, and expanders.
58
+ */
59
+ export declare class NativeContainerDirective {
60
+ private readonly renderer;
61
+ private readonly el;
62
+ set orientation(val: NativeAttrInput);
63
+ set spacing(val: NativeNumberInput);
64
+ set gap(val: NativeNumberInput);
65
+ set rowSpacing(val: NativeNumberInput);
66
+ set columnSpacing(val: NativeNumberInput);
67
+ set minChildren(val: NativeNumberInput);
68
+ set maxChildren(val: NativeNumberInput);
69
+ set minPerRow(val: NativeNumberInput);
70
+ set maxPerRow(val: NativeNumberInput);
71
+ set homogeneous(val: NativeBoolInput);
72
+ set position(val: NativeNumberInput);
73
+ set visibleChild(val: NativeAttrInput);
74
+ set activePage(val: NativeAttrInput);
75
+ set transition(val: NativeAttrInput);
76
+ set transitionType(val: NativeAttrInput);
77
+ set label(val: NativeAttrInput);
78
+ set title(val: NativeAttrInput);
79
+ set expanded(val: NativeBoolInput);
80
+ set open(val: NativeBoolInput);
81
+ set maxSize(val: NativeNumberInput);
82
+ set maximumSize(val: NativeNumberInput);
83
+ set scrollTo(val: NativeAttrInput);
84
+ set scrollAnchor(val: NativeAttrInput);
85
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeContainerDirective, never>;
86
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NativeContainerDirective, "ng-box,gtk-box,ng-grid,gtk-grid,ng-flow,ng-flow-box,gtk-flow-box,ng-paned,gtk-paned,ng-scroll,gtk-scrolled-window,ng-stack,gtk-stack,adw-navigation-view,ng-expander,gtk-expander,ng-clamp,adw-clamp,ng-separator,gtk-separator", never, { "orientation": { "alias": "orientation"; "required": false; }; "spacing": { "alias": "spacing"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; "rowSpacing": { "alias": "row-spacing"; "required": false; }; "columnSpacing": { "alias": "column-spacing"; "required": false; }; "minChildren": { "alias": "min-children"; "required": false; }; "maxChildren": { "alias": "max-children"; "required": false; }; "minPerRow": { "alias": "min-per-row"; "required": false; }; "maxPerRow": { "alias": "max-per-row"; "required": false; }; "homogeneous": { "alias": "homogeneous"; "required": false; }; "position": { "alias": "position"; "required": false; }; "visibleChild": { "alias": "visible-child"; "required": false; }; "activePage": { "alias": "active-page"; "required": false; }; "transition": { "alias": "transition"; "required": false; }; "transitionType": { "alias": "transition-type"; "required": false; }; "label": { "alias": "label"; "required": false; }; "title": { "alias": "title"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "open": { "alias": "open"; "required": false; }; "maxSize": { "alias": "max-size"; "required": false; }; "maximumSize": { "alias": "maximum-size"; "required": false; }; "scrollTo": { "alias": "scroll-to"; "required": false; }; "scrollAnchor": { "alias": "scroll-anchor"; "required": false; }; }, {}, never, never, true, never>;
87
+ }
88
+ /**
89
+ * Typed directive for native labels and action buttons (`<ng-label>`, `<ng-button>`).
90
+ */
91
+ export declare class NativeTextWidgetDirective {
92
+ private readonly renderer;
93
+ private readonly el;
94
+ set label(val: NativeAttrInput);
95
+ set text(val: NativeAttrInput);
96
+ set wrap(val: NativeBoolInput);
97
+ set selectable(val: NativeBoolInput);
98
+ set ellipsize(val: NativeAttrInput);
99
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeTextWidgetDirective, never>;
100
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NativeTextWidgetDirective, "ng-button,gtk-button,ng-label,gtk-label", never, { "label": { "alias": "label"; "required": false; }; "text": { "alias": "text"; "required": false; }; "wrap": { "alias": "wrap"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "ellipsize": { "alias": "ellipsize"; "required": false; }; }, {}, never, never, true, never>;
101
+ }
102
+ /**
103
+ * Typed directive for native images, level bars, progress bars, and spinners.
104
+ */
105
+ export declare class NativeMediaAndMeterDirective {
106
+ private readonly renderer;
107
+ private readonly el;
108
+ set src(val: NativeAttrInput);
109
+ set ngSrc(val: NativeAttrInput);
110
+ set alt(val: NativeAttrInput);
111
+ set value(val: NativeNumberInput);
112
+ set min(val: NativeNumberInput);
113
+ set max(val: NativeNumberInput);
114
+ set indeterminate(val: NativeBoolInput);
115
+ set active(val: NativeBoolInput);
116
+ set spinning(val: NativeBoolInput);
117
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeMediaAndMeterDirective, never>;
118
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NativeMediaAndMeterDirective, "ng-image,adw-image,gtk-picture,ng-picture,ng-level-bar,gtk-level-bar,ng-progress-bar,gtk-progress-bar,ng-spinner,gtk-spinner", never, { "src": { "alias": "src"; "required": false; }; "ngSrc": { "alias": "ngSrc"; "required": false; }; "alt": { "alias": "alt"; "required": false; }; "value": { "alias": "value"; "required": false; }; "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "active": { "alias": "active"; "required": false; }; "spinning": { "alias": "spinning"; "required": false; }; }, {}, never, never, true, never>;
119
+ }
120
+ /**
121
+ * Typed directive for native text inputs, switches, checkboxes, sliders, dropdowns, and spin buttons.
122
+ */
123
+ export declare class NativeInputWidgetDirective {
124
+ private readonly renderer;
125
+ private readonly el;
126
+ set placeholder(val: NativeAttrInput);
127
+ set value(val: NativeAttrInput);
128
+ set text(val: NativeAttrInput);
129
+ set active(val: NativeBoolInput);
130
+ set checked(val: NativeBoolInput);
131
+ set label(val: NativeAttrInput);
132
+ set options(val: NativeAttrInput);
133
+ set selected(val: NativeNumberInput);
134
+ set editable(val: NativeBoolInput);
135
+ set monospace(val: NativeBoolInput);
136
+ set showPeekIcon(val: NativeBoolInput);
137
+ set peek(val: NativeBoolInput);
138
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeInputWidgetDirective, never>;
139
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NativeInputWidgetDirective, "ng-entry,gtk-entry,ng-search-entry,gtk-search-entry,ng-password-entry,gtk-password-entry,ng-text-view,gtk-text-view,ng-switch,gtk-switch,ng-checkbox,ng-check,ng-check-button,gtk-check-button,ng-slider,ng-scale,gtk-scale,ng-spin-button,gtk-spin-button,ng-select,ng-dropdown,gtk-dropdown,gtk-drop-down,adw-entry-row,adw-password-entry-row,adw-switch-row,adw-combo-row,adw-spin-row", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "value": { "alias": "value"; "required": false; }; "text": { "alias": "text"; "required": false; }; "active": { "alias": "active"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "label": { "alias": "label"; "required": false; }; "options": { "alias": "options"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "editable": { "alias": "editable"; "required": false; }; "monospace": { "alias": "monospace"; "required": false; }; "showPeekIcon": { "alias": "show-peek-icon"; "required": false; }; "peek": { "alias": "peek"; "required": false; }; }, {}, never, never, true, never>;
140
+ }
141
+ /**
142
+ * Typed directive for native virtualized lists and tables (`<ng-list>`, `<ng-table>`).
143
+ */
144
+ export declare class NativeListDirective {
145
+ private readonly renderer;
146
+ private readonly el;
147
+ set selectionModeAttr(val: NativeAttrInput);
148
+ set selectionMode(val: NativeAttrInput);
149
+ set showSeparatorsAttr(val: NativeBoolInput);
150
+ set showSeparators(val: NativeBoolInput);
151
+ set separators(val: NativeBoolInput);
152
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeListDirective, never>;
153
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NativeListDirective, "ng-list,ng-table,gtk-list-box,gtk-list-view", never, { "selectionModeAttr": { "alias": "selection-mode"; "required": false; }; "selectionMode": { "alias": "selectionMode"; "required": false; }; "showSeparatorsAttr": { "alias": "show-separators"; "required": false; }; "showSeparators": { "alias": "showSeparators"; "required": false; }; "separators": { "alias": "separators"; "required": false; }; }, {}, never, never, true, never>;
154
+ }
155
+ /**
156
+ * Typed directive for native anchored popovers and context menus (`<ng-popover>`, `<ng-menu>`).
157
+ */
158
+ export declare class NativePopoverDirective {
159
+ private readonly renderer;
160
+ private readonly el;
161
+ set open(val: NativeBoolInput);
162
+ set position(val: NativeAttrInput);
163
+ set placement(val: NativeAttrInput);
164
+ set autohide(val: NativeBoolInput);
165
+ set hasArrowAttr(val: NativeBoolInput);
166
+ set hasArrow(val: NativeBoolInput);
167
+ set anchor(val: NativeAttrInput);
168
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativePopoverDirective, never>;
169
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NativePopoverDirective, "ng-popover,gtk-popover,ng-menu", never, { "open": { "alias": "open"; "required": false; }; "position": { "alias": "position"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "autohide": { "alias": "autohide"; "required": false; }; "hasArrowAttr": { "alias": "has-arrow"; "required": false; }; "hasArrow": { "alias": "hasArrow"; "required": false; }; "anchor": { "alias": "anchor"; "required": false; }; }, {}, never, never, true, never>;
170
+ }
171
+ /**
172
+ * Typed directive for native numeric range & stepper inputs (`<ng-slider>`, `<ng-spin-button>`),
173
+ * isolating `min`/`max`/`step` away from boolean toggles for Signal Forms type safety.
174
+ */
175
+ export declare class NativeNumericRangeDirective {
176
+ private readonly renderer;
177
+ private readonly el;
178
+ set min(val: NativeNumberInput);
179
+ set max(val: NativeNumberInput);
180
+ set step(val: NativeNumberInput);
181
+ static ɵfac: i0.ɵɵFactoryDeclaration<NativeNumericRangeDirective, never>;
182
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NativeNumericRangeDirective, "ng-slider,ng-scale,gtk-scale,ng-spin-button,gtk-spin-button,adw-spin-row", never, { "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "step": { "alias": "step"; "required": false; }; }, {}, never, never, true, never>;
183
+ }
184
+ /**
185
+ * Convenience directive bundle enabling typed bindings on `<ng-*>`, `<gtk-*>`, and `<adw-*>` tags
186
+ * in standalone Angular components without `CUSTOM_ELEMENTS_SCHEMA`.
187
+ */
188
+ export declare const NATIVE_UI_DIRECTIVES: readonly [typeof NativeElementDirective, typeof NativeWindowDirective, typeof NativeContainerDirective, typeof NativeTextWidgetDirective, typeof NativeMediaAndMeterDirective, typeof NativeInputWidgetDirective, typeof NativeNumericRangeDirective, typeof NativeListDirective, typeof NativePopoverDirective];