@symbiote-native/navigation 2.2.0 → 4.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/README.md +55 -2
- package/build/angular/drawer/index.js +2 -2
- package/build/angular/index.js +1 -1
- package/build/angular/tabs/index.js +5 -5
- package/build/core/render-drawer.js +4 -4
- package/build/core/render-tabs.js +5 -5
- package/build/react/drawer/index.js +1 -1
- package/build/react/index.js +1 -1
- package/build/react/tabs/index.js +2 -2
- package/build/solid/drawer/index.js +17 -14
- package/build/solid/index.js +1 -1
- package/build/solid/tabs/index.js +3 -3
- package/build/svelte/drawer/index.svelte +23 -24
- package/build/svelte/index.js +1 -1
- package/build/svelte/registry-host.js +2 -2
- package/build/svelte/stack/index.svelte +5 -5
- package/build/svelte/tabs/index.svelte +9 -9
- package/build/vue/drawer/index.js +1 -1
- package/build/vue/index.js +1 -1
- package/build/vue/tabs/index.js +3 -3
- package/build-ngc/angular/drawer/index.js +5 -5
- package/build-ngc/angular/drawer/index.js.map +1 -1
- package/build-ngc/angular/tabs/index.js +10 -10
- package/build-ngc/angular/tabs/index.js.map +1 -1
- package/build-ngc/core/render-drawer.js +4 -4
- package/build-ngc/core/render-drawer.js.map +1 -1
- package/build-ngc/core/render-tabs.js +5 -5
- package/build-ngc/core/render-tabs.js.map +1 -1
- package/package.json +27 -16
- package/src/angular/drawer/index.ts +2 -2
- package/src/angular/tabs/index.ts +5 -5
- package/src/core/render-drawer.ts +4 -4
- package/src/core/render-tabs.ts +5 -7
- package/src/react/drawer/index.ts +1 -1
- package/src/react/tabs/index.ts +3 -3
- package/src/solid/drawer/index.ts +18 -20
- package/src/solid/tabs/index.ts +3 -3
- package/src/svelte/drawer/index.svelte +23 -24
- package/src/svelte/registry-host.ts +2 -2
- package/src/svelte/stack/index.svelte +5 -5
- package/src/svelte/tabs/index.svelte +9 -9
- package/src/vue/drawer/index.ts +1 -1
- package/src/vue/tabs/index.ts +3 -3
|
@@ -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
|
-
<
|
|
475
|
-
{
|
|
476
|
-
|
|
470
|
+
<view
|
|
471
|
+
p={{
|
|
472
|
+
...descriptor.props,
|
|
473
|
+
style: [descriptor.props.style, contentStyle],
|
|
474
|
+
}}
|
|
477
475
|
>
|
|
478
476
|
{@render screenContent()}
|
|
479
|
-
</
|
|
477
|
+
</view>
|
|
480
478
|
{:else}
|
|
481
|
-
<
|
|
479
|
+
<view p={descriptor.props}>
|
|
482
480
|
{@render screenContent()}
|
|
483
|
-
</
|
|
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
|
-
<
|
|
493
|
-
{
|
|
494
|
-
|
|
490
|
+
<view
|
|
491
|
+
p={{
|
|
492
|
+
...descriptor.props,
|
|
493
|
+
style: [descriptor.props.style, overlayStyle],
|
|
494
|
+
}}
|
|
495
495
|
/>
|
|
496
496
|
{:else}
|
|
497
|
-
<
|
|
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
|
-
<
|
|
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
|
-
</
|
|
514
|
+
</view>
|
|
516
515
|
{:else}
|
|
517
|
-
<
|
|
516
|
+
<view p={descriptor.props}>
|
|
518
517
|
{@render drawerContent?.({
|
|
519
518
|
state,
|
|
520
519
|
descriptors,
|
|
521
520
|
navigation: handle,
|
|
522
521
|
})}
|
|
523
|
-
</
|
|
522
|
+
</view>
|
|
524
523
|
{/if}
|
|
525
524
|
{/if}
|
|
526
525
|
{/snippet}
|
|
527
526
|
|
|
528
|
-
<
|
|
529
|
-
<
|
|
527
|
+
<view p={rootProps}>
|
|
528
|
+
<text p={SCREEN_REGISTRY_HOST_PROPS}>
|
|
530
529
|
{@render children?.()}
|
|
531
|
-
</
|
|
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
|
-
</
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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
|
-
<
|
|
237
|
-
<
|
|
236
|
+
<view p={STACK_ROOT_PROPS}>
|
|
237
|
+
<text p={SCREEN_REGISTRY_HOST_PROPS}>
|
|
238
238
|
{@render children?.()}
|
|
239
|
-
</
|
|
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
|
-
</
|
|
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 `
|
|
8
|
-
// `
|
|
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
|
-
<
|
|
257
|
-
<
|
|
256
|
+
<view p={TAB_ROOT_PROPS}>
|
|
257
|
+
<text p={SCREEN_REGISTRY_HOST_PROPS}>
|
|
258
258
|
{@render children?.()}
|
|
259
|
-
</
|
|
260
|
-
<
|
|
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
|
-
</
|
|
268
|
-
<
|
|
269
|
-
</
|
|
267
|
+
</view>
|
|
268
|
+
<view p={tabBar.props} bind:this={tabBarHost} />
|
|
269
|
+
</view>
|
package/src/vue/drawer/index.ts
CHANGED
package/src/vue/tabs/index.ts
CHANGED
|
@@ -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
|
-
// `
|
|
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('
|
|
330
|
+
return h('view', { style: TAB_ROOT_STYLE }, [
|
|
331
331
|
h(
|
|
332
|
-
'
|
|
332
|
+
'view',
|
|
333
333
|
{ style: TAB_CONTENT_STYLE },
|
|
334
334
|
content === null ? [] : [content],
|
|
335
335
|
),
|