@symbiote-native/navigation 1.0.0 → 2.0.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.
- package/README.md +159 -0
- package/package.json +14 -12
- package/build/angular/drawer/index.d.ts +0 -76
- package/build/angular/drawer/index.js +0 -508
- package/build/angular/drawer-screen.directive.d.ts +0 -14
- package/build/angular/drawer-screen.directive.js +0 -87
- package/build/angular/index.d.ts +0 -23
- package/build/angular/index.js +0 -22
- package/build/angular/injectors/index.d.ts +0 -13
- package/build/angular/injectors/index.js +0 -8
- package/build/angular/injectors/inject-drawer-navigation.d.ts +0 -4
- package/build/angular/injectors/inject-drawer-navigation.js +0 -12
- package/build/angular/injectors/inject-focus-effect.d.ts +0 -2
- package/build/angular/injectors/inject-focus-effect.js +0 -29
- package/build/angular/injectors/inject-is-focused.d.ts +0 -2
- package/build/angular/injectors/inject-is-focused.js +0 -20
- package/build/angular/injectors/inject-navigation-state.d.ts +0 -3
- package/build/angular/injectors/inject-navigation-state.js +0 -35
- package/build/angular/injectors/inject-navigation.d.ts +0 -7
- package/build/angular/injectors/inject-navigation.js +0 -16
- package/build/angular/injectors/inject-route.d.ts +0 -3
- package/build/angular/injectors/inject-route.js +0 -20
- package/build/angular/injectors/inject-stack-navigation.d.ts +0 -4
- package/build/angular/injectors/inject-stack-navigation.js +0 -15
- package/build/angular/injectors/inject-tab-navigation.d.ts +0 -4
- package/build/angular/injectors/inject-tab-navigation.js +0 -11
- package/build/angular/linking.d.ts +0 -3
- package/build/angular/linking.js +0 -43
- package/build/angular/navigation-context.service.d.ts +0 -13
- package/build/angular/navigation-context.service.js +0 -105
- package/build/angular/navigation-scope.directive.d.ts +0 -10
- package/build/angular/navigation-scope.directive.js +0 -90
- package/build/angular/screen.directive.d.ts +0 -22
- package/build/angular/screen.directive.js +0 -90
- package/build/angular/search-bar-ref.directive.d.ts +0 -10
- package/build/angular/search-bar-ref.directive.js +0 -88
- package/build/angular/stack/index.d.ts +0 -55
- package/build/angular/stack/index.js +0 -386
- package/build/angular/tab-screen.directive.d.ts +0 -14
- package/build/angular/tab-screen.directive.js +0 -87
- package/build/angular/tabs/index.d.ts +0 -42
- package/build/angular/tabs/index.js +0 -263
- package/build/core/constants.d.ts +0 -27
- package/build/core/constants.js +0 -61
- package/build/core/drawer-options/index.d.ts +0 -64
- package/build/core/drawer-options/index.js +0 -200
- package/build/core/drawer-router-state/index.d.ts +0 -21
- package/build/core/drawer-router-state/index.js +0 -40
- package/build/core/guards.d.ts +0 -2
- package/build/core/guards.js +0 -22
- package/build/core/header-bar-buttons.d.ts +0 -9
- package/build/core/header-bar-buttons.js +0 -163
- package/build/core/index.d.ts +0 -29
- package/build/core/index.js +0 -32
- package/build/core/linking-config/index.d.ts +0 -13
- package/build/core/linking-config/index.js +0 -171
- package/build/core/navigation-events/index.d.ts +0 -16
- package/build/core/navigation-events/index.js +0 -57
- package/build/core/navigator-handles/index.d.ts +0 -30
- package/build/core/navigator-handles/index.js +0 -15
- package/build/core/navigator-props.d.ts +0 -216
- package/build/core/navigator-props.js +0 -7
- package/build/core/navigator-state/index.d.ts +0 -36
- package/build/core/navigator-state/index.js +0 -81
- package/build/core/render-drawer.d.ts +0 -13
- package/build/core/render-drawer.js +0 -88
- package/build/core/render-stack.d.ts +0 -35
- package/build/core/render-stack.js +0 -294
- package/build/core/render-tabs.d.ts +0 -20
- package/build/core/render-tabs.js +0 -97
- package/build/core/screen-options.d.ts +0 -4
- package/build/core/screen-options.js +0 -133
- package/build/core/search-bar-commands.d.ts +0 -10
- package/build/core/search-bar-commands.js +0 -42
- package/build/core/state-persistence/index.d.ts +0 -3
- package/build/core/state-persistence/index.js +0 -23
- package/build/core/tab-options.d.ts +0 -13
- package/build/core/tab-options.js +0 -10
- package/build/core/tab-router-state/index.d.ts +0 -19
- package/build/core/tab-router-state/index.js +0 -51
- package/build/react/collect-registry.d.ts +0 -4
- package/build/react/collect-registry.js +0 -15
- package/build/react/drawer/index.d.ts +0 -29
- package/build/react/drawer/index.js +0 -277
- package/build/react/drawer-screen.d.ts +0 -14
- package/build/react/drawer-screen.js +0 -8
- package/build/react/hooks/index.d.ts +0 -12
- package/build/react/hooks/index.js +0 -8
- package/build/react/hooks/use-drawer-navigation.d.ts +0 -4
- package/build/react/hooks/use-drawer-navigation.js +0 -12
- package/build/react/hooks/use-focus-effect.d.ts +0 -2
- package/build/react/hooks/use-focus-effect.js +0 -29
- package/build/react/hooks/use-is-focused.d.ts +0 -1
- package/build/react/hooks/use-is-focused.js +0 -22
- package/build/react/hooks/use-navigation-state/index.d.ts +0 -2
- package/build/react/hooks/use-navigation-state/index.js +0 -39
- package/build/react/hooks/use-navigation.d.ts +0 -7
- package/build/react/hooks/use-navigation.js +0 -16
- package/build/react/hooks/use-route.d.ts +0 -2
- package/build/react/hooks/use-route.js +0 -8
- package/build/react/hooks/use-stack-navigation.d.ts +0 -4
- package/build/react/hooks/use-stack-navigation.js +0 -14
- package/build/react/hooks/use-tab-navigation.d.ts +0 -4
- package/build/react/hooks/use-tab-navigation.js +0 -12
- package/build/react/index.d.ts +0 -24
- package/build/react/index.js +0 -21
- package/build/react/linking.d.ts +0 -3
- package/build/react/linking.js +0 -47
- package/build/react/navigation-context.d.ts +0 -10
- package/build/react/navigation-context.js +0 -22
- package/build/react/screen.d.ts +0 -22
- package/build/react/screen.js +0 -7
- package/build/react/stack/index.d.ts +0 -13
- package/build/react/stack/index.js +0 -202
- package/build/react/tab-screen.d.ts +0 -15
- package/build/react/tab-screen.js +0 -8
- package/build/react/tabs/index.d.ts +0 -12
- package/build/react/tabs/index.js +0 -116
- package/build/register.d.ts +0 -7
- package/build/register.js +0 -58
- package/build/vue/composables/index.d.ts +0 -12
- package/build/vue/composables/index.js +0 -8
- package/build/vue/composables/use-drawer-navigation.d.ts +0 -5
- package/build/vue/composables/use-drawer-navigation.js +0 -15
- package/build/vue/composables/use-focus-effect.d.ts +0 -1
- package/build/vue/composables/use-focus-effect.js +0 -31
- package/build/vue/composables/use-is-focused.d.ts +0 -2
- package/build/vue/composables/use-is-focused.js +0 -28
- package/build/vue/composables/use-navigation-state.d.ts +0 -3
- package/build/vue/composables/use-navigation-state.js +0 -29
- package/build/vue/composables/use-navigation.d.ts +0 -8
- package/build/vue/composables/use-navigation.js +0 -13
- package/build/vue/composables/use-route.d.ts +0 -3
- package/build/vue/composables/use-route.js +0 -9
- package/build/vue/composables/use-stack-navigation.d.ts +0 -5
- package/build/vue/composables/use-stack-navigation.js +0 -18
- package/build/vue/composables/use-tab-navigation.d.ts +0 -5
- package/build/vue/composables/use-tab-navigation.js +0 -15
- package/build/vue/drawer/index.d.ts +0 -19
- package/build/vue/drawer/index.js +0 -390
- package/build/vue/drawer-screen.d.ts +0 -14
- package/build/vue/drawer-screen.js +0 -12
- package/build/vue/index.d.ts +0 -21
- package/build/vue/index.js +0 -19
- package/build/vue/linking.d.ts +0 -3
- package/build/vue/linking.js +0 -57
- package/build/vue/navigation-context.d.ts +0 -16
- package/build/vue/navigation-context.js +0 -65
- package/build/vue/screen.d.ts +0 -21
- package/build/vue/screen.js +0 -12
- package/build/vue/stack/index.d.ts +0 -9
- package/build/vue/stack/index.js +0 -279
- package/build/vue/tab-screen.d.ts +0 -14
- package/build/vue/tab-screen.js +0 -11
- package/build/vue/tabs/index.d.ts +0 -10
- package/build/vue/tabs/index.js +0 -209
- package/build-ngc/angular/drawer.d.ts +0 -79
- package/build-ngc/angular/drawer.js +0 -475
- package/build-ngc/angular/drawer.js.map +0 -1
- package/build-ngc/angular/stack.d.ts +0 -58
- package/build-ngc/angular/stack.js +0 -402
- package/build-ngc/angular/stack.js.map +0 -1
- package/build-ngc/angular/tabs.d.ts +0 -45
- package/build-ngc/angular/tabs.js +0 -231
- package/build-ngc/angular/tabs.js.map +0 -1
- package/build-ngc/core/drawer-options.d.ts +0 -64
- package/build-ngc/core/drawer-options.js +0 -201
- package/build-ngc/core/drawer-options.js.map +0 -1
- package/build-ngc/core/drawer-router-state.d.ts +0 -21
- package/build-ngc/core/drawer-router-state.js +0 -41
- package/build-ngc/core/drawer-router-state.js.map +0 -1
- package/build-ngc/core/href.d.ts +0 -16
- package/build-ngc/core/href.js +0 -55
- package/build-ngc/core/href.js.map +0 -1
- package/build-ngc/core/linking-config.d.ts +0 -13
- package/build-ngc/core/linking-config.js +0 -172
- package/build-ngc/core/linking-config.js.map +0 -1
- package/build-ngc/core/navigation-events.d.ts +0 -16
- package/build-ngc/core/navigation-events.js +0 -58
- package/build-ngc/core/navigation-events.js.map +0 -1
- package/build-ngc/core/navigator-handles.d.ts +0 -30
- package/build-ngc/core/navigator-handles.js +0 -16
- package/build-ngc/core/navigator-handles.js.map +0 -1
- package/build-ngc/core/navigator-state.d.ts +0 -36
- package/build-ngc/core/navigator-state.js +0 -82
- package/build-ngc/core/navigator-state.js.map +0 -1
- package/build-ngc/core/search-params.d.ts +0 -9
- package/build-ngc/core/search-params.js +0 -60
- package/build-ngc/core/search-params.js.map +0 -1
- package/build-ngc/core/state-persistence.d.ts +0 -3
- package/build-ngc/core/state-persistence.js +0 -24
- package/build-ngc/core/state-persistence.js.map +0 -1
- package/build-ngc/core/tab-router-state.d.ts +0 -19
- package/build-ngc/core/tab-router-state.js +0 -52
- package/build-ngc/core/tab-router-state.js.map +0 -1
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
// [symbioteScreen]: a declarative marker, never rendered on its own - Stack reads its inputs via
|
|
2
|
-
// @ContentChildren to build the static name -> {component, options} registry, then mounts the
|
|
3
|
-
// registered component itself for each pushed route. Angular's twin of react/screen.ts's Screen
|
|
4
|
-
// marker component; mirrors Angular Material's own `@ContentChildren(MatTab) tabs: QueryList<MatTab>`
|
|
5
|
-
// pattern (a directive applied to an inert `<ng-template>`, never instantiated as a view - see
|
|
6
|
-
// stack.ts's header for why that's safe: @ContentChildren resolves the light-DOM declaration,
|
|
7
|
-
// independent of whether the template is ever instantiated).
|
|
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 { Directive, Input } from '@angular/core';
|
|
43
|
-
let ScreenDirective = (() => {
|
|
44
|
-
let _classDecorators = [Directive({
|
|
45
|
-
selector: 'ng-template[symbioteScreen]',
|
|
46
|
-
standalone: true,
|
|
47
|
-
})];
|
|
48
|
-
let _classDescriptor;
|
|
49
|
-
let _classExtraInitializers = [];
|
|
50
|
-
let _classThis;
|
|
51
|
-
let _name_decorators;
|
|
52
|
-
let _name_initializers = [];
|
|
53
|
-
let _name_extraInitializers = [];
|
|
54
|
-
let _component_decorators;
|
|
55
|
-
let _component_initializers = [];
|
|
56
|
-
let _component_extraInitializers = [];
|
|
57
|
-
let _options_decorators;
|
|
58
|
-
let _options_initializers = [];
|
|
59
|
-
let _options_extraInitializers = [];
|
|
60
|
-
let _initialParams_decorators;
|
|
61
|
-
let _initialParams_initializers = [];
|
|
62
|
-
let _initialParams_extraInitializers = [];
|
|
63
|
-
var ScreenDirective = class {
|
|
64
|
-
static { _classThis = this; }
|
|
65
|
-
static {
|
|
66
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
67
|
-
_name_decorators = [Input({ required: true })];
|
|
68
|
-
_component_decorators = [Input({ required: true })];
|
|
69
|
-
_options_decorators = [Input()];
|
|
70
|
-
_initialParams_decorators = [Input()];
|
|
71
|
-
__esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
|
|
72
|
-
__esDecorate(null, null, _component_decorators, { kind: "field", name: "component", static: false, private: false, access: { has: obj => "component" in obj, get: obj => obj.component, set: (obj, value) => { obj.component = value; } }, metadata: _metadata }, _component_initializers, _component_extraInitializers);
|
|
73
|
-
__esDecorate(null, null, _options_decorators, { kind: "field", name: "options", static: false, private: false, access: { has: obj => "options" in obj, get: obj => obj.options, set: (obj, value) => { obj.options = value; } }, metadata: _metadata }, _options_initializers, _options_extraInitializers);
|
|
74
|
-
__esDecorate(null, null, _initialParams_decorators, { kind: "field", name: "initialParams", static: false, private: false, access: { has: obj => "initialParams" in obj, get: obj => obj.initialParams, set: (obj, value) => { obj.initialParams = value; } }, metadata: _metadata }, _initialParams_initializers, _initialParams_extraInitializers);
|
|
75
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
76
|
-
ScreenDirective = _classThis = _classDescriptor.value;
|
|
77
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
78
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
79
|
-
}
|
|
80
|
-
name = __runInitializers(this, _name_initializers, void 0);
|
|
81
|
-
component = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _component_initializers, void 0));
|
|
82
|
-
options = (__runInitializers(this, _component_extraInitializers), __runInitializers(this, _options_initializers, void 0));
|
|
83
|
-
initialParams = (__runInitializers(this, _options_extraInitializers), __runInitializers(this, _initialParams_initializers, void 0));
|
|
84
|
-
constructor() {
|
|
85
|
-
__runInitializers(this, _initialParams_extraInitializers);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
return ScreenDirective = _classThis;
|
|
89
|
-
})();
|
|
90
|
-
export { ScreenDirective };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type OnDestroy, type OnInit } from '@angular/core';
|
|
2
|
-
import type { ISearchBarCommands } from '../core';
|
|
3
|
-
export declare class SearchBarRefDirective implements OnInit, OnDestroy {
|
|
4
|
-
ref: {
|
|
5
|
-
current: ISearchBarCommands | null;
|
|
6
|
-
} | undefined;
|
|
7
|
-
private readonly elementRef;
|
|
8
|
-
ngOnInit(): void;
|
|
9
|
-
ngOnDestroy(): void;
|
|
10
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// Assigns the app-supplied `headerSearchBarOptions.ref` (a plain `{ current }` cell - see
|
|
2
|
-
// screen.directive.ts's IAngularSearchBarOptions) once the RNSSearchBar native node exists.
|
|
3
|
-
// Angular's twin of react/stack.ts's callback `ref` prop on the RNSSearchBar element: a directive
|
|
4
|
-
// applied directly onto the raw `<RNSSearchBar>` tag can `inject(ElementRef)` the same way
|
|
5
|
-
// SymbioteHostPropsDirective does (primitives/shared.ts's own pattern) - ElementRef.nativeElement
|
|
6
|
-
// is the real engine node the moment the element is created (synchronous, no whenCommitted wait
|
|
7
|
-
// needed here: buildSearchBarHandle's own methods are already a LAZY getter over the node,
|
|
8
|
-
// tolerant of the node existing-but-not-yet-committed, same contract every adapter shares).
|
|
9
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
10
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
11
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
12
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
13
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
14
|
-
var _, done = false;
|
|
15
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
16
|
-
var context = {};
|
|
17
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
18
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
19
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
20
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
21
|
-
if (kind === "accessor") {
|
|
22
|
-
if (result === void 0) continue;
|
|
23
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
24
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
25
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
26
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
27
|
-
}
|
|
28
|
-
else if (_ = accept(result)) {
|
|
29
|
-
if (kind === "field") initializers.unshift(_);
|
|
30
|
-
else descriptor[key] = _;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
34
|
-
done = true;
|
|
35
|
-
};
|
|
36
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
37
|
-
var useValue = arguments.length > 2;
|
|
38
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
39
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
40
|
-
}
|
|
41
|
-
return useValue ? value : void 0;
|
|
42
|
-
};
|
|
43
|
-
import { Directive, Input, inject, ElementRef } from '@angular/core';
|
|
44
|
-
import { isSymbioteNode, dlog, debugNodeId } from '@symbiote-native/engine';
|
|
45
|
-
import { buildSearchBarHandle } from '../core/index.js';
|
|
46
|
-
let SearchBarRefDirective = (() => {
|
|
47
|
-
let _classDecorators = [Directive({
|
|
48
|
-
selector: '[symbioteSearchBarRef]',
|
|
49
|
-
standalone: true,
|
|
50
|
-
})];
|
|
51
|
-
let _classDescriptor;
|
|
52
|
-
let _classExtraInitializers = [];
|
|
53
|
-
let _classThis;
|
|
54
|
-
let _ref_decorators;
|
|
55
|
-
let _ref_initializers = [];
|
|
56
|
-
let _ref_extraInitializers = [];
|
|
57
|
-
var SearchBarRefDirective = class {
|
|
58
|
-
static { _classThis = this; }
|
|
59
|
-
static {
|
|
60
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
61
|
-
_ref_decorators = [Input('symbioteSearchBarRef')];
|
|
62
|
-
__esDecorate(null, null, _ref_decorators, { kind: "field", name: "ref", static: false, private: false, access: { has: obj => "ref" in obj, get: obj => obj.ref, set: (obj, value) => { obj.ref = value; } }, metadata: _metadata }, _ref_initializers, _ref_extraInitializers);
|
|
63
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
64
|
-
SearchBarRefDirective = _classThis = _classDescriptor.value;
|
|
65
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
66
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
67
|
-
}
|
|
68
|
-
ref = __runInitializers(this, _ref_initializers, void 0);
|
|
69
|
-
elementRef = (__runInitializers(this, _ref_extraInitializers), inject(ElementRef));
|
|
70
|
-
ngOnInit() {
|
|
71
|
-
if (!this.ref)
|
|
72
|
-
return;
|
|
73
|
-
const node = this.elementRef.nativeElement;
|
|
74
|
-
if (!isSymbioteNode(node)) {
|
|
75
|
-
this.ref.current = null;
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
dlog(`SearchBarRefDirective: attached to node=${debugNodeId(node)}`);
|
|
79
|
-
this.ref.current = buildSearchBarHandle(() => node);
|
|
80
|
-
}
|
|
81
|
-
ngOnDestroy() {
|
|
82
|
-
if (this.ref)
|
|
83
|
-
this.ref.current = null;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
return SearchBarRefDirective = _classThis;
|
|
87
|
-
})();
|
|
88
|
-
export { SearchBarRefDirective };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { type AfterContentInit, type OnDestroy, type Type } from '@angular/core';
|
|
2
|
-
import type { INavigationEmitter, INavigatorHandle, INavigatorState, IRoute, ISearchBarCommands } from '../../core';
|
|
3
|
-
import type { IAngularScreenOptions } from '../screen.directive';
|
|
4
|
-
export type { INavigatorHandle } from '../../core';
|
|
5
|
-
export declare class Stack implements AfterContentInit, OnDestroy, INavigatorHandle {
|
|
6
|
-
private readonly screenChildren;
|
|
7
|
-
initialRouteName?: string;
|
|
8
|
-
screenOptions?: IAngularScreenOptions;
|
|
9
|
-
readonly headerSubviewProps: Record<string, unknown>;
|
|
10
|
-
private readonly routeIdPrefix;
|
|
11
|
-
private readonly registry;
|
|
12
|
-
private readonly emitters;
|
|
13
|
-
private readonly planCache;
|
|
14
|
-
private routeSequence;
|
|
15
|
-
private screenChildrenSubscription;
|
|
16
|
-
private readonly stateSignal;
|
|
17
|
-
readonly state: import("@angular/core").Signal<Readonly<{
|
|
18
|
-
routes: readonly Readonly<{
|
|
19
|
-
key: string;
|
|
20
|
-
name: string;
|
|
21
|
-
params: unknown;
|
|
22
|
-
}>[];
|
|
23
|
-
}> | undefined>;
|
|
24
|
-
readonly push: (name: string, params?: unknown) => void;
|
|
25
|
-
readonly pop: (count?: number) => void;
|
|
26
|
-
readonly popToTop: () => void;
|
|
27
|
-
readonly popTo: (key: string) => void;
|
|
28
|
-
readonly replace: (name: string, params?: unknown) => void;
|
|
29
|
-
readonly setParams: (params: unknown, key?: string) => void;
|
|
30
|
-
readonly reset: (nextState: INavigatorState) => void;
|
|
31
|
-
readonly canGoBack: () => boolean;
|
|
32
|
-
ngAfterContentInit(): void;
|
|
33
|
-
ngOnDestroy(): void;
|
|
34
|
-
private rebuildRegistry;
|
|
35
|
-
private initializeState;
|
|
36
|
-
private createRoute;
|
|
37
|
-
private dispatch;
|
|
38
|
-
emitterFor(routeKey: string): INavigationEmitter;
|
|
39
|
-
private mergedOptionsFor;
|
|
40
|
-
componentFor(route: IRoute<unknown>): Type<unknown> | null;
|
|
41
|
-
stackHostProps(): Record<string, unknown>;
|
|
42
|
-
private planFor;
|
|
43
|
-
outerScreenIsModal(route: IRoute<unknown>, index: number): boolean;
|
|
44
|
-
isInModal(route: IRoute<unknown>, index: number): boolean;
|
|
45
|
-
screenHostProps(route: IRoute<unknown>, index: number): Record<string, unknown>;
|
|
46
|
-
innerStackProps(): Record<string, unknown>;
|
|
47
|
-
innerScreenProps(route: IRoute<unknown>, index: number): Record<string, unknown>;
|
|
48
|
-
contentWrapperProps(route: IRoute<unknown>, index: number): Record<string, unknown>;
|
|
49
|
-
headerConfigProps(route: IRoute<unknown>, index: number): Record<string, unknown>;
|
|
50
|
-
hasSearchBar(route: IRoute<unknown>): boolean;
|
|
51
|
-
searchBarRef(route: IRoute<unknown>): {
|
|
52
|
-
current: ISearchBarCommands | null;
|
|
53
|
-
} | undefined;
|
|
54
|
-
searchBarProps(route: IRoute<unknown>, index: number): Record<string, unknown>;
|
|
55
|
-
}
|
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
// Stack, the Angular lifecycle half. The route-stack transitions (navigator-state) and the
|
|
2
|
-
// options/props folds (screen-options, render-stack) live in @symbiote-native/navigation core,
|
|
3
|
-
// shared verbatim with the React/Vue adapters; here Angular supplies the lifecycle - a signal for
|
|
4
|
-
// the pushed-route stack, a per-instance counter for route-key generation, push/pop/replace/... as
|
|
5
|
-
// plain public methods directly on the class (no `useImperativeHandle`/forwardRef equivalent
|
|
6
|
-
// needed: an Angular component instance IS its own "ref", same shape as MatDrawer.open(), reached
|
|
7
|
-
// via a template reference variable, e.g. `<Stack #nav>` then `nav.push(...)`; `Stack implements
|
|
8
|
-
// INavigatorHandle` so the instance itself is what NavigationScopeDirective hands to
|
|
9
|
-
// NavigationContextService - the DI scope every mounted screen reads its navigation/route from via
|
|
10
|
-
// injectStackNavigation()/injectRoute(), never a component input) - plus the descriptor bridge for
|
|
11
|
-
// the header config leaf via the raw
|
|
12
|
-
// native-view element tags below. Pushing/popping a route is an ordinary child render/removal:
|
|
13
|
-
// RNSScreenStack diffs its RNSScreen children natively, so no imperative native command is needed
|
|
14
|
-
// here at all. Neither this nor ScreenDirective imports react-native-screens' own React components
|
|
15
|
-
// (hooks, crashes a non-React adapter); the native views are driven directly through the
|
|
16
|
-
// ViewConfig ../register registers. See CLAUDE.md <third_party_rn_packages_are_react_only>.
|
|
17
|
-
//
|
|
18
|
-
// RAW NATIVE TAGS + NO_ERRORS_SCHEMA: RNSScreenStack/RNSScreen/RNSModalScreen/
|
|
19
|
-
// RNSScreenContentWrapper/RNSScreenStackHeaderConfig/RNSScreenStackHeaderSubview/RNSSearchBar are
|
|
20
|
-
// react-native-screens' native Fabric views, not Angular components - core's render-stack.ts
|
|
21
|
-
// deliberately hands back PLAIN PROPS OBJECTS for the leaves this adapter builds itself with real
|
|
22
|
-
// framework children (see its header comment), the same split react/stack.ts's `createElement`
|
|
23
|
-
// calls implement. A non-dashed raw tag name only satisfies Angular's DOM element schema check
|
|
24
|
-
// under `NO_ERRORS_SCHEMA` (`CUSTOM_ELEMENTS_SCHEMA` only relaxes tags containing a "-", confirmed
|
|
25
|
-
// against `.vendors/angular/packages/compiler/src/schema/dom_element_schema_registry.ts`'s
|
|
26
|
-
// `hasElement`) - every other Angular component in this codebase only ever names dashed
|
|
27
|
-
// `symbiote-*` primitives or real `@Component` selectors, so this is the first legitimate need for
|
|
28
|
-
// the looser schema in this codebase; every prop still routes through the real, declared
|
|
29
|
-
// `[symbioteHostProps]` input (primitives/shared.ts, `@symbiote-native/angular`), never a bare
|
|
30
|
-
// unknown-property binding.
|
|
31
|
-
//
|
|
32
|
-
// RESOLVED: `Stack` itself (like `Tab`/`Drawer`) is a composed Angular `@Component` used as a
|
|
33
|
-
// plain `<Stack>` tag by consuming app code. It is NOT hardcoded into `adapters/angular/src/
|
|
34
|
-
// renderer/index.ts`'s `ANCHOR_HOST_COMPONENTS` Set - as an app/package-owned selector it
|
|
35
|
-
// self-registers instead: `adapters/angular/babel-register-composed.cjs` (a Metro babel preset
|
|
36
|
-
// applied bundle-wide, not scoped to adapters/angular) scans this package's own AOT-compiled
|
|
37
|
-
// (`ngc`) `ɵɵngDeclareComponent({selector: 'Stack', ...})` output and auto-calls
|
|
38
|
-
// `registerComposedComponent('Stack')` at bundle time - same mechanism `.examples/angular`
|
|
39
|
-
// navigation-demo screens and `@symbiote-native/slider`'s `Slider` rely on for their own composed
|
|
40
|
-
// components mounted statically or via `NgComponentOutlet`. Unregistered, `createElement('Stack')`
|
|
41
|
-
// falls through to a real `createNode` call and RN paints its own "Unimplemented component"
|
|
42
|
-
// fallback instead. vitest never runs that Metro/babel pipeline, so `stack.test.ts` calls
|
|
43
|
-
// `registerComposedComponent('Stack')` itself. Every raw react-native-screens tag above is
|
|
44
|
-
// correctly EXEMPT from this mechanism (they must fall through to a real `createNode` to paint at
|
|
45
|
-
// all).
|
|
46
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
47
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
48
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
49
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
50
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
51
|
-
var _, done = false;
|
|
52
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
53
|
-
var context = {};
|
|
54
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
55
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
56
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
57
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
58
|
-
if (kind === "accessor") {
|
|
59
|
-
if (result === void 0) continue;
|
|
60
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
61
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
62
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
63
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
64
|
-
}
|
|
65
|
-
else if (_ = accept(result)) {
|
|
66
|
-
if (kind === "field") initializers.unshift(_);
|
|
67
|
-
else descriptor[key] = _;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
71
|
-
done = true;
|
|
72
|
-
};
|
|
73
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
74
|
-
var useValue = arguments.length > 2;
|
|
75
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
76
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
77
|
-
}
|
|
78
|
-
return useValue ? value : void 0;
|
|
79
|
-
};
|
|
80
|
-
import { ChangeDetectionStrategy, Component, ContentChildren, Input, NO_ERRORS_SCHEMA, QueryList, signal, } from '@angular/core';
|
|
81
|
-
import { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';
|
|
82
|
-
import { SymbioteHostPropsDirective } from '@symbiote-native/angular';
|
|
83
|
-
import { Platform, dlog } from '@symbiote-native/engine';
|
|
84
|
-
import { NAVIGATION_EVENT_BLUR, NAVIGATION_EVENT_FOCUS, NAVIGATION_EVENT_STATE, RNS_MODAL_SCREEN_VIEW_NAME, SCREEN_ON_APPEAR, SCREEN_ON_DISAPPEAR, SCREEN_ON_DISMISSED, SCREEN_ON_HEADER_BACK_BUTTON_CLICKED, STACK_ON_FINISH_TRANSITIONING, buildSearchBarPassthrough, createInitialNavigatorState, createNavigationEmitter, navigatorReducer, resolveHeaderInModalStackStyle, resolveScreenRenderPlan, resolveStackProps, } from '../../core/index.js';
|
|
85
|
-
import { NavigationScopeDirective } from '../navigation-scope.directive.js';
|
|
86
|
-
import { SearchBarRefDirective } from '../search-bar-ref.directive.js';
|
|
87
|
-
import { ScreenDirective } from '../screen.directive.js';
|
|
88
|
-
// backTitleVisible defaults to `true` on both platforms per the codegen spec's own default - no
|
|
89
|
-
// ios/android divergence in v1 scope (mirrors react/stack.ts's own constant exactly).
|
|
90
|
-
const NAVIGATOR_PLATFORM = { defaultHeaderBackTitleVisible: true };
|
|
91
|
-
let stackInstanceCounter = 0;
|
|
92
|
-
let Stack = (() => {
|
|
93
|
-
let _classDecorators = [Component({
|
|
94
|
-
selector: 'Stack',
|
|
95
|
-
standalone: true,
|
|
96
|
-
schemas: [NO_ERRORS_SCHEMA],
|
|
97
|
-
imports: [
|
|
98
|
-
NgTemplateOutlet,
|
|
99
|
-
NgComponentOutlet,
|
|
100
|
-
NavigationScopeDirective,
|
|
101
|
-
SearchBarRefDirective,
|
|
102
|
-
SymbioteHostPropsDirective,
|
|
103
|
-
],
|
|
104
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
105
|
-
template: `
|
|
106
|
-
@if (state(); as currentState) {
|
|
107
|
-
<RNSScreenStack [symbioteHostProps]="stackHostProps()">
|
|
108
|
-
@for (route of currentState.routes; track route.key; let idx = $index) {
|
|
109
|
-
<ng-container
|
|
110
|
-
[ngTemplateOutlet]="screenTpl"
|
|
111
|
-
[ngTemplateOutletContext]="{ $implicit: route, index: idx }"
|
|
112
|
-
/>
|
|
113
|
-
}
|
|
114
|
-
</RNSScreenStack>
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
<ng-template #screenTpl let-route let-index="index">
|
|
118
|
-
@if (outerScreenIsModal(route, index)) {
|
|
119
|
-
<RNSModalScreen [symbioteHostProps]="screenHostProps(route, index)">
|
|
120
|
-
<ng-container
|
|
121
|
-
[ngTemplateOutlet]="innerTpl"
|
|
122
|
-
[ngTemplateOutletContext]="{ $implicit: route, index: index }"
|
|
123
|
-
/>
|
|
124
|
-
</RNSModalScreen>
|
|
125
|
-
} @else {
|
|
126
|
-
<RNSScreen [symbioteHostProps]="screenHostProps(route, index)">
|
|
127
|
-
<ng-container
|
|
128
|
-
[ngTemplateOutlet]="innerTpl"
|
|
129
|
-
[ngTemplateOutletContext]="{ $implicit: route, index: index }"
|
|
130
|
-
/>
|
|
131
|
-
</RNSScreen>
|
|
132
|
-
}
|
|
133
|
-
</ng-template>
|
|
134
|
-
|
|
135
|
-
<ng-template #innerTpl let-route let-index="index">
|
|
136
|
-
@if (isInModal(route, index)) {
|
|
137
|
-
<RNSScreenStack [symbioteHostProps]="innerStackProps()">
|
|
138
|
-
<RNSScreen [symbioteHostProps]="innerScreenProps(route, index)">
|
|
139
|
-
<ng-container
|
|
140
|
-
[ngTemplateOutlet]="headerAndContentTpl"
|
|
141
|
-
[ngTemplateOutletContext]="{ $implicit: route, index: index }"
|
|
142
|
-
/>
|
|
143
|
-
</RNSScreen>
|
|
144
|
-
</RNSScreenStack>
|
|
145
|
-
} @else {
|
|
146
|
-
<ng-container
|
|
147
|
-
[ngTemplateOutlet]="headerAndContentTpl"
|
|
148
|
-
[ngTemplateOutletContext]="{ $implicit: route, index: index }"
|
|
149
|
-
/>
|
|
150
|
-
}
|
|
151
|
-
</ng-template>
|
|
152
|
-
|
|
153
|
-
<ng-template #headerAndContentTpl let-route let-index="index">
|
|
154
|
-
<RNSScreenStackHeaderConfig [symbioteHostProps]="headerConfigProps(route, index)">
|
|
155
|
-
@if (hasSearchBar(route)) {
|
|
156
|
-
<RNSScreenStackHeaderSubview [symbioteHostProps]="headerSubviewProps">
|
|
157
|
-
<RNSSearchBar
|
|
158
|
-
[symbioteSearchBarRef]="searchBarRef(route)"
|
|
159
|
-
[symbioteHostProps]="searchBarProps(route, index)"
|
|
160
|
-
/>
|
|
161
|
-
</RNSScreenStackHeaderSubview>
|
|
162
|
-
}
|
|
163
|
-
</RNSScreenStackHeaderConfig>
|
|
164
|
-
<RNSScreenContentWrapper [symbioteHostProps]="contentWrapperProps(route, index)">
|
|
165
|
-
<ng-container
|
|
166
|
-
[symbioteNavigationScope]="route"
|
|
167
|
-
[navigation]="this"
|
|
168
|
-
[emitter]="emitterFor(route.key)"
|
|
169
|
-
>
|
|
170
|
-
<ng-container *ngComponentOutlet="componentFor(route)" />
|
|
171
|
-
</ng-container>
|
|
172
|
-
</RNSScreenContentWrapper>
|
|
173
|
-
</ng-template>
|
|
174
|
-
`,
|
|
175
|
-
})];
|
|
176
|
-
let _classDescriptor;
|
|
177
|
-
let _classExtraInitializers = [];
|
|
178
|
-
let _classThis;
|
|
179
|
-
let _screenChildren_decorators;
|
|
180
|
-
let _screenChildren_initializers = [];
|
|
181
|
-
let _screenChildren_extraInitializers = [];
|
|
182
|
-
let _initialRouteName_decorators;
|
|
183
|
-
let _initialRouteName_initializers = [];
|
|
184
|
-
let _initialRouteName_extraInitializers = [];
|
|
185
|
-
let _screenOptions_decorators;
|
|
186
|
-
let _screenOptions_initializers = [];
|
|
187
|
-
let _screenOptions_extraInitializers = [];
|
|
188
|
-
var Stack = class {
|
|
189
|
-
static { _classThis = this; }
|
|
190
|
-
static {
|
|
191
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
192
|
-
_screenChildren_decorators = [ContentChildren(ScreenDirective)];
|
|
193
|
-
_initialRouteName_decorators = [Input()];
|
|
194
|
-
_screenOptions_decorators = [Input()];
|
|
195
|
-
__esDecorate(null, null, _screenChildren_decorators, { kind: "field", name: "screenChildren", static: false, private: false, access: { has: obj => "screenChildren" in obj, get: obj => obj.screenChildren, set: (obj, value) => { obj.screenChildren = value; } }, metadata: _metadata }, _screenChildren_initializers, _screenChildren_extraInitializers);
|
|
196
|
-
__esDecorate(null, null, _initialRouteName_decorators, { kind: "field", name: "initialRouteName", static: false, private: false, access: { has: obj => "initialRouteName" in obj, get: obj => obj.initialRouteName, set: (obj, value) => { obj.initialRouteName = value; } }, metadata: _metadata }, _initialRouteName_initializers, _initialRouteName_extraInitializers);
|
|
197
|
-
__esDecorate(null, null, _screenOptions_decorators, { kind: "field", name: "screenOptions", static: false, private: false, access: { has: obj => "screenOptions" in obj, get: obj => obj.screenOptions, set: (obj, value) => { obj.screenOptions = value; } }, metadata: _metadata }, _screenOptions_initializers, _screenOptions_extraInitializers);
|
|
198
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
199
|
-
Stack = _classThis = _classDescriptor.value;
|
|
200
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
201
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
202
|
-
}
|
|
203
|
-
screenChildren = __runInitializers(this, _screenChildren_initializers, void 0);
|
|
204
|
-
initialRouteName = (__runInitializers(this, _screenChildren_extraInitializers), __runInitializers(this, _initialRouteName_initializers, void 0));
|
|
205
|
-
screenOptions = (__runInitializers(this, _initialRouteName_extraInitializers), __runInitializers(this, _screenOptions_initializers, void 0));
|
|
206
|
-
headerSubviewProps = (__runInitializers(this, _screenOptions_extraInitializers), { type: 'searchBar' });
|
|
207
|
-
routeIdPrefix = `stack-${(stackInstanceCounter += 1)}`;
|
|
208
|
-
// Keyed by name -> the LIVE ScreenDirective instance, not a snapshot copy of its fields:
|
|
209
|
-
// @ContentChildren's `changes` Observable only fires on a STRUCTURAL change to the query
|
|
210
|
-
// results (screens added/removed/reordered), never when an already-matched instance's own
|
|
211
|
-
// `[options]`/`[component]` binding is merely reassigned a new value - a snapshot copy taken at
|
|
212
|
-
// rebuild time would go stale the instant an app changes e.g. `[options]` on an existing
|
|
213
|
-
// `<ng-template symbioteScreen>` without also adding/removing one. Reading straight off the
|
|
214
|
-
// directive instance means Angular's own ordinary Input binding keeps every field live for free.
|
|
215
|
-
registry = new Map();
|
|
216
|
-
emitters = new Map();
|
|
217
|
-
// Keyed by `${route.key}:${index}`, cleared on every dispatch: the ~7 template-bound
|
|
218
|
-
// accessors below (outerScreenIsModal/isInModal/screenHostProps/...) all resolve the SAME
|
|
219
|
-
// route+index through planFor per change-detection cycle, so caching here turns ~7 runs of
|
|
220
|
-
// the 14-step resolveScreenRenderPlan chain into 1 per actual state change.
|
|
221
|
-
planCache = new Map();
|
|
222
|
-
routeSequence = 0;
|
|
223
|
-
screenChildrenSubscription;
|
|
224
|
-
stateSignal = signal(undefined);
|
|
225
|
-
state = this.stateSignal.asReadonly();
|
|
226
|
-
push = (name, params) => this.dispatch({ type: 'push', route: this.createRoute(name, params) });
|
|
227
|
-
pop = (count) => this.dispatch({ type: 'pop', count });
|
|
228
|
-
popToTop = () => this.dispatch({ type: 'popToTop' });
|
|
229
|
-
popTo = (key) => this.dispatch({ type: 'popTo', key });
|
|
230
|
-
replace = (name, params) => this.dispatch({ type: 'replace', route: this.createRoute(name, params) });
|
|
231
|
-
setParams = (params, key) => this.dispatch({ type: 'setParams', key, params });
|
|
232
|
-
reset = (nextState) => this.dispatch({ type: 'reset', state: nextState });
|
|
233
|
-
canGoBack = () => (this.stateSignal()?.routes.length ?? 0) > 1;
|
|
234
|
-
ngAfterContentInit() {
|
|
235
|
-
this.rebuildRegistry();
|
|
236
|
-
this.initializeState();
|
|
237
|
-
this.screenChildrenSubscription = this.screenChildren.changes.subscribe(() => {
|
|
238
|
-
this.rebuildRegistry();
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
ngOnDestroy() {
|
|
242
|
-
this.screenChildrenSubscription?.unsubscribe();
|
|
243
|
-
}
|
|
244
|
-
rebuildRegistry() {
|
|
245
|
-
this.registry.clear();
|
|
246
|
-
for (const screen of this.screenChildren) {
|
|
247
|
-
this.registry.set(screen.name, screen);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
initializeState() {
|
|
251
|
-
if (this.stateSignal() !== undefined)
|
|
252
|
-
return;
|
|
253
|
-
const initialRouteName = this.initialRouteName ?? this.registry.keys().next().value;
|
|
254
|
-
if (initialRouteName === undefined) {
|
|
255
|
-
dlog('Stack: no <ng-template symbioteScreen> children registered');
|
|
256
|
-
this.stateSignal.set(createInitialNavigatorState({ key: this.routeIdPrefix, name: '', params: undefined }));
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
this.stateSignal.set(createInitialNavigatorState(this.createRoute(initialRouteName, this.registry.get(initialRouteName)?.initialParams)));
|
|
260
|
-
}
|
|
261
|
-
createRoute(name, params) {
|
|
262
|
-
this.routeSequence += 1;
|
|
263
|
-
return { key: `${this.routeIdPrefix}-${name}-${this.routeSequence}`, name, params };
|
|
264
|
-
}
|
|
265
|
-
dispatch(action) {
|
|
266
|
-
const current = this.stateSignal();
|
|
267
|
-
if (current === undefined)
|
|
268
|
-
return;
|
|
269
|
-
const next = navigatorReducer(current, action);
|
|
270
|
-
this.planCache.clear();
|
|
271
|
-
this.stateSignal.set(next);
|
|
272
|
-
const liveRouteKeys = new Set(next.routes.map(route => route.key));
|
|
273
|
-
for (const route of next.routes) {
|
|
274
|
-
this.emitterFor(route.key).emit(NAVIGATION_EVENT_STATE, next);
|
|
275
|
-
}
|
|
276
|
-
for (const routeKey of this.emitters.keys()) {
|
|
277
|
-
if (!liveRouteKeys.has(routeKey))
|
|
278
|
-
this.emitters.delete(routeKey);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
emitterFor(routeKey) {
|
|
282
|
-
let emitter = this.emitters.get(routeKey);
|
|
283
|
-
if (!emitter) {
|
|
284
|
-
emitter = createNavigationEmitter();
|
|
285
|
-
this.emitters.set(routeKey, emitter);
|
|
286
|
-
}
|
|
287
|
-
return emitter;
|
|
288
|
-
}
|
|
289
|
-
mergedOptionsFor(route) {
|
|
290
|
-
const entry = this.registry.get(route.name);
|
|
291
|
-
const optionsArgs = { route, navigation: this };
|
|
292
|
-
const own = entry === undefined
|
|
293
|
-
? undefined
|
|
294
|
-
: typeof entry.options === 'function'
|
|
295
|
-
? entry.options(optionsArgs)
|
|
296
|
-
: entry.options;
|
|
297
|
-
return { ...this.screenOptions, ...own };
|
|
298
|
-
}
|
|
299
|
-
componentFor(route) {
|
|
300
|
-
return this.registry.get(route.name)?.component ?? null;
|
|
301
|
-
}
|
|
302
|
-
stackHostProps() {
|
|
303
|
-
return resolveStackProps({
|
|
304
|
-
passthrough: {
|
|
305
|
-
[STACK_ON_FINISH_TRANSITIONING]: () => dlog(`Stack: onFinishTransitioning at t=${Date.now()}`),
|
|
306
|
-
},
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
// Threads a route's merged options through the shared ~14-call resolver sequence (see
|
|
310
|
-
// core/render-stack.ts's resolveScreenRenderPlan) every per-route template method below picks
|
|
311
|
-
// its one field from. Angular has no per-route closure scope the way React's `.map`/Vue's render
|
|
312
|
-
// loop do, so each template-bound method calls this per change-detection cycle - cached below
|
|
313
|
-
// by `${route.key}:${index}` so the ~7 accessors that share a route+index resolve the plan once
|
|
314
|
-
// per actual state change instead of once per template read; `dispatch` clears the cache before
|
|
315
|
-
// recomputing so no stale entry survives a state transition. Screen appear/disappear stay
|
|
316
|
-
// adapter-owned (close over `this.dispatch`/`this.emitterFor`); the search bar passthrough
|
|
317
|
-
// carries no dlog wrapper, unlike React/Vue (see this file's own review notes) - its imperative
|
|
318
|
-
// ref rides a separate directive (searchBarRef/[symbioteSearchBarRef]), not this passthrough map.
|
|
319
|
-
planFor(route, index) {
|
|
320
|
-
const cacheKey = `${route.key}:${index}`;
|
|
321
|
-
const cached = this.planCache.get(cacheKey);
|
|
322
|
-
if (cached)
|
|
323
|
-
return cached;
|
|
324
|
-
const mergedOptions = this.mergedOptionsFor(route);
|
|
325
|
-
const searchBarOptions = mergedOptions.headerSearchBarOptions;
|
|
326
|
-
const plan = resolveScreenRenderPlan({
|
|
327
|
-
screenId: route.key,
|
|
328
|
-
index,
|
|
329
|
-
routeCount: this.stateSignal()?.routes.length ?? 1,
|
|
330
|
-
options: mergedOptions,
|
|
331
|
-
platform: NAVIGATOR_PLATFORM,
|
|
332
|
-
isAndroid: Platform.OS === 'android',
|
|
333
|
-
screenPassthrough: {
|
|
334
|
-
[SCREEN_ON_DISMISSED]: () => this.dispatch({ type: 'pop', count: 1 }),
|
|
335
|
-
[SCREEN_ON_HEADER_BACK_BUTTON_CLICKED]: () => this.dispatch({ type: 'pop', count: 1 }),
|
|
336
|
-
[SCREEN_ON_APPEAR]: () => {
|
|
337
|
-
dlog(`Stack: route "${route.name}" appeared (focus)`);
|
|
338
|
-
this.emitterFor(route.key).emit(NAVIGATION_EVENT_FOCUS);
|
|
339
|
-
},
|
|
340
|
-
[SCREEN_ON_DISAPPEAR]: () => {
|
|
341
|
-
dlog(`Stack: route "${route.name}" disappeared (blur)`);
|
|
342
|
-
this.emitterFor(route.key).emit(NAVIGATION_EVENT_BLUR);
|
|
343
|
-
},
|
|
344
|
-
},
|
|
345
|
-
searchBarPassthrough: searchBarOptions
|
|
346
|
-
? buildSearchBarPassthrough(searchBarOptions)
|
|
347
|
-
: undefined,
|
|
348
|
-
});
|
|
349
|
-
this.planCache.set(cacheKey, plan);
|
|
350
|
-
return plan;
|
|
351
|
-
}
|
|
352
|
-
outerScreenIsModal(route, index) {
|
|
353
|
-
return this.planFor(route, index).screenViewName === RNS_MODAL_SCREEN_VIEW_NAME;
|
|
354
|
-
}
|
|
355
|
-
isInModal(route, index) {
|
|
356
|
-
return this.planFor(route, index).inModal;
|
|
357
|
-
}
|
|
358
|
-
screenHostProps(route, index) {
|
|
359
|
-
return this.planFor(route, index).screenProps;
|
|
360
|
-
}
|
|
361
|
-
innerStackProps() {
|
|
362
|
-
return { style: resolveHeaderInModalStackStyle() };
|
|
363
|
-
}
|
|
364
|
-
innerScreenProps(route, index) {
|
|
365
|
-
const plan = this.planFor(route, index);
|
|
366
|
-
return { style: plan.innerScreenStyle, activityState: plan.activityState };
|
|
367
|
-
}
|
|
368
|
-
contentWrapperProps(route, index) {
|
|
369
|
-
return this.planFor(route, index).contentWrapperProps;
|
|
370
|
-
}
|
|
371
|
-
headerConfigProps(route, index) {
|
|
372
|
-
return this.planFor(route, index).headerConfig.props;
|
|
373
|
-
}
|
|
374
|
-
hasSearchBar(route) {
|
|
375
|
-
return this.mergedOptionsFor(route).headerSearchBarOptions !== undefined;
|
|
376
|
-
}
|
|
377
|
-
searchBarRef(route) {
|
|
378
|
-
return this.mergedOptionsFor(route).headerSearchBarOptions?.ref;
|
|
379
|
-
}
|
|
380
|
-
searchBarProps(route, index) {
|
|
381
|
-
return this.planFor(route, index).searchBarProps ?? {};
|
|
382
|
-
}
|
|
383
|
-
};
|
|
384
|
-
return Stack = _classThis;
|
|
385
|
-
})();
|
|
386
|
-
export { Stack };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Type } from '@angular/core';
|
|
2
|
-
import type { IRoute, ITabOptions } from '../core';
|
|
3
|
-
import type { ITabNavigatorHandle } from '../core';
|
|
4
|
-
export type ITabScreenOptionsArgs = {
|
|
5
|
-
route: IRoute<unknown>;
|
|
6
|
-
navigation: ITabNavigatorHandle;
|
|
7
|
-
};
|
|
8
|
-
export type ITabScreenOptionsResolver = (props: ITabScreenOptionsArgs) => ITabOptions;
|
|
9
|
-
export declare class TabScreenDirective {
|
|
10
|
-
name: string;
|
|
11
|
-
component: Type<unknown>;
|
|
12
|
-
options?: ITabOptions | ITabScreenOptionsResolver;
|
|
13
|
-
initialParams?: unknown;
|
|
14
|
-
}
|