@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.
Files changed (455) hide show
  1. package/LICENSE +21 -0
  2. package/build/angular/drawer/index.d.ts +76 -0
  3. package/build/angular/drawer/index.js +508 -0
  4. package/build/angular/drawer-screen.directive.d.ts +14 -0
  5. package/build/angular/drawer-screen.directive.js +87 -0
  6. package/build/angular/index.d.ts +23 -0
  7. package/build/angular/index.js +22 -0
  8. package/build/angular/injectors/index.d.ts +13 -0
  9. package/build/angular/injectors/index.js +8 -0
  10. package/build/angular/injectors/inject-drawer-navigation.d.ts +4 -0
  11. package/build/angular/injectors/inject-drawer-navigation.js +12 -0
  12. package/build/angular/injectors/inject-focus-effect.d.ts +2 -0
  13. package/build/angular/injectors/inject-focus-effect.js +29 -0
  14. package/build/angular/injectors/inject-is-focused.d.ts +2 -0
  15. package/build/angular/injectors/inject-is-focused.js +20 -0
  16. package/build/angular/injectors/inject-navigation-state.d.ts +3 -0
  17. package/build/angular/injectors/inject-navigation-state.js +35 -0
  18. package/build/angular/injectors/inject-navigation.d.ts +7 -0
  19. package/build/angular/injectors/inject-navigation.js +16 -0
  20. package/build/angular/injectors/inject-route.d.ts +3 -0
  21. package/build/angular/injectors/inject-route.js +20 -0
  22. package/build/angular/injectors/inject-stack-navigation.d.ts +4 -0
  23. package/build/angular/injectors/inject-stack-navigation.js +15 -0
  24. package/build/angular/injectors/inject-tab-navigation.d.ts +4 -0
  25. package/build/angular/injectors/inject-tab-navigation.js +11 -0
  26. package/build/angular/linking.d.ts +3 -0
  27. package/build/angular/linking.js +43 -0
  28. package/build/angular/navigation-context.service.d.ts +13 -0
  29. package/build/angular/navigation-context.service.js +105 -0
  30. package/build/angular/navigation-scope.directive.d.ts +10 -0
  31. package/build/angular/navigation-scope.directive.js +90 -0
  32. package/build/angular/screen.directive.d.ts +22 -0
  33. package/build/angular/screen.directive.js +90 -0
  34. package/build/angular/search-bar-ref.directive.d.ts +10 -0
  35. package/build/angular/search-bar-ref.directive.js +88 -0
  36. package/build/angular/stack/index.d.ts +55 -0
  37. package/build/angular/stack/index.js +386 -0
  38. package/build/angular/tab-screen.directive.d.ts +14 -0
  39. package/build/angular/tab-screen.directive.js +87 -0
  40. package/build/angular/tabs/index.d.ts +42 -0
  41. package/build/angular/tabs/index.js +263 -0
  42. package/build/core/constants.d.ts +27 -0
  43. package/build/core/constants.js +61 -0
  44. package/build/core/drawer-options/index.d.ts +64 -0
  45. package/build/core/drawer-options/index.js +200 -0
  46. package/build/core/drawer-router-state/index.d.ts +21 -0
  47. package/build/core/drawer-router-state/index.js +40 -0
  48. package/build/core/guards.d.ts +2 -0
  49. package/build/core/guards.js +22 -0
  50. package/build/core/header-bar-buttons.d.ts +9 -0
  51. package/build/core/header-bar-buttons.js +163 -0
  52. package/build/core/index.d.ts +29 -0
  53. package/build/core/index.js +32 -0
  54. package/build/core/linking-config/index.d.ts +13 -0
  55. package/build/core/linking-config/index.js +171 -0
  56. package/build/core/navigation-events/index.d.ts +16 -0
  57. package/build/core/navigation-events/index.js +57 -0
  58. package/build/core/navigator-handles/index.d.ts +30 -0
  59. package/build/core/navigator-handles/index.js +15 -0
  60. package/build/core/navigator-props.d.ts +216 -0
  61. package/build/core/navigator-props.js +7 -0
  62. package/build/core/navigator-state/index.d.ts +36 -0
  63. package/build/core/navigator-state/index.js +81 -0
  64. package/build/core/render-drawer.d.ts +13 -0
  65. package/build/core/render-drawer.js +88 -0
  66. package/build/core/render-stack.d.ts +35 -0
  67. package/build/core/render-stack.js +294 -0
  68. package/build/core/render-tabs.d.ts +20 -0
  69. package/build/core/render-tabs.js +97 -0
  70. package/build/core/screen-options.d.ts +4 -0
  71. package/build/core/screen-options.js +133 -0
  72. package/build/core/search-bar-commands.d.ts +10 -0
  73. package/build/core/search-bar-commands.js +42 -0
  74. package/build/core/state-persistence/index.d.ts +3 -0
  75. package/build/core/state-persistence/index.js +23 -0
  76. package/build/core/tab-options.d.ts +13 -0
  77. package/build/core/tab-options.js +10 -0
  78. package/build/core/tab-router-state/index.d.ts +19 -0
  79. package/build/core/tab-router-state/index.js +51 -0
  80. package/build/react/collect-registry.d.ts +4 -0
  81. package/build/react/collect-registry.js +15 -0
  82. package/build/react/drawer/index.d.ts +29 -0
  83. package/build/react/drawer/index.js +277 -0
  84. package/build/react/drawer-screen.d.ts +14 -0
  85. package/build/react/drawer-screen.js +8 -0
  86. package/build/react/hooks/index.d.ts +12 -0
  87. package/build/react/hooks/index.js +8 -0
  88. package/build/react/hooks/use-drawer-navigation.d.ts +4 -0
  89. package/build/react/hooks/use-drawer-navigation.js +12 -0
  90. package/build/react/hooks/use-focus-effect.d.ts +2 -0
  91. package/build/react/hooks/use-focus-effect.js +29 -0
  92. package/build/react/hooks/use-is-focused.d.ts +1 -0
  93. package/build/react/hooks/use-is-focused.js +22 -0
  94. package/build/react/hooks/use-navigation-state/index.d.ts +2 -0
  95. package/build/react/hooks/use-navigation-state/index.js +39 -0
  96. package/build/react/hooks/use-navigation.d.ts +7 -0
  97. package/build/react/hooks/use-navigation.js +16 -0
  98. package/build/react/hooks/use-route.d.ts +2 -0
  99. package/build/react/hooks/use-route.js +8 -0
  100. package/build/react/hooks/use-stack-navigation.d.ts +4 -0
  101. package/build/react/hooks/use-stack-navigation.js +14 -0
  102. package/build/react/hooks/use-tab-navigation.d.ts +4 -0
  103. package/build/react/hooks/use-tab-navigation.js +12 -0
  104. package/build/react/index.d.ts +24 -0
  105. package/build/react/index.js +21 -0
  106. package/build/react/linking.d.ts +3 -0
  107. package/build/react/linking.js +47 -0
  108. package/build/react/navigation-context.d.ts +10 -0
  109. package/build/react/navigation-context.js +22 -0
  110. package/build/react/screen.d.ts +22 -0
  111. package/build/react/screen.js +7 -0
  112. package/build/react/stack/index.d.ts +13 -0
  113. package/build/react/stack/index.js +202 -0
  114. package/build/react/tab-screen.d.ts +15 -0
  115. package/build/react/tab-screen.js +8 -0
  116. package/build/react/tabs/index.d.ts +12 -0
  117. package/build/react/tabs/index.js +116 -0
  118. package/build/register.d.ts +7 -0
  119. package/build/register.js +58 -0
  120. package/build/vue/composables/index.d.ts +12 -0
  121. package/build/vue/composables/index.js +8 -0
  122. package/build/vue/composables/use-drawer-navigation.d.ts +5 -0
  123. package/build/vue/composables/use-drawer-navigation.js +15 -0
  124. package/build/vue/composables/use-focus-effect.d.ts +1 -0
  125. package/build/vue/composables/use-focus-effect.js +31 -0
  126. package/build/vue/composables/use-is-focused.d.ts +2 -0
  127. package/build/vue/composables/use-is-focused.js +28 -0
  128. package/build/vue/composables/use-navigation-state.d.ts +3 -0
  129. package/build/vue/composables/use-navigation-state.js +29 -0
  130. package/build/vue/composables/use-navigation.d.ts +8 -0
  131. package/build/vue/composables/use-navigation.js +13 -0
  132. package/build/vue/composables/use-route.d.ts +3 -0
  133. package/build/vue/composables/use-route.js +9 -0
  134. package/build/vue/composables/use-stack-navigation.d.ts +5 -0
  135. package/build/vue/composables/use-stack-navigation.js +18 -0
  136. package/build/vue/composables/use-tab-navigation.d.ts +5 -0
  137. package/build/vue/composables/use-tab-navigation.js +15 -0
  138. package/build/vue/drawer/index.d.ts +19 -0
  139. package/build/vue/drawer/index.js +390 -0
  140. package/build/vue/drawer-screen.d.ts +14 -0
  141. package/build/vue/drawer-screen.js +12 -0
  142. package/build/vue/index.d.ts +21 -0
  143. package/build/vue/index.js +19 -0
  144. package/build/vue/linking.d.ts +3 -0
  145. package/build/vue/linking.js +57 -0
  146. package/build/vue/navigation-context.d.ts +16 -0
  147. package/build/vue/navigation-context.js +65 -0
  148. package/build/vue/screen.d.ts +21 -0
  149. package/build/vue/screen.js +12 -0
  150. package/build/vue/stack/index.d.ts +9 -0
  151. package/build/vue/stack/index.js +279 -0
  152. package/build/vue/tab-screen.d.ts +14 -0
  153. package/build/vue/tab-screen.js +11 -0
  154. package/build/vue/tabs/index.d.ts +10 -0
  155. package/build/vue/tabs/index.js +209 -0
  156. package/build-ngc/angular/drawer/index.d.ts +79 -0
  157. package/build-ngc/angular/drawer/index.js +479 -0
  158. package/build-ngc/angular/drawer/index.js.map +1 -0
  159. package/build-ngc/angular/drawer-screen.directive.d.ts +17 -0
  160. package/build-ngc/angular/drawer-screen.directive.js +32 -0
  161. package/build-ngc/angular/drawer-screen.directive.js.map +1 -0
  162. package/build-ngc/angular/drawer.d.ts +79 -0
  163. package/build-ngc/angular/drawer.js +475 -0
  164. package/build-ngc/angular/drawer.js.map +1 -0
  165. package/build-ngc/angular/index.d.ts +23 -0
  166. package/build-ngc/angular/index.js +23 -0
  167. package/build-ngc/angular/index.js.map +1 -0
  168. package/build-ngc/angular/injectors/index.d.ts +13 -0
  169. package/build-ngc/angular/injectors/index.js +9 -0
  170. package/build-ngc/angular/injectors/index.js.map +1 -0
  171. package/build-ngc/angular/injectors/inject-drawer-navigation.d.ts +4 -0
  172. package/build-ngc/angular/injectors/inject-drawer-navigation.js +13 -0
  173. package/build-ngc/angular/injectors/inject-drawer-navigation.js.map +1 -0
  174. package/build-ngc/angular/injectors/inject-focus-effect.d.ts +2 -0
  175. package/build-ngc/angular/injectors/inject-focus-effect.js +30 -0
  176. package/build-ngc/angular/injectors/inject-focus-effect.js.map +1 -0
  177. package/build-ngc/angular/injectors/inject-is-focused.d.ts +2 -0
  178. package/build-ngc/angular/injectors/inject-is-focused.js +22 -0
  179. package/build-ngc/angular/injectors/inject-is-focused.js.map +1 -0
  180. package/build-ngc/angular/injectors/inject-navigation-state.d.ts +3 -0
  181. package/build-ngc/angular/injectors/inject-navigation-state.js +37 -0
  182. package/build-ngc/angular/injectors/inject-navigation-state.js.map +1 -0
  183. package/build-ngc/angular/injectors/inject-navigation.d.ts +7 -0
  184. package/build-ngc/angular/injectors/inject-navigation.js +17 -0
  185. package/build-ngc/angular/injectors/inject-navigation.js.map +1 -0
  186. package/build-ngc/angular/injectors/inject-route.d.ts +3 -0
  187. package/build-ngc/angular/injectors/inject-route.js +21 -0
  188. package/build-ngc/angular/injectors/inject-route.js.map +1 -0
  189. package/build-ngc/angular/injectors/inject-stack-navigation.d.ts +4 -0
  190. package/build-ngc/angular/injectors/inject-stack-navigation.js +16 -0
  191. package/build-ngc/angular/injectors/inject-stack-navigation.js.map +1 -0
  192. package/build-ngc/angular/injectors/inject-tab-navigation.d.ts +4 -0
  193. package/build-ngc/angular/injectors/inject-tab-navigation.js +12 -0
  194. package/build-ngc/angular/injectors/inject-tab-navigation.js.map +1 -0
  195. package/build-ngc/angular/linking.d.ts +3 -0
  196. package/build-ngc/angular/linking.js +44 -0
  197. package/build-ngc/angular/linking.js.map +1 -0
  198. package/build-ngc/angular/navigation-context.service.d.ts +16 -0
  199. package/build-ngc/angular/navigation-context.service.js +63 -0
  200. package/build-ngc/angular/navigation-context.service.js.map +1 -0
  201. package/build-ngc/angular/navigation-scope.directive.d.ts +13 -0
  202. package/build-ngc/angular/navigation-scope.directive.js +42 -0
  203. package/build-ngc/angular/navigation-scope.directive.js.map +1 -0
  204. package/build-ngc/angular/screen.directive.d.ts +25 -0
  205. package/build-ngc/angular/screen.directive.js +35 -0
  206. package/build-ngc/angular/screen.directive.js.map +1 -0
  207. package/build-ngc/angular/search-bar-ref.directive.d.ts +13 -0
  208. package/build-ngc/angular/search-bar-ref.directive.js +44 -0
  209. package/build-ngc/angular/search-bar-ref.directive.js.map +1 -0
  210. package/build-ngc/angular/stack/index.d.ts +58 -0
  211. package/build-ngc/angular/stack/index.js +406 -0
  212. package/build-ngc/angular/stack/index.js.map +1 -0
  213. package/build-ngc/angular/stack.d.ts +58 -0
  214. package/build-ngc/angular/stack.js +402 -0
  215. package/build-ngc/angular/stack.js.map +1 -0
  216. package/build-ngc/angular/tab-screen.directive.d.ts +17 -0
  217. package/build-ngc/angular/tab-screen.directive.js +32 -0
  218. package/build-ngc/angular/tab-screen.directive.js.map +1 -0
  219. package/build-ngc/angular/tabs/index.d.ts +45 -0
  220. package/build-ngc/angular/tabs/index.js +231 -0
  221. package/build-ngc/angular/tabs/index.js.map +1 -0
  222. package/build-ngc/angular/tabs.d.ts +45 -0
  223. package/build-ngc/angular/tabs.js +231 -0
  224. package/build-ngc/angular/tabs.js.map +1 -0
  225. package/build-ngc/core/constants.d.ts +27 -0
  226. package/build-ngc/core/constants.js +62 -0
  227. package/build-ngc/core/constants.js.map +1 -0
  228. package/build-ngc/core/drawer-options/index.d.ts +64 -0
  229. package/build-ngc/core/drawer-options/index.js +201 -0
  230. package/build-ngc/core/drawer-options/index.js.map +1 -0
  231. package/build-ngc/core/drawer-options.d.ts +64 -0
  232. package/build-ngc/core/drawer-options.js +201 -0
  233. package/build-ngc/core/drawer-options.js.map +1 -0
  234. package/build-ngc/core/drawer-router-state/index.d.ts +21 -0
  235. package/build-ngc/core/drawer-router-state/index.js +41 -0
  236. package/build-ngc/core/drawer-router-state/index.js.map +1 -0
  237. package/build-ngc/core/drawer-router-state.d.ts +21 -0
  238. package/build-ngc/core/drawer-router-state.js +41 -0
  239. package/build-ngc/core/drawer-router-state.js.map +1 -0
  240. package/build-ngc/core/guards.d.ts +2 -0
  241. package/build-ngc/core/guards.js +23 -0
  242. package/build-ngc/core/guards.js.map +1 -0
  243. package/build-ngc/core/header-bar-buttons.d.ts +9 -0
  244. package/build-ngc/core/header-bar-buttons.js +164 -0
  245. package/build-ngc/core/header-bar-buttons.js.map +1 -0
  246. package/build-ngc/core/href.d.ts +16 -0
  247. package/build-ngc/core/href.js +55 -0
  248. package/build-ngc/core/href.js.map +1 -0
  249. package/build-ngc/core/index.d.ts +29 -0
  250. package/build-ngc/core/index.js +33 -0
  251. package/build-ngc/core/index.js.map +1 -0
  252. package/build-ngc/core/linking-config/index.d.ts +13 -0
  253. package/build-ngc/core/linking-config/index.js +172 -0
  254. package/build-ngc/core/linking-config/index.js.map +1 -0
  255. package/build-ngc/core/linking-config.d.ts +13 -0
  256. package/build-ngc/core/linking-config.js +172 -0
  257. package/build-ngc/core/linking-config.js.map +1 -0
  258. package/build-ngc/core/navigation-events/index.d.ts +16 -0
  259. package/build-ngc/core/navigation-events/index.js +58 -0
  260. package/build-ngc/core/navigation-events/index.js.map +1 -0
  261. package/build-ngc/core/navigation-events.d.ts +16 -0
  262. package/build-ngc/core/navigation-events.js +58 -0
  263. package/build-ngc/core/navigation-events.js.map +1 -0
  264. package/build-ngc/core/navigator-handles/index.d.ts +30 -0
  265. package/build-ngc/core/navigator-handles/index.js +16 -0
  266. package/build-ngc/core/navigator-handles/index.js.map +1 -0
  267. package/build-ngc/core/navigator-handles.d.ts +30 -0
  268. package/build-ngc/core/navigator-handles.js +16 -0
  269. package/build-ngc/core/navigator-handles.js.map +1 -0
  270. package/build-ngc/core/navigator-props.d.ts +216 -0
  271. package/build-ngc/core/navigator-props.js +8 -0
  272. package/build-ngc/core/navigator-props.js.map +1 -0
  273. package/build-ngc/core/navigator-state/index.d.ts +36 -0
  274. package/build-ngc/core/navigator-state/index.js +82 -0
  275. package/build-ngc/core/navigator-state/index.js.map +1 -0
  276. package/build-ngc/core/navigator-state.d.ts +36 -0
  277. package/build-ngc/core/navigator-state.js +82 -0
  278. package/build-ngc/core/navigator-state.js.map +1 -0
  279. package/build-ngc/core/render-drawer.d.ts +13 -0
  280. package/build-ngc/core/render-drawer.js +89 -0
  281. package/build-ngc/core/render-drawer.js.map +1 -0
  282. package/build-ngc/core/render-stack.d.ts +35 -0
  283. package/build-ngc/core/render-stack.js +295 -0
  284. package/build-ngc/core/render-stack.js.map +1 -0
  285. package/build-ngc/core/render-tabs.d.ts +20 -0
  286. package/build-ngc/core/render-tabs.js +98 -0
  287. package/build-ngc/core/render-tabs.js.map +1 -0
  288. package/build-ngc/core/screen-options.d.ts +4 -0
  289. package/build-ngc/core/screen-options.js +134 -0
  290. package/build-ngc/core/screen-options.js.map +1 -0
  291. package/build-ngc/core/search-bar-commands.d.ts +10 -0
  292. package/build-ngc/core/search-bar-commands.js +43 -0
  293. package/build-ngc/core/search-bar-commands.js.map +1 -0
  294. package/build-ngc/core/search-params.d.ts +9 -0
  295. package/build-ngc/core/search-params.js +60 -0
  296. package/build-ngc/core/search-params.js.map +1 -0
  297. package/build-ngc/core/state-persistence/index.d.ts +3 -0
  298. package/build-ngc/core/state-persistence/index.js +24 -0
  299. package/build-ngc/core/state-persistence/index.js.map +1 -0
  300. package/build-ngc/core/state-persistence.d.ts +3 -0
  301. package/build-ngc/core/state-persistence.js +24 -0
  302. package/build-ngc/core/state-persistence.js.map +1 -0
  303. package/build-ngc/core/tab-options.d.ts +13 -0
  304. package/build-ngc/core/tab-options.js +11 -0
  305. package/build-ngc/core/tab-options.js.map +1 -0
  306. package/build-ngc/core/tab-router-state/index.d.ts +19 -0
  307. package/build-ngc/core/tab-router-state/index.js +52 -0
  308. package/build-ngc/core/tab-router-state/index.js.map +1 -0
  309. package/build-ngc/core/tab-router-state.d.ts +19 -0
  310. package/build-ngc/core/tab-router-state.js +52 -0
  311. package/build-ngc/core/tab-router-state.js.map +1 -0
  312. package/build-ngc/register.d.ts +7 -0
  313. package/build-ngc/register.js +59 -0
  314. package/build-ngc/register.js.map +1 -0
  315. package/codegen-specs/FullWindowOverlayNativeComponent.ts +13 -0
  316. package/codegen-specs/ModalScreenNativeComponent.ts +129 -0
  317. package/codegen-specs/NativeScreensModule.ts +8 -0
  318. package/codegen-specs/NativeScreensModule.web.ts +1 -0
  319. package/codegen-specs/ScreenContainerNativeComponent.ts +8 -0
  320. package/codegen-specs/ScreenContentWrapperNativeComponent.ts +9 -0
  321. package/codegen-specs/ScreenFooterNativeComponent.ts +6 -0
  322. package/codegen-specs/ScreenNativeComponent.ts +133 -0
  323. package/codegen-specs/ScreenNavigationContainerNativeComponent.ts +11 -0
  324. package/codegen-specs/ScreenStackHeaderConfigNativeComponent.ts +99 -0
  325. package/codegen-specs/ScreenStackHeaderSubviewNativeComponent.ts +25 -0
  326. package/codegen-specs/ScreenStackNativeComponent.ts +17 -0
  327. package/codegen-specs/SearchBarNativeComponent.ts +101 -0
  328. package/codegen-specs/codegenUtils.ts +6 -0
  329. package/codegen-specs/gamma/ScrollViewMarkerNativeComponent.ts +15 -0
  330. package/codegen-specs/gamma/modals/form-sheet/FormSheetContentWrapperNativeComponent.ts +10 -0
  331. package/codegen-specs/gamma/modals/form-sheet/FormSheetHostNativeComponent.ts +47 -0
  332. package/codegen-specs/gamma/split/SplitHostNativeComponent.ts +124 -0
  333. package/codegen-specs/gamma/split/SplitScreenNativeComponent.ts +24 -0
  334. package/codegen-specs/gamma/stack/StackHeaderConfigAndroidNativeComponent.ts +144 -0
  335. package/codegen-specs/gamma/stack/StackHeaderConfigIOSNativeComponent.ts +34 -0
  336. package/codegen-specs/gamma/stack/StackHeaderItemIOSNativeComponent.ts +47 -0
  337. package/codegen-specs/gamma/stack/StackHeaderItemSpacerIOSNativeComponent.ts +20 -0
  338. package/codegen-specs/gamma/stack/StackHeaderSubviewAndroidNativeComponent.ts +27 -0
  339. package/codegen-specs/gamma/stack/StackHostNativeComponent.ts +8 -0
  340. package/codegen-specs/gamma/stack/StackScreenNativeComponent.ts +42 -0
  341. package/codegen-specs/safe-area/SafeAreaViewNativeComponent.ts +24 -0
  342. package/codegen-specs/tabs/TabsBottomAccessoryContentNativeComponent.ts +15 -0
  343. package/codegen-specs/tabs/TabsBottomAccessoryNativeComponent.ts +19 -0
  344. package/codegen-specs/tabs/TabsHostAndroidNativeComponent.ts +69 -0
  345. package/codegen-specs/tabs/TabsHostIOSNativeComponent.ts +92 -0
  346. package/codegen-specs/tabs/TabsScreenAndroidNativeComponent.ts +112 -0
  347. package/codegen-specs/tabs/TabsScreenIOSNativeComponent.ts +171 -0
  348. package/package.json +201 -0
  349. package/react-native.config.cjs +58 -0
  350. package/src/angular/drawer/drawer.test.ts +299 -0
  351. package/src/angular/drawer/index.ts +546 -0
  352. package/src/angular/drawer-screen.directive.ts +28 -0
  353. package/src/angular/index.ts +63 -0
  354. package/src/angular/injectors/index.ts +13 -0
  355. package/src/angular/injectors/inject-drawer-navigation.ts +21 -0
  356. package/src/angular/injectors/inject-focus-effect.ts +37 -0
  357. package/src/angular/injectors/inject-is-focused.ts +28 -0
  358. package/src/angular/injectors/inject-navigation-state.ts +46 -0
  359. package/src/angular/injectors/inject-navigation.ts +26 -0
  360. package/src/angular/injectors/inject-route.ts +25 -0
  361. package/src/angular/injectors/inject-stack-navigation.ts +24 -0
  362. package/src/angular/injectors/inject-tab-navigation.ts +20 -0
  363. package/src/angular/injectors/injectors.test.ts +247 -0
  364. package/src/angular/injectors/use-typed-navigation.test.ts +229 -0
  365. package/src/angular/linking.ts +55 -0
  366. package/src/angular/navigation-context.service.ts +68 -0
  367. package/src/angular/navigation-scope.directive.ts +31 -0
  368. package/src/angular/nested-navigation.test.ts +189 -0
  369. package/src/angular/screen.directive.ts +48 -0
  370. package/src/angular/search-bar-ref.directive.ts +38 -0
  371. package/src/angular/stack/index.ts +401 -0
  372. package/src/angular/stack/stack.test.ts +419 -0
  373. package/src/angular/tab-screen.directive.ts +26 -0
  374. package/src/angular/tabs/index.ts +254 -0
  375. package/src/angular/tabs/tabs.test.ts +249 -0
  376. package/src/core/constants.ts +68 -0
  377. package/src/core/drawer-options/drawer-options.test.ts +415 -0
  378. package/src/core/drawer-options/index.ts +331 -0
  379. package/src/core/drawer-router-state/drawer-router-state.test.ts +116 -0
  380. package/src/core/drawer-router-state/index.ts +71 -0
  381. package/src/core/guards.ts +23 -0
  382. package/src/core/header-bar-buttons.ts +212 -0
  383. package/src/core/index.ts +170 -0
  384. package/src/core/linking-config/index.ts +209 -0
  385. package/src/core/linking-config/linking-config.test.ts +109 -0
  386. package/src/core/navigation-events/index.ts +94 -0
  387. package/src/core/navigation-events/navigation-events.test.ts +56 -0
  388. package/src/core/navigator-handles/index.ts +63 -0
  389. package/src/core/navigator-handles/navigator-handles.test.ts +46 -0
  390. package/src/core/navigator-props.ts +323 -0
  391. package/src/core/navigator-state/index.ts +112 -0
  392. package/src/core/navigator-state/navigator-state.test.ts +80 -0
  393. package/src/core/render-drawer.ts +123 -0
  394. package/src/core/render-stack.ts +414 -0
  395. package/src/core/render-tabs.ts +138 -0
  396. package/src/core/screen-options.ts +181 -0
  397. package/src/core/search-bar-commands.ts +57 -0
  398. package/src/core/state-persistence/index.ts +30 -0
  399. package/src/core/state-persistence/state-persistence.test.ts +42 -0
  400. package/src/core/tab-options.ts +25 -0
  401. package/src/core/tab-router-state/index.ts +75 -0
  402. package/src/core/tab-router-state/tab-router-state.test.ts +34 -0
  403. package/src/globals.d.ts +4 -0
  404. package/src/react/collect-registry.ts +19 -0
  405. package/src/react/drawer/drawer.test.tsx +472 -0
  406. package/src/react/drawer/index.ts +451 -0
  407. package/src/react/drawer-screen.ts +29 -0
  408. package/src/react/hooks/hooks.test.tsx +199 -0
  409. package/src/react/hooks/index.ts +12 -0
  410. package/src/react/hooks/use-drawer-navigation.ts +21 -0
  411. package/src/react/hooks/use-focus-effect.ts +36 -0
  412. package/src/react/hooks/use-is-focused.ts +26 -0
  413. package/src/react/hooks/use-navigation-state/index.ts +47 -0
  414. package/src/react/hooks/use-navigation-state/use-navigation-state.test.ts +85 -0
  415. package/src/react/hooks/use-navigation.ts +36 -0
  416. package/src/react/hooks/use-route.ts +11 -0
  417. package/src/react/hooks/use-stack-navigation.ts +23 -0
  418. package/src/react/hooks/use-tab-navigation.ts +21 -0
  419. package/src/react/hooks/use-typed-navigation.test.tsx +187 -0
  420. package/src/react/index.ts +52 -0
  421. package/src/react/linking.ts +59 -0
  422. package/src/react/navigation-context.ts +40 -0
  423. package/src/react/nested-navigation.test.tsx +145 -0
  424. package/src/react/screen.ts +44 -0
  425. package/src/react/stack/index.ts +323 -0
  426. package/src/react/stack/stack.test.tsx +514 -0
  427. package/src/react/tab-screen.ts +30 -0
  428. package/src/react/tabs/index.ts +204 -0
  429. package/src/react/tabs/tabs.test.tsx +256 -0
  430. package/src/register.ts +59 -0
  431. package/src/vue/composables/composables.test.ts +221 -0
  432. package/src/vue/composables/index.ts +12 -0
  433. package/src/vue/composables/use-drawer-navigation.ts +25 -0
  434. package/src/vue/composables/use-focus-effect.ts +37 -0
  435. package/src/vue/composables/use-is-focused.ts +34 -0
  436. package/src/vue/composables/use-navigation-state.ts +38 -0
  437. package/src/vue/composables/use-navigation.ts +30 -0
  438. package/src/vue/composables/use-route.ts +13 -0
  439. package/src/vue/composables/use-stack-navigation.ts +28 -0
  440. package/src/vue/composables/use-tab-navigation.ts +25 -0
  441. package/src/vue/composables/use-typed-navigation.test.ts +205 -0
  442. package/src/vue/drawer/drawer.test.ts +451 -0
  443. package/src/vue/drawer/index.ts +550 -0
  444. package/src/vue/drawer-screen.ts +32 -0
  445. package/src/vue/index.ts +70 -0
  446. package/src/vue/linking.ts +69 -0
  447. package/src/vue/navigation-context.ts +87 -0
  448. package/src/vue/nested-navigation.test.ts +155 -0
  449. package/src/vue/screen.ts +52 -0
  450. package/src/vue/stack/index.ts +376 -0
  451. package/src/vue/stack/stack.test.ts +501 -0
  452. package/src/vue/tab-screen.ts +29 -0
  453. package/src/vue/tabs/index.ts +302 -0
  454. package/src/vue/tabs/tabs.test.ts +278 -0
  455. package/symbiote-navigation.podspec +84 -0
