@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,376 @@
|
|
|
1
|
+
// Stack, the Vue 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/Angular adapters; here Vue supplies the lifecycle - a plain ref
|
|
4
|
+
// for the pushed-route stack (Vue's twin of useReducer: reassign `.value` from the same pure
|
|
5
|
+
// reducer), useId + a closure counter for route-key generation, expose() for the push/pop/replace
|
|
6
|
+
// navigator handle - plus the descriptor bridge for the header config leaf. Pushing/popping a
|
|
7
|
+
// route is an ordinary child mount/unmount: RNSScreenStack diffs its RNSScreen children natively,
|
|
8
|
+
// so no imperative native command is needed here at all. Neither this nor the Screen marker
|
|
9
|
+
// imports react-native-screens' own React components (ScreenStack.tsx et al - hooks, crashes a
|
|
10
|
+
// non-React adapter); the native views are driven directly through the ViewConfig ../register
|
|
11
|
+
// registers. See CLAUDE.md <third_party_rn_packages_are_react_only>.
|
|
12
|
+
|
|
13
|
+
import { defineComponent, h, shallowRef, useId } from '@vue/runtime-core';
|
|
14
|
+
import type { VNode } from '@vue/runtime-core';
|
|
15
|
+
import { descriptorToVue, normalizeVueAttrs } from '@symbiote-native/vue';
|
|
16
|
+
import { Platform, debugNodeId, dlog, isSymbioteNode } from '@symbiote-native/engine';
|
|
17
|
+
import {
|
|
18
|
+
NAVIGATION_EVENT_BLUR,
|
|
19
|
+
NAVIGATION_EVENT_FOCUS,
|
|
20
|
+
NAVIGATION_EVENT_STATE,
|
|
21
|
+
RNS_SCREEN_CONTENT_WRAPPER_VIEW_NAME,
|
|
22
|
+
RNS_SCREEN_STACK_VIEW_NAME,
|
|
23
|
+
RNS_SCREEN_VIEW_NAME,
|
|
24
|
+
SCREEN_ON_APPEAR,
|
|
25
|
+
SCREEN_ON_DISAPPEAR,
|
|
26
|
+
SCREEN_ON_DISMISSED,
|
|
27
|
+
SCREEN_ON_HEADER_BACK_BUTTON_CLICKED,
|
|
28
|
+
SCREEN_ON_WILL_APPEAR,
|
|
29
|
+
SCREEN_ON_WILL_DISAPPEAR,
|
|
30
|
+
STACK_ON_FINISH_TRANSITIONING,
|
|
31
|
+
buildSearchBarHandle,
|
|
32
|
+
buildSearchBarPassthrough,
|
|
33
|
+
computeActivityState,
|
|
34
|
+
createInitialNavigatorState,
|
|
35
|
+
createNavigationEmitter,
|
|
36
|
+
isRecord,
|
|
37
|
+
navigatorReducer,
|
|
38
|
+
resolveScreenRenderPlan,
|
|
39
|
+
resolveStackProps,
|
|
40
|
+
} from '../../core';
|
|
41
|
+
import type {
|
|
42
|
+
INavigationEmitter,
|
|
43
|
+
INavigatorHandle,
|
|
44
|
+
INavigatorPlatform,
|
|
45
|
+
INavigatorState,
|
|
46
|
+
IRoute,
|
|
47
|
+
} from '../../core';
|
|
48
|
+
import { NavigationScope, injectNavigationScope } from '../navigation-context';
|
|
49
|
+
import { Screen } from '../screen';
|
|
50
|
+
import type { IScreenOptionsArgs, IScreenProps, IVueScreenOptions } from '../screen';
|
|
51
|
+
|
|
52
|
+
export type { INavigatorHandle } from '../../core';
|
|
53
|
+
|
|
54
|
+
// React's `children?: ReactNode` becomes Vue's default slot instead (registered screens, read via
|
|
55
|
+
// collectRegistry below) - same split Modal's IModalProps documents.
|
|
56
|
+
export type IStackProps = {
|
|
57
|
+
initialRouteName?: string;
|
|
58
|
+
screenOptions?: IVueScreenOptions;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// backTitleVisible defaults to `true` on both platforms per the codegen spec's own default
|
|
62
|
+
// (CT.WithDefault<boolean, 'true'>) - no ios/android divergence in v1 scope, so a single constant
|
|
63
|
+
// stands in for the per-platform injection point ISliderPlatform-style adapters use elsewhere.
|
|
64
|
+
const NAVIGATOR_PLATFORM: INavigatorPlatform = { defaultHeaderBackTitleVisible: true };
|
|
65
|
+
|
|
66
|
+
type IScreenRegistryEntry = {
|
|
67
|
+
component: IScreenProps['component'];
|
|
68
|
+
options: IScreenProps['options'];
|
|
69
|
+
initialParams: unknown;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
function asString(value: unknown): string | undefined {
|
|
73
|
+
return typeof value === 'string' ? value : undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function asComponent(value: unknown): IScreenProps['component'] | undefined {
|
|
77
|
+
if (typeof value === 'function') return value as IScreenProps['component'];
|
|
78
|
+
return isRecord(value) ? (value as IScreenProps['component']) : undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// screenOptions/options each carry ~20 independently-optional fields (IScreenOptions,
|
|
82
|
+
// navigator-props.ts) forwarded wholesale into the core resolvers below - a per-field guard would
|
|
83
|
+
// just hand-reimplement TypeScript's own structural check, so this narrows only the object-ness at
|
|
84
|
+
// the exact I/O edge where Vue's untyped attrs enter the strongly-typed core surface, per
|
|
85
|
+
// CLAUDE.md's ts-js rule ("the I/O edge where data enters the type system, in the narrowest form").
|
|
86
|
+
function asScreenOptions(value: unknown): IVueScreenOptions | undefined {
|
|
87
|
+
return isRecord(value) ? (value as IVueScreenOptions) : undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function asScreenOptionsOrResolver(value: unknown): IScreenProps['options'] {
|
|
91
|
+
if (typeof value === 'function') return value as IScreenProps['options'];
|
|
92
|
+
return asScreenOptions(value);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function collectRegistry(vnodes: readonly VNode[]): Map<string, IScreenRegistryEntry> {
|
|
96
|
+
const registry = new Map<string, IScreenRegistryEntry>();
|
|
97
|
+
for (const vnode of vnodes) {
|
|
98
|
+
if (vnode.type !== Screen || !isRecord(vnode.props)) continue;
|
|
99
|
+
const name = asString(vnode.props.name);
|
|
100
|
+
const component = asComponent(vnode.props.component);
|
|
101
|
+
if (name === undefined || component === undefined) continue;
|
|
102
|
+
registry.set(name, {
|
|
103
|
+
component,
|
|
104
|
+
options: asScreenOptionsOrResolver(vnode.props.options),
|
|
105
|
+
initialParams: vnode.props.initialParams,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return registry;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function resolveScreenOptions(
|
|
112
|
+
entry: IScreenRegistryEntry,
|
|
113
|
+
screenOptionsArgs: IScreenOptionsArgs,
|
|
114
|
+
screenOptions: IVueScreenOptions | undefined,
|
|
115
|
+
): IVueScreenOptions {
|
|
116
|
+
const own =
|
|
117
|
+
typeof entry.options === 'function' ? entry.options(screenOptionsArgs) : entry.options;
|
|
118
|
+
return { ...screenOptions, ...own };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const StackImpl = defineComponent<IStackProps>(
|
|
122
|
+
(_props, { attrs: rawAttrs, slots, expose }) => {
|
|
123
|
+
const attrs = normalizeVueAttrs(rawAttrs);
|
|
124
|
+
|
|
125
|
+
// Read BEFORE this Stack establishes its own per-screen NavigationScope below - becomes
|
|
126
|
+
// the `parent` link a nested screen's useNavigation().getParent() walks (e.g. this Stack
|
|
127
|
+
// rendered as a Tab screen's content reaches that Tab via this value). undefined when this
|
|
128
|
+
// Stack is the nesting root. Kept as the injected ref itself (not unwrapped here) so the
|
|
129
|
+
// render loop below always reads its CURRENT `.value`, matching React's useContext
|
|
130
|
+
// re-reading on every render.
|
|
131
|
+
const ambientScopeRef = injectNavigationScope();
|
|
132
|
+
|
|
133
|
+
const routeIdPrefix = useId();
|
|
134
|
+
let routeSequence = 0;
|
|
135
|
+
// One emitter per route.key, keyed exactly like routeSequence's counter is scoped - created
|
|
136
|
+
// lazily the first time a route is rendered, pruned once it's popped off the stack (below).
|
|
137
|
+
const emitters = new Map<string, INavigationEmitter>();
|
|
138
|
+
// Investigation instrumentation (flicker-on-focus bug): route keys whose resolved
|
|
139
|
+
// transition/animation-timing props have already been logged, so the once-per-mount dump
|
|
140
|
+
// below doesn't spam on every re-render. Kept behind DEBUG, never removed.
|
|
141
|
+
const loggedScreenPropKeys = new Set<string>();
|
|
142
|
+
|
|
143
|
+
function emitterFor(routeKey: string): INavigationEmitter {
|
|
144
|
+
let emitter = emitters.get(routeKey);
|
|
145
|
+
if (emitter === undefined) {
|
|
146
|
+
emitter = createNavigationEmitter();
|
|
147
|
+
emitters.set(routeKey, emitter);
|
|
148
|
+
}
|
|
149
|
+
return emitter;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function createRoute(name: string, params: unknown): IRoute<unknown> {
|
|
153
|
+
routeSequence += 1;
|
|
154
|
+
return { key: `${routeIdPrefix}-${name}-${routeSequence}`, name, params };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const initialRegistry = collectRegistry(slots.default?.() ?? []);
|
|
158
|
+
const initialRouteName =
|
|
159
|
+
asString(attrs.initialRouteName) ?? initialRegistry.keys().next().value;
|
|
160
|
+
let initialState: INavigatorState;
|
|
161
|
+
if (initialRouteName === undefined) {
|
|
162
|
+
dlog('Stack: no <Stack.Screen> children registered');
|
|
163
|
+
initialState = createInitialNavigatorState({
|
|
164
|
+
key: routeIdPrefix,
|
|
165
|
+
name: '',
|
|
166
|
+
params: undefined,
|
|
167
|
+
});
|
|
168
|
+
} else {
|
|
169
|
+
initialState = createInitialNavigatorState(
|
|
170
|
+
createRoute(initialRouteName, initialRegistry.get(initialRouteName)?.initialParams),
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const state = shallowRef<INavigatorState>(initialState);
|
|
175
|
+
|
|
176
|
+
function dispatch(action: Parameters<typeof navigatorReducer>[1]): void {
|
|
177
|
+
state.value = navigatorReducer(state.value, action);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const handle: INavigatorHandle = {
|
|
181
|
+
push: (name, params) => dispatch({ type: 'push', route: createRoute(name, params) }),
|
|
182
|
+
pop: count => dispatch({ type: 'pop', count }),
|
|
183
|
+
popToTop: () => dispatch({ type: 'popToTop' }),
|
|
184
|
+
popTo: key => dispatch({ type: 'popTo', key }),
|
|
185
|
+
replace: (name, params) => dispatch({ type: 'replace', route: createRoute(name, params) }),
|
|
186
|
+
setParams: (params, key) => dispatch({ type: 'setParams', key, params }),
|
|
187
|
+
reset: nextState => dispatch({ type: 'reset', state: nextState }),
|
|
188
|
+
canGoBack: () => state.value.routes.length > 1,
|
|
189
|
+
};
|
|
190
|
+
expose(handle);
|
|
191
|
+
|
|
192
|
+
// Broadcasts the router state to every still-live route's emitter (useNavigationState's
|
|
193
|
+
// source) after each commit, and prunes emitters for routes popped off the stack - mirroring
|
|
194
|
+
// React's own subscribe-in-effect pattern. `watch` isn't needed here (unlike React's
|
|
195
|
+
// useEffect, which must be deferred past render to avoid a descendant setState-during-render):
|
|
196
|
+
// Vue's provide/inject + shallowRef.value writes are safe to perform directly inside the
|
|
197
|
+
// render closure below, so the broadcast happens right there, once per render.
|
|
198
|
+
function broadcastState(): void {
|
|
199
|
+
for (const route of state.value.routes) {
|
|
200
|
+
emitterFor(route.key).emit(NAVIGATION_EVENT_STATE, state.value);
|
|
201
|
+
}
|
|
202
|
+
for (const routeKey of emitters.keys()) {
|
|
203
|
+
if (!state.value.routes.some(route => route.key === routeKey)) emitters.delete(routeKey);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return () => {
|
|
208
|
+
broadcastState();
|
|
209
|
+
const registry = collectRegistry(slots.default?.() ?? []);
|
|
210
|
+
const screenOptions = asScreenOptions(attrs.screenOptions);
|
|
211
|
+
|
|
212
|
+
// Investigation instrumentation (flicker-on-focus bug): STACK_ON_FINISH_TRANSITIONING is
|
|
213
|
+
// the native signal that the WHOLE push/pop animation has finished (as opposed to
|
|
214
|
+
// onAppear/onDisappear, which are per-screen) - logging it lets the per-screen
|
|
215
|
+
// appear/disappear timestamps be checked against the actual transition-complete moment.
|
|
216
|
+
// Kept behind DEBUG, never removed.
|
|
217
|
+
const stackProps = resolveStackProps({
|
|
218
|
+
passthrough: {
|
|
219
|
+
[STACK_ON_FINISH_TRANSITIONING]: () =>
|
|
220
|
+
dlog(`Stack: onFinishTransitioning at t=${Date.now()}`),
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
const children = state.value.routes.map((route, index) => {
|
|
225
|
+
const entry = registry.get(route.name);
|
|
226
|
+
if (entry === undefined) {
|
|
227
|
+
dlog(`Stack: no screen registered for route name "${route.name}"`);
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const screenOptionsArgs: IScreenOptionsArgs = { route, navigation: handle };
|
|
232
|
+
const mergedOptions = resolveScreenOptions(entry, screenOptionsArgs, screenOptions);
|
|
233
|
+
const activityState = computeActivityState(index, state.value.routes.length);
|
|
234
|
+
// Investigation instrumentation (flicker-on-focus bug): fires on EVERY Stack render, not
|
|
235
|
+
// just on transitions, so the log stream shows whether a route's activityState/index ever
|
|
236
|
+
// changes outside of a push/pop dispatch. Kept behind DEBUG, never removed.
|
|
237
|
+
dlog(
|
|
238
|
+
`Stack: render route "${route.name}" index=${index}/${state.value.routes.length - 1} ` +
|
|
239
|
+
`activityState=${activityState} at t=${Date.now()}`,
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
const routeEmitter = emitterFor(route.key);
|
|
243
|
+
|
|
244
|
+
const searchBarOptions = mergedOptions.headerSearchBarOptions;
|
|
245
|
+
const plan = resolveScreenRenderPlan({
|
|
246
|
+
screenId: route.key,
|
|
247
|
+
index,
|
|
248
|
+
routeCount: state.value.routes.length,
|
|
249
|
+
options: mergedOptions,
|
|
250
|
+
platform: NAVIGATOR_PLATFORM,
|
|
251
|
+
isAndroid: Platform.OS === 'android',
|
|
252
|
+
screenPassthrough: {
|
|
253
|
+
[SCREEN_ON_DISMISSED]: () => dispatch({ type: 'pop', count: 1 }),
|
|
254
|
+
[SCREEN_ON_HEADER_BACK_BUTTON_CLICKED]: () => dispatch({ type: 'pop', count: 1 }),
|
|
255
|
+
// onAppear/onDisappear are the definitive visibility boundary (post-transition-
|
|
256
|
+
// animation), so 'focus'/'blur' fire exactly once per transition; onWillAppear/
|
|
257
|
+
// onWillDisappear fire BEFORE the animation runs, so wiring them to emit() too would
|
|
258
|
+
// double-invoke useFocusEffect per transition - they only get a debug log here.
|
|
259
|
+
[SCREEN_ON_WILL_APPEAR]: () =>
|
|
260
|
+
dlog(`Stack: route "${route.name}" will appear at t=${Date.now()}`),
|
|
261
|
+
[SCREEN_ON_APPEAR]: () => {
|
|
262
|
+
dlog(`Stack: route "${route.name}" appeared (focus) at t=${Date.now()}`);
|
|
263
|
+
routeEmitter.emit(NAVIGATION_EVENT_FOCUS);
|
|
264
|
+
},
|
|
265
|
+
[SCREEN_ON_WILL_DISAPPEAR]: () =>
|
|
266
|
+
dlog(`Stack: route "${route.name}" will disappear at t=${Date.now()}`),
|
|
267
|
+
[SCREEN_ON_DISAPPEAR]: () => {
|
|
268
|
+
dlog(`Stack: route "${route.name}" disappeared (blur) at t=${Date.now()}`);
|
|
269
|
+
routeEmitter.emit(NAVIGATION_EVENT_BLUR);
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
searchBarPassthrough: searchBarOptions
|
|
273
|
+
? {
|
|
274
|
+
...buildSearchBarPassthrough(searchBarOptions, message =>
|
|
275
|
+
dlog(`Stack: route "${route.name}" ${message}`),
|
|
276
|
+
),
|
|
277
|
+
// The imperative ref (SearchBarCommands): a function ref attached straight to the
|
|
278
|
+
// RNSSearchBar host element via `passthrough.ref` - descriptorToVue's h() call
|
|
279
|
+
// hands the raw engine node to a plain function ref same as Switch/TextInput's
|
|
280
|
+
// setNodeRef. Built fresh per mount/unmount, never captured eagerly
|
|
281
|
+
// (buildSearchBarHandle's own lazy-getter contract is satisfied trivially here
|
|
282
|
+
// since `node` is already resolved).
|
|
283
|
+
ref: (el: unknown): void => {
|
|
284
|
+
const node = isSymbioteNode(el) ? el : null;
|
|
285
|
+
// Investigation instrumentation (search-bar-ref "node not committed" bug):
|
|
286
|
+
// compare this debugNodeId against the mirror.set/dispatchViewCommand logs in
|
|
287
|
+
// commit.ts - same id on both sides proves the ref really does hold the
|
|
288
|
+
// committed node; a mismatch proves a stale closure instead. Kept behind DEBUG,
|
|
289
|
+
// never removed.
|
|
290
|
+
dlog(
|
|
291
|
+
`Stack: search bar ref callback, node=${node === null ? 'null' : debugNodeId(node)} at t=${Date.now()}`,
|
|
292
|
+
);
|
|
293
|
+
const appRef = searchBarOptions.ref;
|
|
294
|
+
if (appRef === undefined) return;
|
|
295
|
+
appRef.value = node === null ? null : buildSearchBarHandle(() => node);
|
|
296
|
+
},
|
|
297
|
+
}
|
|
298
|
+
: undefined,
|
|
299
|
+
});
|
|
300
|
+
// Investigation instrumentation (flicker-on-focus bug): the actual timing/z-order-relevant
|
|
301
|
+
// values resolved onto the native RNSScreen, once per route.key (not every render) -
|
|
302
|
+
// rules a stackAnimation/transitionDuration mismatch against react-native-screens' own
|
|
303
|
+
// native default in or out. Kept behind DEBUG, never removed.
|
|
304
|
+
if (!loggedScreenPropKeys.has(route.key)) {
|
|
305
|
+
loggedScreenPropKeys.add(route.key);
|
|
306
|
+
dlog(
|
|
307
|
+
`Stack: route "${route.name}" resolved screen props ` +
|
|
308
|
+
`stackAnimation=${String(plan.screenProps.stackAnimation)} ` +
|
|
309
|
+
`stackPresentation=${String(plan.screenProps.stackPresentation)} ` +
|
|
310
|
+
`transitionDuration=${String(plan.screenProps.transitionDuration)} ` +
|
|
311
|
+
`gestureEnabled=${String(plan.screenProps.gestureEnabled)} at t=${Date.now()}`,
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// Must not be flattened away (collapsable: false) - react-native-screens' native side
|
|
316
|
+
// finds THIS specific view type by class check to register a formSheet's content for
|
|
317
|
+
// sizing (see RNS_SCREEN_CONTENT_WRAPPER_VIEW_NAME's comment in core/constants.ts). A
|
|
318
|
+
// `push` screen doesn't need it, but a `formSheet` one is otherwise left with no content
|
|
319
|
+
// ever attached natively.
|
|
320
|
+
const content = h(RNS_SCREEN_CONTENT_WRAPPER_VIEW_NAME, plan.contentWrapperProps, [
|
|
321
|
+
h(
|
|
322
|
+
NavigationScope,
|
|
323
|
+
{
|
|
324
|
+
value: {
|
|
325
|
+
route,
|
|
326
|
+
navigation: handle,
|
|
327
|
+
emitter: routeEmitter,
|
|
328
|
+
parent: ambientScopeRef?.value,
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
// No route/navigation props: the screen reads both through composables off the
|
|
332
|
+
// NavigationScope provided just above (useRoute / useStackNavigation).
|
|
333
|
+
() => h(entry.component),
|
|
334
|
+
),
|
|
335
|
+
]);
|
|
336
|
+
|
|
337
|
+
// react-native-screens' own Screen.tsx swaps in a DIFFERENT Fabric component
|
|
338
|
+
// ('RNSModalScreen') for a modally-presented screen - its native updateLayoutMetrics:
|
|
339
|
+
// relies on this exact class to know it must NOT apply Yoga's computed frame (see
|
|
340
|
+
// resolveScreenViewName's comment in core/render-stack.ts). The nested Screen
|
|
341
|
+
// isHeaderInModal adds below is always plain 'RNSScreen': react-native-screens' own inner
|
|
342
|
+
// Screen never carries a presentation prop either, since it exists purely to host the
|
|
343
|
+
// header, not to be modally presented itself.
|
|
344
|
+
|
|
345
|
+
// A modal/formSheet screen has no UINavigationController of its own on iOS - nest an
|
|
346
|
+
// inner RNSScreenStack/RNSScreen purely to host the native header bar (see
|
|
347
|
+
// isHeaderInModal's comment in core/render-stack.ts). Skipping this leaves
|
|
348
|
+
// RNSScreenStackHeaderConfig with no navigation controller to attach to, so the header
|
|
349
|
+
// silently never renders.
|
|
350
|
+
return plan.inModal
|
|
351
|
+
? h(plan.screenViewName, { key: route.key, ...plan.screenProps }, [
|
|
352
|
+
h(RNS_SCREEN_STACK_VIEW_NAME, { style: plan.innerStackStyle }, [
|
|
353
|
+
h(
|
|
354
|
+
RNS_SCREEN_VIEW_NAME,
|
|
355
|
+
// activityState mirrors the outer Screen's own value - react-native-screens'
|
|
356
|
+
// RNSScreen.mm treats an unset/inactive nested screen as not yet pushed,
|
|
357
|
+
// leaving it parked at its pre-push transition position (off past the bottom
|
|
358
|
+
// edge) instead of its real, presented frame.
|
|
359
|
+
{ style: plan.innerScreenStyle, activityState: plan.activityState },
|
|
360
|
+
[descriptorToVue(plan.headerConfig), content],
|
|
361
|
+
),
|
|
362
|
+
]),
|
|
363
|
+
])
|
|
364
|
+
: h(plan.screenViewName, { key: route.key, ...plan.screenProps }, [
|
|
365
|
+
descriptorToVue(plan.headerConfig),
|
|
366
|
+
content,
|
|
367
|
+
]);
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
return h(RNS_SCREEN_STACK_VIEW_NAME, stackProps, children);
|
|
371
|
+
};
|
|
372
|
+
},
|
|
373
|
+
{ name: 'Stack', inheritAttrs: false },
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
export const Stack = Object.assign(StackImpl, { Screen });
|