@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,299 @@
|
|
|
1
|
+
// Co-located Angular-driven test for the @symbiote-native/navigation Angular Drawer navigator.
|
|
2
|
+
// Proves: registry building from @ContentChildren, jumpTo focus switching, openDrawer/
|
|
3
|
+
// closeDrawer/toggleDrawer driving the isOpen state and the panel/overlay geometry reuse from
|
|
4
|
+
// core (drawerChildOrder/resolveDrawerGeometry), and drawer content projection via the
|
|
5
|
+
// `#drawerContent` TemplateRef. Drawer is imported from its own module (NOT the package barrel)
|
|
6
|
+
// so ../register never loads headless - Drawer needs no react-native-screens ViewConfig at all.
|
|
7
|
+
|
|
8
|
+
import '@angular/compiler';
|
|
9
|
+
import { Component, CUSTOM_ELEMENTS_SCHEMA, ViewChild, type Signal } from '@angular/core';
|
|
10
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
11
|
+
import {
|
|
12
|
+
Animated,
|
|
13
|
+
mount,
|
|
14
|
+
unmount,
|
|
15
|
+
Dimensions,
|
|
16
|
+
registerComposedComponent,
|
|
17
|
+
} from '@symbiote-native/angular';
|
|
18
|
+
import { installFabric, type IFakeNode } from '@symbiote-native/test-utils';
|
|
19
|
+
import { Drawer } from './index';
|
|
20
|
+
import type { IDrawerNavigatorHandle } from './index';
|
|
21
|
+
import { DrawerScreenDirective } from '../drawer-screen.directive';
|
|
22
|
+
import { injectIsFocused } from '../injectors/inject-is-focused';
|
|
23
|
+
|
|
24
|
+
const ROOT_TAG = 5122;
|
|
25
|
+
const tick = (): Promise<void> => new Promise(resolve => setTimeout(resolve, 0));
|
|
26
|
+
|
|
27
|
+
// Drawer reads the screen width off WindowDimensionsService (isSwipeStartInEdge) - headless has
|
|
28
|
+
// no DeviceInfo native module, so seed a concrete width once; every mount in this file reads this
|
|
29
|
+
// same cached value (Dimensions is a module-level singleton). Mirrors
|
|
30
|
+
// react/drawer.test.tsx's identical setup.
|
|
31
|
+
Dimensions.set({ window: { width: 375, height: 812, scale: 1, fontScale: 1 } });
|
|
32
|
+
|
|
33
|
+
// On a real Metro build, adapters/angular's babel-register-composed.cjs auto-registers `Drawer`
|
|
34
|
+
// as an anchor host by scanning the AOT-compiled @Component's selector - vitest never runs that
|
|
35
|
+
// pipeline, so this test drives the same self-registration entry point by hand (mirrors
|
|
36
|
+
// renderer.test.ts's 'RefApiDemo' convention). Without it, `<Drawer>` falls through to a raw
|
|
37
|
+
// Fabric createNode('Drawer') call instead of a non-painting anchor.
|
|
38
|
+
registerComposedComponent('Drawer');
|
|
39
|
+
|
|
40
|
+
// rAF is not a Node global; Animated.timing (driven by every openDrawer/closeDrawer/toggleDrawer
|
|
41
|
+
// call) reads it at .start() time. Ported verbatim from react/drawer.test.tsx's own polyfill - no
|
|
42
|
+
// frame is ever awaited here since these tests assert on state-derived content, not animated
|
|
43
|
+
// frame values.
|
|
44
|
+
let frameClock = 0;
|
|
45
|
+
const pendingFrames = new Map<number, (time: number) => void>();
|
|
46
|
+
let nextFrameId = 1;
|
|
47
|
+
|
|
48
|
+
function installRequestAnimationFrame(): void {
|
|
49
|
+
Object.assign(globalThis, {
|
|
50
|
+
requestAnimationFrame(callback: (time: number) => void): number {
|
|
51
|
+
const id = nextFrameId++;
|
|
52
|
+
pendingFrames.set(id, callback);
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
const cb = pendingFrames.get(id);
|
|
55
|
+
if (cb !== undefined) {
|
|
56
|
+
pendingFrames.delete(id);
|
|
57
|
+
frameClock += 16;
|
|
58
|
+
cb(frameClock);
|
|
59
|
+
}
|
|
60
|
+
}, 0);
|
|
61
|
+
return id;
|
|
62
|
+
},
|
|
63
|
+
cancelAnimationFrame(id: number): void {
|
|
64
|
+
pendingFrames.delete(id);
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const fabric = installFabric();
|
|
70
|
+
|
|
71
|
+
beforeEach(() => {
|
|
72
|
+
fabric.reset();
|
|
73
|
+
frameClock = 0;
|
|
74
|
+
pendingFrames.clear();
|
|
75
|
+
nextFrameId = 1;
|
|
76
|
+
installRequestAnimationFrame();
|
|
77
|
+
capturedHomeInstance = undefined;
|
|
78
|
+
capturedSettingsInstance = undefined;
|
|
79
|
+
});
|
|
80
|
+
afterEach(() => {
|
|
81
|
+
unmount(ROOT_TAG);
|
|
82
|
+
Reflect.deleteProperty(globalThis, 'requestAnimationFrame');
|
|
83
|
+
Reflect.deleteProperty(globalThis, 'cancelAnimationFrame');
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
function findInTree(
|
|
87
|
+
predicate: (node: IFakeNode) => boolean,
|
|
88
|
+
nodes = fabric.committed,
|
|
89
|
+
): IFakeNode | undefined {
|
|
90
|
+
for (const node of nodes) {
|
|
91
|
+
if (predicate(node)) return node;
|
|
92
|
+
const found = findInTree(predicate, node.children);
|
|
93
|
+
if (found) return found;
|
|
94
|
+
}
|
|
95
|
+
return undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
let capturedHomeInstance: HomeDrawerScreenComponent | undefined;
|
|
99
|
+
let capturedSettingsInstance: SettingsDrawerScreenComponent | undefined;
|
|
100
|
+
|
|
101
|
+
@Component({
|
|
102
|
+
selector: 'home-drawer-screen',
|
|
103
|
+
standalone: true,
|
|
104
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
105
|
+
template: `<symbiote-text>home</symbiote-text>`,
|
|
106
|
+
})
|
|
107
|
+
class HomeDrawerScreenComponent {
|
|
108
|
+
// Real screens (e.g. .examples/angular's DrawerHomeScreen) call injectIsFocused() - see the
|
|
109
|
+
// regression test below for why this matters.
|
|
110
|
+
readonly isFocused: Signal<boolean> = injectIsFocused();
|
|
111
|
+
|
|
112
|
+
constructor() {
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
114
|
+
capturedHomeInstance = this;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@Component({
|
|
119
|
+
selector: 'settings-drawer-screen',
|
|
120
|
+
standalone: true,
|
|
121
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
122
|
+
template: `<symbiote-text>settings</symbiote-text>`,
|
|
123
|
+
})
|
|
124
|
+
class SettingsDrawerScreenComponent {
|
|
125
|
+
readonly isFocused: Signal<boolean> = injectIsFocused();
|
|
126
|
+
|
|
127
|
+
constructor() {
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
129
|
+
capturedSettingsInstance = this;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
let capturedHost: DrawerTestHost | undefined;
|
|
134
|
+
|
|
135
|
+
@Component({
|
|
136
|
+
selector: 'drawer-test-host',
|
|
137
|
+
standalone: true,
|
|
138
|
+
imports: [Drawer, DrawerScreenDirective],
|
|
139
|
+
template: `
|
|
140
|
+
<Drawer #nav initialRouteName="Home">
|
|
141
|
+
<ng-template
|
|
142
|
+
symbioteDrawerScreen
|
|
143
|
+
name="Home"
|
|
144
|
+
[component]="homeComponent"
|
|
145
|
+
[options]="homeOptions"
|
|
146
|
+
></ng-template>
|
|
147
|
+
<ng-template
|
|
148
|
+
symbioteDrawerScreen
|
|
149
|
+
name="Settings"
|
|
150
|
+
[component]="settingsComponent"
|
|
151
|
+
></ng-template>
|
|
152
|
+
<ng-template #drawerContent let-ctx>
|
|
153
|
+
<symbiote-text
|
|
154
|
+
>{{ ctx.state.routes.length }} routes, focused index {{ ctx.state.index }}</symbiote-text
|
|
155
|
+
>
|
|
156
|
+
</ng-template>
|
|
157
|
+
</Drawer>
|
|
158
|
+
`,
|
|
159
|
+
})
|
|
160
|
+
class DrawerTestHost {
|
|
161
|
+
@ViewChild('nav') nav!: Drawer;
|
|
162
|
+
|
|
163
|
+
homeComponent = HomeDrawerScreenComponent;
|
|
164
|
+
settingsComponent = SettingsDrawerScreenComponent;
|
|
165
|
+
homeOptions: Record<string, unknown> = { title: 'Home', drawerLabel: 'Home' };
|
|
166
|
+
|
|
167
|
+
constructor() {
|
|
168
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
169
|
+
capturedHost = this;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async function mountDrawer(): Promise<IDrawerNavigatorHandle> {
|
|
174
|
+
capturedHost = undefined;
|
|
175
|
+
mount(ROOT_TAG, DrawerTestHost);
|
|
176
|
+
await tick();
|
|
177
|
+
const host = capturedHost;
|
|
178
|
+
if (!host) throw new Error('DrawerTestHost never mounted');
|
|
179
|
+
return host.nav;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
describe('Angular Drawer navigator', () => {
|
|
183
|
+
it('mounts closed, with the initial route focused', async () => {
|
|
184
|
+
const handle = await mountDrawer();
|
|
185
|
+
expect(findInTree(n => n.viewName === 'RCTRawText' && n.props.text === 'home')).toBeDefined();
|
|
186
|
+
expect(
|
|
187
|
+
findInTree(n => n.viewName === 'RCTRawText' && n.props.text === 'settings'),
|
|
188
|
+
).toBeUndefined();
|
|
189
|
+
void handle;
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it('jumpTo() switches the focused/mounted screen and closes the drawer', async () => {
|
|
193
|
+
const handle = await mountDrawer();
|
|
194
|
+
handle.openDrawer();
|
|
195
|
+
await tick();
|
|
196
|
+
handle.jumpTo('Settings');
|
|
197
|
+
await tick();
|
|
198
|
+
expect(
|
|
199
|
+
findInTree(n => n.viewName === 'RCTRawText' && n.props.text === 'settings'),
|
|
200
|
+
).toBeDefined();
|
|
201
|
+
expect(findInTree(n => n.viewName === 'RCTRawText' && n.props.text === 'home')).toBeUndefined();
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// Regression test: jumpTo() used to read isOpen off the signal AFTER dispatch(), by which point
|
|
205
|
+
// drawerRouterReducer had already flipped it to false - so the "was it open?" check always saw
|
|
206
|
+
// false and never animated the panel closed, leaving it visually stuck open even though the
|
|
207
|
+
// router state itself was already correct. Asserts on the actual Animated.timing call
|
|
208
|
+
// (animateProgressTo's own entry point), not just the state-derived content used above, since
|
|
209
|
+
// that's what the stuck-open bug never touched.
|
|
210
|
+
it('jumpTo() animates the panel closed when the drawer was open', async () => {
|
|
211
|
+
const handle = await mountDrawer();
|
|
212
|
+
handle.openDrawer();
|
|
213
|
+
await tick();
|
|
214
|
+
const timingSpy = vi.spyOn(Animated, 'timing');
|
|
215
|
+
handle.jumpTo('Settings');
|
|
216
|
+
await tick();
|
|
217
|
+
expect(timingSpy).toHaveBeenCalledWith(
|
|
218
|
+
expect.anything(),
|
|
219
|
+
expect.objectContaining({ toValue: 0 }),
|
|
220
|
+
);
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('openDrawer()/closeDrawer()/toggleDrawer() drive the router state', async () => {
|
|
224
|
+
const handle = await mountDrawer();
|
|
225
|
+
handle.openDrawer();
|
|
226
|
+
await tick();
|
|
227
|
+
handle.closeDrawer();
|
|
228
|
+
await tick();
|
|
229
|
+
handle.toggleDrawer();
|
|
230
|
+
await tick();
|
|
231
|
+
// No public isOpen getter on the handle (mirrors react's IDrawerNavigatorHandle) - proven
|
|
232
|
+
// indirectly via the drawer content projection below, which reads live router state.
|
|
233
|
+
void handle;
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it('projects drawer content via the #drawerContent template, reading live router state', async () => {
|
|
237
|
+
await mountDrawer();
|
|
238
|
+
expect(
|
|
239
|
+
findInTree(n => n.viewName === 'RCTRawText' && n.props.text === '2 routes, focused index 0'),
|
|
240
|
+
).toBeDefined();
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
it('reuses core geometry: content/overlay/panel slots paint in front-type order (content, overlay, panel)', async () => {
|
|
244
|
+
await mountDrawer();
|
|
245
|
+
// 'front' (the default drawerType) paints content, then overlay (absent while closed - see
|
|
246
|
+
// isDrawerOverlayVisible), then panel - proven by both home content and the drawer-content
|
|
247
|
+
// template text (panel) being present simultaneously in the committed tree.
|
|
248
|
+
expect(findInTree(n => n.viewName === 'RCTRawText' && n.props.text === 'home')).toBeDefined();
|
|
249
|
+
expect(
|
|
250
|
+
findInTree(n => n.viewName === 'RCTRawText' && n.props.text === '2 routes, focused index 0'),
|
|
251
|
+
).toBeDefined();
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
// Regression test: focusedRouteEmitter() runs as a TEMPLATE EXPRESSION
|
|
255
|
+
// ([emitter]="focusedRouteEmitter()"), inside Angular's reactive-read tracking context for the
|
|
256
|
+
// current CD pass. It synchronously calls emitter.emit(FOCUS/BLUR), fan-out-calling every
|
|
257
|
+
// listener on that route's emitter synchronously too - including injectIsFocused()'s
|
|
258
|
+
// `isFocused.set(...)`, since every real screen calls injectIsFocused(). Angular throws NG600
|
|
259
|
+
// ("signal write during a template execution") the instant that set() runs inside a tracked
|
|
260
|
+
// read. jumpTo() is exactly what tapping a drawer menu item fires. tabs.ts's
|
|
261
|
+
// focusedRouteEmitter() has the identical shape and its own regression test in tabs.test.ts.
|
|
262
|
+
it('switching the focused screen does not throw when it calls injectIsFocused()', async () => {
|
|
263
|
+
const handle = await mountDrawer();
|
|
264
|
+
const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
|
|
265
|
+
try {
|
|
266
|
+
handle.jumpTo('Settings');
|
|
267
|
+
await tick();
|
|
268
|
+
handle.jumpTo('Home');
|
|
269
|
+
await tick();
|
|
270
|
+
} finally {
|
|
271
|
+
expect(errorSpy).not.toHaveBeenCalled();
|
|
272
|
+
errorSpy.mockRestore();
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// injectIsFocused() reads context.emitter at CALL time (during the screen's own constructor),
|
|
277
|
+
// which runs as part of *ngComponentOutlet creating the screen - nested INSIDE the same
|
|
278
|
+
// <ng-container [emitter]="focusedRouteEmitter()"> whose input evaluation is what actually
|
|
279
|
+
// fires the FOCUS emit. If Angular evaluates the ng-container's OWN inputs (calling
|
|
280
|
+
// focusedRouteEmitter(), firing FOCUS) before creating/refreshing the nested ngComponentOutlet
|
|
281
|
+
// child (running the screen's constructor, registering the injectIsFocused() listener), the
|
|
282
|
+
// FOCUS event fires to zero listeners and is lost forever - isFocused stays false permanently.
|
|
283
|
+
it('the initially-focused screen actually observes isFocused() becoming true', async () => {
|
|
284
|
+
await mountDrawer();
|
|
285
|
+
await tick();
|
|
286
|
+
expect(capturedHomeInstance).toBeDefined();
|
|
287
|
+
expect(capturedHomeInstance?.isFocused()).toBe(true);
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it('switching screens toggles isFocused() true/false on the exiting/entering screens', async () => {
|
|
291
|
+
const handle = await mountDrawer();
|
|
292
|
+
await tick();
|
|
293
|
+
handle.jumpTo('Settings');
|
|
294
|
+
await tick();
|
|
295
|
+
expect(capturedHomeInstance?.isFocused()).toBe(false);
|
|
296
|
+
expect(capturedSettingsInstance).toBeDefined();
|
|
297
|
+
expect(capturedSettingsInstance?.isFocused()).toBe(true);
|
|
298
|
+
});
|
|
299
|
+
});
|