react-native-windows 0.0.0-canary.813 → 0.0.0-canary.815

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 (83) hide show
  1. package/.flowconfig +1 -1
  2. package/Libraries/Components/Button.js +10 -5
  3. package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
  4. package/Libraries/Components/ScrollView/ScrollView.js +49 -0
  5. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +2 -0
  6. package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +2 -0
  7. package/Libraries/Components/TextInput/TextInput.windows.js +2 -2
  8. package/Libraries/Components/Touchable/TouchableOpacity.d.ts +0 -17
  9. package/Libraries/Components/Touchable/TouchableWithoutFeedback.d.ts +8 -0
  10. package/Libraries/Components/Touchable/TouchableWithoutFeedback.js +114 -111
  11. package/Libraries/Components/Touchable/TouchableWithoutFeedback.windows.js +126 -110
  12. package/Libraries/Components/View/View.windows.js +3 -0
  13. package/Libraries/Components/View/ViewPropTypes.d.ts +0 -49
  14. package/Libraries/Core/ExceptionsManager.js +2 -2
  15. package/Libraries/Core/ReactNativeVersion.js +1 -1
  16. package/Libraries/ReactNative/AppContainer-dev.js +21 -2
  17. package/Libraries/Renderer/shims/ReactNativeTypes.js +2 -2
  18. package/Libraries/Utilities/NativePlatformConstantsWin.js +2 -2
  19. package/Libraries/Utilities/ReactNativeTestTools.js +5 -0
  20. package/Microsoft.ReactNative/CompositionComponentView.idl +17 -7
  21. package/Microsoft.ReactNative/CompositionRootView.idl +1 -0
  22. package/Microsoft.ReactNative/CompositionUIService.idl +4 -0
  23. package/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +2 -1
  24. package/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +106 -19
  25. package/Microsoft.ReactNative/Fabric/AbiViewProps.h +45 -13
  26. package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.cpp +28 -64
  27. package/Microsoft.ReactNative/Fabric/Composition/ActivityIndicatorComponentView.h +7 -11
  28. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView.cpp +4 -0
  29. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView.h +2 -0
  30. package/Microsoft.ReactNative/Fabric/Composition/CompositionRootView_emptyimpl.cpp +4 -0
  31. package/Microsoft.ReactNative/Fabric/Composition/CompositionUIService.cpp +12 -0
  32. package/Microsoft.ReactNative/Fabric/Composition/CompositionUIService.h +4 -0
  33. package/Microsoft.ReactNative/Fabric/Composition/CompositionUIService_emptyimpl.cpp +6 -0
  34. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +27 -16
  35. package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +13 -4
  36. package/Microsoft.ReactNative/Fabric/Composition/DebuggingOverlayComponentView.cpp +1 -0
  37. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.cpp +49 -95
  38. package/Microsoft.ReactNative/Fabric/Composition/ImageComponentView.h +11 -15
  39. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp +16 -31
  40. package/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h +5 -8
  41. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.cpp +24 -81
  42. package/Microsoft.ReactNative/Fabric/Composition/ParagraphComponentView.h +4 -13
  43. package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +1 -0
  44. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp +53 -68
  45. package/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.h +5 -7
  46. package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.cpp +38 -84
  47. package/Microsoft.ReactNative/Fabric/Composition/SwitchComponentView.h +6 -10
  48. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.cpp +52 -104
  49. package/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputComponentView.h +7 -13
  50. package/Microsoft.ReactNative/Fabric/Composition/UnimplementedNativeViewComponentView.cpp +1 -0
  51. package/Microsoft.ReactNative/Modules/PlatformConstantsWinModule.cpp +2 -2
  52. package/Microsoft.ReactNative/Modules/PlatformConstantsWinModule.h +3 -3
  53. package/Microsoft.ReactNative/Utils/LocalBundleReader.cpp +2 -3
  54. package/Microsoft.ReactNative/ViewProps.idl +37 -3
  55. package/Microsoft.ReactNative/packages.lock.json +68 -40
  56. package/Microsoft.ReactNative.Cxx/JSValueComposition.h +4 -0
  57. package/PropertySheets/Generated/PackageVersion.g.props +2 -2
  58. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/renderer/components/scrollview/ScrollViewProps.cpp +36 -1
  59. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/runtime/ReactInstance.cpp +1 -1
  60. package/Shared/HermesSamplingProfiler.cpp +1 -2
  61. package/Shared/OInstance.cpp +1 -2
  62. package/Shared/Shared.vcxitems +3 -0
  63. package/Shared/Shared.vcxitems.filters +3 -0
  64. package/codegen/NativeDOMSpec.g.h +43 -25
  65. package/codegen/NativePlatformConstantsWindowsSpec.g.h +81 -0
  66. package/codegen/NativeReactNativeFeatureFlagsSpec.g.h +39 -15
  67. package/codegen/rnwcoreJSI-generated.cpp +67 -22
  68. package/codegen/rnwcoreJSI.h +327 -2521
  69. package/package.json +21 -20
  70. package/src/private/featureflags/ReactNativeFeatureFlags.js +21 -1
  71. package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +5 -1
  72. package/src/private/webapis/dom/nodes/ReactNativeElement.js +3 -7
  73. package/src/private/webapis/dom/nodes/ReadOnlyElement.js +11 -30
  74. package/src/private/webapis/dom/nodes/ReadOnlyNode.js +0 -7
  75. package/src/private/webapis/dom/nodes/specs/NativeDOM.js +114 -27
  76. package/src/private/webapis/dom/nodes/specs/__mocks__/NativeDOMMock.js +59 -22
  77. package/src/private/webapis/performance/PerformanceObserver.js +2 -0
  78. package/src/private/webapis/performance/RawPerformanceEntry.js +0 -5
  79. package/src/private/webapis/performance/specs/__mocks__/NativePerformanceObserver.js +2 -3
  80. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/utils/jsi-utils.cpp +0 -39
  81. package/ReactCommon/TEMP_UntilReactCommonUpdate/react/utils/jsi-utils.h +0 -31
  82. package/codegen/NativePlatformConstantsWinSpec.g.h +0 -81
  83. /package/src/private/specs/modules/{NativePlatformConstantsWin.js → NativePlatformConstantsWindows.js} +0 -0
