react-native-windows 0.76.0-preview.1 → 0.76.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.
- package/Libraries/Components/Keyboard/KeyboardAvoidingView.js +17 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.js +3 -0
- package/Libraries/Components/ScrollView/ScrollViewNativeComponent.windows.js +3 -0
- package/Libraries/Components/TextInput/RCTTextInputViewConfig.js +10 -0
- package/Libraries/Components/View/ReactNativeStyleAttributes.js +2 -2
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpDeveloperTools.js +5 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +2 -2
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +11 -2
- package/Libraries/NativeComponent/BaseViewConfig.windows.js +11 -2
- package/Libraries/ReactNative/getNativeComponentAttributes.js +4 -0
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +98 -5
- package/Libraries/StyleSheet/StyleSheetTypes.js +5 -5
- package/Libraries/StyleSheet/processBoxShadow.js +5 -7
- package/Libraries/StyleSheet/processFilter.js +4 -4
- package/Libraries/Utilities/HMRClient.js +6 -5
- package/Microsoft.ReactNative/Fabric/ComponentView.cpp +12 -0
- package/Microsoft.ReactNative/Fabric/ComponentView.h +3 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp +66 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.h +8 -2
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +24 -0
- package/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.cpp +8 -3
- package/Microsoft.ReactNative/Fabric/Composition/ReactNativeIsland.h +1 -0
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.cpp +11 -0
- package/Microsoft.ReactNative/Fabric/Composition/RootComponentView.h +2 -0
- package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.cpp +1 -2
- package/Microsoft.ReactNative/Fabric/Composition/TextDrawing.h +1 -1
- package/Microsoft.ReactNative/Fabric/Composition/Theme.cpp +12 -4
- package/Microsoft.ReactNative/Fabric/Composition/TooltipService.cpp +338 -0
- package/Microsoft.ReactNative/Fabric/Composition/TooltipService.h +66 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.cpp +8 -0
- package/Microsoft.ReactNative/Fabric/Composition/UiaHelpers.h +1 -0
- package/Microsoft.ReactNative/Fabric/FabricUIManagerModule.cpp +3 -0
- package/Microsoft.ReactNative/Fabric/ReactTaggedView.h +4 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.cpp +5 -0
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewProps.h +1 -1
- package/Microsoft.ReactNative/Fabric/platform/react/renderer/components/view/HostPlatformViewTraitsInitializer.h +1 -1
- package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +1 -1
- package/Microsoft.ReactNative/ReactCoreInjection.h +0 -1
- package/Microsoft.ReactNative/ReactHost/ReactInstanceWin.cpp +15 -4
- package/PropertySheets/Generated/PackageVersion.g.props +2 -2
- package/Shared/Shared.vcxitems +3 -0
- package/Shared/Shared.vcxitems.filters +1 -0
- package/package.json +21 -17
- package/src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE.js +11 -9
- package/types/experimental.d.ts +0 -105
- package/Common/packages.lock.json +0 -26
- package/Folly/packages.lock.json +0 -23
- package/Microsoft.ReactNative/packages.fabric.lock.json +0 -159
- package/Microsoft.ReactNative/packages.lock.json +0 -131
- package/Microsoft.ReactNative.Managed/packages.lock.json +0 -373
- package/Microsoft.ReactNative.Managed.CodeGen/packages.lock.json +0 -3197
- package/ReactCommon/packages.lock.json +0 -30
- package/fmt/packages.lock.json +0 -13
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {ViewStyleProp} from '../../StyleSheet/StyleSheet';
|
|
12
|
+
import type {DimensionsPayload} from '../../Utilities/NativeDeviceInfo';
|
|
12
13
|
import type {
|
|
13
14
|
ViewLayout,
|
|
14
15
|
ViewLayoutEvent,
|
|
@@ -18,6 +19,7 @@ import type {KeyboardEvent, KeyboardMetrics} from './Keyboard';
|
|
|
18
19
|
|
|
19
20
|
import LayoutAnimation from '../../LayoutAnimation/LayoutAnimation';
|
|
20
21
|
import StyleSheet from '../../StyleSheet/StyleSheet';
|
|
22
|
+
import Dimensions from '../../Utilities/Dimensions';
|
|
21
23
|
import Platform from '../../Utilities/Platform';
|
|
22
24
|
import {type EventSubscription} from '../../vendor/emitter/EventEmitter';
|
|
23
25
|
import AccessibilityInfo from '../AccessibilityInfo/AccessibilityInfo';
|
|
@@ -66,6 +68,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
66
68
|
viewRef: {current: React.ElementRef<typeof View> | null, ...};
|
|
67
69
|
_initialFrameHeight: number = 0;
|
|
68
70
|
_bottom: number = 0;
|
|
71
|
+
_windowWidth: number = Dimensions.get('window').width;
|
|
69
72
|
|
|
70
73
|
constructor(props: Props) {
|
|
71
74
|
super(props);
|
|
@@ -130,6 +133,10 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
130
133
|
}
|
|
131
134
|
};
|
|
132
135
|
|
|
136
|
+
_onDimensionsChange = ({window}: DimensionsPayload) => {
|
|
137
|
+
this._windowWidth = window?.width ?? 0;
|
|
138
|
+
};
|
|
139
|
+
|
|
133
140
|
// Avoid unnecessary renders if the KeyboardAvoidingView is disabled.
|
|
134
141
|
_setBottom = (value: number) => {
|
|
135
142
|
const enabled = this.props.enabled ?? true;
|
|
@@ -145,6 +152,15 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
145
152
|
return;
|
|
146
153
|
}
|
|
147
154
|
|
|
155
|
+
if (
|
|
156
|
+
Platform.OS === 'ios' &&
|
|
157
|
+
this._windowWidth !== this._keyboardEvent.endCoordinates.width
|
|
158
|
+
) {
|
|
159
|
+
// The keyboard is not the standard bottom-of-the-screen keyboard. For example, floating keyboard on iPadOS.
|
|
160
|
+
this._setBottom(0);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
148
164
|
const {duration, easing, endCoordinates} = this._keyboardEvent;
|
|
149
165
|
const height = await this._relativeKeyboardHeight(endCoordinates);
|
|
150
166
|
|
|
@@ -178,6 +194,7 @@ class KeyboardAvoidingView extends React.Component<Props, State> {
|
|
|
178
194
|
if (Platform.OS === 'ios') {
|
|
179
195
|
this._subscriptions = [
|
|
180
196
|
Keyboard.addListener('keyboardWillChangeFrame', this._onKeyboardChange),
|
|
197
|
+
Dimensions.addEventListener('change', this._onDimensionsChange),
|
|
181
198
|
];
|
|
182
199
|
} else {
|
|
183
200
|
this._subscriptions = [
|
|
@@ -160,6 +160,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
160
160
|
snapToInterval: true,
|
|
161
161
|
snapToOffsets: true,
|
|
162
162
|
snapToStart: true,
|
|
163
|
+
verticalScrollIndicatorInsets: {
|
|
164
|
+
diff: require('../../Utilities/differ/insetsDiffer'),
|
|
165
|
+
},
|
|
163
166
|
zoomScale: true,
|
|
164
167
|
...ConditionallyIgnoredEventHandlers({
|
|
165
168
|
onScrollBeginDrag: true,
|
|
@@ -161,6 +161,9 @@ export const __INTERNAL_VIEW_CONFIG: PartialViewConfig =
|
|
|
161
161
|
snapToInterval: true,
|
|
162
162
|
snapToOffsets: true,
|
|
163
163
|
snapToStart: true,
|
|
164
|
+
verticalScrollIndicatorInsets: {
|
|
165
|
+
diff: require('../../Utilities/differ/insetsDiffer'),
|
|
166
|
+
},
|
|
164
167
|
zoomScale: true,
|
|
165
168
|
...ConditionallyIgnoredEventHandlers({
|
|
166
169
|
onScrollBeginDrag: true,
|
|
@@ -85,8 +85,15 @@ const RCTTextInputViewConfig = {
|
|
|
85
85
|
topContentSizeChange: {
|
|
86
86
|
registrationName: 'onContentSizeChange',
|
|
87
87
|
},
|
|
88
|
+
topChangeSync: {
|
|
89
|
+
registrationName: 'onChangeSync',
|
|
90
|
+
},
|
|
91
|
+
topKeyPressSync: {
|
|
92
|
+
registrationName: 'onKeyPressSync',
|
|
93
|
+
},
|
|
88
94
|
},
|
|
89
95
|
validAttributes: {
|
|
96
|
+
dynamicTypeRamp: true,
|
|
90
97
|
fontSize: true,
|
|
91
98
|
fontWeight: true,
|
|
92
99
|
fontVariant: true,
|
|
@@ -97,6 +104,7 @@ const RCTTextInputViewConfig = {
|
|
|
97
104
|
textTransform: true,
|
|
98
105
|
textAlign: true,
|
|
99
106
|
fontFamily: true,
|
|
107
|
+
lineBreakModeIOS: true,
|
|
100
108
|
lineHeight: true,
|
|
101
109
|
isHighlighted: true,
|
|
102
110
|
writingDirection: true,
|
|
@@ -150,6 +158,8 @@ const RCTTextInputViewConfig = {
|
|
|
150
158
|
onSelectionChange: true,
|
|
151
159
|
onContentSizeChange: true,
|
|
152
160
|
onScroll: true,
|
|
161
|
+
onChangeSync: true,
|
|
162
|
+
onKeyPressSync: true,
|
|
153
163
|
}),
|
|
154
164
|
},
|
|
155
165
|
};
|
|
@@ -120,7 +120,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
|
|
|
120
120
|
/**
|
|
121
121
|
* Filter
|
|
122
122
|
*/
|
|
123
|
-
|
|
123
|
+
filter: {process: processFilter},
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
126
|
* MixBlendMode
|
|
@@ -135,7 +135,7 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
|
|
|
135
135
|
/*
|
|
136
136
|
* BoxShadow
|
|
137
137
|
*/
|
|
138
|
-
|
|
138
|
+
boxShadow: {process: processBoxShadow},
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
141
|
* Linear Gradient
|
|
@@ -42,9 +42,13 @@ if (__DEV__) {
|
|
|
42
42
|
if (!Platform.isTesting) {
|
|
43
43
|
const HMRClient = require('../Utilities/HMRClient');
|
|
44
44
|
|
|
45
|
+
// [0.76 only] When under React Native DevTools, log "JavaScript logs will
|
|
46
|
+
// be removed from Metro..." warning, and continue to forward logs.
|
|
45
47
|
if (global.__FUSEBOX_HAS_FULL_CONSOLE_SUPPORT__) {
|
|
46
48
|
HMRClient.unstable_notifyFuseboxConsoleEnabled();
|
|
47
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (console._isPolyfilled) {
|
|
48
52
|
// We assume full control over the console and send JavaScript logs to Metro.
|
|
49
53
|
[
|
|
50
54
|
'trace',
|
|
@@ -169,10 +169,10 @@ const validAttributesForNonEventProps = {
|
|
|
169
169
|
experimental_backgroundImage: {
|
|
170
170
|
process: require('../StyleSheet/processBackgroundImage').default,
|
|
171
171
|
},
|
|
172
|
-
|
|
172
|
+
boxShadow: {
|
|
173
173
|
process: require('../StyleSheet/processBoxShadow').default,
|
|
174
174
|
},
|
|
175
|
-
|
|
175
|
+
filter: {
|
|
176
176
|
process: require('../StyleSheet/processFilter').default,
|
|
177
177
|
},
|
|
178
178
|
experimental_mixBlendMode: true,
|
|
@@ -198,6 +198,7 @@ const validAttributesForNonEventProps = {
|
|
|
198
198
|
testID: true,
|
|
199
199
|
backgroundColor: {process: require('../StyleSheet/processColor').default},
|
|
200
200
|
backfaceVisibility: true,
|
|
201
|
+
cursor: true,
|
|
201
202
|
opacity: true,
|
|
202
203
|
shadowColor: {process: require('../StyleSheet/processColor').default},
|
|
203
204
|
shadowOffset: {diff: require('../Utilities/differ/sizesDiffer')},
|
|
@@ -216,16 +217,18 @@ const validAttributesForNonEventProps = {
|
|
|
216
217
|
role: true,
|
|
217
218
|
borderRadius: true,
|
|
218
219
|
borderColor: {process: require('../StyleSheet/processColor').default},
|
|
220
|
+
borderBlockColor: {process: require('../StyleSheet/processColor').default},
|
|
219
221
|
borderCurve: true,
|
|
220
222
|
borderWidth: true,
|
|
223
|
+
borderBlockWidth: true,
|
|
221
224
|
borderStyle: true,
|
|
222
225
|
hitSlop: {diff: require('../Utilities/differ/insetsDiffer')},
|
|
223
226
|
collapsable: true,
|
|
224
227
|
collapsableChildren: true,
|
|
225
|
-
|
|
228
|
+
filter: {
|
|
226
229
|
process: require('../StyleSheet/processFilter').default,
|
|
227
230
|
},
|
|
228
|
-
|
|
231
|
+
boxShadow: {
|
|
229
232
|
process: require('../StyleSheet/processBoxShadow').default,
|
|
230
233
|
},
|
|
231
234
|
experimental_mixBlendMode: true,
|
|
@@ -240,9 +243,15 @@ const validAttributesForNonEventProps = {
|
|
|
240
243
|
borderLeftWidth: true,
|
|
241
244
|
borderLeftColor: {process: require('../StyleSheet/processColor').default},
|
|
242
245
|
borderStartWidth: true,
|
|
246
|
+
borderBlockStartWidth: true,
|
|
243
247
|
borderStartColor: {process: require('../StyleSheet/processColor').default},
|
|
248
|
+
borderBlockStartColor: {
|
|
249
|
+
process: require('../StyleSheet/processColor').default,
|
|
250
|
+
},
|
|
244
251
|
borderEndWidth: true,
|
|
252
|
+
borderBlockEndWidth: true,
|
|
245
253
|
borderEndColor: {process: require('../StyleSheet/processColor').default},
|
|
254
|
+
borderBlockEndColor: {process: require('../StyleSheet/processColor').default},
|
|
246
255
|
|
|
247
256
|
borderTopLeftRadius: true,
|
|
248
257
|
borderTopRightRadius: true,
|
|
@@ -218,6 +218,7 @@ const validAttributesForNonEventProps = {
|
|
|
218
218
|
testID: true,
|
|
219
219
|
backgroundColor: {process: require('../StyleSheet/processColor').default},
|
|
220
220
|
backfaceVisibility: true,
|
|
221
|
+
cursor: true,
|
|
221
222
|
opacity: true,
|
|
222
223
|
shadowColor: {process: require('../StyleSheet/processColor').default},
|
|
223
224
|
shadowOffset: {diff: require('../Utilities/differ/sizesDiffer')},
|
|
@@ -236,16 +237,18 @@ const validAttributesForNonEventProps = {
|
|
|
236
237
|
role: true,
|
|
237
238
|
borderRadius: true,
|
|
238
239
|
borderColor: {process: require('../StyleSheet/processColor').default},
|
|
240
|
+
borderBlockColor: {process: require('../StyleSheet/processColor').default},
|
|
239
241
|
borderCurve: true,
|
|
240
242
|
borderWidth: true,
|
|
243
|
+
borderBlockWidth: true,
|
|
241
244
|
borderStyle: true,
|
|
242
245
|
hitSlop: {diff: require('../Utilities/differ/insetsDiffer')},
|
|
243
246
|
collapsable: true,
|
|
244
247
|
collapsableChildren: true,
|
|
245
|
-
|
|
248
|
+
filter: {
|
|
246
249
|
process: require('../StyleSheet/processFilter').default,
|
|
247
250
|
},
|
|
248
|
-
|
|
251
|
+
boxShadow: {
|
|
249
252
|
process: require('../StyleSheet/processBoxShadow').default,
|
|
250
253
|
},
|
|
251
254
|
experimental_mixBlendMode: true,
|
|
@@ -260,9 +263,15 @@ const validAttributesForNonEventProps = {
|
|
|
260
263
|
borderLeftWidth: true,
|
|
261
264
|
borderLeftColor: {process: require('../StyleSheet/processColor').default},
|
|
262
265
|
borderStartWidth: true,
|
|
266
|
+
borderBlockStartWidth: true,
|
|
263
267
|
borderStartColor: {process: require('../StyleSheet/processColor').default},
|
|
268
|
+
borderBlockStartColor: {
|
|
269
|
+
process: require('../StyleSheet/processColor').default,
|
|
270
|
+
},
|
|
264
271
|
borderEndWidth: true,
|
|
272
|
+
borderBlockEndWidth: true,
|
|
265
273
|
borderEndColor: {process: require('../StyleSheet/processColor').default},
|
|
274
|
+
borderBlockEndColor: {process: require('../StyleSheet/processColor').default},
|
|
266
275
|
|
|
267
276
|
borderTopLeftRadius: true,
|
|
268
277
|
borderTopRightRadius: true,
|
|
@@ -188,6 +188,10 @@ function getProcessorForType(typeName: string): ?(nextProp: any) => any {
|
|
|
188
188
|
case 'UIImage':
|
|
189
189
|
case 'RCTImageSource':
|
|
190
190
|
return resolveAssetSource;
|
|
191
|
+
case 'BoxShadowArray':
|
|
192
|
+
return processBoxShadow;
|
|
193
|
+
case 'FilterArray':
|
|
194
|
+
return processFilter;
|
|
191
195
|
// Android Types
|
|
192
196
|
case 'Color':
|
|
193
197
|
return processColor;
|
|
@@ -110,11 +110,102 @@ export interface FlexStyle {
|
|
|
110
110
|
top?: DimensionValue | undefined;
|
|
111
111
|
width?: DimensionValue | undefined;
|
|
112
112
|
zIndex?: number | undefined;
|
|
113
|
+
direction?: 'inherit' | 'ltr' | 'rtl' | undefined;
|
|
113
114
|
|
|
114
115
|
/**
|
|
115
|
-
*
|
|
116
|
+
* Equivalent to `top`, `bottom`, `right` and `left`
|
|
116
117
|
*/
|
|
117
|
-
|
|
118
|
+
inset?: DimensionValue | undefined;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Equivalent to `top`, `bottom`
|
|
122
|
+
*/
|
|
123
|
+
insetBlock?: DimensionValue | undefined;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Equivalent to `bottom`
|
|
127
|
+
*/
|
|
128
|
+
insetBlockEnd?: DimensionValue | undefined;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Equivalent to `top`
|
|
132
|
+
*/
|
|
133
|
+
insetBlockStart?: DimensionValue | undefined;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Equivalent to `right` and `left`
|
|
137
|
+
*/
|
|
138
|
+
insetInline?: DimensionValue | undefined;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Equivalent to `right` or `left`
|
|
142
|
+
*/
|
|
143
|
+
insetInlineEnd?: DimensionValue | undefined;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Equivalent to `right` or `left`
|
|
147
|
+
*/
|
|
148
|
+
insetInlineStart?: DimensionValue | undefined;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Equivalent to `marginVertical`
|
|
152
|
+
*/
|
|
153
|
+
marginBlock?: DimensionValue | undefined;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Equivalent to `marginBottom`
|
|
157
|
+
*/
|
|
158
|
+
marginBlockEnd?: DimensionValue | undefined;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Equivalent to `marginTop`
|
|
162
|
+
*/
|
|
163
|
+
marginBlockStart?: DimensionValue | undefined;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Equivalent to `marginHorizontal`
|
|
167
|
+
*/
|
|
168
|
+
marginInline?: DimensionValue | undefined;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Equivalent to `marginEnd`
|
|
172
|
+
*/
|
|
173
|
+
marginInlineEnd?: DimensionValue | undefined;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Equivalent to `marginStart`
|
|
177
|
+
*/
|
|
178
|
+
marginInlineStart?: DimensionValue | undefined;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Equivalent to `paddingVertical`
|
|
182
|
+
*/
|
|
183
|
+
paddingBlock?: DimensionValue | undefined;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Equivalent to `paddingBottom`
|
|
187
|
+
*/
|
|
188
|
+
paddingBlockEnd?: DimensionValue | undefined;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Equivalent to `paddingTop`
|
|
192
|
+
*/
|
|
193
|
+
paddingBlockStart?: DimensionValue | undefined;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Equivalent to `paddingHorizontal`
|
|
197
|
+
*/
|
|
198
|
+
paddingInline?: DimensionValue | undefined;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Equivalent to `paddingEnd`
|
|
202
|
+
*/
|
|
203
|
+
paddingInlineEnd?: DimensionValue | undefined;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Equivalent to `paddingStart`
|
|
207
|
+
*/
|
|
208
|
+
paddingInlineStart?: DimensionValue | undefined;
|
|
118
209
|
}
|
|
119
210
|
|
|
120
211
|
export interface ShadowStyleIOS {
|
|
@@ -239,16 +330,16 @@ export type FilterFunction =
|
|
|
239
330
|
| {opacity: number | string}
|
|
240
331
|
| {saturate: number | string}
|
|
241
332
|
| {sepia: number | string}
|
|
242
|
-
| {dropShadow:
|
|
333
|
+
| {dropShadow: DropShadowValue | string};
|
|
243
334
|
|
|
244
|
-
export type
|
|
335
|
+
export type DropShadowValue = {
|
|
245
336
|
offsetX: number | string;
|
|
246
337
|
offsetY: number | string;
|
|
247
338
|
standardDeviation?: number | string | undefined;
|
|
248
339
|
color?: ColorValue | number | undefined;
|
|
249
340
|
};
|
|
250
341
|
|
|
251
|
-
export type
|
|
342
|
+
export type BoxShadowValue = {
|
|
252
343
|
offsetX: number | string;
|
|
253
344
|
offsetY: number | string;
|
|
254
345
|
color?: string | undefined;
|
|
@@ -336,6 +427,8 @@ export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle {
|
|
|
336
427
|
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined;
|
|
337
428
|
isolation?: 'auto' | 'isolate' | undefined;
|
|
338
429
|
cursor?: CursorValue | undefined;
|
|
430
|
+
boxShadow?: ReadonlyArray<BoxShadowValue> | string | undefined;
|
|
431
|
+
filter?: ReadonlyArray<FilterFunction> | string | undefined;
|
|
339
432
|
}
|
|
340
433
|
|
|
341
434
|
export type FontVariant =
|
|
@@ -700,9 +700,9 @@ export type FilterFunction =
|
|
|
700
700
|
| {opacity: number | string}
|
|
701
701
|
| {saturate: number | string}
|
|
702
702
|
| {sepia: number | string}
|
|
703
|
-
| {dropShadow:
|
|
703
|
+
| {dropShadow: DropShadowValue | string};
|
|
704
704
|
|
|
705
|
-
export type
|
|
705
|
+
export type DropShadowValue = {
|
|
706
706
|
offsetX: number | string,
|
|
707
707
|
offsetY: number | string,
|
|
708
708
|
standardDeviation?: number | string,
|
|
@@ -719,7 +719,7 @@ export type GradientValue = {
|
|
|
719
719
|
}>,
|
|
720
720
|
};
|
|
721
721
|
|
|
722
|
-
export type
|
|
722
|
+
export type BoxShadowValue = {
|
|
723
723
|
offsetX: number | string,
|
|
724
724
|
offsetY: number | string,
|
|
725
725
|
color?: ____ColorValue_Internal,
|
|
@@ -788,8 +788,8 @@ export type ____ViewStyle_InternalCore = $ReadOnly<{
|
|
|
788
788
|
elevation?: number,
|
|
789
789
|
pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only',
|
|
790
790
|
cursor?: CursorValue,
|
|
791
|
-
|
|
792
|
-
|
|
791
|
+
boxShadow?: $ReadOnlyArray<BoxShadowValue> | string,
|
|
792
|
+
filter?: $ReadOnlyArray<FilterFunction> | string,
|
|
793
793
|
experimental_mixBlendMode?: ____BlendMode_Internal,
|
|
794
794
|
experimental_backgroundImage?: $ReadOnlyArray<GradientValue> | string,
|
|
795
795
|
isolation?: 'auto' | 'isolate',
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import type {ProcessedColorValue} from './processColor';
|
|
13
|
-
import type {
|
|
13
|
+
import type {BoxShadowValue} from './StyleSheetTypes';
|
|
14
14
|
|
|
15
15
|
import processColor from './processColor';
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ export type ParsedBoxShadow = {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export default function processBoxShadow(
|
|
27
|
-
rawBoxShadows: ?($ReadOnlyArray<
|
|
27
|
+
rawBoxShadows: ?($ReadOnlyArray<BoxShadowValue> | string),
|
|
28
28
|
): Array<ParsedBoxShadow> {
|
|
29
29
|
const result: Array<ParsedBoxShadow> = [];
|
|
30
30
|
if (rawBoxShadows == null) {
|
|
@@ -106,16 +106,14 @@ export default function processBoxShadow(
|
|
|
106
106
|
return result;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
function parseBoxShadowString(
|
|
110
|
-
|
|
111
|
-
): Array<BoxShadowPrimitive> {
|
|
112
|
-
let result: Array<BoxShadowPrimitive> = [];
|
|
109
|
+
function parseBoxShadowString(rawBoxShadows: string): Array<BoxShadowValue> {
|
|
110
|
+
let result: Array<BoxShadowValue> = [];
|
|
113
111
|
|
|
114
112
|
for (const rawBoxShadow of rawBoxShadows
|
|
115
113
|
.split(/,(?![^()]*\))/) // split by comma that is not in parenthesis
|
|
116
114
|
.map(bS => bS.trim())
|
|
117
115
|
.filter(bS => bS !== '')) {
|
|
118
|
-
const boxShadow:
|
|
116
|
+
const boxShadow: BoxShadowValue = {
|
|
119
117
|
offsetX: 0,
|
|
120
118
|
offsetY: 0,
|
|
121
119
|
};
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
'use strict';
|
|
13
13
|
|
|
14
14
|
import type {ColorValue} from './StyleSheet';
|
|
15
|
-
import type {
|
|
15
|
+
import type {DropShadowValue, FilterFunction} from './StyleSheetTypes';
|
|
16
16
|
|
|
17
17
|
import processColor from './processColor';
|
|
18
18
|
|
|
@@ -179,7 +179,7 @@ function _getFilterAmount(filterName: string, filterArgs: mixed): ?number {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
function parseDropShadow(
|
|
182
|
-
rawDropShadow: string |
|
|
182
|
+
rawDropShadow: string | DropShadowValue,
|
|
183
183
|
): ?ParsedDropShadow {
|
|
184
184
|
const dropShadow =
|
|
185
185
|
typeof rawDropShadow === 'string'
|
|
@@ -248,8 +248,8 @@ function parseDropShadow(
|
|
|
248
248
|
return parsedDropShadow;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
function parseDropShadowString(rawDropShadow: string): ?
|
|
252
|
-
const dropShadow:
|
|
251
|
+
function parseDropShadowString(rawDropShadow: string): ?DropShadowValue {
|
|
252
|
+
const dropShadow: DropShadowValue = {
|
|
253
253
|
offsetX: 0,
|
|
254
254
|
offsetY: 0,
|
|
255
255
|
};
|
|
@@ -153,11 +153,12 @@ const HMRClient: HMRClientNativeInterface = {
|
|
|
153
153
|
level: 'info',
|
|
154
154
|
data: [
|
|
155
155
|
'\n' +
|
|
156
|
-
'\
|
|
157
|
-
' \
|
|
158
|
-
'
|
|
159
|
-
'
|
|
160
|
-
'
|
|
156
|
+
'\u001B[7m' +
|
|
157
|
+
' \u001B[1m💡 JavaScript logs will be removed from Metro in React ' +
|
|
158
|
+
'Native 0.77!\u001B[22m Please use React Native DevTools as your ' +
|
|
159
|
+
'default tool. Tip: Type \u001B[1mj\u001B[22m in the terminal to ' +
|
|
160
|
+
'open (requires Google Chrome or Microsoft Edge).' +
|
|
161
|
+
'\u001B[27m' +
|
|
161
162
|
'\n',
|
|
162
163
|
],
|
|
163
164
|
}),
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
#include <Fabric/Composition/RootComponentView.h>
|
|
15
15
|
#include "AbiEventEmitter.h"
|
|
16
16
|
#include "AbiShadowNode.h"
|
|
17
|
+
#include "ReactCoreInjection.h"
|
|
17
18
|
|
|
18
19
|
namespace winrt::Microsoft::ReactNative::Composition::implementation {
|
|
19
20
|
struct RootComponentView;
|
|
@@ -262,6 +263,17 @@ void ComponentView::HandleCommand(const winrt::Microsoft::ReactNative::HandleCom
|
|
|
262
263
|
}
|
|
263
264
|
}
|
|
264
265
|
|
|
266
|
+
HWND ComponentView::GetHwndForParenting() noexcept {
|
|
267
|
+
if (m_parent) {
|
|
268
|
+
return winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(m_parent)
|
|
269
|
+
->GetHwndForParenting();
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Fallback if we do not know any more specific HWND
|
|
273
|
+
return reinterpret_cast<HWND>(winrt::Microsoft::ReactNative::implementation::ReactCoreInjection::GetTopLevelWindowId(
|
|
274
|
+
m_reactContext.Properties().Handle()));
|
|
275
|
+
}
|
|
276
|
+
|
|
265
277
|
winrt::Microsoft::ReactNative::Composition::implementation::RootComponentView *ComponentView::rootComponentView()
|
|
266
278
|
const noexcept {
|
|
267
279
|
if (m_rootView)
|
|
@@ -209,6 +209,9 @@ struct ComponentView : public ComponentViewT<ComponentView> {
|
|
|
209
209
|
// Notify up the tree to bring the rect into view by scrolling as needed
|
|
210
210
|
virtual void StartBringIntoView(BringIntoViewOptions &&args) noexcept;
|
|
211
211
|
|
|
212
|
+
// Eventually PopupContentLink and similar APIs will remove the need for this.
|
|
213
|
+
virtual HWND GetHwndForParenting() noexcept;
|
|
214
|
+
|
|
212
215
|
virtual const winrt::Microsoft::ReactNative::IComponentProps userProps(
|
|
213
216
|
facebook::react::Props::Shared const &props) noexcept;
|
|
214
217
|
|
|
@@ -129,6 +129,18 @@ bool accessibilityValueHasValue(const facebook::react::AccessibilityValue &value
|
|
|
129
129
|
return (value.min.has_value() && value.max.has_value()) || value.now.has_value() || value.text.has_value();
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
bool expandableControl(const facebook::react::SharedViewProps props) {
|
|
133
|
+
if (props->accessibilityState.has_value() && props->accessibilityState->expanded.has_value())
|
|
134
|
+
return true;
|
|
135
|
+
auto accessibilityActions = props->accessibilityActions;
|
|
136
|
+
for (size_t i = 0; i < accessibilityActions.size(); i++) {
|
|
137
|
+
if (accessibilityActions[i].name == "expand" || accessibilityActions[i].name == "collapse") {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
|
|
132
144
|
HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTERNID patternId, IUnknown **pRetVal) {
|
|
133
145
|
if (pRetVal == nullptr)
|
|
134
146
|
return E_POINTER;
|
|
@@ -181,6 +193,15 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE
|
|
|
181
193
|
AddRef();
|
|
182
194
|
}
|
|
183
195
|
|
|
196
|
+
if (patternId == UIA_ExpandCollapsePatternId &&
|
|
197
|
+
(accessibilityRole == "combobox" || accessibilityRole == "splitbutton" || accessibilityRole == "treeitem" ||
|
|
198
|
+
(expandableControl(props) &&
|
|
199
|
+
(accessibilityRole == "toolbar" || accessibilityRole == "menuitem" || accessibilityRole == "menubar" ||
|
|
200
|
+
accessibilityRole == "listitem" || accessibilityRole == "group" || accessibilityRole == "button")))) {
|
|
201
|
+
*pRetVal = static_cast<IExpandCollapseProvider *>(this);
|
|
202
|
+
AddRef();
|
|
203
|
+
}
|
|
204
|
+
|
|
184
205
|
return S_OK;
|
|
185
206
|
}
|
|
186
207
|
|
|
@@ -349,6 +370,13 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
|
|
|
349
370
|
pRetVal->lVal = GetLiveSetting(props->accessibilityLiveRegion);
|
|
350
371
|
break;
|
|
351
372
|
}
|
|
373
|
+
case UIA_ItemStatusPropertyId: {
|
|
374
|
+
pRetVal->vt = VT_BSTR;
|
|
375
|
+
pRetVal->bstrVal = (props->accessibilityState.has_value() && props->accessibilityState->busy)
|
|
376
|
+
? SysAllocString(L"Busy")
|
|
377
|
+
: SysAllocString(L"");
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
352
380
|
}
|
|
353
381
|
|
|
354
382
|
return hr;
|
|
@@ -496,4 +524,42 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::Toggle() {
|
|
|
496
524
|
return S_OK;
|
|
497
525
|
}
|
|
498
526
|
|
|
527
|
+
HRESULT __stdcall CompositionDynamicAutomationProvider::get_ExpandCollapseState(ExpandCollapseState *pRetVal) {
|
|
528
|
+
if (pRetVal == nullptr)
|
|
529
|
+
return E_POINTER;
|
|
530
|
+
auto strongView = m_view.view();
|
|
531
|
+
|
|
532
|
+
if (!strongView)
|
|
533
|
+
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
534
|
+
|
|
535
|
+
auto props = std::static_pointer_cast<const facebook::react::ViewProps>(
|
|
536
|
+
winrt::get_self<winrt::Microsoft::ReactNative::implementation::ComponentView>(strongView)->props());
|
|
537
|
+
|
|
538
|
+
if (props == nullptr)
|
|
539
|
+
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
540
|
+
|
|
541
|
+
*pRetVal = props->accessibilityState->expanded.has_value()
|
|
542
|
+
? GetExpandCollapseState(props->accessibilityState->expanded.value())
|
|
543
|
+
: ExpandCollapseState_Collapsed;
|
|
544
|
+
return S_OK;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
HRESULT __stdcall CompositionDynamicAutomationProvider::Expand() {
|
|
548
|
+
auto strongView = m_view.view();
|
|
549
|
+
|
|
550
|
+
if (!strongView)
|
|
551
|
+
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
552
|
+
DispatchAccessibilityAction(m_view, "expand");
|
|
553
|
+
return S_OK;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
HRESULT __stdcall CompositionDynamicAutomationProvider::Collapse() {
|
|
557
|
+
auto strongView = m_view.view();
|
|
558
|
+
|
|
559
|
+
if (!strongView)
|
|
560
|
+
return UIA_E_ELEMENTNOTAVAILABLE;
|
|
561
|
+
DispatchAccessibilityAction(m_view, "collapse");
|
|
562
|
+
return S_OK;
|
|
563
|
+
}
|
|
564
|
+
|
|
499
565
|
} // namespace winrt::Microsoft::ReactNative::implementation
|