react-native-navigation 7.23.1-snapshot.440 → 7.24.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 (161) hide show
  1. package/Mock.d.ts +1 -0
  2. package/Mock.js +4 -0
  3. package/Mock.ts +1 -1
  4. package/jest.config.js +1 -1
  5. package/lib/{src/Mock → Mock}/Application.tsx +0 -0
  6. package/lib/{src/Mock → Mock}/ComponentProps.tsx +0 -0
  7. package/lib/{src/Mock → Mock}/Components/BottomTabs.tsx +0 -0
  8. package/lib/{src/Mock → Mock}/Components/ComponentScreen.tsx +1 -1
  9. package/lib/{src/Mock → Mock}/Components/LayoutComponent.tsx +0 -0
  10. package/lib/{src/Mock → Mock}/Components/Modals.tsx +0 -0
  11. package/lib/{src/Mock → Mock}/Components/NavigationButton.tsx +1 -1
  12. package/lib/{src/Mock → Mock}/Components/Overlays.tsx +0 -0
  13. package/lib/{src/Mock → Mock}/Components/Stack.tsx +0 -0
  14. package/lib/{src/Mock → Mock}/Components/TopBar.tsx +2 -2
  15. package/lib/{src/Mock → Mock}/Layouts/BottomTabsNode.ts +1 -1
  16. package/lib/{src/Mock → Mock}/Layouts/ComponentNode.ts +1 -1
  17. package/lib/{src/Mock → Mock}/Layouts/LayoutNodeFactory.ts +0 -0
  18. package/lib/{src/Mock → Mock}/Layouts/Node.ts +1 -1
  19. package/lib/{src/Mock → Mock}/Layouts/ParentNode.ts +2 -2
  20. package/lib/{src/Mock → Mock}/Layouts/StackNode.ts +0 -0
  21. package/lib/{src/Mock → Mock}/Stores/EventsStore.ts +3 -3
  22. package/lib/{src/Mock → Mock}/Stores/LayoutStore.ts +1 -1
  23. package/lib/{src/Mock → Mock}/connect.ts +0 -0
  24. package/lib/Mock/constants.d.ts +2 -0
  25. package/lib/Mock/constants.js +5 -0
  26. package/lib/{src/Mock → Mock}/constants.ts +0 -0
  27. package/lib/Mock/index.d.ts +3 -0
  28. package/lib/Mock/index.js +14 -0
  29. package/lib/{src/Mock → Mock}/index.ts +0 -0
  30. package/lib/{src/Mock → Mock}/mocks/AppRegistryService.ts +0 -0
  31. package/lib/{src/Mock → Mock}/mocks/NativeCommandsSender.tsx +1 -1
  32. package/lib/{src/Mock → Mock}/mocks/NativeEventsReceiver.ts +2 -2
  33. package/lib/dist/Mock/Application.js +2 -2
  34. package/lib/dist/Mock/Components/BottomTabs.js +2 -2
  35. package/lib/dist/Mock/Components/ComponentScreen.js +5 -5
  36. package/lib/dist/Mock/Components/LayoutComponent.js +3 -2
  37. package/lib/dist/Mock/Components/Modals.js +2 -2
  38. package/lib/dist/Mock/Components/NavigationButton.d.ts +1 -1
  39. package/lib/dist/Mock/Components/NavigationButton.js +8 -10
  40. package/lib/dist/Mock/Components/Overlays.js +2 -2
  41. package/lib/dist/Mock/Components/Stack.js +2 -2
  42. package/lib/dist/Mock/Components/TopBar.d.ts +2 -2
  43. package/lib/dist/Mock/Components/TopBar.js +7 -6
  44. package/lib/dist/Mock/Layouts/BottomTabsNode.d.ts +1 -1
  45. package/lib/dist/Mock/Layouts/BottomTabsNode.js +3 -3
  46. package/lib/dist/Mock/Layouts/ComponentNode.d.ts +1 -1
  47. package/lib/dist/Mock/Layouts/ComponentNode.js +4 -4
  48. package/lib/dist/Mock/Layouts/LayoutNodeFactory.js +3 -3
  49. package/lib/dist/Mock/Layouts/Node.d.ts +1 -1
  50. package/lib/dist/Mock/Layouts/Node.js +5 -0
  51. package/lib/dist/Mock/Layouts/ParentNode.d.ts +2 -2
  52. package/lib/dist/Mock/Layouts/ParentNode.js +4 -3
  53. package/lib/dist/Mock/Layouts/StackNode.js +1 -1
  54. package/lib/dist/Mock/Stores/EventsStore.d.ts +3 -3
  55. package/lib/dist/Mock/Stores/LayoutStore.js +2 -2
  56. package/lib/dist/Mock/connect.js +1 -1
  57. package/lib/dist/Mock/index.js +1 -1
  58. package/lib/dist/Mock/mocks/NativeCommandsSender.d.ts +1 -1
  59. package/lib/dist/Mock/mocks/NativeCommandsSender.js +2 -2
  60. package/lib/dist/Mock/mocks/NativeEventsReceiver.d.ts +2 -2
  61. package/lib/dist/Mock/mocks/NativeEventsReceiver.js +1 -1
  62. package/lib/dist/{Navigation.d.ts → src/Navigation.d.ts} +0 -0
  63. package/lib/dist/{Navigation.js → src/Navigation.js} +19 -3
  64. package/lib/dist/{NavigationDelegate.d.ts → src/NavigationDelegate.d.ts} +0 -0
  65. package/lib/dist/{NavigationDelegate.js → src/NavigationDelegate.js} +1 -0
  66. package/lib/dist/{adapters → src/adapters}/AppRegistryService.d.ts +0 -0
  67. package/lib/dist/{adapters → src/adapters}/AppRegistryService.js +0 -0
  68. package/lib/dist/{adapters → src/adapters}/AssetResolver.d.ts +0 -0
  69. package/lib/dist/{adapters → src/adapters}/AssetResolver.js +0 -0
  70. package/lib/dist/src/adapters/ColorService.d.ts +3 -0
  71. package/lib/dist/{adapters → src/adapters}/ColorService.js +1 -1
  72. package/lib/dist/{adapters → src/adapters}/Constants.d.ts +0 -0
  73. package/lib/dist/{adapters → src/adapters}/Constants.js +10 -6
  74. package/lib/dist/{adapters → src/adapters}/NativeCommandsSender.d.ts +0 -0
  75. package/lib/dist/{adapters → src/adapters}/NativeCommandsSender.js +1 -0
  76. package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.d.ts +0 -0
  77. package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.js +1 -0
  78. package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.mock.d.ts +0 -0
  79. package/lib/dist/{adapters → src/adapters}/NativeEventsReceiver.mock.js +0 -0
  80. package/lib/dist/{adapters → src/adapters}/TouchablePreview.d.ts +0 -0
  81. package/lib/dist/src/adapters/TouchablePreview.js +89 -0
  82. package/lib/dist/{adapters → src/adapters}/UniqueIdProvider.d.ts +0 -0
  83. package/lib/dist/{adapters → src/adapters}/UniqueIdProvider.js +2 -2
  84. package/lib/dist/{commands → src/commands}/Commands.d.ts +0 -0
  85. package/lib/dist/{commands → src/commands}/Commands.js +18 -9
  86. package/lib/dist/{commands → src/commands}/Deprecations.d.ts +0 -0
  87. package/lib/dist/src/commands/Deprecations.js +80 -0
  88. package/lib/dist/{commands → src/commands}/LayoutTreeCrawler.d.ts +0 -0
  89. package/lib/dist/{commands → src/commands}/LayoutTreeCrawler.js +2 -0
  90. package/lib/dist/{commands → src/commands}/LayoutTreeParser.d.ts +0 -0
  91. package/lib/dist/{commands → src/commands}/LayoutTreeParser.js +1 -0
  92. package/lib/dist/{commands → src/commands}/LayoutType.d.ts +0 -0
  93. package/lib/dist/{commands → src/commands}/LayoutType.js +0 -0
  94. package/lib/dist/{commands → src/commands}/OptionsCrawler.d.ts +0 -0
  95. package/lib/dist/{commands → src/commands}/OptionsCrawler.js +6 -4
  96. package/lib/dist/{commands → src/commands}/OptionsProcessor.d.ts +0 -0
  97. package/lib/dist/{commands → src/commands}/OptionsProcessor.js +42 -36
  98. package/lib/dist/{components → src/components}/ComponentRegistry.d.ts +0 -0
  99. package/lib/dist/{components → src/components}/ComponentRegistry.js +4 -0
  100. package/lib/dist/{components → src/components}/ComponentWrapper.d.ts +0 -0
  101. package/lib/dist/{components → src/components}/ComponentWrapper.js +17 -17
  102. package/lib/dist/{components → src/components}/Modal.d.ts +0 -0
  103. package/lib/dist/{components → src/components}/Modal.js +8 -8
  104. package/lib/dist/{components → src/components}/Store.d.ts +0 -0
  105. package/lib/dist/{components → src/components}/Store.js +6 -7
  106. package/lib/dist/{events → src/events}/CommandsObserver.d.ts +0 -0
  107. package/lib/dist/{events → src/events}/CommandsObserver.js +2 -1
  108. package/lib/dist/{events → src/events}/ComponentEventsObserver.d.ts +4 -2
  109. package/lib/dist/{events → src/events}/ComponentEventsObserver.js +16 -14
  110. package/lib/dist/{events → src/events}/EventsRegistry.d.ts +2 -2
  111. package/lib/dist/{events → src/events}/EventsRegistry.js +3 -0
  112. package/lib/dist/{index.d.ts → src/index.d.ts} +0 -0
  113. package/lib/dist/src/index.js +22 -0
  114. package/lib/dist/{interfaces → src/interfaces}/CommandName.d.ts +0 -0
  115. package/lib/dist/{interfaces → src/interfaces}/CommandName.js +0 -0
  116. package/lib/dist/{interfaces → src/interfaces}/ComponentEvents.d.ts +0 -0
  117. package/lib/dist/{interfaces → src/interfaces}/ComponentEvents.js +0 -0
  118. package/lib/dist/{interfaces → src/interfaces}/EventSubscription.d.ts +0 -0
  119. package/lib/dist/{interfaces → src/interfaces}/EventSubscription.js +0 -0
  120. package/lib/dist/{interfaces → src/interfaces}/Events.d.ts +0 -0
  121. package/lib/dist/{interfaces → src/interfaces}/Events.js +0 -0
  122. package/lib/dist/{interfaces → src/interfaces}/Layout.d.ts +0 -0
  123. package/lib/dist/{interfaces → src/interfaces}/Layout.js +0 -0
  124. package/lib/dist/{interfaces → src/interfaces}/NavigationComponent.d.ts +0 -0
  125. package/lib/dist/{interfaces → src/interfaces}/NavigationComponent.js +8 -1
  126. package/lib/dist/{interfaces → src/interfaces}/NavigationComponentListener.d.ts +0 -0
  127. package/lib/dist/{interfaces → src/interfaces}/NavigationComponentListener.js +0 -0
  128. package/lib/dist/{interfaces → src/interfaces}/NavigationComponentProps.d.ts +0 -0
  129. package/lib/dist/{interfaces → src/interfaces}/NavigationComponentProps.js +0 -0
  130. package/lib/dist/{interfaces → src/interfaces}/NavigationFunctionComponent.d.ts +0 -0
  131. package/lib/dist/{interfaces → src/interfaces}/NavigationFunctionComponent.js +0 -0
  132. package/lib/dist/{interfaces → src/interfaces}/Options.d.ts +0 -0
  133. package/lib/dist/{interfaces → src/interfaces}/Options.js +0 -0
  134. package/lib/dist/{interfaces → src/interfaces}/ProcessorSubscription.d.ts +0 -0
  135. package/lib/dist/{interfaces → src/interfaces}/ProcessorSubscription.js +0 -0
  136. package/lib/dist/{interfaces → src/interfaces}/Processors.d.ts +0 -0
  137. package/lib/dist/{interfaces → src/interfaces}/Processors.js +0 -0
  138. package/lib/dist/{processors → src/processors}/LayoutProcessor.d.ts +0 -0
  139. package/lib/dist/{processors → src/processors}/LayoutProcessor.js +1 -0
  140. package/lib/dist/{processors → src/processors}/LayoutProcessorsStore.d.ts +0 -0
  141. package/lib/dist/{processors → src/processors}/LayoutProcessorsStore.js +1 -3
  142. package/lib/dist/{processors → src/processors}/OptionProcessorsStore.d.ts +0 -0
  143. package/lib/dist/{processors → src/processors}/OptionProcessorsStore.js +1 -3
  144. package/lib/dist/{types.d.ts → src/types.d.ts} +0 -0
  145. package/lib/dist/{types.js → src/types.js} +0 -0
  146. package/lib/ios/AnimationObserver.h +17 -0
  147. package/lib/ios/AnimationObserver.m +41 -0
  148. package/lib/ios/RNNCommandsHandler.m +14 -4
  149. package/lib/ios/RNNComponentViewController.m +2 -0
  150. package/lib/ios/RNNExternalViewController.m +2 -0
  151. package/lib/ios/RNNSwizzles.m +20 -0
  152. package/lib/ios/ReactNativeNavigation.xcodeproj/project.pbxproj +8 -0
  153. package/lib/src/commands/OptionsCrawler.ts +2 -1
  154. package/lib/src/events/ComponentEventsObserver.ts +5 -1
  155. package/lib/src/events/EventsRegistry.ts +2 -1
  156. package/package.json +6 -6
  157. package/tsconfig.mocks.json +7 -0
  158. package/lib/dist/adapters/ColorService.d.ts +0 -3
  159. package/lib/dist/adapters/TouchablePreview.js +0 -91
  160. package/lib/dist/commands/Deprecations.js +0 -82
  161. package/lib/dist/index.js +0 -22
