@sigmela/router 0.3.6 → 0.4.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 (118) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +2 -1
  3. package/README.md +108 -479
  4. package/dist/Router.d.ts +190 -0
  5. package/dist/Router.d.ts.map +1 -0
  6. package/dist/components/Modal.d.ts +56 -0
  7. package/dist/components/Modal.d.ts.map +1 -0
  8. package/dist/components/OverlayContentScope.d.ts +8 -0
  9. package/dist/components/OverlayContentScope.d.ts.map +1 -0
  10. package/dist/components/RouterCloseButton.d.ts +9 -0
  11. package/dist/components/RouterCloseButton.d.ts.map +1 -0
  12. package/dist/components/Sheet.d.ts +53 -0
  13. package/dist/components/Sheet.d.ts.map +1 -0
  14. package/dist/components/SheetSurface.d.ts +27 -0
  15. package/dist/components/SheetSurface.d.ts.map +1 -0
  16. package/dist/components/index.d.ts +4 -0
  17. package/dist/components/index.d.ts.map +1 -0
  18. package/dist/components/pageScrollLock.d.ts +3 -0
  19. package/dist/components/pageScrollLock.d.ts.map +1 -0
  20. package/dist/components/sheetDragEngine.d.ts +27 -0
  21. package/dist/components/sheetDragEngine.d.ts.map +1 -0
  22. package/dist/index.d.ts +5 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +3649 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/navigationHistory.d.ts +17 -0
  27. package/dist/navigationHistory.d.ts.map +1 -0
  28. package/dist/router.css +971 -0
  29. package/dist/types.d.ts +3 -0
  30. package/dist/types.d.ts.map +1 -0
  31. package/dist/utils/id.d.ts +2 -0
  32. package/dist/utils/id.d.ts.map +1 -0
  33. package/package.json +69 -174
  34. package/lib/module/Drawer/Drawer.js +0 -250
  35. package/lib/module/Drawer/DrawerContext.js +0 -4
  36. package/lib/module/Drawer/DrawerIcon.web.js +0 -47
  37. package/lib/module/Drawer/RenderDrawer.native.js +0 -248
  38. package/lib/module/Drawer/RenderDrawer.web.js +0 -197
  39. package/lib/module/Drawer/useDrawer.js +0 -11
  40. package/lib/module/Navigation.js +0 -79
  41. package/lib/module/NavigationStack.js +0 -254
  42. package/lib/module/Router.js +0 -2171
  43. package/lib/module/RouterContext.js +0 -33
  44. package/lib/module/ScreenStack/ScreenStack.native.js +0 -3
  45. package/lib/module/ScreenStack/ScreenStack.web.js +0 -561
  46. package/lib/module/ScreenStack/ScreenStackContext.js +0 -21
  47. package/lib/module/ScreenStack/animationHelpers.js +0 -87
  48. package/lib/module/ScreenStack/index.js +0 -3
  49. package/lib/module/ScreenStackItem/ScreenStackItem.js +0 -70
  50. package/lib/module/ScreenStackItem/ScreenStackItem.types.js +0 -3
  51. package/lib/module/ScreenStackItem/ScreenStackItem.web.js +0 -171
  52. package/lib/module/ScreenStackItem/index.js +0 -3
  53. package/lib/module/ScreenStackSheetItem/ScreenStackSheetItem.native.js +0 -70
  54. package/lib/module/ScreenStackSheetItem/ScreenStackSheetItem.web.js +0 -5
  55. package/lib/module/ScreenStackSheetItem/index.js +0 -3
  56. package/lib/module/SplitView/RenderSplitView.native.js +0 -101
  57. package/lib/module/SplitView/RenderSplitView.web.js +0 -107
  58. package/lib/module/SplitView/SplitView.js +0 -97
  59. package/lib/module/SplitView/SplitViewContext.js +0 -4
  60. package/lib/module/SplitView/index.js +0 -5
  61. package/lib/module/SplitView/useSplitView.js +0 -11
  62. package/lib/module/StackRenderer.js +0 -42
  63. package/lib/module/TabBar/RenderTabBar.native.js +0 -418
  64. package/lib/module/TabBar/RenderTabBar.web.js +0 -218
  65. package/lib/module/TabBar/TabBar.js +0 -208
  66. package/lib/module/TabBar/TabBarContext.js +0 -4
  67. package/lib/module/TabBar/TabIcon.web.js +0 -47
  68. package/lib/module/TabBar/index.js +0 -6
  69. package/lib/module/TabBar/useTabBar.js +0 -11
  70. package/lib/module/TabBar/useTabBarHeight.js +0 -22
  71. package/lib/module/createController.js +0 -5
  72. package/lib/module/index.js +0 -15
  73. package/lib/module/navigationNode.js +0 -3
  74. package/lib/module/package.json +0 -1
  75. package/lib/module/styles.css +0 -1111
  76. package/lib/module/types.js +0 -13
  77. package/lib/typescript/package.json +0 -1
  78. package/lib/typescript/src/Drawer/Drawer.d.ts +0 -100
  79. package/lib/typescript/src/Drawer/DrawerContext.d.ts +0 -3
  80. package/lib/typescript/src/Drawer/DrawerIcon.web.d.ts +0 -7
  81. package/lib/typescript/src/Drawer/RenderDrawer.native.d.ts +0 -8
  82. package/lib/typescript/src/Drawer/RenderDrawer.web.d.ts +0 -8
  83. package/lib/typescript/src/Drawer/useDrawer.d.ts +0 -2
  84. package/lib/typescript/src/Navigation.d.ts +0 -17
  85. package/lib/typescript/src/NavigationStack.d.ts +0 -46
  86. package/lib/typescript/src/Router.d.ts +0 -232
  87. package/lib/typescript/src/RouterContext.d.ts +0 -18
  88. package/lib/typescript/src/ScreenStack/ScreenStack.native.d.ts +0 -2
  89. package/lib/typescript/src/ScreenStack/ScreenStack.web.d.ts +0 -9
  90. package/lib/typescript/src/ScreenStack/ScreenStackContext.d.ts +0 -31
  91. package/lib/typescript/src/ScreenStack/animationHelpers.d.ts +0 -6
  92. package/lib/typescript/src/ScreenStack/index.d.ts +0 -2
  93. package/lib/typescript/src/ScreenStackItem/ScreenStackItem.d.ts +0 -3
  94. package/lib/typescript/src/ScreenStackItem/ScreenStackItem.types.d.ts +0 -14
  95. package/lib/typescript/src/ScreenStackItem/ScreenStackItem.web.d.ts +0 -3
  96. package/lib/typescript/src/ScreenStackItem/index.d.ts +0 -3
  97. package/lib/typescript/src/ScreenStackSheetItem/ScreenStackSheetItem.native.d.ts +0 -11
  98. package/lib/typescript/src/ScreenStackSheetItem/ScreenStackSheetItem.web.d.ts +0 -2
  99. package/lib/typescript/src/ScreenStackSheetItem/index.d.ts +0 -2
  100. package/lib/typescript/src/SplitView/RenderSplitView.native.d.ts +0 -19
  101. package/lib/typescript/src/SplitView/RenderSplitView.web.d.ts +0 -8
  102. package/lib/typescript/src/SplitView/SplitView.d.ts +0 -33
  103. package/lib/typescript/src/SplitView/SplitViewContext.d.ts +0 -3
  104. package/lib/typescript/src/SplitView/index.d.ts +0 -5
  105. package/lib/typescript/src/SplitView/useSplitView.d.ts +0 -2
  106. package/lib/typescript/src/StackRenderer.d.ts +0 -8
  107. package/lib/typescript/src/TabBar/RenderTabBar.native.d.ts +0 -8
  108. package/lib/typescript/src/TabBar/RenderTabBar.web.d.ts +0 -8
  109. package/lib/typescript/src/TabBar/TabBar.d.ts +0 -112
  110. package/lib/typescript/src/TabBar/TabBarContext.d.ts +0 -3
  111. package/lib/typescript/src/TabBar/TabIcon.web.d.ts +0 -7
  112. package/lib/typescript/src/TabBar/index.d.ts +0 -5
  113. package/lib/typescript/src/TabBar/useTabBar.d.ts +0 -2
  114. package/lib/typescript/src/TabBar/useTabBarHeight.d.ts +0 -18
  115. package/lib/typescript/src/createController.d.ts +0 -15
  116. package/lib/typescript/src/index.d.ts +0 -21
  117. package/lib/typescript/src/navigationNode.d.ts +0 -41
  118. package/lib/typescript/src/types.d.ts +0 -140
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Presentations that behave like modals (overlay on top of content).
5
- */
6
- export const MODAL_LIKE_PRESENTATIONS = new Set(['modal', 'modalRight', 'transparentModal', 'containedModal', 'containedTransparentModal', 'fullScreenModal', 'formSheet', 'pageSheet', 'sheet']);
7
-
8
- /**
9
- * Check if a presentation type is modal-like (renders as overlay).
10
- */
11
- export function isModalLikePresentation(presentation) {
12
- return presentation !== undefined && MODAL_LIKE_PRESENTATIONS.has(presentation);
13
- }
@@ -1 +0,0 @@
1
- {"type":"module"}
@@ -1,100 +0,0 @@
1
- import type { ImageSourcePropType } from 'react-native';
2
- import { NavigationStack } from '../NavigationStack';
3
- import type { ComponentType } from 'react';
4
- import React from 'react';
5
- import type { NavigationNode, NodeChild, NodeRoute } from '../navigationNode';
6
- import type { PlatformIcon } from 'react-native-screens';
7
- type LegacyIOSIconShape = {
8
- sfSymbolName: string;
9
- } | {
10
- imageSource: ImageSourcePropType;
11
- } | {
12
- templateSource: ImageSourcePropType;
13
- };
14
- type ExtendedIcon = ImageSourcePropType | LegacyIOSIconShape | PlatformIcon;
15
- export type DrawerItemInternal = {
16
- tabKey: string;
17
- title?: string;
18
- icon?: ExtendedIcon;
19
- selectedIcon?: ExtendedIcon;
20
- badgeValue?: string;
21
- tabPrefix?: string;
22
- };
23
- export type DrawerProps = {
24
- onItemPress: (index: number) => void;
25
- items: DrawerItemInternal[];
26
- activeIndex: number;
27
- isOpen: boolean;
28
- onClose: () => void;
29
- };
30
- export type DrawerDescriptor = {
31
- renderer?: ComponentType<DrawerProps>;
32
- };
33
- type DrawerItemConfig = Omit<DrawerItemInternal, 'tabKey'> & {
34
- stack?: NavigationStack;
35
- node?: NavigationNode;
36
- screen?: React.ComponentType<any>;
37
- prefix?: string;
38
- component?: ComponentType<DrawerProps>;
39
- };
40
- type DrawerOptions = {
41
- component?: ComponentType<DrawerProps>;
42
- initialIndex?: number;
43
- width?: number;
44
- };
45
- export declare class Drawer implements NavigationNode {
46
- private readonly drawerId;
47
- screens: Record<string, React.ComponentType<any>>;
48
- stacks: Record<string, NavigationStack>;
49
- nodes: Record<string, NavigationNode>;
50
- readonly width: number;
51
- private listeners;
52
- private openListeners;
53
- private state;
54
- constructor(options?: DrawerOptions);
55
- getId(): string;
56
- addTab(tab: Omit<DrawerItemConfig, 'tabKey'> & {
57
- key: string;
58
- }): Drawer;
59
- setBadge(tabIndex: number, badge: string | null): void;
60
- setTabBarConfig(config: Partial<{
61
- component?: ComponentType<DrawerProps>;
62
- }>): void;
63
- onIndexChange(index: number): void;
64
- open(): void;
65
- close(): void;
66
- toggle(): void;
67
- getIsOpen(): boolean;
68
- subscribeOpenState(listener: (isOpen: boolean) => void): () => void;
69
- private notifyOpenListeners;
70
- getState: () => {
71
- tabs: DrawerItemInternal[];
72
- config: {
73
- component?: ComponentType<DrawerProps>;
74
- };
75
- index: number;
76
- isOpen: boolean;
77
- };
78
- private setState;
79
- private notifyListeners;
80
- subscribe(listener: () => void): () => void;
81
- getTabs(): DrawerItemInternal[];
82
- getInitialIndex(): number;
83
- getActiveChildId(): string | undefined;
84
- switchToRoute(routeId: string): void;
85
- hasRoute(routeId: string): boolean;
86
- setActiveChildByRoute(routeId: string): void;
87
- getNodeRoutes(): NodeRoute[];
88
- getNodeChildren(): NodeChild[];
89
- getRenderer(): React.ComponentType<any>;
90
- seed(): {
91
- routeId: string;
92
- params?: Record<string, unknown>;
93
- path: string;
94
- stackId?: string;
95
- } | null;
96
- private findTabIndexByRoute;
97
- private nodeHasRoute;
98
- }
99
- export {};
100
- //# sourceMappingURL=Drawer.d.ts.map
@@ -1,3 +0,0 @@
1
- import type { Drawer } from './Drawer';
2
- export declare const DrawerContext: import("react").Context<Drawer | null>;
3
- //# sourceMappingURL=DrawerContext.d.ts.map
@@ -1,7 +0,0 @@
1
- import { type ImageSourcePropType } from 'react-native';
2
- export interface DrawerIconProps {
3
- source: ImageSourcePropType;
4
- tintColor?: string;
5
- }
6
- export declare const DrawerIcon: import("react").MemoExoticComponent<({ source, tintColor }: DrawerIconProps) => import("react/jsx-runtime").JSX.Element>;
7
- //# sourceMappingURL=DrawerIcon.web.d.ts.map
@@ -1,8 +0,0 @@
1
- import type { Drawer } from './Drawer';
2
- import type { NavigationAppearance } from '../types';
3
- export interface RenderDrawerProps {
4
- drawer: Drawer;
5
- appearance?: NavigationAppearance;
6
- }
7
- export declare const RenderDrawer: import("react").NamedExoticComponent<RenderDrawerProps>;
8
- //# sourceMappingURL=RenderDrawer.native.d.ts.map
@@ -1,8 +0,0 @@
1
- import type { NavigationAppearance } from '../types';
2
- import type { Drawer } from './Drawer';
3
- export interface RenderDrawerProps {
4
- drawer: Drawer;
5
- appearance?: NavigationAppearance;
6
- }
7
- export declare const RenderDrawer: import("react").NamedExoticComponent<RenderDrawerProps>;
8
- //# sourceMappingURL=RenderDrawer.web.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare const useDrawer: () => import("./Drawer").Drawer;
2
- //# sourceMappingURL=useDrawer.d.ts.map
@@ -1,17 +0,0 @@
1
- import type { NavigationAppearance } from './types';
2
- import { Router } from './Router';
3
- interface NavigationProps {
4
- router: Router;
5
- appearance?: NavigationAppearance;
6
- }
7
- /**
8
- * Navigation component renders the root and global stacks.
9
- *
10
- * Modal stacks (NavigationStack added via addModal) are rendered as regular ScreenStackItems
11
- * with their component being the StackRenderer that subscribes to its own stack history.
12
- * This creates a clean recursive structure: stacks render their items, nested stacks
13
- * (via childNode) render their own items through StackRenderer.
14
- */
15
- export declare const Navigation: import("react").NamedExoticComponent<NavigationProps>;
16
- export {};
17
- //# sourceMappingURL=Navigation.d.ts.map
@@ -1,46 +0,0 @@
1
- import type { ScreenOptions, NavigationStackOptions } from './types';
2
- import React from 'react';
3
- import { type MixedComponent } from './createController';
4
- import type { NavigationNode, NodeRoute, NodeChild } from './navigationNode';
5
- type BuiltRoute = NodeRoute;
6
- type ChildNode = NodeChild;
7
- export declare class NavigationStack implements NavigationNode {
8
- private readonly stackId;
9
- private readonly routes;
10
- private readonly children;
11
- private readonly defaultOptions;
12
- private readonly debugEnabled;
13
- private readonly provider;
14
- private _cachedRenderer;
15
- constructor();
16
- constructor(id: string);
17
- constructor(defaultOptions: NavigationStackOptions);
18
- constructor(id: string, defaultOptions: NavigationStackOptions);
19
- constructor(id: string, defaultOptions: NavigationStackOptions, debug: boolean);
20
- private log;
21
- getId(): string;
22
- addScreen(pathPattern: string, mixedComponent: MixedComponent | NavigationNode, options?: ScreenOptions): NavigationStack;
23
- addModal(path: string, mixedComponent: MixedComponent | NavigationNode, options?: ScreenOptions): NavigationStack;
24
- addSheet(path: string, mixedComponent: MixedComponent | NavigationNode, options?: ScreenOptions): NavigationStack;
25
- addStack(prefixOrStack: string | NavigationStack, maybeStack?: NavigationStack): NavigationStack;
26
- getChildren(): ChildNode[];
27
- getRoutes(): BuiltRoute[];
28
- getFirstRoute(): BuiltRoute | undefined;
29
- getDefaultOptions(): ScreenOptions | undefined;
30
- getNodeRoutes(): BuiltRoute[];
31
- getNodeChildren(): ChildNode[];
32
- getRenderer(): React.ComponentType<any>;
33
- seed?(): {
34
- routeId: string;
35
- params?: Record<string, unknown>;
36
- path: string;
37
- stackId?: string;
38
- } | null;
39
- private extractComponent;
40
- private isNavigationNode;
41
- private buildQueryPattern;
42
- private computeBaseSpecificity;
43
- private normalizePrefix;
44
- }
45
- export {};
46
- //# sourceMappingURL=NavigationStack.d.ts.map
@@ -1,232 +0,0 @@
1
- import type { NavigationNode } from './navigationNode';
2
- import type { HistoryItem, ScreenOptions, ActiveRoute, QueryPattern } from './types';
3
- type Listener = () => void;
4
- export interface RouterConfig {
5
- roots: Record<string, NavigationNode>;
6
- root: string;
7
- screenOptions?: ScreenOptions;
8
- debug?: boolean;
9
- }
10
- export type RootTransition = ScreenOptions['stackAnimation'];
11
- type RouterState = {
12
- history: HistoryItem[];
13
- };
14
- export declare class Router {
15
- root: NavigationNode | null;
16
- private readonly roots;
17
- private activeRootKey;
18
- private readonly listeners;
19
- private readonly registry;
20
- private state;
21
- private readonly routerScreenOptions;
22
- private readonly debugEnabled;
23
- private sheetDismissers;
24
- private dismissedStackIds;
25
- private stackListeners;
26
- private stackById;
27
- private routeById;
28
- private stackActivators;
29
- private compiledRouteById;
30
- private stackHistories;
31
- private activeRoute;
32
- private activeRouteListeners;
33
- private rootListeners;
34
- private rootTransition?;
35
- private suppressRootTransitionOnNextRead;
36
- private lastBrowserIndex;
37
- private suppressHistorySyncCount;
38
- private abortController?;
39
- private navigationToken;
40
- private lastParsedPath;
41
- private lastParsedResult;
42
- private lastMatchedPathname;
43
- private lastMatchedQuery;
44
- private lastMatchedResult;
45
- constructor(config: RouterConfig);
46
- isDebugEnabled(): boolean;
47
- isStackBeingDismissed(stackId?: string): boolean;
48
- clearStackDismissed(stackId?: string): void;
49
- private markStackDismissed;
50
- private log;
51
- navigate: (path: string) => void;
52
- replace: (path: string, dedupe?: boolean) => void;
53
- /**
54
- * Web-only convenience: resets Router navigation state to what a fresh
55
- * deep-link render would produce for the given URL.
56
- *
57
- * This intentionally clears preserved per-tab stacks (useful when tab stacks
58
- * and browser URL can get out of sync).
59
- */
60
- reset: (path: string) => void;
61
- registerSheetDismisser: (key: string, dismisser: () => void) => void;
62
- unregisterSheetDismisser: (key: string) => void;
63
- goBack: () => void;
64
- /**
65
- * Closes the nearest modal or sheet, regardless of navigation depth inside it.
66
- * Useful when a NavigationStack is rendered inside a modal and you want to
67
- * close the entire modal from any screen within it.
68
- */
69
- dismiss: () => void;
70
- getState: () => RouterState;
71
- subscribe(listener: Listener): () => void;
72
- subscribeActiveRoute: (listener: Listener) => (() => void);
73
- getStackHistory: (stackId?: string) => HistoryItem[];
74
- /**
75
- * Returns all history items in navigation order.
76
- * Useful for rendering all screens including modal stacks.
77
- */
78
- getFullHistory: () => HistoryItem[];
79
- subscribeStack: (stackId: string, cb: Listener) => (() => void);
80
- getRootStackId(): string | undefined;
81
- subscribeRoot(listener: Listener): () => void;
82
- private emitRootChange;
83
- getRootTransition(): RootTransition | undefined;
84
- setRoot(nextRootKey: string, options?: {
85
- transition?: RootTransition;
86
- }): void;
87
- getActiveRoute: () => ActiveRoute;
88
- debugGetState(): {
89
- history: {
90
- key: string;
91
- routeId: string;
92
- stackId: string | undefined;
93
- path: string | undefined;
94
- params: Record<string, unknown> | undefined;
95
- query: Record<string, unknown> | undefined;
96
- stackPresentation: import("./types").StackPresentationTypes | undefined;
97
- }[];
98
- stackSlices: {
99
- stackId: string;
100
- items: {
101
- key: string;
102
- routeId: string;
103
- path: string | undefined;
104
- params: Record<string, unknown> | undefined;
105
- query: Record<string, unknown> | undefined;
106
- stackPresentation: import("./types").StackPresentationTypes | undefined;
107
- }[];
108
- }[];
109
- activeRoute: ActiveRoute;
110
- registry: {
111
- routeId: string;
112
- path: string;
113
- pathnamePattern: string;
114
- stackId: string | undefined;
115
- isWildcardPath: boolean;
116
- baseSpecificity: number;
117
- queryPattern: QueryPattern | null;
118
- options: ScreenOptions | undefined;
119
- }[];
120
- };
121
- debugMatchRoute(path: string): {
122
- input: {
123
- path: string;
124
- pathname: string;
125
- query: Record<string, unknown>;
126
- };
127
- matches: {
128
- routeId: string;
129
- path: string;
130
- pathnamePattern: string;
131
- stackId?: string;
132
- isWildcardPath: boolean;
133
- baseSpecificity: number;
134
- pathMatch: boolean;
135
- queryMatch: boolean;
136
- options?: ScreenOptions;
137
- }[];
138
- best: {
139
- routeId: string;
140
- path: string;
141
- stackId: string | undefined;
142
- options: ScreenOptions | undefined;
143
- } | null;
144
- };
145
- debugGetStackInfo(stackId: string): {
146
- stackId: string;
147
- historyLength: number;
148
- items: {
149
- key: string;
150
- routeId: string;
151
- path: string | undefined;
152
- params: Record<string, unknown> | undefined;
153
- query: Record<string, unknown> | undefined;
154
- stackPresentation: import("./types").StackPresentationTypes | undefined;
155
- }[];
156
- };
157
- debugGetAllStacks(): {
158
- stackId: string;
159
- historyLength: number;
160
- items: {
161
- key: string;
162
- routeId: string;
163
- path: string | undefined;
164
- params: Record<string, unknown> | undefined;
165
- query: Record<string, unknown> | undefined;
166
- stackPresentation: import("./types").StackPresentationTypes | undefined;
167
- }[];
168
- }[];
169
- private recomputeActiveRoute;
170
- private performNavigation;
171
- private createHistoryItem;
172
- private applyHistoryChange;
173
- private setState;
174
- private updateStackHistories;
175
- private areArraysEqual;
176
- private syncStateForSameRoute;
177
- private resolveTargetStackAndRoute;
178
- private findChildStackRouteForPathname;
179
- private findRootRouteWithContainer;
180
- private isRouteInContainer;
181
- private activateContainerForRoute;
182
- private findContainerInStack;
183
- private activateStack;
184
- private ensureStackHasSeed;
185
- private updateActiveRouteFromStack;
186
- private emitDepth;
187
- private emit;
188
- private getTopOfStack;
189
- private findExistingRoute;
190
- private findExistingRouteByPathname;
191
- private buildRegistry;
192
- private normalizeBasePath;
193
- private joinPaths;
194
- private stripBasePath;
195
- private combinePathWithBase;
196
- private computeBasePathSpecificity;
197
- private getAutoSeed;
198
- private seedInitialHistory;
199
- private addChildNodeSeedsToItems;
200
- private addChildNodeSeedsToHistory;
201
- private matchBaseRoute;
202
- private generateKey;
203
- private parsePath;
204
- private mergeOptions;
205
- private findStackById;
206
- private getCompiledRoute;
207
- private areShallowEqual;
208
- private matchQueryPattern;
209
- private isWebEnv;
210
- private getCurrentUrl;
211
- private readHistoryIndex;
212
- private getHistoryIndexOrNull;
213
- private getHistoryIndex;
214
- private ensureHistoryIndex;
215
- private getRouterPathFromHistory;
216
- private getReplaceDedupeFromHistory;
217
- private shouldSyncPathWithUrl;
218
- private pushUrl;
219
- private replaceUrl;
220
- private replaceUrlSilently;
221
- private buildUrlFromActiveRoute;
222
- private patchBrowserHistoryOnce;
223
- private setupBrowserHistory;
224
- private destroyed;
225
- destroy(): void;
226
- private syncUrlAfterInternalPop;
227
- private popFromActiveStack;
228
- private buildHistoryFromUrl;
229
- private reuseKeysFromPreviousHistory;
230
- }
231
- export {};
232
- //# sourceMappingURL=Router.d.ts.map
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import type { StackPresentationTypes } from './types';
3
- import type { Router } from './Router';
4
- export declare const RouterContext: React.Context<Router | null>;
5
- export type RouteLocalContextValue = {
6
- presentation: StackPresentationTypes;
7
- params?: Record<string, unknown>;
8
- query?: Record<string, unknown>;
9
- pattern?: string;
10
- path?: string;
11
- };
12
- export declare const RouteLocalContext: React.Context<RouteLocalContextValue | null>;
13
- export declare const useRouter: () => Router;
14
- export declare const useCurrentRoute: () => import("./types").ActiveRoute;
15
- export declare function useParams<TParams extends Record<string, unknown> = Record<string, unknown>>(): TParams;
16
- export declare function useQueryParams<TQuery extends Record<string, unknown> = Record<string, unknown>>(): TQuery;
17
- export declare function useRoute(): RouteLocalContextValue;
18
- //# sourceMappingURL=RouterContext.d.ts.map
@@ -1,2 +0,0 @@
1
- export { ScreenStack } from 'react-native-screens';
2
- //# sourceMappingURL=ScreenStack.native.d.ts.map
@@ -1,9 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- type ScreenStackProps = {
3
- children: ReactNode;
4
- transitionTime?: number;
5
- animated?: boolean;
6
- };
7
- export declare const ScreenStack: import("react").NamedExoticComponent<ScreenStackProps>;
8
- export {};
9
- //# sourceMappingURL=ScreenStack.web.d.ts.map
@@ -1,31 +0,0 @@
1
- import type { ScreenStackItemPhase } from '../ScreenStackItem/ScreenStackItem.types';
2
- import type { TransitionStatus } from 'react-transition-state';
3
- export type PresentationTypeClass = 'push' | 'modal' | 'modal-right' | 'transparent-modal' | 'contained-modal' | 'contained-transparent-modal' | 'fullscreen-modal' | 'formsheet' | 'pagesheet' | 'sheet';
4
- export type AnimationType = 'push-enter' | 'push-exit' | 'push-background' | 'pop-enter' | 'pop-exit' | 'pop-background' | 'modal-enter' | 'modal-exit' | 'modal-right-enter' | 'modal-right-exit' | 'transparent-modal-enter' | 'transparent-modal-exit' | 'contained-modal-enter' | 'contained-modal-exit' | 'contained-transparent-modal-enter' | 'contained-transparent-modal-exit' | 'fullscreen-modal-enter' | 'fullscreen-modal-exit' | 'formsheet-enter' | 'formsheet-exit' | 'pagesheet-enter' | 'pagesheet-exit' | 'sheet-enter' | 'sheet-exit' | 'no-animate' | 'none';
5
- export type ScreenStackItemState = {
6
- presentationType: PresentationTypeClass;
7
- animationType: AnimationType;
8
- phase: ScreenStackItemPhase;
9
- transitionStatus: TransitionStatus;
10
- zIndex: number;
11
- };
12
- export type ScreenStackItemsContextValue = {
13
- items: {
14
- [key: string]: ScreenStackItemState;
15
- };
16
- };
17
- export type ScreenStackAnimatingContextValue = boolean;
18
- export declare const ScreenStackItemsContext: import("react").Context<ScreenStackItemsContextValue | null>;
19
- export declare const ScreenStackAnimatingContext: import("react").Context<boolean>;
20
- export type ScreenStackConfig = {
21
- /**
22
- * When false, the first screen pushed after the stack becomes empty will NOT animate
23
- * (treated as an initial render). Subsequent pushes/pops still animate normally.
24
- */
25
- animateFirstScreenAfterEmpty?: boolean;
26
- };
27
- export declare const ScreenStackConfigContext: import("react").Context<ScreenStackConfig>;
28
- export declare const useScreenStackConfig: () => ScreenStackConfig;
29
- export declare const useScreenStackItemsContext: () => ScreenStackItemsContextValue;
30
- export declare const useScreenStackAnimatingContext: () => boolean;
31
- //# sourceMappingURL=ScreenStackContext.d.ts.map
@@ -1,6 +0,0 @@
1
- import type { StackPresentationTypes } from '../types';
2
- import type { PresentationTypeClass, AnimationType } from './ScreenStackContext';
3
- export declare function getPresentationTypeClass(presentation: StackPresentationTypes): PresentationTypeClass;
4
- export declare function getAnimationTypeForPresentation(presentation: StackPresentationTypes, isEntering: boolean, direction: 'forward' | 'back'): AnimationType;
5
- export declare function computeAnimationType(_key: string, isInStack: boolean, isTop: boolean, direction: 'forward' | 'back', presentation: StackPresentationTypes, isInitialPhase: boolean, animated?: boolean, isBulkRemoval?: boolean): AnimationType;
6
- //# sourceMappingURL=animationHelpers.d.ts.map
@@ -1,2 +0,0 @@
1
- export { ScreenStack } from './ScreenStack';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,3 +0,0 @@
1
- import type { ScreenStackItemProps } from './ScreenStackItem.types';
2
- export declare const ScreenStackItem: import("react").NamedExoticComponent<ScreenStackItemProps>;
3
- //# sourceMappingURL=ScreenStackItem.d.ts.map
@@ -1,14 +0,0 @@
1
- import type { HistoryItem, NavigationAppearance, ScreenOptions } from '../types';
2
- import type { TransitionStatus } from 'react-transition-state';
3
- import type { CSSProperties } from 'react';
4
- export type ScreenStackItemPhase = 'active' | 'inactive' | 'exiting';
5
- export interface ScreenStackItemProps {
6
- item: HistoryItem;
7
- stackId?: string;
8
- stackAnimation?: ScreenOptions['stackAnimation'];
9
- appearance?: NavigationAppearance;
10
- phase?: ScreenStackItemPhase;
11
- transitionStatus?: TransitionStatus;
12
- style?: CSSProperties;
13
- }
14
- //# sourceMappingURL=ScreenStackItem.types.d.ts.map
@@ -1,3 +0,0 @@
1
- import type { ScreenStackItemProps } from './ScreenStackItem.types';
2
- export declare const ScreenStackItem: import("react").MemoExoticComponent<({ item, appearance, style }: ScreenStackItemProps) => import("react/jsx-runtime").JSX.Element | null>;
3
- //# sourceMappingURL=ScreenStackItem.web.d.ts.map
@@ -1,3 +0,0 @@
1
- export { ScreenStackItem } from './ScreenStackItem';
2
- export type { ScreenStackItemProps } from './ScreenStackItem.types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,11 +0,0 @@
1
- import type { RouteLocalContextValue } from '../RouterContext';
2
- import type { HistoryItem, SheetAppearance } from '../types';
3
- interface ScreenStackSheetItemProps {
4
- route: RouteLocalContextValue;
5
- appearance?: SheetAppearance;
6
- onDismissed: () => void;
7
- item: HistoryItem;
8
- }
9
- export declare const ScreenStackSheetItem: import("react").NamedExoticComponent<ScreenStackSheetItemProps>;
10
- export {};
11
- //# sourceMappingURL=ScreenStackSheetItem.native.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare const ScreenStackSheetItem: () => null;
2
- //# sourceMappingURL=ScreenStackSheetItem.web.d.ts.map
@@ -1,2 +0,0 @@
1
- export { ScreenStackSheetItem } from './ScreenStackSheetItem';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,19 +0,0 @@
1
- import type { NavigationAppearance } from '../types';
2
- import type { SplitView } from './SplitView';
3
- export interface RenderSplitViewProps {
4
- splitView: SplitView;
5
- appearance?: NavigationAppearance;
6
- }
7
- /**
8
- * On native, SplitView renders primary and secondary screens in a SINGLE
9
- * ScreenStack to get native push/pop animations.
10
- *
11
- * The combined history is: [...primaryHistory, ...secondaryHistory]
12
- * This way, navigating from primary to secondary is a native push.
13
- *
14
- * History starts empty and is populated via useEffect + startTransition,
15
- * following the pattern from react-native-screens' BottomTabsContainer.
16
- * This lets the parent Screen attach before child ScreenStackItems mount.
17
- */
18
- export declare const RenderSplitView: import("react").NamedExoticComponent<RenderSplitViewProps>;
19
- //# sourceMappingURL=RenderSplitView.native.d.ts.map
@@ -1,8 +0,0 @@
1
- import type { NavigationAppearance } from '../types';
2
- import type { SplitView } from './SplitView';
3
- export interface RenderSplitViewProps {
4
- splitView: SplitView;
5
- appearance?: NavigationAppearance;
6
- }
7
- export declare const RenderSplitView: import("react").NamedExoticComponent<RenderSplitViewProps>;
8
- //# sourceMappingURL=RenderSplitView.web.d.ts.map
@@ -1,33 +0,0 @@
1
- import React from 'react';
2
- import type { NavigationNode, NodeChild, NodeRoute } from '../navigationNode';
3
- import type { NavigationStack } from '../NavigationStack';
4
- export type SplitViewOptions = {
5
- minWidth: number;
6
- primary: NavigationStack;
7
- secondary: NavigationStack;
8
- primaryMaxWidth?: number;
9
- };
10
- export declare class SplitView implements NavigationNode {
11
- private readonly splitViewId;
12
- private readonly secondaryWrapper;
13
- readonly primary: NavigationStack;
14
- readonly secondary: NavigationStack;
15
- readonly minWidth: number;
16
- readonly primaryMaxWidth: number;
17
- private _cachedRenderer;
18
- constructor(options: SplitViewOptions);
19
- getId(): string;
20
- getNodeRoutes(): NodeRoute[];
21
- getNodeChildren(): NodeChild[];
22
- getRenderer(): React.ComponentType<any>;
23
- hasRoute(routeId: string): boolean;
24
- switchToRoute(_routeId: string): void;
25
- setActiveChildByRoute(routeId: string): void;
26
- seed(): {
27
- routeId: string;
28
- params?: Record<string, unknown>;
29
- path: string;
30
- stackId?: string;
31
- } | null;
32
- }
33
- //# sourceMappingURL=SplitView.d.ts.map
@@ -1,3 +0,0 @@
1
- import type { SplitView } from './SplitView';
2
- export declare const SplitViewContext: import("react").Context<SplitView | null>;
3
- //# sourceMappingURL=SplitViewContext.d.ts.map
@@ -1,5 +0,0 @@
1
- export { SplitView } from './SplitView';
2
- export type { SplitViewOptions } from './SplitView';
3
- export { RenderSplitView } from './RenderSplitView';
4
- export { useSplitView } from './useSplitView';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare const useSplitView: () => import("./SplitView").SplitView;
2
- //# sourceMappingURL=useSplitView.d.ts.map