react-native-windows 0.81.3 → 0.81.5

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 (71) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/Libraries/NativeComponent/ViewConfigIgnore.windows.js +45 -0
  3. package/Libraries/Renderer/implementations/ReactFabric-dev.js +38 -35
  4. package/Libraries/Renderer/implementations/ReactFabric-prod.js +51 -22
  5. package/Libraries/Renderer/implementations/ReactFabric-profiling.js +54 -24
  6. package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js +36 -33
  7. package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js +5 -5
  8. package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js +5 -5
  9. package/Libraries/Renderer/shims/ReactNativeTypes.js +23 -11
  10. package/Libraries/Renderer/shims/ReactNativeTypes.windows.js +23 -12
  11. package/Microsoft.ReactNative/ABIViewManager.cpp +12 -1
  12. package/Microsoft.ReactNative/ComponentView.idl +2 -0
  13. package/Microsoft.ReactNative/Composition.Input.idl +7 -0
  14. package/Microsoft.ReactNative/CompositionComponentView.idl +5 -0
  15. package/Microsoft.ReactNative/CompositionHwndHost.idl +1 -0
  16. package/Microsoft.ReactNative/CompositionSwitcher.idl +16 -9
  17. package/Microsoft.ReactNative/Fabric/ComponentView.cpp +19 -1
  18. package/Microsoft.ReactNative/Fabric/ComponentView.h +10 -1
  19. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.cpp +12 -0
  20. package/Microsoft.ReactNative/Fabric/Composition/Composition.Input.h +15 -0
  21. package/Microsoft.ReactNative/Fabric/Composition/CompositionContextHelper.cpp +15 -0
  22. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.cpp +75 -0
  23. package/Microsoft.ReactNative/Fabric/Composition/CompositionEventHandler.h +1 -0
  24. package/Microsoft.ReactNative/Fabric/Composition/CompositionHwndHost.cpp +10 -45
  25. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +86 -19
  26. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +4 -0
  27. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.cpp +95 -22
  28. package/Microsoft.ReactNative/Fabric/Composition/ContentIslandComponentView.h +15 -0
  29. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +61 -74
  30. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +71 -12
  31. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +11 -0
  32. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +4 -3
  33. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +2 -1
  34. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.cpp +245 -0
  35. package/Microsoft.ReactNative/Fabric/Composition/ReactNativeWindow.h +80 -0
  36. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +33 -1
  37. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +17 -0
  38. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +47 -23
  39. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +3 -0
  40. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputShadowNode.cpp +3 -1
  41. package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +8 -4
  42. package/Microsoft.ReactNative/Modules/ImageViewManagerModule.cpp +41 -15
  43. package/Microsoft.ReactNative/Modules/LogBoxModule.cpp +20 -95
  44. package/Microsoft.ReactNative/Modules/LogBoxModule.h +1 -1
  45. package/Microsoft.ReactNative/ReactNativeAppBuilder.cpp +0 -41
  46. package/Microsoft.ReactNative/ReactNativeAppBuilder.idl +0 -11
  47. package/Microsoft.ReactNative/ReactNativeIsland.idl +2 -3
  48. package/Microsoft.ReactNative/ReactNativeWin32App.cpp +31 -101
  49. package/Microsoft.ReactNative/ReactNativeWin32App.h +2 -13
  50. package/Microsoft.ReactNative/ReactNativeWindow.idl +44 -0
  51. package/Mso/src/dispatchQueue/queueService.cpp +3 -1
  52. package/Mso/src/dispatchQueue/uiScheduler_winrt.cpp +2 -1
  53. package/PropertySheets/Generated/PackageVersion.g.props +3 -3
  54. package/Shared/Networking/OriginPolicyHttpFilter.cpp +2 -1
  55. package/Shared/Shared.vcxitems +7 -0
  56. package/Shared/Shared.vcxitems.filters +6 -0
  57. package/codegen/react/components/rnwcore/ActivityIndicatorView.g.h +2 -1
  58. package/codegen/react/components/rnwcore/AndroidDrawerLayout.g.h +42 -25
  59. package/codegen/react/components/rnwcore/AndroidHorizontalScrollContentView.g.h +2 -1
  60. package/codegen/react/components/rnwcore/AndroidProgressBar.g.h +2 -1
  61. package/codegen/react/components/rnwcore/AndroidSwipeRefreshLayout.g.h +11 -6
  62. package/codegen/react/components/rnwcore/AndroidSwitch.g.h +11 -6
  63. package/codegen/react/components/rnwcore/DebuggingOverlay.g.h +1 -0
  64. package/codegen/react/components/rnwcore/InputAccessory.g.h +2 -1
  65. package/codegen/react/components/rnwcore/ModalHostView.g.h +40 -23
  66. package/codegen/react/components/rnwcore/PullToRefreshView.g.h +11 -6
  67. package/codegen/react/components/rnwcore/SafeAreaView.g.h +1 -0
  68. package/codegen/react/components/rnwcore/Switch.g.h +11 -6
  69. package/codegen/react/components/rnwcore/UnimplementedNativeView.g.h +2 -1
  70. package/codegen/react/components/rnwcore/VirtualView.g.h +41 -8
  71. package/package.json +21 -21
