@symbiote-native/angular 0.1.0 → 0.2.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 +17 -4
- package/build/angular/bootstrap.d.ts +7 -0
- package/build/angular/bootstrap.js +15 -0
- package/build/angular/bootstrap.js.map +1 -0
- package/build/bootstrap.d.ts +7 -0
- package/build/bootstrap.js +14 -0
- package/package.json +11 -6
- package/src/bootstrap.ts +26 -0
- package/build/angular/components/drawer-layout-android/index.android.d.ts +0 -34
- package/build/angular/components/drawer-layout-android/index.android.js +0 -291
- package/build/angular/components/drawer-layout-android/index.android.js.map +0 -1
- package/build/angular/components/drawer-layout-android/index.d.ts +0 -11
- package/build/angular/components/drawer-layout-android/index.js +0 -109
- package/build/angular/components/drawer-layout-android/index.js.map +0 -1
- package/build/angular/components/drawer-layout-android/shared.d.ts +0 -74
- package/build/angular/components/drawer-layout-android/shared.js +0 -138
- package/build/angular/components/drawer-layout-android/shared.js.map +0 -1
- package/build/components/drawer-layout-android/index.android.d.ts +0 -29
- package/build/components/drawer-layout-android/index.android.js +0 -326
- package/build/components/drawer-layout-android/index.d.ts +0 -8
- package/build/components/drawer-layout-android/index.js +0 -145
- package/build/components/drawer-layout-android/shared.d.ts +0 -71
- package/build/components/drawer-layout-android/shared.js +0 -205
|
@@ -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 };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import type { IStyleProp, ISymbioteEvent, IViewStyle } from '@symbiote/engine';
|
|
3
|
-
import type { IAccessibilityProps, IAccessibilityStateValue, IAriaProps, IDrawerLockMode, IDrawerPosition, IDrawerSlideEvent, IDrawerState, IKeyboardDismissMode } from '@symbiote/components';
|
|
4
|
-
export type { IDrawerPosition, IDrawerLockMode, IKeyboardDismissMode, IDrawerState, IDrawerSlideEvent, IDrawerLayoutAndroidHandle, } from '@symbiote/components';
|
|
5
|
-
export interface IAngularDrawerLayoutAndroidProps extends IAccessibilityProps, IAriaProps {
|
|
6
|
-
drawerWidth?: number;
|
|
7
|
-
drawerPosition?: IDrawerPosition;
|
|
8
|
-
drawerLockMode?: IDrawerLockMode;
|
|
9
|
-
keyboardDismissMode?: IKeyboardDismissMode;
|
|
10
|
-
drawerBackgroundColor?: string;
|
|
11
|
-
statusBarBackgroundColor?: string;
|
|
12
|
-
style?: IStyleProp<IViewStyle>;
|
|
13
|
-
onDrawerOpen?: () => void;
|
|
14
|
-
onDrawerClose?: () => void;
|
|
15
|
-
onDrawerSlide?: (event: IDrawerSlideEvent) => void;
|
|
16
|
-
onDrawerStateChanged?: (state: IDrawerState) => void;
|
|
17
|
-
}
|
|
18
|
-
export type IAngularDrawerLayoutAndroidInputs = Omit<IAngularDrawerLayoutAndroidProps, 'onDrawerOpen' | 'onDrawerClose' | 'onDrawerSlide' | 'onDrawerStateChanged' | 'onAccessibilityAction' | 'onAccessibilityTap' | 'onMagicTap' | 'onAccessibilityEscape'>;
|
|
19
|
-
export declare abstract class DrawerLayoutAndroidBase implements IAngularDrawerLayoutAndroidInputs {
|
|
20
|
-
readonly drawerOpen: EventEmitter<void>;
|
|
21
|
-
readonly drawerClose: EventEmitter<void>;
|
|
22
|
-
readonly drawerSlide: EventEmitter<IDrawerSlideEvent>;
|
|
23
|
-
readonly drawerStateChanged: EventEmitter<IDrawerState>;
|
|
24
|
-
readonly accessibilityAction: EventEmitter<ISymbioteEvent>;
|
|
25
|
-
readonly accessibilityTap: EventEmitter<ISymbioteEvent>;
|
|
26
|
-
readonly magicTap: EventEmitter<ISymbioteEvent>;
|
|
27
|
-
readonly accessibilityEscape: EventEmitter<ISymbioteEvent>;
|
|
28
|
-
drawerWidth?: number;
|
|
29
|
-
drawerPosition?: IDrawerPosition;
|
|
30
|
-
drawerLockMode?: IDrawerLockMode;
|
|
31
|
-
keyboardDismissMode?: IKeyboardDismissMode;
|
|
32
|
-
drawerBackgroundColor?: string;
|
|
33
|
-
statusBarBackgroundColor?: string;
|
|
34
|
-
style?: IStyleProp<IViewStyle>;
|
|
35
|
-
nativeID?: string;
|
|
36
|
-
testID?: string;
|
|
37
|
-
accessible?: boolean;
|
|
38
|
-
accessibilityLabel?: string;
|
|
39
|
-
accessibilityHint?: string;
|
|
40
|
-
accessibilityRole?: IAccessibilityProps['accessibilityRole'];
|
|
41
|
-
accessibilityState?: IAccessibilityStateValue;
|
|
42
|
-
accessibilityValue?: IAccessibilityProps['accessibilityValue'];
|
|
43
|
-
accessibilityActions?: IAccessibilityProps['accessibilityActions'];
|
|
44
|
-
accessibilityLabelledBy?: string | string[];
|
|
45
|
-
importantForAccessibility?: IAccessibilityProps['importantForAccessibility'];
|
|
46
|
-
accessibilityLiveRegion?: IAccessibilityProps['accessibilityLiveRegion'];
|
|
47
|
-
screenReaderFocusable?: boolean;
|
|
48
|
-
accessibilityElementsHidden?: boolean;
|
|
49
|
-
accessibilityViewIsModal?: boolean;
|
|
50
|
-
accessibilityIgnoresInvertColors?: boolean;
|
|
51
|
-
accessibilityLanguage?: string;
|
|
52
|
-
accessibilityRespondsToUserInteraction?: boolean;
|
|
53
|
-
accessibilityShowsLargeContentViewer?: boolean;
|
|
54
|
-
accessibilityLargeContentTitle?: string;
|
|
55
|
-
role?: IAriaProps['role'];
|
|
56
|
-
'aria-label'?: string;
|
|
57
|
-
'aria-labelledby'?: string;
|
|
58
|
-
'aria-live'?: IAriaProps['aria-live'];
|
|
59
|
-
'aria-hidden'?: boolean;
|
|
60
|
-
'aria-busy'?: boolean;
|
|
61
|
-
'aria-checked'?: boolean | 'mixed';
|
|
62
|
-
'aria-disabled'?: boolean;
|
|
63
|
-
'aria-expanded'?: boolean;
|
|
64
|
-
'aria-selected'?: boolean;
|
|
65
|
-
'aria-modal'?: boolean;
|
|
66
|
-
'aria-valuemax'?: number;
|
|
67
|
-
'aria-valuemin'?: number;
|
|
68
|
-
'aria-valuenow'?: number;
|
|
69
|
-
'aria-valuetext'?: string;
|
|
70
|
-
protected accessibilityInputs(): IAccessibilityProps & IAriaProps & Record<string, unknown>;
|
|
71
|
-
}
|