@@ -0,0 +1,501 @@
1
+ // Co-located Vue-driven pipeline test, the Vue twin of react/stack.test.tsx. Proves the shared
2
+ // core drives Vue correctly against an INJECTED codegen-shaped ViewConfig: push/pop mount and
3
+ // unmount RNSScreen children with the right activityState, the header title reaches
4
+ // RNSScreenStackHeaderConfig, and the native onDismissed/onHeaderBackButtonClicked events drive a
5
+ // pop through the imperative handle. Stack is imported from './index' (NOT the package barrel,
6
+ // '.') so the third-party native-spec side-effect (../register) never loads headless.
7
+
8
+ import { defineComponent, h, ref } from '@vue/runtime-core';
9
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
10
+ import { mount, unmount, setNativeViewConfigSource } from '@symbiote-native/vue';
11
+ import type { INativeViewConfig } from '@symbiote-native/engine';
12
+ import { installFabric, type IFakeNode } from '@symbiote-native/test-utils';
13
+ import { Stack } from './index';
14
+ import type { INavigatorHandle } from './index';
15
+ import { useRoute } from '../composables';
16
+ import type { INavigatorState, ISearchBarCommands } from '../../core';
17
+
18
+ const ROOT_TAG = 4512;
19
+ const SCREEN_VIEW = 'RNSScreen';
20
+ const STACK_VIEW = 'RNSScreenStack';
21
+ const HEADER_CONFIG_VIEW = 'RNSScreenStackHeaderConfig';
22
+ const HEADER_SUBVIEW_VIEW = 'RNSScreenStackHeaderSubview';
23
+ const SEARCH_BAR_VIEW = 'RNSSearchBar';
24
+
25
+ function directEvent(registrationName: string) {
26
+ return { registrationName };
27
+ }
28
+
29
+ const RNS_SCREEN_VIEW_CONFIG = {
30
+ directEventTypes: {
31
+ topAppear: directEvent('onAppear'),
32
+ topDisappear: directEvent('onDisappear'),
33
+ topWillAppear: directEvent('onWillAppear'),
34
+ topWillDisappear: directEvent('onWillDisappear'),
35
+ topDismissed: directEvent('onDismissed'),
36
+ topHeaderBackButtonClicked: directEvent('onHeaderBackButtonClicked'),
37
+ },
38
+ validAttributes: {
39
+ screenId: true,
40
+ activityState: true,
41
+ gestureEnabled: true,
42
+ stackAnimation: true,
43
+ stackPresentation: true,
44
+ transitionDuration: true,
45
+ },
46
+ };
47
+
48
+ const RNS_SCREEN_STACK_VIEW_CONFIG = {
49
+ directEventTypes: { topFinishTransitioning: directEvent('onFinishTransitioning') },
50
+ validAttributes: {},
51
+ };
52
+
53
+ const RNS_HEADER_CONFIG_VIEW_CONFIG = {
54
+ directEventTypes: { topPressHeaderBarButtonItem: directEvent('onPressHeaderBarButtonItem') },
55
+ validAttributes: { title: true, hidden: true, backTitle: true, backTitleVisible: true },
56
+ };
57
+
58
+ const RNS_SEARCH_BAR_VIEW_CONFIG = {
59
+ directEventTypes: {
60
+ topSearchFocus: directEvent('onSearchFocus'),
61
+ topSearchBlur: directEvent('onSearchBlur'),
62
+ topChangeText: directEvent('onChangeText'),
63
+ topSearchButtonPress: directEvent('onSearchButtonPress'),
64
+ topCancelButtonPress: directEvent('onCancelButtonPress'),
65
+ topClose: directEvent('onClose'),
66
+ topOpen: directEvent('onOpen'),
67
+ },
68
+ validAttributes: { placeholder: true },
69
+ };
70
+
71
+ const VIEW_CONFIGS: Record<string, INativeViewConfig> = {
72
+ [SCREEN_VIEW]: RNS_SCREEN_VIEW_CONFIG,
73
+ [STACK_VIEW]: RNS_SCREEN_STACK_VIEW_CONFIG,
74
+ [HEADER_CONFIG_VIEW]: RNS_HEADER_CONFIG_VIEW_CONFIG,
75
+ [SEARCH_BAR_VIEW]: RNS_SEARCH_BAR_VIEW_CONFIG,
76
+ };
77
+
78
+ const fabric = installFabric();
79
+ setNativeViewConfigSource(name => VIEW_CONFIGS[name]);
80
+
81
+ const tick = (): Promise<void> => new Promise(resolve => setTimeout(resolve, 0));
82
+
83
+ beforeEach(() => fabric.reset());
84
+ afterEach(() => unmount(ROOT_TAG));
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 child = findInTree(predicate, node.children);
93
+ if (child) return child;
94
+ }
95
+ return undefined;
96
+ }
97
+
98
+ function screenNodes(): IFakeNode[] {
99
+ const found: IFakeNode[] = [];
100
+ const collect = (nodes: readonly IFakeNode[]): void => {
101
+ for (const node of nodes) {
102
+ if (node.viewName === SCREEN_VIEW) found.push(node);
103
+ collect(node.children);
104
+ }
105
+ };
106
+ collect(fabric.committed);
107
+ return found;
108
+ }
109
+
110
+ function headerConfigOf(screen: IFakeNode): IFakeNode {
111
+ const header = screen.children.find(child => child.viewName === HEADER_CONFIG_VIEW);
112
+ if (!header) throw new Error('no header config child on screen');
113
+ return header;
114
+ }
115
+
116
+ function HomeScreen() {
117
+ return h('symbiote-text', {}, 'home');
118
+ }
119
+
120
+ function DetailsScreen() {
121
+ return h('symbiote-text', {}, 'details');
122
+ }
123
+
124
+ function mountStack(
125
+ handleRef: ReturnType<typeof ref<INavigatorHandle | null>>,
126
+ children: unknown[],
127
+ ) {
128
+ mount(
129
+ ROOT_TAG,
130
+ defineComponent({
131
+ setup: () => () => h(Stack, { ref: handleRef, initialRouteName: 'Home' }, () => children),
132
+ }),
133
+ );
134
+ }
135
+
136
+ describe('Vue Stack navigator', () => {
137
+ it('mounts only the initial route as an RNSScreen, focused', async () => {
138
+ mount(
139
+ ROOT_TAG,
140
+ defineComponent({
141
+ setup: () => () =>
142
+ h(Stack, { initialRouteName: 'Home' }, () => [
143
+ h(Stack.Screen, { name: 'Home', component: HomeScreen, options: { title: 'Home' } }),
144
+ h(Stack.Screen, { name: 'Details', component: DetailsScreen }),
145
+ ]),
146
+ }),
147
+ );
148
+ await tick();
149
+ const screens = screenNodes();
150
+ expect(screens).toHaveLength(1);
151
+ expect(screens[0].props.activityState).toBe(2);
152
+ expect(fabric.find(n => n.viewName === STACK_VIEW)).toBeDefined();
153
+ expect(headerConfigOf(screens[0]).props.title).toBe('Home');
154
+ });
155
+
156
+ it('push() mounts a second RNSScreen and keeps the first at activityState 2', async () => {
157
+ const handleRef = ref<INavigatorHandle | null>(null);
158
+ mountStack(handleRef, [
159
+ h(Stack.Screen, { name: 'Home', component: HomeScreen }),
160
+ h(Stack.Screen, { name: 'Details', component: DetailsScreen, options: { title: 'Details' } }),
161
+ ]);
162
+ await tick();
163
+ handleRef.value?.push('Details');
164
+ await tick();
165
+ const screens = screenNodes();
166
+ expect(screens).toHaveLength(2);
167
+ expect(screens[0].props.activityState).toBe(2);
168
+ expect(screens[1].props.activityState).toBe(2);
169
+ expect(headerConfigOf(screens[1]).props.title).toBe('Details');
170
+ expect(handleRef.value?.canGoBack()).toBe(true);
171
+ });
172
+
173
+ it('pop() unmounts back down to the previous route', async () => {
174
+ const handleRef = ref<INavigatorHandle | null>(null);
175
+ mountStack(handleRef, [
176
+ h(Stack.Screen, { name: 'Home', component: HomeScreen }),
177
+ h(Stack.Screen, { name: 'Details', component: DetailsScreen }),
178
+ ]);
179
+ await tick();
180
+ handleRef.value?.push('Details');
181
+ await tick();
182
+ expect(screenNodes()).toHaveLength(2);
183
+ handleRef.value?.pop();
184
+ await tick();
185
+ expect(screenNodes()).toHaveLength(1);
186
+ expect(handleRef.value?.canGoBack()).toBe(false);
187
+ });
188
+
189
+ it('refuses to pop the last route', async () => {
190
+ const handleRef = ref<INavigatorHandle | null>(null);
191
+ mountStack(handleRef, [h(Stack.Screen, { name: 'Home', component: HomeScreen })]);
192
+ await tick();
193
+ handleRef.value?.pop();
194
+ await tick();
195
+ expect(screenNodes()).toHaveLength(1);
196
+ });
197
+
198
+ it('drives a pop from the native onDismissed event (iOS swipe/interactive dismiss)', async () => {
199
+ const handleRef = ref<INavigatorHandle | null>(null);
200
+ mountStack(handleRef, [
201
+ h(Stack.Screen, { name: 'Home', component: HomeScreen }),
202
+ h(Stack.Screen, { name: 'Details', component: DetailsScreen }),
203
+ ]);
204
+ await tick();
205
+ handleRef.value?.push('Details');
206
+ await tick();
207
+ expect(screenNodes()).toHaveLength(2);
208
+ const top = screenNodes()[1];
209
+ fabric.fireEvent(top.instanceHandle, 'topDismissed', { dismissCount: 1 });
210
+ await tick();
211
+ expect(screenNodes()).toHaveLength(1);
212
+ });
213
+
214
+ it('drives a pop from the native onHeaderBackButtonClicked event', async () => {
215
+ const handleRef = ref<INavigatorHandle | null>(null);
216
+ mountStack(handleRef, [
217
+ h(Stack.Screen, { name: 'Home', component: HomeScreen }),
218
+ h(Stack.Screen, { name: 'Details', component: DetailsScreen }),
219
+ ]);
220
+ await tick();
221
+ handleRef.value?.push('Details');
222
+ await tick();
223
+ const top = screenNodes()[1];
224
+ fabric.fireEvent(top.instanceHandle, 'topHeaderBackButtonClicked', {});
225
+ await tick();
226
+ expect(screenNodes()).toHaveLength(1);
227
+ });
228
+
229
+ it('mounts the registered screen component as the RNSScreen content', async () => {
230
+ mount(
231
+ ROOT_TAG,
232
+ defineComponent({
233
+ setup: () => () =>
234
+ h(Stack, { initialRouteName: 'Home' }, () => [
235
+ h(Stack.Screen, { name: 'Home', component: HomeScreen }),
236
+ ]),
237
+ }),
238
+ );
239
+ await tick();
240
+ expect(findInTree(n => n.viewName === 'RCTRawText' && n.props.text === 'home')).toBeDefined();
241
+ });
242
+
243
+ it('exposes route.params to the screen via useRoute() after navigation.push', async () => {
244
+ let receivedParams: unknown;
245
+ const ParamsScreen = defineComponent(() => {
246
+ const route = useRoute();
247
+ return () => {
248
+ receivedParams = route.value.params;
249
+ return h('symbiote-text', {}, 'params');
250
+ };
251
+ });
252
+ const handleRef = ref<INavigatorHandle | null>(null);
253
+ mountStack(handleRef, [
254
+ h(Stack.Screen, { name: 'Home', component: HomeScreen }),
255
+ h(Stack.Screen, { name: 'Details', component: ParamsScreen }),
256
+ ]);
257
+ await tick();
258
+ handleRef.value?.push('Details', { id: 42 });
259
+ await tick();
260
+ expect(receivedParams).toEqual({ id: 42 });
261
+ });
262
+
263
+ it('setParams() merges onto the focused route without changing the stack shape', async () => {
264
+ let receivedParams: unknown;
265
+ const ParamsScreen = defineComponent(() => {
266
+ const route = useRoute();
267
+ return () => {
268
+ receivedParams = route.value.params;
269
+ return h('symbiote-text', {}, 'params');
270
+ };
271
+ });
272
+ const handleRef = ref<INavigatorHandle | null>(null);
273
+ mountStack(handleRef, [
274
+ h(Stack.Screen, { name: 'Home', component: HomeScreen }),
275
+ h(Stack.Screen, { name: 'Details', component: ParamsScreen }),
276
+ ]);
277
+ await tick();
278
+ handleRef.value?.push('Details', { id: 1 });
279
+ await tick();
280
+ handleRef.value?.setParams({ id: 2 });
281
+ await tick();
282
+ expect(receivedParams).toEqual({ id: 2 });
283
+ expect(screenNodes()).toHaveLength(2);
284
+ });
285
+
286
+ it('setParams() targets a route by key when given, not just the focused one', async () => {
287
+ let homeKey: string | undefined;
288
+ let homeParams: unknown;
289
+ const HomeTrackingScreen = defineComponent(() => {
290
+ const route = useRoute();
291
+ return () => {
292
+ homeKey = route.value.key;
293
+ homeParams = route.value.params;
294
+ return h('symbiote-text', {}, 'home');
295
+ };
296
+ });
297
+ const handleRef = ref<INavigatorHandle | null>(null);
298
+ mountStack(handleRef, [
299
+ h(Stack.Screen, {
300
+ name: 'Home',
301
+ component: HomeTrackingScreen,
302
+ initialParams: { tab: 'feed' },
303
+ }),
304
+ h(Stack.Screen, { name: 'Details', component: DetailsScreen }),
305
+ ]);
306
+ await tick();
307
+ handleRef.value?.push('Details');
308
+ await tick();
309
+ if (homeKey === undefined) throw new Error('home route key was never captured');
310
+ handleRef.value?.setParams({ tab: 'search' }, homeKey);
311
+ await tick();
312
+ expect(homeParams).toEqual({ tab: 'search' });
313
+ });
314
+
315
+ it('reset() replaces the whole stack with the given state', async () => {
316
+ const handleRef = ref<INavigatorHandle | null>(null);
317
+ mountStack(handleRef, [
318
+ h(Stack.Screen, { name: 'Home', component: HomeScreen }),
319
+ h(Stack.Screen, { name: 'Details', component: DetailsScreen, options: { title: 'Details' } }),
320
+ ]);
321
+ await tick();
322
+ handleRef.value?.push('Details');
323
+ await tick();
324
+ expect(screenNodes()).toHaveLength(2);
325
+
326
+ const nextState: INavigatorState = {
327
+ routes: [{ key: 'reset-1', name: 'Details', params: { id: 7 } }],
328
+ };
329
+ handleRef.value?.reset(nextState);
330
+ await tick();
331
+
332
+ const screens = screenNodes();
333
+ expect(screens).toHaveLength(1);
334
+ expect(screens[0].props.activityState).toBe(2);
335
+ expect(headerConfigOf(screens[0]).props.title).toBe('Details');
336
+ expect(handleRef.value?.canGoBack()).toBe(false);
337
+ });
338
+
339
+ it('nests an RNSSearchBar child, wrapped in an RNSScreenStackHeaderSubview, when headerSearchBarOptions is set', async () => {
340
+ mount(
341
+ ROOT_TAG,
342
+ defineComponent({
343
+ setup: () => () =>
344
+ h(Stack, { initialRouteName: 'Home' }, () => [
345
+ h(Stack.Screen, {
346
+ name: 'Home',
347
+ component: HomeScreen,
348
+ options: { headerSearchBarOptions: { placeholder: 'Search' } },
349
+ }),
350
+ ]),
351
+ }),
352
+ );
353
+ await tick();
354
+ const header = headerConfigOf(screenNodes()[0]);
355
+ expect(header.children).toHaveLength(1);
356
+ const subview = header.children[0];
357
+ expect(subview.viewName).toBe(HEADER_SUBVIEW_VIEW);
358
+ expect(subview.props.type).toBe('searchBar');
359
+ expect(subview.children).toHaveLength(1);
360
+ expect(subview.children[0].viewName).toBe(SEARCH_BAR_VIEW);
361
+ expect(subview.children[0].props.placeholder).toBe('Search');
362
+ });
363
+
364
+ it('forwards search bar text changes to the app-supplied onChangeText callback', async () => {
365
+ let receivedText: string | undefined;
366
+ mount(
367
+ ROOT_TAG,
368
+ defineComponent({
369
+ setup: () => () =>
370
+ h(Stack, { initialRouteName: 'Home' }, () => [
371
+ h(Stack.Screen, {
372
+ name: 'Home',
373
+ component: HomeScreen,
374
+ options: {
375
+ headerSearchBarOptions: {
376
+ placeholder: 'Search',
377
+ onChangeText: (text: string) => {
378
+ receivedText = text;
379
+ },
380
+ },
381
+ },
382
+ }),
383
+ ]),
384
+ }),
385
+ );
386
+ await tick();
387
+ const searchBar = headerConfigOf(screenNodes()[0]).children[0].children[0];
388
+ fabric.fireEvent(searchBar.instanceHandle, 'topChangeText', { text: 'asdf' });
389
+ await tick();
390
+ expect(receivedText).toBe('asdf');
391
+ });
392
+
393
+ it('forwards every other native search bar event to its app-supplied callback', async () => {
394
+ const received: {
395
+ focus: number;
396
+ blur: number;
397
+ cancelButtonPress: number;
398
+ close: number;
399
+ open: number;
400
+ searchButtonPressText?: string;
401
+ } = { focus: 0, blur: 0, cancelButtonPress: 0, close: 0, open: 0 };
402
+ mount(
403
+ ROOT_TAG,
404
+ defineComponent({
405
+ setup: () => () =>
406
+ h(Stack, { initialRouteName: 'Home' }, () => [
407
+ h(Stack.Screen, {
408
+ name: 'Home',
409
+ component: HomeScreen,
410
+ options: {
411
+ headerSearchBarOptions: {
412
+ placeholder: 'Search',
413
+ onFocus: () => received.focus++,
414
+ onBlur: () => received.blur++,
415
+ onCancelButtonPress: () => received.cancelButtonPress++,
416
+ onSearchButtonPress: (text: string) => {
417
+ received.searchButtonPressText = text;
418
+ },
419
+ onClose: () => received.close++,
420
+ onOpen: () => received.open++,
421
+ },
422
+ },
423
+ }),
424
+ ]),
425
+ }),
426
+ );
427
+ await tick();
428
+ const searchBar = headerConfigOf(screenNodes()[0]).children[0].children[0];
429
+ fabric.fireEvent(searchBar.instanceHandle, 'topSearchFocus', {});
430
+ fabric.fireEvent(searchBar.instanceHandle, 'topSearchBlur', {});
431
+ fabric.fireEvent(searchBar.instanceHandle, 'topCancelButtonPress', {});
432
+ fabric.fireEvent(searchBar.instanceHandle, 'topSearchButtonPress', { text: 'qwer' });
433
+ fabric.fireEvent(searchBar.instanceHandle, 'topClose', {});
434
+ fabric.fireEvent(searchBar.instanceHandle, 'topOpen', {});
435
+ await tick();
436
+ expect(received).toEqual({
437
+ focus: 1,
438
+ blur: 1,
439
+ cancelButtonPress: 1,
440
+ close: 1,
441
+ open: 1,
442
+ searchButtonPressText: 'qwer',
443
+ });
444
+ });
445
+
446
+ it('drives imperative SearchBarCommands (focus/setText/…) through the app-supplied ref', async () => {
447
+ const searchBarRef = ref<ISearchBarCommands | null>(null);
448
+ mount(
449
+ ROOT_TAG,
450
+ defineComponent({
451
+ setup: () => () =>
452
+ h(Stack, { initialRouteName: 'Home' }, () => [
453
+ h(Stack.Screen, {
454
+ name: 'Home',
455
+ component: HomeScreen,
456
+ options: { headerSearchBarOptions: { placeholder: 'Search', ref: searchBarRef } },
457
+ }),
458
+ ]),
459
+ }),
460
+ );
461
+ await tick();
462
+ const searchBar = headerConfigOf(screenNodes()[0]).children[0].children[0];
463
+
464
+ searchBarRef.value?.focus();
465
+ expect(fabric.commands.at(-1)).toMatchObject({ commandName: 'focus', args: [] });
466
+ expect(fabric.commands.at(-1)?.node.tag).toBe(searchBar.tag);
467
+
468
+ searchBarRef.value?.setText('preset');
469
+ expect(fabric.commands.at(-1)).toMatchObject({ commandName: 'setText', args: ['preset'] });
470
+
471
+ searchBarRef.value?.toggleCancelButton(false);
472
+ expect(fabric.commands.at(-1)).toMatchObject({
473
+ commandName: 'toggleCancelButton',
474
+ args: [false],
475
+ });
476
+
477
+ searchBarRef.value?.clearText();
478
+ expect(fabric.commands.at(-1)).toMatchObject({ commandName: 'clearText', args: [] });
479
+
480
+ searchBarRef.value?.cancelSearch();
481
+ expect(fabric.commands.at(-1)).toMatchObject({ commandName: 'cancelSearch', args: [] });
482
+
483
+ searchBarRef.value?.blur();
484
+ expect(fabric.commands.at(-1)).toMatchObject({ commandName: 'blur', args: [] });
485
+ });
486
+
487
+ it('renders the header config with zero children when there is no search bar', async () => {
488
+ mount(
489
+ ROOT_TAG,
490
+ defineComponent({
491
+ setup: () => () =>
492
+ h(Stack, { initialRouteName: 'Home' }, () => [
493
+ h(Stack.Screen, { name: 'Home', component: HomeScreen }),
494
+ ]),
495
+ }),
496
+ );
497
+ await tick();
498
+ const header = headerConfigOf(screenNodes()[0]);
499
+ expect(header.children).toHaveLength(0);
500
+ });
501
+ });
@@ -0,0 +1,29 @@
1
+ // Tab.Screen: a declarative marker, never rendered on its own - Tab reads its props via a
2
+ // default-slot scan (see tabs.ts's collectRegistry) to build the static name -> {component,
3
+ // options} registry, then mounts the FOCUSED route's component itself. The Vue twin of
4
+ // react/tab-screen.ts's TabScreen, mirroring screen.ts's slot-scanning marker pattern minus the
5
+ // stack-only concepts (no push/pop lifecycle events to wire); see CLAUDE.md
6
+ // <third_party_rn_packages_are_react_only> - this and Tab import nothing from react-native.
7
+
8
+ import { defineComponent } from '@vue/runtime-core';
9
+ import type { Component } from '@vue/runtime-core';
10
+ import type { IRoute, ITabOptions, ITabNavigatorHandle } from '../core';
11
+
12
+ export type ITabScreenOptionsArgs = {
13
+ route: IRoute<unknown>;
14
+ navigation: ITabNavigatorHandle;
15
+ };
16
+
17
+ export type ITabScreenOptionsResolver = (props: ITabScreenOptionsArgs) => ITabOptions;
18
+
19
+ export type ITabScreenProps = {
20
+ name: string;
21
+ component: Component;
22
+ options?: ITabOptions | ITabScreenOptionsResolver;
23
+ initialParams?: unknown;
24
+ };
25
+
26
+ export const TabScreen = defineComponent<ITabScreenProps>(() => () => null, {
27
+ name: 'TabScreen',
28
+ inheritAttrs: false,
29
+ });