@symbiote-native/navigation 3.0.0 → 4.0.1

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 (38) hide show
  1. package/README.md +10 -2
  2. package/build/angular/drawer/index.js +14 -6
  3. package/build/angular/tabs/index.js +18 -17
  4. package/build/core/render-drawer.js +4 -4
  5. package/build/core/render-tabs.js +5 -5
  6. package/build/react/drawer/index.js +1 -1
  7. package/build/react/tabs/index.js +2 -2
  8. package/build/solid/drawer/index.js +17 -14
  9. package/build/solid/tabs/index.js +3 -3
  10. package/build/svelte/drawer/index.svelte +23 -24
  11. package/build/svelte/registry-host.js +2 -2
  12. package/build/svelte/stack/index.svelte +5 -5
  13. package/build/svelte/tabs/index.svelte +9 -9
  14. package/build/vue/drawer/index.js +1 -1
  15. package/build/vue/tabs/index.js +3 -3
  16. package/build-ngc/angular/drawer/index.js +17 -9
  17. package/build-ngc/angular/drawer/index.js.map +1 -1
  18. package/build-ngc/angular/tabs/index.js +23 -22
  19. package/build-ngc/angular/tabs/index.js.map +1 -1
  20. package/build-ngc/core/render-drawer.js +4 -4
  21. package/build-ngc/core/render-drawer.js.map +1 -1
  22. package/build-ngc/core/render-tabs.js +5 -5
  23. package/build-ngc/core/render-tabs.js.map +1 -1
  24. package/package.json +14 -14
  25. package/src/angular/drawer/index.ts +13 -5
  26. package/src/angular/tabs/index.ts +18 -16
  27. package/src/core/render-drawer.ts +4 -4
  28. package/src/core/render-tabs.ts +5 -7
  29. package/src/react/drawer/index.ts +1 -1
  30. package/src/react/tabs/index.ts +3 -3
  31. package/src/solid/drawer/index.ts +18 -20
  32. package/src/solid/tabs/index.ts +3 -3
  33. package/src/svelte/drawer/index.svelte +23 -24
  34. package/src/svelte/registry-host.ts +2 -2
  35. package/src/svelte/stack/index.svelte +5 -5
  36. package/src/svelte/tabs/index.svelte +9 -9
  37. package/src/vue/drawer/index.ts +1 -1
  38. package/src/vue/tabs/index.ts +3 -3
@@ -29,13 +29,11 @@ import {
29
29
  createEffect,
30
30
  createMemo,
31
31
  createSignal,
32
- mergeProps,
33
32
  onCleanup,
34
33
  untrack,
35
34
  } from 'solid-js';
36
35
  import type { Accessor } from 'solid-js';
37
36
  import { Animated, createWindowDimensions } from '@symbiote-native/solid';
38
- import type { IAnimatedComponentProps } from '@symbiote-native/solid';
39
37
  import type { JSX } from '@symbiote-native/solid/jsx-runtime';
40
38
  // createComponent from solid-js, insert from the renderer - see stack/index.ts's note.
41
39
  import { createComponent } from 'solid-js';
@@ -509,25 +507,25 @@ function DrawerImpl(props: IDrawerProps): JSX.Element {
509
507
  if (children !== undefined) insert(node, children);
510
508
  return node;
511
509
  }
512
- // ONE source, never a spread followed by an explicit prop: mergeProps takes the first
513
- // NON-undefined value scanning back-to-front, so a later `undefined` silently loses to an
514
- // earlier value (.claude/rules/solid-descriptor-bridge.md §6). Collapsing to a single bag
515
- // removes the question. mergeProps still earns its place - it wraps the function source in a
516
- // memo and hands Animated.View a reactive proxy, which is what keeps the slot's props live
517
- // without rebuilding the node.
518
- return createComponent(
519
- Animated.View,
520
- mergeProps((): IAnimatedComponentProps => ({
521
- ...slotDescriptor(slot).props,
522
- style: [slotDescriptor(slot).props.style, animatedStyle(slot)],
523
- get children(): JSX.Element {
524
- return slotChildren(slot);
525
- },
526
- })),
527
- );
510
+ // ONE source, never a spread followed by an explicit prop: mergeProps took the first
511
+ // NON-undefined value scanning back-to-front, so a later `undefined` silently lost to an
512
+ // earlier one (.claude/rules/solid-descriptor-bridge.md §6). A single bag removes the
513
+ // question, and the thunk is what keeps the slot's props live without rebuilding the node.
514
+ //
515
+ // No Animated.View: the engine resolves an AnimatedNode written into any prop of any host
516
+ // node, so the interpolation in `animatedStyle` binds from a plain `view`.
517
+ const animated = hostElement('view', () => ({
518
+ ...slotDescriptor(slot).props,
519
+ style: [slotDescriptor(slot).props.style, animatedStyle(slot)],
520
+ }));
521
+ // An ACCESSOR, not a value: the slot's children are the focused screen, which mounts after
522
+ // this node is built. Reading once here yields the pre-mount slot and the screen never
523
+ // arrives — where the branch above may read eagerly, because its children are already built.
524
+ insert(animated, () => slotChildren(slot));
525
+ return animated;
528
526
  }
