@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,231 @@
|
|
|
1
|
+
// Tab, the Angular lifecycle half. The focused-index router (tab-router-state) and the tab-bar
|
|
2
|
+
// Descriptor builder (render-tabs) live in @symbiote-native/navigation core, shared verbatim with
|
|
3
|
+
// the React/Vue adapters; here Angular supplies the lifecycle - a signal for the focused index, a
|
|
4
|
+
// per-instance counter for route-key generation, `jumpTo`/`setParams` as plain public methods
|
|
5
|
+
// directly on the class (no ref forwarding needed, see stack.ts's header, same reasoning: `Tab
|
|
6
|
+
// implements ITabNavigatorHandle`) - plus the descriptor bridge (`symbiote-descriptor-outlet`,
|
|
7
|
+
// `@symbiote-native/angular`) for the tab-bar leaf, exactly like Stack bridges its header config.
|
|
8
|
+
// Unlike Stack, a bottom-tabs bar is a PURE-JS UI: it paints
|
|
9
|
+
// ordinary `symbiote-view`/`symbiote-text` primitives via the shared render fn, so there is no
|
|
10
|
+
// react-native-screens ViewConfig to register - Tab needs no `../register` import. Every tag this
|
|
11
|
+
// template names (`View`, `symbiote-descriptor-outlet`) is a REAL imported Angular component (no
|
|
12
|
+
// raw non-dashed native tag names the way stack.ts needs `NO_ERRORS_SCHEMA` for), so no loosened
|
|
13
|
+
// schema is needed here at all.
|
|
14
|
+
//
|
|
15
|
+
// RESOLVED (see stack.ts's header, identical reasoning): `'Tab'` has an `ANCHOR_HOST_COMPONENTS`
|
|
16
|
+
// entry in `adapters/angular/src/renderer.ts`, so a real device build paints `<Tab>` correctly as
|
|
17
|
+
// a nested tag.
|
|
18
|
+
import { ChangeDetectionStrategy, Component, ContentChildren, Input, QueryList, signal, untracked, } from '@angular/core';
|
|
19
|
+
import { NgComponentOutlet } from '@angular/common';
|
|
20
|
+
import { dlog } from '@symbiote-native/engine';
|
|
21
|
+
import { DescriptorOutlet, View } from '@symbiote-native/angular';
|
|
22
|
+
import { NAVIGATION_EVENT_BLUR, NAVIGATION_EVENT_FOCUS, createInitialTabState, createNavigationEmitter, diffFocusedRoute, isFocusedRoute, renderTabBar, tabRouterReducer, } from '../../core';
|
|
23
|
+
import { NavigationScopeDirective } from '../navigation-scope.directive';
|
|
24
|
+
import { TabScreenDirective } from '../tab-screen.directive';
|
|
25
|
+
import * as i0 from "@angular/core";
|
|
26
|
+
const TAB_ROOT_STYLE = { flex: 1 };
|
|
27
|
+
const TAB_CONTENT_STYLE = { flex: 1 };
|
|
28
|
+
let tabInstanceCounter = 0;
|
|
29
|
+
export class Tab {
|
|
30
|
+
tabScreenChildren;
|
|
31
|
+
initialRouteName;
|
|
32
|
+
screenOptions;
|
|
33
|
+
rootStyle = TAB_ROOT_STYLE;
|
|
34
|
+
contentStyle = TAB_CONTENT_STYLE;
|
|
35
|
+
routeIdPrefix = `tab-${(tabInstanceCounter += 1)}`;
|
|
36
|
+
// Keyed by name -> the LIVE TabScreenDirective instance - see stack.ts's matching comment for
|
|
37
|
+
// why a snapshot copy would go stale on an in-place `[options]`/`[component]` change.
|
|
38
|
+
registry = new Map();
|
|
39
|
+
tabScreenChildrenSubscription;
|
|
40
|
+
stateSignal = signal(undefined, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "stateSignal" }] : /* istanbul ignore next */ []));
|
|
42
|
+
state = this.stateSignal.asReadonly();
|
|
43
|
+
currentEmitterKey;
|
|
44
|
+
currentEmitter;
|
|
45
|
+
jumpTo = (name, params) => this.dispatch({ type: 'jumpTo', name, params });
|
|
46
|
+
setParams = (params, key) => this.dispatch({ type: 'setParams', key, params });
|
|
47
|
+
ngAfterContentInit() {
|
|
48
|
+
this.rebuildRegistry();
|
|
49
|
+
this.initializeState();
|
|
50
|
+
this.tabScreenChildrenSubscription = this.tabScreenChildren.changes.subscribe(() => {
|
|
51
|
+
this.rebuildRegistry();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
ngOnDestroy() {
|
|
55
|
+
this.tabScreenChildrenSubscription?.unsubscribe();
|
|
56
|
+
if (this.currentEmitter)
|
|
57
|
+
this.currentEmitter.emit(NAVIGATION_EVENT_BLUR);
|
|
58
|
+
}
|
|
59
|
+
rebuildRegistry() {
|
|
60
|
+
this.registry.clear();
|
|
61
|
+
for (const screen of this.tabScreenChildren) {
|
|
62
|
+
this.registry.set(screen.name, screen);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
routesFromRegistry() {
|
|
66
|
+
return Array.from(this.registry.entries()).map(([name, entry]) => ({
|
|
67
|
+
key: `${this.routeIdPrefix}-${name}`,
|
|
68
|
+
name,
|
|
69
|
+
params: entry.initialParams,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
initializeState() {
|
|
73
|
+
if (this.stateSignal() !== undefined)
|
|
74
|
+
return;
|
|
75
|
+
const routes = this.routesFromRegistry();
|
|
76
|
+
if (routes.length === 0)
|
|
77
|
+
dlog('Tab: no <ng-template symbioteTabScreen> children registered');
|
|
78
|
+
this.stateSignal.set(createInitialTabState(routes, this.initialRouteName));
|
|
79
|
+
}
|
|
80
|
+
dispatch(action) {
|
|
81
|
+
const current = this.stateSignal();
|
|
82
|
+
if (current === undefined)
|
|
83
|
+
return;
|
|
84
|
+
this.stateSignal.set(tabRouterReducer(current, action));
|
|
85
|
+
}
|
|
86
|
+
resolveTabOptions(entry, route) {
|
|
87
|
+
const props = { route, navigation: this };
|
|
88
|
+
const own = typeof entry.options === 'function' ? entry.options(props) : entry.options;
|
|
89
|
+
return { ...this.screenOptions, ...own };
|
|
90
|
+
}
|
|
91
|
+
focusedRoute() {
|
|
92
|
+
const state = this.stateSignal();
|
|
93
|
+
return state?.routes[state.index];
|
|
94
|
+
}
|
|
95
|
+
componentForRoute(route) {
|
|
96
|
+
return this.registry.get(route.name)?.component ?? null;
|
|
97
|
+
}
|
|
98
|
+
// Lazily creates/replaces the focused route's emitter and synthesizes focus/blur - Tab paints
|
|
99
|
+
// its own bar in pure JS (no native onAppear/onDisappear the way Stack's RNSScreen has), so
|
|
100
|
+
// focus/blur is synthesized here exactly like react/tabs.ts's own useEffect does, just idempotent
|
|
101
|
+
// per read (called repeatedly with the same key during one CD pass) instead of dependency-array
|
|
102
|
+
// gated. Keyed on the route KEY, not the object, so a setParams-only change doesn't re-fire.
|
|
103
|
+
//
|
|
104
|
+
// Called from the template ([emitter]="focusedRouteEmitter()"), which runs inside Angular's
|
|
105
|
+
// reactive-read tracking context for the current CD pass - unlike React's useEffect, which runs
|
|
106
|
+
// in a separate post-commit phase. Two consequences of that, both fixed below:
|
|
107
|
+
//
|
|
108
|
+
// 1. Writing a signal from inside a tracked template read throws Angular's NG600 ("signal write
|
|
109
|
+
// during a template execution") - untracked() opts this whole synthesis out of that tracking
|
|
110
|
+
// context, matching what the post-commit useEffect phase gives React for free.
|
|
111
|
+
// 2. The NEW route's screen component (injectIsFocused's listener source) is created by
|
|
112
|
+
// *ngComponentOutlet AFTER this binding is evaluated, but still within the SAME synchronous
|
|
113
|
+
// template refresh - so emitting FOCUS right here fires to zero listeners and is silently
|
|
114
|
+
// lost forever (isFocused stays false permanently, even for the very first-focused screen).
|
|
115
|
+
// queueMicrotask defers the FOCUS emit past the end of the current synchronous refresh
|
|
116
|
+
// (which includes the new screen's construction), guaranteeing its injectIsFocused()
|
|
117
|
+
// listener is already attached by the time it fires. BLUR doesn't need this: the outgoing
|
|
118
|
+
// screen's listener was already attached on an earlier tick, so it's safe to fire now.
|
|
119
|
+
focusedRouteEmitter() {
|
|
120
|
+
const key = this.focusedRoute()?.key;
|
|
121
|
+
return untracked(() => {
|
|
122
|
+
if (key === this.currentEmitterKey && this.currentEmitter)
|
|
123
|
+
return this.currentEmitter;
|
|
124
|
+
const { blurKey, focusKey } = diffFocusedRoute(this.currentEmitterKey, key);
|
|
125
|
+
if (blurKey !== undefined && this.currentEmitter) {
|
|
126
|
+
dlog('Tab: previous route blurred');
|
|
127
|
+
this.currentEmitter.emit(NAVIGATION_EVENT_BLUR);
|
|
128
|
+
}
|
|
129
|
+
const emitter = createNavigationEmitter();
|
|
130
|
+
this.currentEmitter = emitter;
|
|
131
|
+
this.currentEmitterKey = key;
|
|
132
|
+
if (focusKey !== undefined) {
|
|
133
|
+
queueMicrotask(() => {
|
|
134
|
+
if (this.currentEmitter !== emitter)
|
|
135
|
+
return; // superseded by a later switch
|
|
136
|
+
dlog(`Tab: route "${this.focusedRoute()?.name}" focused`);
|
|
137
|
+
emitter.emit(NAVIGATION_EVENT_FOCUS);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return emitter;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
tabBarDescriptor() {
|
|
144
|
+
const state = this.stateSignal();
|
|
145
|
+
const routes = state?.routes ?? [];
|
|
146
|
+
const focusedIndex = state?.index ?? 0;
|
|
147
|
+
const items = routes.map((route, index) => {
|
|
148
|
+
const entry = this.registry.get(route.name);
|
|
149
|
+
const focused = isFocusedRoute(index, focusedIndex);
|
|
150
|
+
if (!entry) {
|
|
151
|
+
dlog(`Tab: no screen registered for route name "${route.name}"`);
|
|
152
|
+
return { key: route.key, focused, label: route.name, passthrough: {} };
|
|
153
|
+
}
|
|
154
|
+
const options = this.resolveTabOptions(entry, route);
|
|
155
|
+
return {
|
|
156
|
+
key: route.key,
|
|
157
|
+
focused,
|
|
158
|
+
label: options.tabBarLabel ?? options.title ?? route.name,
|
|
159
|
+
icon: options.tabBarIcon,
|
|
160
|
+
badge: options.tabBarBadge,
|
|
161
|
+
activeTintColor: options.tabBarActiveTintColor,
|
|
162
|
+
inactiveTintColor: options.tabBarInactiveTintColor,
|
|
163
|
+
passthrough: {
|
|
164
|
+
onPress: () => this.jumpTo(route.name),
|
|
165
|
+
accessibilityRole: 'tab',
|
|
166
|
+
accessibilityState: { selected: focused },
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
const focusedRoute = this.focusedRoute();
|
|
171
|
+
const focusedEntry = focusedRoute ? this.registry.get(focusedRoute.name) : undefined;
|
|
172
|
+
const focusedOptions = focusedEntry && focusedRoute
|
|
173
|
+
? this.resolveTabOptions(focusedEntry, focusedRoute)
|
|
174
|
+
: this.screenOptions;
|
|
175
|
+
return renderTabBar({ items, style: focusedOptions?.tabBarStyle, passthrough: {} });
|
|
176
|
+
}
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tab, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
178
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Tab, isStandalone: true, selector: "Tab", inputs: { initialRouteName: "initialRouteName", screenOptions: "screenOptions" }, queries: [{ propertyName: "tabScreenChildren", predicate: TabScreenDirective }], ngImport: i0, template: `
|
|
179
|
+
<View [style]="rootStyle">
|
|
180
|
+
<View [style]="contentStyle">
|
|
181
|
+
@if (focusedRoute(); as route) {
|
|
182
|
+
@if (componentForRoute(route); as component) {
|
|
183
|
+
<ng-container
|
|
184
|
+
[symbioteNavigationScope]="route"
|
|
185
|
+
[navigation]="this"
|
|
186
|
+
[emitter]="focusedRouteEmitter()"
|
|
187
|
+
>
|
|
188
|
+
<ng-container *ngComponentOutlet="component" />
|
|
189
|
+
</ng-container>
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
</View>
|
|
193
|
+
<symbiote-descriptor-outlet [node]="tabBarDescriptor()" />
|
|
194
|
+
</View>
|
|
195
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NavigationScopeDirective, selector: "[symbioteNavigationScope]", inputs: ["symbioteNavigationScope", "navigation", "emitter"] }, { kind: "component", type: DescriptorOutlet, selector: "symbiote-descriptor-outlet", inputs: ["node"] }, { kind: "component", type: View, selector: "symbiote-view, View" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
196
|
+
}
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tab, decorators: [{
|
|
198
|
+
type: Component,
|
|
199
|
+
args: [{
|
|
200
|
+
selector: 'Tab',
|
|
201
|
+
standalone: true,
|
|
202
|
+
imports: [NgComponentOutlet, NavigationScopeDirective, DescriptorOutlet, View],
|
|
203
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
204
|
+
template: `
|
|
205
|
+
<View [style]="rootStyle">
|
|
206
|
+
<View [style]="contentStyle">
|
|
207
|
+
@if (focusedRoute(); as route) {
|
|
208
|
+
@if (componentForRoute(route); as component) {
|
|
209
|
+
<ng-container
|
|
210
|
+
[symbioteNavigationScope]="route"
|
|
211
|
+
[navigation]="this"
|
|
212
|
+
[emitter]="focusedRouteEmitter()"
|
|
213
|
+
>
|
|
214
|
+
<ng-container *ngComponentOutlet="component" />
|
|
215
|
+
</ng-container>
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
</View>
|
|
219
|
+
<symbiote-descriptor-outlet [node]="tabBarDescriptor()" />
|
|
220
|
+
</View>
|
|
221
|
+
`,
|
|
222
|
+
}]
|
|
223
|
+
}], propDecorators: { tabScreenChildren: [{
|
|
224
|
+
type: ContentChildren,
|
|
225
|
+
args: [TabScreenDirective]
|
|
226
|
+
}], initialRouteName: [{
|
|
227
|
+
type: Input
|
|
228
|
+
}], screenOptions: [{
|
|
229
|
+
type: Input
|
|
230
|
+
}] } });
|
|
231
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/angular/tabs/index.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,kGAAkG;AAClG,kGAAkG;AAClG,8FAA8F;AAC9F,+FAA+F;AAC/F,+FAA+F;AAC/F,kGAAkG;AAClG,6DAA6D;AAC7D,+FAA+F;AAC/F,kGAAkG;AAClG,iGAAiG;AACjG,iGAAiG;AACjG,gCAAgC;AAChC,EAAE;AACF,iGAAiG;AACjG,kGAAkG;AAClG,gBAAgB;AAEhB,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,GAIV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,YAAY,E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AAC,YAAY,EAAE,YAAY,CAAC;YACpD,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;QAEzB,OAAO,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACtF,CAAC;uGApKU,GAAG;2FAAH,GAAG,mLACG,kBAAkB,6BApBzB;;;;;;;;;;;;;;;;;GAiBT,4DAnBS,iBAAiB,yRAAE,wBAAwB,oIAAE,gBAAgB,yFAAE,IAAI;;2FAqBlE,GAAG;kBAxBf,SAAS;mBAAC;oBACT,QAAQ,EAAE,KAAK;oBACf,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,iBAAiB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,IAAI,CAAC;oBAC9E,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,QAAQ,EAAE;;;;;;;;;;;;;;;;;GAiBT;iBACF;;sBAEE,eAAe;uBAAC,kBAAkB;;sBAGlC,KAAK;;sBACL,KAAK"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type AfterContentInit, type OnDestroy, type Type } from '@angular/core';
|
|
2
|
+
import type { IDescriptor } from '@symbiote-native/components';
|
|
3
|
+
import type { INavigationEmitter, IRoute, ITabNavigatorHandle, ITabOptions } from '../core';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export type { ITabNavigatorHandle } from '../core';
|
|
6
|
+
export declare class Tab implements AfterContentInit, OnDestroy, ITabNavigatorHandle {
|
|
7
|
+
private readonly tabScreenChildren;
|
|
8
|
+
initialRouteName?: string;
|
|
9
|
+
screenOptions?: ITabOptions;
|
|
10
|
+
readonly rootStyle: {
|
|
11
|
+
flex: number;
|
|
12
|
+
};
|
|
13
|
+
readonly contentStyle: {
|
|
14
|
+
flex: number;
|
|
15
|
+
};
|
|
16
|
+
private readonly routeIdPrefix;
|
|
17
|
+
private readonly registry;
|
|
18
|
+
private tabScreenChildrenSubscription;
|
|
19
|
+
private readonly stateSignal;
|
|
20
|
+
readonly state: import("@angular/core").Signal<Readonly<{
|
|
21
|
+
routes: readonly Readonly<{
|
|
22
|
+
key: string;
|
|
23
|
+
name: string;
|
|
24
|
+
params: unknown;
|
|
25
|
+
}>[];
|
|
26
|
+
index: number;
|
|
27
|
+
}> | undefined>;
|
|
28
|
+
private currentEmitterKey;
|
|
29
|
+
private currentEmitter;
|
|
30
|
+
readonly jumpTo: (name: string, params?: unknown) => void;
|
|
31
|
+
readonly setParams: (params: unknown, key: string) => void;
|
|
32
|
+
ngAfterContentInit(): void;
|
|
33
|
+
ngOnDestroy(): void;
|
|
34
|
+
private rebuildRegistry;
|
|
35
|
+
private routesFromRegistry;
|
|
36
|
+
private initializeState;
|
|
37
|
+
private dispatch;
|
|
38
|
+
private resolveTabOptions;
|
|
39
|
+
focusedRoute(): IRoute<unknown> | undefined;
|
|
40
|
+
componentForRoute(route: IRoute<unknown>): Type<unknown> | null;
|
|
41
|
+
focusedRouteEmitter(): INavigationEmitter;
|
|
42
|
+
tabBarDescriptor(): IDescriptor;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Tab, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Tab, "Tab", never, { "initialRouteName": { "alias": "initialRouteName"; "required": false; }; "screenOptions": { "alias": "screenOptions"; "required": false; }; }, {}, ["tabScreenChildren"], never, true, never>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
// Tab, the Angular lifecycle half. The focused-index router (tab-router-state) and the tab-bar
|
|
2
|
+
// Descriptor builder (render-tabs) live in @symbiote-native/navigation core, shared verbatim with
|
|
3
|
+
// the React/Vue adapters; here Angular supplies the lifecycle — a signal for the focused index, a
|
|
4
|
+
// per-instance counter for route-key generation, `jumpTo`/`setParams` as plain public methods
|
|
5
|
+
// directly on the class (no ref forwarding needed, see stack.ts's header, same reasoning: `Tab
|
|
6
|
+
// implements ITabNavigatorHandle`) - plus the descriptor bridge (`symbiote-descriptor-outlet`,
|
|
7
|
+
// `@symbiote-native/angular`) for the tab-bar leaf, exactly like Stack bridges its header config.
|
|
8
|
+
// Unlike Stack, a bottom-tabs bar is a PURE-JS UI: it paints
|
|
9
|
+
// ordinary `symbiote-view`/`symbiote-text` primitives via the shared render fn, so there is no
|
|
10
|
+
// react-native-screens ViewConfig to register — Tab needs no `../register` import. Every tag this
|
|
11
|
+
// template names (`View`, `symbiote-descriptor-outlet`) is a REAL imported Angular component (no
|
|
12
|
+
// raw non-dashed native tag names the way stack.ts needs `NO_ERRORS_SCHEMA` for), so no loosened
|
|
13
|
+
// schema is needed here at all.
|
|
14
|
+
//
|
|
15
|
+
// RESOLVED (see stack.ts's header, identical reasoning): `'Tab'` has an `ANCHOR_HOST_COMPONENTS`
|
|
16
|
+
// entry in `adapters/angular/src/renderer.ts`, so a real device build paints `<Tab>` correctly as
|
|
17
|
+
// a nested tag.
|
|
18
|
+
import { ChangeDetectionStrategy, Component, ContentChildren, Input, QueryList, signal, untracked, } from '@angular/core';
|
|
19
|
+
import { NgComponentOutlet } from '@angular/common';
|
|
20
|
+
import { dlog } from '@symbiote-native/engine';
|
|
21
|
+
import { DescriptorOutlet, View } from '@symbiote-native/angular';
|
|
22
|
+
import { NAVIGATION_EVENT_BLUR, NAVIGATION_EVENT_FOCUS, createInitialTabState, createNavigationEmitter, diffFocusedRoute, isFocusedRoute, renderTabBar, tabRouterReducer, } from '../core';
|
|
23
|
+
import { NavigationScopeDirective } from './navigation-scope.directive';
|
|
24
|
+
import { TabScreenDirective } from './tab-screen.directive';
|
|
25
|
+
import * as i0 from "@angular/core";
|
|
26
|
+
const TAB_ROOT_STYLE = { flex: 1 };
|
|
27
|
+
const TAB_CONTENT_STYLE = { flex: 1 };
|
|
28
|
+
let tabInstanceCounter = 0;
|
|
29
|
+
export class Tab {
|
|
30
|
+
tabScreenChildren;
|
|
31
|
+
initialRouteName;
|
|
32
|
+
screenOptions;
|
|
33
|
+
rootStyle = TAB_ROOT_STYLE;
|
|
34
|
+
contentStyle = TAB_CONTENT_STYLE;
|
|
35
|
+
routeIdPrefix = `tab-${(tabInstanceCounter += 1)}`;
|
|
36
|
+
// Keyed by name -> the LIVE TabScreenDirective instance — see stack.ts's matching comment for
|
|
37
|
+
// why a snapshot copy would go stale on an in-place `[options]`/`[component]` change.
|
|
38
|
+
registry = new Map();
|
|
39
|
+
tabScreenChildrenSubscription;
|
|
40
|
+
stateSignal = signal(undefined, /* @ts-ignore */
|
|
41
|
+
...(ngDevMode ? [{ debugName: "stateSignal" }] : /* istanbul ignore next */ []));
|
|
42
|
+
state = this.stateSignal.asReadonly();
|
|
43
|
+
currentEmitterKey;
|
|
44
|
+
currentEmitter;
|
|
45
|
+
jumpTo = (name, params) => this.dispatch({ type: 'jumpTo', name, params });
|
|
46
|
+
setParams = (params, key) => this.dispatch({ type: 'setParams', key, params });
|
|
47
|
+
ngAfterContentInit() {
|
|
48
|
+
this.rebuildRegistry();
|
|
49
|
+
this.initializeState();
|
|
50
|
+
this.tabScreenChildrenSubscription = this.tabScreenChildren.changes.subscribe(() => {
|
|
51
|
+
this.rebuildRegistry();
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
ngOnDestroy() {
|
|
55
|
+
this.tabScreenChildrenSubscription?.unsubscribe();
|
|
56
|
+
if (this.currentEmitter)
|
|
57
|
+
this.currentEmitter.emit(NAVIGATION_EVENT_BLUR);
|
|
58
|
+
}
|
|
59
|
+
rebuildRegistry() {
|
|
60
|
+
this.registry.clear();
|
|
61
|
+
for (const screen of this.tabScreenChildren) {
|
|
62
|
+
this.registry.set(screen.name, screen);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
routesFromRegistry() {
|
|
66
|
+
return Array.from(this.registry.entries()).map(([name, entry]) => ({
|
|
67
|
+
key: `${this.routeIdPrefix}-${name}`,
|
|
68
|
+
name,
|
|
69
|
+
params: entry.initialParams,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
initializeState() {
|
|
73
|
+
if (this.stateSignal() !== undefined)
|
|
74
|
+
return;
|
|
75
|
+
const routes = this.routesFromRegistry();
|
|
76
|
+
if (routes.length === 0)
|
|
77
|
+
dlog('Tab: no <ng-template symbioteTabScreen> children registered');
|
|
78
|
+
this.stateSignal.set(createInitialTabState(routes, this.initialRouteName));
|
|
79
|
+
}
|
|
80
|
+
dispatch(action) {
|
|
81
|
+
const current = this.stateSignal();
|
|
82
|
+
if (current === undefined)
|
|
83
|
+
return;
|
|
84
|
+
this.stateSignal.set(tabRouterReducer(current, action));
|
|
85
|
+
}
|
|
86
|
+
resolveTabOptions(entry, route) {
|
|
87
|
+
const props = { route, navigation: this };
|
|
88
|
+
const own = typeof entry.options === 'function' ? entry.options(props) : entry.options;
|
|
89
|
+
return { ...this.screenOptions, ...own };
|
|
90
|
+
}
|
|
91
|
+
focusedRoute() {
|
|
92
|
+
const state = this.stateSignal();
|
|
93
|
+
return state?.routes[state.index];
|
|
94
|
+
}
|
|
95
|
+
componentForRoute(route) {
|
|
96
|
+
return this.registry.get(route.name)?.component ?? null;
|
|
97
|
+
}
|
|
98
|
+
// Lazily creates/replaces the focused route's emitter and synthesizes focus/blur — Tab paints
|
|
99
|
+
// its own bar in pure JS (no native onAppear/onDisappear the way Stack's RNSScreen has), so
|
|
100
|
+
// focus/blur is synthesized here exactly like react/tabs.ts's own useEffect does, just idempotent
|
|
101
|
+
// per read (called repeatedly with the same key during one CD pass) instead of dependency-array
|
|
102
|
+
// gated. Keyed on the route KEY, not the object, so a setParams-only change doesn't re-fire.
|
|
103
|
+
//
|
|
104
|
+
// Called from the template ([emitter]="focusedRouteEmitter()"), which runs inside Angular's
|
|
105
|
+
// reactive-read tracking context for the current CD pass — unlike React's useEffect, which runs
|
|
106
|
+
// in a separate post-commit phase. Two consequences of that, both fixed below:
|
|
107
|
+
//
|
|
108
|
+
// 1. Writing a signal from inside a tracked template read throws Angular's NG600 ("signal write
|
|
109
|
+
// during a template execution") — untracked() opts this whole synthesis out of that tracking
|
|
110
|
+
// context, matching what the post-commit useEffect phase gives React for free.
|
|
111
|
+
// 2. The NEW route's screen component (injectIsFocused's listener source) is created by
|
|
112
|
+
// *ngComponentOutlet AFTER this binding is evaluated, but still within the SAME synchronous
|
|
113
|
+
// template refresh — so emitting FOCUS right here fires to zero listeners and is silently
|
|
114
|
+
// lost forever (isFocused stays false permanently, even for the very first-focused screen).
|
|
115
|
+
// queueMicrotask defers the FOCUS emit past the end of the current synchronous refresh
|
|
116
|
+
// (which includes the new screen's construction), guaranteeing its injectIsFocused()
|
|
117
|
+
// listener is already attached by the time it fires. BLUR doesn't need this: the outgoing
|
|
118
|
+
// screen's listener was already attached on an earlier tick, so it's safe to fire now.
|
|
119
|
+
focusedRouteEmitter() {
|
|
120
|
+
const key = this.focusedRoute()?.key;
|
|
121
|
+
return untracked(() => {
|
|
122
|
+
if (key === this.currentEmitterKey && this.currentEmitter)
|
|
123
|
+
return this.currentEmitter;
|
|
124
|
+
const { blurKey, focusKey } = diffFocusedRoute(this.currentEmitterKey, key);
|
|
125
|
+
if (blurKey !== undefined && this.currentEmitter) {
|
|
126
|
+
dlog('Tab: previous route blurred');
|
|
127
|
+
this.currentEmitter.emit(NAVIGATION_EVENT_BLUR);
|
|
128
|
+
}
|
|
129
|
+
const emitter = createNavigationEmitter();
|
|
130
|
+
this.currentEmitter = emitter;
|
|
131
|
+
this.currentEmitterKey = key;
|
|
132
|
+
if (focusKey !== undefined) {
|
|
133
|
+
queueMicrotask(() => {
|
|
134
|
+
if (this.currentEmitter !== emitter)
|
|
135
|
+
return; // superseded by a later switch
|
|
136
|
+
dlog(`Tab: route "${this.focusedRoute()?.name}" focused`);
|
|
137
|
+
emitter.emit(NAVIGATION_EVENT_FOCUS);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return emitter;
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
tabBarDescriptor() {
|
|
144
|
+
const state = this.stateSignal();
|
|
145
|
+
const routes = state?.routes ?? [];
|
|
146
|
+
const focusedIndex = state?.index ?? 0;
|
|
147
|
+
const items = routes.map((route, index) => {
|
|
148
|
+
const entry = this.registry.get(route.name);
|
|
149
|
+
const focused = isFocusedRoute(index, focusedIndex);
|
|
150
|
+
if (!entry) {
|
|
151
|
+
dlog(`Tab: no screen registered for route name "${route.name}"`);
|
|
152
|
+
return { key: route.key, focused, label: route.name, passthrough: {} };
|
|
153
|
+
}
|
|
154
|
+
const options = this.resolveTabOptions(entry, route);
|
|
155
|
+
return {
|
|
156
|
+
key: route.key,
|
|
157
|
+
focused,
|
|
158
|
+
label: options.tabBarLabel ?? options.title ?? route.name,
|
|
159
|
+
icon: options.tabBarIcon,
|
|
160
|
+
badge: options.tabBarBadge,
|
|
161
|
+
activeTintColor: options.tabBarActiveTintColor,
|
|
162
|
+
inactiveTintColor: options.tabBarInactiveTintColor,
|
|
163
|
+
passthrough: {
|
|
164
|
+
onPress: () => this.jumpTo(route.name),
|
|
165
|
+
accessibilityRole: 'tab',
|
|
166
|
+
accessibilityState: { selected: focused },
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
const focusedRoute = this.focusedRoute();
|
|
171
|
+
const focusedEntry = focusedRoute ? this.registry.get(focusedRoute.name) : undefined;
|
|
172
|
+
const focusedOptions = focusedEntry && focusedRoute
|
|
173
|
+
? this.resolveTabOptions(focusedEntry, focusedRoute)
|
|
174
|
+
: this.screenOptions;
|
|
175
|
+
return renderTabBar({ items, style: focusedOptions?.tabBarStyle, passthrough: {} });
|
|
176
|
+
}
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tab, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
178
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: Tab, isStandalone: true, selector: "Tab", inputs: { initialRouteName: "initialRouteName", screenOptions: "screenOptions" }, queries: [{ propertyName: "tabScreenChildren", predicate: TabScreenDirective }], ngImport: i0, template: `
|
|
179
|
+
<View [style]="rootStyle">
|
|
180
|
+
<View [style]="contentStyle">
|
|
181
|
+
@if (focusedRoute(); as route) {
|
|
182
|
+
@if (componentForRoute(route); as component) {
|
|
183
|
+
<ng-container
|
|
184
|
+
[symbioteNavigationScope]="route"
|
|
185
|
+
[navigation]="this"
|
|
186
|
+
[emitter]="focusedRouteEmitter()"
|
|
187
|
+
>
|
|
188
|
+
<ng-container *ngComponentOutlet="component" />
|
|
189
|
+
</ng-container>
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
</View>
|
|
193
|
+
<symbiote-descriptor-outlet [node]="tabBarDescriptor()" />
|
|
194
|
+
</View>
|
|
195
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NavigationScopeDirective, selector: "[symbioteNavigationScope]", inputs: ["symbioteNavigationScope", "navigation", "emitter"] }, { kind: "component", type: DescriptorOutlet, selector: "symbiote-descriptor-outlet", inputs: ["node"] }, { kind: "component", type: View, selector: "symbiote-view, View" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
196
|
+
}
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Tab, decorators: [{
|
|
198
|
+
type: Component,
|
|
199
|
+
args: [{
|
|
200
|
+
selector: 'Tab',
|
|
201
|
+
standalone: true,
|
|
202
|
+
imports: [NgComponentOutlet, NavigationScopeDirective, DescriptorOutlet, View],
|
|
203
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
204
|
+
template: `
|
|
205
|
+
<View [style]="rootStyle">
|
|
206
|
+
<View [style]="contentStyle">
|
|
207
|
+
@if (focusedRoute(); as route) {
|
|
208
|
+
@if (componentForRoute(route); as component) {
|
|
209
|
+
<ng-container
|
|
210
|
+
[symbioteNavigationScope]="route"
|
|
211
|
+
[navigation]="this"
|
|
212
|
+
[emitter]="focusedRouteEmitter()"
|
|
213
|
+
>
|
|
214
|
+
<ng-container *ngComponentOutlet="component" />
|
|
215
|
+
</ng-container>
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
</View>
|
|
219
|
+
<symbiote-descriptor-outlet [node]="tabBarDescriptor()" />
|
|
220
|
+
</View>
|
|
221
|
+
`,
|
|
222
|
+
}]
|
|
223
|
+
}], propDecorators: { tabScreenChildren: [{
|
|
224
|
+
type: ContentChildren,
|
|
225
|
+
args: [TabScreenDirective]
|
|
226
|
+
}], initialRouteName: [{
|
|
227
|
+
type: Input
|
|
228
|
+
}], screenOptions: [{
|
|
229
|
+
type: Input
|
|
230
|
+
}] } });
|
|
231
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/angular/tabs.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,kGAAkG;AAClG,kGAAkG;AAClG,8FAA8F;AAC9F,+FAA+F;AAC/F,+FAA+F;AAC/F,kGAAkG;AAClG,6DAA6D;AAC7D,+FAA+F;AAC/F,kGAAkG;AAClG,iGAAiG;AACjG,iGAAiG;AACjG,gCAAgC;AAChC,EAAE;AACF,iGAAiG;AACjG,kGAAkG;AAClG,gBAAgB;AAEhB,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,KAAK,EACL,SAAS,EACT,MAAM,EACN,SAAS,GAIV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,E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,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACrF,MAAM,cAAc,GAClB,YAAY,IAAI,YAAY;YAC1B,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,YAAY,CAAC;YACpD,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;QAEzB,OAAO,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;IACtF,CAAC;uGApKU,GAAG;2FAAH,GAAG,mLACG,kBAAkB,6BApBzB;;;;;;;;;;;;;;;;;GAiBT,4DAnBS,iBAAiB,yRAAE,wBAAwB,oIAAE,gBAAgB,yFAAE,IAAI;;2FAqBlE,GAAG;kBAxBf,SAAS;mBAAC;oBACT,QAAQ,EAAE,KAAK;oBACf,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,iBAAiB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,IAAI,CAAC;oBAC9E,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,QAAQ,EAAE;;;;;;;;;;;;;;;;;GAiBT;iBACF;;sBAEE,eAAe;uBAAC,kBAAkB;;sBAGlC,KAAK;;sBACL,KAAK"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const RNS_SCREEN_VIEW_NAME = "RNSScreen";
|
|
2
|
+
export declare const RNS_MODAL_SCREEN_VIEW_NAME = "RNSModalScreen";
|
|
3
|
+
export declare const RNS_SCREEN_STACK_VIEW_NAME = "RNSScreenStack";
|
|
4
|
+
export declare const RNS_SCREEN_STACK_HEADER_CONFIG_VIEW_NAME = "RNSScreenStackHeaderConfig";
|
|
5
|
+
export declare const RNS_SCREEN_STACK_HEADER_SUBVIEW_VIEW_NAME = "RNSScreenStackHeaderSubview";
|
|
6
|
+
export declare const RNS_SEARCH_BAR_VIEW_NAME = "RNSSearchBar";
|
|
7
|
+
export declare const RNS_SCREEN_CONTENT_WRAPPER_VIEW_NAME = "RNSScreenContentWrapper";
|
|
8
|
+
export declare const SCREEN_ON_APPEAR = "onAppear";
|
|
9
|
+
export declare const SCREEN_ON_DISAPPEAR = "onDisappear";
|
|
10
|
+
export declare const SCREEN_ON_WILL_APPEAR = "onWillAppear";
|
|
11
|
+
export declare const SCREEN_ON_WILL_DISAPPEAR = "onWillDisappear";
|
|
12
|
+
export declare const SCREEN_ON_DISMISSED = "onDismissed";
|
|
13
|
+
export declare const SCREEN_ON_HEADER_BACK_BUTTON_CLICKED = "onHeaderBackButtonClicked";
|
|
14
|
+
export declare const STACK_ON_FINISH_TRANSITIONING = "onFinishTransitioning";
|
|
15
|
+
export declare const HEADER_ON_PRESS_BAR_BUTTON_ITEM = "onPressHeaderBarButtonItem";
|
|
16
|
+
export declare const HEADER_ON_PRESS_BAR_BUTTON_MENU_ITEM = "onPressHeaderBarButtonMenuItem";
|
|
17
|
+
export declare const SEARCH_BAR_ON_FOCUS = "onSearchFocus";
|
|
18
|
+
export declare const SEARCH_BAR_ON_BLUR = "onSearchBlur";
|
|
19
|
+
export declare const SEARCH_BAR_ON_SEARCH_BUTTON_PRESS = "onSearchButtonPress";
|
|
20
|
+
export declare const SEARCH_BAR_ON_CANCEL_BUTTON_PRESS = "onCancelButtonPress";
|
|
21
|
+
export declare const SEARCH_BAR_ON_CHANGE_TEXT = "onChangeText";
|
|
22
|
+
export declare const SEARCH_BAR_ON_CLOSE = "onClose";
|
|
23
|
+
export declare const SEARCH_BAR_ON_OPEN = "onOpen";
|
|
24
|
+
export declare const SCREEN_ACTIVITY_STATE_FOCUSED = 2;
|
|
25
|
+
export declare const SCREEN_ACTIVITY_STATE_INACTIVE = 0;
|
|
26
|
+
export declare const STACK_DEFAULT_ANIMATION = "default";
|
|
27
|
+
export declare const STACK_DEFAULT_PRESENTATION = "push";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Framework-agnostic constants for the react-native-screens native stack primitives. symbiote
|
|
2
|
+
// ships zero ViewConfig metadata for these views at runtime - the engine derives events and
|
|
3
|
+
// color processors from react-native-screens' own codegen ViewConfig - this file only names the
|
|
4
|
+
// Fabric view names and event prop keys every adapter binds against, plus the RNS activityState
|
|
5
|
+
// convention (mirrors @react-navigation/native-stack's internal screen focus signaling).
|
|
6
|
+
// The Fabric view names react-native-screens' codegen components register. descriptorFor passes
|
|
7
|
+
// any non-`symbiote-` string through as a raw Fabric name, so the render fns emit these directly.
|
|
8
|
+
export const RNS_SCREEN_VIEW_NAME = 'RNSScreen';
|
|
9
|
+
// The modal-presentation twin of RNSScreen - see resolveScreenViewName's comment in
|
|
10
|
+
// render-stack.ts for why a formSheet/modal screen MUST use this different Fabric name.
|
|
11
|
+
export const RNS_MODAL_SCREEN_VIEW_NAME = 'RNSModalScreen';
|
|
12
|
+
export const RNS_SCREEN_STACK_VIEW_NAME = 'RNSScreenStack';
|
|
13
|
+
export const RNS_SCREEN_STACK_HEADER_CONFIG_VIEW_NAME = 'RNSScreenStackHeaderConfig';
|
|
14
|
+
// The header-subview leaf react-native-screens itself uses to host arbitrary framework children
|
|
15
|
+
// (left/right/back/title/center/searchBar) inside the header. Registered here for ground-truth
|
|
16
|
+
// parity, but unconsumed by any fold in v1 scope: renderHeaderConfig's Descriptor never takes
|
|
17
|
+
// framework children (see render-stack.ts), so mounting a subview child is left to the adapter.
|
|
18
|
+
export const RNS_SCREEN_STACK_HEADER_SUBVIEW_VIEW_NAME = 'RNSScreenStackHeaderSubview';
|
|
19
|
+
export const RNS_SEARCH_BAR_VIEW_NAME = 'RNSSearchBar';
|
|
20
|
+
// react-native-screens' own JS layer (ScreenStackItem -> DebugContainer -> ScreenContentWrapper)
|
|
21
|
+
// ALWAYS wraps a screen's content in this native view, `collapsable: false` so Fabric can never
|
|
22
|
+
// flatten it away. RNSScreen.mm's `registerContentWrapper:contentHeightErrata:` is a no-op for
|
|
23
|
+
// `push` (early-returns NO), but for `formSheet` it's how the native side ever learns the
|
|
24
|
+
// content's real size - RNSScreenContentWrapper's `willMoveToWindow` walks up to the ancestor
|
|
25
|
+
// RNSScreen and registers itself, and its `receivedReactFrame:` delegate callback is what feeds
|
|
26
|
+
// the sheet's own height/detent machinery. Skipping this wrapper is harmless for `push` (why it
|
|
27
|
+
// went unnoticed) but leaves a formSheet screen's native side with nothing to attach to at all.
|
|
28
|
+
export const RNS_SCREEN_CONTENT_WRAPPER_VIEW_NAME = 'RNSScreenContentWrapper';
|
|
29
|
+
// RNSScreen event prop keys (all DirectEventHandler in the codegen spec).
|
|
30
|
+
export const SCREEN_ON_APPEAR = 'onAppear';
|
|
31
|
+
export const SCREEN_ON_DISAPPEAR = 'onDisappear';
|
|
32
|
+
export const SCREEN_ON_WILL_APPEAR = 'onWillAppear';
|
|
33
|
+
export const SCREEN_ON_WILL_DISAPPEAR = 'onWillDisappear';
|
|
34
|
+
export const SCREEN_ON_DISMISSED = 'onDismissed';
|
|
35
|
+
export const SCREEN_ON_HEADER_BACK_BUTTON_CLICKED = 'onHeaderBackButtonClicked';
|
|
36
|
+
// RNSScreenStack event prop key.
|
|
37
|
+
export const STACK_ON_FINISH_TRANSITIONING = 'onFinishTransitioning';
|
|
38
|
+
// RNSScreenStackHeaderConfig event prop keys (both DirectEventHandler in the codegen spec): a
|
|
39
|
+
// plain bar-button-item press, and a press on a (possibly nested) menu action of a 'menu'-type
|
|
40
|
+
// bar-button item.
|
|
41
|
+
export const HEADER_ON_PRESS_BAR_BUTTON_ITEM = 'onPressHeaderBarButtonItem';
|
|
42
|
+
export const HEADER_ON_PRESS_BAR_BUTTON_MENU_ITEM = 'onPressHeaderBarButtonMenuItem';
|
|
43
|
+
// RNSSearchBar event prop keys (all DirectEventHandler in the codegen spec). onClose/onOpen are
|
|
44
|
+
// Android-only per the codegen spec's own comment.
|
|
45
|
+
export const SEARCH_BAR_ON_FOCUS = 'onSearchFocus';
|
|
46
|
+
export const SEARCH_BAR_ON_BLUR = 'onSearchBlur';
|
|
47
|
+
export const SEARCH_BAR_ON_SEARCH_BUTTON_PRESS = 'onSearchButtonPress';
|
|
48
|
+
export const SEARCH_BAR_ON_CANCEL_BUTTON_PRESS = 'onCancelButtonPress';
|
|
49
|
+
export const SEARCH_BAR_ON_CHANGE_TEXT = 'onChangeText';
|
|
50
|
+
export const SEARCH_BAR_ON_CLOSE = 'onClose';
|
|
51
|
+
export const SEARCH_BAR_ON_OPEN = 'onOpen';
|
|
52
|
+
// activityState RNS reads to decide which screen is attached to the native hierarchy. Per
|
|
53
|
+
// react-native-screens' native RNSScreen.mm (maybeAssertActivityStateProgressionOldValue), an
|
|
54
|
+
// already-mounted NativeStack screen's activityState can never DECREASE via a plain prop update -
|
|
55
|
+
// only 0 (detached) and 2 (attached + focused) are used; there is no "1 = transitioning" value in
|
|
56
|
+
// @react-navigation/native-stack's actual algorithm (NativeStackView.native.tsx computes
|
|
57
|
+
// `activityState={isInactive ? 0 : 2}`, never 1). See computeActivityState for the full rationale.
|
|
58
|
+
export const SCREEN_ACTIVITY_STATE_FOCUSED = 2;
|
|
59
|
+
export const SCREEN_ACTIVITY_STATE_INACTIVE = 0;
|
|
60
|
+
export const STACK_DEFAULT_ANIMATION = 'default';
|
|
61
|
+
export const STACK_DEFAULT_PRESENTATION = 'push';
|
|
62
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,4FAA4F;AAC5F,gGAAgG;AAChG,gGAAgG;AAChG,yFAAyF;AAEzF,gGAAgG;AAChG,kGAAkG;AAClG,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAChD,oFAAoF;AACpF,wFAAwF;AACxF,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAC3D,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC;AAC3D,MAAM,CAAC,MAAM,wCAA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