@symbiote-native/navigation 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/build/angular/drawer/index.d.ts +76 -0
- package/build/angular/drawer/index.js +508 -0
- package/build/angular/drawer-screen.directive.d.ts +14 -0
- package/build/angular/drawer-screen.directive.js +87 -0
- package/build/angular/index.d.ts +23 -0
- package/build/angular/index.js +22 -0
- package/build/angular/injectors/index.d.ts +13 -0
- package/build/angular/injectors/index.js +8 -0
- package/build/angular/injectors/inject-drawer-navigation.d.ts +4 -0
- package/build/angular/injectors/inject-drawer-navigation.js +12 -0
- package/build/angular/injectors/inject-focus-effect.d.ts +2 -0
- package/build/angular/injectors/inject-focus-effect.js +29 -0
- package/build/angular/injectors/inject-is-focused.d.ts +2 -0
- package/build/angular/injectors/inject-is-focused.js +20 -0
- package/build/angular/injectors/inject-navigation-state.d.ts +3 -0
- package/build/angular/injectors/inject-navigation-state.js +35 -0
- package/build/angular/injectors/inject-navigation.d.ts +7 -0
- package/build/angular/injectors/inject-navigation.js +16 -0
- package/build/angular/injectors/inject-route.d.ts +3 -0
- package/build/angular/injectors/inject-route.js +20 -0
- package/build/angular/injectors/inject-stack-navigation.d.ts +4 -0
- package/build/angular/injectors/inject-stack-navigation.js +15 -0
- package/build/angular/injectors/inject-tab-navigation.d.ts +4 -0
- package/build/angular/injectors/inject-tab-navigation.js +11 -0
- package/build/angular/linking.d.ts +3 -0
- package/build/angular/linking.js +43 -0
- package/build/angular/navigation-context.service.d.ts +13 -0
- package/build/angular/navigation-context.service.js +105 -0
- package/build/angular/navigation-scope.directive.d.ts +10 -0
- package/build/angular/navigation-scope.directive.js +90 -0
- package/build/angular/screen.directive.d.ts +22 -0
- package/build/angular/screen.directive.js +90 -0
- package/build/angular/search-bar-ref.directive.d.ts +10 -0
- package/build/angular/search-bar-ref.directive.js +88 -0
- package/build/angular/stack/index.d.ts +55 -0
- package/build/angular/stack/index.js +386 -0
- package/build/angular/tab-screen.directive.d.ts +14 -0
- package/build/angular/tab-screen.directive.js +87 -0
- package/build/angular/tabs/index.d.ts +42 -0
- package/build/angular/tabs/index.js +263 -0
- package/build/core/constants.d.ts +27 -0
- package/build/core/constants.js +61 -0
- package/build/core/drawer-options/index.d.ts +64 -0
- package/build/core/drawer-options/index.js +200 -0
- package/build/core/drawer-router-state/index.d.ts +21 -0
- package/build/core/drawer-router-state/index.js +40 -0
- package/build/core/guards.d.ts +2 -0
- package/build/core/guards.js +22 -0
- package/build/core/header-bar-buttons.d.ts +9 -0
- package/build/core/header-bar-buttons.js +163 -0
- package/build/core/index.d.ts +29 -0
- package/build/core/index.js +32 -0
- package/build/core/linking-config/index.d.ts +13 -0
- package/build/core/linking-config/index.js +171 -0
- package/build/core/navigation-events/index.d.ts +16 -0
- package/build/core/navigation-events/index.js +57 -0
- package/build/core/navigator-handles/index.d.ts +30 -0
- package/build/core/navigator-handles/index.js +15 -0
- package/build/core/navigator-props.d.ts +216 -0
- package/build/core/navigator-props.js +7 -0
- package/build/core/navigator-state/index.d.ts +36 -0
- package/build/core/navigator-state/index.js +81 -0
- package/build/core/render-drawer.d.ts +13 -0
- package/build/core/render-drawer.js +88 -0
- package/build/core/render-stack.d.ts +35 -0
- package/build/core/render-stack.js +294 -0
- package/build/core/render-tabs.d.ts +20 -0
- package/build/core/render-tabs.js +97 -0
- package/build/core/screen-options.d.ts +4 -0
- package/build/core/screen-options.js +133 -0
- package/build/core/search-bar-commands.d.ts +10 -0
- package/build/core/search-bar-commands.js +42 -0
- package/build/core/state-persistence/index.d.ts +3 -0
- package/build/core/state-persistence/index.js +23 -0
- package/build/core/tab-options.d.ts +13 -0
- package/build/core/tab-options.js +10 -0
- package/build/core/tab-router-state/index.d.ts +19 -0
- package/build/core/tab-router-state/index.js +51 -0
- package/build/react/collect-registry.d.ts +4 -0
- package/build/react/collect-registry.js +15 -0
- package/build/react/drawer/index.d.ts +29 -0
- package/build/react/drawer/index.js +277 -0
- package/build/react/drawer-screen.d.ts +14 -0
- package/build/react/drawer-screen.js +8 -0
- package/build/react/hooks/index.d.ts +12 -0
- package/build/react/hooks/index.js +8 -0
- package/build/react/hooks/use-drawer-navigation.d.ts +4 -0
- package/build/react/hooks/use-drawer-navigation.js +12 -0
- package/build/react/hooks/use-focus-effect.d.ts +2 -0
- package/build/react/hooks/use-focus-effect.js +29 -0
- package/build/react/hooks/use-is-focused.d.ts +1 -0
- package/build/react/hooks/use-is-focused.js +22 -0
- package/build/react/hooks/use-navigation-state/index.d.ts +2 -0
- package/build/react/hooks/use-navigation-state/index.js +39 -0
- package/build/react/hooks/use-navigation.d.ts +7 -0
- package/build/react/hooks/use-navigation.js +16 -0
- package/build/react/hooks/use-route.d.ts +2 -0
- package/build/react/hooks/use-route.js +8 -0
- package/build/react/hooks/use-stack-navigation.d.ts +4 -0
- package/build/react/hooks/use-stack-navigation.js +14 -0
- package/build/react/hooks/use-tab-navigation.d.ts +4 -0
- package/build/react/hooks/use-tab-navigation.js +12 -0
- package/build/react/index.d.ts +24 -0
- package/build/react/index.js +21 -0
- package/build/react/linking.d.ts +3 -0
- package/build/react/linking.js +47 -0
- package/build/react/navigation-context.d.ts +10 -0
- package/build/react/navigation-context.js +22 -0
- package/build/react/screen.d.ts +22 -0
- package/build/react/screen.js +7 -0
- package/build/react/stack/index.d.ts +13 -0
- package/build/react/stack/index.js +202 -0
- package/build/react/tab-screen.d.ts +15 -0
- package/build/react/tab-screen.js +8 -0
- package/build/react/tabs/index.d.ts +12 -0
- package/build/react/tabs/index.js +116 -0
- package/build/register.d.ts +7 -0
- package/build/register.js +58 -0
- package/build/vue/composables/index.d.ts +12 -0
- package/build/vue/composables/index.js +8 -0
- package/build/vue/composables/use-drawer-navigation.d.ts +5 -0
- package/build/vue/composables/use-drawer-navigation.js +15 -0
- package/build/vue/composables/use-focus-effect.d.ts +1 -0
- package/build/vue/composables/use-focus-effect.js +31 -0
- package/build/vue/composables/use-is-focused.d.ts +2 -0
- package/build/vue/composables/use-is-focused.js +28 -0
- package/build/vue/composables/use-navigation-state.d.ts +3 -0
- package/build/vue/composables/use-navigation-state.js +29 -0
- package/build/vue/composables/use-navigation.d.ts +8 -0
- package/build/vue/composables/use-navigation.js +13 -0
- package/build/vue/composables/use-route.d.ts +3 -0
- package/build/vue/composables/use-route.js +9 -0
- package/build/vue/composables/use-stack-navigation.d.ts +5 -0
- package/build/vue/composables/use-stack-navigation.js +18 -0
- package/build/vue/composables/use-tab-navigation.d.ts +5 -0
- package/build/vue/composables/use-tab-navigation.js +15 -0
- package/build/vue/drawer/index.d.ts +19 -0
- package/build/vue/drawer/index.js +390 -0
- package/build/vue/drawer-screen.d.ts +14 -0
- package/build/vue/drawer-screen.js +12 -0
- package/build/vue/index.d.ts +21 -0
- package/build/vue/index.js +19 -0
- package/build/vue/linking.d.ts +3 -0
- package/build/vue/linking.js +57 -0
- package/build/vue/navigation-context.d.ts +16 -0
- package/build/vue/navigation-context.js +65 -0
- package/build/vue/screen.d.ts +21 -0
- package/build/vue/screen.js +12 -0
- package/build/vue/stack/index.d.ts +9 -0
- package/build/vue/stack/index.js +279 -0
- package/build/vue/tab-screen.d.ts +14 -0
- package/build/vue/tab-screen.js +11 -0
- package/build/vue/tabs/index.d.ts +10 -0
- package/build/vue/tabs/index.js +209 -0
- package/build-ngc/angular/drawer/index.d.ts +79 -0
- package/build-ngc/angular/drawer/index.js +479 -0
- package/build-ngc/angular/drawer/index.js.map +1 -0
- package/build-ngc/angular/drawer-screen.directive.d.ts +17 -0
- package/build-ngc/angular/drawer-screen.directive.js +32 -0
- package/build-ngc/angular/drawer-screen.directive.js.map +1 -0
- package/build-ngc/angular/drawer.d.ts +79 -0
- package/build-ngc/angular/drawer.js +475 -0
- package/build-ngc/angular/drawer.js.map +1 -0
- package/build-ngc/angular/index.d.ts +23 -0
- package/build-ngc/angular/index.js +23 -0
- package/build-ngc/angular/index.js.map +1 -0
- package/build-ngc/angular/injectors/index.d.ts +13 -0
- package/build-ngc/angular/injectors/index.js +9 -0
- package/build-ngc/angular/injectors/index.js.map +1 -0
- package/build-ngc/angular/injectors/inject-drawer-navigation.d.ts +4 -0
- package/build-ngc/angular/injectors/inject-drawer-navigation.js +13 -0
- package/build-ngc/angular/injectors/inject-drawer-navigation.js.map +1 -0
- package/build-ngc/angular/injectors/inject-focus-effect.d.ts +2 -0
- package/build-ngc/angular/injectors/inject-focus-effect.js +30 -0
- package/build-ngc/angular/injectors/inject-focus-effect.js.map +1 -0
- package/build-ngc/angular/injectors/inject-is-focused.d.ts +2 -0
- package/build-ngc/angular/injectors/inject-is-focused.js +22 -0
- package/build-ngc/angular/injectors/inject-is-focused.js.map +1 -0
- package/build-ngc/angular/injectors/inject-navigation-state.d.ts +3 -0
- package/build-ngc/angular/injectors/inject-navigation-state.js +37 -0
- package/build-ngc/angular/injectors/inject-navigation-state.js.map +1 -0
- package/build-ngc/angular/injectors/inject-navigation.d.ts +7 -0
- package/build-ngc/angular/injectors/inject-navigation.js +17 -0
- package/build-ngc/angular/injectors/inject-navigation.js.map +1 -0
- package/build-ngc/angular/injectors/inject-route.d.ts +3 -0
- package/build-ngc/angular/injectors/inject-route.js +21 -0
- package/build-ngc/angular/injectors/inject-route.js.map +1 -0
- package/build-ngc/angular/injectors/inject-stack-navigation.d.ts +4 -0
- package/build-ngc/angular/injectors/inject-stack-navigation.js +16 -0
- package/build-ngc/angular/injectors/inject-stack-navigation.js.map +1 -0
- package/build-ngc/angular/injectors/inject-tab-navigation.d.ts +4 -0
- package/build-ngc/angular/injectors/inject-tab-navigation.js +12 -0
- package/build-ngc/angular/injectors/inject-tab-navigation.js.map +1 -0
- package/build-ngc/angular/linking.d.ts +3 -0
- package/build-ngc/angular/linking.js +44 -0
- package/build-ngc/angular/linking.js.map +1 -0
- package/build-ngc/angular/navigation-context.service.d.ts +16 -0
- package/build-ngc/angular/navigation-context.service.js +63 -0
- package/build-ngc/angular/navigation-context.service.js.map +1 -0
- package/build-ngc/angular/navigation-scope.directive.d.ts +13 -0
- package/build-ngc/angular/navigation-scope.directive.js +42 -0
- package/build-ngc/angular/navigation-scope.directive.js.map +1 -0
- package/build-ngc/angular/screen.directive.d.ts +25 -0
- package/build-ngc/angular/screen.directive.js +35 -0
- package/build-ngc/angular/screen.directive.js.map +1 -0
- package/build-ngc/angular/search-bar-ref.directive.d.ts +13 -0
- package/build-ngc/angular/search-bar-ref.directive.js +44 -0
- package/build-ngc/angular/search-bar-ref.directive.js.map +1 -0
- package/build-ngc/angular/stack/index.d.ts +58 -0
- package/build-ngc/angular/stack/index.js +406 -0
- package/build-ngc/angular/stack/index.js.map +1 -0
- package/build-ngc/angular/stack.d.ts +58 -0
- package/build-ngc/angular/stack.js +402 -0
- package/build-ngc/angular/stack.js.map +1 -0
- package/build-ngc/angular/tab-screen.directive.d.ts +17 -0
- package/build-ngc/angular/tab-screen.directive.js +32 -0
- package/build-ngc/angular/tab-screen.directive.js.map +1 -0
- package/build-ngc/angular/tabs/index.d.ts +45 -0
- package/build-ngc/angular/tabs/index.js +231 -0
- package/build-ngc/angular/tabs/index.js.map +1 -0
- package/build-ngc/angular/tabs.d.ts +45 -0
- package/build-ngc/angular/tabs.js +231 -0
- package/build-ngc/angular/tabs.js.map +1 -0
- package/build-ngc/core/constants.d.ts +27 -0
- package/build-ngc/core/constants.js +62 -0
- package/build-ngc/core/constants.js.map +1 -0
- package/build-ngc/core/drawer-options/index.d.ts +64 -0
- package/build-ngc/core/drawer-options/index.js +201 -0
- package/build-ngc/core/drawer-options/index.js.map +1 -0
- package/build-ngc/core/drawer-options.d.ts +64 -0
- package/build-ngc/core/drawer-options.js +201 -0
- package/build-ngc/core/drawer-options.js.map +1 -0
- package/build-ngc/core/drawer-router-state/index.d.ts +21 -0
- package/build-ngc/core/drawer-router-state/index.js +41 -0
- package/build-ngc/core/drawer-router-state/index.js.map +1 -0
- package/build-ngc/core/drawer-router-state.d.ts +21 -0
- package/build-ngc/core/drawer-router-state.js +41 -0
- package/build-ngc/core/drawer-router-state.js.map +1 -0
- package/build-ngc/core/guards.d.ts +2 -0
- package/build-ngc/core/guards.js +23 -0
- package/build-ngc/core/guards.js.map +1 -0
- package/build-ngc/core/header-bar-buttons.d.ts +9 -0
- package/build-ngc/core/header-bar-buttons.js +164 -0
- package/build-ngc/core/header-bar-buttons.js.map +1 -0
- package/build-ngc/core/href.d.ts +16 -0
- package/build-ngc/core/href.js +55 -0
- package/build-ngc/core/href.js.map +1 -0
- package/build-ngc/core/index.d.ts +29 -0
- package/build-ngc/core/index.js +33 -0
- package/build-ngc/core/index.js.map +1 -0
- package/build-ngc/core/linking-config/index.d.ts +13 -0
- package/build-ngc/core/linking-config/index.js +172 -0
- package/build-ngc/core/linking-config/index.js.map +1 -0
- package/build-ngc/core/linking-config.d.ts +13 -0
- package/build-ngc/core/linking-config.js +172 -0
- package/build-ngc/core/linking-config.js.map +1 -0
- package/build-ngc/core/navigation-events/index.d.ts +16 -0
- package/build-ngc/core/navigation-events/index.js +58 -0
- package/build-ngc/core/navigation-events/index.js.map +1 -0
- package/build-ngc/core/navigation-events.d.ts +16 -0
- package/build-ngc/core/navigation-events.js +58 -0
- package/build-ngc/core/navigation-events.js.map +1 -0
- package/build-ngc/core/navigator-handles/index.d.ts +30 -0
- package/build-ngc/core/navigator-handles/index.js +16 -0
- package/build-ngc/core/navigator-handles/index.js.map +1 -0
- package/build-ngc/core/navigator-handles.d.ts +30 -0
- package/build-ngc/core/navigator-handles.js +16 -0
- package/build-ngc/core/navigator-handles.js.map +1 -0
- package/build-ngc/core/navigator-props.d.ts +216 -0
- package/build-ngc/core/navigator-props.js +8 -0
- package/build-ngc/core/navigator-props.js.map +1 -0
- package/build-ngc/core/navigator-state/index.d.ts +36 -0
- package/build-ngc/core/navigator-state/index.js +82 -0
- package/build-ngc/core/navigator-state/index.js.map +1 -0
- package/build-ngc/core/navigator-state.d.ts +36 -0
- package/build-ngc/core/navigator-state.js +82 -0
- package/build-ngc/core/navigator-state.js.map +1 -0
- package/build-ngc/core/render-drawer.d.ts +13 -0
- package/build-ngc/core/render-drawer.js +89 -0
- package/build-ngc/core/render-drawer.js.map +1 -0
- package/build-ngc/core/render-stack.d.ts +35 -0
- package/build-ngc/core/render-stack.js +295 -0
- package/build-ngc/core/render-stack.js.map +1 -0
- package/build-ngc/core/render-tabs.d.ts +20 -0
- package/build-ngc/core/render-tabs.js +98 -0
- package/build-ngc/core/render-tabs.js.map +1 -0
- package/build-ngc/core/screen-options.d.ts +4 -0
- package/build-ngc/core/screen-options.js +134 -0
- package/build-ngc/core/screen-options.js.map +1 -0
- package/build-ngc/core/search-bar-commands.d.ts +10 -0
- package/build-ngc/core/search-bar-commands.js +43 -0
- package/build-ngc/core/search-bar-commands.js.map +1 -0
- package/build-ngc/core/search-params.d.ts +9 -0
- package/build-ngc/core/search-params.js +60 -0
- package/build-ngc/core/search-params.js.map +1 -0
- package/build-ngc/core/state-persistence/index.d.ts +3 -0
- package/build-ngc/core/state-persistence/index.js +24 -0
- package/build-ngc/core/state-persistence/index.js.map +1 -0
- package/build-ngc/core/state-persistence.d.ts +3 -0
- package/build-ngc/core/state-persistence.js +24 -0
- package/build-ngc/core/state-persistence.js.map +1 -0
- package/build-ngc/core/tab-options.d.ts +13 -0
- package/build-ngc/core/tab-options.js +11 -0
- package/build-ngc/core/tab-options.js.map +1 -0
- package/build-ngc/core/tab-router-state/index.d.ts +19 -0
- package/build-ngc/core/tab-router-state/index.js +52 -0
- package/build-ngc/core/tab-router-state/index.js.map +1 -0
- package/build-ngc/core/tab-router-state.d.ts +19 -0
- package/build-ngc/core/tab-router-state.js +52 -0
- package/build-ngc/core/tab-router-state.js.map +1 -0
- package/build-ngc/register.d.ts +7 -0
- package/build-ngc/register.js +59 -0
- package/build-ngc/register.js.map +1 -0
- package/codegen-specs/FullWindowOverlayNativeComponent.ts +13 -0
- package/codegen-specs/ModalScreenNativeComponent.ts +129 -0
- package/codegen-specs/NativeScreensModule.ts +8 -0
- package/codegen-specs/NativeScreensModule.web.ts +1 -0
- package/codegen-specs/ScreenContainerNativeComponent.ts +8 -0
- package/codegen-specs/ScreenContentWrapperNativeComponent.ts +9 -0
- package/codegen-specs/ScreenFooterNativeComponent.ts +6 -0
- package/codegen-specs/ScreenNativeComponent.ts +133 -0
- package/codegen-specs/ScreenNavigationContainerNativeComponent.ts +11 -0
- package/codegen-specs/ScreenStackHeaderConfigNativeComponent.ts +99 -0
- package/codegen-specs/ScreenStackHeaderSubviewNativeComponent.ts +25 -0
- package/codegen-specs/ScreenStackNativeComponent.ts +17 -0
- package/codegen-specs/SearchBarNativeComponent.ts +101 -0
- package/codegen-specs/codegenUtils.ts +6 -0
- package/codegen-specs/gamma/ScrollViewMarkerNativeComponent.ts +15 -0
- package/codegen-specs/gamma/modals/form-sheet/FormSheetContentWrapperNativeComponent.ts +10 -0
- package/codegen-specs/gamma/modals/form-sheet/FormSheetHostNativeComponent.ts +47 -0
- package/codegen-specs/gamma/split/SplitHostNativeComponent.ts +124 -0
- package/codegen-specs/gamma/split/SplitScreenNativeComponent.ts +24 -0
- package/codegen-specs/gamma/stack/StackHeaderConfigAndroidNativeComponent.ts +144 -0
- package/codegen-specs/gamma/stack/StackHeaderConfigIOSNativeComponent.ts +34 -0
- package/codegen-specs/gamma/stack/StackHeaderItemIOSNativeComponent.ts +47 -0
- package/codegen-specs/gamma/stack/StackHeaderItemSpacerIOSNativeComponent.ts +20 -0
- package/codegen-specs/gamma/stack/StackHeaderSubviewAndroidNativeComponent.ts +27 -0
- package/codegen-specs/gamma/stack/StackHostNativeComponent.ts +8 -0
- package/codegen-specs/gamma/stack/StackScreenNativeComponent.ts +42 -0
- package/codegen-specs/safe-area/SafeAreaViewNativeComponent.ts +24 -0
- package/codegen-specs/tabs/TabsBottomAccessoryContentNativeComponent.ts +15 -0
- package/codegen-specs/tabs/TabsBottomAccessoryNativeComponent.ts +19 -0
- package/codegen-specs/tabs/TabsHostAndroidNativeComponent.ts +69 -0
- package/codegen-specs/tabs/TabsHostIOSNativeComponent.ts +92 -0
- package/codegen-specs/tabs/TabsScreenAndroidNativeComponent.ts +112 -0
- package/codegen-specs/tabs/TabsScreenIOSNativeComponent.ts +171 -0
- package/package.json +201 -0
- package/react-native.config.cjs +58 -0
- package/src/angular/drawer/drawer.test.ts +299 -0
- package/src/angular/drawer/index.ts +546 -0
- package/src/angular/drawer-screen.directive.ts +28 -0
- package/src/angular/index.ts +63 -0
- package/src/angular/injectors/index.ts +13 -0
- package/src/angular/injectors/inject-drawer-navigation.ts +21 -0
- package/src/angular/injectors/inject-focus-effect.ts +37 -0
- package/src/angular/injectors/inject-is-focused.ts +28 -0
- package/src/angular/injectors/inject-navigation-state.ts +46 -0
- package/src/angular/injectors/inject-navigation.ts +26 -0
- package/src/angular/injectors/inject-route.ts +25 -0
- package/src/angular/injectors/inject-stack-navigation.ts +24 -0
- package/src/angular/injectors/inject-tab-navigation.ts +20 -0
- package/src/angular/injectors/injectors.test.ts +247 -0
- package/src/angular/injectors/use-typed-navigation.test.ts +229 -0
- package/src/angular/linking.ts +55 -0
- package/src/angular/navigation-context.service.ts +68 -0
- package/src/angular/navigation-scope.directive.ts +31 -0
- package/src/angular/nested-navigation.test.ts +189 -0
- package/src/angular/screen.directive.ts +48 -0
- package/src/angular/search-bar-ref.directive.ts +38 -0
- package/src/angular/stack/index.ts +401 -0
- package/src/angular/stack/stack.test.ts +419 -0
- package/src/angular/tab-screen.directive.ts +26 -0
- package/src/angular/tabs/index.ts +254 -0
- package/src/angular/tabs/tabs.test.ts +249 -0
- package/src/core/constants.ts +68 -0
- package/src/core/drawer-options/drawer-options.test.ts +415 -0
- package/src/core/drawer-options/index.ts +331 -0
- package/src/core/drawer-router-state/drawer-router-state.test.ts +116 -0
- package/src/core/drawer-router-state/index.ts +71 -0
- package/src/core/guards.ts +23 -0
- package/src/core/header-bar-buttons.ts +212 -0
- package/src/core/index.ts +170 -0
- package/src/core/linking-config/index.ts +209 -0
- package/src/core/linking-config/linking-config.test.ts +109 -0
- package/src/core/navigation-events/index.ts +94 -0
- package/src/core/navigation-events/navigation-events.test.ts +56 -0
- package/src/core/navigator-handles/index.ts +63 -0
- package/src/core/navigator-handles/navigator-handles.test.ts +46 -0
- package/src/core/navigator-props.ts +323 -0
- package/src/core/navigator-state/index.ts +112 -0
- package/src/core/navigator-state/navigator-state.test.ts +80 -0
- package/src/core/render-drawer.ts +123 -0
- package/src/core/render-stack.ts +414 -0
- package/src/core/render-tabs.ts +138 -0
- package/src/core/screen-options.ts +181 -0
- package/src/core/search-bar-commands.ts +57 -0
- package/src/core/state-persistence/index.ts +30 -0
- package/src/core/state-persistence/state-persistence.test.ts +42 -0
- package/src/core/tab-options.ts +25 -0
- package/src/core/tab-router-state/index.ts +75 -0
- package/src/core/tab-router-state/tab-router-state.test.ts +34 -0
- package/src/globals.d.ts +4 -0
- package/src/react/collect-registry.ts +19 -0
- package/src/react/drawer/drawer.test.tsx +472 -0
- package/src/react/drawer/index.ts +451 -0
- package/src/react/drawer-screen.ts +29 -0
- package/src/react/hooks/hooks.test.tsx +199 -0
- package/src/react/hooks/index.ts +12 -0
- package/src/react/hooks/use-drawer-navigation.ts +21 -0
- package/src/react/hooks/use-focus-effect.ts +36 -0
- package/src/react/hooks/use-is-focused.ts +26 -0
- package/src/react/hooks/use-navigation-state/index.ts +47 -0
- package/src/react/hooks/use-navigation-state/use-navigation-state.test.ts +85 -0
- package/src/react/hooks/use-navigation.ts +36 -0
- package/src/react/hooks/use-route.ts +11 -0
- package/src/react/hooks/use-stack-navigation.ts +23 -0
- package/src/react/hooks/use-tab-navigation.ts +21 -0
- package/src/react/hooks/use-typed-navigation.test.tsx +187 -0
- package/src/react/index.ts +52 -0
- package/src/react/linking.ts +59 -0
- package/src/react/navigation-context.ts +40 -0
- package/src/react/nested-navigation.test.tsx +145 -0
- package/src/react/screen.ts +44 -0
- package/src/react/stack/index.ts +323 -0
- package/src/react/stack/stack.test.tsx +514 -0
- package/src/react/tab-screen.ts +30 -0
- package/src/react/tabs/index.ts +204 -0
- package/src/react/tabs/tabs.test.tsx +256 -0
- package/src/register.ts +59 -0
- package/src/vue/composables/composables.test.ts +221 -0
- package/src/vue/composables/index.ts +12 -0
- package/src/vue/composables/use-drawer-navigation.ts +25 -0
- package/src/vue/composables/use-focus-effect.ts +37 -0
- package/src/vue/composables/use-is-focused.ts +34 -0
- package/src/vue/composables/use-navigation-state.ts +38 -0
- package/src/vue/composables/use-navigation.ts +30 -0
- package/src/vue/composables/use-route.ts +13 -0
- package/src/vue/composables/use-stack-navigation.ts +28 -0
- package/src/vue/composables/use-tab-navigation.ts +25 -0
- package/src/vue/composables/use-typed-navigation.test.ts +205 -0
- package/src/vue/drawer/drawer.test.ts +451 -0
- package/src/vue/drawer/index.ts +550 -0
- package/src/vue/drawer-screen.ts +32 -0
- package/src/vue/index.ts +70 -0
- package/src/vue/linking.ts +69 -0
- package/src/vue/navigation-context.ts +87 -0
- package/src/vue/nested-navigation.test.ts +155 -0
- package/src/vue/screen.ts +52 -0
- package/src/vue/stack/index.ts +376 -0
- package/src/vue/stack/stack.test.ts +501 -0
- package/src/vue/tab-screen.ts +29 -0
- package/src/vue/tabs/index.ts +302 -0
- package/src/vue/tabs/tabs.test.ts +278 -0
- package/symbiote-navigation.podspec +84 -0
|
@@ -0,0 +1,401 @@
|
|
|
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
|
+
|
|
47
|
+
import {
|
|
48
|
+
ChangeDetectionStrategy,
|
|
49
|
+
Component,
|
|
50
|
+
ContentChildren,
|
|
51
|
+
Input,
|
|
52
|
+
NO_ERRORS_SCHEMA,
|
|
53
|
+
QueryList,
|
|
54
|
+
signal,
|
|
55
|
+
type AfterContentInit,
|
|
56
|
+
type OnDestroy,
|
|
57
|
+
type Type,
|
|
58
|
+
} from '@angular/core';
|
|
59
|
+
import { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';
|
|
60
|
+
import { SymbioteHostPropsDirective } from '@symbiote-native/angular';
|
|
61
|
+
import { Platform, dlog } from '@symbiote-native/engine';
|
|
62
|
+
import {
|
|
63
|
+
NAVIGATION_EVENT_BLUR,
|
|
64
|
+
NAVIGATION_EVENT_FOCUS,
|
|
65
|
+
NAVIGATION_EVENT_STATE,
|
|
66
|
+
RNS_MODAL_SCREEN_VIEW_NAME,
|
|
67
|
+
SCREEN_ON_APPEAR,
|
|
68
|
+
SCREEN_ON_DISAPPEAR,
|
|
69
|
+
SCREEN_ON_DISMISSED,
|
|
70
|
+
SCREEN_ON_HEADER_BACK_BUTTON_CLICKED,
|
|
71
|
+
STACK_ON_FINISH_TRANSITIONING,
|
|
72
|
+
buildSearchBarPassthrough,
|
|
73
|
+
createInitialNavigatorState,
|
|
74
|
+
createNavigationEmitter,
|
|
75
|
+
navigatorReducer,
|
|
76
|
+
resolveHeaderInModalStackStyle,
|
|
77
|
+
resolveScreenRenderPlan,
|
|
78
|
+
resolveStackProps,
|
|
79
|
+
} from '../../core';
|
|
80
|
+
import type {
|
|
81
|
+
INavigationEmitter,
|
|
82
|
+
INavigatorHandle,
|
|
83
|
+
INavigatorPlatform,
|
|
84
|
+
INavigatorState,
|
|
85
|
+
INavigatorAction,
|
|
86
|
+
IRoute,
|
|
87
|
+
ISearchBarCommands,
|
|
88
|
+
IScreenRenderPlan,
|
|
89
|
+
} from '../../core';
|
|
90
|
+
import { NavigationScopeDirective } from '../navigation-scope.directive';
|
|
91
|
+
import { SearchBarRefDirective } from '../search-bar-ref.directive';
|
|
92
|
+
import { ScreenDirective } from '../screen.directive';
|
|
93
|
+
import type { IAngularScreenOptions, IScreenOptionsArgs } from '../screen.directive';
|
|
94
|
+
|
|
95
|
+
export type { INavigatorHandle } from '../../core';
|
|
96
|
+
|
|
97
|
+
// backTitleVisible defaults to `true` on both platforms per the codegen spec's own default - no
|
|
98
|
+
// ios/android divergence in v1 scope (mirrors react/stack.ts's own constant exactly).
|
|
99
|
+
const NAVIGATOR_PLATFORM: INavigatorPlatform = { defaultHeaderBackTitleVisible: true };
|
|
100
|
+
|
|
101
|
+
let stackInstanceCounter = 0;
|
|
102
|
+
|
|
103
|
+
@Component({
|
|
104
|
+
selector: 'Stack',
|
|
105
|
+
standalone: true,
|
|
106
|
+
schemas: [NO_ERRORS_SCHEMA],
|
|
107
|
+
imports: [
|
|
108
|
+
NgTemplateOutlet,
|
|
109
|
+
NgComponentOutlet,
|
|
110
|
+
NavigationScopeDirective,
|
|
111
|
+
SearchBarRefDirective,
|
|
112
|
+
SymbioteHostPropsDirective,
|
|
113
|
+
],
|
|
114
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
115
|
+
template: `
|
|
116
|
+
@if (state(); as currentState) {
|
|
117
|
+
<RNSScreenStack [symbioteHostProps]="stackHostProps()">
|
|
118
|
+
@for (route of currentState.routes; track route.key; let idx = $index) {
|
|
119
|
+
<ng-container
|
|
120
|
+
[ngTemplateOutlet]="screenTpl"
|
|
121
|
+
[ngTemplateOutletContext]="{ $implicit: route, index: idx }"
|
|
122
|
+
/>
|
|
123
|
+
}
|
|
124
|
+
</RNSScreenStack>
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
<ng-template #screenTpl let-route let-index="index">
|
|
128
|
+
@if (outerScreenIsModal(route, index)) {
|
|
129
|
+
<RNSModalScreen [symbioteHostProps]="screenHostProps(route, index)">
|
|
130
|
+
<ng-container
|
|
131
|
+
[ngTemplateOutlet]="innerTpl"
|
|
132
|
+
[ngTemplateOutletContext]="{ $implicit: route, index: index }"
|
|
133
|
+
/>
|
|
134
|
+
</RNSModalScreen>
|
|
135
|
+
} @else {
|
|
136
|
+
<RNSScreen [symbioteHostProps]="screenHostProps(route, index)">
|
|
137
|
+
<ng-container
|
|
138
|
+
[ngTemplateOutlet]="innerTpl"
|
|
139
|
+
[ngTemplateOutletContext]="{ $implicit: route, index: index }"
|
|
140
|
+
/>
|
|
141
|
+
</RNSScreen>
|
|
142
|
+
}
|
|
143
|
+
</ng-template>
|
|
144
|
+
|
|
145
|
+
<ng-template #innerTpl let-route let-index="index">
|
|
146
|
+
@if (isInModal(route, index)) {
|
|
147
|
+
<RNSScreenStack [symbioteHostProps]="innerStackProps()">
|
|
148
|
+
<RNSScreen [symbioteHostProps]="innerScreenProps(route, index)">
|
|
149
|
+
<ng-container
|
|
150
|
+
[ngTemplateOutlet]="headerAndContentTpl"
|
|
151
|
+
[ngTemplateOutletContext]="{ $implicit: route, index: index }"
|
|
152
|
+
/>
|
|
153
|
+
</RNSScreen>
|
|
154
|
+
</RNSScreenStack>
|
|
155
|
+
} @else {
|
|
156
|
+
<ng-container
|
|
157
|
+
[ngTemplateOutlet]="headerAndContentTpl"
|
|
158
|
+
[ngTemplateOutletContext]="{ $implicit: route, index: index }"
|
|
159
|
+
/>
|
|
160
|
+
}
|
|
161
|
+
</ng-template>
|
|
162
|
+
|
|
163
|
+
<ng-template #headerAndContentTpl let-route let-index="index">
|
|
164
|
+
<RNSScreenStackHeaderConfig [symbioteHostProps]="headerConfigProps(route, index)">
|
|
165
|
+
@if (hasSearchBar(route)) {
|
|
166
|
+
<RNSScreenStackHeaderSubview [symbioteHostProps]="headerSubviewProps">
|
|
167
|
+
<RNSSearchBar
|
|
168
|
+
[symbioteSearchBarRef]="searchBarRef(route)"
|
|
169
|
+
[symbioteHostProps]="searchBarProps(route, index)"
|
|
170
|
+
/>
|
|
171
|
+
</RNSScreenStackHeaderSubview>
|
|
172
|
+
}
|
|
173
|
+
</RNSScreenStackHeaderConfig>
|
|
174
|
+
<RNSScreenContentWrapper [symbioteHostProps]="contentWrapperProps(route, index)">
|
|
175
|
+
<ng-container
|
|
176
|
+
[symbioteNavigationScope]="route"
|
|
177
|
+
[navigation]="this"
|
|
178
|
+
[emitter]="emitterFor(route.key)"
|
|
179
|
+
>
|
|
180
|
+
<ng-container *ngComponentOutlet="componentFor(route)" />
|
|
181
|
+
</ng-container>
|
|
182
|
+
</RNSScreenContentWrapper>
|
|
183
|
+
</ng-template>
|
|
184
|
+
`,
|
|
185
|
+
})
|
|
186
|
+
export class Stack implements AfterContentInit, OnDestroy, INavigatorHandle {
|
|
187
|
+
@ContentChildren(ScreenDirective) private readonly screenChildren!: QueryList<ScreenDirective>;
|
|
188
|
+
|
|
189
|
+
@Input() initialRouteName?: string;
|
|
190
|
+
@Input() screenOptions?: IAngularScreenOptions;
|
|
191
|
+
|
|
192
|
+
readonly headerSubviewProps: Record<string, unknown> = { type: 'searchBar' };
|
|
193
|
+
|
|
194
|
+
private readonly routeIdPrefix = `stack-${(stackInstanceCounter += 1)}`;
|
|
195
|
+
// Keyed by name -> the LIVE ScreenDirective instance, not a snapshot copy of its fields:
|
|
196
|
+
// @ContentChildren's `changes` Observable only fires on a STRUCTURAL change to the query
|
|
197
|
+
// results (screens added/removed/reordered), never when an already-matched instance's own
|
|
198
|
+
// `[options]`/`[component]` binding is merely reassigned a new value - a snapshot copy taken at
|
|
199
|
+
// rebuild time would go stale the instant an app changes e.g. `[options]` on an existing
|
|
200
|
+
// `<ng-template symbioteScreen>` without also adding/removing one. Reading straight off the
|
|
201
|
+
// directive instance means Angular's own ordinary Input binding keeps every field live for free.
|
|
202
|
+
private readonly registry = new Map<string, ScreenDirective>();
|
|
203
|
+
private readonly emitters = new Map<string, INavigationEmitter>();
|
|
204
|
+
// Keyed by `${route.key}:${index}`, cleared on every dispatch: the ~7 template-bound
|
|
205
|
+
// accessors below (outerScreenIsModal/isInModal/screenHostProps/...) all resolve the SAME
|
|
206
|
+
// route+index through planFor per change-detection cycle, so caching here turns ~7 runs of
|
|
207
|
+
// the 14-step resolveScreenRenderPlan chain into 1 per actual state change.
|
|
208
|
+
private readonly planCache = new Map<string, IScreenRenderPlan>();
|
|
209
|
+
private routeSequence = 0;
|
|
210
|
+
private screenChildrenSubscription: { unsubscribe: () => void } | undefined;
|
|
211
|
+
|
|
212
|
+
private readonly stateSignal = signal<INavigatorState | undefined>(undefined);
|
|
213
|
+
readonly state = this.stateSignal.asReadonly();
|
|
214
|
+
|
|
215
|
+
readonly push = (name: string, params?: unknown): void =>
|
|
216
|
+
this.dispatch({ type: 'push', route: this.createRoute(name, params) });
|
|
217
|
+
readonly pop = (count?: number): void => this.dispatch({ type: 'pop', count });
|
|
218
|
+
readonly popToTop = (): void => this.dispatch({ type: 'popToTop' });
|
|
219
|
+
readonly popTo = (key: string): void => this.dispatch({ type: 'popTo', key });
|
|
220
|
+
readonly replace = (name: string, params?: unknown): void =>
|
|
221
|
+
this.dispatch({ type: 'replace', route: this.createRoute(name, params) });
|
|
222
|
+
readonly setParams = (params: unknown, key?: string): void =>
|
|
223
|
+
this.dispatch({ type: 'setParams', key, params });
|
|
224
|
+
readonly reset = (nextState: INavigatorState): void =>
|
|
225
|
+
this.dispatch({ type: 'reset', state: nextState });
|
|
226
|
+
readonly canGoBack = (): boolean => (this.stateSignal()?.routes.length ?? 0) > 1;
|
|
227
|
+
|
|
228
|
+
ngAfterContentInit(): void {
|
|
229
|
+
this.rebuildRegistry();
|
|
230
|
+
this.initializeState();
|
|
231
|
+
this.screenChildrenSubscription = this.screenChildren.changes.subscribe(() => {
|
|
232
|
+
this.rebuildRegistry();
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
ngOnDestroy(): void {
|
|
237
|
+
this.screenChildrenSubscription?.unsubscribe();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
private rebuildRegistry(): void {
|
|
241
|
+
this.registry.clear();
|
|
242
|
+
for (const screen of this.screenChildren) {
|
|
243
|
+
this.registry.set(screen.name, screen);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
private initializeState(): void {
|
|
248
|
+
if (this.stateSignal() !== undefined) return;
|
|
249
|
+
const initialRouteName = this.initialRouteName ?? this.registry.keys().next().value;
|
|
250
|
+
if (initialRouteName === undefined) {
|
|
251
|
+
dlog('Stack: no <ng-template symbioteScreen> children registered');
|
|
252
|
+
this.stateSignal.set(
|
|
253
|
+
createInitialNavigatorState({ key: this.routeIdPrefix, name: '', params: undefined }),
|
|
254
|
+
);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
this.stateSignal.set(
|
|
258
|
+
createInitialNavigatorState(
|
|
259
|
+
this.createRoute(initialRouteName, this.registry.get(initialRouteName)?.initialParams),
|
|
260
|
+
),
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
private createRoute(name: string, params: unknown): IRoute<unknown> {
|
|
265
|
+
this.routeSequence += 1;
|
|
266
|
+
return { key: `${this.routeIdPrefix}-${name}-${this.routeSequence}`, name, params };
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
private dispatch(action: INavigatorAction): void {
|
|
270
|
+
const current = this.stateSignal();
|
|
271
|
+
if (current === undefined) return;
|
|
272
|
+
const next = navigatorReducer(current, action);
|
|
273
|
+
this.planCache.clear();
|
|
274
|
+
this.stateSignal.set(next);
|
|
275
|
+
const liveRouteKeys = new Set(next.routes.map(route => route.key));
|
|
276
|
+
for (const route of next.routes) {
|
|
277
|
+
this.emitterFor(route.key).emit(NAVIGATION_EVENT_STATE, next);
|
|
278
|
+
}
|
|
279
|
+
for (const routeKey of this.emitters.keys()) {
|
|
280
|
+
if (!liveRouteKeys.has(routeKey)) this.emitters.delete(routeKey);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
emitterFor(routeKey: string): INavigationEmitter {
|
|
285
|
+
let emitter = this.emitters.get(routeKey);
|
|
286
|
+
if (!emitter) {
|
|
287
|
+
emitter = createNavigationEmitter();
|
|
288
|
+
this.emitters.set(routeKey, emitter);
|
|
289
|
+
}
|
|
290
|
+
return emitter;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
private mergedOptionsFor(route: IRoute<unknown>): IAngularScreenOptions {
|
|
294
|
+
const entry = this.registry.get(route.name);
|
|
295
|
+
const optionsArgs: IScreenOptionsArgs = { route, navigation: this };
|
|
296
|
+
const own =
|
|
297
|
+
entry === undefined
|
|
298
|
+
? undefined
|
|
299
|
+
: typeof entry.options === 'function'
|
|
300
|
+
? entry.options(optionsArgs)
|
|
301
|
+
: entry.options;
|
|
302
|
+
return { ...this.screenOptions, ...own };
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
componentFor(route: IRoute<unknown>): Type<unknown> | null {
|
|
306
|
+
return this.registry.get(route.name)?.component ?? null;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
stackHostProps(): Record<string, unknown> {
|
|
310
|
+
return resolveStackProps({
|
|
311
|
+
passthrough: {
|
|
312
|
+
[STACK_ON_FINISH_TRANSITIONING]: () =>
|
|
313
|
+
dlog(`Stack: onFinishTransitioning at t=${Date.now()}`),
|
|
314
|
+
},
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Threads a route's merged options through the shared ~14-call resolver sequence (see
|
|
319
|
+
// core/render-stack.ts's resolveScreenRenderPlan) every per-route template method below picks
|
|
320
|
+
// its one field from. Angular has no per-route closure scope the way React's `.map`/Vue's render
|
|
321
|
+
// loop do, so each template-bound method calls this per change-detection cycle - cached below
|
|
322
|
+
// by `${route.key}:${index}` so the ~7 accessors that share a route+index resolve the plan once
|
|
323
|
+
// per actual state change instead of once per template read; `dispatch` clears the cache before
|
|
324
|
+
// recomputing so no stale entry survives a state transition. Screen appear/disappear stay
|
|
325
|
+
// adapter-owned (close over `this.dispatch`/`this.emitterFor`); the search bar passthrough
|
|
326
|
+
// carries no dlog wrapper, unlike React/Vue (see this file's own review notes) - its imperative
|
|
327
|
+
// ref rides a separate directive (searchBarRef/[symbioteSearchBarRef]), not this passthrough map.
|
|
328
|
+
private planFor(route: IRoute<unknown>, index: number): IScreenRenderPlan {
|
|
329
|
+
const cacheKey = `${route.key}:${index}`;
|
|
330
|
+
const cached = this.planCache.get(cacheKey);
|
|
331
|
+
if (cached) return cached;
|
|
332
|
+
const mergedOptions = this.mergedOptionsFor(route);
|
|
333
|
+
const searchBarOptions = mergedOptions.headerSearchBarOptions;
|
|
334
|
+
const plan = resolveScreenRenderPlan({
|
|
335
|
+
screenId: route.key,
|
|
336
|
+
index,
|
|
337
|
+
routeCount: this.stateSignal()?.routes.length ?? 1,
|
|
338
|
+
options: mergedOptions,
|
|
339
|
+
platform: NAVIGATOR_PLATFORM,
|
|
340
|
+
isAndroid: Platform.OS === 'android',
|
|
341
|
+
screenPassthrough: {
|
|
342
|
+
[SCREEN_ON_DISMISSED]: () => this.dispatch({ type: 'pop', count: 1 }),
|
|
343
|
+
[SCREEN_ON_HEADER_BACK_BUTTON_CLICKED]: () => this.dispatch({ type: 'pop', count: 1 }),
|
|
344
|
+
[SCREEN_ON_APPEAR]: () => {
|
|
345
|
+
dlog(`Stack: route "${route.name}" appeared (focus)`);
|
|
346
|
+
this.emitterFor(route.key).emit(NAVIGATION_EVENT_FOCUS);
|
|
347
|
+
},
|
|
348
|
+
[SCREEN_ON_DISAPPEAR]: () => {
|
|
349
|
+
dlog(`Stack: route "${route.name}" disappeared (blur)`);
|
|
350
|
+
this.emitterFor(route.key).emit(NAVIGATION_EVENT_BLUR);
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
searchBarPassthrough: searchBarOptions
|
|
354
|
+
? buildSearchBarPassthrough(searchBarOptions)
|
|
355
|
+
: undefined,
|
|
356
|
+
});
|
|
357
|
+
this.planCache.set(cacheKey, plan);
|
|
358
|
+
return plan;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
outerScreenIsModal(route: IRoute<unknown>, index: number): boolean {
|
|
362
|
+
return this.planFor(route, index).screenViewName === RNS_MODAL_SCREEN_VIEW_NAME;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
isInModal(route: IRoute<unknown>, index: number): boolean {
|
|
366
|
+
return this.planFor(route, index).inModal;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
screenHostProps(route: IRoute<unknown>, index: number): Record<string, unknown> {
|
|
370
|
+
return this.planFor(route, index).screenProps;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
innerStackProps(): Record<string, unknown> {
|
|
374
|
+
return { style: resolveHeaderInModalStackStyle() };
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
innerScreenProps(route: IRoute<unknown>, index: number): Record<string, unknown> {
|
|
378
|
+
const plan = this.planFor(route, index);
|
|
379
|
+
return { style: plan.innerScreenStyle, activityState: plan.activityState };
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
contentWrapperProps(route: IRoute<unknown>, index: number): Record<string, unknown> {
|
|
383
|
+
return this.planFor(route, index).contentWrapperProps;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
headerConfigProps(route: IRoute<unknown>, index: number): Record<string, unknown> {
|
|
387
|
+
return this.planFor(route, index).headerConfig.props;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
hasSearchBar(route: IRoute<unknown>): boolean {
|
|
391
|
+
return this.mergedOptionsFor(route).headerSearchBarOptions !== undefined;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
searchBarRef(route: IRoute<unknown>): { current: ISearchBarCommands | null } | undefined {
|
|
395
|
+
return this.mergedOptionsFor(route).headerSearchBarOptions?.ref;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
searchBarProps(route: IRoute<unknown>, index: number): Record<string, unknown> {
|
|
399
|
+
return this.planFor(route, index).searchBarProps ?? {};
|
|
400
|
+
}
|
|
401
|
+
}
|