@@ -1,6 +1,6 @@
1
1
  import { EmitterSubscription } from 'react-native';
2
- import { ComponentWillAppearEvent, ComponentDidAppearEvent, ComponentDidDisappearEvent, NavigationButtonPressedEvent, SearchBarUpdatedEvent, SearchBarCancelPressedEvent, PreviewCompletedEvent, ModalDismissedEvent, ScreenPoppedEvent, ModalAttemptedToDismissEvent } from '../../interfaces/ComponentEvents';
3
- import { CommandCompletedEvent, BottomTabSelectedEvent, BottomTabLongPressedEvent, BottomTabPressedEvent } from '../../interfaces/Events';
2
+ import { ComponentWillAppearEvent, ComponentDidAppearEvent, ComponentDidDisappearEvent, NavigationButtonPressedEvent, SearchBarUpdatedEvent, SearchBarCancelPressedEvent, PreviewCompletedEvent, ModalDismissedEvent, ScreenPoppedEvent, ModalAttemptedToDismissEvent } from '../../src/interfaces/ComponentEvents';
3
+ import { CommandCompletedEvent, BottomTabSelectedEvent, BottomTabLongPressedEvent, BottomTabPressedEvent } from '../../src/interfaces/Events';
4
4
  export declare class NativeEventsReceiver {
5
5
  registerAppLaunchedListener(callback: () => void): EmitterSubscription;
6
6
  registerComponentWillAppearListener(callback: (event: ComponentWillAppearEvent) => void): EmitterSubscription;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NativeEventsReceiver = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const lodash_1 = tslib_1.__importDefault(require("lodash"));
5
+ const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
6
6
  const EventsStore_1 = require("./../Stores/EventsStore");
7
7
  class NativeEventsReceiver {
8
8
  registerAppLaunchedListener(callback) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NavigationRoot = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const isArray_1 = tslib_1.__importDefault(require("lodash/isArray"));
5
+ const isArray_1 = (0, tslib_1.__importDefault)(require("lodash/isArray"));
6
6
  const UniqueIdProvider_1 = require("./adapters/UniqueIdProvider");
7
7
  const Store_1 = require("./components/Store");
8
8
  const OptionProcessorsStore_1 = require("./processors/OptionProcessorsStore");
@@ -24,11 +24,27 @@ const LayoutProcessor_1 = require("./processors/LayoutProcessor");
24
24
  const LayoutProcessorsStore_1 = require("./processors/LayoutProcessorsStore");
25
25
  const OptionsCrawler_1 = require("./commands/OptionsCrawler");
26
26
  class NavigationRoot {
27
+ nativeCommandsSender;
28
+ nativeEventsReceiver;
29
+ appRegistryService;
30
+ TouchablePreview = TouchablePreview_1.TouchablePreview;
31
+ store;
32
+ optionProcessorsStore;
33
+ layoutProcessorsStore;
34
+ uniqueIdProvider;
35
+ componentRegistry;
36
+ layoutTreeParser;
37
+ layoutTreeCrawler;
38
+ commands;
39
+ eventsRegistry;
40
+ commandsObserver;
41
+ componentEventsObserver;
42
+ componentWrapper;
43
+ optionsCrawler;
27
44
  constructor(nativeCommandsSender, nativeEventsReceiver, appRegistryService) {
28
45
  this.nativeCommandsSender = nativeCommandsSender;
29
46
  this.nativeEventsReceiver = nativeEventsReceiver;
30
47
  this.appRegistryService = appRegistryService;
31
- this.TouchablePreview = TouchablePreview_1.TouchablePreview;
32
48
  this.componentWrapper = new ComponentWrapper_1.ComponentWrapper();
33
49
  this.store = new Store_1.Store();
34
50
  this.optionProcessorsStore = new OptionProcessorsStore_1.OptionProcessorsStore();
@@ -147,7 +163,7 @@ class NavigationRoot {
147
163
  * Sets new root component to stack.
148
164
  */
149
165
  setStackRoot(componentId, layout) {
150
- const children = isArray_1.default(layout) ? layout : [layout];
166
+ const children = (0, isArray_1.default)(layout) ? layout : [layout];
151
167
  return this.commands.setStackRoot(componentId, children);
152
168
  }
153
169
  /**
@@ -6,6 +6,7 @@ const NativeCommandsSender_1 = require("./adapters/NativeCommandsSender");
6
6
  const NativeEventsReceiver_1 = require("./adapters/NativeEventsReceiver");
7
7
  const AppRegistryService_1 = require("./adapters/AppRegistryService");
8
8
  class NavigationDelegate {
9
+ concreteNavigation;
9
10
  constructor() {
10
11
  this.concreteNavigation = this.createConcreteNavigation(new NativeCommandsSender_1.NativeCommandsSender(), new NativeEventsReceiver_1.NativeEventsReceiver(), new AppRegistryService_1.AppRegistryService());
11
12
  }
@@ -0,0 +1,3 @@
1
+ export declare class ColorService {
2
+ toNativeColor(inputColor: string): import("react-native").ProcessedColorValue | null | undefined;
3
+ }
@@ -4,7 +4,7 @@ exports.ColorService = void 0;
4
4
  const react_native_1 = require("react-native");
5
5
  class ColorService {
6
6
  toNativeColor(inputColor) {
7
- return react_native_1.processColor(inputColor);
7
+ return (0, react_native_1.processColor)(inputColor);
8
8
  }
9
9
  }
10
10
  exports.ColorService = ColorService;
@@ -3,12 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Constants = void 0;
4
4
  const react_native_1 = require("react-native");
5
5
  class Constants {
6
- constructor(constants) {
7
- this.statusBarHeight = constants.statusBarHeight;
8
- this.topBarHeight = constants.topBarHeight;
9
- this.backButtonId = constants.backButtonId;
10
- this.bottomTabsHeight = constants.bottomTabsHeight;
11
- }
12
6
  static async get() {
13
7
  const constants = await react_native_1.NativeModules.RNNBridgeModule.getNavigationConstants();
14
8
  return new Constants(constants);
@@ -16,5 +10,15 @@ class Constants {
16
10
  static getSync() {
17
11
  return new Constants(react_native_1.NativeModules.RNNBridgeModule.getNavigationConstantsSync());
18
12
  }
13
+ statusBarHeight;
14
+ backButtonId;
15
+ topBarHeight;
16
+ bottomTabsHeight;
17
+ constructor(constants) {
18
+ this.statusBarHeight = constants.statusBarHeight;
19
+ this.topBarHeight = constants.topBarHeight;
20
+ this.backButtonId = constants.backButtonId;
21
+ this.bottomTabsHeight = constants.bottomTabsHeight;
22
+ }
19
23
  }
20
24
  exports.Constants = Constants;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NativeCommandsSender = void 0;
4
4
  const react_native_1 = require("react-native");
5
5
  class NativeCommandsSender {
6
+ nativeCommandsModule;
6
7
  constructor() {
7
8
  this.nativeCommandsModule = react_native_1.NativeModules.RNNBridgeModule;
8
9
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NativeEventsReceiver = void 0;
4
4
  const react_native_1 = require("react-native");
5
5
  class NativeEventsReceiver {
6
+ emitter;
6
7
  constructor() {
7
8
  // NOTE: This try catch is workaround for integration tests
8
9
  // TODO: mock NativeEventEmitter in integration tests rather done adding try catch in source code
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TouchablePreview = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = (0, tslib_1.__importStar)(require("react"));
6
+ const PropTypes = (0, tslib_1.__importStar)(require("prop-types"));
7
+ const react_native_1 = require("react-native");
8
+ const PREVIEW_DELAY = 350;
9
+ const PREVIEW_MIN_FORCE = 0.1;
10
+ const PREVIEW_TIMEOUT = 1250;
11
+ class TouchablePreview extends React.PureComponent {
12
+ static propTypes = {
13
+ children: PropTypes.node,
14
+ touchableComponent: PropTypes.func,
15
+ onPress: PropTypes.func,
16
+ onPressIn: PropTypes.func,
17
+ onPeekIn: PropTypes.func,
18
+ onPeekOut: PropTypes.func,
19
+ label: PropTypes.string,
20
+ };
21
+ static defaultProps = {
22
+ touchableComponent: react_native_1.TouchableWithoutFeedback,
23
+ };
24
+ static peeking = false;
25
+ timeout;
26
+ touchStartedAt = 0;
27
+ onRef = React.createRef();
28
+ onPress = () => {
29
+ const { onPress } = this.props;
30
+ if (typeof onPress !== 'function' || TouchablePreview.peeking) {
31
+ return;
32
+ }
33
+ return onPress();
34
+ };
35
+ onPressIn = () => {
36
+ if (react_native_1.Platform.OS === 'ios') {
37
+ const { onPressIn } = this.props;
38
+ if (!onPressIn) {
39
+ return;
40
+ }
41
+ const reactTag = (0, react_native_1.findNodeHandle)(this.onRef.current);
42
+ return onPressIn({ reactTag });
43
+ }
44
+ // Other platforms don't support 3D Touch Preview API
45
+ return null;
46
+ };
47
+ onTouchStart = (event) => {
48
+ // Store a timestamp of the initial touch start
49
+ this.touchStartedAt = event.nativeEvent.timestamp;
50
+ };
51
+ onTouchMove = (event) => {
52
+ clearTimeout(this.timeout);
53
+ const { force, timestamp } = event.nativeEvent;
54
+ const diff = timestamp - this.touchStartedAt;
55
+ if (force > PREVIEW_MIN_FORCE && diff > PREVIEW_DELAY) {
56
+ TouchablePreview.peeking = true;
57
+ if (typeof this.props.onPeekIn === 'function') {
58
+ this.props.onPeekIn();
59
+ }
60
+ }
61
+ //@ts-ignore
62
+ this.timeout = setTimeout(this.onTouchEnd, PREVIEW_TIMEOUT);
63
+ };
64
+ onTouchEnd = () => {
65
+ clearTimeout(this.timeout);
66
+ TouchablePreview.peeking = false;
67
+ if (typeof this.props.onPeekOut === 'function') {
68
+ this.props.onPeekOut();
69
+ }
70
+ };
71
+ render() {
72
+ const { children, touchableComponent, ...props } = this.props;
73
+ // Default to TouchableWithoutFeedback for iOS if set to TouchableNativeFeedback
74
+ const Touchable = react_native_1.Platform.OS === 'ios' && touchableComponent instanceof react_native_1.TouchableNativeFeedback
75
+ ? react_native_1.TouchableWithoutFeedback
76
+ : touchableComponent;
77
+ // Wrap component with Touchable for handling platform touches
78
+ // and a single react View for detecting force and timing.
79
+ return (
80
+ /**
81
+ * @TODO (Jin Shin 25 June 2020)
82
+ * Ignoring this for now so that it builds.
83
+ */
84
+ // @ts-ignore
85
+ React.createElement(Touchable, { ...props, ref: this.onRef, onPress: this.onPress, onPressIn: this.onPressIn },
86
+ React.createElement(react_native_1.View, { onTouchStart: this.onTouchStart, onTouchMove: this.onTouchMove, onTouchEnd: this.onTouchEnd }, children)));
87
+ }
88
+ }
89
+ exports.TouchablePreview = TouchablePreview;
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UniqueIdProvider = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const uniqueId_1 = tslib_1.__importDefault(require("lodash/uniqueId"));
5
+ const uniqueId_1 = (0, tslib_1.__importDefault)(require("lodash/uniqueId"));
6
6
  class UniqueIdProvider {
7
7
  generate(prefix) {
8
- return uniqueId_1.default(prefix);
8
+ return (0, uniqueId_1.default)(prefix);
9
9
  }
10
10
  }
11
11
  exports.UniqueIdProvider = UniqueIdProvider;
@@ -2,11 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Commands = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const cloneDeepWith_1 = tslib_1.__importDefault(require("lodash/cloneDeepWith"));
6
- const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
7
- const map_1 = tslib_1.__importDefault(require("lodash/map"));
5
+ const cloneDeepWith_1 = (0, tslib_1.__importDefault)(require("lodash/cloneDeepWith"));
6
+ const cloneDeep_1 = (0, tslib_1.__importDefault)(require("lodash/cloneDeep"));
7
+ const map_1 = (0, tslib_1.__importDefault)(require("lodash/map"));
8
8
  const CommandName_1 = require("../interfaces/CommandName");
9
9
  class Commands {
10
+ store;
11
+ nativeCommandsSender;
12
+ layoutTreeParser;
13
+ layoutTreeCrawler;
14
+ commandsObserver;
15
+ uniqueIdProvider;
16
+ optionsProcessor;
17
+ layoutProcessor;
18
+ optionsCrawler;
10
19
  constructor(store, nativeCommandsSender, layoutTreeParser, layoutTreeCrawler, commandsObserver, uniqueIdProvider, optionsProcessor, layoutProcessor, optionsCrawler) {
11
20
  this.store = store;
12
21
  this.nativeCommandsSender = nativeCommandsSender;
@@ -23,12 +32,12 @@ class Commands {
23
32
  this.optionsCrawler.crawl(input.root);
24
33
  const processedRoot = this.layoutProcessor.process(input.root, CommandName_1.CommandName.SetRoot);
25
34
  const root = this.layoutTreeParser.parse(processedRoot);
26
- const modals = map_1.default(input.modals, (modal) => {
35
+ const modals = (0, map_1.default)(input.modals, (modal) => {
27
36
  this.optionsCrawler.crawl(modal);
28
37
  const processedModal = this.layoutProcessor.process(modal, CommandName_1.CommandName.SetRoot);
29
38
  return this.layoutTreeParser.parse(processedModal);
30
39
  });
31
- const overlays = map_1.default(input.overlays, (overlay) => {
40
+ const overlays = (0, map_1.default)(input.overlays, (overlay) => {
32
41
  this.optionsCrawler.crawl(overlay);
33
42
  const processedOverlay = this.layoutProcessor.process(overlay, CommandName_1.CommandName.SetRoot);
34
43
  return this.layoutTreeParser.parse(processedOverlay);
@@ -49,13 +58,13 @@ class Commands {
49
58
  return result;
50
59
  }
51
60
  setDefaultOptions(options) {
52
- const input = cloneDeep_1.default(options);
61
+ const input = (0, cloneDeep_1.default)(options);
53
62
  this.optionsProcessor.processDefaultOptions(input, CommandName_1.CommandName.SetDefaultOptions);
54
63
  this.nativeCommandsSender.setDefaultOptions(input);
55
64
  this.commandsObserver.notify(CommandName_1.CommandName.SetDefaultOptions, { options });
56
65
  }
57
66
  mergeOptions(componentId, options) {
58
- const input = cloneDeep_1.default(options);
67
+ const input = (0, cloneDeep_1.default)(options);
59
68
  this.optionsProcessor.processOptions(CommandName_1.CommandName.MergeOptions, input);
60
69
  const component = this.store.getComponentInstance(componentId);
61
70
  if (component && !component.isMounted)
@@ -129,7 +138,7 @@ class Commands {
129
138
  return result;
130
139
  }
131
140
  setStackRoot(componentId, children) {
132
- const input = map_1.default(cloneLayout(children), (simpleApi) => {
141
+ const input = (0, map_1.default)(cloneLayout(children), (simpleApi) => {
133
142
  this.optionsCrawler.crawl(simpleApi);
134
143
  const layoutProcessed = this.layoutProcessor.process(simpleApi, CommandName_1.CommandName.SetStackRoot);
135
144
  const layout = this.layoutTreeParser.parse(layoutProcessed);
@@ -179,7 +188,7 @@ class Commands {
179
188
  }
180
189
  exports.Commands = Commands;
181
190
  function cloneLayout(layout) {
182
- return cloneDeepWith_1.default(layout, (value, key) => {
191
+ return (0, cloneDeepWith_1.default)(layout, (value, key) => {
183
192
  if (key === 'passProps' && typeof value === 'object' && value !== null)
184
193
  return { ...value };
185
194
  });
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Deprecations = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const once_1 = (0, tslib_1.__importDefault)(require("lodash/once"));
6
+ const get_1 = (0, tslib_1.__importDefault)(require("lodash/get"));
7
+ const each_1 = (0, tslib_1.__importDefault)(require("lodash/each"));
8
+ const react_native_1 = require("react-native");
9
+ class Deprecations {
10
+ deprecatedOptions = [
11
+ {
12
+ key: 'topBar.searchBarHiddenWhenScrolling',
13
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
14
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
15
+ }),
16
+ },
17
+ {
18
+ key: 'topBar.searchBarPlaceholder',
19
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
20
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
21
+ }),
22
+ },
23
+ {
24
+ key: 'topBar.searchBarBackgroundColor',
25
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
26
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
27
+ }),
28
+ },
29
+ {
30
+ key: 'topBar.searchBarTintColor',
31
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
32
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
33
+ }),
34
+ },
35
+ {
36
+ key: 'topBar.hideNavBarOnFocusSearchBar',
37
+ showWarning: (0, once_1.default)((_key, parentOptions) => {
38
+ console.warn(`${_key} is deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
39
+ }),
40
+ },
41
+ ];
42
+ checkForDeprecatedOptions(options) {
43
+ (0, each_1.default)(this.deprecatedOptions, (option) => {
44
+ if ((0, get_1.default)(options, option.key, null)) {
45
+ option.showWarning(option.key, options);
46
+ }
47
+ });
48
+ }
49
+ onProcessOptions(key, parentOptions, commandName) {
50
+ if (key === 'bottomTabs' &&
51
+ parentOptions[key]?.visible !== undefined &&
52
+ react_native_1.Platform.OS === 'ios' &&
53
+ commandName === 'mergeOptions') {
54
+ this.deprecateBottomTabsVisibility(parentOptions);
55
+ }
56
+ if (key === 'searchBar' && react_native_1.Platform.OS === 'ios' && typeof parentOptions[key] === 'boolean') {
57
+ this.deprecateSearchBarOptions(parentOptions);
58
+ }
59
+ if (key === 'interpolation' && typeof parentOptions[key] === 'string') {
60
+ this.deprecateInterpolationOptions(parentOptions);
61
+ }
62
+ if (key === 'showModal' || key === 'dismissModal') {
63
+ if (typeof parentOptions[key] === 'object' &&
64
+ !('enter' in parentOptions[key]) &&
65
+ !('exit' in parentOptions[key]))
66
+ console.warn(`${key} without enter/exit is deprecated, and will be changed in the next major version. For more information see https://wix.github.io/react-native-navigation/docs/style-animations#modal-animations`, parentOptions);
67
+ }
68
+ }
69
+ onProcessDefaultOptions(_key, _parentOptions) { }
70
+ deprecateSearchBarOptions = (0, once_1.default)((parentOptions) => {
71
+ console.warn(`toggling searchBar visibility using a boolean value will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/issues/6585`, parentOptions);
72
+ });
73
+ deprecateInterpolationOptions = (0, once_1.default)((parentOptions) => {
74
+ console.warn(`Using Interpolation types as strings has been deprecated and will be removed in the next major version. For more information see https://github.com/wix/react-native-navigation/pull/6644`, parentOptions);
75
+ });
76
+ deprecateBottomTabsVisibility = (0, once_1.default)((parentOptions) => {
77
+ console.warn(`toggling bottomTabs visibility is deprecated on iOS. For more information see https://github.com/wix/react-native-navigation/issues/6416`, parentOptions);
78
+ });
79
+ }
80
+ exports.Deprecations = Deprecations;
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LayoutTreeCrawler = void 0;
4
4
  const LayoutType_1 = require("./LayoutType");
5
5
  class LayoutTreeCrawler {
6
+ store;
7
+ optionsProcessor;
6
8
  constructor(store, optionsProcessor) {
7
9
  this.store = store;
8
10
  this.optionsProcessor = optionsProcessor;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LayoutTreeParser = void 0;
4
4
  const LayoutType_1 = require("./LayoutType");
5
5
  class LayoutTreeParser {
6
+ uniqueIdProvider;
6
7
  constructor(uniqueIdProvider) {
7
8
  this.uniqueIdProvider = uniqueIdProvider;
8
9
  this.parse = this.parse.bind(this);
@@ -2,10 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OptionsCrawler = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
6
- const isFunction_1 = tslib_1.__importDefault(require("lodash/isFunction"));
5
+ const merge_1 = (0, tslib_1.__importDefault)(require("lodash/merge"));
6
+ const isFunction_1 = (0, tslib_1.__importDefault)(require("lodash/isFunction"));
7
7
  const LayoutType_1 = require("./LayoutType");
8
8
  class OptionsCrawler {
9
+ store;
10
+ uniqueIdProvider;
9
11
  constructor(store, uniqueIdProvider) {
10
12
  this.store = store;
11
13
  this.uniqueIdProvider = uniqueIdProvider;
@@ -63,13 +65,13 @@ class OptionsCrawler {
63
65
  }
64
66
  applyStaticOptions(layout) {
65
67
  const staticOptions = this.staticOptionsIfPossible(layout);
66
- layout.options = merge_1.default({}, staticOptions, layout.options);
68
+ layout.options = (0, merge_1.default)({}, staticOptions, layout.options);
67
69
  }
68
70
  staticOptionsIfPossible(layout) {
69
71
  const foundReactGenerator = this.store.getComponentClassForName(layout.name);
70
72
  const reactComponent = foundReactGenerator ? foundReactGenerator() : undefined;
71
73
  if (reactComponent && this.isComponentWithOptions(reactComponent)) {
72
- return isFunction_1.default(reactComponent.options)
74
+ return (0, isFunction_1.default)(reactComponent.options)
73
75
  ? reactComponent.options({ componentId: layout.id, ...layout.passProps } || {})
74
76
  : reactComponent.options;
75
77
  }