529
527
 
530
- const root = hostElement('symbiote-view', () => ({
528
+ const root = hostElement('view', () => ({
531
529
  ...rootDescriptor().props,
532
530
  ...panResponder.panHandlers,
533
531
  }));
@@ -540,7 +538,7 @@ function DrawerImpl(props: IDrawerProps): JSX.Element {
540
538
  return untrack(() => buildDrawer(current));
541
539
  });
542
540
 
543
- const host = hostElement('symbiote-view', () => ({ style: { flex: 1 } }));
541
+ const host = hostElement('view', () => ({ style: { flex: 1 } }));
544
542
  insert(host, drawer);
545
543
 
546
544
  return createComponent(ScreenCollectorProvider, {
@@ -3,7 +3,7 @@
3
3
  // every other adapter; here Solid supplies the lifecycle - a signal for the dispatched router
4
4
  // state, a callback `ref` for the jumpTo/setParams handle - plus the descriptor bridge for the
5
5
  // tab-bar leaf. Unlike Stack, a bottom-tabs bar is a PURE-JS UI painting ordinary
6
- // `symbiote-view`/`symbiote-text` primitives, so there is no react-native-screens ViewConfig to
6
+ // `view`/`text` primitives, so there is no react-native-screens ViewConfig to
7
7
  // register here.
8
8
  //
9
9
  // TWO SOLID-ONLY REBUILD BOUNDARIES, both invisible in every other adapter:
@@ -305,12 +305,12 @@ function TabImpl(props: ITabProps): JSX.Element {
305
305
  return found ?? { key: routeKey, name: '', params: undefined };
306
306
  }
307
307
 
308
- const contentHost = hostElement('symbiote-view', () => ({
308
+ const contentHost = hostElement('view', () => ({
309
309
  style: TAB_CONTENT_STYLE,
310
310
  }));
311
311
  insert(contentHost, content);
312
312
 
313
- const root = hostElement('symbiote-view', () => ({ style: TAB_ROOT_STYLE }));
313
+ const root = hostElement('view', () => ({ style: TAB_ROOT_STYLE }));
314
314
  // ONE array insert rather than two: a second `insert` on the same parent would find the first
315
315
  // child already there and REPLACE it (solid-js/universal's insertExpression), while an array is
316
316
  // reconciled by identity - contentHost keeps its node, only the bar is swapped when it rebuilds.
@@ -35,10 +35,6 @@
35
35
  IPanResponderGestureState,
36
36
  ISymbioteEvent,
37
37
  } from '@symbiote-native/engine';
38
- // The ONLY import from the adapter's main barrel: `Animated.View` is a compiled `.svelte`
39
- // component, so unlike PanResponder/Dimensions/AnimatedValue (pure engine re-exports, taken
40
- // from the engine directly here) it has no `.svelte`-free home to import from.
41
- import { Animated } from '@symbiote-native/svelte';
42
38
  import {
43
39
  DRAWER_DEFAULT_OVERLAY_COLOR,
44
40
  NAVIGATION_EVENT_BLUR,
@@ -471,16 +467,18 @@
471
467
  {@const descriptor = slotDescriptors.content}
472
468
  {#if descriptor !== undefined}
473
469
  {#if contentStyle !== undefined}
474
- <Animated.View
475
- {...descriptor.props}
476
- style={[descriptor.props.style, contentStyle]}
470
+ <view
471
+ p={{
472
+ ...descriptor.props,
473
+ style: [descriptor.props.style, contentStyle],
474
+ }}
477
475
  >
478
476
  {@render screenContent()}
479
- </Animated.View>
477
+ </view>
480
478
  {:else}
481
- <symbiote-view p={descriptor.props}>
479
+ <view p={descriptor.props}>
482
480
  {@render screenContent()}
483
- </symbiote-view>
481
+ </view>
484
482
  {/if}
485
483
  {/if}
486
484
  {/snippet}
@@ -489,12 +487,14 @@
489
487
  {@const descriptor = slotDescriptors.overlay}
490
488
  {#if descriptor !== undefined}
491
489
  {#if overlayStyle !== undefined}
492
- <Animated.View
493
- {...descriptor.props}
494
- style={[descriptor.props.style, overlayStyle]}
490
+ <view
491
+ p={{
492
+ ...descriptor.props,
493
+ style: [descriptor.props.style, overlayStyle],
494
+ }}
495
495
  />
496
496
  {:else}
497
- <symbiote-view p={descriptor.props} />
497
+ <view p={descriptor.props} />
498
498
  {/if}
499
499
  {/if}
500
500
  {/snippet}
@@ -503,32 +503,31 @@
503
503
  {@const descriptor = slotDescriptors.panel}
504
504
  {#if descriptor !== undefined}
505
505
  {#if panelStyle !== undefined}
506
- <Animated.View
507
- {...descriptor.props}
508
- style={[descriptor.props.style, panelStyle]}
506
+ <view
507
+ p={{ ...descriptor.props, style: [descriptor.props.style, panelStyle] }}
509
508
  >
510
509
  {@render drawerContent?.({
511
510
  state,
512
511
  descriptors,
513
512
  navigation: handle,
514
513
  })}
515
- </Animated.View>
514
+ </view>
516
515
  {:else}
517
- <symbiote-view p={descriptor.props}>
516
+ <view p={descriptor.props}>
518
517
  {@render drawerContent?.({
519
518
  state,
520
519
  descriptors,
521
520
  navigation: handle,
522
521
  })}
523
- </symbiote-view>
522
+ </view>
524
523
  {/if}
525
524
  {/if}
526
525
  {/snippet}
527
526
 
528
- <symbiote-view p={rootProps}>
529
- <symbiote-text p={SCREEN_REGISTRY_HOST_PROPS}>
527
+ <view p={rootProps}>
528
+ <text p={SCREEN_REGISTRY_HOST_PROPS}>
530
529
  {@render children?.()}
531
- </symbiote-text>
530
+ </text>
532
531
  {#each order as slot (slot)}
533
532
  {#if slot === 'content'}
534
533
  {@render contentSlot()}
@@ -538,7 +537,7 @@
538
537
  {@render panelSlot()}
539
538
  {/if}
540
539
  {/each}
541
- </symbiote-view>
540
+ </view>
542
541
 
543
542
  <!-- --- Explicit gap list vs the real react-native-gesture-handler + react-native-reanimated
544
543
  @react-navigation/drawer (confirmed against its current docs, mirrored verbatim from the
@@ -12,11 +12,11 @@
12
12
  //
13
13
  // therefore compiles to `from_tree([marker, ' ', marker])`, and each ' ' becomes an RCTRawText
14
14
  // engine node parented to whatever host tag holds the `{@render children?.()}` call. Inside a
15
- // plain `symbiote-view` that is the invalid "text outside a <Text> component" shape; inside
15
+ // plain `view` that is the invalid "text outside a <text> component" shape; inside
16
16
  // RNSScreenStack it is worse, since react-native-screens' native side expects only RNSScreen
17
17
  // children there.
18
18
  //
19
- // So the markers are rendered inside a zero-size `symbiote-text` instead: raw text inside an
19
+ // So the markers are rendered inside a zero-size `text` instead: raw text inside an
20
20
  // RCTText is LEGAL, which turns the hazard from a device crash into a no-op and makes it
21
21
  // structurally impossible rather than a rule app authors have to remember. The cost is one
22
22
  // collapsed, non-interactive RCTText per navigator.
@@ -15,7 +15,7 @@
15
15
  // HOW SCREENS ARE DISCOVERED: not by reading `children`, which Svelte hands over as an opaque
16
16
  // Snippet - the markers register themselves through the context collector (../screen-registry.ts)
17
17
  // while the snippet renders, and the route list derives from that. The snippet is rendered
18
- // inside a collapsed `symbiote-text` (../registry-host.ts) so whitespace between two markers
18
+ // inside a collapsed `text` (../registry-host.ts) so whitespace between two markers
19
19
  // can never become an illegal raw-text child of a native view.
20
20
 
21
21
  // Route keys must be unique per Stack INSTANCE (Svelte has no useId); a module counter is the
@@ -233,10 +233,10 @@
233
233
  }
234
234
  </script>
235
235
 
236
- <symbiote-view p={STACK_ROOT_PROPS}>
237
- <symbiote-text p={SCREEN_REGISTRY_HOST_PROPS}>
236
+ <view p={STACK_ROOT_PROPS}>
237
+ <text p={SCREEN_REGISTRY_HOST_PROPS}>
238
238
  {@render children?.()}
239
- </symbiote-text>
239
+ </text>
240
240
  <svelte:element
241
241
  this={RNS_SCREEN_STACK_VIEW_NAME}
242
242
  {@attach hostProps(stackProps)}
@@ -258,4 +258,4 @@
258
258
  {/if}
259
259
  {/each}
260
260
  </svelte:element>
261
- </symbiote-view>
261
+ </view>
@@ -4,8 +4,8 @@
4
4
  // with the React/Vue/Angular entries; here Svelte supplies the lifecycle - `$state.raw` for the
5
5
  // router (its twin of useReducer), a module counter for route-key generation, `export
6
6
  // function`s for the jumpTo/setParams handle - plus the Descriptor bridge for the tab-bar leaf.
7
- // Unlike Stack, a bottom-tabs bar is a PURE-JS UI: it paints ordinary `symbiote-view`/
8
- // `symbiote-text` primitives via the shared render fn, so there is no react-native-screens
7
+ // Unlike Stack, a bottom-tabs bar is a PURE-JS UI: it paints ordinary `view`/
8
+ // `text` primitives via the shared render fn, so there is no react-native-screens
9
9
  // ViewConfig to register here - Tab needs no `../../register` import.
10
10
  //
11
11
  // Screens are discovered through the context collector (../screen-registry.ts), not by reading
@@ -253,17 +253,17 @@
253
253
  });
254
254
  </script>
255
255
 
256
- <symbiote-view p={TAB_ROOT_PROPS}>
257
- <symbiote-text p={SCREEN_REGISTRY_HOST_PROPS}>
256
+ <view p={TAB_ROOT_PROPS}>
257
+ <text p={SCREEN_REGISTRY_HOST_PROPS}>
258
258
  {@render children?.()}
259
- </symbiote-text>
260
- <symbiote-view p={TAB_CONTENT_PROPS}>
259
+ </text>
260
+ <view p={TAB_CONTENT_PROPS}>
261
261
  {#if focusedScreen !== undefined}
262
262
  {@const FocusedComponent = focusedScreen.component}
263
263
  <NavigationScope value={focusedScreen.scope}>
264
264
  <FocusedComponent />
265
265
  </NavigationScope>
266
266
  {/if}
267
- </symbiote-view>
268
- <symbiote-view p={tabBar.props} bind:this={tabBarHost} />
269
- </symbiote-view>
267
+ </view>
268
+ <view p={tabBar.props} bind:this={tabBarHost} />
269
+ </view>
@@ -608,7 +608,7 @@ const DrawerImpl = defineComponent<IDrawerProps>(
608
608
  .filter((element): element is VNode => element !== null);
609
609
 
610
610
  return h(
611
- 'symbiote-view',
611
+ 'view',
612
612
  { style: root.props.style, ...panResponder.panHandlers },
613
613
  drawerChildren,
614
614
  );
@@ -4,7 +4,7 @@
4
4
  // router state (Vue's twin of useReducer), useId for route-key generation, expose() for the
5
5
  // jumpTo/setParams handle - plus the descriptor bridge for the tab-bar leaf, like Stack's header
6
6
  // config (stack.ts). Unlike Stack, a bottom-tabs bar is a PURE-JS UI: it paints ordinary
7
- // `symbiote-view`/`symbiote-text` primitives via the shared render fn, so there is no
7
+ // `view`/`text` primitives via the shared render fn, so there is no
8
8
  // react-native-screens ViewConfig to register here - Tab needs no `../register` import.
9
9
 
10
10
  import {
@@ -327,9 +327,9 @@ const TabImpl = defineComponent<ITabProps>(
327
327
  )
328
328
  : null;
329
329
 
330
- return h('symbiote-view', { style: TAB_ROOT_STYLE }, [
330
+ return h('view', { style: TAB_ROOT_STYLE }, [
331
331
  h(
332
- 'symbiote-view',
332
+ 'view',
333
333
  { style: TAB_CONTENT_STYLE },
334
334
  content === null ? [] : [content],
335
335
  ),