@symbiote-native/angular 0.7.0 → 1.0.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 +3 -3
- package/babel-lower-host-primitives.cjs +636 -0
- package/babel-register-composed.cjs +21 -3
- package/build/angular/anchor-host-registry.js +3 -1
- package/build/angular/anchor-host-registry.js.map +1 -1
- package/build/angular/bootstrap.js +1 -1
- package/build/angular/bootstrap.js.map +1 -1
- package/build/angular/components/activity-indicator/index.android.js +7 -2
- package/build/angular/components/activity-indicator/index.android.js.map +1 -1
- package/build/angular/components/activity-indicator/index.ios.js +3 -1
- package/build/angular/components/activity-indicator/index.ios.js.map +1 -1
- package/build/angular/components/activity-indicator/shared.d.ts +1 -1
- package/build/angular/components/activity-indicator/shared.js +1 -1
- package/build/angular/components/activity-indicator/shared.js.map +1 -1
- package/build/angular/components/button.d.ts +3 -0
- package/build/angular/components/button.js +22 -5
- package/build/angular/components/button.js.map +1 -1
- package/build/angular/components/flat-list/index.d.ts +1 -1
- package/build/angular/components/flat-list/index.js +47 -14
- package/build/angular/components/flat-list/index.js.map +1 -1
- package/build/angular/components/image/index.android.js +4 -10
- package/build/angular/components/image/index.android.js.map +1 -1
- package/build/angular/components/image/index.ios.js +4 -10
- package/build/angular/components/image/index.ios.js.map +1 -1
- package/build/angular/components/image/shared.d.ts +4 -4
- package/build/angular/components/image/shared.js +51 -33
- package/build/angular/components/image/shared.js.map +1 -1
- package/build/angular/components/image-background.d.ts +3 -0
- package/build/angular/components/image-background.js +32 -9
- package/build/angular/components/image-background.js.map +1 -1
- package/build/angular/components/input-accessory-view/index.d.ts +2 -1
- package/build/angular/components/input-accessory-view/index.js +18 -16
- package/build/angular/components/input-accessory-view/index.js.map +1 -1
- package/build/angular/components/keyboard-avoiding-view/index.d.ts +3 -1
- package/build/angular/components/keyboard-avoiding-view/index.js +56 -19
- package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
- package/build/angular/components/modal/index.d.ts +1 -0
- package/build/angular/components/modal/index.js +21 -10
- package/build/angular/components/modal/index.js.map +1 -1
- package/build/angular/components/pressable/index.d.ts +10 -5
- package/build/angular/components/pressable/index.js +61 -16
- package/build/angular/components/pressable/index.js.map +1 -1
- package/build/angular/components/refresh-control/index.d.ts +2 -1
- package/build/angular/components/refresh-control/index.js +13 -9
- package/build/angular/components/refresh-control/index.js.map +1 -1
- package/build/angular/components/safe-area-view/index.d.ts +3 -1
- package/build/angular/components/safe-area-view/index.js +22 -20
- package/build/angular/components/safe-area-view/index.js.map +1 -1
- package/build/angular/components/scroll-view/index.android.js +44 -14
- package/build/angular/components/scroll-view/index.android.js.map +1 -1
- package/build/angular/components/scroll-view/index.ios.js +13 -5
- package/build/angular/components/scroll-view/index.ios.js.map +1 -1
- package/build/angular/components/scroll-view/projection.d.ts +32 -0
- package/build/angular/components/scroll-view/projection.js +212 -47
- package/build/angular/components/scroll-view/projection.js.map +1 -1
- package/build/angular/components/scroll-view/shared.d.ts +2 -0
- package/build/angular/components/scroll-view/shared.js +48 -11
- package/build/angular/components/scroll-view/shared.js.map +1 -1
- package/build/angular/components/scroll-view/sticky-header.js +7 -3
- package/build/angular/components/scroll-view/sticky-header.js.map +1 -1
- package/build/angular/components/section-list/index.d.ts +9 -1
- package/build/angular/components/section-list/index.js +72 -18
- package/build/angular/components/section-list/index.js.map +1 -1
- package/build/angular/components/switch/index.android.js +23 -9
- package/build/angular/components/switch/index.android.js.map +1 -1
- package/build/angular/components/switch/index.ios.js +23 -9
- package/build/angular/components/switch/index.ios.js.map +1 -1
- package/build/angular/components/switch/shared.d.ts +1 -1
- package/build/angular/components/switch/shared.js +5 -2
- package/build/angular/components/switch/shared.js.map +1 -1
- package/build/angular/components/text-input.d.ts +8 -2
- package/build/angular/components/text-input.js +79 -34
- package/build/angular/components/text-input.js.map +1 -1
- package/build/angular/components/touchable/index.d.ts +36 -7
- package/build/angular/components/touchable/index.js +280 -72
- package/build/angular/components/touchable/index.js.map +1 -1
- package/build/angular/components/touchable-native-feedback/index.d.ts +2 -1
- package/build/angular/components/touchable-native-feedback/index.js +19 -17
- package/build/angular/components/touchable-native-feedback/index.js.map +1 -1
- package/build/angular/components/virtualized-list/directives.js +4 -0
- package/build/angular/components/virtualized-list/directives.js.map +1 -1
- package/build/angular/components/virtualized-list/index.d.ts +8 -2
- package/build/angular/components/virtualized-list/index.js +207 -61
- package/build/angular/components/virtualized-list/index.js.map +1 -1
- package/build/angular/components/virtualized-section-list/directives.js.map +1 -1
- package/build/angular/components/virtualized-section-list/index.d.ts +21 -1
- package/build/angular/components/virtualized-section-list/index.js +100 -22
- package/build/angular/components/virtualized-section-list/index.js.map +1 -1
- package/build/angular/components.d.ts +2 -2
- package/build/angular/components.js +1 -1
- package/build/angular/components.js.map +1 -1
- package/build/angular/create-portal/index.d.ts +11 -2
- package/build/angular/create-portal/index.js +42 -12
- package/build/angular/create-portal/index.js.map +1 -1
- package/build/angular/create-tunnel/index.js.map +1 -1
- package/build/angular/descriptor-to-angular/index.js +3 -1
- package/build/angular/descriptor-to-angular/index.js.map +1 -1
- package/build/angular/diagnostics.d.ts +33 -0
- package/build/angular/diagnostics.js +82 -0
- package/build/angular/diagnostics.js.map +1 -0
- package/build/angular/gate-demand.d.ts +37 -0
- package/build/angular/gate-demand.js +84 -0
- package/build/angular/gate-demand.js.map +1 -0
- package/build/angular/host-instance/index.js +1 -1
- package/build/angular/host-instance/index.js.map +1 -1
- package/build/angular/index.d.ts +6 -2
- package/build/angular/index.js +16 -1
- package/build/angular/index.js.map +1 -1
- package/build/angular/modules/animated/create-animated-component.d.ts +1 -0
- package/build/angular/modules/animated/create-animated-component.js +41 -18
- package/build/angular/modules/animated/create-animated-component.js.map +1 -1
- package/build/angular/modules/app-registry/index.js.map +1 -1
- package/build/angular/modules/status-bar/index.js +1 -1
- package/build/angular/modules/status-bar/index.js.map +1 -1
- package/build/angular/primitives/index.d.ts +31 -2
- package/build/angular/primitives/index.js +81 -3
- package/build/angular/primitives/index.js.map +1 -1
- package/build/angular/primitives/shared.d.ts +9 -1
- package/build/angular/primitives/shared.js +49 -3
- package/build/angular/primitives/shared.js.map +1 -1
- package/build/angular/register.d.ts +1 -0
- package/build/angular/register.js +35 -0
- package/build/angular/register.js.map +1 -0
- package/build/angular/render/index.js +51 -6
- package/build/angular/render/index.js.map +1 -1
- package/build/angular/renderer/index.d.ts +1 -0
- package/build/angular/renderer/index.js +157 -21
- package/build/angular/renderer/index.js.map +1 -1
- package/build/angular/services/color-scheme.service.js.map +1 -1
- package/build/angular/services/window-dimensions.service.js +1 -1
- package/build/angular/services/window-dimensions.service.js.map +1 -1
- package/build/angular/state-style.d.ts +9 -0
- package/build/angular/state-style.js +39 -0
- package/build/angular/state-style.js.map +1 -0
- package/metro-transformer.cjs +69 -0
- package/package.json +27 -8
- package/src/anchor-host-registry.ts +3 -1
- package/src/bootstrap.ts +4 -1
- package/src/components/activity-indicator/index.android.ts +7 -2
- package/src/components/activity-indicator/index.ios.ts +3 -1
- package/src/components/activity-indicator/shared.ts +32 -13
- package/src/components/button.ts +36 -6
- package/src/components/flat-list/index.ts +91 -29
- package/src/components/image/index.android.ts +9 -6
- package/src/components/image/index.ios.ts +9 -6
- package/src/components/image/shared.ts +110 -45
- package/src/components/image-background.ts +47 -10
- package/src/components/input-accessory-view/index.ts +41 -18
- package/src/components/keyboard-avoiding-view/index.ts +76 -22
- package/src/components/modal/index.ts +39 -12
- package/src/components/pressable/index.ts +121 -31
- package/src/components/refresh-control/index.ts +36 -13
- package/src/components/safe-area-view/index.ts +44 -19
- package/src/components/scroll-view/index.android.ts +31 -9
- package/src/components/scroll-view/index.ios.ts +17 -4
- package/src/components/scroll-view/projection.ts +290 -63
- package/src/components/scroll-view/shared.ts +124 -30
- package/src/components/scroll-view/sticky-header.ts +25 -8
- package/src/components/section-list/index.ts +79 -19
- package/src/components/switch/index.android.ts +18 -7
- package/src/components/switch/index.ios.ts +18 -7
- package/src/components/switch/shared.ts +15 -4
- package/src/components/text-input.ts +119 -31
- package/src/components/touchable/index.ts +339 -72
- package/src/components/touchable-native-feedback/index.ts +50 -18
- package/src/components/virtualized-list/directives.ts +19 -5
- package/src/components/virtualized-list/index.ts +292 -72
- package/src/components/virtualized-section-list/directives.ts +6 -3
- package/src/components/virtualized-section-list/index.ts +164 -34
- package/src/components.ts +6 -1
- package/src/create-portal/index.ts +47 -11
- package/src/create-tunnel/index.ts +3 -1
- package/src/descriptor-to-angular/index.ts +29 -8
- package/src/diagnostics.ts +138 -0
- package/src/gate-demand.ts +109 -0
- package/src/host-instance/index.ts +9 -3
- package/src/index.ts +33 -2
- package/src/modules/animated/create-animated-component.ts +67 -19
- package/src/modules/app-registry/index.ts +3 -1
- package/src/modules/status-bar/index.ts +13 -4
- package/src/primitives/index.ts +73 -2
- package/src/primitives/shared.ts +70 -9
- package/src/register.ts +43 -0
- package/src/render/index.ts +59 -7
- package/src/renderer/index.ts +209 -37
- package/src/services/color-scheme.service.ts +3 -1
- package/src/services/window-dimensions.service.ts +11 -4
- package/src/state-style.ts +39 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/app-registry/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,qDAAqD;AACrD,gFAAgF;AAChF,kGAAkG;AAClG,yFAAyF;AACzF,iFAAiF;AACjF,2FAA2F;AAG3F,OAAO,EACL,iBAAiB,EACjB,IAAI,GAGL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/app-registry/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,qDAAqD;AACrD,gFAAgF;AAChF,kGAAkG;AAClG,yFAAyF;AACzF,iFAAiF;AACjF,2FAA2F;AAG3F,OAAO,EACL,iBAAiB,EACjB,IAAI,GAGL,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAcrC,SAAS,WAAW,CAClB,iBAAqC,EACrC,2BAAwE;IAExE,OAAO,aAAa,CAAC,EAAE;QACrB,IAAI,CAAC,oCAAoC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1E,oFAAoF;QACpF,6CAA6C;QAC7C,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE;YAChD,YAAY,EAAE,aAAa,CAAC,YAAY;YACxC,gBAAgB,EAAE,2BAA2B,EAAE,EAAE,CAAC,aAAa,CAAC;SACjE,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,iBAAiB,CAGzD,WAAW,CAAC,CAAC;AAEf,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// declarative shape: a component that renders nothing and re-applies the props through
|
|
5
5
|
// ngOnChanges on mount + every prop change. Imperative statics are attached to the component
|
|
6
6
|
// object the same way RN does.
|
|
7
|
-
import { Component, Input } from '@angular/core';
|
|
7
|
+
import { Component, Input, } from '@angular/core';
|
|
8
8
|
import { applyStatusBarProps, statusBarImperative, statusBarCurrentHeight, } from '@symbiote-native/engine';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
class StatusBarComponent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/status-bar/index.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,yGAAyG;AACzG,wFAAwF;AACxF,uFAAuF;AACvF,6FAA6F;AAC7F,+BAA+B;AAE/B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/status-bar/index.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,yGAAyG;AACzG,wFAAwF;AACxF,uF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1
|
+
import { type OnInit, type SimpleChanges } from '@angular/core';
|
|
2
|
+
import { type IEllipsizeMode } from '@symbiote-native/components';
|
|
1
3
|
import { SymbiotePrimitiveHost } from './shared';
|
|
2
4
|
import * as i0 from "@angular/core";
|
|
3
5
|
export { anchorHostStyle, anchorStyleProp, stableAnchorStyle, SymbioteHostPropsDirective, SymbioteStyleInputDirective, } from './shared';
|
|
@@ -5,9 +7,24 @@ export declare class ViewHost extends SymbiotePrimitiveHost {
|
|
|
5
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<ViewHost, never>;
|
|
6
8
|
static ɵcmp: i0.ɵɵComponentDeclaration<ViewHost, "symbiote-view, View", never, {}, {}, never, ["*"], true, never>;
|
|
7
9
|
}
|
|
8
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Text carries the two defaults RN's Text.js applies unconditionally (`ellipsizeMode ?? 'tail'`,
|
|
12
|
+
* `allowFontScaling !== false`, Text.js:289 and :291). Without them native falls back to `clip` and a
|
|
13
|
+
* clamped Text cuts mid-word with no ellipsis — device-observed on the other adapters 2026-08-19.
|
|
14
|
+
*
|
|
15
|
+
* They are declared as real `@Input()`s, unlike the pass-through props the base's comment
|
|
16
|
+
* describes, for one reason: the default can only be applied by code that can SEE whether the
|
|
17
|
+
* caller supplied a value. A host-binding pass-through is invisible here, so blindly writing
|
|
18
|
+
* 'tail' would silently overwrite an explicit `ellipsizeMode="clip"`.
|
|
19
|
+
*/
|
|
20
|
+
export declare class TextHost extends SymbiotePrimitiveHost implements OnInit {
|
|
21
|
+
ellipsizeMode?: IEllipsizeMode;
|
|
22
|
+
allowFontScaling?: boolean;
|
|
23
|
+
ngOnInit(): void;
|
|
24
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
25
|
+
private applyTextDefaults;
|
|
9
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextHost, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TextHost, "symbiote-text, Text", never, {}, {}, never, ["*"], true, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextHost, "symbiote-text, Text", never, { "ellipsizeMode": { "alias": "ellipsizeMode"; "required": false; }; "allowFontScaling": { "alias": "allowFontScaling"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
11
28
|
}
|
|
12
29
|
export declare class ImageHost extends SymbiotePrimitiveHost {
|
|
13
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<ImageHost, never>;
|
|
@@ -37,10 +54,22 @@ export declare class MultilineTextInputHost extends SymbiotePrimitiveHost {
|
|
|
37
54
|
static ɵfac: i0.ɵɵFactoryDeclaration<MultilineTextInputHost, never>;
|
|
38
55
|
static ɵcmp: i0.ɵɵComponentDeclaration<MultilineTextInputHost, "symbiote-text-input-multiline", never, {}, {}, never, ["*"], true, never>;
|
|
39
56
|
}
|
|
57
|
+
export declare class ManagedTextInputHost extends SymbiotePrimitiveHost {
|
|
58
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ManagedTextInputHost, never>;
|
|
59
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ManagedTextInputHost, "symbiote-text-input-managed", never, {}, {}, never, ["*"], true, never>;
|
|
60
|
+
}
|
|
61
|
+
export declare class ManagedMultilineTextInputHost extends SymbiotePrimitiveHost {
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ManagedMultilineTextInputHost, never>;
|
|
63
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ManagedMultilineTextInputHost, "symbiote-text-input-multiline-managed", never, {}, {}, never, ["*"], true, never>;
|
|
64
|
+
}
|
|
40
65
|
export declare class SwitchHost extends SymbiotePrimitiveHost {
|
|
41
66
|
static ɵfac: i0.ɵɵFactoryDeclaration<SwitchHost, never>;
|
|
42
67
|
static ɵcmp: i0.ɵɵComponentDeclaration<SwitchHost, "symbiote-switch", never, {}, {}, never, ["*"], true, never>;
|
|
43
68
|
}
|
|
69
|
+
export declare class ManagedSwitchHost extends SymbiotePrimitiveHost {
|
|
70
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ManagedSwitchHost, never>;
|
|
71
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ManagedSwitchHost, "symbiote-switch-managed", never, {}, {}, never, ["*"], true, never>;
|
|
72
|
+
}
|
|
44
73
|
export declare class ActivityIndicatorHost extends SymbiotePrimitiveHost {
|
|
45
74
|
static ɵfac: i0.ɵɵFactoryDeclaration<ActivityIndicatorHost, never>;
|
|
46
75
|
static ɵcmp: i0.ɵɵComponentDeclaration<ActivityIndicatorHost, "symbiote-activity-indicator", never, {}, {}, never, ["*"], true, never>;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// components that directly own the `symbiote-*` selectors; every composed adapter
|
|
3
3
|
// component imports them and renders them in its template. Declaring `style` as a real
|
|
4
4
|
// Angular input prevents Angular's CSS style engine from decomposing RN `StyleProp` arrays.
|
|
5
|
-
import { Component } from '@angular/core';
|
|
5
|
+
import { Component, Input, } from '@angular/core';
|
|
6
|
+
import { resolveTextProps, } from '@symbiote-native/components';
|
|
6
7
|
import { SymbiotePrimitiveHost } from './shared';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export { anchorHostStyle, anchorStyleProp, stableAnchorStyle, SymbioteHostPropsDirective, SymbioteStyleInputDirective, } from './shared';
|
|
@@ -18,9 +19,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
18
19
|
template: '<ng-content></ng-content>',
|
|
19
20
|
}]
|
|
20
21
|
}] });
|
|
22
|
+
/**
|
|
23
|
+
* Text carries the two defaults RN's Text.js applies unconditionally (`ellipsizeMode ?? 'tail'`,
|
|
24
|
+
* `allowFontScaling !== false`, Text.js:289 and :291). Without them native falls back to `clip` and a
|
|
25
|
+
* clamped Text cuts mid-word with no ellipsis — device-observed on the other adapters 2026-08-19.
|
|
26
|
+
*
|
|
27
|
+
* They are declared as real `@Input()`s, unlike the pass-through props the base's comment
|
|
28
|
+
* describes, for one reason: the default can only be applied by code that can SEE whether the
|
|
29
|
+
* caller supplied a value. A host-binding pass-through is invisible here, so blindly writing
|
|
30
|
+
* 'tail' would silently overwrite an explicit `ellipsizeMode="clip"`.
|
|
31
|
+
*/
|
|
21
32
|
export class TextHost extends SymbiotePrimitiveHost {
|
|
33
|
+
ellipsizeMode;
|
|
34
|
+
allowFontScaling;
|
|
35
|
+
// ngOnChanges fires before ngOnInit when a binding exists, and not at all when none does —
|
|
36
|
+
// so both hooks are needed to guarantee the defaults land exactly once per settled value.
|
|
37
|
+
ngOnInit() {
|
|
38
|
+
this.applyTextDefaults();
|
|
39
|
+
}
|
|
40
|
+
ngOnChanges(changes) {
|
|
41
|
+
super.ngOnChanges(changes);
|
|
42
|
+
if ('ellipsizeMode' in changes || 'allowFontScaling' in changes) {
|
|
43
|
+
this.applyTextDefaults();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
applyTextDefaults() {
|
|
47
|
+
const resolved = resolveTextProps({
|
|
48
|
+
ellipsizeMode: this.ellipsizeMode,
|
|
49
|
+
allowFontScaling: this.allowFontScaling,
|
|
50
|
+
});
|
|
51
|
+
this.setHostProp('ellipsizeMode', resolved.ellipsizeMode);
|
|
52
|
+
this.setHostProp('allowFontScaling', resolved.allowFontScaling);
|
|
53
|
+
}
|
|
22
54
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TextHost, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
23
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: TextHost, isStandalone: true, selector: "symbiote-text, Text", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
55
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: TextHost, isStandalone: true, selector: "symbiote-text, Text", inputs: { ellipsizeMode: "ellipsizeMode", allowFontScaling: "allowFontScaling" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
24
56
|
}
|
|
25
57
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TextHost, decorators: [{
|
|
26
58
|
type: Component,
|
|
@@ -29,7 +61,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
29
61
|
standalone: true,
|
|
30
62
|
template: '<ng-content></ng-content>',
|
|
31
63
|
}]
|
|
32
|
-
}]
|
|
64
|
+
}], propDecorators: { ellipsizeMode: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}], allowFontScaling: [{
|
|
67
|
+
type: Input
|
|
68
|
+
}] } });
|
|
33
69
|
export class ImageHost extends SymbiotePrimitiveHost {
|
|
34
70
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ImageHost, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
35
71
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: ImageHost, isStandalone: true, selector: "symbiote-image", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
@@ -90,6 +126,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
90
126
|
template: '<ng-content></ng-content>',
|
|
91
127
|
}]
|
|
92
128
|
}] });
|
|
129
|
+
// The pair the LOWERED path commits — declared so the tag alphabet stays complete, though no
|
|
130
|
+
// Angular template renders them: this adapter has no lowering transform. The `-managed` pair below
|
|
131
|
+
// is what its own TextInput renders.
|
|
93
132
|
export class TextInputHost extends SymbiotePrimitiveHost {
|
|
94
133
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: TextInputHost, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
95
134
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: TextInputHost, isStandalone: true, selector: "symbiote-text-input", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
@@ -114,6 +153,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
114
153
|
template: '<ng-content></ng-content>',
|
|
115
154
|
}]
|
|
116
155
|
}] });
|
|
156
|
+
export class ManagedTextInputHost extends SymbiotePrimitiveHost {
|
|
157
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ManagedTextInputHost, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
158
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: ManagedTextInputHost, isStandalone: true, selector: "symbiote-text-input-managed", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
159
|
+
}
|
|
160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ManagedTextInputHost, decorators: [{
|
|
161
|
+
type: Component,
|
|
162
|
+
args: [{
|
|
163
|
+
selector: 'symbiote-text-input-managed',
|
|
164
|
+
standalone: true,
|
|
165
|
+
template: '<ng-content></ng-content>',
|
|
166
|
+
}]
|
|
167
|
+
}] });
|
|
168
|
+
export class ManagedMultilineTextInputHost extends SymbiotePrimitiveHost {
|
|
169
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ManagedMultilineTextInputHost, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
170
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: ManagedMultilineTextInputHost, isStandalone: true, selector: "symbiote-text-input-multiline-managed", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
171
|
+
}
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ManagedMultilineTextInputHost, decorators: [{
|
|
173
|
+
type: Component,
|
|
174
|
+
args: [{
|
|
175
|
+
selector: 'symbiote-text-input-multiline-managed',
|
|
176
|
+
standalone: true,
|
|
177
|
+
template: '<ng-content></ng-content>',
|
|
178
|
+
}]
|
|
179
|
+
}] });
|
|
117
180
|
export class SwitchHost extends SymbiotePrimitiveHost {
|
|
118
181
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SwitchHost, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
119
182
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: SwitchHost, isStandalone: true, selector: "symbiote-switch", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
@@ -126,6 +189,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
126
189
|
template: '<ng-content></ng-content>',
|
|
127
190
|
}]
|
|
128
191
|
}] });
|
|
192
|
+
// The component path's spelling — same native Switch/AndroidSwitch, a tag the engine's Switch
|
|
193
|
+
// behavior does not carry. See `component-names/shared.ts` for why the wrapper may not share the
|
|
194
|
+
// lowered tag; mirrors `ManagedTextInputHost` above.
|
|
195
|
+
export class ManagedSwitchHost extends SymbiotePrimitiveHost {
|
|
196
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ManagedSwitchHost, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
197
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: ManagedSwitchHost, isStandalone: true, selector: "symbiote-switch-managed", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
198
|
+
}
|
|
199
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ManagedSwitchHost, decorators: [{
|
|
200
|
+
type: Component,
|
|
201
|
+
args: [{
|
|
202
|
+
selector: 'symbiote-switch-managed',
|
|
203
|
+
standalone: true,
|
|
204
|
+
template: '<ng-content></ng-content>',
|
|
205
|
+
}]
|
|
206
|
+
}] });
|
|
129
207
|
export class ActivityIndicatorHost extends SymbiotePrimitiveHost {
|
|
130
208
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ActivityIndicatorHost, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
131
209
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: ActivityIndicatorHost, isStandalone: true, selector: "symbiote-activity-indicator", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,kFAAkF;AAClF,uFAAuF;AACvF,4FAA4F;AAE5F,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,kFAAkF;AAClF,uFAAuF;AACvF,4FAA4F;AAE5F,OAAO,EACL,SAAS,EACT,KAAK,GAGN,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,GAEjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;;AAEjD,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,UAAU,CAAC;AAOlB,MAAM,OAAO,QAAS,SAAQ,qBAAqB;uGAAtC,QAAQ;2FAAR,QAAQ,sGAFT,2B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;oBACvC,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,2BAA2B;iBACtC;;AAQD,MAAM,OAAO,gBAAiB,SAAQ,qBAAqB;uGAA9C,gBAAgB;2FAAhB,gBAAgB,0GAFjB,2BAA2B;;2FAE1B,gBAAgB;kBAL5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,yBAAyB;oBACnC,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,2BAA2B;iBACtC;;AAQD,MAAM,OAAO,SAAU,SAAQ,qBAAqB;uGAAvC,SAAS;2FAAT,SAAS,iGAFV,2BAA2B;;2FAE1B,SAAS;kBALrB,SAAS;mBAAC;oBACT,QAAQ,EAAE,gBAAgB;oBAC1B,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,2BAA2B;iBACtC;;AAQD,MAAM,OAAO,kBAAmB,SAAQ,qBAAqB;uGAAhD,kBAAkB;2FAAlB,kBAAkB,2GAFnB,2BAA2B;;2FAE1B,kBAAkB;kBAL9B,SAAS;mBAAC;oBACT,QAAQ,EAAE,0BAA0B;oBACpC,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,2BAA2B;iBACtC;;AAQD,MAAM,OAAO,sBAAuB,SAAQ,qBAAqB;uGAApD,sBAAsB;2FAAtB,sBAAsB,gHAFvB,2BAA2B;;2FAE1B,sBAAsB;kBALlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,+BAA+B;oBACzC,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,2BAA2B;iBACtC"}
|
|
@@ -91,9 +91,10 @@ export declare class SymbioteStyleInputDirective implements DoCheck, OnChanges {
|
|
|
91
91
|
* Angular then treats them as host property bindings and still dispatches them through the
|
|
92
92
|
* custom renderer's `setProperty`, so the engine's `routeProp` handles them as usual.
|
|
93
93
|
*/
|
|
94
|
-
export declare abstract class SymbiotePrimitiveHost implements OnChanges {
|
|
94
|
+
export declare abstract class SymbiotePrimitiveHost implements DoCheck, OnChanges {
|
|
95
95
|
private readonly renderer;
|
|
96
96
|
private readonly elementRef;
|
|
97
|
+
ngDoCheck(): void;
|
|
97
98
|
style?: IStyleProp<unknown>;
|
|
98
99
|
/**
|
|
99
100
|
* The underlying engine host node (public instance). Exposed so `findNodeHandle` can resolve
|
|
@@ -101,6 +102,12 @@ export declare abstract class SymbiotePrimitiveHost implements OnChanges {
|
|
|
101
102
|
*/
|
|
102
103
|
get nativeElement(): IHostInstance;
|
|
103
104
|
ngOnChanges(changes: SimpleChanges): void;
|
|
105
|
+
/**
|
|
106
|
+
* Push one resolved prop onto the host element. `protected` rather than exposing the injected
|
|
107
|
+
* Renderer2/ElementRef, so a subclass applying its own defaults (TextHost) uses the same single
|
|
108
|
+
* write path this base already uses for `style`.
|
|
109
|
+
*/
|
|
110
|
+
protected setHostProp(key: string, value: unknown): void;
|
|
104
111
|
static ɵfac: i0.ɵɵFactoryDeclaration<SymbiotePrimitiveHost, never>;
|
|
105
112
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SymbiotePrimitiveHost, never, never, { "style": { "alias": "style"; "required": false; }; }, {}, never, never, true, never>;
|
|
106
113
|
}
|
|
@@ -118,6 +125,7 @@ export declare class SymbioteHostPropsDirective {
|
|
|
118
125
|
private readonly elementRef;
|
|
119
126
|
private readonly cdr;
|
|
120
127
|
private readonly wrappers;
|
|
128
|
+
private pushed;
|
|
121
129
|
get node(): unknown;
|
|
122
130
|
set symbioteHostProps(props: Record<string, unknown>);
|
|
123
131
|
private wrapCallback;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectorRef, Directive, ElementRef, inject, Input, Renderer2, } from '@angular/core';
|
|
2
|
+
import { countAngular } from '../diagnostics';
|
|
2
3
|
import { flattenStyle, isSymbioteNode, } from '@symbiote-native/engine';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
/**
|
|
@@ -72,7 +73,9 @@ function shallowStyleEqual(a, b) {
|
|
|
72
73
|
*/
|
|
73
74
|
export function stableAnchorStyle(elementRef, explicitStyle, previous) {
|
|
74
75
|
const next = flattenStyle([anchorHostStyle(elementRef), explicitStyle]);
|
|
75
|
-
return isRecord(previous) && shallowStyleEqual(previous, next)
|
|
76
|
+
return isRecord(previous) && shallowStyleEqual(previous, next)
|
|
77
|
+
? previous
|
|
78
|
+
: next;
|
|
76
79
|
}
|
|
77
80
|
const ON_PREFIX = /^on[A-Z]/;
|
|
78
81
|
// The one `onX` that fires per FRAME rather than per gesture, and with sticky headers RN pins
|
|
@@ -130,10 +133,12 @@ export class SymbioteStyleInputDirective {
|
|
|
130
133
|
// check re-dirties the view every tick and free-runs CD, the hazard `stableAnchorStyle` above
|
|
131
134
|
// prevents one level up.
|
|
132
135
|
ngDoCheck() {
|
|
136
|
+
countAngular('styleChecks');
|
|
133
137
|
const current = anchorHostStyle(this.elementRef);
|
|
134
138
|
if (isAnchorStyleUnchanged(this.lastAnchorStyle, current))
|
|
135
139
|
return;
|
|
136
140
|
this.lastAnchorStyle = current;
|
|
141
|
+
countAngular('styleMarks');
|
|
137
142
|
this.cdr.markForCheck();
|
|
138
143
|
}
|
|
139
144
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SymbioteStyleInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -153,7 +158,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
153
158
|
function isAnchorStyleUnchanged(previous, next) {
|
|
154
159
|
if (Object.is(previous, next))
|
|
155
160
|
return true;
|
|
156
|
-
return isRecord(previous) && isRecord(next) && shallowStyleEqual(previous, next);
|
|
161
|
+
return (isRecord(previous) && isRecord(next) && shallowStyleEqual(previous, next));
|
|
157
162
|
}
|
|
158
163
|
/**
|
|
159
164
|
* Base for all Angular primitive host components (`symbiote-view`, `symbiote-text`, ...).
|
|
@@ -170,6 +175,12 @@ function isAnchorStyleUnchanged(previous, next) {
|
|
|
170
175
|
export class SymbiotePrimitiveHost {
|
|
171
176
|
renderer = inject(Renderer2);
|
|
172
177
|
elementRef = inject(ElementRef);
|
|
178
|
+
// Counting only. Angular calls this once per view per check, so it is the only honest measure of
|
|
179
|
+
// how much tree a tick walks - and with CheckAlways primitives that is the whole application, not
|
|
180
|
+
// the screen on top. One integer increment next to a template refresh is not measurable.
|
|
181
|
+
ngDoCheck() {
|
|
182
|
+
countAngular('viewsChecked');
|
|
183
|
+
}
|
|
173
184
|
style;
|
|
174
185
|
/**
|
|
175
186
|
* The underlying engine host node (public instance). Exposed so `findNodeHandle` can resolve
|
|
@@ -182,7 +193,15 @@ export class SymbiotePrimitiveHost {
|
|
|
182
193
|
if (!('style' in changes))
|
|
183
194
|
return;
|
|
184
195
|
const value = this.style === undefined ? undefined : flattenStyle(this.style);
|
|
185
|
-
this.
|
|
196
|
+
this.setHostProp('style', value);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Push one resolved prop onto the host element. `protected` rather than exposing the injected
|
|
200
|
+
* Renderer2/ElementRef, so a subclass applying its own defaults (TextHost) uses the same single
|
|
201
|
+
* write path this base already uses for `style`.
|
|
202
|
+
*/
|
|
203
|
+
setHostProp(key, value) {
|
|
204
|
+
this.renderer.setProperty(this.elementRef.nativeElement, key, value);
|
|
186
205
|
}
|
|
187
206
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SymbiotePrimitiveHost, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
188
207
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: SymbiotePrimitiveHost, isStandalone: true, inputs: { style: "style" }, usesOnChanges: true, ngImport: i0 });
|
|
@@ -218,13 +237,40 @@ export class SymbioteHostPropsDirective {
|
|
|
218
237
|
// defeats every downstream identity check on the bag, so nothing upstream could ever conclude
|
|
219
238
|
// "this bag is unchanged" while a callback prop was in it.
|
|
220
239
|
wrappers = new WeakMap();
|
|
240
|
+
// Values pushed by the previous bag, so a push writes only what actually moved. Copied rather
|
|
241
|
+
// than aliased: a component is free to hand back the same object with mutated fields.
|
|
242
|
+
pushed = {};
|
|
221
243
|
get node() {
|
|
222
244
|
return this.elementRef.nativeElement;
|
|
223
245
|
}
|
|
246
|
+
// MEASURED 2026-08-20, headless 1000-row create: writing every key of every bag cost 104 000
|
|
247
|
+
// engine setProp calls where Solid's identical screen cost 12 000 — and 90 000 of them carried
|
|
248
|
+
// `undefined`. A composed component's bag is a FIXED-SHAPE literal (Pressable's is ~48 keys,
|
|
249
|
+
// most of them unset on any given instance), so the first push of a fresh node spends most of
|
|
250
|
+
// its work deleting keys the node never had. Diffing per key removes exactly that: an unset key
|
|
251
|
+
// is skipped on mount and still written the moment it changes to or from a real value.
|
|
224
252
|
set symbioteHostProps(props) {
|
|
253
|
+
const pushed = this.pushed;
|
|
254
|
+
// Only keys the node actually carries, so the vanished-key sweep below walks a handful rather
|
|
255
|
+
// than the bag's whole declared shape.
|
|
256
|
+
const next = {};
|
|
225
257
|
for (const [key, value] of Object.entries(props)) {
|
|
258
|
+
if (value !== undefined)
|
|
259
|
+
next[key] = value;
|
|
260
|
+
if (Object.is(pushed[key], value))
|
|
261
|
+
continue;
|
|
226
262
|
this.renderer.setProperty(this.elementRef.nativeElement, key, this.wrapCallback(key, value));
|
|
227
263
|
}
|
|
264
|
+
// A bag's key SET is not fixed across pushes — resolveAccessibilityProps folds aria-* aliases
|
|
265
|
+
// into a different shape once any of them holds a value — and a key that vanishes must clear
|
|
266
|
+
// the prop rather than leave the last value on the native view. A key still IN the bag was
|
|
267
|
+
// already handled above, `undefined` included.
|
|
268
|
+
for (const key of Object.keys(pushed)) {
|
|
269
|
+
if (key in props)
|
|
270
|
+
continue;
|
|
271
|
+
this.renderer.setProperty(this.elementRef.nativeElement, key, undefined);
|
|
272
|
+
}
|
|
273
|
+
this.pushed = next;
|
|
228
274
|
}
|
|
229
275
|
// A flat-bag `onX` callback (responder negotiation, onLongPress, …) is invoked by the engine's
|
|
230
276
|
// event dispatch — a plain JS call, entirely outside Angular. In Angular 20 a component compiles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/primitives/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EAET,UAAU,EACV,MAAM,EACN,KAAK,EAEL,SAAS,GAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,YAAY,EACZ,cAAc,GAGf,MAAM,yBAAyB,CAAC;;AAEjC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,eAAe,CAAC,UAA+B;IAC7D,MAAM,IAAI,GAAG,UAAU,CAAC,aAAa,CAAC;IACtC,OAAO,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,+FAA+F;AAC/F,+FAA+F;AAC/F,wFAAwF;AACxF,8FAA8F;AAC9F,wFAAwF;AACxF,yFAAyF;AACzF,wFAAwF;AACxF,SAAS,YAAY,CAAI,KAAc;IACrC,OAAO,CACL,KAAK,KAAK,SAAS;QACnB,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,KAAK;QACf,KAAK,KAAK,EAAE;QACZ,OAAO,KAAK,KAAK,QAAQ,CAC1B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/primitives/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,SAAS,EAET,UAAU,EACV,MAAM,EACN,KAAK,EAEL,SAAS,GAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,cAAc,GAGf,MAAM,yBAAyB,CAAC;;AAEjC;;;;;;;;;;;;;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KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;YAC9D,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;YACxB,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC;IACjB,CAAC;uGAvFU,0BAA0B;2FAA1B,0BAA0B;;2FAA1B,0BAA0B;kBANtC,SAAS;mBAAC;oBACT,QAAQ,EAAE,qBAAqB;oBAC/B,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,cAAc;oBACxB,MAAM,EAAE,CAAC,mBAAmB,CAAC;iBAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Side-effect ONLY. Exports nothing, and must never be re-exported from the barrel.
|
|
2
|
+
//
|
|
3
|
+
// A lowered `<symbiote-pressable>`/`<symbiote-text-input>` is a bare custom element with no
|
|
4
|
+
// component behind it, so the press machine and the controlled-input machine have to live on the
|
|
5
|
+
// engine node itself — reached by `registerPressableBehavior()`/`registerTextInputBehavior()`
|
|
6
|
+
// having run before the first node of that tag is created.
|
|
7
|
+
//
|
|
8
|
+
// Metro turns on `inlineRequires` for PRODUCTION only, moving a `require()` down to the first place
|
|
9
|
+
// its binding is used as a VALUE; a barrel's `export { X } from './x'` compiles to a lazy getter,
|
|
10
|
+
// so a module reached only that way never evaluates unless something names it as a value — silent
|
|
11
|
+
// in Release builds alone, invisible to tsc, to vitest, and to grepping the bundle (see CLAUDE.md,
|
|
12
|
+
// "Never make correctness depend on a module's load-time side effect"). A bare
|
|
13
|
+
// `import './register';` placed NEXT TO a re-export of the same specifier does not help either —
|
|
14
|
+
// Babel merges the two into one dependency and the merged one stays lazy. This is the shape that
|
|
15
|
+
// survives both traps, matching `adapters/{vue,svelte,solid}/src/register.ts` and
|
|
16
|
+
// `packages/slider/src/{react,vue,svelte,angular}/index.ts`.
|
|
17
|
+
import { registerImageBehavior, registerInputAccessoryViewBehavior, registerPressableBehavior, registerSwitchBehavior, registerTextInputBehavior, } from '@symbiote-native/components';
|
|
18
|
+
registerPressableBehavior();
|
|
19
|
+
// Only the LOWERED tags carry this — the wrapper renders `symbiote-text-input-managed` /
|
|
20
|
+
// `symbiote-text-input-multiline-managed` and keeps running its own lifecycle. One owner per node;
|
|
21
|
+
// see `component-names/shared.ts`.
|
|
22
|
+
registerTextInputBehavior();
|
|
23
|
+
// Same reason as TextInput: the wrapper renders `symbiote-switch-managed` and runs its own
|
|
24
|
+
// lastNativeReport/snap-back lifecycle, so the engine's copy attaches only to the bare tag.
|
|
25
|
+
registerSwitchBehavior();
|
|
26
|
+
// Image owns no runtime — its behavior is a prop FOLD and nothing else, and it is registered on the
|
|
27
|
+
// same `symbiote-image` the wrapper already emits rather than on a `-managed` twin. That is safe
|
|
28
|
+
// only because the mapping is idempotent, which `core/components/src/behaviors/image.test.ts`
|
|
29
|
+
// asserts rather than assumes; a wrapper-built node simply folds a second time and nothing moves.
|
|
30
|
+
registerImageBehavior();
|
|
31
|
+
// Fold-only, and it shares the wrapper's tag for the same reason Image does: the mapping has no
|
|
32
|
+
// aliasing at all, so a wrapper-built node folding a second time moves nothing.
|
|
33
|
+
// `core/components/src/behaviors/input-accessory-view.test.ts` asserts that rather than assuming it.
|
|
34
|
+
registerInputAccessoryViewBehavior();
|
|
35
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/register.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,4FAA4F;AAC5F,iGAAiG;AACjG,8FAA8F;AAC9F,2DAA2D;AAC3D,EAAE;AACF,oGAAoG;AACpG,kGAAkG;AAClG,kGAAkG;AAClG,mGAAmG;AACnG,+EAA+E;AAC/E,iGAAiG;AACjG,iGAAiG;AACjG,kFAAkF;AAClF,6DAA6D;AAC7D,OAAO,EACL,qBAAqB,EACrB,kCAAkC,EAClC,yBAAyB,EACzB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AAErC,yBAAyB,EAAE,CAAC;AAC5B,yFAAyF;AACzF,mGAAmG;AACnG,mCAAmC;AACnC,yBAAyB,EAAE,CAAC;AAC5B,2FAA2F;AAC3F,4FAA4F;AAC5F,sBAAsB,EAAE,CAAC;AAEzB,oGAAoG;AACpG,iGAAiG;AACjG,8FAA8F;AAC9F,kGAAkG;AAClG,qBAAqB,EAAE,CAAC;AAExB,gGAAgG;AAChG,gFAAgF;AAChF,qGAAqG;AACrG,kCAAkC,EAAE,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// SymbioteRendererFactory provided so Angular drives the engine, which commits into
|
|
5
5
|
// nativeFabricUIManager; RN's own renderer never in the path. Angular twin of
|
|
6
6
|
// adapters/vue/src/render.ts.
|
|
7
|
-
import { createElement as createEngineElement, createSurface, disposeRoot, dlog, toPublicInstance, } from '@symbiote-native/engine';
|
|
7
|
+
import { createElement as createEngineElement, createSurface, disposeRoot, dlog, reportUncaughtError, toPublicInstance, } from '@symbiote-native/engine';
|
|
8
8
|
import { descriptorFor } from '@symbiote-native/components';
|
|
9
9
|
import { ApplicationRef, createComponent, createEnvironmentInjector, DOCUMENT, ErrorHandler, RendererFactory2, ɵINJECTOR_SCOPE as INJECTOR_SCOPE, ɵprovideZonelessChangeDetectionInternal as provideZonelessChangeDetectionInternal, } from '@angular/core';
|
|
10
10
|
import { SymbioteRendererFactory } from '../renderer';
|
|
@@ -37,9 +37,36 @@ function asAngularHost(hostNode) {
|
|
|
37
37
|
// that isn't one of our primitives), so the root needs an explicit host too, one we then hand
|
|
38
38
|
// to the wrapper as projectable content.
|
|
39
39
|
function createDetachedViewHost() {
|
|
40
|
-
|
|
40
|
+
// 'symbiote-view', not 'View': the public name is not a Fabric view name, and until
|
|
41
|
+
// makeDescriptorFor learned to reject one it fell through to a view literally named `View`.
|
|
42
|
+
const descriptor = descriptorFor('symbiote-view');
|
|
41
43
|
return toPublicInstance(createEngineElement(descriptor.component, descriptor.isText));
|
|
42
44
|
}
|
|
45
|
+
// Angular's whole unhandled-error funnel: INTERNAL_APPLICATION_ERROR_HANDLER resolves this token
|
|
46
|
+
// and hands it everything the framework caught on the app's behalf — a scheduled (async) tick that
|
|
47
|
+
// threw, a template listener that threw, a rejected pending task. Routed to the engine so an
|
|
48
|
+
// Angular app reaches the same native redbox as a React one instead of a console line nobody sees
|
|
49
|
+
// off a dev machine.
|
|
50
|
+
//
|
|
51
|
+
// There is deliberately no caught-vs-uncaught split here, unlike the React adapter's
|
|
52
|
+
// onUncaughtError/onCaughtError pair. Angular has no error boundary, and every path where the app
|
|
53
|
+
// DID handle something keeps clear of this seam on its own: a `@defer` block with an `@error`
|
|
54
|
+
// branch renders that branch (defer/rendering.ts calls handleUncaughtError only when there is
|
|
55
|
+
// none), `resource()` parks the failure in its own error signal, and an app-level try/catch or
|
|
56
|
+
// `catchError` never reaches Angular at all. So anything arriving here is by construction
|
|
57
|
+
// unclaimed, and the redbox is the right answer for all of it.
|
|
58
|
+
//
|
|
59
|
+
// Two things this must not do. It must not also call `super.handleError` — reportUncaughtError
|
|
60
|
+
// picks exactly one channel (host reporter or console) precisely because RN routes console.error
|
|
61
|
+
// into LogBox too, so the pair would double-report every error. And it must not throw: the
|
|
62
|
+
// scheduler invokes this from inside its own `catch` (zoneless_scheduling_impl.ts's tick), where a
|
|
63
|
+
// second throw escapes to the host and kills the "report and keep running" behaviour the provider
|
|
64
|
+
// exists for.
|
|
65
|
+
class SymbioteErrorHandler extends ErrorHandler {
|
|
66
|
+
handleError(error) {
|
|
67
|
+
reportUncaughtError(error, { origin: 'angular render' });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
43
70
|
function applyInputs(cmpRef, initialProps) {
|
|
44
71
|
if (initialProps === undefined)
|
|
45
72
|
return;
|
|
@@ -70,7 +97,23 @@ export function mount(rootTag, rootComponent, options) {
|
|
|
70
97
|
provide: RendererFactory2,
|
|
71
98
|
useValue: new SymbioteRendererFactory(surface),
|
|
72
99
|
},
|
|
73
|
-
|
|
100
|
+
// `getElementById` is not decoration: `resource()` resolves TransferState, whose root
|
|
101
|
+
// factory runs `retrieveTransferredState(doc, appId)` ->
|
|
102
|
+
// `doc.getElementById(appId + '-state')` (core/src/transfer_state.ts:156) to pick up
|
|
103
|
+
// server-rendered state. A stub without it makes that a TypeError, and because the throw
|
|
104
|
+
// happens while the component is being constructed, the ENTIRE screen renders nothing —
|
|
105
|
+
// white body under a native header that navigation drew anyway, no error surfaced. The
|
|
106
|
+
// `optional: true` on the injector lookup does not help: the token resolves, its factory
|
|
107
|
+
// is what throws. Returning null is the honest client answer — there is no server here, so
|
|
108
|
+
// `script?.tagName` short-circuits and the caller gets `{}`.
|
|
109
|
+
{
|
|
110
|
+
provide: DOCUMENT,
|
|
111
|
+
useValue: {
|
|
112
|
+
head: surface,
|
|
113
|
+
body: surface,
|
|
114
|
+
getElementById: () => null,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
74
117
|
// createEnvironmentInjector with a null parent scopes this injector to {'environment'}
|
|
75
118
|
// only (see EnvironmentNgModuleRefAdapter), so providedIn:'root' tokens — ApplicationRef
|
|
76
119
|
// included — never resolve (R3Injector.get walks up for a `scopes` containing 'root', and
|
|
@@ -94,9 +137,11 @@ export function mount(rootTag, rootComponent, options) {
|
|
|
94
137
|
// `injector.get(ErrorHandler)`; a normal `bootstrapApplication` registers that token by
|
|
95
138
|
// default, but our from-scratch environment injector never did, so the lookup itself threw
|
|
96
139
|
// NG0201 and replaced the real error with "No provider found for ErrorHandler" — any async
|
|
97
|
-
// tick() exception crashed hard, uncaught, instead of being reported.
|
|
98
|
-
//
|
|
99
|
-
|
|
140
|
+
// tick() exception crashed hard, uncaught, instead of being reported. The token still has to
|
|
141
|
+
// be provided for exactly that reason; what it resolves to is now SymbioteErrorHandler
|
|
142
|
+
// (see above), which reports through the engine instead of Angular's `console.error('ERROR',
|
|
143
|
+
// e)` and, like the default, returns rather than rethrows so the app keeps running.
|
|
144
|
+
{ provide: ErrorHandler, useClass: SymbioteErrorHandler },
|
|
100
145
|
ColorSchemeService,
|
|
101
146
|
WindowDimensionsService,
|
|
102
147
|
], rootInjectorParent());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/render/index.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,yFAAyF;AACzF,2FAA2F;AAC3F,oFAAoF;AACpF,8EAA8E;AAC9E,8BAA8B;AAE9B,OAAO,EACL,aAAa,IAAI,mBAAmB,EACpC,aAAa,EACb,WAAW,EACX,IAAI,EACJ,gBAAgB,GAIjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EACL,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,eAAe,IAAI,cAAc,EACjC,uCAAuC,IAAI,sCAAsC,GAIlF,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE1E,0FAA0F;AAC1F,4FAA4F;AAC5F,6FAA6F;AAC7F,qFAAqF;AACrF,6FAA6F;AAC7F,0FAA0F;AAC1F,2CAA2C;AAC3C,SAAS,kBAAkB;IACzB,OAAO,IAAsC,CAAC;AAChD,CAAC;AACD,SAAS,aAAa,CAAC,QAAyC;IAC9D,yFAAyF;IACzF,uFAAuF;IACvF,wCAAwC;IACxC,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE;QACzC,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,eAAe;KACvB,CAAC,CAAC;IACH,OAAO,QAA8B,CAAC;AACxC,CA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