@@ -25,11 +25,11 @@ import type {
25
25
  } from '../../Types/CoreEventTypes';
26
26
 
27
27
  import View from '../../Components/View/View';
28
- import Pressability, {
29
- type PressabilityConfig,
30
- } from '../../Pressability/Pressability';
31
28
  import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
29
+ import usePressability from '../../Pressability/usePressability';
32
30
  import * as React from 'react';
31
+ import {useMemo} from 'react';
32
+ import Animated from '../../Animated/Animated'; // Windows
33
33
 
34
34
  type Props = $ReadOnly<{|
35
35
  accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
@@ -91,10 +91,7 @@ type Props = $ReadOnly<{|
91
91
  onMouseLeave?: ?(event: MouseEvent) => void, // [Windows]
92
92
  tabIndex?: ?number, // [Windows]
93
93
  tooltip?: ?Stringish, // [Windows]
94
- |}>;
95
-
96
- type State = $ReadOnly<{|
97
- pressability: Pressability,
94
+ hostRef?: ?React.Ref<typeof Animated.View>, // [Windows]
98
95
  |}>;
99
96
 
100
97
  const PASSTHROUGH_PROPS = [
@@ -130,117 +127,136 @@ const PASSTHROUGH_PROPS = [
130
127
  'tooltip', // [Windows]
131
128
  ];
132
129
 
133
- class TouchableWithoutFeedback extends React.Component<Props, State> {
134
- state: State = {
135
- pressability: new Pressability(createPressabilityConfig(this.props)),
136
- };
130
+ // Modify the function to accept the ref prop and forward it
131
+ const TouchableWithoutFeedback: React.AbstractComponent<
132
+ Props,
133
+ React.ElementRef<typeof Animated.View>,
134
+ > = React.forwardRef(function TouchableWithoutFeedback(props: Props, ref): React.Node {
135
+ const {
136
+ disabled,
137
+ rejectResponderTermination,
138
+ 'aria-disabled': ariaDisabled,
139
+ accessibilityState,
140
+ hitSlop,
141
+ delayLongPress,
142
+ delayPressIn,
143
+ delayPressOut,
144
+ pressRetentionOffset,
145
+ touchSoundDisabled,
146
+ onBlur: _onBlur,
147
+ onFocus: _onFocus,
148
+ onLongPress,
149
+ onPress,
150
+ onPressIn,
151
+ onPressOut,
152
+ onMouseEnter, // [Windows]
153
+ onMouseLeave, // [Windows]
154
+ } = props;
137
155
 
138
- render(): React.Node {
139
- const element = React.Children.only<$FlowFixMe>(this.props.children);
140
- const children: Array<React.Node> = [element.props.children];
141
- const ariaLive = this.props['aria-live'];
142
-
143
- if (__DEV__) {
144
- if (element.type === View) {
145
- children.push(
146
- <PressabilityDebugView color="red" hitSlop={this.props.hitSlop} />,
147
- );
148
- }
149
- }
150
156
 
151
- let _accessibilityState = {
152
- busy: this.props['aria-busy'] ?? this.props.accessibilityState?.busy,
153
- checked:
154
- this.props['aria-checked'] ?? this.props.accessibilityState?.checked,
157
+ const pressabilityConfig = useMemo(
158
+ () => ({
159
+ cancelable: !rejectResponderTermination,
155
160
  disabled:
156
- this.props['aria-disabled'] ?? this.props.accessibilityState?.disabled,
157
- expanded:
158
- this.props['aria-expanded'] ?? this.props.accessibilityState?.expanded,
159
- selected:
160
- this.props['aria-selected'] ?? this.props.accessibilityState?.selected,
161
- };
162
-
163
- // BACKWARD-COMPATIBILITY: Focus and blur events were never supported before
164
- // adopting `Pressability`, so preserve that behavior.
165
- const {onBlur, onFocus, ...eventHandlersWithoutBlurAndFocus} =
166
- this.state.pressability.getEventHandlers();
167
-
168
- const elementProps: {[string]: mixed, ...} = {
169
- ...eventHandlersWithoutBlurAndFocus,
170
- accessible: this.props.accessible !== false,
171
- accessibilityState:
172
- this.props.disabled != null
173
- ? {
174
- ..._accessibilityState,
175
- disabled: this.props.disabled,
176
- }
177
- : _accessibilityState,
178
- focusable:
179
- this.props.focusable !== false && this.props.onPress !== undefined,
180
-
181
- accessibilityElementsHidden:
182
- this.props['aria-hidden'] ?? this.props.accessibilityElementsHidden,
183
- importantForAccessibility:
184
- this.props['aria-hidden'] === true
185
- ? 'no-hide-descendants'
186
- : this.props.importantForAccessibility,
187
- accessibilityLiveRegion:
188
- ariaLive === 'off'
189
- ? 'none'
190
- : ariaLive ?? this.props.accessibilityLiveRegion,
191
- nativeID: this.props.id ?? this.props.nativeID,
192
- };
193
- for (const prop of PASSTHROUGH_PROPS) {
194
- if (this.props[prop] !== undefined) {
195
- elementProps[prop] = this.props[prop];
196
- }
197
- }
161
+ disabled !== null
162
+ ? disabled
163
+ : ariaDisabled ?? accessibilityState?.disabled,
164
+ hitSlop: hitSlop,
165
+ delayLongPress: delayLongPress,
166
+ delayPressIn: delayPressIn,
167
+ delayPressOut: delayPressOut,
168
+ minPressDuration: 0,
169
+ pressRectOffset: pressRetentionOffset,
170
+ android_disableSound: touchSoundDisabled,
171
+ onBlur: _onBlur,
172
+ onFocus: _onFocus,
173
+ onLongPress: onLongPress,
174
+ onPress: onPress,
175
+ onPressIn: onPressIn,
176
+ onPressOut: onPressOut,
177
+ onMouseEnter: onMouseEnter, // [Windows]
178
+ onMouseLeave: onMouseLeave, // [Windows]
179
+ }),
180
+ [
181
+ rejectResponderTermination,
182
+ disabled,
183
+ ariaDisabled,
184
+ accessibilityState?.disabled,
185
+ hitSlop,
186
+ delayLongPress,
187
+ delayPressIn,
188
+ delayPressOut,
189
+ pressRetentionOffset,
190
+ touchSoundDisabled,
191
+ _onBlur,
192
+ _onFocus,
193
+ onLongPress,
194
+ onPress,
195
+ onPressIn,
196
+ onPressOut,
197
+ onMouseEnter, // [Windows]
198
+ onMouseLeave, // [Windows]
199
+ ],
200
+ );
198
201
 
199
- // $FlowFixMe[incompatible-call]
200
- return React.cloneElement(element, elementProps, ...children);
201
- }
202
+ const eventHandlers = usePressability(pressabilityConfig);
202
203
 
203
- componentDidUpdate(): void {
204
- this.state.pressability.configure(createPressabilityConfig(this.props));
205
- }
204
+ const element = React.Children.only<$FlowFixMe>(props.children);
205
+ const children: Array<React.Node> = [element.props.children];
206
+ const ariaLive = props['aria-live'];
206
207
 
207
- componentDidMount(): mixed {
208
- this.state.pressability.configure(createPressabilityConfig(this.props));
208
+ if (__DEV__) {
209
+ if (element.type === View) {
210
+ children.push(
211
+ <PressabilityDebugView color="red" hitSlop={props.hitSlop} />,
212
+ );
213
+ }
209
214
  }
210
215
 
211
- componentWillUnmount(): void {
212
- this.state.pressability.reset();
213
- }
214
- }
215
-
216
- function createPressabilityConfig({
217
- 'aria-disabled': ariaDisabled,
218
- ...props
219
- }: Props): PressabilityConfig {
220
- const accessibilityStateDisabled =
221
- ariaDisabled ?? props.accessibilityState?.disabled;
222
- return {
223
- cancelable: !props.rejectResponderTermination,
224
- disabled:
225
- props.disabled !== null ? props.disabled : accessibilityStateDisabled,
226
- hitSlop: props.hitSlop,
227
- delayLongPress: props.delayLongPress,
228
- delayPressIn: props.delayPressIn,
229
- delayPressOut: props.delayPressOut,
230
- minPressDuration: 0,
231
- pressRectOffset: props.pressRetentionOffset,
232
- android_disableSound: props.touchSoundDisabled,
233
- onBlur: props.onBlur,
234
- onFocus: props.onFocus,
235
- onLongPress: props.onLongPress,
236
- onPress: props.onPress,
237
- onPressIn: props.onPressIn,
238
- onPressOut: props.onPressOut,
239
- onMouseEnter: props.onMouseEnter, // [Windows]
240
- onMouseLeave: props.onMouseLeave, // [Windows]
216
+ let _accessibilityState = {
217
+ busy: props['aria-busy'] ?? props.accessibilityState?.busy,
218
+ checked: props['aria-checked'] ?? props.accessibilityState?.checked,
219
+ disabled: props['aria-disabled'] ?? props.accessibilityState?.disabled,
220
+ expanded: props['aria-expanded'] ?? props.accessibilityState?.expanded,
221
+ selected: props['aria-selected'] ?? props.accessibilityState?.selected,
222
+ };
223
+
224
+ // BACKWARD-COMPATIBILITY: Focus and blur events were never supported before
225
+ // adopting `Pressability`, so preserve that behavior.
226
+ const {onBlur, onFocus, ...eventHandlersWithoutBlurAndFocus} =
227
+ eventHandlers || {};
228
+
229
+ const elementProps: {[string]: mixed, ...} = {
230
+ ...eventHandlersWithoutBlurAndFocus,
231
+ accessible: props.accessible !== false,
232
+ accessibilityState:
233
+ props.disabled != null
234
+ ? {
235
+ ..._accessibilityState,
236
+ disabled: props.disabled,
237
+ }
238
+ : _accessibilityState,
239
+ focusable: props.focusable !== false && props.onPress !== undefined,
240
+
241
+ accessibilityElementsHidden:
242
+ props['aria-hidden'] ?? props.accessibilityElementsHidden,
243
+ importantForAccessibility:
244
+ props['aria-hidden'] === true
245
+ ? 'no-hide-descendants'
246
+ : props.importantForAccessibility,
247
+ accessibilityLiveRegion:
248
+ ariaLive === 'off' ? 'none' : ariaLive ?? props.accessibilityLiveRegion,
249
+ nativeID: props.id ?? props.nativeID,
241
250
  };
242
- }
243
251
 
244
- TouchableWithoutFeedback.displayName = 'TouchableWithoutFeedback';
252
+ for (const prop of PASSTHROUGH_PROPS) {
253
+ if (props[prop] !== undefined) {
254
+ elementProps[prop] = props[prop];
255
+ }
256
+ }
257
+
258
+ // $FlowFixMe[incompatible-call]
259
+ return React.cloneElement(element, {...elementProps, ref}, ...children);
260
+ });
245
261
 
246
- module.exports = TouchableWithoutFeedback;
262
+ module.exports = TouchableWithoutFeedback;
@@ -175,6 +175,9 @@ const View: React.AbstractComponent<
175
175
  // [Windows
176
176
  // $FlowFixMe - children typing
177
177
  const childrenWithImportantForAccessibility = children => {
178
+ if (children == null) {
179
+ return children;
180
+ }
178
181
  const updatedChildren = React.Children.map(children, child => {
179
182
  if (React.isValidElement(child)) {
180
183
  // $FlowFixMe[incompatible-use]
@@ -23,48 +23,6 @@ import {IKeyboardProps} from '../Keyboard/KeyboardExtProps'; // Windows
23
23
  import {Touchable} from '../Touchable/Touchable';
24
24
  import {AccessibilityProps} from './ViewAccessibility';
25
25
 
26
- export type TVParallaxProperties = {
27
- /**
28
- * If true, parallax effects are enabled. Defaults to true.
29
- */
30
- enabled?: boolean | undefined;
31
-
32
- /**
33
- * Defaults to 2.0.
34
- */
35
- shiftDistanceX?: number | undefined;
36
-
37
- /**
38
- * Defaults to 2.0.
39
- */
40
- shiftDistanceY?: number | undefined;
41
-
42
- /**
43
- * Defaults to 0.05.
44
- */
45
- tiltAngle?: number | undefined;
46
-
47
- /**
48
- * Defaults to 1.0
49
- */
50
- magnification?: number | undefined;
51
-
52
- /**
53
- * Defaults to 1.0
54
- */
55
- pressMagnification?: number | undefined;
56
-
57
- /**
58
- * Defaults to 0.3
59
- */
60
- pressDuration?: number | undefined;
61
-
62
- /**
63
- * Defaults to 0.3
64
- */
65
- pressDelay?: number | undefined;
66
- };
67
-
68
26
  export interface TVViewPropsIOS {
69
27
  /**
70
28
  * *(Apple TV only)* When set to true, this view will be focusable
@@ -81,13 +39,6 @@ export interface TVViewPropsIOS {
81
39
  */
82
40
  hasTVPreferredFocus?: boolean | undefined;
83
41
 
84
- /**
85
- * *(Apple TV only)* Object with properties to control Apple TV parallax effects.
86
- *
87
- * @platform ios
88
- */
89
- tvParallaxProperties?: TVParallaxProperties | undefined;
90
-
91
42
  /**
92
43
  * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0.
93
44
  *
@@ -126,8 +126,8 @@ function reportException(
126
126
  }
127
127
 
128
128
  declare var console: {
129
- error: typeof console.error,
130
- _errorOriginal: typeof console.error,
129
+ error: (...data: $ReadOnlyArray<mixed>) => void,
130
+ _errorOriginal: (...data: $ReadOnlyArray<mixed>) => void,
131
131
  reportErrorsAsExceptions: boolean,
132
132
  ...
133
133
  };
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 75,
19
19
  patch: 0,
20
- prerelease: 'nightly-20240321-7d180d712',
20
+ prerelease: 'nightly-20240406-a05466c5b',
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -20,7 +20,6 @@ import View from '../Components/View/View';
20
20
  import DebuggingOverlay from '../Debugging/DebuggingOverlay';
21
21
  import useSubscribeToDebuggingOverlayRegistry from '../Debugging/useSubscribeToDebuggingOverlayRegistry';
22
22
  import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter';
23
- import ReactDevToolsOverlay from '../Inspector/ReactDevToolsOverlay';
24
23
  import LogBoxNotificationContainer from '../LogBox/LogBoxNotificationContainer';
25
24
  import StyleSheet from '../StyleSheet/StyleSheet';
26
25
  import {RootTagContext, createRootTag} from './RootTag';
@@ -64,6 +63,26 @@ const InspectorDeferred = ({
64
63
  );
65
64
  };
66
65
 
66
+ type ReactDevToolsOverlayDeferredProps = {
67
+ inspectedViewRef: InspectedViewRef,
68
+ reactDevToolsAgent: ReactDevToolsAgent,
69
+ };
70
+
71
+ const ReactDevToolsOverlayDeferred = ({
72
+ inspectedViewRef,
73
+ reactDevToolsAgent,
74
+ }: ReactDevToolsOverlayDeferredProps) => {
75
+ const ReactDevToolsOverlay =
76
+ require('../Inspector/ReactDevToolsOverlay').default;
77
+
78
+ return (
79
+ <ReactDevToolsOverlay
80
+ inspectedViewRef={inspectedViewRef}
81
+ reactDevToolsAgent={reactDevToolsAgent}
82
+ />
83
+ );
84
+ };
85
+
67
86
  const AppContainer = ({
68
87
  children,
69
88
  fabric,
@@ -155,7 +174,7 @@ const AppContainer = ({
155
174
  <DebuggingOverlay ref={debuggingOverlayRef} />
156
175
 
157
176
  {reactDevToolsAgent != null && (
158
- <ReactDevToolsOverlay
177
+ <ReactDevToolsOverlayDeferred
159
178
  inspectedViewRef={innerViewRef}
160
179
  reactDevToolsAgent={reactDevToolsAgent}
161
180
  />
@@ -7,7 +7,7 @@
7
7
  * @noformat
8
8
  * @flow strict
9
9
  * @nolint
10
- * @generated SignedSource<<fbf33f04ca9428c149262f17c8a4b6ab>>
10
+ * @generated SignedSource<<b35184ab7e1e173fd34278def089e277>>
11
11
  */
12
12
 
13
13
  import type {ElementRef, ElementType, Element, AbstractComponent} from 'react';
@@ -127,7 +127,7 @@ export type NativeMethods = $ReadOnly<{|
127
127
  |}>;
128
128
 
129
129
  // This validates that INativeMethods and NativeMethods stay in sync using Flow!
130
- declare var ensureNativeMethodsAreSynced: NativeMethods;
130
+ declare const ensureNativeMethodsAreSynced: NativeMethods;
131
131
  (ensureNativeMethodsAreSynced: INativeMethods);
132
132
 
133
133
  export type HostComponent<T> = AbstractComponent<T, $ReadOnly<NativeMethods>>;
@@ -6,6 +6,6 @@
6
6
  * @flow strict
7
7
  */
8
8
 
9
- export * from '../../src/private/specs/modules/NativePlatformConstantsWin';
10
- import NativePlatformConstantsWin from '../../src/private/specs/modules/NativePlatformConstantsWin';
9
+ export * from '../../src/private/specs/modules/NativePlatformConstantsWindows';
10
+ import NativePlatformConstantsWin from '../../src/private/specs/modules/NativePlatformConstantsWindows';
11
11
  export default NativePlatformConstantsWin;
@@ -12,6 +12,8 @@
12
12
 
13
13
  import type {ReactTestRenderer as ReactTestRendererType} from 'react-test-renderer';
14
14
 
15
+ import TouchableWithoutFeedback from '../Components/Touchable/TouchableWithoutFeedback';
16
+
15
17
  const Switch = require('../Components/Switch/Switch').default;
16
18
  const TextInput = require('../Components/TextInput/TextInput');
17
19
  const View = require('../Components/View/View');
@@ -49,6 +51,9 @@ function byClickable(): Predicate {
49
51
  (node.type === Switch && node.props && node.props.disabled !== true) ||
50
52
  (node.type === View &&
51
53
  node?.props?.onStartShouldSetResponder?.testOnly_pressabilityConfig) ||
54
+ (node.type === TouchableWithoutFeedback &&
55
+ node.props &&
56
+ typeof node.props.onPress === 'function') ||
52
57
  // HACK: Find components that use `Pressability`.
53
58
  node.instance?.state?.pressability != null ||
54
59
  // TODO: Remove this after deleting `Touchable`.
@@ -26,6 +26,15 @@ namespace Microsoft.ReactNative.Composition
26
26
  Default = 0x00000007, // ShadowProps | NativeBorder | Background
27
27
  };
28
28
 
29
+ namespace Experimental {
30
+ [webhosthidden]
31
+ [experimental]
32
+ interface IInternalCreateComponentViewArgs
33
+ {
34
+ ICompositionContext CompositionContext { get; };
35
+ }
36
+ }
37
+
29
38
  [experimental]
30
39
  [webhosthidden]
31
40
  runtimeclass CreateCompositionComponentViewArgs : Microsoft.ReactNative.CreateComponentViewArgs {
@@ -72,7 +81,7 @@ namespace Microsoft.ReactNative.Composition
72
81
  [experimental]
73
82
  [webhosthidden]
74
83
  [default_interface]
75
- unsealed runtimeclass SwitchComponentView : ComponentView {
84
+ unsealed runtimeclass SwitchComponentView : ViewComponentView {
76
85
  };
77
86
 
78
87
  [experimental]
@@ -90,31 +99,32 @@ namespace Microsoft.ReactNative.Composition
90
99
  [experimental]
91
100
  [webhosthidden]
92
101
  [default_interface]
93
- unsealed runtimeclass ActivityIndicatorComponentView : ComponentView {
102
+ unsealed runtimeclass ActivityIndicatorComponentView : ViewComponentView {
94
103
  };
95
104
 
96
105
  [experimental]
97
106
  [webhosthidden]
98
107
  [default_interface]
99
- unsealed runtimeclass WindowsModalHostComponentView : ComponentView {
108
+ unsealed runtimeclass WindowsModalHostComponentView : ViewComponentView {
100
109
  };
101
110
 
102
111
  [experimental]
103
112
  [webhosthidden]
104
113
  [default_interface]
105
- unsealed runtimeclass ImageComponentView : ComponentView {
114
+ unsealed runtimeclass ImageComponentView : ViewComponentView {
115
+ Microsoft.ReactNative.ImageProps ViewProps { get; };
106
116
  };
107
117
 
108
118
  [experimental]
109
119
  [webhosthidden]
110
120
  [default_interface]
111
- unsealed runtimeclass ParagraphComponentView : ComponentView {
121
+ unsealed runtimeclass ParagraphComponentView : ViewComponentView {
112
122
  };
113
123
 
114
124
  [experimental]
115
125
  [webhosthidden]
116
126
  [default_interface]
117
- unsealed runtimeclass ScrollViewComponentView : ComponentView {
127
+ unsealed runtimeclass ScrollViewComponentView : ViewComponentView {
118
128
  };
119
129
 
120
130
  [experimental]
@@ -126,7 +136,7 @@ namespace Microsoft.ReactNative.Composition
126
136
  [experimental]
127
137
  [webhosthidden]
128
138
  [default_interface]
129
- unsealed runtimeclass WindowsTextInputComponentView : ComponentView {
139
+ unsealed runtimeclass WindowsTextInputComponentView : ViewComponentView {
130
140
  };
131
141
 
132
142
  } // namespace Microsoft.ReactNative
@@ -99,6 +99,7 @@ namespace Microsoft.ReactNative
99
99
  Microsoft.ReactNative.Composition.ICustomResourceLoader Resources;
100
100
 
101
101
  Microsoft.ReactNative.Composition.Theme Theme { get; };
102
+ Int64 RootTag { get; };
102
103
 
103
104
  #ifdef USE_WINUI3
104
105
  Microsoft.UI.Content.ContentIsland Island { get; };
@@ -2,6 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  import "ReactInstanceSettings.idl";
5
+ import "ComponentView.idl";
5
6
 
6
7
  #include "DocString.h"
7
8
 
@@ -22,5 +23,8 @@ namespace Microsoft.ReactNative.Composition
22
23
  "Gets the Compositor used by this ReactNative instance.")
23
24
  static Microsoft.UI.Composition.Compositor GetCompositor(Microsoft.ReactNative.IReactPropertyBag properties);
24
25
 
26
+ DOC_STRING("Gets the ComponentView from a react tag.")
27
+ static Microsoft.ReactNative.ComponentView ComponentFromReactTag(Microsoft.ReactNative.IReactContext context, Int64 reactTag);
28
+
25
29
  }
26
30
  } // namespace Microsoft.ReactNative.Composition
@@ -99,7 +99,8 @@ facebook::react::Props::Shared AbiViewComponentDescriptor::cloneProps(
99
99
  // auto shadowNodeProps = std::make_shared<ShadowNodeT::Props>(context, rawProps, props);
100
100
  auto shadowNodeProps = std::make_shared<AbiViewProps>(
101
101
  context, props ? static_cast<AbiViewProps const &>(*props) : *ShadowNodeT::defaultSharedProps(), rawProps);
102
- auto viewProps = winrt::make<winrt::Microsoft::ReactNative::implementation::UserViewProps>(shadowNodeProps);
102
+ auto viewProps =
103
+ winrt::make<winrt::Microsoft::ReactNative::implementation::ViewProps>(shadowNodeProps, false /*holdRef*/);
103
104
  auto userProps =
104
105
  winrt::get_self<winrt::Microsoft::ReactNative::Composition::ReactCompositionViewComponentBuilder>(m_builder)
105
106
  ->CreateProps(viewProps);