react-native-windows 0.66.3 → 0.67.0-preview.3

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 (262) hide show
  1. package/.flowconfig +2 -1
  2. package/CHANGELOG.json +917 -85
  3. package/CHANGELOG.md +352 -37
  4. package/Chakra/Chakra.vcxitems +0 -1
  5. package/Chakra/Chakra.vcxitems.filters +0 -3
  6. package/Chakra/ChakraHelpers.cpp +0 -267
  7. package/Chakra/ChakraInstanceArgs.h +0 -5
  8. package/Chakra/ChakraPlatform.h +0 -4
  9. package/Chakra/ChakraTracing.cpp +0 -33
  10. package/Chakra/ChakraValue.h +0 -4
  11. package/Chakra/Utf8DebugExtensions.cpp +0 -5
  12. package/Chakra/Utf8DebugExtensions.h +0 -6
  13. package/Libraries/ActionSheetIOS/ActionSheetIOS.js +14 -1
  14. package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +2 -0
  15. package/Libraries/Alert/Alert.windows.js +48 -21
  16. package/Libraries/Alert/NativeDialogManagerWindows.js +49 -0
  17. package/Libraries/Animated/AnimatedEvent.js +23 -4
  18. package/Libraries/Animated/NativeAnimatedHelper.js +2 -2
  19. package/Libraries/Animated/components/AnimatedImage.js +3 -3
  20. package/Libraries/Animated/components/AnimatedScrollView.js +3 -3
  21. package/Libraries/Animated/components/AnimatedText.js +3 -3
  22. package/Libraries/Animated/components/AnimatedView.js +1 -3
  23. package/Libraries/Animated/createAnimatedComponent.js +3 -34
  24. package/Libraries/Components/Button.js +3 -0
  25. package/Libraries/Components/Button.windows.js +70 -38
  26. package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
  27. package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
  28. package/Libraries/Components/Flyout/Flyout.js +3 -3
  29. package/Libraries/Components/Flyout/Flyout.js.map +1 -1
  30. package/Libraries/Components/Flyout/FlyoutProps.d.ts +4 -0
  31. package/Libraries/Components/Flyout/FlyoutProps.js.map +1 -1
  32. package/Libraries/Components/Glyph/Glyph.js +2 -2
  33. package/Libraries/Components/Glyph/Glyph.js.map +1 -1
  34. package/Libraries/Components/Keyboard/KeyboardExt.js +4 -3
  35. package/Libraries/Components/Keyboard/KeyboardExt.js.map +1 -1
  36. package/Libraries/Components/Popup/Popup.js +3 -3
  37. package/Libraries/Components/Popup/Popup.js.map +1 -1
  38. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
  39. package/Libraries/Components/ScrollView/ScrollView.js +17 -16
  40. package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
  41. package/Libraries/Components/View/View.js +1 -1
  42. package/Libraries/Components/View/View.windows.js +1 -1
  43. package/Libraries/Components/View/ViewAccessibility.js +1 -1
  44. package/Libraries/Components/View/ViewAccessibility.windows.js +1 -1
  45. package/Libraries/Components/View/ViewWindows.js +1 -1
  46. package/Libraries/Components/View/ViewWindows.js.map +1 -1
  47. package/Libraries/Components/View/ViewWindowsProps.d.ts +42 -2
  48. package/Libraries/Components/View/ViewWindowsProps.js.map +1 -1
  49. package/Libraries/Core/ExceptionsManager.js +45 -80
  50. package/Libraries/Core/ExtendedError.js +0 -1
  51. package/Libraries/Core/ReactNativeVersion.js +2 -2
  52. package/Libraries/Core/setUpBatchedBridge.js +1 -1
  53. package/Libraries/Core/setUpGlobals.js +2 -4
  54. package/Libraries/Core/setUpTimers.js +2 -2
  55. package/Libraries/Image/Image.ios.js +6 -0
  56. package/Libraries/Image/Image.windows.js +6 -0
  57. package/Libraries/Image/ImageBackground.js +10 -8
  58. package/Libraries/Image/ImageProps.js +28 -0
  59. package/Libraries/LogBox/Data/LogBoxData.js +18 -19
  60. package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
  61. package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
  62. package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
  63. package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
  64. package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
  65. package/Libraries/NewAppScreen/components/logo.png +0 -0
  66. package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +2 -1
  67. package/Libraries/PermissionsAndroid/PermissionsAndroid.js +2 -0
  68. package/Libraries/Pressability/Pressability.js +13 -13
  69. package/Libraries/Pressability/Pressability.windows.js +13 -13
  70. package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -1
  71. package/Libraries/ReactNative/AppRegistry.js +4 -2
  72. package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +1569 -875
  73. package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +529 -319
  74. package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +570 -362
  75. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +1592 -891
  76. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +521 -311
  77. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +562 -354
  78. package/Libraries/Share/Share.js +1 -1
  79. package/Libraries/StyleSheet/normalizeColor.js +2 -2
  80. package/Libraries/Text/Text.windows.js +1 -0
  81. package/Libraries/Text/TextNativeComponent.windows.js +72 -0
  82. package/Libraries/Text/TextProps.js +1 -7
  83. package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
  84. package/Libraries/Utilities/HMRClient.js +1 -1
  85. package/Microsoft.ReactNative/ABIViewManager.cpp +10 -1
  86. package/Microsoft.ReactNative/ABIViewManager.h +3 -0
  87. package/Microsoft.ReactNative/Base/CoreNativeModules.cpp +0 -6
  88. package/Microsoft.ReactNative/IReactDispatcher.cpp +16 -1
  89. package/Microsoft.ReactNative/IViewManager.idl +25 -0
  90. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +35 -8
  91. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj.filters +60 -0
  92. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.cpp +3 -4
  93. package/Microsoft.ReactNative/Modules/AccessibilityInfoModule.h +3 -3
  94. package/Microsoft.ReactNative/Modules/AlertModule.cpp +57 -14
  95. package/Microsoft.ReactNative/Modules/AlertModule.h +17 -24
  96. package/Microsoft.ReactNative/Modules/Animated/InterpolationAnimatedNode.cpp +4 -2
  97. package/Microsoft.ReactNative/Modules/Animated/PropsAnimatedNode.cpp +3 -1
  98. package/Microsoft.ReactNative/Modules/AppStateModule.cpp +8 -6
  99. package/Microsoft.ReactNative/Modules/AppStateModule.h +6 -9
  100. package/Microsoft.ReactNative/Modules/DeviceInfoModule.cpp +34 -22
  101. package/Microsoft.ReactNative/Modules/DeviceInfoModule.h +8 -4
  102. package/Microsoft.ReactNative/Modules/I18nManagerModule.cpp +6 -4
  103. package/Microsoft.ReactNative/Modules/I18nManagerModule.h +3 -2
  104. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +47 -95
  105. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.h +28 -17
  106. package/Microsoft.ReactNative/Modules/LinkingManagerModule.cpp +14 -4
  107. package/Microsoft.ReactNative/Modules/NativeUIManager.cpp +1 -1
  108. package/Microsoft.ReactNative/Modules/PaperUIManagerModule.cpp +82 -66
  109. package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +14 -1
  110. package/Microsoft.ReactNative/ReactInstanceSettings.idl +3 -1
  111. package/Microsoft.ReactNative/ReactPointerEventArgs.cpp +37 -0
  112. package/Microsoft.ReactNative/ReactPointerEventArgs.h +28 -0
  113. package/Microsoft.ReactNative/ReactPointerEventArgs.idl +67 -0
  114. package/Microsoft.ReactNative/Utils/TextTransform.h +1 -1
  115. package/Microsoft.ReactNative/Utils/XamlIslandUtils.cpp +24 -10
  116. package/Microsoft.ReactNative/Utils/XamlIslandUtils.h +4 -2
  117. package/Microsoft.ReactNative/Version.rc +2 -19
  118. package/Microsoft.ReactNative/Views/FlyoutViewManager.cpp +57 -2
  119. package/Microsoft.ReactNative/Views/FrameworkElementTransferProperties.cpp +3 -0
  120. package/Microsoft.ReactNative/Views/FrameworkElementViewManager.cpp +7 -2
  121. package/Microsoft.ReactNative/Views/Image/ImageViewManager.cpp +16 -6
  122. package/Microsoft.ReactNative/Views/Image/ReactImage.cpp +18 -11
  123. package/Microsoft.ReactNative/Views/Image/ReactImage.h +3 -1
  124. package/Microsoft.ReactNative/Views/RawTextViewManager.cpp +4 -53
  125. package/Microsoft.ReactNative/Views/RawTextViewManager.h +0 -3
  126. package/Microsoft.ReactNative/Views/ShadowNodeBase.h +5 -0
  127. package/Microsoft.ReactNative/Views/Text/TextHighlighterVisitor.cpp +52 -0
  128. package/Microsoft.ReactNative/Views/Text/TextHighlighterVisitor.h +37 -0
  129. package/Microsoft.ReactNative/Views/Text/TextHitTestUtils.cpp +343 -0
  130. package/Microsoft.ReactNative/Views/Text/TextHitTestUtils.h +13 -0
  131. package/Microsoft.ReactNative/Views/Text/TextHitTestVisitor.cpp +76 -0
  132. package/Microsoft.ReactNative/Views/Text/TextHitTestVisitor.h +32 -0
  133. package/Microsoft.ReactNative/Views/Text/TextParentVisitor.cpp +12 -0
  134. package/Microsoft.ReactNative/Views/Text/TextParentVisitor.h +19 -0
  135. package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.cpp +80 -0
  136. package/Microsoft.ReactNative/Views/Text/TextPropertyChangedParentVisitor.h +43 -0
  137. package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.cpp +21 -0
  138. package/Microsoft.ReactNative/Views/Text/TextTransformParentVisitor.h +23 -0
  139. package/Microsoft.ReactNative/Views/Text/TextTransformVisitor.cpp +70 -0
  140. package/Microsoft.ReactNative/Views/Text/TextTransformVisitor.h +34 -0
  141. package/Microsoft.ReactNative/Views/Text/TextVisitor.cpp +56 -0
  142. package/Microsoft.ReactNative/Views/Text/TextVisitor.h +34 -0
  143. package/Microsoft.ReactNative/Views/Text/TextVisitorScope.h +35 -0
  144. package/Microsoft.ReactNative/Views/Text/TextVisitors.h +47 -0
  145. package/Microsoft.ReactNative/Views/TextViewManager.cpp +112 -103
  146. package/Microsoft.ReactNative/Views/TextViewManager.h +6 -12
  147. package/Microsoft.ReactNative/Views/TouchEventHandler.cpp +171 -129
  148. package/Microsoft.ReactNative/Views/TouchEventHandler.h +19 -15
  149. package/Microsoft.ReactNative/Views/ViewManagerBase.cpp +31 -0
  150. package/Microsoft.ReactNative/Views/ViewManagerBase.h +2 -0
  151. package/Microsoft.ReactNative/Views/ViewViewManager.cpp +0 -5
  152. package/Microsoft.ReactNative/Views/VirtualTextViewManager.cpp +21 -91
  153. package/Microsoft.ReactNative/Views/VirtualTextViewManager.h +5 -8
  154. package/Microsoft.ReactNative/XamlView.h +3 -3
  155. package/Microsoft.ReactNative/packages.config +1 -1
  156. package/Microsoft.ReactNative.Cxx/NativeModules.h +114 -0
  157. package/Microsoft.ReactNative.Cxx/VersionMacros.h +19 -0
  158. package/PropertySheets/External/Microsoft.ReactNative.Common.props +2 -0
  159. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.props +1 -0
  160. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.props +1 -0
  161. package/PropertySheets/Generated/PackageVersion.g.props +19 -0
  162. package/PropertySheets/PackageVersionDefinitions.props +28 -0
  163. package/PropertySheets/React.Cpp.props +2 -0
  164. package/PropertySheets/WinUI.props +1 -1
  165. package/Scripts/Microsoft.ReactNative.Managed.nuspec +1 -1
  166. package/Scripts/copyRNLibraries.js +12 -0
  167. package/Scripts/rnw-dependencies.ps1 +25 -24
  168. package/Shared/HermesSamplingProfiler.cpp +3 -21
  169. package/Shared/JSI/ChakraApi.cpp +1 -37
  170. package/Shared/JSI/ChakraApi.h +0 -4
  171. package/Shared/JSI/ChakraJsiRuntime_edgemode.cpp +1 -5
  172. package/Shared/JSI/ChakraRuntime.cpp +0 -12
  173. package/Shared/JSI/ChakraRuntimeFactory.h +0 -2
  174. package/Shared/Modules/PlatformConstantsModule.cpp +1 -15
  175. package/Shared/OInstance.cpp +6 -19
  176. package/Shared/Shared.vcxitems +0 -1
  177. package/Shared/Shared.vcxitems.filters +0 -3
  178. package/Shared/Utils.cpp +58 -0
  179. package/Shared/Utils.h +3 -0
  180. package/codegen/NativeAccessibilityInfoSpec.g.h +9 -9
  181. package/codegen/NativeAccessibilityManagerSpec.g.h +49 -21
  182. package/codegen/NativeActionSheetManagerSpec.g.h +62 -6
  183. package/codegen/NativeAlertManagerSpec.g.h +4 -4
  184. package/codegen/NativeAnimatedModuleSpec.g.h +10 -10
  185. package/codegen/NativeAnimatedTurboModuleSpec.g.h +10 -10
  186. package/codegen/NativeAppStateSpec.g.h +25 -3
  187. package/codegen/NativeAppearanceSpec.g.h +3 -3
  188. package/codegen/NativeAsyncLocalStorageSpec.g.h +66 -18
  189. package/codegen/NativeAsyncSQLiteDBStorageSpec.g.h +66 -18
  190. package/codegen/NativeBlobModuleSpec.g.h +24 -6
  191. package/codegen/NativeBugReportingSpec.g.h +3 -3
  192. package/codegen/NativeDatePickerAndroidSpec.g.h +3 -3
  193. package/codegen/NativeDevLoadingViewSpec.g.h +3 -3
  194. package/codegen/NativeDeviceInfoSpec.g.h +18 -0
  195. package/codegen/NativeDialogManagerAndroidSpec.g.h +28 -4
  196. package/codegen/NativeDialogManagerWindowsSpec.g.h +77 -0
  197. package/codegen/NativeExceptionsManagerSpec.g.h +11 -11
  198. package/codegen/NativeFileReaderModuleSpec.g.h +6 -6
  199. package/codegen/NativeFrameRateLoggerSpec.g.h +11 -3
  200. package/codegen/NativeI18nManagerSpec.g.h +20 -0
  201. package/codegen/NativeImageEditorSpec.g.h +30 -6
  202. package/codegen/NativeImageLoaderAndroidSpec.g.h +6 -6
  203. package/codegen/NativeImageLoaderIOSSpec.g.h +6 -6
  204. package/codegen/NativeImagePickerIOSSpec.g.h +28 -12
  205. package/codegen/NativeImageStoreAndroidSpec.g.h +3 -3
  206. package/codegen/NativeImageStoreIOSSpec.g.h +21 -9
  207. package/codegen/NativeIntentAndroidSpec.g.h +3 -3
  208. package/codegen/NativeJSCHeapCaptureSpec.g.h +3 -3
  209. package/codegen/NativeJSCSamplingProfilerSpec.g.h +3 -3
  210. package/codegen/NativeJSDevSupportSpec.g.h +18 -0
  211. package/codegen/NativeNetworkingAndroidSpec.g.h +6 -6
  212. package/codegen/NativeNetworkingIOSSpec.g.h +26 -6
  213. package/codegen/NativePermissionsAndroidSpec.g.h +3 -3
  214. package/codegen/NativePlatformConstantsAndroidSpec.g.h +48 -0
  215. package/codegen/NativePlatformConstantsIOSSpec.g.h +38 -0
  216. package/codegen/NativePlatformConstantsWinSpec.g.h +32 -0
  217. package/codegen/NativePushNotificationManagerIOSSpec.g.h +35 -25
  218. package/codegen/NativeRedBoxSpec.g.h +3 -3
  219. package/codegen/NativeSampleTurboModuleSpec.g.h +32 -12
  220. package/codegen/NativeSegmentFetcherSpec.g.h +6 -6
  221. package/codegen/NativeSettingsManagerSpec.g.h +22 -6
  222. package/codegen/NativeShareModuleSpec.g.h +11 -3
  223. package/codegen/NativeSourceCodeSpec.g.h +16 -0
  224. package/codegen/NativeStatusBarManagerAndroidSpec.g.h +21 -3
  225. package/codegen/NativeStatusBarManagerIOSSpec.g.h +30 -6
  226. package/codegen/NativeToastAndroidSpec.g.h +24 -0
  227. package/codegen/NativeUIManagerSpec.g.h +63 -63
  228. package/codegen/NativeVibrationSpec.g.h +3 -3
  229. package/codegen/NativeWebSocketModuleSpec.g.h +9 -3
  230. package/index.js +15 -10
  231. package/index.windows.js +15 -10
  232. package/jest/mockModal.js +31 -0
  233. package/jest/setup.js +5 -3
  234. package/just-task.js +2 -1
  235. package/package.json +23 -20
  236. package/rntypes/BatchedBridge.d.ts +23 -0
  237. package/rntypes/Devtools.d.ts +20 -0
  238. package/rntypes/LaunchScreen.d.ts +9 -0
  239. package/rntypes/globals.d.ts +496 -0
  240. package/rntypes/index.d.ts +9966 -0
  241. package/rntypes/legacy-properties.d.ts +266 -0
  242. package/template/cpp-app/proj/MyApp.vcxproj +0 -5
  243. package/template/cpp-app/src/pch.h +1 -0
  244. package/template/cpp-lib/src/pch.h +3 -0
  245. package/template/cs-app/proj/MyApp.csproj +0 -6
  246. package/typings-index.d.ts +2 -1
  247. package/typings-index.js +7 -5
  248. package/typings-index.js.map +1 -1
  249. package/Chakra/ChakraCoreDebugger.h +0 -147
  250. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
  251. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
  252. package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.windows.js +0 -30
  253. package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
  254. package/Libraries/Components/StaticContainer.react.js +0 -51
  255. package/Libraries/Components/Touchable/ensurePositiveDelayProps.js +0 -25
  256. package/Libraries/Interaction/InteractionMixin.js +0 -54
  257. package/Libraries/ReactNative/queryLayoutByID.js +0 -58
  258. package/Scripts/Microsoft.ChakraCore.ARM64.nuspec +0 -50
  259. package/Scripts/Microsoft.ChakraCore.ARM64.targets +0 -15
  260. package/Shared/JSI/ChakraCoreRuntime.h +0 -59
  261. package/template/cpp-app/keys/MyApp_TemporaryKey.pfx +0 -0
  262. package/template/cs-app/keys/MyApp_TemporaryKey.pfx +0 -0
