@symbiote-native/angular 0.1.0 → 0.1.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.
@@ -1,138 +0,0 @@
1
- // Shared types + the input-field base for the Angular DrawerLayoutAndroid: the Props/Handle
2
- // contract both the real Android build (index.android.ts) and the off-Android fallback (index.ts)
3
- // implement. The platform-agnostic enums + the imperative handle live in @symbiote/components
4
- // (shared verbatim with React/Vue, the single source of truth); this file adds only the
5
- // Angular-facing prop surface. Per ADR 0019 the filename selects the build; no Platform.OS read
6
- // anywhere. The Angular twin of the Vue folder's shared.ts, with the bulky @Input field block
7
- // pulled into a base class both builds extend (the Switch SwitchBase precedent), so the input
8
- // surface is declared once. The `inputs:` array itself stays an inline literal per @Component
9
- // (ngc AOT needs a static literal, so it cannot be hoisted into a shared const).
10
- import { Directive, EventEmitter, Output } from '@angular/core';
11
- import * as i0 from "@angular/core";
12
- // The shared @Input/@Output field block. The concrete @Component lists the matching `inputs:`
13
- // array (the SwitchBase pattern) for plain inputs, plus `outputs:` for the events below. Aria props
14
- // use their literal kebab names so a field directly satisfies the optional IAriaProps member and is
15
- // its own input name (no alias bookkeeping). accessibilityInputs() folds the whole bag for
16
- // resolveAccessibilityProps, the way Modal's does. @Directive() is required the moment this base
17
- // carries decorated members (@Output() here) — ngc's AOT build (NG2007) enforces it, mirroring
18
- // ScrollViewBase/SwitchBase.
19
- export class DrawerLayoutAndroidBase {
20
- // The drawer/accessibility lifecycle as real Angular events: `(drawerOpen)="onOpen()"`, not
21
- // `[onDrawerOpen]="onOpen"` — mirrors Pressable's press/hover @Output() conversion. The
22
- // concrete @Component lists these SAME names in its `outputs:` array (the Switch precedent
23
- // for a field declared on a shared base class rather than the concrete class itself).
24
- drawerOpen = new EventEmitter();
25
- drawerClose = new EventEmitter();
26
- drawerSlide = new EventEmitter();
27
- drawerStateChanged = new EventEmitter();
28
- accessibilityAction = new EventEmitter();
29
- accessibilityTap = new EventEmitter();
30
- magicTap = new EventEmitter();
31
- accessibilityEscape = new EventEmitter();
32
- drawerWidth;
33
- drawerPosition;
34
- drawerLockMode;
35
- keyboardDismissMode;
36
- drawerBackgroundColor;
37
- statusBarBackgroundColor;
38
- style;
39
- nativeID;
40
- testID;
41
- accessible;
42
- accessibilityLabel;
43
- accessibilityHint;
44
- accessibilityRole;
45
- accessibilityState;
46
- accessibilityValue;
47
- accessibilityActions;
48
- accessibilityLabelledBy;
49
- importantForAccessibility;
50
- accessibilityLiveRegion;
51
- screenReaderFocusable;
52
- accessibilityElementsHidden;
53
- accessibilityViewIsModal;
54
- accessibilityIgnoresInvertColors;
55
- accessibilityLanguage;
56
- accessibilityRespondsToUserInteraction;
57
- accessibilityShowsLargeContentViewer;
58
- accessibilityLargeContentTitle;
59
- role;
60
- 'aria-label';
61
- 'aria-labelledby';
62
- 'aria-live';
63
- 'aria-hidden';
64
- 'aria-busy';
65
- 'aria-checked';
66
- 'aria-disabled';
67
- 'aria-expanded';
68
- 'aria-selected';
69
- 'aria-modal';
70
- 'aria-valuemax';
71
- 'aria-valuemin';
72
- 'aria-valuenow';
73
- 'aria-valuetext';
74
- // Typed as the a11y intersection WITH the string index (the bag resolveAccessibilityProps folds
75
- // aria-*/role into the RN accessibility* names of), so its result stays assignable to the
76
- // resolveDrawerLayout passthrough.
77
- accessibilityInputs() {
78
- return {
79
- nativeID: this.nativeID,
80
- testID: this.testID,
81
- accessible: this.accessible,
82
- accessibilityLabel: this.accessibilityLabel,
83
- accessibilityHint: this.accessibilityHint,
84
- accessibilityRole: this.accessibilityRole,
85
- accessibilityState: this.accessibilityState,
86
- accessibilityValue: this.accessibilityValue,
87
- accessibilityActions: this.accessibilityActions,
88
- accessibilityLabelledBy: this.accessibilityLabelledBy,
89
- importantForAccessibility: this.importantForAccessibility,
90
- accessibilityLiveRegion: this.accessibilityLiveRegion,
91
- screenReaderFocusable: this.screenReaderFocusable,
92
- accessibilityElementsHidden: this.accessibilityElementsHidden,
93
- accessibilityViewIsModal: this.accessibilityViewIsModal,
94
- accessibilityIgnoresInvertColors: this.accessibilityIgnoresInvertColors,
95
- accessibilityLanguage: this.accessibilityLanguage,
96
- accessibilityRespondsToUserInteraction: this.accessibilityRespondsToUserInteraction,
97
- accessibilityShowsLargeContentViewer: this.accessibilityShowsLargeContentViewer,
98
- accessibilityLargeContentTitle: this.accessibilityLargeContentTitle,
99
- role: this.role,
100
- 'aria-label': this['aria-label'],
101
- 'aria-labelledby': this['aria-labelledby'],
102
- 'aria-live': this['aria-live'],
103
- 'aria-hidden': this['aria-hidden'],
104
- 'aria-busy': this['aria-busy'],
105
- 'aria-checked': this['aria-checked'],
106
- 'aria-disabled': this['aria-disabled'],
107
- 'aria-expanded': this['aria-expanded'],
108
- 'aria-selected': this['aria-selected'],
109
- 'aria-modal': this['aria-modal'],
110
- 'aria-valuemax': this['aria-valuemax'],
111
- 'aria-valuemin': this['aria-valuemin'],
112
- 'aria-valuenow': this['aria-valuenow'],
113
- 'aria-valuetext': this['aria-valuetext'],
114
- };
115
- }
116
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DrawerLayoutAndroidBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
117
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.4", type: DrawerLayoutAndroidBase, isStandalone: true, outputs: { drawerOpen: "drawerOpen", drawerClose: "drawerClose", drawerSlide: "drawerSlide", drawerStateChanged: "drawerStateChanged", accessibilityAction: "accessibilityAction", accessibilityTap: "accessibilityTap", magicTap: "magicTap", accessibilityEscape: "accessibilityEscape" }, ngImport: i0 });
118
- }
119
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.4", ngImport: i0, type: DrawerLayoutAndroidBase, decorators: [{
120
- type: Directive
121
- }], propDecorators: { drawerOpen: [{
122
- type: Output
123
- }], drawerClose: [{
124
- type: Output
125
- }], drawerSlide: [{
126
- type: Output
127
- }], drawerStateChanged: [{
128
- type: Output
129
- }], accessibilityAction: [{
130
- type: Output
131
- }], accessibilityTap: [{
132
- type: Output
133
- }], magicTap: [{
134
- type: Output
135
- }], accessibilityEscape: [{
136
- type: Output
137
- }] } });
138
- //# sourceMappingURL=shared.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/components/drawer-layout-android/shared.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,kGAAkG;AAClG,8FAA8F;AAC9F,wFAAwF;AACxF,gGAAgG;AAChG,8FAA8F;AAC9F,8FAA8F;AAC9F,8FAA8F;AAC9F,iFAAiF;AAEjF,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAsDhE,8FAA8F;AAC9F,oGAAoG;AACpG,oGAAoG;AACpG,2FAA2F;AAC3F,iGAAiG;AACjG,+FAA+F;AAC/F,6BAA6B;AAE7B,MAAM,OAAgB,uBAAuB;IAC3C,4FAA4F;IAC5F,wFAAwF;IACxF,2FAA2F;IAC3F,sFAAsF;IACnE,UAAU,GAAG,IAAI,YAAY,EAAQ,CAAC;IACtC,WAAW,GAAG,IAAI,YAAY,EAAQ,CAAC;IACvC,WAAW,GAAG,IAAI,YAAY,EAAqB,CAAC;IACpD,kBAAkB,GAAG,IAAI,YAAY,EAAgB,CAAC;IACtD,mBAAmB,GAAG,IAAI,YAAY,EAAkB,CAAC;IACzD,gBAAgB,GAAG,IAAI,YAAY,EAAkB,CAAC;IACtD,QAAQ,GAAG,IAAI,YAAY,EAAkB,CAAC;IAC9C,mBAAmB,GAAG,IAAI,YAAY,EAAkB,CAAC;IAE5E,WAAW,CAAU;IACrB,cAAc,CAAmB;IACjC,cAAc,CAAmB;IACjC,mBAAmB,CAAwB;IAC3C,qBAAqB,CAAU;IAC/B,wBAAwB,CAAU;IAClC,KAAK,CAA0B;IAE/B,QAAQ,CAAU;IAClB,MAAM,CAAU;IAChB,UAAU,CAAW;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
- import { type ISymbioteEvent, type IViewStyle } from '@symbiote/engine';
4
- import { DrawerLayoutAndroidBase } from './shared';
5
- export type { IDrawerPosition, IDrawerLockMode, IKeyboardDismissMode, IDrawerState, IDrawerSlideEvent, IDrawerLayoutAndroidHandle, } from './shared';
6
- export type { IAngularDrawerLayoutAndroidProps } from './shared';
7
- export declare class AndroidDrawerLayoutHost {
8
- }
9
- export declare class DrawerLayoutAndroid extends DrawerLayoutAndroidBase implements IDrawerLayoutAndroidHandle {
10
- private hostElement?;
11
- private drawerOpened;
12
- private readonly changeDetector;
13
- private cachedResolved;
14
- private cachedResolvedKey;
15
- private get resolved();
16
- get hostProps(): Record<string, unknown>;
17
- get contentWrapperStyle(): Readonly<IViewStyle>;
18
- get navigationWrapperStyle(): IViewStyle;
19
- get navigationPointerEvents(): 'auto' | 'none';
20
- handleDrawerOpen(): void;
21
- handleDrawerClose(): void;
22
- handleDrawerSlide(event: unknown): void;
23
- handleDrawerStateChanged(event: unknown): void;
24
- emit(emitter: EventEmitter<ISymbioteEvent>, event: unknown): void;
25
- openDrawer(): void;
26
- closeDrawer(): void;
27
- private dispatchDrawer;
28
- private get hostNode();
29
- }
@@ -1,326 +0,0 @@
1
- // DrawerLayoutAndroid on Android: the real build, the Angular twin of the React/Vue
2
- // index.android.ts. AndroidDrawerLayout is an ordinary Fabric host node committing through the
3
- // same childSet as the rest of the tree (no per-library glue; the engine derives its events from
4
- // the ViewConfig, so we render the RAW Fabric name 'AndroidDrawerLayout'). The platform-invariant
5
- // math — the host prop bag + the content/navigation wrapper styles, the slide/state event
6
- // normalization, the imperative open/close command NAMES — lives in @symbiote/components, shared
7
- // verbatim with React/Vue; here Angular supplies only the lifecycle: a `drawerOpened` flag gates
8
- // the navigation wrapper's pointerEvents, the host node is read by IDENTITY through a #host
9
- // ViewChild for the imperative commands, and the four (drawer*) events fold into the typed
10
- // callbacks.
11
- //
12
- // Child order matches RN exactly: content FIRST, navigation SECOND. Content is the DEFAULT
13
- // <ng-content>; the drawer panel is the `[drawerNavigationView]` slot (the Angular twin of React's
14
- // renderNavigationView / Vue's navigationView slot). Metro picks this file on an Android host; no
15
- // Platform.OS read. device-verify-pending: the AndroidDrawerLayout name + openDrawer/closeDrawer
16
- // commands are RN-source-confirmed, not yet exercised on a real Android host.
17
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
18
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
19
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
20
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
21
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
22
- var _, done = false;
23
- for (var i = decorators.length - 1; i >= 0; i--) {
24
- var context = {};
25
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
26
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
27
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
28
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
29
- if (kind === "accessor") {
30
- if (result === void 0) continue;
31
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
32
- if (_ = accept(result.get)) descriptor.get = _;
33
- if (_ = accept(result.set)) descriptor.set = _;
34
- if (_ = accept(result.init)) initializers.unshift(_);
35
- }
36
- else if (_ = accept(result)) {
37
- if (kind === "field") initializers.unshift(_);
38
- else descriptor[key] = _;
39
- }
40
- }
41
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
42
- done = true;
43
- };
44
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
45
- var useValue = arguments.length > 2;
46
- for (var i = 0; i < initializers.length; i++) {
47
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
48
- }
49
- return useValue ? value : void 0;
50
- };
51
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, ElementRef, EventEmitter, inject, ViewChild, } from '@angular/core';
52
- import { CLOSE_DRAWER_COMMAND, OPEN_DRAWER_COMMAND, offsetFromSlide, resolveAccessibilityProps, resolveDrawerLayout, stateFromChange, } from '@symbiote/components';
53
- import { dispatchViewCommand, dlog, isSymbioteNode, whenCommitted, } from '@symbiote/engine';
54
- import { DrawerLayoutAndroidBase } from './shared';
55
- import { SymbioteHostPropsDirective, ViewHost } from '../../primitives';
56
- // Angular infers an `(event)` binding's $event as the DOM Event for a custom-schema element,
57
- // so each handler enters as `unknown` and is narrowed here before reaching a typed callback.
58
- function isSymbioteEvent(value) {
59
- return typeof value === 'object' && value !== null && 'nativeEvent' in value;
60
- }
61
- // Element-wise reference comparison for the `resolved` memoization key (below). Primitives
62
- // compare by value here; style/accessibility objects compare by reference, matching how the
63
- // rest of this codebase treats prop identity (a caller passing a fresh-but-equal style object
64
- // every render already looks "changed" everywhere else, so this is not a new assumption).
65
- function sameShallowKey(a, b) {
66
- if (b === undefined || a.length !== b.length)
67
- return false;
68
- for (let i = 0; i < a.length; i += 1) {
69
- if (a[i] !== b[i])
70
- return false;
71
- }
72
- return true;
73
- }
74
- // The raw Fabric host element. Its selector MUST equal DRAWER_VIEW_NAME ('AndroidDrawerLayout',
75
- // core/components/src/state/drawer-layout-android.ts). A no-hyphen UNKNOWN tag fails Angular's
76
- // CUSTOM_ELEMENTS_SCHEMA check (the schema only permits hyphenated custom elements); declaring it
77
- // as a matched standalone component lifts that restriction, and the renderer still hands the
78
- // literal tag name to the engine — descriptorFor passes any non-`symbiote-*` name through
79
- // untouched, so it lands as the AndroidDrawerLayout Fabric view. The main component must be added
80
- // to the engine's ANCHOR_HOST_COMPONENTS (its own bookkeeping host must not paint); this real host
81
- // must NOT be in that set.
82
- let AndroidDrawerLayoutHost = (() => {
83
- let _classDecorators = [Component({
84
- selector: 'AndroidDrawerLayout',
85
- standalone: true,
86
- template: '<ng-content></ng-content>',
87
- })];
88
- let _classDescriptor;
89
- let _classExtraInitializers = [];
90
- let _classThis;
91
- var AndroidDrawerLayoutHost = class {
92
- static { _classThis = this; }
93
- static {
94
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
95
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
96
- AndroidDrawerLayoutHost = _classThis = _classDescriptor.value;
97
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
98
- __runInitializers(_classThis, _classExtraInitializers);
99
- }
100
- };
101
- return AndroidDrawerLayoutHost = _classThis;
102
- })();
103
- export { AndroidDrawerLayoutHost };
104
- let DrawerLayoutAndroid = (() => {
105
- let _classDecorators = [Component({
106
- selector: 'DrawerLayoutAndroid',
107
- standalone: true,
108
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
109
- imports: [AndroidDrawerLayoutHost, SymbioteHostPropsDirective, ViewHost],
110
- changeDetection: ChangeDetectionStrategy.OnPush,
111
- inputs: [
112
- 'drawerWidth',
113
- 'drawerPosition',
114
- 'drawerLockMode',
115
- 'keyboardDismissMode',
116
- 'drawerBackgroundColor',
117
- 'statusBarBackgroundColor',
118
- 'style',
119
- 'nativeID',
120
- 'testID',
121
- 'accessible',
122
- 'accessibilityLabel',
123
- 'accessibilityHint',
124
- 'accessibilityRole',
125
- 'accessibilityState',
126
- 'accessibilityValue',
127
- 'accessibilityActions',
128
- 'accessibilityLabelledBy',
129
- 'importantForAccessibility',
130
- 'accessibilityLiveRegion',
131
- 'screenReaderFocusable',
132
- 'accessibilityElementsHidden',
133
- 'accessibilityViewIsModal',
134
- 'accessibilityIgnoresInvertColors',
135
- 'accessibilityLanguage',
136
- 'accessibilityRespondsToUserInteraction',
137
- 'accessibilityShowsLargeContentViewer',
138
- 'accessibilityLargeContentTitle',
139
- 'role',
140
- 'aria-label',
141
- 'aria-labelledby',
142
- 'aria-live',
143
- 'aria-hidden',
144
- 'aria-busy',
145
- 'aria-checked',
146
- 'aria-disabled',
147
- 'aria-expanded',
148
- 'aria-selected',
149
- 'aria-modal',
150
- 'aria-valuemax',
151
- 'aria-valuemin',
152
- 'aria-valuenow',
153
- 'aria-valuetext',
154
- ],
155
- // The Switch precedent: fields decorated with @Output() on the shared base class
156
- // (DrawerLayoutAndroidBase) still need their names re-declared here for Angular's
157
- // component metadata to expose them as outputs of THIS concrete class.
158
- outputs: [
159
- 'drawerOpen',
160
- 'drawerClose',
161
- 'drawerSlide',
162
- 'drawerStateChanged',
163
- 'accessibilityAction',
164
- 'accessibilityTap',
165
- 'magicTap',
166
- 'accessibilityEscape',
167
- ],
168
- template: `
169
- <AndroidDrawerLayout
170
- #host
171
- [symbioteHostProps]="hostProps"
172
- (drawerOpen)="handleDrawerOpen()"
173
- (drawerClose)="handleDrawerClose()"
174
- (drawerSlide)="handleDrawerSlide($event)"
175
- (drawerStateChanged)="handleDrawerStateChanged($event)"
176
- (accessibilityAction)="emit(accessibilityAction, $event)"
177
- (accessibilityTap)="emit(accessibilityTap, $event)"
178
- (magicTap)="emit(magicTap, $event)"
179
- (accessibilityEscape)="emit(accessibilityEscape, $event)"
180
- >
181
- <symbiote-view [style]="contentWrapperStyle">
182
- <ng-content></ng-content>
183
- </symbiote-view>
184
- <symbiote-view [style]="navigationWrapperStyle" [pointerEvents]="navigationPointerEvents">
185
- <ng-content select="[drawerNavigationView]"></ng-content>
186
- </symbiote-view>
187
- </AndroidDrawerLayout>
188
- `,
189
- })];
190
- let _classDescriptor;
191
- let _classExtraInitializers = [];
192
- let _classThis;
193
- let _classSuper = DrawerLayoutAndroidBase;
194
- let _hostElement_decorators;
195
- let _hostElement_initializers = [];
196
- let _hostElement_extraInitializers = [];
197
- var DrawerLayoutAndroid = class extends _classSuper {
198
- static { _classThis = this; }
199
- static {
200
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
201
- _hostElement_decorators = [ViewChild('host', { read: ElementRef })];
202
- __esDecorate(null, null, _hostElement_decorators, { kind: "field", name: "hostElement", static: false, private: false, access: { has: obj => "hostElement" in obj, get: obj => obj.hostElement, set: (obj, value) => { obj.hostElement = value; } }, metadata: _metadata }, _hostElement_initializers, _hostElement_extraInitializers);
203
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
204
- DrawerLayoutAndroid = _classThis = _classDescriptor.value;
205
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
206
- __runInitializers(_classThis, _classExtraInitializers);
207
- }
208
- // {read: ElementRef} hands back the host element (the engine node), NOT the host component
209
- // instance, so the imperative commands resolve it by IDENTITY against the engine mirror.
210
- hostElement = __runInitializers(this, _hostElement_initializers, void 0);
211
- // Gates the navigation wrapper's pointerEvents (RN _onDrawerOpen/_onDrawerClose setState):
212
- // closed -> 'none' so the off-screen drawer never intercepts touches; open -> 'auto'.
213
- drawerOpened = (__runInitializers(this, _hostElement_extraInitializers), false);
214
- changeDetector = inject(ChangeDetectorRef);
215
- // Memoized against the last-seen inputs: AndroidDrawerLayout's native ViewManager
216
- // (ReactDrawerLayoutManager) enforces a hard 2-child cap with no re-add tolerance — unlike
217
- // ordinary Fabric views. `resolved` is read FOUR times per template evaluation (once per
218
- // getter below), and without memoization each read rebuilds fresh hostProps/navigationWrapper-
219
- // Style objects even when nothing actually changed, so an UNRELATED markForCheck (e.g. the
220
- // native `(drawerOpen)`/`(drawerClose)` events calling it in handleDrawerOpen/handleDrawerClose)
221
- // forces the engine to reclone this subtree on every CD pass. Caching on the actual input
222
- // values (not just drawerOpened) keeps the returned prop/style objects referentially STABLE
223
- // across a CD pass that touches this component but changes none of its inputs, which is the
224
- // one thing on the JS side we control to reduce how often this subtree gets re-committed.
225
- cachedResolved;
226
- cachedResolvedKey;
227
- // resolveDrawerLayout owns the host prop bag + the two wrapper styles + the pointerEvents gate
228
- // (shared with React/Vue); the four getters below read the resolved tree it returns.
229
- get resolved() {
230
- const passthrough = resolveAccessibilityProps(this.accessibilityInputs());
231
- const key = [
232
- this.drawerWidth,
233
- this.drawerPosition,
234
- this.drawerLockMode,
235
- this.keyboardDismissMode,
236
- this.drawerBackgroundColor,
237
- this.statusBarBackgroundColor,
238
- this.drawerOpened,
239
- this.style,
240
- ...Object.values(passthrough),
241
- ];
242
- if (this.cachedResolved !== undefined && sameShallowKey(key, this.cachedResolvedKey)) {
243
- return this.cachedResolved;
244
- }
245
- const resolved = resolveDrawerLayout({
246
- drawerWidth: this.drawerWidth,
247
- drawerPosition: this.drawerPosition,
248
- drawerLockMode: this.drawerLockMode,
249
- keyboardDismissMode: this.keyboardDismissMode,
250
- drawerBackgroundColor: this.drawerBackgroundColor,
251
- statusBarBackgroundColor: this.statusBarBackgroundColor,
252
- drawerOpened: this.drawerOpened,
253
- style: this.style,
254
- // The drawer renders a raw host node (not the View FC), so nothing else folds aria-*/role —
255
- // resolve them into accessibility* here before passing through.
256
- passthrough,
257
- });
258
- this.cachedResolved = resolved;
259
- this.cachedResolvedKey = key;
260
- return resolved;
261
- }
262
- get hostProps() {
263
- return this.resolved.hostProps;
264
- }
265
- get contentWrapperStyle() {
266
- return this.resolved.contentWrapperStyle;
267
- }
268
- get navigationWrapperStyle() {
269
- return this.resolved.navigationWrapperStyle;
270
- }
271
- get navigationPointerEvents() {
272
- return this.resolved.navigationPointerEvents;
273
- }
274
- handleDrawerOpen() {
275
- dlog('Angular DrawerLayoutAndroid onDrawerOpen');
276
- this.drawerOpened = true;
277
- this.drawerOpen.emit();
278
- this.changeDetector.markForCheck();
279
- }
280
- handleDrawerClose() {
281
- dlog('Angular DrawerLayoutAndroid onDrawerClose');
282
- this.drawerOpened = false;
283
- this.drawerClose.emit();
284
- this.changeDetector.markForCheck();
285
- }
286
- handleDrawerSlide(event) {
287
- if (!isSymbioteEvent(event))
288
- return;
289
- this.drawerSlide.emit({ offset: offsetFromSlide(event) });
290
- }
291
- handleDrawerStateChanged(event) {
292
- if (!isSymbioteEvent(event))
293
- return;
294
- this.drawerStateChanged.emit(stateFromChange(event));
295
- }
296
- emit(emitter, event) {
297
- if (isSymbioteEvent(event))
298
- emitter.emit(event);
299
- }
300
- // The component instance IS the imperative handle (RN's DrawerLayoutAndroidMethods): a parent
301
- // calls @ViewChild(DrawerLayoutAndroid).openDrawer().
302
- openDrawer() {
303
- this.dispatchDrawer(OPEN_DRAWER_COMMAND);
304
- }
305
- closeDrawer() {
306
- this.dispatchDrawer(CLOSE_DRAWER_COMMAND);
307
- }
308
- dispatchDrawer(command) {
309
- const node = this.hostNode;
310
- if (node === null) {
311
- dlog(`Angular DrawerLayoutAndroid ${command} no-op: no committed host node`);
312
- return;
313
- }
314
- // whenCommitted defers until the node has a Fabric tag. Angular coalesces commits on a
315
- // microtask (renderer.requestCommit), so an imperative call right after creation can precede
316
- // the commit and otherwise no-op — the same async-commit gotcha as Switch's snap-back.
317
- whenCommitted(node, () => dispatchViewCommand(node, command, []));
318
- }
319
- get hostNode() {
320
- const native = this.hostElement?.nativeElement;
321
- return isSymbioteNode(native) ? native : null;
322
- }
323
- };
324
- return DrawerLayoutAndroid = _classThis;
325
- })();
326
- export { DrawerLayoutAndroid };
@@ -1,8 +0,0 @@
1
- import type { IDrawerLayoutAndroidHandle } from '@symbiote/components';
2
- import { DrawerLayoutAndroidBase } from './shared';
3
- export type { IDrawerPosition, IDrawerLockMode, IKeyboardDismissMode, IDrawerState, IDrawerSlideEvent, IDrawerLayoutAndroidHandle, } from './shared';
4
- export type { IAngularDrawerLayoutAndroidProps } from './shared';
5
- export declare class DrawerLayoutAndroid extends DrawerLayoutAndroidBase implements IDrawerLayoutAndroidHandle {
6
- openDrawer(): void;
7
- closeDrawer(): void;
8
- }
@@ -1,145 +0,0 @@
1
- // DrawerLayoutAndroid: base / off-Android fallback (the Angular twin of the React/Vue adapter's
2
- // index.ts). AndroidDrawerLayout is Android-only, so everywhere except an Android host — where
3
- // Metro picks index.android.ts — we render the main content (the default <ng-content>) in a plain
4
- // container and DROP the navigation panel (RN's DrawerLayoutAndroidFallback shape). The imperative
5
- // open/close are silent no-ops; there is no drawer to drive. The filename is the selector; no
6
- // Platform.OS read. The Angular barrel imports './drawer-layout-android', which resolves here under
7
- // tsc/headless and to the .android file under Metro on Android. See ADR 0019.
8
- var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
- function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
- var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
- var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
- var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
- var _, done = false;
14
- for (var i = decorators.length - 1; i >= 0; i--) {
15
- var context = {};
16
- for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
- for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
- context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
- var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
- if (kind === "accessor") {
21
- if (result === void 0) continue;
22
- if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
- if (_ = accept(result.get)) descriptor.get = _;
24
- if (_ = accept(result.set)) descriptor.set = _;
25
- if (_ = accept(result.init)) initializers.unshift(_);
26
- }
27
- else if (_ = accept(result)) {
28
- if (kind === "field") initializers.unshift(_);
29
- else descriptor[key] = _;
30
- }
31
- }
32
- if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
- done = true;
34
- };
35
- var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
36
- var useValue = arguments.length > 2;
37
- for (var i = 0; i < initializers.length; i++) {
38
- value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
39
- }
40
- return useValue ? value : void 0;
41
- };
42
- import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, Component } from '@angular/core';
43
- import { dlog } from '@symbiote/engine';
44
- import { DrawerLayoutAndroidBase } from './shared';
45
- import { ViewHost } from '../../primitives';
46
- let DrawerLayoutAndroid = (() => {
47
- let _classDecorators = [Component({
48
- selector: 'DrawerLayoutAndroid',
49
- standalone: true,
50
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
51
- imports: [ViewHost],
52
- changeDetection: ChangeDetectionStrategy.OnPush,
53
- inputs: [
54
- 'drawerWidth',
55
- 'drawerPosition',
56
- 'drawerLockMode',
57
- 'keyboardDismissMode',
58
- 'drawerBackgroundColor',
59
- 'statusBarBackgroundColor',
60
- 'style',
61
- 'nativeID',
62
- 'testID',
63
- 'accessible',
64
- 'accessibilityLabel',
65
- 'accessibilityHint',
66
- 'accessibilityRole',
67
- 'accessibilityState',
68
- 'accessibilityValue',
69
- 'accessibilityActions',
70
- 'accessibilityLabelledBy',
71
- 'importantForAccessibility',
72
- 'accessibilityLiveRegion',
73
- 'screenReaderFocusable',
74
- 'accessibilityElementsHidden',
75
- 'accessibilityViewIsModal',
76
- 'accessibilityIgnoresInvertColors',
77
- 'accessibilityLanguage',
78
- 'accessibilityRespondsToUserInteraction',
79
- 'accessibilityShowsLargeContentViewer',
80
- 'accessibilityLargeContentTitle',
81
- 'role',
82
- 'aria-label',
83
- 'aria-labelledby',
84
- 'aria-live',
85
- 'aria-hidden',
86
- 'aria-busy',
87
- 'aria-checked',
88
- 'aria-disabled',
89
- 'aria-expanded',
90
- 'aria-selected',
91
- 'aria-modal',
92
- 'aria-valuemax',
93
- 'aria-valuemin',
94
- 'aria-valuenow',
95
- 'aria-valuetext',
96
- ],
97
- // Declared for parity with the Android build (DrawerLayoutAndroidBase's @Output() fields need
98
- // their names re-declared on every concrete class that extends it, the Switch precedent) even
99
- // though this fallback never emits them — there is no real drawer here to fire the events.
100
- outputs: [
101
- 'drawerOpen',
102
- 'drawerClose',
103
- 'drawerSlide',
104
- 'drawerStateChanged',
105
- 'accessibilityAction',
106
- 'accessibilityTap',
107
- 'magicTap',
108
- 'accessibilityEscape',
109
- ],
110
- // The catch-all <ng-content> paints the main content. The `[drawerNavigationView]` slot is
111
- // declared inside a never-stamped <ng-template> purely so its projected nodes are claimed away
112
- // from the catch-all and DROPPED — the Angular pull-based equivalent of the Vue fallback never
113
- // invoking slots.navigationView. RN's off-Android fallback shows content only.
114
- template: `
115
- <symbiote-view [style]="style">
116
- <ng-content></ng-content>
117
- </symbiote-view>
118
- <ng-template>
119
- <ng-content select="[drawerNavigationView]"></ng-content>
120
- </ng-template>
121
- `,
122
- })];
123
- let _classDescriptor;
124
- let _classExtraInitializers = [];
125
- let _classThis;
126
- let _classSuper = DrawerLayoutAndroidBase;
127
- var DrawerLayoutAndroid = class extends _classSuper {
128
- static { _classThis = this; }
129
- static {
130
- const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
131
- __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
132
- DrawerLayoutAndroid = _classThis = _classDescriptor.value;
133
- if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
134
- __runInitializers(_classThis, _classExtraInitializers);
135
- }
136
- openDrawer() {
137
- dlog('Angular DrawerLayoutAndroid.openDrawer no-op: off Android');
138
- }
139
- closeDrawer() {
140
- dlog('Angular DrawerLayoutAndroid.closeDrawer no-op: off Android');
141
- }
142
- };
143
- return DrawerLayoutAndroid = _classThis;
144
- })();
145
- export { DrawerLayoutAndroid };