@ohos-ports/react-native-navigation 8.9.0-beta.1 → 8.9.0-beta.11
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 +27 -27
- package/lib/cjs/Mock/Application.js +67 -0
- package/lib/cjs/Mock/ComponentProps.js +16 -0
- package/lib/cjs/Mock/Components/BottomTabs.js +50 -0
- package/lib/cjs/Mock/Components/ComponentScreen.js +135 -0
- package/lib/cjs/Mock/Components/LayoutComponent.js +85 -0
- package/lib/cjs/Mock/Components/Modals.js +56 -0
- package/lib/cjs/Mock/Components/NavigationButton.js +104 -0
- package/lib/cjs/Mock/Components/Overlays.js +57 -0
- package/lib/cjs/Mock/Components/SideMenu.js +69 -0
- package/lib/cjs/Mock/Components/Stack.js +52 -0
- package/lib/cjs/Mock/Components/TopBar.js +115 -0
- package/lib/cjs/Mock/Layouts/BottomTabsNode.js +60 -0
- package/lib/cjs/Mock/Layouts/ComponentNode.js +132 -0
- package/lib/cjs/Mock/Layouts/LayoutNodeFactory.js +59 -0
- package/lib/cjs/Mock/Layouts/Node.js +32 -0
- package/lib/cjs/Mock/Layouts/ParentNode.js +99 -0
- package/lib/cjs/Mock/Layouts/SideMenu.js +112 -0
- package/lib/cjs/Mock/Layouts/StackNode.js +42 -0
- package/lib/cjs/Mock/Stores/EventsStore.js +85 -0
- package/lib/{module → cjs}/Mock/Stores/LayoutStore.js +56 -24
- package/lib/cjs/Mock/actions/layoutActions.js +47 -0
- package/lib/cjs/Mock/connect.js +31 -0
- package/lib/cjs/Mock/constants.js +31 -0
- package/lib/cjs/Mock/index.js +48 -0
- package/lib/cjs/Mock/mocks/AppRegistryService.js +31 -0
- package/lib/cjs/Mock/mocks/NativeCommandsSender.js +181 -0
- package/lib/cjs/Mock/mocks/NativeEventsReceiver.js +146 -0
- package/lib/cjs/Navigation.js +259 -0
- package/lib/{module → cjs}/NavigationDelegate.js +33 -34
- package/lib/cjs/adapters/AndroidCustomRowForwarder.js +84 -0
- package/lib/cjs/adapters/AppRegistryService.js +33 -0
- package/lib/cjs/adapters/AssetResolver.js +33 -0
- package/lib/cjs/adapters/ColorService.js +33 -0
- package/lib/cjs/adapters/Constants.js +43 -0
- package/lib/{module → cjs}/adapters/NativeCommandsSender.js +39 -5
- package/lib/cjs/adapters/NativeEventsReceiver.js +99 -0
- package/lib/cjs/adapters/NativeEventsReceiver.mock.js +30 -0
- package/lib/cjs/adapters/NativeRNNTurboEventEmitter.js +27 -0
- package/lib/cjs/adapters/NativeRNNTurboModule.js +26 -0
- package/lib/cjs/adapters/TouchablePreview.js +137 -0
- package/lib/cjs/adapters/UniqueIdProvider.js +43 -0
- package/lib/cjs/commands/Commands.js +276 -0
- package/lib/cjs/commands/Deprecations.js +101 -0
- package/lib/cjs/commands/LayoutTreeCrawler.js +56 -0
- package/lib/cjs/commands/LayoutTreeParser.js +154 -0
- package/lib/cjs/commands/LayoutType.js +40 -0
- package/lib/cjs/commands/OptionsCrawler.js +106 -0
- package/lib/{module → cjs}/commands/OptionsProcessor.js +102 -67
- package/lib/{module → cjs}/components/ComponentRegistry.js +27 -3
- package/lib/cjs/components/ComponentWrapper.js +114 -0
- package/lib/cjs/components/Modal.js +159 -0
- package/lib/{module → cjs}/components/Store.js +27 -3
- package/lib/cjs/events/CommandsObserver.js +43 -0
- package/lib/cjs/events/ComponentEventsObserver.js +128 -0
- package/lib/{module → cjs}/events/EventsRegistry.js +27 -3
- package/lib/cjs/index.js +63 -0
- package/lib/cjs/interfaces/CommandName.js +46 -0
- package/lib/cjs/interfaces/ComponentEvents.js +1 -0
- package/lib/cjs/interfaces/EventSubscription.js +1 -0
- package/lib/cjs/interfaces/Events.js +1 -0
- package/lib/cjs/interfaces/Layout.js +16 -0
- package/lib/cjs/interfaces/NavigationComponent.js +62 -0
- package/lib/cjs/interfaces/NavigationComponentListener.js +16 -0
- package/lib/cjs/interfaces/NavigationComponentProps.js +1 -0
- package/lib/cjs/interfaces/NavigationFunctionComponent.js +16 -0
- package/lib/cjs/interfaces/Options.js +47 -0
- package/lib/cjs/interfaces/ProcessorSubscription.js +1 -0
- package/lib/cjs/interfaces/Processors.js +16 -0
- package/lib/cjs/linking/DeferredLinkQueue.js +66 -0
- package/lib/{module → cjs}/linking/LinkingHandler.js +40 -43
- package/lib/cjs/linking/ModalLayoutBuilder.js +59 -0
- package/lib/{module → cjs}/linking/RouteMatcher.js +31 -15
- package/lib/cjs/linking/URLParser.js +70 -0
- package/lib/cjs/linking/types.js +16 -0
- package/lib/cjs/processors/LayoutProcessor.js +39 -0
- package/lib/cjs/processors/LayoutProcessorsStore.js +42 -0
- package/lib/cjs/processors/OptionProcessorsStore.js +43 -0
- package/lib/cjs/types.js +1 -0
- package/package.json +10 -9
- package/postinstall.js +53 -0
- package/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/statusbar/StatusBarPresenter.kt +0 -212
- package/lib/module/ARCHITECTURE.md +0 -331
- package/lib/module/Mock/Application.js +0 -33
- package/lib/module/Mock/Application.js.map +0 -1
- package/lib/module/Mock/ComponentProps.js +0 -4
- package/lib/module/Mock/ComponentProps.js.map +0 -1
- package/lib/module/Mock/Components/BottomTabs.js +0 -16
- package/lib/module/Mock/Components/BottomTabs.js.map +0 -1
- package/lib/module/Mock/Components/ComponentScreen.js +0 -101
- package/lib/module/Mock/Components/ComponentScreen.js.map +0 -1
- package/lib/module/Mock/Components/LayoutComponent.js +0 -50
- package/lib/module/Mock/Components/LayoutComponent.js.map +0 -1
- package/lib/module/Mock/Components/Modals.js +0 -22
- package/lib/module/Mock/Components/Modals.js.map +0 -1
- package/lib/module/Mock/Components/NavigationButton.js +0 -72
- package/lib/module/Mock/Components/NavigationButton.js.map +0 -1
- package/lib/module/Mock/Components/Overlays.js +0 -23
- package/lib/module/Mock/Components/Overlays.js.map +0 -1
- package/lib/module/Mock/Components/SideMenu.js +0 -29
- package/lib/module/Mock/Components/SideMenu.js.map +0 -1
- package/lib/module/Mock/Components/Stack.js +0 -18
- package/lib/module/Mock/Components/Stack.js.map +0 -1
- package/lib/module/Mock/Components/TopBar.js +0 -81
- package/lib/module/Mock/Components/TopBar.js.map +0 -1
- package/lib/module/Mock/Layouts/BottomTabsNode.js +0 -30
- package/lib/module/Mock/Layouts/BottomTabsNode.js.map +0 -1
- package/lib/module/Mock/Layouts/ComponentNode.js +0 -102
- package/lib/module/Mock/Layouts/ComponentNode.js.map +0 -1
- package/lib/module/Mock/Layouts/LayoutNodeFactory.js +0 -28
- package/lib/module/Mock/Layouts/LayoutNodeFactory.js.map +0 -1
- package/lib/module/Mock/Layouts/Node.js +0 -14
- package/lib/module/Mock/Layouts/Node.js.map +0 -1
- package/lib/module/Mock/Layouts/ParentNode.js +0 -66
- package/lib/module/Mock/Layouts/ParentNode.js.map +0 -1
- package/lib/module/Mock/Layouts/SideMenu.js +0 -72
- package/lib/module/Mock/Layouts/SideMenu.js.map +0 -1
- package/lib/module/Mock/Layouts/StackNode.js +0 -12
- package/lib/module/Mock/Layouts/StackNode.js.map +0 -1
- package/lib/module/Mock/Stores/EventsStore.js +0 -53
- package/lib/module/Mock/Stores/EventsStore.js.map +0 -1
- package/lib/module/Mock/Stores/LayoutStore.js.map +0 -1
- package/lib/module/Mock/actions/layoutActions.js +0 -19
- package/lib/module/Mock/actions/layoutActions.js.map +0 -1
- package/lib/module/Mock/connect.js +0 -8
- package/lib/module/Mock/connect.js.map +0 -1
- package/lib/module/Mock/constants.js +0 -5
- package/lib/module/Mock/constants.js.map +0 -1
- package/lib/module/Mock/index.js +0 -20
- package/lib/module/Mock/index.js.map +0 -1
- package/lib/module/Mock/mocks/AppRegistryService.js +0 -6
- package/lib/module/Mock/mocks/AppRegistryService.js.map +0 -1
- package/lib/module/Mock/mocks/NativeCommandsSender.js +0 -146
- package/lib/module/Mock/mocks/NativeCommandsSender.js.map +0 -1
- package/lib/module/Mock/mocks/NativeEventsReceiver.js +0 -103
- package/lib/module/Mock/mocks/NativeEventsReceiver.js.map +0 -1
- package/lib/module/Navigation.js +0 -250
- package/lib/module/Navigation.js.map +0 -1
- package/lib/module/NavigationDelegate.js.map +0 -1
- package/lib/module/adapters/AndroidCustomRowForwarder.js +0 -75
- package/lib/module/adapters/AndroidCustomRowForwarder.js.map +0 -1
- package/lib/module/adapters/AppRegistryService.js +0 -9
- package/lib/module/adapters/AppRegistryService.js.map +0 -1
- package/lib/module/adapters/AssetResolver.js +0 -9
- package/lib/module/adapters/AssetResolver.js.map +0 -1
- package/lib/module/adapters/ColorService.js +0 -9
- package/lib/module/adapters/ColorService.js.map +0 -1
- package/lib/module/adapters/Constants.js +0 -19
- package/lib/module/adapters/Constants.js.map +0 -1
- package/lib/module/adapters/NativeCommandsSender.js.map +0 -1
- package/lib/module/adapters/NativeEventsReceiver.js +0 -65
- package/lib/module/adapters/NativeEventsReceiver.js.map +0 -1
- package/lib/module/adapters/NativeEventsReceiver.mock.js +0 -6
- package/lib/module/adapters/NativeEventsReceiver.mock.js.map +0 -1
- package/lib/module/adapters/NativeRNNTurboEventEmitter.js +0 -7
- package/lib/module/adapters/NativeRNNTurboEventEmitter.js.map +0 -1
- package/lib/module/adapters/NativeRNNTurboModule.js +0 -6
- package/lib/module/adapters/NativeRNNTurboModule.js.map +0 -1
- package/lib/module/adapters/TouchablePreview.js +0 -115
- package/lib/module/adapters/TouchablePreview.js.map +0 -1
- package/lib/module/adapters/UniqueIdProvider.js +0 -9
- package/lib/module/adapters/UniqueIdProvider.js.map +0 -1
- package/lib/module/commands/Commands.js +0 -241
- package/lib/module/commands/Commands.js.map +0 -1
- package/lib/module/commands/Commands.test.js +0 -759
- package/lib/module/commands/Commands.test.js.map +0 -1
- package/lib/module/commands/Deprecations.js +0 -66
- package/lib/module/commands/Deprecations.js.map +0 -1
- package/lib/module/commands/LayoutTreeCrawler.js +0 -32
- package/lib/module/commands/LayoutTreeCrawler.js.map +0 -1
- package/lib/module/commands/LayoutTreeCrawler.test.js +0 -82
- package/lib/module/commands/LayoutTreeCrawler.test.js.map +0 -1
- package/lib/module/commands/LayoutTreeParser.js +0 -130
- package/lib/module/commands/LayoutTreeParser.js.map +0 -1
- package/lib/module/commands/LayoutTreeParser.test.js +0 -359
- package/lib/module/commands/LayoutTreeParser.test.js.map +0 -1
- package/lib/module/commands/LayoutType.js +0 -16
- package/lib/module/commands/LayoutType.js.map +0 -1
- package/lib/module/commands/LayoutType.test.js +0 -12
- package/lib/module/commands/LayoutType.test.js.map +0 -1
- package/lib/module/commands/OptionsCrawler.js +0 -72
- package/lib/module/commands/OptionsCrawler.js.map +0 -1
- package/lib/module/commands/OptionsCrawler.test.js +0 -351
- package/lib/module/commands/OptionsCrawler.test.js.map +0 -1
- package/lib/module/commands/OptionsProcessor.js.map +0 -1
- package/lib/module/commands/OptionsProcessor.test.js +0 -1234
- package/lib/module/commands/OptionsProcessor.test.js.map +0 -1
- package/lib/module/components/ComponentRegistry.js.map +0 -1
- package/lib/module/components/ComponentRegistry.test.js +0 -57
- package/lib/module/components/ComponentRegistry.test.js.map +0 -1
- package/lib/module/components/ComponentWrapper.js +0 -80
- package/lib/module/components/ComponentWrapper.js.map +0 -1
- package/lib/module/components/ComponentWrapper.test.js +0 -333
- package/lib/module/components/ComponentWrapper.test.js.map +0 -1
- package/lib/module/components/Modal.js +0 -125
- package/lib/module/components/Modal.js.map +0 -1
- package/lib/module/components/Store.js.map +0 -1
- package/lib/module/components/Store.test.js +0 -148
- package/lib/module/components/Store.test.js.map +0 -1
- package/lib/module/events/CommandsObserver.js +0 -19
- package/lib/module/events/CommandsObserver.js.map +0 -1
- package/lib/module/events/CommandsObserver.test.js +0 -43
- package/lib/module/events/CommandsObserver.test.js.map +0 -1
- package/lib/module/events/ComponentEventsObserver.js +0 -94
- package/lib/module/events/ComponentEventsObserver.js.map +0 -1
- package/lib/module/events/ComponentEventsObserver.test.js +0 -391
- package/lib/module/events/ComponentEventsObserver.test.js.map +0 -1
- package/lib/module/events/EventsRegistry.js.map +0 -1
- package/lib/module/events/EventsRegistry.test.js +0 -131
- package/lib/module/events/EventsRegistry.test.js.map +0 -1
- package/lib/module/index.js +0 -22
- package/lib/module/index.js.map +0 -1
- package/lib/module/interfaces/CommandName.js +0 -22
- package/lib/module/interfaces/CommandName.js.map +0 -1
- package/lib/module/interfaces/ComponentEvents.js +0 -2
- package/lib/module/interfaces/ComponentEvents.js.map +0 -1
- package/lib/module/interfaces/EventSubscription.js +0 -2
- package/lib/module/interfaces/EventSubscription.js.map +0 -1
- package/lib/module/interfaces/Events.js +0 -2
- package/lib/module/interfaces/Events.js.map +0 -1
- package/lib/module/interfaces/Layout.js +0 -4
- package/lib/module/interfaces/Layout.js.map +0 -1
- package/lib/module/interfaces/NavigationComponent.js +0 -21
- package/lib/module/interfaces/NavigationComponent.js.map +0 -1
- package/lib/module/interfaces/NavigationComponentListener.js +0 -4
- package/lib/module/interfaces/NavigationComponentListener.js.map +0 -1
- package/lib/module/interfaces/NavigationComponentProps.js +0 -2
- package/lib/module/interfaces/NavigationComponentProps.js.map +0 -1
- package/lib/module/interfaces/NavigationFunctionComponent.js +0 -4
- package/lib/module/interfaces/NavigationFunctionComponent.js.map +0 -1
- package/lib/module/interfaces/Options.js +0 -47
- package/lib/module/interfaces/Options.js.map +0 -1
- package/lib/module/interfaces/ProcessorSubscription.js +0 -2
- package/lib/module/interfaces/ProcessorSubscription.js.map +0 -1
- package/lib/module/interfaces/Processors.js +0 -4
- package/lib/module/interfaces/Processors.js.map +0 -1
- package/lib/module/linking/DeferredLinkQueue.js +0 -52
- package/lib/module/linking/DeferredLinkQueue.js.map +0 -1
- package/lib/module/linking/DeferredLinkQueue.test.js +0 -54
- package/lib/module/linking/DeferredLinkQueue.test.js.map +0 -1
- package/lib/module/linking/LinkingHandler.js.map +0 -1
- package/lib/module/linking/LinkingHandler.test.js +0 -384
- package/lib/module/linking/LinkingHandler.test.js.map +0 -1
- package/lib/module/linking/ModalLayoutBuilder.js +0 -56
- package/lib/module/linking/ModalLayoutBuilder.js.map +0 -1
- package/lib/module/linking/ModalLayoutBuilder.test.js +0 -154
- package/lib/module/linking/ModalLayoutBuilder.test.js.map +0 -1
- package/lib/module/linking/RouteMatcher.js.map +0 -1
- package/lib/module/linking/RouteMatcher.test.js +0 -164
- package/lib/module/linking/RouteMatcher.test.js.map +0 -1
- package/lib/module/linking/URLParser.js +0 -56
- package/lib/module/linking/URLParser.js.map +0 -1
- package/lib/module/linking/URLParser.test.js +0 -100
- package/lib/module/linking/URLParser.test.js.map +0 -1
- package/lib/module/linking/types.js +0 -4
- package/lib/module/linking/types.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/module/processors/LayoutProcessor.js +0 -15
- package/lib/module/processors/LayoutProcessor.js.map +0 -1
- package/lib/module/processors/LayoutProcessor.test.js +0 -53
- package/lib/module/processors/LayoutProcessor.test.js.map +0 -1
- package/lib/module/processors/LayoutProcessorsStore.js +0 -18
- package/lib/module/processors/LayoutProcessorsStore.js.map +0 -1
- package/lib/module/processors/LayoutProcessorsStore.test.js +0 -31
- package/lib/module/processors/LayoutProcessorsStore.test.js.map +0 -1
- package/lib/module/processors/OptionProcessorsStore.js +0 -19
- package/lib/module/processors/OptionProcessorsStore.js.map +0 -1
- package/lib/module/processors/OptionProcessorsStore.test.js +0 -31
- package/lib/module/processors/OptionProcessorsStore.test.js.map +0 -1
- package/lib/module/types.js +0 -2
- package/lib/module/types.js.map +0 -1
- package/scripts/setup-esm-shim.js +0 -101
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
# JavaScript/TypeScript Architecture
|
|
2
|
-
|
|
3
|
-
The JavaScript layer provides the public API and orchestrates communication between React components and native navigation implementations.
|
|
4
|
-
|
|
5
|
-
## Entry Point
|
|
6
|
-
|
|
7
|
-
`index.ts` exports the `Navigation` singleton (a `NavigationDelegate` instance) along with re-exports from `Modal`, `EventsRegistry`, `Constants`, and all interfaces. Applications use `Navigation.*` for commands and `Navigation.events().*` for event subscriptions.
|
|
8
|
-
|
|
9
|
-
## Module Structure
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
src/
|
|
13
|
-
├── index.ts # Main entry point, exports Navigation singleton
|
|
14
|
-
├── Navigation.ts # NavigationRoot - core orchestrator
|
|
15
|
-
├── NavigationDelegate.ts # Public API facade
|
|
16
|
-
├── adapters/ # Native bridge layer
|
|
17
|
-
├── commands/ # Command processing
|
|
18
|
-
├── components/ # React component management
|
|
19
|
-
├── events/ # Event system
|
|
20
|
-
├── interfaces/ # TypeScript type definitions
|
|
21
|
-
├── linking/ # Deep-linking framework (URL → command)
|
|
22
|
-
└── processors/ # Extensibility hooks
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Core Classes
|
|
26
|
-
|
|
27
|
-
### NavigationDelegate (Public API)
|
|
28
|
-
**File**: `NavigationDelegate.ts`
|
|
29
|
-
|
|
30
|
-
Facade providing the public `Navigation` API. All methods proxy to `NavigationRoot`.
|
|
31
|
-
|
|
32
|
-
```typescript
|
|
33
|
-
// Usage
|
|
34
|
-
import { Navigation } from 'react-native-navigation';
|
|
35
|
-
Navigation.setRoot({ root: { stack: { children: [...] } } });
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### NavigationRoot (Core Orchestrator)
|
|
39
|
-
**File**: `Navigation.ts`
|
|
40
|
-
|
|
41
|
-
Coordinates all subsystems. Constructed with dependencies:
|
|
42
|
-
- `NativeCommandsSender` - sends commands to native
|
|
43
|
-
- `NativeEventsReceiver` - receives events from native
|
|
44
|
-
- `AppRegistryService` - manages React Native component registry
|
|
45
|
-
|
|
46
|
-
Initializes and coordinates:
|
|
47
|
-
- `Store` - component instance & props storage
|
|
48
|
-
- `ComponentRegistry` - component registration
|
|
49
|
-
- `LayoutTreeParser` - converts layouts to internal nodes
|
|
50
|
-
- `LayoutTreeCrawler` - processes layout trees
|
|
51
|
-
- `Commands` - command execution
|
|
52
|
-
- `EventsRegistry` - event subscriptions
|
|
53
|
-
- `OptionsProcessor` - option processing
|
|
54
|
-
- `LayoutProcessor` - layout transformations
|
|
55
|
-
|
|
56
|
-
## Adapters Layer
|
|
57
|
-
|
|
58
|
-
Bridge between JavaScript and native/React Native APIs.
|
|
59
|
-
|
|
60
|
-
| Adapter | Purpose |
|
|
61
|
-
|---------|---------|
|
|
62
|
-
| `NativeCommandsSender` | Wraps TurboModule for command dispatch |
|
|
63
|
-
| `NativeEventsReceiver` | Wraps NativeEventEmitter for events |
|
|
64
|
-
| `NativeRNNTurboModule` | TurboModule spec interface |
|
|
65
|
-
| `NativeRNNTurboEventEmitter` | TurboModule event emitter spec |
|
|
66
|
-
| `UniqueIdProvider` | Generates unique component/command IDs |
|
|
67
|
-
| `ColorService` | Converts colors to native format |
|
|
68
|
-
| `AssetResolver` | Resolves require() image assets (class: AssetService) |
|
|
69
|
-
| `AppRegistryService` | Registers components with React Native |
|
|
70
|
-
| `Constants` | Platform dimension constants |
|
|
71
|
-
| `TouchablePreview` | 3D Touch / Haptic preview handling |
|
|
72
|
-
|
|
73
|
-
## Commands Layer
|
|
74
|
-
|
|
75
|
-
### Commands Class
|
|
76
|
-
**File**: `commands/Commands.ts`
|
|
77
|
-
|
|
78
|
-
Central command dispatcher. Each navigation command:
|
|
79
|
-
1. Validates input
|
|
80
|
-
2. Processes layout through pipeline
|
|
81
|
-
3. Sends to native via adapter
|
|
82
|
-
4. Returns promise with result
|
|
83
|
-
|
|
84
|
-
### Processing Pipeline
|
|
85
|
-
|
|
86
|
-
The pipeline executes in this exact order:
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
Input Layout (from API)
|
|
90
|
-
↓
|
|
91
|
-
1. OptionsCrawler.crawl() # Extract static options from component classes
|
|
92
|
-
↓
|
|
93
|
-
2. LayoutProcessor.process() # Apply registered layout processors
|
|
94
|
-
↓
|
|
95
|
-
3. LayoutTreeParser.parse() # Convert to internal LayoutNode tree
|
|
96
|
-
↓
|
|
97
|
-
4. LayoutTreeCrawler.crawl() # Process options, save props to Store
|
|
98
|
-
↓
|
|
99
|
-
5. OptionsProcessor (during crawl) # Resolve colors, assets, custom processors
|
|
100
|
-
↓
|
|
101
|
-
6. NativeCommandsSender # Send to native module
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### LayoutNode (Internal Tree)
|
|
105
|
-
```typescript
|
|
106
|
-
interface LayoutNode {
|
|
107
|
-
id: string; // Unique identifier
|
|
108
|
-
type: LayoutType; // Component|Stack|BottomTabs|etc
|
|
109
|
-
data: {
|
|
110
|
-
name?: string; // Component name
|
|
111
|
-
options?: any; // Processed options
|
|
112
|
-
passProps?: any; // Component props (cleared before native)
|
|
113
|
-
};
|
|
114
|
-
children: LayoutNode[];
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### LayoutType Enum
|
|
119
|
-
```typescript
|
|
120
|
-
enum LayoutType {
|
|
121
|
-
Component = 'Component',
|
|
122
|
-
Stack = 'Stack',
|
|
123
|
-
BottomTabs = 'BottomTabs',
|
|
124
|
-
SideMenuRoot = 'SideMenuRoot',
|
|
125
|
-
SideMenuCenter = 'SideMenuCenter',
|
|
126
|
-
SideMenuLeft = 'SideMenuLeft',
|
|
127
|
-
SideMenuRight = 'SideMenuRight',
|
|
128
|
-
TopTabs = 'TopTabs',
|
|
129
|
-
ExternalComponent = 'ExternalComponent',
|
|
130
|
-
SplitView = 'SplitView',
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## Components Layer
|
|
135
|
-
|
|
136
|
-
### ComponentRegistry
|
|
137
|
-
**File**: `components/ComponentRegistry.ts`
|
|
138
|
-
|
|
139
|
-
Manages React component registration and wrapping.
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
Navigation.registerComponent('ScreenName', () => MyComponent);
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### ComponentWrapper
|
|
146
|
-
**File**: `components/ComponentWrapper.tsx`
|
|
147
|
-
|
|
148
|
-
Higher-order component that:
|
|
149
|
-
- Wraps original component with lifecycle management
|
|
150
|
-
- Stores instance in `Store` for event dispatch
|
|
151
|
-
- Injects `componentId` and `componentName` props
|
|
152
|
-
|
|
153
|
-
### Store
|
|
154
|
-
**File**: `components/Store.ts`
|
|
155
|
-
|
|
156
|
-
Centralized storage for:
|
|
157
|
-
- `componentsByName` - registered component providers
|
|
158
|
-
- `componentsInstancesById` - mounted component instances
|
|
159
|
-
- `propsById` - static props by component ID
|
|
160
|
-
- `pendingPropsById` - props awaiting component mount
|
|
161
|
-
- `wrappedComponents` - cached wrapped components
|
|
162
|
-
- `lazyRegistratorFn` - function for lazy component registration
|
|
163
|
-
|
|
164
|
-
## Events Layer
|
|
165
|
-
|
|
166
|
-
### EventsRegistry
|
|
167
|
-
**File**: `events/EventsRegistry.ts`
|
|
168
|
-
|
|
169
|
-
Public API for event subscriptions:
|
|
170
|
-
|
|
171
|
-
```typescript
|
|
172
|
-
Navigation.events().registerComponentDidAppearListener(({ componentId }) => {});
|
|
173
|
-
Navigation.events().registerCommandCompletedListener(({ commandId }) => {});
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### ComponentEventsObserver
|
|
177
|
-
**File**: `events/ComponentEventsObserver.ts`
|
|
178
|
-
|
|
179
|
-
Dispatches events to component instance methods:
|
|
180
|
-
- `componentWillAppear()`
|
|
181
|
-
- `componentDidAppear()`
|
|
182
|
-
- `componentDidDisappear()`
|
|
183
|
-
- `navigationButtonPressed()`
|
|
184
|
-
- `screenPopped()`
|
|
185
|
-
|
|
186
|
-
### CommandsObserver
|
|
187
|
-
**File**: `events/CommandsObserver.ts`
|
|
188
|
-
|
|
189
|
-
Notifies listeners of command lifecycle (start, complete).
|
|
190
|
-
|
|
191
|
-
## Events (Native → JS)
|
|
192
|
-
|
|
193
|
-
| Event | Description |
|
|
194
|
-
|-------|-------------|
|
|
195
|
-
| `RNN.AppLaunched` | App initialization complete |
|
|
196
|
-
| `RNN.ComponentWillAppear` | Component about to appear |
|
|
197
|
-
| `RNN.ComponentDidAppear` | Component now visible |
|
|
198
|
-
| `RNN.ComponentDidDisappear` | Component hidden |
|
|
199
|
-
| `RNN.NavigationButtonPressed` | TopBar button tapped |
|
|
200
|
-
| `RNN.BottomTabPressed` | Tab pressed (even if selected) |
|
|
201
|
-
| `RNN.BottomTabSelected` | Tab selection changed |
|
|
202
|
-
| `RNN.BottomTabLongPressed` | Tab long-pressed |
|
|
203
|
-
| `RNN.ModalDismissed` | Modal was dismissed |
|
|
204
|
-
| `RNN.ModalAttemptedToDismiss` | Swipe-to-dismiss attempted |
|
|
205
|
-
| `RNN.ScreenPopped` | Screen removed from stack |
|
|
206
|
-
| `RNN.SearchBarUpdated` | Search text changed |
|
|
207
|
-
| `RNN.SearchBarCancelPressed` | Search cancelled |
|
|
208
|
-
| `RNN.PreviewCompleted` | 3D Touch preview completed |
|
|
209
|
-
| `RNN.CommandCompleted` | Navigation command finished |
|
|
210
|
-
|
|
211
|
-
## Linking Layer
|
|
212
|
-
|
|
213
|
-
Implements URL-to-screen routing on top of the standard command pipeline. The whole feature is JS-only; it consumes URLs from RN's `Linking` module and dispatches `showModal` (or a user-supplied command) when a match is found.
|
|
214
|
-
|
|
215
|
-
**Public surface** (proxied through `NavigationDelegate`):
|
|
216
|
-
- `Navigation.setLinking(config)` — configure prefixes, screen map, and customization hooks
|
|
217
|
-
- `Navigation.handleDeepLink(url)` — manually feed a URL (push notifications, branch.io, App Clips)
|
|
218
|
-
- `Navigation.setLinkingReady(ready)` — user-controlled gate for deferred deep links
|
|
219
|
-
|
|
220
|
-
**Internal modules** (`src/linking/`):
|
|
221
|
-
|
|
222
|
-
| File | Purpose |
|
|
223
|
-
|------|---------|
|
|
224
|
-
| `LinkingHandler.ts` | Orchestrator. Subscribes to `Linking.url`/`getInitialURL`, drives the queue, dispatches matches. Instantiated by `NavigationRoot`. |
|
|
225
|
-
| `URLParser.ts` | Strips prefix (longest match), removes fragment, decodes path segments + query params. |
|
|
226
|
-
| `RouteMatcher.ts` | Compiles `ScreensConfig` into a `RouteNode` tree; matches paths to screen chains with parameter extraction. |
|
|
227
|
-
| `DeferredLinkQueue.ts` | FIFO queue. Holds URLs until both gates open (root-ready + user-ready). |
|
|
228
|
-
| `ModalLayoutBuilder.ts` | Default presentation: wraps the matched chain in a `stack`, merges params into `passProps`, filters React-reserved keys (`ref`, `key`). |
|
|
229
|
-
| `types.ts` | Public types: `LinkingConfig`, `RouteMatch`, `ScreensConfig`, etc. (re-exported via `src/index.ts`). |
|
|
230
|
-
|
|
231
|
-
**Readiness gates** — a URL is dispatched only when both are true:
|
|
232
|
-
1. **Root-ready** (automatic): the first `Navigation.setRoot()` has resolved. `NavigationRoot.setRoot` calls `linkingHandler.setRootReady()` after the promise resolves.
|
|
233
|
-
2. **User-ready** (optional): `config.isReady()` returns `true`, or `setLinkingReady(true)` was called.
|
|
234
|
-
|
|
235
|
-
**Resolution priority** when a match is found:
|
|
236
|
-
1. `config.onLink(match)` — full escape hatch, RNN does nothing else
|
|
237
|
-
2. `config.getModal(match)` — custom modal layout
|
|
238
|
-
3. Default `ModalLayoutBuilder` output
|
|
239
|
-
|
|
240
|
-
## Processors Layer
|
|
241
|
-
|
|
242
|
-
### OptionProcessorsStore
|
|
243
|
-
**File**: `processors/OptionProcessorsStore.ts`
|
|
244
|
-
|
|
245
|
-
Registers custom option processors:
|
|
246
|
-
|
|
247
|
-
```typescript
|
|
248
|
-
Navigation.addOptionProcessor('topBar.title.text', (value, commandName) => {
|
|
249
|
-
return value.toUpperCase(); // Transform all titles
|
|
250
|
-
});
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### LayoutProcessorsStore
|
|
254
|
-
**File**: `processors/LayoutProcessorsStore.ts`
|
|
255
|
-
|
|
256
|
-
Registers layout transformers:
|
|
257
|
-
|
|
258
|
-
```typescript
|
|
259
|
-
Navigation.addLayoutProcessor((layout, commandName) => {
|
|
260
|
-
// Add default options to all components
|
|
261
|
-
return layout;
|
|
262
|
-
});
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
## Interfaces
|
|
266
|
-
|
|
267
|
-
### Layout Types
|
|
268
|
-
**File**: `interfaces/Layout.ts`
|
|
269
|
-
|
|
270
|
-
```typescript
|
|
271
|
-
interface LayoutRoot {
|
|
272
|
-
root: Layout;
|
|
273
|
-
modals?: any[];
|
|
274
|
-
overlays?: any[];
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
type Layout = {
|
|
278
|
-
component?: LayoutComponent;
|
|
279
|
-
stack?: LayoutStack;
|
|
280
|
-
bottomTabs?: LayoutBottomTabs;
|
|
281
|
-
sideMenu?: LayoutSideMenu;
|
|
282
|
-
splitView?: LayoutSplitView;
|
|
283
|
-
topTabs?: LayoutTopTabs;
|
|
284
|
-
externalComponent?: ExternalComponent;
|
|
285
|
-
}
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### Options Interface
|
|
289
|
-
**File**: `interfaces/Options.ts` (comprehensive)
|
|
290
|
-
|
|
291
|
-
Contains all configuration options for:
|
|
292
|
-
- Status bar, navigation bars
|
|
293
|
-
- Top bar (buttons, title, search)
|
|
294
|
-
- Bottom tabs
|
|
295
|
-
- Side menus
|
|
296
|
-
- Modals, overlays
|
|
297
|
-
- Animations
|
|
298
|
-
- Layout parameters
|
|
299
|
-
|
|
300
|
-
### NavigationComponent
|
|
301
|
-
**File**: `interfaces/NavigationComponent.ts`
|
|
302
|
-
|
|
303
|
-
Base class for navigation-aware components:
|
|
304
|
-
|
|
305
|
-
```typescript
|
|
306
|
-
class MyScreen extends NavigationComponent<Props> {
|
|
307
|
-
static options: Options = { ... };
|
|
308
|
-
|
|
309
|
-
componentDidAppear(event) { }
|
|
310
|
-
navigationButtonPressed(event) { }
|
|
311
|
-
}
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
## Dependencies
|
|
315
|
-
|
|
316
|
-
**Production**:
|
|
317
|
-
- `lodash` - utility functions
|
|
318
|
-
- `hoist-non-react-statics` - HOC support
|
|
319
|
-
- `react-lifecycles-compat` - lifecycle polyfill
|
|
320
|
-
- `tslib` - TypeScript helpers
|
|
321
|
-
|
|
322
|
-
**Peer**:
|
|
323
|
-
- `react`, `react-native` (required)
|
|
324
|
-
- `remx` (optional state management)
|
|
325
|
-
|
|
326
|
-
## Build Output
|
|
327
|
-
|
|
328
|
-
Uses `react-native-builder-bob`:
|
|
329
|
-
- **Source**: `src/`
|
|
330
|
-
- **Output**: `lib/`
|
|
331
|
-
- **Targets**: ESM modules + TypeScript declarations
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
import { connect } from "./connect.js";
|
|
6
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
export const Application = connect(class extends React.Component {
|
|
8
|
-
constructor(props) {
|
|
9
|
-
super(props);
|
|
10
|
-
props.entryPoint();
|
|
11
|
-
}
|
|
12
|
-
render() {
|
|
13
|
-
const {
|
|
14
|
-
LayoutComponent
|
|
15
|
-
} = require('./Components/LayoutComponent');
|
|
16
|
-
const {
|
|
17
|
-
LayoutStore
|
|
18
|
-
} = require('./Stores/LayoutStore');
|
|
19
|
-
const {
|
|
20
|
-
Modals
|
|
21
|
-
} = require('./Components/Modals');
|
|
22
|
-
const {
|
|
23
|
-
Overlays
|
|
24
|
-
} = require('./Components/Overlays');
|
|
25
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
26
|
-
testID: 'Application',
|
|
27
|
-
children: [/*#__PURE__*/_jsx(LayoutComponent, {
|
|
28
|
-
layoutNode: LayoutStore.getLayout()
|
|
29
|
-
}), /*#__PURE__*/_jsx(Modals, {}), /*#__PURE__*/_jsx(Overlays, {})]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=Application.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","connect","jsx","_jsx","jsxs","_jsxs","Application","Component","constructor","props","entryPoint","render","LayoutComponent","require","LayoutStore","Modals","Overlays","testID","children","layoutNode","getLayout"],"sourceRoot":"../../../src","sources":["Mock/Application.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,OAAO,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMpC,OAAO,MAAMC,WAAW,GAAGL,OAAO,CAChC,cAAcF,KAAK,CAACQ,SAAS,CAAmB;EAC9CC,WAAWA,CAACC,KAAuB,EAAE;IACnC,KAAK,CAACA,KAAK,CAAC;IACZA,KAAK,CAACC,UAAU,CAAC,CAAC;EACpB;EAEAC,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEC;IAAgB,CAAC,GAAGC,OAAO,CAAC,8BAA8B,CAAC;IACnE,MAAM;MAAEC;IAAY,CAAC,GAAGD,OAAO,CAAC,sBAAsB,CAAC;IACvD,MAAM;MAAEE;IAAO,CAAC,GAAGF,OAAO,CAAC,qBAAqB,CAAC;IACjD,MAAM;MAAEG;IAAS,CAAC,GAAGH,OAAO,CAAC,uBAAuB,CAAC;IACrD,oBACER,KAAA,CAACL,IAAI;MAACiB,MAAM,EAAE,aAAc;MAAAC,QAAA,gBAC1Bf,IAAA,CAACS,eAAe;QAACO,UAAU,EAAEL,WAAW,CAACM,SAAS,CAAC;MAAE,CAAE,CAAC,eACxDjB,IAAA,CAACY,MAAM,IAAE,CAAC,eACVZ,IAAA,CAACa,QAAQ,IAAE,CAAC;IAAA,CACR,CAAC;EAEX;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["Mock/ComponentProps.tsx"],"mappings":"","ignoreList":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { Component } from 'react';
|
|
4
|
-
import { LayoutComponent } from "./LayoutComponent.js";
|
|
5
|
-
import { connect } from "../connect.js";
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
export const BottomTabs = connect(class extends Component {
|
|
8
|
-
render() {
|
|
9
|
-
return this.props.layoutNode.children.map(child => {
|
|
10
|
-
return /*#__PURE__*/_jsx(LayoutComponent, {
|
|
11
|
-
layoutNode: child
|
|
12
|
-
}, child.nodeId);
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=BottomTabs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","LayoutComponent","connect","jsx","_jsx","BottomTabs","render","props","layoutNode","children","map","child","nodeId"],"sourceRoot":"../../../../src","sources":["Mock/Components/BottomTabs.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,eAAe,QAAQ,sBAAmB;AAEnD,SAASC,OAAO,QAAQ,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,OAAO,MAAMC,UAAU,GAAGH,OAAO,CAC/B,cAAcF,SAAS,CAAiB;EACtCM,MAAMA,CAAA,EAAG;IACP,OAAO,IAAI,CAACC,KAAK,CAACC,UAAU,CAACC,QAAQ,CAACC,GAAG,CAAEC,KAAK,IAAK;MACnD,oBAAOP,IAAA,CAACH,eAAe;QAAoBO,UAAU,EAAEG;MAAM,GAAhCA,KAAK,CAACC,MAA4B,CAAC;IAClE,CAAC,CAAC;EACJ;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { Component } from 'react';
|
|
4
|
-
import { View, Text, TouchableOpacity, Image } from 'react-native';
|
|
5
|
-
import { Navigation } from 'react-native-navigation';
|
|
6
|
-
import { VISIBLE_SCREEN_TEST_ID } from "../constants.js";
|
|
7
|
-
import { LayoutStore } from "../Stores/LayoutStore.js";
|
|
8
|
-
import { connect } from "../connect.js";
|
|
9
|
-
import { TopBar } from "./TopBar.js";
|
|
10
|
-
import { events } from "../Stores/EventsStore.js";
|
|
11
|
-
import _ from 'lodash';
|
|
12
|
-
import { switchTabByIndex } from "../actions/layoutActions.js";
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
function isURISource(src) {
|
|
15
|
-
return !!src && typeof src === 'object' && 'uri' in src;
|
|
16
|
-
}
|
|
17
|
-
export const ComponentScreen = connect(class extends Component {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
}
|
|
21
|
-
componentDidMount() {
|
|
22
|
-
this.props.layoutNode.componentDidMount();
|
|
23
|
-
}
|
|
24
|
-
isVisible() {
|
|
25
|
-
const isVisible = LayoutStore.isVisibleLayout(this.props.layoutNode);
|
|
26
|
-
return isVisible;
|
|
27
|
-
}
|
|
28
|
-
renderTabBar() {
|
|
29
|
-
const bottomTabs = this.props.layoutNode.getBottomTabs();
|
|
30
|
-
if (!bottomTabs) return null;
|
|
31
|
-
const bottomTabsOptions = bottomTabs.resolveOptions().bottomTabs;
|
|
32
|
-
if (bottomTabsOptions?.visible === false) return null;
|
|
33
|
-
const buttons = bottomTabs.children.map((child, i) => {
|
|
34
|
-
const bottomTabOptions = child.resolveOptions().bottomTab;
|
|
35
|
-
const icon = bottomTabs.selectedIndex === i ? bottomTabOptions?.selectedIcon : bottomTabOptions?.icon;
|
|
36
|
-
const iconURI = isURISource(icon) ? icon.uri : undefined;
|
|
37
|
-
return /*#__PURE__*/_jsx(View, {
|
|
38
|
-
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
39
|
-
style: {
|
|
40
|
-
padding: 10
|
|
41
|
-
},
|
|
42
|
-
testID: bottomTabOptions?.testID,
|
|
43
|
-
onPress: () => {
|
|
44
|
-
events.invokeBottomTabPressed({
|
|
45
|
-
tabIndex: i
|
|
46
|
-
});
|
|
47
|
-
if (_.defaultTo(bottomTabOptions?.selectTabOnPress, true)) switchTabByIndex(this.props.layoutNode.getBottomTabs(), i);
|
|
48
|
-
},
|
|
49
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
50
|
-
style: {
|
|
51
|
-
justifyContent: 'center',
|
|
52
|
-
alignItems: 'center'
|
|
53
|
-
},
|
|
54
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
55
|
-
children: bottomTabOptions?.badge
|
|
56
|
-
}), iconURI && /*#__PURE__*/_jsx(Image, {
|
|
57
|
-
style: {
|
|
58
|
-
width: 18,
|
|
59
|
-
height: 18,
|
|
60
|
-
marginBottom: 5
|
|
61
|
-
},
|
|
62
|
-
source: {
|
|
63
|
-
uri: iconURI
|
|
64
|
-
}
|
|
65
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
66
|
-
style: {
|
|
67
|
-
fontSize: 12
|
|
68
|
-
},
|
|
69
|
-
children: bottomTabOptions?.text || ''
|
|
70
|
-
})]
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
}, `tab-${i}`);
|
|
74
|
-
});
|
|
75
|
-
return /*#__PURE__*/_jsx(View, {
|
|
76
|
-
testID: bottomTabsOptions?.testID,
|
|
77
|
-
style: {
|
|
78
|
-
flexDirection: 'row',
|
|
79
|
-
justifyContent: 'center',
|
|
80
|
-
width: '100%',
|
|
81
|
-
backgroundColor: '#F0F2F5'
|
|
82
|
-
},
|
|
83
|
-
children: buttons
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
render() {
|
|
87
|
-
const Component = Navigation.mock.store.getWrappedComponent(this.props.layoutNode.data.name);
|
|
88
|
-
if (!Component) throw new Error(`${this.props.layoutNode.data.name} has not been registered.`);
|
|
89
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
90
|
-
testID: this.isVisible() ? VISIBLE_SCREEN_TEST_ID : undefined,
|
|
91
|
-
children: [this.props.layoutNode.getStack() && /*#__PURE__*/_jsx(TopBar, {
|
|
92
|
-
layoutNode: this.props.layoutNode,
|
|
93
|
-
topBarOptions: this.props.layoutNode.resolveOptions().topBar,
|
|
94
|
-
backButtonOptions: this.props.layoutNode.resolveOptions().topBar?.backButton
|
|
95
|
-
}), /*#__PURE__*/_jsx(Component, {
|
|
96
|
-
componentId: this.props.layoutNode.nodeId
|
|
97
|
-
}), this.renderTabBar()]
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
//# sourceMappingURL=ComponentScreen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","Text","TouchableOpacity","Image","Navigation","VISIBLE_SCREEN_TEST_ID","LayoutStore","connect","TopBar","events","_","switchTabByIndex","jsx","_jsx","jsxs","_jsxs","isURISource","src","ComponentScreen","constructor","props","componentDidMount","layoutNode","isVisible","isVisibleLayout","renderTabBar","bottomTabs","getBottomTabs","bottomTabsOptions","resolveOptions","visible","buttons","children","map","child","i","bottomTabOptions","bottomTab","icon","selectedIndex","selectedIcon","iconURI","uri","undefined","style","padding","testID","onPress","invokeBottomTabPressed","tabIndex","defaultTo","selectTabOnPress","justifyContent","alignItems","badge","width","height","marginBottom","source","fontSize","text","flexDirection","backgroundColor","render","mock","store","getWrappedComponent","data","name","Error","getStack","topBarOptions","topBar","backButtonOptions","backButton","componentId","nodeId"],"sourceRoot":"../../../../src","sources":["Mock/Components/ComponentScreen.tsx"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { Component } from 'react';
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
import { BottomTabs } from "./BottomTabs.js";
|
|
6
|
-
import { ComponentScreen } from "./ComponentScreen.js";
|
|
7
|
-
import { Stack } from "./Stack.js";
|
|
8
|
-
import { SideMenuRoot, SideMenuCenter, SideMenuLeft, SideMenuRight } from "./SideMenu.js";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export const LayoutComponent = class extends Component {
|
|
11
|
-
render() {
|
|
12
|
-
switch (this.props.layoutNode.type) {
|
|
13
|
-
case 'BottomTabs':
|
|
14
|
-
return /*#__PURE__*/_jsx(BottomTabs, {
|
|
15
|
-
layoutNode: this.props.layoutNode
|
|
16
|
-
});
|
|
17
|
-
case 'Stack':
|
|
18
|
-
return /*#__PURE__*/_jsx(Stack, {
|
|
19
|
-
layoutNode: this.props.layoutNode
|
|
20
|
-
});
|
|
21
|
-
case 'Component':
|
|
22
|
-
return /*#__PURE__*/_jsx(ComponentScreen, {
|
|
23
|
-
layoutNode: this.props.layoutNode
|
|
24
|
-
});
|
|
25
|
-
case 'SideMenuRoot':
|
|
26
|
-
return /*#__PURE__*/_jsx(SideMenuRoot, {
|
|
27
|
-
layoutNode: this.props.layoutNode
|
|
28
|
-
});
|
|
29
|
-
case 'SideMenuLeft':
|
|
30
|
-
return /*#__PURE__*/_jsx(SideMenuLeft, {
|
|
31
|
-
layoutNode: this.props.layoutNode
|
|
32
|
-
});
|
|
33
|
-
case 'SideMenuCenter':
|
|
34
|
-
return /*#__PURE__*/_jsx(SideMenuCenter, {
|
|
35
|
-
layoutNode: this.props.layoutNode
|
|
36
|
-
});
|
|
37
|
-
case 'SideMenuRight':
|
|
38
|
-
return /*#__PURE__*/_jsx(SideMenuRight, {
|
|
39
|
-
layoutNode: this.props.layoutNode
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
return /*#__PURE__*/_jsx(View, {});
|
|
43
|
-
}
|
|
44
|
-
componentDidCatch(error, errorInfo) {
|
|
45
|
-
const err = new Error(`Error while trying to render layout ${this.props.layoutNode.nodeId} of type ${this.props.layoutNode.type}: ${error}\n${errorInfo?.componentStack}`);
|
|
46
|
-
err.cause = error;
|
|
47
|
-
throw err;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=LayoutComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","BottomTabs","ComponentScreen","Stack","SideMenuRoot","SideMenuCenter","SideMenuLeft","SideMenuRight","jsx","_jsx","LayoutComponent","render","props","layoutNode","type","componentDidCatch","error","errorInfo","err","Error","nodeId","componentStack","cause"],"sourceRoot":"../../../../src","sources":["Mock/Components/LayoutComponent.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,UAAU,QAAQ,iBAAc;AAEzC,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,KAAK,QAAQ,YAAS;AAC/B,SAASC,YAAY,EAAEC,cAAc,EAAEC,YAAY,EAAEC,aAAa,QAAQ,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEvF,OAAO,MAAMC,eAAe,GAAG,cAAcX,SAAS,CAAiB;EACrEY,MAAMA,CAAA,EAAG;IACP,QAAQ,IAAI,CAACC,KAAK,CAACC,UAAU,CAACC,IAAI;MAChC,KAAK,YAAY;QACf,oBAAOL,IAAA,CAACR,UAAU;UAACY,UAAU,EAAE,IAAI,CAACD,KAAK,CAACC;QAAW,CAAE,CAAC;MAC1D,KAAK,OAAO;QACV,oBAAOJ,IAAA,CAACN,KAAK;UAACU,UAAU,EAAE,IAAI,CAACD,KAAK,CAACC;QAAW,CAAE,CAAC;MACrD,KAAK,WAAW;QACd,oBAAOJ,IAAA,CAACP,eAAe;UAACW,UAAU,EAAE,IAAI,CAACD,KAAK,CAACC;QAAW,CAAE,CAAC;MAC/D,KAAK,cAAc;QACjB,oBAAOJ,IAAA,CAACL,YAAY;UAACS,UAAU,EAAE,IAAI,CAACD,KAAK,CAACC;QAAW,CAAE,CAAC;MAC5D,KAAK,cAAc;QACjB,oBAAOJ,IAAA,CAACH,YAAY;UAACO,UAAU,EAAE,IAAI,CAACD,KAAK,CAACC;QAAW,CAAE,CAAC;MAC5D,KAAK,gBAAgB;QACnB,oBAAOJ,IAAA,CAACJ,cAAc;UAACQ,UAAU,EAAE,IAAI,CAACD,KAAK,CAACC;QAAW,CAAE,CAAC;MAC9D,KAAK,eAAe;QAClB,oBAAOJ,IAAA,CAACF,aAAa;UAACM,UAAU,EAAE,IAAI,CAACD,KAAK,CAACC;QAAW,CAAE,CAAC;IAC/D;IAEA,oBAAOJ,IAAA,CAACT,IAAI,IAAE,CAAC;EACjB;EACAe,iBAAiBA,CAACC,KAAY,EAAEC,SAA0B,EAAE;IAC1D,MAAMC,GAAG,GAAG,IAAIC,KAAK,CACnB,uCAAuC,IAAI,CAACP,KAAK,CAACC,UAAU,CAACO,MAAM,YAAY,IAAI,CAACR,KAAK,CAACC,UAAU,CAACC,IAAI,KAAKE,KAAK,KAAKC,SAAS,EAAEI,cAAc,EACnJ,CAAC;IACAH,GAAG,CAASI,KAAK,GAAGN,KAAK;IAC1B,MAAME,GAAG;EACX;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { Component } from 'react';
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
import { LayoutComponent } from "./LayoutComponent.js";
|
|
6
|
-
import { LayoutStore } from "../Stores/LayoutStore.js";
|
|
7
|
-
import { connect } from "../connect.js";
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
export const Modals = connect(class extends Component {
|
|
10
|
-
render() {
|
|
11
|
-
const children = LayoutStore.getModals();
|
|
12
|
-
return /*#__PURE__*/_jsx(View, {
|
|
13
|
-
testID: 'MODALS',
|
|
14
|
-
children: children.map(child => {
|
|
15
|
-
return /*#__PURE__*/_jsx(LayoutComponent, {
|
|
16
|
-
layoutNode: child
|
|
17
|
-
}, child.nodeId);
|
|
18
|
-
})
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
//# sourceMappingURL=Modals.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Component","View","LayoutComponent","LayoutStore","connect","jsx","_jsx","Modals","render","children","getModals","testID","map","child","layoutNode","nodeId"],"sourceRoot":"../../../../src","sources":["Mock/Components/Modals.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,eAAe,QAAQ,sBAAmB;AAEnD,SAASC,WAAW,QAAQ,0BAAuB;AACnD,SAASC,OAAO,QAAQ,eAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,OAAO,MAAMC,MAAM,GAAGH,OAAO,CAC3B,cAAcJ,SAAS,CAAiB;EACtCQ,MAAMA,CAAA,EAAG;IACP,MAAMC,QAAQ,GAAGN,WAAW,CAACO,SAAS,CAAC,CAAC;IACxC,oBACEJ,IAAA,CAACL,IAAI;MAACU,MAAM,EAAE,QAAS;MAAAF,QAAA,EACpBA,QAAQ,CAACG,GAAG,CAAEC,KAAiB,IAAK;QACnC,oBAAOP,IAAA,CAACJ,eAAe;UAAoBY,UAAU,EAAED;QAAM,GAAhCA,KAAK,CAACE,MAA4B,CAAC;MAClE,CAAC;IAAC,CACE,CAAC;EAEX;AACF,CACF,CAAC","ignoreList":[]}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { Component } from 'react';
|
|
4
|
-
import { Button, TouchableOpacity } from 'react-native';
|
|
5
|
-
import { Navigation } from 'react-native-navigation';
|
|
6
|
-
import { events } from "../Stores/EventsStore.js";
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
export const NavigationButton = class extends Component {
|
|
9
|
-
ref = undefined;
|
|
10
|
-
render() {
|
|
11
|
-
const {
|
|
12
|
-
button,
|
|
13
|
-
componentId
|
|
14
|
-
} = this.props;
|
|
15
|
-
if (button.component) return this.renderButtonComponent();
|
|
16
|
-
return /*#__PURE__*/_jsx(Button, {
|
|
17
|
-
testID: button.testID,
|
|
18
|
-
title: button.text || '',
|
|
19
|
-
disabled: button.enabled === false,
|
|
20
|
-
onPress: () => button.enabled !== false && events.invokeNavigationButtonPressed({
|
|
21
|
-
buttonId: button.id,
|
|
22
|
-
componentId
|
|
23
|
-
})
|
|
24
|
-
}, button.id);
|
|
25
|
-
}
|
|
26
|
-
renderButtonComponent() {
|
|
27
|
-
const {
|
|
28
|
-
button,
|
|
29
|
-
componentId
|
|
30
|
-
} = this.props;
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
const buttonComponentId = button.component.componentId;
|
|
33
|
-
// @ts-ignore
|
|
34
|
-
const ComponentClass = Navigation.mock.store.getComponentClassForName(button.component.name);
|
|
35
|
-
if (!ComponentClass) {
|
|
36
|
-
throw new Error(`Cannot find registered component for: ${button.component?.name}`);
|
|
37
|
-
}
|
|
38
|
-
const ButtonComponent = ComponentClass();
|
|
39
|
-
const props = Navigation.mock.store.getPropsForId(buttonComponentId);
|
|
40
|
-
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
41
|
-
onPress: () => {
|
|
42
|
-
if (this.ref) {
|
|
43
|
-
this.invokeOnClick(
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
(this.ref._reactInternalFiber || this.ref._reactInternals).return.stateNode);
|
|
46
|
-
}
|
|
47
|
-
events.invokeNavigationButtonPressed({
|
|
48
|
-
buttonId: button.id,
|
|
49
|
-
componentId: componentId
|
|
50
|
-
});
|
|
51
|
-
},
|
|
52
|
-
testID: button.testID,
|
|
53
|
-
children: /*#__PURE__*/_jsx(ButtonComponent, {
|
|
54
|
-
...props,
|
|
55
|
-
componentId: buttonComponentId,
|
|
56
|
-
ref: ref => this.ref = ref
|
|
57
|
-
}, buttonComponentId)
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
invokeOnClick(stateNode) {
|
|
61
|
-
if (stateNode.children) {
|
|
62
|
-
// @ts-ignore
|
|
63
|
-
stateNode.children.forEach(instance => {
|
|
64
|
-
if (instance.internalInstanceHandle && instance.internalInstanceHandle.stateNode.props.onClick) {
|
|
65
|
-
instance.internalInstanceHandle.stateNode.props.onClick();
|
|
66
|
-
}
|
|
67
|
-
this.invokeOnClick(instance);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=NavigationButton.js.map
|