@@ -11,6 +11,7 @@
11
11
  'use strict';
12
12
 
13
13
  const AnimatedValue = require('./nodes/AnimatedValue');
14
+ const AnimatedValueXY = require('./nodes/AnimatedValueXY');
14
15
  const NativeAnimatedHelper = require('./NativeAnimatedHelper');
15
16
  const ReactNative = require('../Renderer/shims/ReactNative');
16
17
 
@@ -18,7 +19,10 @@ const invariant = require('invariant');
18
19
 
19
20
  const {shouldUseNativeDriver} = require('./NativeAnimatedHelper');
20
21
 
21
- export type Mapping = {[key: string]: Mapping, ...} | AnimatedValue;
22
+ export type Mapping =
23
+ | {[key: string]: Mapping, ...}
24
+ | AnimatedValue
25
+ | AnimatedValueXY;
22
26
  export type EventConfig = {
23
27
  listener?: ?Function,
24
28
  useNativeDriver: boolean,
@@ -41,6 +45,9 @@ function attachNativeEvent(
41
45
  nativeEventPath: path,
42
46
  animatedValueTag: value.__getNativeTag(),
43
47
  });
48
+ } else if (value instanceof AnimatedValueXY) {
49
+ traverse(value.x, path.concat('x'));
50
+ traverse(value.y, path.concat('y'));
44
51
  } else if (typeof value === 'object') {
45
52
  for (const key in value) {
46
53
  traverse(value[key], path.concat(key));
@@ -95,6 +102,13 @@ function validateMapping(argMapping, args) {
95
102
  );
96
103
  return;
97
104
  }
105
+ if (recMapping instanceof AnimatedValueXY) {
106
+ invariant(
107
+ typeof recEvt.x === 'number' && typeof recEvt.y === 'number',
108
+ 'Bad mapping of event key ' + key + ', should be XY but got ' + recEvt,
109
+ );
110
+ return;
111
+ }
98
112
  if (typeof recEvt === 'number') {
99
113
  invariant(
100
114
  recMapping instanceof AnimatedValue,
@@ -204,22 +218,27 @@ class AnimatedEvent {
204
218
  validatedMapping = true;
205
219
  }
206
220
 
207
- const traverse = (recMapping, recEvt, key) => {
221
+ const traverse = (recMapping, recEvt) => {
208
222
  if (recMapping instanceof AnimatedValue) {
209
223
  if (typeof recEvt === 'number') {
210
224
  recMapping.setValue(recEvt);
211
225
  }
226
+ } else if (recMapping instanceof AnimatedValueXY) {
227
+ if (typeof recEvt === 'object') {
228
+ traverse(recMapping.x, recEvt.x);
229
+ traverse(recMapping.y, recEvt.y);
230
+ }
212
231
  } else if (typeof recMapping === 'object') {
213
232
  for (const mappingKey in recMapping) {
214
233
  /* $FlowFixMe[prop-missing] (>=0.120.0) This comment suppresses an
215
234
  * error found when Flow v0.120 was deployed. To see the error,
216
235
  * delete this comment and run Flow. */
217
- traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);
236
+ traverse(recMapping[mappingKey], recEvt[mappingKey]);
218
237
  }
219
238
  }
220
239
  };
221
240
  this._argMapping.forEach((mapping, idx) => {
222
- traverse(mapping, args[idx], 'arg' + idx);
241
+ traverse(mapping, args[idx]);
223
242
  });
224
243
 
225
244
  this._callListeners(...args);
@@ -24,7 +24,7 @@ import invariant from 'invariant';
24
24
 
25
25
  // TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%.
26
26
  const NativeAnimatedModule =
27
- Platform.OS === 'ios' && global.RN$Bridgeless
27
+ Platform.OS === 'ios' && global.RN$Bridgeless === true
28
28
  ? NativeAnimatedTurboModule
29
29
  : NativeAnimatedNonTurboModule;
30
30
 
@@ -355,7 +355,7 @@ function shouldUseNativeDriver(
355
355
  'animated module is missing. Falling back to JS-based animation. To ' +
356
356
  'resolve this, add `RCTAnimation` module to this app, or remove ' +
357
357
  '`useNativeDriver`. ' +
358
- 'Make sure to run `pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md',
358
+ 'Make sure to run `bundle exec pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md',
359
359
  );
360
360
  _warnedMissingNativeAnimated = true;
361
361
  }
@@ -15,9 +15,9 @@ const createAnimatedComponent = require('../createAnimatedComponent');
15
15
 
16
16
  import type {AnimatedComponentType} from '../createAnimatedComponent';
17
17
 
18
- module.exports = (createAnimatedComponent((Image: $FlowFixMe), {
19
- collapsable: false,
20
- }): AnimatedComponentType<
18
+ module.exports = (createAnimatedComponent(
19
+ (Image: $FlowFixMe),
20
+ ): AnimatedComponentType<
21
21
  React.ElementConfig<typeof Image>,
22
22
  React.ElementRef<typeof Image>,
23
23
  >);
@@ -22,9 +22,9 @@ const ScrollViewWithEventThrottle = React.forwardRef((props, ref) => (
22
22
  <ScrollView scrollEventThrottle={0.0001} {...props} ref={ref} />
23
23
  ));
24
24
 
25
- module.exports = (createAnimatedComponent(ScrollViewWithEventThrottle, {
26
- collapsable: false,
27
- }): AnimatedComponentType<
25
+ module.exports = (createAnimatedComponent(
26
+ ScrollViewWithEventThrottle,
27
+ ): AnimatedComponentType<
28
28
  React.ElementConfig<typeof ScrollView>,
29
29
  React.ElementRef<typeof ScrollView>,
30
30
  >);
@@ -15,9 +15,9 @@ const createAnimatedComponent = require('../createAnimatedComponent');
15
15
 
16
16
  import type {AnimatedComponentType} from '../createAnimatedComponent';
17
17
 
18
- module.exports = (createAnimatedComponent((Text: $FlowFixMe), {
19
- collapsable: false,
20
- }): AnimatedComponentType<
18
+ module.exports = (createAnimatedComponent(
19
+ (Text: $FlowFixMe),
20
+ ): AnimatedComponentType<
21
21
  React.ElementConfig<typeof Text>,
22
22
  React.ElementRef<typeof Text>,
23
23
  >);
@@ -15,9 +15,7 @@ const createAnimatedComponent = require('../createAnimatedComponent');
15
15
 
16
16
  import type {AnimatedComponentType} from '../createAnimatedComponent';
17
17
 
18
- module.exports = (createAnimatedComponent(View, {
19
- collapsable: true,
20
- }): AnimatedComponentType<
18
+ module.exports = (createAnimatedComponent(View): AnimatedComponentType<
21
19
  React.ElementConfig<typeof View>,
22
20
  React.ElementRef<typeof View>,
23
21
  >);
@@ -39,13 +39,8 @@ export type AnimatedComponentType<
39
39
  Instance,
40
40
  >;
41
41
 
42
- type AnimatedComponentOptions = {
43
- collapsable?: boolean,
44
- };
45
-
46
42
  function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
47
43
  Component: React.AbstractComponent<Props, Instance>,
48
- options?: AnimatedComponentOptions,
49
44
  ): AnimatedComponentType<Props, Instance> {
50
45
  invariant(
51
46
  typeof Component !== 'function' ||
@@ -210,39 +205,13 @@ function createAnimatedComponent<Props: {+[string]: mixed, ...}, Instance>(
210
205
  this.props.passthroughAnimatedPropExplicitValues || {};
211
206
  const mergedStyle = {...style, ...passthruStyle};
212
207
 
213
- // On Fabric, we always want to ensure the container Animated View is *not*
214
- // flattened.
215
- // Because we do not get a host component ref immediately and thus cannot
216
- // do a proper Fabric vs non-Fabric detection immediately, we default to assuming
217
- // that Fabric *is* enabled until we know otherwise.
218
- // Thus, in Fabric, this view will never be flattened. In non-Fabric, the view will
219
- // not be flattened during the initial render but may be flattened in the second render
220
- // and onwards.
221
- const forceNativeIdFabric =
222
- (this._component == null &&
223
- (options?.collapsable === false || props.collapsable !== true)) ||
224
- this._isFabric();
225
-
226
- const forceNativeId =
227
- props.collapsable ??
228
- (this._propsAnimated.__isNative ||
229
- forceNativeIdFabric ||
230
- options?.collapsable === false);
231
- // The native driver updates views directly through the UI thread so we
232
- // have to make sure the view doesn't get optimized away because it cannot
233
- // go through the NativeViewHierarchyManager since it operates on the shadow
234
- // thread. TODO: T68258846
235
- const collapsableProps = forceNativeId
236
- ? {
237
- nativeID: props.nativeID ?? 'animatedComponent',
238
- collapsable: false,
239
- }
240
- : {};
208
+ // Force `collapsable` to be false so that native view is not flattened.
209
+ // Flattened views cannot be accurately referenced by a native driver.
241
210
  return (
242
211
  <Component
243
212
  {...props}
244
213
  {...passthruProps}
245
- {...collapsableProps}
214
+ collapsable={false}
246
215
  style={mergedStyle}
247
216
  ref={this._setComponentRef}
248
217
  />
@@ -145,6 +145,7 @@ type ButtonProps = $ReadOnly<{|
145
145
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
146
146
  onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
147
147
  accessibilityState?: ?AccessibilityState,
148
+ accessibilityHint?: ?string,
148
149
  |}>;
149
150
 
150
151
  /**
@@ -275,6 +276,7 @@ class Button extends React.Component<ButtonProps> {
275
276
  testID,
276
277
  accessible,
277
278
  accessibilityActions,
279
+ accessibilityHint,
278
280
  onAccessibilityAction,
279
281
  } = this.props;
280
282
  const buttonStyles = [styles.button];
@@ -317,6 +319,7 @@ class Button extends React.Component<ButtonProps> {
317
319
  accessibilityActions={accessibilityActions}
318
320
  onAccessibilityAction={onAccessibilityAction}
319
321
  accessibilityLabel={accessibilityLabel}
322
+ accessibilityHint={accessibilityHint}
320
323
  accessibilityRole="button"
321
324
  accessibilityState={accessibilityState}
322
325
  hasTVPreferredFocus={hasTVPreferredFocus}
@@ -147,6 +147,7 @@ type ButtonProps = $ReadOnly<{|
147
147
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
148
148
  onAccessibilityAction?: ?(event: AccessibilityActionEvent) => mixed,
149
149
  accessibilityState?: ?AccessibilityState,
150
+ accessibilityHint?: ?string,
150
151
 
151
152
  // [Windows
152
153
  /**
@@ -296,6 +297,7 @@ class Button extends React.Component<
296
297
  testID,
297
298
  accessible,
298
299
  accessibilityActions,
300
+ accessibilityHint,
299
301
  onAccessibilityAction,
300
302
  tabIndex,
301
303
  } = this.props;
@@ -339,6 +341,7 @@ class Button extends React.Component<
339
341
  return (
340
342
  <Touchable
341
343
  accessibilityLabel={accessibilityLabel}
344
+ accessibilityHint={accessibilityHint}
342
345
  accessibilityRole="button"
343
346
  accessibilityState={accessibilityState}
344
347
  hasTVPreferredFocus={hasTVPreferredFocus}
@@ -352,7 +355,11 @@ class Button extends React.Component<
352
355
  onPress={onPress}
353
356
  tabIndex={tabIndex}
354
357
  touchSoundDisabled={touchSoundDisabled}
355
- underlayColor={PlatformColor('ButtonBackgroundPressed')}
358
+ underlayColor={
359
+ color
360
+ ? PlatformColor('SolidBackgroundFillColorBaseBrush')
361
+ : PlatformColor('ButtonBackgroundPressed')
362
+ }
356
363
  onShowUnderlay={() => {
357
364
  this.setState({pressed: true});
358
365
  }}
@@ -360,24 +367,12 @@ class Button extends React.Component<
360
367
  this.setState({pressed: false});
361
368
  }}
362
369
  style={
363
- this.state.pressed
364
- ? [
365
- buttonStyles,
366
- {
367
- borderColor: PlatformColor('ButtonBorderBrushPressed'),
368
- borderBottomWidth: 1,
369
- },
370
- ]
370
+ color
371
+ ? {borderRadius: 3}
372
+ : this.state.pressed
373
+ ? [buttonStyles, styles.buttonPressed]
371
374
  : this.state.hover
372
- ? [
373
- buttonStyles,
374
- {
375
- backgroundColor: PlatformColor(
376
- 'ButtonBackgroundPointerOver',
377
- ),
378
- borderColor: PlatformColor('ButtonBorderBrushPointerOver'),
379
- },
380
- ]
375
+ ? [buttonStyles, styles.buttonHover]
381
376
  : buttonStyles
382
377
  }
383
378
  onMouseEnter={() => {
@@ -386,27 +381,52 @@ class Button extends React.Component<
386
381
  onMouseLeave={() => {
387
382
  if (!disabled) this.setState({hover: false});
388
383
  }}>
389
- <Text
384
+ <View
390
385
  style={
391
- this.state.pressed
392
- ? [
393
- textStyles,
394
- {
395
- color: PlatformColor('ButtonForegroundPressed'),
396
- },
397
- ]
398
- : this.state.hover
399
- ? [
400
- textStyles,
401
- {
402
- color: PlatformColor('ButtonForegroundPointerOver'),
403
- },
404
- ]
405
- : textStyles
406
- }
407
- disabled={disabled}>
408
- {formattedTitle}
409
- </Text>
386
+ color
387
+ ? this.state.pressed
388
+ ? [buttonStyles, styles.buttonPressed]
389
+ : buttonStyles
390
+ : {}
391
+ }>
392
+ <View
393
+ style={
394
+ color
395
+ ? this.state.hover
396
+ ? [
397
+ styles.buttonHover,
398
+ {
399
+ backgroundColor: 'rgba(255, 255, 255, 0.1)',
400
+ },
401
+ ]
402
+ : {}
403
+ : {}
404
+ }>
405
+ <Text
406
+ style={
407
+ color
408
+ ? textStyles
409
+ : this.state.pressed
410
+ ? [
411
+ textStyles,
412
+ {
413
+ color: PlatformColor('ButtonForegroundPressed'),
414
+ },
415
+ ]
416
+ : this.state.hover
417
+ ? [
418
+ textStyles,
419
+ {
420
+ color: PlatformColor('ButtonForegroundPointerOver'),
421
+ },
422
+ ]
423
+ : textStyles
424
+ }
425
+ disabled={disabled}>
426
+ {formattedTitle}
427
+ </Text>
428
+ </View>
429
+ </View>
410
430
  </Touchable>
411
431
  );
412
432
  } else {
@@ -416,6 +436,7 @@ class Button extends React.Component<
416
436
  accessibilityActions={accessibilityActions}
417
437
  onAccessibilityAction={onAccessibilityAction}
418
438
  accessibilityLabel={accessibilityLabel}
439
+ accessibilityHint={accessibilityHint}
419
440
  accessibilityRole="button"
420
441
  accessibilityState={accessibilityState}
421
442
  hasTVPreferredFocus={hasTVPreferredFocus}
@@ -505,6 +526,17 @@ const styles = StyleSheet.create({
505
526
  },
506
527
  // Windows]
507
528
  }),
529
+ // [Windows
530
+ buttonHover: {
531
+ backgroundColor: PlatformColor('ButtonBackgroundPointerOver'),
532
+ borderColor: PlatformColor('ButtonBorderBrushPointerOver'),
533
+ borderRadius: 3,
534
+ },
535
+ buttonPressed: {
536
+ borderColor: PlatformColor('ButtonBorderBrushPressed'),
537
+ borderBottomWidth: 1,
538
+ },
539
+ // Windows]
508
540
  });
509
541
 
510
542
  module.exports = Button;
@@ -117,10 +117,6 @@ type Props = $ReadOnly<{|
117
117
  * source of truth.
118
118
  */
119
119
  class DatePickerIOS extends React.Component<Props> {
120
- static DefaultProps: {|mode: $TEMPORARY$string<'datetime'>|} = {
121
- mode: 'datetime',
122
- };
123
-
124
120
  _picker: ?React.ElementRef<typeof RCTDatePickerNativeComponent> = null;
125
121
 
126
122
  componentDidUpdate() {
@@ -142,6 +138,7 @@ class DatePickerIOS extends React.Component<Props> {
142
138
 
143
139
  render(): React.Node {
144
140
  const props = this.props;
141
+ const mode = props.mode ?? 'datetime';
145
142
  invariant(
146
143
  props.date || props.initialDate,
147
144
  'A selected date or initial date should be specified.',
@@ -153,7 +150,7 @@ class DatePickerIOS extends React.Component<Props> {
153
150
  ref={picker => {
154
151
  this._picker = picker;
155
152
  }}
156
- style={getHeight(props.pickerStyle, props.mode)}
153
+ style={getHeight(props.pickerStyle, mode)}
157
154
  date={
158
155
  props.date
159
156
  ? props.date.getTime()
@@ -172,7 +169,7 @@ class DatePickerIOS extends React.Component<Props> {
172
169
  minimumDate={
173
170
  props.minimumDate ? props.minimumDate.getTime() : undefined
174
171
  }
175
- mode={props.mode}
172
+ mode={mode}
176
173
  minuteInterval={props.minuteInterval}
177
174
  timeZoneOffsetInMinutes={props.timeZoneOffsetInMinutes}
178
175
  onChange={this._onChange}
@@ -56,7 +56,7 @@ type Props = $ReadOnly<{|
56
56
  * );
57
57
  * ```
58
58
  */
59
- drawerBackgroundColor: ColorValue,
59
+ drawerBackgroundColor?: ?ColorValue,
60
60
 
61
61
  /**
62
62
  * Specifies the side of the screen from which the drawer will slide in.
@@ -161,11 +161,6 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
161
161
 
162
162
  return {Left: 'left', Right: 'right'};
163
163
  }
164
- static defaultProps: {|
165
- drawerBackgroundColor: 'white',
166
- |} = {
167
- drawerBackgroundColor: 'white',
168
- };
169
164
 
170
165
  _nativeRef = React.createRef<
171
166
  React.ElementRef<typeof AndroidDrawerLayoutNativeComponent>,
@@ -175,6 +170,7 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
175
170
 
176
171
  render(): React.Node {
177
172
  const {
173
+ drawerBackgroundColor = 'white',
178
174
  onDrawerStateChanged,
179
175
  renderNavigationView,
180
176
  onDrawerOpen,
@@ -189,7 +185,7 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
189
185
  styles.drawerSubview,
190
186
  {
191
187
  width: this.props.drawerWidth,
192
- backgroundColor: this.props.drawerBackgroundColor,
188
+ backgroundColor: drawerBackgroundColor,
193
189
  },
194
190
  ]}
195
191
  collapsable={false}>
@@ -220,6 +216,7 @@ class DrawerLayoutAndroid extends React.Component<Props, State> {
220
216
  <AndroidDrawerLayoutNativeComponent
221
217
  {...props}
222
218
  ref={this._nativeRef}
219
+ drawerBackgroundColor={drawerBackgroundColor}
223
220
  drawerWidth={this.props.drawerWidth}
224
221
  drawerPosition={this.props.drawerPosition}
225
222
  drawerLockMode={this.props.drawerLockMode}
@@ -16,7 +16,7 @@ const styles = react_native_1.StyleSheet.create({
16
16
  position: 'absolute',
17
17
  },
18
18
  });
19
- const RCTFlyout = react_native_1.requireNativeComponent('RCTFlyout');
19
+ const RCTFlyout = (0, react_native_1.requireNativeComponent)('RCTFlyout');
20
20
  /**
21
21
  * Renders a flyout component.
22
22
  *
@@ -30,7 +30,7 @@ class Flyout extends react_1.default.Component {
30
30
  // Check if we're given a new target property; we need to resolve it to a node handle before render
31
31
  if (prevState.targetRef !== nextProps.target) {
32
32
  // Map the 'target' property to a node tag to use in the native layer
33
- const newtarget = react_native_1.findNodeHandle(nextProps.target);
33
+ const newtarget = (0, react_native_1.findNodeHandle)(nextProps.target);
34
34
  return {
35
35
  target: newtarget,
36
36
  targetRef: nextProps.target,
@@ -44,7 +44,7 @@ class Flyout extends react_1.default.Component {
44
44
  }
45
45
  render() {
46
46
  const props = { ...this.props };
47
- return (react_1.default.createElement(RCTFlyout, Object.assign({}, props, { target: this.state.target, style: [styles.rctFlyout, this.props.style] })));
47
+ return (react_1.default.createElement(RCTFlyout, { ...props, target: this.state.target, style: [styles.rctFlyout, this.props.style] }));
48
48
  }
49
49
  }
50
50
  exports.Flyout = Flyout;
@@ -1 +1 @@
1
- {"version":3,"file":"Flyout.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Flyout/Flyout.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,CAAC;;;;;;AAEb,kDAA0B;AAC1B,+CAAgF;AAGhF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAC;AAOH,MAAM,SAAS,GAAG,qCAAsB,CAAe,WAAW,CAAC,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAa,MAAO,SAAQ,eAAK,CAAC,SAA2C;IACpE,MAAM,CAAC,wBAAwB,CACpC,SAAuB,EACvB,SAA6B;QAE7B,mGAAmG;QACnG,IAAI,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC,MAAM,EAAE;YAC5C,qEAAqE;YACrE,MAAM,SAAS,GAAkB,6BAAc,CAC7C,SAAS,CAAC,MAIsB,CACjC,CAAC;YAEF,OAAO;gBACL,MAAM,EAAE,SAAS;gBACjB,SAAS,EAAE,SAAS,CAAC,MAAM;aAC5B,CAAC;SACH;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,YAAY,KAAmB;QAC7B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;IACpD,CAAC;IAEM,MAAM;QACX,MAAM,KAAK,GAAG,EAAC,GAAG,IAAI,CAAC,KAAK,EAAC,CAAC;QAE9B,OAAO,CACL,8BAAC,SAAS,oBACJ,KAAK,IACT,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAC3C,CACH,CAAC;IACJ,CAAC;CACF;AAzCD,wBAyCC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n'use strict';\n\nimport React from 'react';\nimport {findNodeHandle, requireNativeComponent, StyleSheet} from 'react-native';\nimport {IFlyoutProps} from './FlyoutProps';\n\nconst styles = StyleSheet.create({\n rctFlyout: {\n position: 'absolute',\n },\n});\n\nexport interface IFlyoutTargetState {\n target?: number | null;\n targetRef?: React.ReactNode;\n}\n\nconst RCTFlyout = requireNativeComponent<IFlyoutProps>('RCTFlyout');\n\n/**\n * Renders a flyout component.\n *\n * This is a controlled component that requires an `onDismiss` callback that\n * updates the `isOpen` prop in order for the component to reflect user actions.\n *\n * @keyword flyout\n */\nexport class Flyout extends React.Component<IFlyoutProps, IFlyoutTargetState> {\n public static getDerivedStateFromProps(\n nextProps: IFlyoutProps,\n prevState: IFlyoutTargetState,\n ): IFlyoutTargetState {\n // Check if we're given a new target property; we need to resolve it to a node handle before render\n if (prevState.targetRef !== nextProps.target) {\n // Map the 'target' property to a node tag to use in the native layer\n const newtarget: number | null = findNodeHandle(\n nextProps.target as\n | null\n | number\n | React.Component<IFlyoutProps, IFlyoutTargetState>\n | React.ComponentClass<Flyout>,\n );\n\n return {\n target: newtarget,\n targetRef: nextProps.target,\n };\n }\n\n return prevState;\n }\n\n constructor(props: IFlyoutProps) {\n super(props);\n this.state = {target: undefined, targetRef: null};\n }\n\n public render(): JSX.Element {\n const props = {...this.props};\n\n return (\n <RCTFlyout\n {...props}\n target={this.state.target}\n style={[styles.rctFlyout, this.props.style]}\n />\n );\n }\n}\n"]}
1
+ {"version":3,"file":"Flyout.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Flyout/Flyout.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,CAAC;;;;;;AAEb,kDAA0B;AAC1B,+CAAgF;AAGhF,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC,CAAC;AAOH,MAAM,SAAS,GAAG,IAAA,qCAAsB,EAAe,WAAW,CAAC,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAa,MAAO,SAAQ,eAAK,CAAC,SAA2C;IACpE,MAAM,CAAC,wBAAwB,CACpC,SAAuB,EACvB,SAA6B;QAE7B,mGAAmG;QACnG,IAAI,SAAS,CAAC,SAAS,KAAK,SAAS,CAAC,MAAM,EAAE;YAC5C,qEAAqE;YACrE,MAAM,SAAS,GAAkB,IAAA,6BAAc,EAC7C,SAAS,CAAC,MAIsB,CACjC,CAAC;YAEF,OAAO;gBACL,MAAM,EAAE,SAAS;gBACjB,SAAS,EAAE,SAAS,CAAC,MAAM;aAC5B,CAAC;SACH;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,YAAY,KAAmB;QAC7B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;IACpD,CAAC;IAEM,MAAM;QACX,MAAM,KAAK,GAAG,EAAC,GAAG,IAAI,CAAC,KAAK,EAAC,CAAC;QAE9B,OAAO,CACL,8BAAC,SAAS,OACJ,KAAK,EACT,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACzB,KAAK,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAC3C,CACH,CAAC;IACJ,CAAC;CACF;AAzCD,wBAyCC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n'use strict';\n\nimport React from 'react';\nimport {findNodeHandle, requireNativeComponent, StyleSheet} from 'react-native';\nimport {IFlyoutProps} from './FlyoutProps';\n\nconst styles = StyleSheet.create({\n rctFlyout: {\n position: 'absolute',\n },\n});\n\nexport interface IFlyoutTargetState {\n target?: number | null;\n targetRef?: React.ReactNode;\n}\n\nconst RCTFlyout = requireNativeComponent<IFlyoutProps>('RCTFlyout');\n\n/**\n * Renders a flyout component.\n *\n * This is a controlled component that requires an `onDismiss` callback that\n * updates the `isOpen` prop in order for the component to reflect user actions.\n *\n * @keyword flyout\n */\nexport class Flyout extends React.Component<IFlyoutProps, IFlyoutTargetState> {\n public static getDerivedStateFromProps(\n nextProps: IFlyoutProps,\n prevState: IFlyoutTargetState,\n ): IFlyoutTargetState {\n // Check if we're given a new target property; we need to resolve it to a node handle before render\n if (prevState.targetRef !== nextProps.target) {\n // Map the 'target' property to a node tag to use in the native layer\n const newtarget: number | null = findNodeHandle(\n nextProps.target as\n | null\n | number\n | React.Component<IFlyoutProps, IFlyoutTargetState>\n | React.ComponentClass<Flyout>,\n );\n\n return {\n target: newtarget,\n targetRef: nextProps.target,\n };\n }\n\n return prevState;\n }\n\n constructor(props: IFlyoutProps) {\n super(props);\n this.state = {target: undefined, targetRef: null};\n }\n\n public render(): JSX.Element {\n const props = {...this.props};\n\n return (\n <RCTFlyout\n {...props}\n target={this.state.target}\n style={[styles.rctFlyout, this.props.style]}\n />\n );\n }\n}\n"]}
@@ -6,9 +6,12 @@
6
6
  import React from 'react';
7
7
  import { ViewProps } from 'react-native';
8
8
  export declare type Placement = 'top' | 'bottom' | 'left' | 'right' | 'full' | 'top-edge-aligned-left' | 'top-edge-aligned-right' | 'bottom-edge-aligned-left' | 'bottom-edge-aligned-right' | 'left-edge-aligned-top' | 'right-edge-aligned-top' | 'left-edge-aligned-bottom' | 'right-edge-aligned-bottom';
9
+ export declare type ShowMode = 'auto' | 'standard' | 'transient' | 'transient-with-dismiss-on-pointer-move-away';
9
10
  export interface IFlyoutProps extends ViewProps {
10
11
  horizontalOffset?: number;
11
12
  isLightDismissEnabled?: boolean;
13
+ autoFocus?: boolean;
14
+ shouldConstrainToRootBounds?: boolean;
12
15
  /**
13
16
  * Specifies whether the area outside the flyout is darkened
14
17
  */
@@ -16,6 +19,7 @@ export interface IFlyoutProps extends ViewProps {
16
19
  isOpen?: boolean;
17
20
  onDismiss?: (isOpen: boolean) => void;
18
21
  placement?: Placement;
22
+ showMode?: ShowMode;
19
23
  target?: React.ReactNode;
20
24
  verticalOffset?: number;
21
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FlyoutProps.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Flyout/FlyoutProps.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\nimport React from 'react';\nimport {ViewProps} from 'react-native';\n\nexport type Placement =\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'full'\n | 'top-edge-aligned-left'\n | 'top-edge-aligned-right'\n | 'bottom-edge-aligned-left'\n | 'bottom-edge-aligned-right'\n | 'left-edge-aligned-top'\n | 'right-edge-aligned-top'\n | 'left-edge-aligned-bottom'\n | 'right-edge-aligned-bottom';\n\nexport interface IFlyoutProps extends ViewProps {\n horizontalOffset?: number;\n isLightDismissEnabled?: boolean;\n\n /**\n * Specifies whether the area outside the flyout is darkened\n */\n isOverlayEnabled?: boolean;\n\n isOpen?: boolean;\n onDismiss?: (isOpen: boolean) => void;\n placement?: Placement;\n target?: React.ReactNode;\n verticalOffset?: number;\n}\n"]}
1
+ {"version":3,"file":"FlyoutProps.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Flyout/FlyoutProps.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\nimport React from 'react';\nimport {ViewProps} from 'react-native';\n\nexport type Placement =\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'full'\n | 'top-edge-aligned-left'\n | 'top-edge-aligned-right'\n | 'bottom-edge-aligned-left'\n | 'bottom-edge-aligned-right'\n | 'left-edge-aligned-top'\n | 'right-edge-aligned-top'\n | 'left-edge-aligned-bottom'\n | 'right-edge-aligned-bottom';\n\nexport type ShowMode =\n | 'auto'\n | 'standard'\n | 'transient'\n | 'transient-with-dismiss-on-pointer-move-away';\n\nexport interface IFlyoutProps extends ViewProps {\n horizontalOffset?: number;\n isLightDismissEnabled?: boolean;\n autoFocus?: boolean;\n shouldConstrainToRootBounds?: boolean;\n\n /**\n * Specifies whether the area outside the flyout is darkened\n */\n isOverlayEnabled?: boolean;\n\n isOpen?: boolean;\n onDismiss?: (isOpen: boolean) => void;\n placement?: Placement;\n showMode?: ShowMode;\n target?: React.ReactNode;\n verticalOffset?: number;\n}\n"]}
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.Glyph = void 0;
12
12
  const react_1 = __importDefault(require("react"));
13
13
  const react_native_1 = require("react-native");
14
- const RCTGlyph = react_native_1.requireNativeComponent('PLYIcon');
14
+ const RCTGlyph = (0, react_native_1.requireNativeComponent)('PLYIcon');
15
15
  /**
16
16
  * Glyph is a wrapper for the Xaml Glyph control
17
17
  *
@@ -23,7 +23,7 @@ class Glyph extends react_1.default.PureComponent {
23
23
  render() {
24
24
  const props = { ...this.props };
25
25
  props.style = this.props.style;
26
- return react_1.default.createElement(RCTGlyph, Object.assign({}, props));
26
+ return react_1.default.createElement(RCTGlyph, { ...props });
27
27
  }
28
28
  }
29
29
  exports.Glyph = Glyph;
@@ -1 +1 @@
1
- {"version":3,"file":"Glyph.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Glyph/Glyph.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,CAAC;;;;;;AAEb,kDAA0B;AAC1B,+CAAoD;AAGpD,MAAM,QAAQ,GAAG,qCAAsB,CAAC,SAAS,CAAC,CAAC;AAEnD;;;;;;GAMG;AACH,MAAa,KAAM,SAAQ,eAAK,CAAC,aAAyB;IACjD,MAAM;QACX,MAAM,KAAK,GAAG,EAAC,GAAG,IAAI,CAAC,KAAK,EAAC,CAAC;QAC9B,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAE/B,OAAO,8BAAC,QAAQ,oBAAK,KAAK,EAAI,CAAC;IACjC,CAAC;CACF;AAPD,sBAOC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n'use strict';\n\nimport React from 'react';\nimport {requireNativeComponent} from 'react-native';\nimport {GlyphProps} from './GlyphProps';\n\nconst RCTGlyph = requireNativeComponent('PLYIcon');\n\n/**\n * Glyph is a wrapper for the Xaml Glyph control\n *\n * This control is used to render Glyphs from a Font file, which might be\n * used similar to SVG to have vector based images that also have the\n * ability to be rendered with a specific color\n */\nexport class Glyph extends React.PureComponent<GlyphProps> {\n public render(): JSX.Element {\n const props = {...this.props};\n props.style = this.props.style;\n\n return <RCTGlyph {...props} />;\n }\n}\n"]}
1
+ {"version":3,"file":"Glyph.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Glyph/Glyph.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,CAAC;;;;;;AAEb,kDAA0B;AAC1B,+CAAoD;AAGpD,MAAM,QAAQ,GAAG,IAAA,qCAAsB,EAAC,SAAS,CAAC,CAAC;AAEnD;;;;;;GAMG;AACH,MAAa,KAAM,SAAQ,eAAK,CAAC,aAAyB;IACjD,MAAM;QACX,MAAM,KAAK,GAAG,EAAC,GAAG,IAAI,CAAC,KAAK,EAAC,CAAC;QAC9B,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;QAE/B,OAAO,8BAAC,QAAQ,OAAK,KAAK,GAAI,CAAC;IACjC,CAAC;CACF;AAPD,sBAOC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n'use strict';\n\nimport React from 'react';\nimport {requireNativeComponent} from 'react-native';\nimport {GlyphProps} from './GlyphProps';\n\nconst RCTGlyph = requireNativeComponent('PLYIcon');\n\n/**\n * Glyph is a wrapper for the Xaml Glyph control\n *\n * This control is used to render Glyphs from a Font file, which might be\n * used similar to SVG to have vector based images that also have the\n * ability to be rendered with a specific color\n */\nexport class Glyph extends React.PureComponent<GlyphProps> {\n public render(): JSX.Element {\n const props = {...this.props};\n props.style = this.props.style;\n\n return <RCTGlyph {...props} />;\n }\n}\n"]}
@@ -10,15 +10,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.supportKeyboard = void 0;
12
12
  const react_1 = __importDefault(require("react"));
13
- exports.supportKeyboard = (WrappedComponent) => {
13
+ const supportKeyboard = (WrappedComponent) => {
14
14
  class SupportKeyboard extends react_1.default.Component {
15
15
  render() {
16
16
  const { forwardedRef, ...rest } = this.props;
17
- return react_1.default.createElement(WrappedComponent, Object.assign({ ref: forwardedRef }, rest));
17
+ return react_1.default.createElement(WrappedComponent, { ref: forwardedRef, ...rest });
18
18
  }
19
19
  }
20
20
  return react_1.default.forwardRef((props, ref) => {
21
- return react_1.default.createElement(SupportKeyboard, Object.assign({}, props, { forwardedRef: ref }));
21
+ return react_1.default.createElement(SupportKeyboard, { ...props, forwardedRef: ref });
22
22
  });
23
23
  };
24
+ exports.supportKeyboard = supportKeyboard;
24
25
  //# sourceMappingURL=KeyboardExt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"KeyboardExt.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Keyboard/KeyboardExt.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,CAAC;;;;;;AAEb,kDAA0B;AAGb,QAAA,eAAe,GAAG,CAC7B,gBAAwC,EACxC,EAAE;IAUF,MAAM,eAAgB,SAAQ,eAAK,CAAC,SAAgC;QAC3D,MAAM;YACX,MAAM,EAAC,YAAY,EAAE,GAAG,IAAI,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;YAC3C,OAAO,8BAAC,gBAAgB,kBAAC,GAAG,EAAE,YAAY,IAAO,IAAU,EAAI,CAAC;QAClE,CAAC;KACF;IAED,OAAO,eAAK,CAAC,UAAU,CACrB,CAAC,KAA+B,EAAE,GAAmB,EAAE,EAAE;QACvD,OAAO,8BAAC,eAAe,oBAAK,KAAK,IAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC3D,CAAC,CACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n'use strict';\n\nimport React from 'react';\nimport {IKeyboardProps} from './KeyboardExtProps';\n\nexport const supportKeyboard = <P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n interface IForwardRefProps {\n forwardedRef: React.Ref<any>;\n }\n\n // children is used to avoid error: Property 'children' does not exist on type 'IntrinsicAttributes & ViewProps &\n // IKeyboardProps & RefAttributes<any>\n type PropsWithoutForwardedRef = P & IKeyboardProps & {children?: any};\n type PropsWithForwardedRef = PropsWithoutForwardedRef & IForwardRefProps;\n\n class SupportKeyboard extends React.Component<PropsWithForwardedRef> {\n public render(): JSX.Element {\n const {forwardedRef, ...rest} = this.props;\n return <WrappedComponent ref={forwardedRef} {...(rest as P)} />;\n }\n }\n\n return React.forwardRef(\n (props: PropsWithoutForwardedRef, ref: React.Ref<any>) => {\n return <SupportKeyboard {...props} forwardedRef={ref} />;\n },\n );\n};\n"]}
1
+ {"version":3,"file":"KeyboardExt.js","sourceRoot":"","sources":["../../../src/Libraries/Components/Keyboard/KeyboardExt.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,YAAY,CAAC;;;;;;AAEb,kDAA0B;AAGnB,MAAM,eAAe,GAAG,CAC7B,gBAAwC,EACxC,EAAE;IAUF,MAAM,eAAgB,SAAQ,eAAK,CAAC,SAAgC;QAC3D,MAAM;YACX,MAAM,EAAC,YAAY,EAAE,GAAG,IAAI,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;YAC3C,OAAO,8BAAC,gBAAgB,IAAC,GAAG,EAAE,YAAY,KAAO,IAAU,GAAI,CAAC;QAClE,CAAC;KACF;IAED,OAAO,eAAK,CAAC,UAAU,CACrB,CAAC,KAA+B,EAAE,GAAmB,EAAE,EAAE;QACvD,OAAO,8BAAC,eAAe,OAAK,KAAK,EAAE,YAAY,EAAE,GAAG,GAAI,CAAC;IAC3D,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,eAAe,mBAwB1B","sourcesContent":["/**\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n * @format\n */\n'use strict';\n\nimport React from 'react';\nimport {IKeyboardProps} from './KeyboardExtProps';\n\nexport const supportKeyboard = <P extends Record<string, any>>(\n WrappedComponent: React.ComponentType<P>,\n) => {\n interface IForwardRefProps {\n forwardedRef: React.Ref<any>;\n }\n\n // children is used to avoid error: Property 'children' does not exist on type 'IntrinsicAttributes & ViewProps &\n // IKeyboardProps & RefAttributes<any>\n type PropsWithoutForwardedRef = P & IKeyboardProps & {children?: any};\n type PropsWithForwardedRef = PropsWithoutForwardedRef & IForwardRefProps;\n\n class SupportKeyboard extends React.Component<PropsWithForwardedRef> {\n public render(): JSX.Element {\n const {forwardedRef, ...rest} = this.props;\n return <WrappedComponent ref={forwardedRef} {...(rest as P)} />;\n }\n }\n\n return React.forwardRef(\n (props: PropsWithoutForwardedRef, ref: React.Ref<any>) => {\n return <SupportKeyboard {...props} forwardedRef={ref} />;\n },\n );\n};\n"]}
@@ -16,7 +16,7 @@ const styles = react_native_1.StyleSheet.create({
16
16
  position: 'absolute',
17
17
  },
18
18
  });
19
- const RCTPopup = react_native_1.requireNativeComponent('RCTPopup');
19
+ const RCTPopup = (0, react_native_1.requireNativeComponent)('RCTPopup');
20
20
  /**
21
21
  * Renders a popup component.
22
22
  *
@@ -30,7 +30,7 @@ class Popup extends react_1.default.Component {
30
30
  // Check if we're given a new target property; we need to resolve it to a node handle before render
31
31
  if (prevState.targetRef !== nextProps.target) {
32
32
  // Map the 'target' property to a node tag to use in the native layer
33
- const newTarget = react_native_1.findNodeHandle(nextProps.target);
33
+ const newTarget = (0, react_native_1.findNodeHandle)(nextProps.target);
34
34
  return {
35
35
  target: newTarget,
36
36
  targetRef: nextProps.target,
@@ -45,7 +45,7 @@ class Popup extends react_1.default.Component {
45
45
  render() {
46
46
  const props = { ...this.props };
47
47
  props.style = [styles.rctPopup, this.props.style];
48
- return react_1.default.createElement(RCTPopup, Object.assign({}, props, { target: this.state.target }));
48
+ return react_1.default.createElement(RCTPopup, { ...props, target: this.state.target });
49
49
  }
50
50
  }
51
51
  exports.Popup = Popup;