@symbiote-native/navigation 2.0.3 → 2.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 +42 -12
- package/build/angular/drawer/index.js +29 -13
- package/build/angular/index.d.ts +4 -4
- package/build/angular/injectors/inject-navigation.js +1 -1
- package/build/angular/navigation-scope.directive.js +1 -1
- package/build/angular/search-bar-ref.directive.js +1 -1
- package/build/angular/stack/index.d.ts +2 -0
- package/build/angular/stack/index.js +43 -9
- package/build/angular/tabs/index.d.ts +1 -1
- package/build/angular/tabs/index.js +40 -13
- package/build/core/drawer-options/index.js +19 -5
- package/build/core/drawer-router-state/index.js +8 -2
- package/build/core/guards.js +3 -1
- package/build/core/header-bar-buttons.js +14 -4
- package/build/core/index.d.ts +6 -5
- package/build/core/index.js +7 -3
- package/build/core/navigator-state/index.js +12 -4
- package/build/core/render-drawer.js +4 -1
- package/build/core/render-stack.js +13 -4
- package/build/core/screen-options.js +1 -1
- package/build/core/search-bar-commands.js +1 -1
- package/build/core/stack-router-state/index.d.ts +2 -0
- package/build/core/stack-router-state/index.js +44 -0
- package/build/core/state-persistence/index.js +6 -2
- package/build/core/tab-router-state/index.d.ts +1 -0
- package/build/core/tab-router-state/index.js +27 -2
- package/build/react/drawer/index.js +59 -26
- package/build/react/index.d.ts +7 -7
- package/build/react/index.js +2 -2
- package/build/react/stack/index.js +47 -10
- package/build/react/tabs/index.js +36 -12
- package/build/solid/drawer/index.d.ts +22 -0
- package/build/solid/drawer/index.js +394 -0
- package/build/solid/drawer-screen-props.d.ts +13 -0
- package/build/solid/drawer-screen-props.js +2 -0
- package/build/solid/host.d.ts +2 -0
- package/build/solid/host.js +23 -0
- package/build/solid/index.d.ts +19 -0
- package/build/solid/index.js +24 -0
- package/build/solid/linking.d.ts +3 -0
- package/build/solid/linking.js +55 -0
- package/build/solid/navigation-context.d.ts +13 -0
- package/build/solid/navigation-context.js +37 -0
- package/build/solid/primitives/create-focus-effect.d.ts +1 -0
- package/build/solid/primitives/create-focus-effect.js +30 -0
- package/build/solid/primitives/create-is-focused.d.ts +2 -0
- package/build/solid/primitives/create-is-focused.js +31 -0
- package/build/solid/primitives/create-navigation-state.d.ts +3 -0
- package/build/solid/primitives/create-navigation-state.js +30 -0
- package/build/solid/primitives/index.d.ts +12 -0
- package/build/solid/primitives/index.js +8 -0
- package/build/solid/primitives/use-drawer-navigation.d.ts +5 -0
- package/build/solid/primitives/use-drawer-navigation.js +15 -0
- package/build/solid/primitives/use-navigation.d.ts +8 -0
- package/build/solid/primitives/use-navigation.js +23 -0
- package/build/solid/primitives/use-route.d.ts +3 -0
- package/build/solid/primitives/use-route.js +14 -0
- package/build/solid/primitives/use-stack-navigation.d.ts +5 -0
- package/build/solid/primitives/use-stack-navigation.js +19 -0
- package/build/solid/primitives/use-tab-navigation.d.ts +5 -0
- package/build/solid/primitives/use-tab-navigation.js +15 -0
- package/build/solid/screen-props.d.ts +19 -0
- package/build/solid/screen-props.js +9 -0
- package/build/solid/screen-registry.d.ts +31 -0
- package/build/solid/screen-registry.js +86 -0
- package/build/solid/screen.d.ts +6 -0
- package/build/solid/screen.js +69 -0
- package/build/solid/stack/index.d.ts +15 -0
- package/build/solid/stack/index.js +348 -0
- package/build/solid/tab-screen-props.d.ts +13 -0
- package/build/solid/tab-screen-props.js +3 -0
- package/build/solid/tabs/index.d.ts +14 -0
- package/build/solid/tabs/index.js +228 -0
- package/build/svelte/attachments.d.ts +5 -0
- package/build/svelte/attachments.js +61 -0
- package/build/svelte/descriptor-subtree.d.ts +3 -0
- package/build/svelte/descriptor-subtree.js +39 -0
- package/build/svelte/drawer/drawer-props.d.ts +14 -0
- package/build/svelte/drawer/drawer-props.js +3 -0
- package/build/svelte/drawer/index.d.ts +10 -0
- package/build/svelte/drawer/index.js +6 -0
- package/build/svelte/drawer/index.svelte +559 -0
- package/build/svelte/drawer/index.svelte.d.ts +10 -0
- package/build/svelte/drawer-screen-props.d.ts +13 -0
- package/build/svelte/drawer-screen-props.js +4 -0
- package/build/svelte/drawer-screen.svelte +25 -0
- package/build/svelte/drawer-screen.svelte.d.ts +4 -0
- package/build/svelte/index.d.ts +21 -0
- package/build/svelte/index.js +20 -0
- package/build/svelte/linking.svelte.d.ts +2 -0
- package/build/svelte/linking.svelte.js +55 -0
- package/build/svelte/navigation-context.d.ts +14 -0
- package/build/svelte/navigation-context.js +44 -0
- package/build/svelte/navigation-scope.svelte +27 -0
- package/build/svelte/navigation-scope.svelte.d.ts +9 -0
- package/build/svelte/registry-host.d.ts +1 -0
- package/build/svelte/registry-host.js +26 -0
- package/build/svelte/runes/index.d.ts +12 -0
- package/build/svelte/runes/index.js +12 -0
- package/build/svelte/runes/use-drawer-navigation.svelte.d.ts +6 -0
- package/build/svelte/runes/use-drawer-navigation.svelte.js +19 -0
- package/build/svelte/runes/use-focus-effect.svelte.d.ts +1 -0
- package/build/svelte/runes/use-focus-effect.svelte.js +31 -0
- package/build/svelte/runes/use-is-focused.svelte.d.ts +3 -0
- package/build/svelte/runes/use-is-focused.svelte.js +34 -0
- package/build/svelte/runes/use-navigation-state.svelte.d.ts +4 -0
- package/build/svelte/runes/use-navigation-state.svelte.js +39 -0
- package/build/svelte/runes/use-navigation.svelte.d.ts +9 -0
- package/build/svelte/runes/use-navigation.svelte.js +26 -0
- package/build/svelte/runes/use-route.svelte.d.ts +4 -0
- package/build/svelte/runes/use-route.svelte.js +12 -0
- package/build/svelte/runes/use-stack-navigation.svelte.d.ts +6 -0
- package/build/svelte/runes/use-stack-navigation.svelte.js +22 -0
- package/build/svelte/runes/use-tab-navigation.svelte.d.ts +6 -0
- package/build/svelte/runes/use-tab-navigation.svelte.js +19 -0
- package/build/svelte/screen-props.d.ts +21 -0
- package/build/svelte/screen-props.js +6 -0
- package/build/svelte/screen-registry.d.ts +17 -0
- package/build/svelte/screen-registry.js +57 -0
- package/build/svelte/screen.svelte +28 -0
- package/build/svelte/screen.svelte.d.ts +4 -0
- package/build/svelte/stack/index.d.ts +14 -0
- package/build/svelte/stack/index.js +7 -0
- package/build/svelte/stack/index.svelte +261 -0
- package/build/svelte/stack/index.svelte.d.ts +15 -0
- package/build/svelte/stack/stack-props.d.ts +20 -0
- package/build/svelte/stack/stack-props.js +4 -0
- package/build/svelte/stack/stack-screen.svelte +205 -0
- package/build/svelte/stack/stack-screen.svelte.d.ts +4 -0
- package/build/svelte/tab-screen-props.d.ts +13 -0
- package/build/svelte/tab-screen-props.js +4 -0
- package/build/svelte/tab-screen.svelte +26 -0
- package/build/svelte/tab-screen.svelte.d.ts +4 -0
- package/build/svelte/tabs/index.d.ts +8 -0
- package/build/svelte/tabs/index.js +6 -0
- package/build/svelte/tabs/index.svelte +269 -0
- package/build/svelte/tabs/index.svelte.d.ts +8 -0
- package/build/svelte/tabs/tab-props.d.ts +7 -0
- package/build/svelte/tabs/tab-props.js +3 -0
- package/build/vue/composables/use-navigation.js +5 -1
- package/build/vue/drawer/index.js +36 -13
- package/build/vue/index.d.ts +3 -3
- package/build/vue/navigation-context.js +1 -1
- package/build/vue/stack/index.js +43 -18
- package/build/vue/tabs/index.js +65 -39
- package/build-ngc/angular/drawer/index.js +40 -18
- package/build-ngc/angular/drawer/index.js.map +1 -1
- package/build-ngc/angular/drawer-screen.directive.js +3 -3
- package/build-ngc/angular/index.d.ts +4 -4
- package/build-ngc/angular/index.js.map +1 -1
- package/build-ngc/angular/injectors/inject-focus-effect.js.map +1 -1
- package/build-ngc/angular/injectors/inject-is-focused.js.map +1 -1
- package/build-ngc/angular/injectors/inject-navigation-state.js.map +1 -1
- package/build-ngc/angular/injectors/inject-navigation.js +1 -1
- package/build-ngc/angular/injectors/inject-navigation.js.map +1 -1
- package/build-ngc/angular/linking.js.map +1 -1
- package/build-ngc/angular/navigation-context.service.js +3 -3
- package/build-ngc/angular/navigation-context.service.js.map +1 -1
- package/build-ngc/angular/navigation-scope.directive.js +4 -4
- package/build-ngc/angular/navigation-scope.directive.js.map +1 -1
- package/build-ngc/angular/screen.directive.js +3 -3
- package/build-ngc/angular/screen.directive.js.map +1 -1
- package/build-ngc/angular/search-bar-ref.directive.js +4 -4
- package/build-ngc/angular/search-bar-ref.directive.js.map +1 -1
- package/build-ngc/angular/stack/index.d.ts +2 -0
- package/build-ngc/angular/stack/index.js +52 -14
- package/build-ngc/angular/stack/index.js.map +1 -1
- package/build-ngc/angular/tab-screen.directive.js +3 -3
- package/build-ngc/angular/tab-screen.directive.js.map +1 -1
- package/build-ngc/angular/tabs/index.d.ts +1 -1
- package/build-ngc/angular/tabs/index.js +43 -16
- package/build-ngc/angular/tabs/index.js.map +1 -1
- package/build-ngc/core/constants.js.map +1 -1
- package/build-ngc/core/drawer-options/index.js +19 -5
- package/build-ngc/core/drawer-options/index.js.map +1 -1
- package/build-ngc/core/drawer-router-state/index.js +8 -2
- package/build-ngc/core/drawer-router-state/index.js.map +1 -1
- package/build-ngc/core/guards.js +3 -1
- package/build-ngc/core/guards.js.map +1 -1
- package/build-ngc/core/header-bar-buttons.js +14 -4
- package/build-ngc/core/header-bar-buttons.js.map +1 -1
- package/build-ngc/core/index.d.ts +6 -5
- package/build-ngc/core/index.js +7 -3
- package/build-ngc/core/index.js.map +1 -1
- package/build-ngc/core/linking-config/index.js.map +1 -1
- package/build-ngc/core/navigation-events/index.js.map +1 -1
- package/build-ngc/core/navigator-handles/index.js.map +1 -1
- package/build-ngc/core/navigator-state/index.js +12 -4
- package/build-ngc/core/navigator-state/index.js.map +1 -1
- package/build-ngc/core/render-drawer.js +4 -1
- package/build-ngc/core/render-drawer.js.map +1 -1
- package/build-ngc/core/render-stack.js +13 -4
- package/build-ngc/core/render-stack.js.map +1 -1
- package/build-ngc/core/render-tabs.js.map +1 -1
- package/build-ngc/core/screen-options.js +1 -1
- package/build-ngc/core/screen-options.js.map +1 -1
- package/build-ngc/core/search-bar-commands.js +1 -1
- package/build-ngc/core/search-bar-commands.js.map +1 -1
- package/build-ngc/core/stack-router-state/index.d.ts +2 -0
- package/build-ngc/core/stack-router-state/index.js +45 -0
- package/build-ngc/core/stack-router-state/index.js.map +1 -0
- package/build-ngc/core/state-persistence/index.js +6 -2
- package/build-ngc/core/state-persistence/index.js.map +1 -1
- package/build-ngc/core/tab-router-state/index.d.ts +1 -0
- package/build-ngc/core/tab-router-state/index.js +27 -2
- package/build-ngc/core/tab-router-state/index.js.map +1 -1
- package/package.json +44 -16
- package/src/angular/drawer/index.ts +75 -29
- package/src/angular/index.ts +20 -4
- package/src/angular/injectors/inject-focus-effect.ts +8 -2
- package/src/angular/injectors/inject-is-focused.ts +6 -4
- package/src/angular/injectors/inject-navigation-state.ts +7 -4
- package/src/angular/injectors/inject-navigation.ts +12 -3
- package/src/angular/linking.ts +4 -1
- package/src/angular/navigation-context.service.ts +5 -2
- package/src/angular/navigation-scope.directive.ts +6 -2
- package/src/angular/screen.directive.ts +13 -3
- package/src/angular/search-bar-ref.directive.ts +10 -2
- package/src/angular/stack/index.ts +91 -24
- package/src/angular/tab-screen.directive.ts +3 -1
- package/src/angular/tabs/index.ts +54 -16
- package/src/core/constants.ts +6 -3
- package/src/core/drawer-options/index.ts +40 -13
- package/src/core/drawer-router-state/index.ts +11 -3
- package/src/core/guards.ts +3 -1
- package/src/core/header-bar-buttons.ts +41 -12
- package/src/core/index.ts +29 -5
- package/src/core/linking-config/index.ts +31 -10
- package/src/core/navigation-events/index.ts +8 -2
- package/src/core/navigator-handles/index.ts +8 -3
- package/src/core/navigator-props.ts +13 -4
- package/src/core/navigator-state/index.ts +24 -7
- package/src/core/render-drawer.ts +24 -9
- package/src/core/render-stack.ts +52 -13
- package/src/core/render-tabs.ts +24 -6
- package/src/core/screen-options.ts +15 -5
- package/src/core/search-bar-commands.ts +12 -3
- package/src/core/stack-router-state/index.ts +52 -0
- package/src/core/state-persistence/index.ts +13 -3
- package/src/core/tab-router-state/index.ts +35 -3
- package/src/react/drawer/index.ts +409 -330
- package/src/react/drawer-screen.ts +8 -2
- package/src/react/hooks/use-focus-effect.ts +8 -2
- package/src/react/hooks/use-is-focused.ts +6 -2
- package/src/react/hooks/use-navigation.ts +8 -2
- package/src/react/index.ts +37 -7
- package/src/react/linking.ts +4 -1
- package/src/react/navigation-context.ts +6 -2
- package/src/react/screen.ts +12 -3
- package/src/react/stack/index.ts +297 -220
- package/src/react/tab-screen.ts +3 -1
- package/src/react/tabs/index.ts +202 -139
- package/src/solid/drawer/index.ts +570 -0
- package/src/solid/drawer-screen-props.ts +24 -0
- package/src/solid/host.ts +29 -0
- package/src/solid/index.ts +87 -0
- package/src/solid/linking.ts +74 -0
- package/src/solid/navigation-context.ts +56 -0
- package/src/solid/primitives/create-focus-effect.ts +41 -0
- package/src/solid/primitives/create-is-focused.ts +41 -0
- package/src/solid/primitives/create-navigation-state.ts +44 -0
- package/src/solid/primitives/index.ts +12 -0
- package/src/solid/primitives/use-drawer-navigation.ts +25 -0
- package/src/solid/primitives/use-navigation.ts +44 -0
- package/src/solid/primitives/use-route.ts +18 -0
- package/src/solid/primitives/use-stack-navigation.ts +29 -0
- package/src/solid/primitives/use-tab-navigation.ts +25 -0
- package/src/solid/screen-props.ts +51 -0
- package/src/solid/screen-registry.ts +159 -0
- package/src/solid/screen.ts +80 -0
- package/src/solid/stack/index.ts +528 -0
- package/src/solid/tab-screen-props.ts +21 -0
- package/src/solid/tabs/index.ts +327 -0
- package/src/svelte/attachments.ts +70 -0
- package/src/svelte/descriptor-subtree.ts +51 -0
- package/src/svelte/drawer/drawer-props.ts +28 -0
- package/src/svelte/drawer/index.svelte +559 -0
- package/src/svelte/drawer/index.ts +10 -0
- package/src/svelte/drawer-screen-props.ts +26 -0
- package/src/svelte/drawer-screen.svelte +25 -0
- package/src/svelte/fabric-tree.test-helper.ts +95 -0
- package/src/svelte/index.ts +83 -0
- package/src/svelte/linking.svelte.ts +72 -0
- package/src/svelte/navigation-context.ts +62 -0
- package/src/svelte/navigation-scope.svelte +27 -0
- package/src/svelte/registry-host.ts +26 -0
- package/src/svelte/runes/index.ts +17 -0
- package/src/svelte/runes/use-drawer-navigation.svelte.ts +31 -0
- package/src/svelte/runes/use-focus-effect.svelte.ts +41 -0
- package/src/svelte/runes/use-is-focused.svelte.ts +38 -0
- package/src/svelte/runes/use-navigation-state.svelte.ts +48 -0
- package/src/svelte/runes/use-navigation.svelte.ts +49 -0
- package/src/svelte/runes/use-route.svelte.ts +16 -0
- package/src/svelte/runes/use-stack-navigation.svelte.ts +34 -0
- package/src/svelte/runes/use-tab-navigation.svelte.ts +29 -0
- package/src/svelte/screen-props.ts +50 -0
- package/src/svelte/screen-registry.ts +98 -0
- package/src/svelte/screen.svelte +28 -0
- package/src/svelte/stack/index.svelte +261 -0
- package/src/svelte/stack/index.ts +11 -0
- package/src/svelte/stack/stack-props.ts +31 -0
- package/src/svelte/stack/stack-screen.svelte +205 -0
- package/src/svelte/svelte-ambient.d.ts +6 -0
- package/src/svelte/svelte-compile.test-helper.ts +147 -0
- package/src/svelte/tab-screen-props.ts +22 -0
- package/src/svelte/tab-screen.svelte +26 -0
- package/src/svelte/tabs/index.svelte +269 -0
- package/src/svelte/tabs/index.ts +10 -0
- package/src/svelte/tabs/tab-props.ts +13 -0
- package/src/vue/composables/use-navigation-state.ts +7 -4
- package/src/vue/composables/use-navigation.ts +13 -3
- package/src/vue/drawer/index.ts +128 -41
- package/src/vue/drawer-screen.ts +12 -5
- package/src/vue/index.ts +15 -3
- package/src/vue/linking.ts +7 -2
- package/src/vue/navigation-context.ts +17 -5
- package/src/vue/screen.ts +7 -2
- package/src/vue/stack/index.ts +108 -43
- package/src/vue/tab-screen.ts +3 -1
- package/src/vue/tabs/index.ts +109 -68
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbiote-native/navigation",
|
|
3
|
-
"version": "2.0
|
|
4
|
-
"description": "Native stack navigator for SymbioteNative, built on react-native-screens' native view primitives (RNSScreen/RNSScreenStack) — one framework-agnostic core, reachable from the React, Vue, and Angular adapters.",
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "Native stack navigator for SymbioteNative, built on react-native-screens' native view primitives (RNSScreen/RNSScreenStack) — one framework-agnostic core, reachable from the React, Vue, Svelte, Solid, and Angular adapters.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -30,6 +30,14 @@
|
|
|
30
30
|
"types": "./build/vue/index.d.ts",
|
|
31
31
|
"default": "./build/vue/index.js"
|
|
32
32
|
},
|
|
33
|
+
"./svelte": {
|
|
34
|
+
"types": "./build/svelte/index.d.ts",
|
|
35
|
+
"default": "./build/svelte/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./solid": {
|
|
38
|
+
"types": "./build/solid/index.d.ts",
|
|
39
|
+
"default": "./build/solid/index.js"
|
|
40
|
+
},
|
|
33
41
|
"./angular": {
|
|
34
42
|
"types": "./build-ngc/angular/index.d.ts",
|
|
35
43
|
"default": "./build-ngc/angular/index.js"
|
|
@@ -141,19 +149,23 @@
|
|
|
141
149
|
},
|
|
142
150
|
"dependencies": {
|
|
143
151
|
"react-native-screens": "4.26.0",
|
|
144
|
-
"@symbiote-native/components": "0.
|
|
152
|
+
"@symbiote-native/components": "0.5.0"
|
|
145
153
|
},
|
|
146
154
|
"peerDependencies": {
|
|
147
155
|
"@angular/common": ">=20",
|
|
148
156
|
"@angular/core": ">=20",
|
|
157
|
+
"@symbiote-native/angular": ">=0.6.2",
|
|
149
158
|
"@symbiote-native/engine": ">=0.1.7",
|
|
159
|
+
"@symbiote-native/react": ">=0.2.8",
|
|
160
|
+
"@symbiote-native/solid": ">=0.0.1",
|
|
161
|
+
"@symbiote-native/svelte": ">=0.1.0",
|
|
162
|
+
"@symbiote-native/vue": ">=0.3.8",
|
|
150
163
|
"@vue/runtime-core": "^3.5.13",
|
|
151
164
|
"react": ">=19.0.0",
|
|
152
165
|
"react-native": ">=0.86",
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"@symbiote-native/vue": "0.3.8"
|
|
166
|
+
"solid-js": ">=1.9.0",
|
|
167
|
+
"svelte": ">=5.56.0",
|
|
168
|
+
"vue": ">=3.5.0"
|
|
157
169
|
},
|
|
158
170
|
"peerDependenciesMeta": {
|
|
159
171
|
"@angular/common": {
|
|
@@ -168,6 +180,12 @@
|
|
|
168
180
|
"@symbiote-native/react": {
|
|
169
181
|
"optional": true
|
|
170
182
|
},
|
|
183
|
+
"@symbiote-native/solid": {
|
|
184
|
+
"optional": true
|
|
185
|
+
},
|
|
186
|
+
"@symbiote-native/svelte": {
|
|
187
|
+
"optional": true
|
|
188
|
+
},
|
|
171
189
|
"@symbiote-native/vue": {
|
|
172
190
|
"optional": true
|
|
173
191
|
},
|
|
@@ -177,25 +195,35 @@
|
|
|
177
195
|
"react": {
|
|
178
196
|
"optional": true
|
|
179
197
|
},
|
|
198
|
+
"solid-js": {
|
|
199
|
+
"optional": true
|
|
200
|
+
},
|
|
201
|
+
"svelte": {
|
|
202
|
+
"optional": true
|
|
203
|
+
},
|
|
180
204
|
"vue": {
|
|
181
205
|
"optional": true
|
|
182
206
|
}
|
|
183
207
|
},
|
|
184
208
|
"devDependencies": {
|
|
185
|
-
"@angular/common": "
|
|
186
|
-
"@angular/compiler": "
|
|
187
|
-
"@angular/compiler-cli": "
|
|
188
|
-
"@angular/core": "
|
|
209
|
+
"@angular/common": "~22.0.8",
|
|
210
|
+
"@angular/compiler": "~22.0.8",
|
|
211
|
+
"@angular/compiler-cli": "~22.0.8",
|
|
212
|
+
"@angular/core": "~22.0.8",
|
|
189
213
|
"@types/node": "^26.0.0",
|
|
190
214
|
"@types/react": "^19.2.0",
|
|
191
215
|
"@vue/runtime-core": "^3.5.13",
|
|
192
216
|
"react": "19.2.3",
|
|
217
|
+
"solid-js": "^1.9.14",
|
|
218
|
+
"svelte": "^5.56.0",
|
|
193
219
|
"typescript": "~6.0.0",
|
|
194
|
-
"@symbiote-native/angular": "0.
|
|
195
|
-
"@symbiote-native/engine": "0.
|
|
196
|
-
"@symbiote-native/react": "0.
|
|
197
|
-
"@symbiote-native/
|
|
198
|
-
"@symbiote-native/
|
|
220
|
+
"@symbiote-native/angular": "0.8.0",
|
|
221
|
+
"@symbiote-native/engine": "0.3.0",
|
|
222
|
+
"@symbiote-native/react": "0.4.0",
|
|
223
|
+
"@symbiote-native/solid": "0.1.0",
|
|
224
|
+
"@symbiote-native/svelte": "0.3.0",
|
|
225
|
+
"@symbiote-native/test-utils": "0.2.0",
|
|
226
|
+
"@symbiote-native/vue": "0.5.0"
|
|
199
227
|
},
|
|
200
228
|
"scripts": {
|
|
201
229
|
"clean": "rm -rf build-ngc",
|
|
@@ -65,7 +65,10 @@ import {
|
|
|
65
65
|
View,
|
|
66
66
|
WindowDimensionsService,
|
|
67
67
|
} from '@symbiote-native/angular';
|
|
68
|
-
import type {
|
|
68
|
+
import type {
|
|
69
|
+
IDescriptor,
|
|
70
|
+
IDescriptorChild,
|
|
71
|
+
} from '@symbiote-native/components';
|
|
69
72
|
import {
|
|
70
73
|
DRAWER_DEFAULT_OVERLAY_COLOR,
|
|
71
74
|
NAVIGATION_EVENT_BLUR,
|
|
@@ -132,7 +135,10 @@ let drawerInstanceCounter = 0;
|
|
|
132
135
|
@for (slot of slotOrder(); track slot) {
|
|
133
136
|
@switch (slot) {
|
|
134
137
|
@case ('content') {
|
|
135
|
-
<AnimatedView
|
|
138
|
+
<AnimatedView
|
|
139
|
+
[style]="contentStyle()"
|
|
140
|
+
[animatedProps]="slotAnimatedProps('content')"
|
|
141
|
+
>
|
|
136
142
|
@if (focusedRoute(); as route) {
|
|
137
143
|
@if (componentForRoute(route); as component) {
|
|
138
144
|
<ng-container
|
|
@@ -153,7 +159,10 @@ let drawerInstanceCounter = 0;
|
|
|
153
159
|
/>
|
|
154
160
|
}
|
|
155
161
|
@case ('panel') {
|
|
156
|
-
<AnimatedView
|
|
162
|
+
<AnimatedView
|
|
163
|
+
[style]="panelStyle()"
|
|
164
|
+
[animatedProps]="slotAnimatedProps('panel')"
|
|
165
|
+
>
|
|
157
166
|
@if (drawerContentTemplate) {
|
|
158
167
|
<ng-container
|
|
159
168
|
*ngTemplateOutlet="
|
|
@@ -170,7 +179,9 @@ let drawerInstanceCounter = 0;
|
|
|
170
179
|
}
|
|
171
180
|
`,
|
|
172
181
|
})
|
|
173
|
-
export class Drawer
|
|
182
|
+
export class Drawer
|
|
183
|
+
implements AfterContentInit, OnChanges, OnDestroy, IDrawerNavigatorHandle
|
|
184
|
+
{
|
|
174
185
|
@ContentChildren(DrawerScreenDirective)
|
|
175
186
|
private readonly drawerScreenChildren!: QueryList<DrawerScreenDirective>;
|
|
176
187
|
@ContentChild('drawerContent', { read: TemplateRef })
|
|
@@ -187,15 +198,19 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
187
198
|
@Input() swipeMinDistance?: number;
|
|
188
199
|
@Input() swipeMinVelocity?: number;
|
|
189
200
|
|
|
190
|
-
private readonly windowDimensions = inject(WindowDimensionsService)
|
|
201
|
+
private readonly windowDimensions = inject(WindowDimensionsService)
|
|
202
|
+
.dimensions;
|
|
191
203
|
|
|
192
204
|
private readonly routeIdPrefix = `drawer-${(drawerInstanceCounter += 1)}`;
|
|
193
205
|
// Keyed by name -> the LIVE DrawerScreenDirective instance - see stack.ts's matching comment
|
|
194
206
|
// for why a snapshot copy would go stale on an in-place `[options]`/`[component]` change.
|
|
195
207
|
private readonly registry = new Map<string, DrawerScreenDirective>();
|
|
196
|
-
private drawerScreenChildrenSubscription:
|
|
208
|
+
private drawerScreenChildrenSubscription:
|
|
209
|
+
{ unsubscribe: () => void } | undefined;
|
|
197
210
|
|
|
198
|
-
private readonly stateSignal = signal<IDrawerRouterState | undefined>(
|
|
211
|
+
private readonly stateSignal = signal<IDrawerRouterState | undefined>(
|
|
212
|
+
undefined,
|
|
213
|
+
);
|
|
199
214
|
readonly state = this.stateSignal.asReadonly();
|
|
200
215
|
|
|
201
216
|
private currentEmitterKey: string | undefined;
|
|
@@ -221,12 +236,14 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
221
236
|
this.dispatch({ type: 'toggleDrawer' });
|
|
222
237
|
};
|
|
223
238
|
readonly jumpTo = (name: string): void => {
|
|
224
|
-
//
|
|
225
|
-
//
|
|
226
|
-
//
|
|
239
|
+
// Both sides of the dispatch, mirroring vue/drawer/index.ts's jumpTo: an unregistered name is
|
|
240
|
+
// a documented reducer no-op that hands the SAME state back, so animating off the pre-dispatch
|
|
241
|
+
// snapshot alone would slide the panel shut while the router still says isOpen. The signal is
|
|
242
|
+
// set synchronously inside dispatch, so the second read is already the reducer's own answer.
|
|
227
243
|
const wasOpen = this.stateSignal()?.isOpen ?? false;
|
|
228
244
|
this.dispatch({ type: 'jumpTo', name });
|
|
229
|
-
|
|
245
|
+
const isOpenNow = this.stateSignal()?.isOpen ?? false;
|
|
246
|
+
if (wasOpen && !isOpenNow) this.animateProgressTo(false);
|
|
230
247
|
};
|
|
231
248
|
|
|
232
249
|
readonly panResponder = PanResponder.create({
|
|
@@ -258,9 +275,16 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
258
275
|
dlog('Drawer: gesture grant');
|
|
259
276
|
this.dragStartProgress = (this.stateSignal()?.isOpen ?? false) ? 1 : 0;
|
|
260
277
|
},
|
|
261
|
-
onPanResponderMove: (
|
|
278
|
+
onPanResponderMove: (
|
|
279
|
+
_event: ISymbioteEvent,
|
|
280
|
+
gestureState: IPanResponderGestureState,
|
|
281
|
+
): void => {
|
|
262
282
|
this.progress.setValue(
|
|
263
|
-
resolveDragProgress(
|
|
283
|
+
resolveDragProgress(
|
|
284
|
+
gestureState,
|
|
285
|
+
this.dragStartProgress,
|
|
286
|
+
this.optionsSnapshot(),
|
|
287
|
+
),
|
|
264
288
|
);
|
|
265
289
|
},
|
|
266
290
|
onPanResponderRelease: (
|
|
@@ -286,9 +310,10 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
286
310
|
ngAfterContentInit(): void {
|
|
287
311
|
this.rebuildRegistry();
|
|
288
312
|
this.initializeState();
|
|
289
|
-
this.drawerScreenChildrenSubscription =
|
|
290
|
-
this.
|
|
291
|
-
|
|
313
|
+
this.drawerScreenChildrenSubscription =
|
|
314
|
+
this.drawerScreenChildren.changes.subscribe(() => {
|
|
315
|
+
this.rebuildRegistry();
|
|
316
|
+
});
|
|
292
317
|
}
|
|
293
318
|
|
|
294
319
|
ngOnDestroy(): void {
|
|
@@ -316,7 +341,9 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
316
341
|
const routes = this.routesFromRegistry();
|
|
317
342
|
if (routes.length === 0)
|
|
318
343
|
dlog('Drawer: no <ng-template symbioteDrawerScreen> children registered');
|
|
319
|
-
this.stateSignal.set(
|
|
344
|
+
this.stateSignal.set(
|
|
345
|
+
createInitialDrawerRouterState(routes, this.initialRouteName),
|
|
346
|
+
);
|
|
320
347
|
}
|
|
321
348
|
|
|
322
349
|
private dispatch(action: IDrawerRouterAction): void {
|
|
@@ -341,10 +368,12 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
341
368
|
// ngOnChanges (below) pushes every input change in here instead, which drawerRoot/slotsMap CAN
|
|
342
369
|
// track correctly since reading a signal (unlike a plain field) IS visible to computed()'s
|
|
343
370
|
// dependency collection.
|
|
344
|
-
private readonly optionsSnapshot = signal<IDrawerOptions>(
|
|
345
|
-
|
|
346
|
-
this.drawerStyle,
|
|
371
|
+
private readonly optionsSnapshot = signal<IDrawerOptions>(
|
|
372
|
+
this.buildOptionsSnapshot(),
|
|
347
373
|
);
|
|
374
|
+
private readonly drawerStyleSnapshot = signal<
|
|
375
|
+
IStyleProp<IViewStyle> | undefined
|
|
376
|
+
>(this.drawerStyle);
|
|
348
377
|
|
|
349
378
|
ngOnChanges(): void {
|
|
350
379
|
this.optionsSnapshot.set(this.buildOptionsSnapshot());
|
|
@@ -382,10 +411,13 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
382
411
|
private readonly drawerRoot = computed<IDescriptor>(() =>
|
|
383
412
|
renderDrawer(
|
|
384
413
|
{
|
|
385
|
-
overlayColor:
|
|
414
|
+
overlayColor:
|
|
415
|
+
this.optionsSnapshot().overlayColor ?? DRAWER_DEFAULT_OVERLAY_COLOR,
|
|
386
416
|
drawerStyle: this.drawerStyleSnapshot(),
|
|
387
417
|
contentPassthrough: {},
|
|
388
|
-
overlayPassthrough: this.isAnimated()
|
|
418
|
+
overlayPassthrough: this.isAnimated()
|
|
419
|
+
? this.overlayResponderPassthrough()
|
|
420
|
+
: {},
|
|
389
421
|
panelPassthrough: {},
|
|
390
422
|
},
|
|
391
423
|
this.optionsSnapshot(),
|
|
@@ -398,7 +430,8 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
398
430
|
const map = new Map<IDrawerSlot, IDescriptor>();
|
|
399
431
|
order.forEach((slot, index) => {
|
|
400
432
|
const child: IDescriptorChild | undefined = root.children[index];
|
|
401
|
-
if (child !== undefined && typeof child !== 'string')
|
|
433
|
+
if (child !== undefined && typeof child !== 'string')
|
|
434
|
+
map.set(slot, child);
|
|
402
435
|
});
|
|
403
436
|
return map;
|
|
404
437
|
});
|
|
@@ -431,7 +464,9 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
431
464
|
animatedStyle: () => Record<string, unknown>,
|
|
432
465
|
): Record<string, unknown> {
|
|
433
466
|
const base = this.slotsMap().get(slot)?.props.style;
|
|
434
|
-
return this.isAnimated()
|
|
467
|
+
return this.isAnimated()
|
|
468
|
+
? flattenStyle([base, animatedStyle()])
|
|
469
|
+
: flattenStyle(base);
|
|
435
470
|
}
|
|
436
471
|
|
|
437
472
|
contentStyle(): Record<string, unknown> {
|
|
@@ -450,7 +485,10 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
450
485
|
overlayStyle(): Record<string, unknown> {
|
|
451
486
|
return this.slotStyle('overlay', () => {
|
|
452
487
|
const g = resolveDrawerGeometry(this.optionsSnapshot());
|
|
453
|
-
const { opacity, translateX } = resolveDrawerSlotInterpolation(
|
|
488
|
+
const { opacity, translateX } = resolveDrawerSlotInterpolation(
|
|
489
|
+
g,
|
|
490
|
+
'overlay',
|
|
491
|
+
);
|
|
454
492
|
return {
|
|
455
493
|
opacity: this.progress.interpolate(opacity),
|
|
456
494
|
transform: [{ translateX: this.progress.interpolate(translateX) }],
|
|
@@ -511,8 +549,12 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
511
549
|
focusedRouteEmitter(): INavigationEmitter {
|
|
512
550
|
const key = this.focusedRoute()?.key;
|
|
513
551
|
return untracked(() => {
|
|
514
|
-
if (key === this.currentEmitterKey && this.currentEmitter)
|
|
515
|
-
|
|
552
|
+
if (key === this.currentEmitterKey && this.currentEmitter)
|
|
553
|
+
return this.currentEmitter;
|
|
554
|
+
const { blurKey, focusKey } = diffFocusedRoute(
|
|
555
|
+
this.currentEmitterKey,
|
|
556
|
+
key,
|
|
557
|
+
);
|
|
516
558
|
if (blurKey !== undefined && this.currentEmitter) {
|
|
517
559
|
dlog('Drawer: previous route blurred');
|
|
518
560
|
this.currentEmitter.emit(NAVIGATION_EVENT_BLUR);
|
|
@@ -531,7 +573,9 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
531
573
|
});
|
|
532
574
|
}
|
|
533
575
|
|
|
534
|
-
drawerContentContext(
|
|
576
|
+
drawerContentContext(
|
|
577
|
+
currentState: IDrawerRouterState,
|
|
578
|
+
): IDrawerContentContext {
|
|
535
579
|
const descriptors: IDrawerDescriptorMap = {};
|
|
536
580
|
for (const route of currentState.routes) {
|
|
537
581
|
const entry = this.registry.get(route.name);
|
|
@@ -541,6 +585,8 @@ export class Drawer implements AfterContentInit, OnChanges, OnDestroy, IDrawerNa
|
|
|
541
585
|
navigation: this,
|
|
542
586
|
};
|
|
543
587
|
}
|
|
544
|
-
return {
|
|
588
|
+
return {
|
|
589
|
+
$implicit: { state: currentState, descriptors, navigation: this },
|
|
590
|
+
};
|
|
545
591
|
}
|
|
546
592
|
}
|
package/src/angular/index.ts
CHANGED
|
@@ -15,7 +15,11 @@ export type {
|
|
|
15
15
|
IScreenOptionsArgs,
|
|
16
16
|
IScreenOptionsResolver,
|
|
17
17
|
} from './screen.directive';
|
|
18
|
-
export type {
|
|
18
|
+
export type {
|
|
19
|
+
IScreenOptions,
|
|
20
|
+
IStackAnimation,
|
|
21
|
+
IStackPresentation,
|
|
22
|
+
} from '../core';
|
|
19
23
|
|
|
20
24
|
export {
|
|
21
25
|
injectNavigation,
|
|
@@ -46,7 +50,10 @@ export type { ILinkingConfig, IScreenLinkingConfig } from '../core';
|
|
|
46
50
|
export { Tab } from './tabs';
|
|
47
51
|
export type { ITabNavigatorHandle } from './tabs';
|
|
48
52
|
export { TabScreenDirective } from './tab-screen.directive';
|
|
49
|
-
export type {
|
|
53
|
+
export type {
|
|
54
|
+
ITabScreenOptionsArgs,
|
|
55
|
+
ITabScreenOptionsResolver,
|
|
56
|
+
} from './tab-screen.directive';
|
|
50
57
|
export type { ITabOptions, ITabBarIcon } from '../core';
|
|
51
58
|
|
|
52
59
|
// Drawer: the swipeable drawer navigator, a PURE-JS UI (PanResponder + Animated, no
|
|
@@ -54,10 +61,19 @@ export type { ITabOptions, ITabBarIcon } from '../core';
|
|
|
54
61
|
// ../register import above). See drawer.ts's header for the feasibility note re:
|
|
55
62
|
// react-native-gesture-handler / react-native-reanimated parity gaps.
|
|
56
63
|
export { Drawer } from './drawer';
|
|
57
|
-
export type {
|
|
64
|
+
export type {
|
|
65
|
+
IDrawerNavigatorHandle,
|
|
66
|
+
IDrawerDescriptorMap,
|
|
67
|
+
IDrawerContentContext,
|
|
68
|
+
} from './drawer';
|
|
58
69
|
export { DrawerScreenDirective } from './drawer-screen.directive';
|
|
59
70
|
export type {
|
|
60
71
|
IDrawerScreenOptionsArgs,
|
|
61
72
|
IDrawerScreenOptionsResolver,
|
|
62
73
|
} from './drawer-screen.directive';
|
|
63
|
-
export type {
|
|
74
|
+
export type {
|
|
75
|
+
IDrawerOptions,
|
|
76
|
+
IDrawerScreenOptions,
|
|
77
|
+
IDrawerType,
|
|
78
|
+
IDrawerPosition,
|
|
79
|
+
} from '../core';
|
|
@@ -26,8 +26,14 @@ export function injectFocusEffect(effect: IFocusEffectCallback): void {
|
|
|
26
26
|
cleanup = undefined;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
const unsubscribeFocus = context.emitter.addListener(
|
|
30
|
-
|
|
29
|
+
const unsubscribeFocus = context.emitter.addListener(
|
|
30
|
+
NAVIGATION_EVENT_FOCUS,
|
|
31
|
+
runEffect,
|
|
32
|
+
);
|
|
33
|
+
const unsubscribeBlur = context.emitter.addListener(
|
|
34
|
+
NAVIGATION_EVENT_BLUR,
|
|
35
|
+
runCleanup,
|
|
36
|
+
);
|
|
31
37
|
|
|
32
38
|
destroyRef.onDestroy(() => {
|
|
33
39
|
unsubscribeFocus();
|
|
@@ -13,11 +13,13 @@ export function injectIsFocused(): Signal<boolean> {
|
|
|
13
13
|
const destroyRef = inject(DestroyRef);
|
|
14
14
|
const isFocused = signal(false);
|
|
15
15
|
|
|
16
|
-
const unsubscribeFocus = context.emitter.addListener(
|
|
17
|
-
|
|
16
|
+
const unsubscribeFocus = context.emitter.addListener(
|
|
17
|
+
NAVIGATION_EVENT_FOCUS,
|
|
18
|
+
() => isFocused.set(true),
|
|
18
19
|
);
|
|
19
|
-
const unsubscribeBlur = context.emitter.addListener(
|
|
20
|
-
|
|
20
|
+
const unsubscribeBlur = context.emitter.addListener(
|
|
21
|
+
NAVIGATION_EVENT_BLUR,
|
|
22
|
+
() => isFocused.set(false),
|
|
21
23
|
);
|
|
22
24
|
destroyRef.onDestroy(() => {
|
|
23
25
|
unsubscribeFocus();
|
|
@@ -36,10 +36,13 @@ export function injectNavigationState<TResult>(
|
|
|
36
36
|
|
|
37
37
|
const result = signal(selector({ routes: [route] }));
|
|
38
38
|
|
|
39
|
-
const unsubscribe = context.emitter.addListener(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const unsubscribe = context.emitter.addListener(
|
|
40
|
+
NAVIGATION_EVENT_STATE,
|
|
41
|
+
(state: unknown) => {
|
|
42
|
+
if (!isNavigatorState(state)) return;
|
|
43
|
+
result.set(selector(state));
|
|
44
|
+
},
|
|
45
|
+
);
|
|
43
46
|
destroyRef.onDestroy(unsubscribe);
|
|
44
47
|
|
|
45
48
|
return result.asReadonly();
|
|
@@ -6,11 +6,20 @@
|
|
|
6
6
|
// surface. All pub/sub logic lives in ../../core/navigation-events; this function only reads
|
|
7
7
|
// NavigationContextService and binds identity.
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
|
|
9
|
+
import type {
|
|
10
|
+
INavigationEventListener,
|
|
11
|
+
INavigationEventName,
|
|
12
|
+
} from '../../core';
|
|
13
|
+
import {
|
|
14
|
+
requireNavigationContext,
|
|
15
|
+
type IAnyNavigatorHandle,
|
|
16
|
+
} from '../navigation-context.service';
|
|
11
17
|
|
|
12
18
|
export type INavigationHandle = IAnyNavigatorHandle & {
|
|
13
|
-
addListener: (
|
|
19
|
+
addListener: (
|
|
20
|
+
event: INavigationEventName,
|
|
21
|
+
listener: INavigationEventListener,
|
|
22
|
+
) => () => void;
|
|
14
23
|
// Walks exactly ONE hop up NavigationContextService's `parent` chain to the enclosing
|
|
15
24
|
// navigator's handle (plain immediate-parent walking, no named/targeted ancestor lookup).
|
|
16
25
|
getParent: () => IAnyNavigatorHandle | undefined;
|
package/src/angular/linking.ts
CHANGED
|
@@ -22,7 +22,10 @@ export function injectLinkingIntegration(
|
|
|
22
22
|
): void {
|
|
23
23
|
const destroyRef = inject(DestroyRef);
|
|
24
24
|
|
|
25
|
-
function applyRoute(
|
|
25
|
+
function applyRoute(
|
|
26
|
+
url: string,
|
|
27
|
+
dispatch: (name: string, params?: unknown) => void,
|
|
28
|
+
): void {
|
|
26
29
|
const route = resolveRouteFromUrl(config, url);
|
|
27
30
|
if (route === null) {
|
|
28
31
|
dlog(`injectLinkingIntegration: no route resolved for "${url}"`);
|
|
@@ -38,7 +38,8 @@ export class NavigationContextService {
|
|
|
38
38
|
// package's zoneless/signals-first convention. `navigation`/`emitter` are stable for a screen's
|
|
39
39
|
// whole lifetime, so they stay plain fields - no reactivity needed there.
|
|
40
40
|
private readonly routeSignal = signal<IRoute<unknown> | undefined>(undefined);
|
|
41
|
-
readonly route: Signal<IRoute<unknown> | undefined> =
|
|
41
|
+
readonly route: Signal<IRoute<unknown> | undefined> =
|
|
42
|
+
this.routeSignal.asReadonly();
|
|
42
43
|
|
|
43
44
|
navigation!: IAnyNavigatorHandle;
|
|
44
45
|
emitter!: INavigationEmitter;
|
|
@@ -57,7 +58,9 @@ export class NavigationContextService {
|
|
|
57
58
|
// identical everywhere instead of six independently-typed copies. Must be called from an
|
|
58
59
|
// injection context, same requirement `inject()` itself has - every call site is the first line
|
|
59
60
|
// of an injectX function, which callers already only invoke from their own injection context.
|
|
60
|
-
export function requireNavigationContext(
|
|
61
|
+
export function requireNavigationContext(
|
|
62
|
+
injectorName: string,
|
|
63
|
+
): NavigationContextService {
|
|
61
64
|
const context = inject(NavigationContextService, { optional: true });
|
|
62
65
|
if (!context) {
|
|
63
66
|
throw new Error(
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
import { Directive, Input, inject, type OnChanges } from '@angular/core';
|
|
11
11
|
import type { INavigationEmitter, IRoute } from '../core';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
NavigationContextService,
|
|
14
|
+
type IAnyNavigatorHandle,
|
|
15
|
+
} from './navigation-context.service';
|
|
13
16
|
|
|
14
17
|
@Directive({
|
|
15
18
|
selector: '[symbioteNavigationScope]',
|
|
@@ -17,7 +20,8 @@ import { NavigationContextService, type IAnyNavigatorHandle } from './navigation
|
|
|
17
20
|
providers: [NavigationContextService],
|
|
18
21
|
})
|
|
19
22
|
export class NavigationScopeDirective implements OnChanges {
|
|
20
|
-
@Input({ required: true, alias: 'symbioteNavigationScope' })
|
|
23
|
+
@Input({ required: true, alias: 'symbioteNavigationScope' })
|
|
24
|
+
route!: IRoute<unknown>;
|
|
21
25
|
@Input({ required: true }) navigation!: IAnyNavigatorHandle;
|
|
22
26
|
@Input({ required: true }) emitter!: INavigationEmitter;
|
|
23
27
|
|
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
// independent of whether the template is ever instantiated).
|
|
8
8
|
|
|
9
9
|
import { Directive, Input, type Type } from '@angular/core';
|
|
10
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
ISearchBarCommands,
|
|
12
|
+
ISearchBarOptions,
|
|
13
|
+
IScreenOptions,
|
|
14
|
+
IRoute,
|
|
15
|
+
} from '../core';
|
|
11
16
|
import type { INavigatorHandle } from '../core';
|
|
12
17
|
|
|
13
18
|
// The imperative ref (focus/blur/clearText/setText/cancelSearch/toggleCancelButton) carries a
|
|
@@ -21,7 +26,10 @@ export type IAngularSearchBarOptions = ISearchBarOptions & {
|
|
|
21
26
|
ref?: { current: ISearchBarCommands | null };
|
|
22
27
|
};
|
|
23
28
|
|
|
24
|
-
export type IAngularScreenOptions = Omit<
|
|
29
|
+
export type IAngularScreenOptions = Omit<
|
|
30
|
+
IScreenOptions,
|
|
31
|
+
'headerSearchBarOptions'
|
|
32
|
+
> & {
|
|
25
33
|
headerSearchBarOptions?: IAngularSearchBarOptions;
|
|
26
34
|
};
|
|
27
35
|
|
|
@@ -34,7 +42,9 @@ export type IScreenOptionsArgs = {
|
|
|
34
42
|
navigation: INavigatorHandle;
|
|
35
43
|
};
|
|
36
44
|
|
|
37
|
-
export type IScreenOptionsResolver = (
|
|
45
|
+
export type IScreenOptionsResolver = (
|
|
46
|
+
args: IScreenOptionsArgs,
|
|
47
|
+
) => IAngularScreenOptions;
|
|
38
48
|
|
|
39
49
|
@Directive({
|
|
40
50
|
selector: 'ng-template[symbioteScreen]',
|
|
@@ -7,7 +7,14 @@
|
|
|
7
7
|
// needed here: buildSearchBarHandle's own methods are already a LAZY getter over the node,
|
|
8
8
|
// tolerant of the node existing-but-not-yet-committed, same contract every adapter shares).
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
Directive,
|
|
12
|
+
Input,
|
|
13
|
+
inject,
|
|
14
|
+
type OnDestroy,
|
|
15
|
+
type OnInit,
|
|
16
|
+
ElementRef,
|
|
17
|
+
} from '@angular/core';
|
|
11
18
|
import { isSymbioteNode, dlog, debugNodeId } from '@symbiote-native/engine';
|
|
12
19
|
import { buildSearchBarHandle } from '../core';
|
|
13
20
|
import type { ISearchBarCommands } from '../core';
|
|
@@ -17,7 +24,8 @@ import type { ISearchBarCommands } from '../core';
|
|
|
17
24
|
standalone: true,
|
|
18
25
|
})
|
|
19
26
|
export class SearchBarRefDirective implements OnInit, OnDestroy {
|
|
20
|
-
@Input('symbioteSearchBarRef') ref:
|
|
27
|
+
@Input('symbioteSearchBarRef') ref:
|
|
28
|
+
{ current: ISearchBarCommands | null } | undefined;
|
|
21
29
|
|
|
22
30
|
private readonly elementRef = inject<ElementRef<unknown>>(ElementRef);
|
|
23
31
|
|