@@ -7,7 +7,7 @@
7
7
  * @noflow
8
8
  * @nolint
9
9
  * @preventMunge
10
- * @generated SignedSource<<cff8afb4533b426f7c26ccb0475bdf8c>>
10
+ * @generated SignedSource<<918f2971ff54304721b755a22da3df6d>>
11
11
  *
12
12
  * This file was sync'd from the facebook/react repository.
13
13
  */
@@ -405,7 +405,7 @@ __DEV__ &&
405
405
  prevPrepareStackTrace = error.indexOf("\n");
406
406
  -1 !== prevPrepareStackTrace &&
407
407
  (error = error.slice(prevPrepareStackTrace + 1));
408
- prevPrepareStackTrace = error.indexOf("react-stack-bottom-frame");
408
+ prevPrepareStackTrace = error.indexOf("react_stack_bottom_frame");
409
409
  -1 !== prevPrepareStackTrace &&
410
410
  (prevPrepareStackTrace = error.lastIndexOf(
411
411
  "\n",
@@ -16385,7 +16385,7 @@ __DEV__ &&
16385
16385
  }
16386
16386
  };
16387
16387
  var callComponent = {
16388
- "react-stack-bottom-frame": function (Component, props, secondArg) {
16388
+ react_stack_bottom_frame: function (Component, props, secondArg) {
16389
16389
  var wasRendering = isRendering;
16390
16390
  isRendering = !0;
16391
16391
  try {
@@ -16396,9 +16396,9 @@ __DEV__ &&
16396
16396
  }
16397
16397
  },
16398
16398
  callComponentInDEV =
16399
- callComponent["react-stack-bottom-frame"].bind(callComponent),
16399
+ callComponent.react_stack_bottom_frame.bind(callComponent),
16400
16400
  callRender = {
16401
- "react-stack-bottom-frame": function (instance) {
16401
+ react_stack_bottom_frame: function (instance) {
16402
16402
  var wasRendering = isRendering;
16403
16403
  isRendering = !0;
16404
16404
  try {
@@ -16408,9 +16408,9 @@ __DEV__ &&
16408
16408
  }
16409
16409
  }
16410
16410
  },
16411
- callRenderInDEV = callRender["react-stack-bottom-frame"].bind(callRender),
16411
+ callRenderInDEV = callRender.react_stack_bottom_frame.bind(callRender),
16412
16412
  callComponentDidMount = {
16413
- "react-stack-bottom-frame": function (finishedWork, instance) {
16413
+ react_stack_bottom_frame: function (finishedWork, instance) {
16414
16414
  try {
16415
16415
  instance.componentDidMount();
16416
16416
  } catch (error) {
@@ -16418,11 +16418,12 @@ __DEV__ &&
16418
16418
  }
16419
16419
  }
16420
16420
  },
16421
- callComponentDidMountInDEV = callComponentDidMount[
16422
- "react-stack-bottom-frame"
16423
- ].bind(callComponentDidMount),
16421
+ callComponentDidMountInDEV =
16422
+ callComponentDidMount.react_stack_bottom_frame.bind(
16423
+ callComponentDidMount
16424
+ ),
16424
16425
  callComponentDidUpdate = {
16425
- "react-stack-bottom-frame": function (
16426
+ react_stack_bottom_frame: function (
16426
16427
  finishedWork,
16427
16428
  instance,
16428
16429
  prevProps,
@@ -16436,22 +16437,24 @@ __DEV__ &&
16436
16437
  }
16437
16438
  }
16438
16439
  },
16439
- callComponentDidUpdateInDEV = callComponentDidUpdate[
16440
- "react-stack-bottom-frame"
16441
- ].bind(callComponentDidUpdate),
16440
+ callComponentDidUpdateInDEV =
16441
+ callComponentDidUpdate.react_stack_bottom_frame.bind(
16442
+ callComponentDidUpdate
16443
+ ),
16442
16444
  callComponentDidCatch = {
16443
- "react-stack-bottom-frame": function (instance, errorInfo) {
16445
+ react_stack_bottom_frame: function (instance, errorInfo) {
16444
16446
  var stack = errorInfo.stack;
16445
16447
  instance.componentDidCatch(errorInfo.value, {
16446
16448
  componentStack: null !== stack ? stack : ""
16447
16449
  });
16448
16450
  }
16449
16451
  },
16450
- callComponentDidCatchInDEV = callComponentDidCatch[
16451
- "react-stack-bottom-frame"
16452
- ].bind(callComponentDidCatch),
16452
+ callComponentDidCatchInDEV =
16453
+ callComponentDidCatch.react_stack_bottom_frame.bind(
16454
+ callComponentDidCatch
16455
+ ),
16453
16456
  callComponentWillUnmount = {
16454
- "react-stack-bottom-frame": function (
16457
+ react_stack_bottom_frame: function (
16455
16458
  current,
16456
16459
  nearestMountedAncestor,
16457
16460
  instance
@@ -16463,11 +16466,12 @@ __DEV__ &&
16463
16466
  }
16464
16467
  }
16465
16468
  },
16466
- callComponentWillUnmountInDEV = callComponentWillUnmount[
16467
- "react-stack-bottom-frame"
16468
- ].bind(callComponentWillUnmount),
16469
+ callComponentWillUnmountInDEV =
16470
+ callComponentWillUnmount.react_stack_bottom_frame.bind(
16471
+ callComponentWillUnmount
16472
+ ),
16469
16473
  callCreate = {
16470
- "react-stack-bottom-frame": function (effect) {
16474
+ react_stack_bottom_frame: function (effect) {
16471
16475
  null != effect.resourceKind &&
16472
16476
  console.error(
16473
16477
  "Expected only SimpleEffects when enableUseEffectCRUDOverload is disabled, got %s",
@@ -16479,9 +16483,9 @@ __DEV__ &&
16479
16483
  return (effect.destroy = create);
16480
16484
  }
16481
16485
  },
16482
- callCreateInDEV = callCreate["react-stack-bottom-frame"].bind(callCreate),
16486
+ callCreateInDEV = callCreate.react_stack_bottom_frame.bind(callCreate),
16483
16487
  callDestroy = {
16484
- "react-stack-bottom-frame": function (
16488
+ react_stack_bottom_frame: function (
16485
16489
  current,
16486
16490
  nearestMountedAncestor,
16487
16491
  destroy
@@ -16493,16 +16497,15 @@ __DEV__ &&
16493
16497
  }
16494
16498
  }
16495
16499
  },
16496
- callDestroyInDEV =
16497
- callDestroy["react-stack-bottom-frame"].bind(callDestroy),
16500
+ callDestroyInDEV = callDestroy.react_stack_bottom_frame.bind(callDestroy),
16498
16501
  callLazyInit = {
16499
- "react-stack-bottom-frame": function (lazy) {
16502
+ react_stack_bottom_frame: function (lazy) {
16500
16503
  var init = lazy._init;
16501
16504
  return init(lazy._payload);
16502
16505
  }
16503
16506
  },
16504
16507
  callLazyInitInDEV =
16505
- callLazyInit["react-stack-bottom-frame"].bind(callLazyInit),
16508
+ callLazyInit.react_stack_bottom_frame.bind(callLazyInit),
16506
16509
  thenableState = null,
16507
16510
  thenableIndexCounter = 0,
16508
16511
  currentDebugInfo = null,
@@ -16868,11 +16871,11 @@ __DEV__ &&
16868
16871
  shouldSuspendImpl = newShouldSuspendImpl;
16869
16872
  };
16870
16873
  var isomorphicReactPackageVersion = React.version;
16871
- if ("19.1.0" !== isomorphicReactPackageVersion)
16874
+ if ("19.1.4" !== isomorphicReactPackageVersion)
16872
16875
  throw Error(
16873
16876
  'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
16874
16877
  (isomorphicReactPackageVersion +
16875
- "\n - react-native-renderer: 19.1.0\nLearn more: https://react.dev/warnings/version-mismatch")
16878
+ "\n - react-native-renderer: 19.1.4\nLearn more: https://react.dev/warnings/version-mismatch")
16876
16879
  );
16877
16880
  if (
16878
16881
  "function" !==
@@ -16898,10 +16901,10 @@ __DEV__ &&
16898
16901
  (function () {
16899
16902
  var internals = {
16900
16903
  bundleType: 1,
16901
- version: "19.1.0",
16904
+ version: "19.1.4",
16902
16905
  rendererPackageName: "react-native-renderer",
16903
16906
  currentDispatcherRef: ReactSharedInternals,
16904
- reconcilerVersion: "19.1.0"
16907
+ reconcilerVersion: "19.1.4"
16905
16908
  };
16906
16909
  null !== extraDevToolsConfig &&
16907
16910
  (internals.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
7
7
  * @noflow
8
8
  * @nolint
9
9
  * @preventMunge
10
- * @generated SignedSource<<43be62d6fc9b622e265e2acb066ed13c>>
10
+ * @generated SignedSource<<0129ab1b7de2122366e60b1d68de6e4a>>
11
11
  *
12
12
  * This file was sync'd from the facebook/react repository.
13
13
  */
@@ -10603,11 +10603,11 @@ function updateContainer(element, container, parentComponent, callback) {
10603
10603
  return lane;
10604
10604
  }
10605
10605
  var isomorphicReactPackageVersion = React.version;
10606
- if ("19.1.0" !== isomorphicReactPackageVersion)
10606
+ if ("19.1.4" !== isomorphicReactPackageVersion)
10607
10607
  throw Error(
10608
10608
  'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
10609
10609
  (isomorphicReactPackageVersion +
10610
- "\n - react-native-renderer: 19.1.0\nLearn more: https://react.dev/warnings/version-mismatch")
10610
+ "\n - react-native-renderer: 19.1.4\nLearn more: https://react.dev/warnings/version-mismatch")
10611
10611
  );
10612
10612
  if (
10613
10613
  "function" !==
@@ -10656,10 +10656,10 @@ batchedUpdatesImpl = function (fn, a) {
10656
10656
  var roots = new Map(),
10657
10657
  internals$jscomp$inline_1269 = {
10658
10658
  bundleType: 0,
10659
- version: "19.1.0",
10659
+ version: "19.1.4",
10660
10660
  rendererPackageName: "react-native-renderer",
10661
10661
  currentDispatcherRef: ReactSharedInternals,
10662
- reconcilerVersion: "19.1.0"
10662
+ reconcilerVersion: "19.1.4"
10663
10663
  };
10664
10664
  null !== extraDevToolsConfig &&
10665
10665
  (internals$jscomp$inline_1269.rendererConfig = extraDevToolsConfig);
@@ -7,7 +7,7 @@
7
7
  * @noflow
8
8
  * @nolint
9
9
  * @preventMunge
10
- * @generated SignedSource<<d0e536371839f0311bec769f15162a4b>>
10
+ * @generated SignedSource<<d09a614d44bd133ffd789d5236ba611a>>
11
11
  *
12
12
  * This file was sync'd from the facebook/react repository.
13
13
  */
@@ -11245,11 +11245,11 @@ function updateContainer(element, container, parentComponent, callback) {
11245
11245
  return lane;
11246
11246
  }
11247
11247
  var isomorphicReactPackageVersion = React.version;
11248
- if ("19.1.0" !== isomorphicReactPackageVersion)
11248
+ if ("19.1.4" !== isomorphicReactPackageVersion)
11249
11249
  throw Error(
11250
11250
  'Incompatible React versions: The "react" and "react-native-renderer" packages must have the exact same version. Instead got:\n - react: ' +
11251
11251
  (isomorphicReactPackageVersion +
11252
- "\n - react-native-renderer: 19.1.0\nLearn more: https://react.dev/warnings/version-mismatch")
11252
+ "\n - react-native-renderer: 19.1.4\nLearn more: https://react.dev/warnings/version-mismatch")
11253
11253
  );
11254
11254
  if (
11255
11255
  "function" !==
@@ -11298,10 +11298,10 @@ batchedUpdatesImpl = function (fn, a) {
11298
11298
  var roots = new Map(),
11299
11299
  internals$jscomp$inline_1362 = {
11300
11300
  bundleType: 0,
11301
- version: "19.1.0",
11301
+ version: "19.1.4",
11302
11302
  rendererPackageName: "react-native-renderer",
11303
11303
  currentDispatcherRef: ReactSharedInternals,
11304
- reconcilerVersion: "19.1.0"
11304
+ reconcilerVersion: "19.1.4"
11305
11305
  };
11306
11306
  null !== extraDevToolsConfig &&
11307
11307
  (internals$jscomp$inline_1362.rendererConfig = extraDevToolsConfig);
@@ -7,9 +7,14 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict
10
- * @generated SignedSource<<deb7924d11c790f99448a1c2f0edddb9>>
10
+ * @generated SignedSource<<9564768e65343249f5e5ee5074826c7f>>
11
11
  */
12
12
 
13
+ import type {
14
+ Component as ReactComponent,
15
+ ElementRef,
16
+ ElementType,
17
+ } from 'react';
13
18
  import type {
14
19
  // $FlowFixMe[nonstrict-import] TODO(@rubennorte)
15
20
  HostInstance as PublicInstance,
@@ -21,8 +26,6 @@ import type {
21
26
  PublicTextInstance,
22
27
  } from 'react-native';
23
28
 
24
- import * as React from 'react';
25
-
26
29
  export type AttributeType<T, V> =
27
30
  | true
28
31
  | $ReadOnly<{
@@ -35,7 +38,16 @@ export type AttributeType<T, V> =
35
38
  export type AnyAttributeType = AttributeType<$FlowFixMe, $FlowFixMe>;
36
39
 
37
40
  export type AttributeConfiguration = $ReadOnly<{
38
- [propName: string]: AnyAttributeType | void,
41
+ [propName: string]: AnyAttributeType,
42
+ style?: $ReadOnly<{
43
+ [propName: string]: AnyAttributeType,
44
+ ...
45
+ }>,
46
+ ...
47
+ }>;
48
+
49
+ export type PartialAttributeConfiguration = $ReadOnly<{
50
+ [propName: string]: AnyAttributeType,
39
51
  style?: $ReadOnly<{
40
52
  [propName: string]: AnyAttributeType,
41
53
  ...
@@ -75,7 +87,7 @@ export type PartialViewConfig = $ReadOnly<{
75
87
  directEventTypes?: ViewConfig['directEventTypes'],
76
88
  supportsRawText?: boolean,
77
89
  uiViewClassName: string,
78
- validAttributes?: AttributeConfiguration,
90
+ validAttributes?: PartialAttributeConfiguration,
79
91
  }>;
80
92
 
81
93
  type InspectorDataProps = $ReadOnly<{
@@ -84,7 +96,7 @@ type InspectorDataProps = $ReadOnly<{
84
96
  }>;
85
97
 
86
98
  type InspectorDataGetter = (
87
- <TElementType: React.ElementType>(
99
+ <TElementType: ElementType>(
88
100
  componentOrHandle: React.ElementRef<TElementType> | number,
89
101
  ) => ?number,
90
102
  ) => $ReadOnly<{
@@ -128,7 +140,7 @@ export type RenderRootOptions = {
128
140
  +componentStack?: ?string,
129
141
  // $FlowFixMe[unclear-type] unknown props and state.
130
142
  // $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally.
131
- +errorBoundary?: ?React.Component<any, any>,
143
+ +errorBoundary?: ?ReactComponent<any, any>,
132
144
  },
133
145
  ) => void,
134
146
  onRecoverableError?: (
@@ -142,10 +154,10 @@ export type RenderRootOptions = {
142
154
  * Provide minimal Flow typing for the high-level RN API and call it a day.
143
155
  */
144
156
  export type ReactNativeType = {
145
- findHostInstance_DEPRECATED<TElementType: React.ElementType>(
157
+ findHostInstance_DEPRECATED<TElementType: ElementType>(
146
158
  componentOrHandle: ?(React.ElementRef<TElementType> | number),
147
159
  ): ?PublicInstance,
148
- findNodeHandle<TElementType: React.ElementType>(
160
+ findNodeHandle<TElementType: ElementType>(
149
161
  componentOrHandle: ?(React.ElementRef<TElementType> | number),
150
162
  ): ?number,
151
163
  isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
@@ -171,10 +183,10 @@ export opaque type Node = mixed;
171
183
  export opaque type InternalInstanceHandle = mixed;
172
184
 
173
185
  export type ReactFabricType = {
174
- findHostInstance_DEPRECATED<TElementType: React.ElementType>(
186
+ findHostInstance_DEPRECATED<TElementType: ElementType>(
175
187
  componentOrHandle: ?(React.ElementRef<TElementType> | number),
176
188
  ): ?PublicInstance,
177
- findNodeHandle<TElementType: React.ElementType>(
189
+ findNodeHandle<TElementType: ElementType>(
178
190
  componentOrHandle: ?(React.ElementRef<TElementType> | number),
179
191
  ): ?number,
180
192
  dispatchCommand(
@@ -7,11 +7,15 @@
7
7
  * @noformat
8
8
  * @nolint
9
9
  * @flow strict
10
- * @generated SignedSource<<deb7924d11c790f99448a1c2f0edddb9>>
10
+ * @generated SignedSource<<9564768e65343249f5e5ee5074826c7f>>
11
11
  */
12
12
 
13
13
  import type {
14
- // $FlowFixMe[missing-export] TODO(@rubennorte) - Missing export from react-native
14
+ Component as ReactComponent,
15
+ ElementRef,
16
+ ElementType,
17
+ } from 'react';
18
+ import type {
15
19
  // $FlowFixMe[nonstrict-import] TODO(@rubennorte)
16
20
  HostInstance as PublicInstance,
17
21
  // $FlowFixMe[missing-export] TODO(@rubennorte) - Missing export from react-native
@@ -25,8 +29,6 @@ import type {
25
29
  PublicTextInstance,
26
30
  } from 'react-native';
27
31
 
28
- import * as React from 'react';
29
-
30
32
  export type AttributeType<T, V> =
31
33
  | true
32
34
  | $ReadOnly<{
@@ -39,7 +41,16 @@ export type AttributeType<T, V> =
39
41
  export type AnyAttributeType = AttributeType<$FlowFixMe, $FlowFixMe>;
40
42
 
41
43
  export type AttributeConfiguration = $ReadOnly<{
42
- [propName: string]: AnyAttributeType | void,
44
+ [propName: string]: AnyAttributeType,
45
+ style?: $ReadOnly<{
46
+ [propName: string]: AnyAttributeType,
47
+ ...
48
+ }>,
49
+ ...
50
+ }>;
51
+
52
+ export type PartialAttributeConfiguration = $ReadOnly<{
53
+ [propName: string]: AnyAttributeType,
43
54
  style?: $ReadOnly<{
44
55
  [propName: string]: AnyAttributeType,
45
56
  ...
@@ -79,7 +90,7 @@ export type PartialViewConfig = $ReadOnly<{
79
90
  directEventTypes?: ViewConfig['directEventTypes'],
80
91
  supportsRawText?: boolean,
81
92
  uiViewClassName: string,
82
- validAttributes?: AttributeConfiguration,
93
+ validAttributes?: PartialAttributeConfiguration,
83
94
  }>;
84
95
 
85
96
  type InspectorDataProps = $ReadOnly<{
@@ -88,7 +99,7 @@ type InspectorDataProps = $ReadOnly<{
88
99
  }>;
89
100
 
90
101
  type InspectorDataGetter = (
91
- <TElementType: React.ElementType>(
102
+ <TElementType: ElementType>(
92
103
  componentOrHandle: React.ElementRef<TElementType> | number,
93
104
  ) => ?number,
94
105
  ) => $ReadOnly<{
@@ -132,7 +143,7 @@ export type RenderRootOptions = {
132
143
  +componentStack?: ?string,
133
144
  // $FlowFixMe[unclear-type] unknown props and state.
134
145
  // $FlowFixMe[value-as-type] Component in react repo is any-typed, but it will be well typed externally.
135
- +errorBoundary?: ?React.Component<any, any>,
146
+ +errorBoundary?: ?ReactComponent<any, any>,
136
147
  },
137
148
  ) => void,
138
149
  onRecoverableError?: (
@@ -146,10 +157,10 @@ export type RenderRootOptions = {
146
157
  * Provide minimal Flow typing for the high-level RN API and call it a day.
147
158
  */
148
159
  export type ReactNativeType = {
149
- findHostInstance_DEPRECATED<TElementType: React.ElementType>(
160
+ findHostInstance_DEPRECATED<TElementType: ElementType>(
150
161
  componentOrHandle: ?(React.ElementRef<TElementType> | number),
151
162
  ): ?PublicInstance,
152
- findNodeHandle<TElementType: React.ElementType>(
163
+ findNodeHandle<TElementType: ElementType>(
153
164
  componentOrHandle: ?(React.ElementRef<TElementType> | number),
154
165
  ): ?number,
155
166
  isChildPublicInstance(parent: PublicInstance, child: PublicInstance): boolean,
@@ -175,10 +186,10 @@ export opaque type Node = mixed;
175
186
  export opaque type InternalInstanceHandle = mixed;
176
187
 
177
188
  export type ReactFabricType = {
178
- findHostInstance_DEPRECATED<TElementType: React.ElementType>(
189
+ findHostInstance_DEPRECATED<TElementType: ElementType>(
179
190
  componentOrHandle: ?(React.ElementRef<TElementType> | number),
180
191
  ): ?PublicInstance,
181
- findNodeHandle<TElementType: React.ElementType>(
192
+ findNodeHandle<TElementType: ElementType>(
182
193
  componentOrHandle: ?(React.ElementRef<TElementType> | number),
183
194
  ): ?number,
184
195
  dispatchCommand(
@@ -190,8 +190,19 @@ void ABIViewManager::AddView(const xaml::DependencyObject &parent, const xaml::D
190
190
  }
191
191
 
192
192
  void ABIViewManager::RemoveAllChildren(const xaml::DependencyObject &parent) {
193
+ if (!parent) {
194
+ return;
195
+ }
196
+
193
197
  if (m_viewManagerWithChildren) {
194
- m_viewManagerWithChildren.RemoveAllChildren(parent.as<xaml::FrameworkElement>());
198
+ auto fe = parent.try_as<xaml::FrameworkElement>();
199
+ if (fe) {
200
+ try {
201
+ m_viewManagerWithChildren.RemoveAllChildren(fe);
202
+ } catch (...) {
203
+ // External view manager may fail during shutdown if view is already disposed
204
+ }
205
+ }
195
206
  } else {
196
207
  Super::RemoveAllChildren(parent);
197
208
  }
@@ -106,6 +106,8 @@ namespace Microsoft.ReactNative
106
106
  DOC_STRING("Used to handle key up events when this component is focused, or if a child component did not handle the key up")
107
107
  event Windows.Foundation.EventHandler<Microsoft.ReactNative.Composition.Input.KeyRoutedEventArgs> KeyUp;
108
108
  event Windows.Foundation.EventHandler<Microsoft.ReactNative.Composition.Input.CharacterReceivedRoutedEventArgs> CharacterReceived;
109
+ DOC_STRING("Used to handle context menu key events (SHIFT+F10 or Context Menu key) when this component is focused")
110
+ event Windows.Foundation.EventHandler<Microsoft.ReactNative.Composition.Input.ContextMenuKeyEventArgs> ContextMenuKey;
109
111
  event Windows.Foundation.EventHandler<Microsoft.ReactNative.Composition.Input.PointerRoutedEventArgs> PointerPressed;
110
112
  event Windows.Foundation.EventHandler<Microsoft.ReactNative.Composition.Input.PointerRoutedEventArgs> PointerReleased;
111
113
  event Windows.Foundation.EventHandler<Microsoft.ReactNative.Composition.Input.PointerRoutedEventArgs> PointerMoved;
@@ -34,6 +34,13 @@ namespace Microsoft.ReactNative.Composition.Input
34
34
  KeyboardSource KeyboardSource { get; };
35
35
  };
36
36
 
37
+ DOC_STRING("Event arguments for context menu key events (SHIFT+F10 or Context Menu key)")
38
+ interface ContextMenuKeyEventArgs requires RoutedEventArgs
39
+ {
40
+ DOC_STRING("Gets or sets whether the event was handled. Set to true to prevent default behavior.")
41
+ Boolean Handled { get; set; };
42
+ };
43
+
37
44
  interface IPointerPointTransform
38
45
  {
39
46
  IPointerPointTransform Inverse { get; };
@@ -93,6 +93,8 @@ namespace Microsoft.ReactNative.Composition
93
93
  [webhosthidden]
94
94
  runtimeclass ContentIslandComponentView : ViewComponentView {
95
95
  void Connect(Microsoft.UI.Content.ContentIsland contentIsland);
96
+ DOC_STRING("The ChildSiteLink will be unavailable until after the ContentIslandComponentView is mounted")
97
+ Microsoft.UI.Content.ChildSiteLink ChildSiteLink { get; };
96
98
  };
97
99
 
98
100
  [experimental]
@@ -154,6 +156,9 @@ namespace Microsoft.ReactNative.Composition
154
156
  [webhosthidden]
155
157
  [default_interface]
156
158
  runtimeclass ScrollViewComponentView : ViewComponentView {
159
+ // Issue #15557: Event fired when scroll position changes.
160
+ // ContentIslandComponentView uses this to update LocalToParentTransformMatrix.
161
+ event Windows.Foundation.EventHandler<IInspectable> ViewChanged;
157
162
  };
158
163
 
159
164
  [experimental]
@@ -13,6 +13,7 @@ namespace Microsoft.ReactNative
13
13
  [default_interface]
14
14
  [webhosthidden]
15
15
  [experimental]
16
+ [deprecated("Use @ReactNativeWindow instead", deprecate, 1)]
16
17
  DOC_STRING("An HWND based host of RNW running on windows composition."
17
18
  "Provided as an ease of use function - most of the time HWND-less hosting would be preferable."
18
19
  "In the long term this is likely to be replaced with a more modern hosting interface.")
@@ -45,9 +45,16 @@ enum SnapPointsAlignment {
45
45
  void Opacity(Single value);
46
46
  void BlurRadius(Single value);
47
47
  void Color(Windows.UI.Color value);
48
+ void Mask(IBrush mask);
49
+ void SourcePolicy(CompositionDropShadowSourcePolicy policy);
48
50
  }
49
51
 
50
- [webhosthidden][experimental] interface IVisual {
52
+ [webhosthidden][experimental] enum CompositionDropShadowSourcePolicy {
53
+ Default = 0,
54
+ InheritedOnly = 1
55
+ };
56
+
57
+ [webhosthidden][experimental] interface IVisual {
51
58
  void InsertAt(IVisual visual, Int32 index);
52
59
  void Remove(IVisual visual);
53
60
  IVisual GetAt(UInt32 index);
@@ -72,14 +79,14 @@ enum SnapPointsAlignment {
72
79
  void AnimationClass(AnimationClass value);
73
80
  }
74
81
 
75
- [webhosthidden][experimental] interface ISpriteVisual
82
+ [webhosthidden][experimental] interface ISpriteVisual
76
83
  requires IVisual
77
84
  {
78
85
  void Brush(IBrush brush);
79
86
  void Shadow(IDropShadow shadow);
80
87
  }
81
88
 
82
- [webhosthidden][experimental] interface IRoundedRectangleVisual
89
+ [webhosthidden][experimental] interface IRoundedRectangleVisual
83
90
  requires IVisual
84
91
  {
85
92
  void Brush(IBrush brush);
@@ -88,13 +95,13 @@ enum SnapPointsAlignment {
88
95
  void StrokeThickness(Single value);
89
96
  }
90
97
 
91
- [webhosthidden][experimental] interface IScrollPositionChangedArgs {
98
+ [webhosthidden][experimental] interface IScrollPositionChangedArgs {
92
99
  Windows.Foundation.Numerics.Vector2 Position {
93
100
  get;
94
101
  };
95
102
  }
96
103
 
97
- [webhosthidden][experimental] interface IScrollVisual
104
+ [webhosthidden][experimental] interface IScrollVisual
98
105
  requires IVisual
99
106
  {
100
107
  void Brush(IBrush brush);
@@ -122,7 +129,7 @@ enum SnapPointsAlignment {
122
129
  void SnapToAlignment(SnapPointsAlignment alignment);
123
130
  }
124
131
 
125
- [webhosthidden][experimental] interface IActivityVisual
132
+ [webhosthidden][experimental] interface IActivityVisual
126
133
  requires IVisual
127
134
  {
128
135
  void Size(Single value);
@@ -131,7 +138,7 @@ enum SnapPointsAlignment {
131
138
  void StopAnimation();
132
139
  }
133
140
 
134
- [webhosthidden][experimental] interface ICaretVisual {
141
+ [webhosthidden][experimental] interface ICaretVisual {
135
142
  IVisual InnerVisual {
136
143
  get;
137
144
  };
@@ -144,7 +151,7 @@ enum SnapPointsAlignment {
144
151
  void Brush(IBrush brush);
145
152
  }
146
153
 
147
- [webhosthidden][experimental] interface IFocusVisual {
154
+ [webhosthidden][experimental] interface IFocusVisual {
148
155
  IVisual InnerVisual {
149
156
  get;
150
157
  };
@@ -158,7 +165,7 @@ enum SnapPointsAlignment {
158
165
  };
159
166
  }
160
167
 
161
- [webhosthidden][experimental] interface ICompositionContext {
168
+ [webhosthidden][experimental] interface ICompositionContext {
162
169
  ISpriteVisual CreateSpriteVisual();
163
170
  IScrollVisual CreateScrollerVisual();
164
171
  IRoundedRectangleVisual CreateRoundedRectangleVisual();
@@ -72,7 +72,7 @@ void ComponentView::onMounted() noexcept {
72
72
  m_mountedEvent(*this, *this);
73
73
  }
74
74
 
75
- bool ComponentView::isMounted() noexcept {
75
+ bool ComponentView::isMounted() const noexcept {
76
76
  return m_mounted;
77
77
  }
78
78
 
@@ -469,6 +469,16 @@ void ComponentView::CharacterReceived(winrt::event_token const &token) noexcept
469
469
  m_characterReceivedEvent.remove(token);
470
470
  }
471
471
 
472
+ winrt::event_token ComponentView::ContextMenuKey(
473
+ winrt::Windows::Foundation::EventHandler<
474
+ winrt::Microsoft::ReactNative::Composition::Input::ContextMenuKeyEventArgs> const &handler) noexcept {
475
+ return m_contextMenuKeyEvent.add(handler);
476
+ }
477
+
478
+ void ComponentView::ContextMenuKey(winrt::event_token const &token) noexcept {
479
+ m_contextMenuKeyEvent.remove(token);
480
+ }
481
+
472
482
  winrt::event_token ComponentView::PointerPressed(
473
483
  winrt::Windows::Foundation::EventHandler<
474
484
  winrt::Microsoft::ReactNative::Composition::Input::PointerRoutedEventArgs> const &handler) noexcept {
@@ -609,6 +619,14 @@ void ComponentView::OnCharacterReceived(
609
619
  }
610
620
  }
611
621
 
622
+ void ComponentView::OnContextMenuKey(
623
+ const winrt::Microsoft::ReactNative::Composition::Input::ContextMenuKeyEventArgs &args) noexcept {
624
+ m_contextMenuKeyEvent(*this, args);
625
+ if (m_parent && !args.Handled()) {
626
+ winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(m_parent)->OnContextMenuKey(args);
627
+ }
628
+ }
629
+
612
630
  bool ComponentView::focusable() const noexcept {
613
631
  return false;
614
632
  }