react-native-windows 0.72.0-preview.4 → 0.72.0-preview.6

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.
@@ -1527,6 +1527,12 @@ function InternalTextInput(props: Props): React.Node {
1527
1527
  };
1528
1528
  }
1529
1529
 
1530
+ if (focusable && !accessible) {
1531
+ console.warn(
1532
+ 'All focusable views should report proper accessiblity information. TextInputs marked as focusable should always be accessible.',
1533
+ );
1534
+ }
1535
+
1530
1536
  // $FlowFixMe[underconstrained-implicit-instantiation]
1531
1537
  let style = flattenStyle(props.style);
1532
1538
 
@@ -46,13 +46,6 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
46
46
  flexWrap: true,
47
47
  gap: true,
48
48
  height: true,
49
- inset: true,
50
- insetBlock: true,
51
- insetBlockEnd: true,
52
- insetBlockStart: true,
53
- insetInline: true,
54
- insetInlineEnd: true,
55
- insetInlineStart: true,
56
49
  justifyContent: true,
57
50
  left: true,
58
51
  margin: true,
@@ -183,6 +183,19 @@ const View: React.AbstractComponent<
183
183
  return updatedChildren;
184
184
  }
185
185
  };
186
+
187
+ const _focusable = tabIndex !== undefined ? !tabIndex : focusable;
188
+ const _accessible =
189
+ importantForAccessibility === 'no-hide-descendants'
190
+ ? false
191
+ : otherProps.accessible;
192
+
193
+ if (_focusable === true && _accessible === false) {
194
+ console.warn(
195
+ 'All focusable views should report proper accessiblity information. Views marked as focusable should always be accessible.',
196
+ );
197
+ }
198
+
186
199
  // Windows]
187
200
 
188
201
  return (
@@ -205,7 +218,7 @@ const View: React.AbstractComponent<
205
218
  : ariaLive ?? accessibilityLiveRegion
206
219
  }
207
220
  accessibilityLabel={ariaLabel ?? accessibilityLabel}
208
- focusable={tabIndex !== undefined ? !tabIndex : focusable}
221
+ focusable={_focusable}
209
222
  disabled={disabled}
210
223
  accessibilityState={_accessibilityState}
211
224
  accessibilityRole={
@@ -230,11 +243,7 @@ const View: React.AbstractComponent<
230
243
  onKeyUp={_keyUp}
231
244
  onKeyUpCapture={_keyUpCapture}
232
245
  // [Windows
233
- accessible={
234
- importantForAccessibility === 'no-hide-descendants'
235
- ? false
236
- : otherProps.accessible
237
- }
246
+ accessible={_accessible}
238
247
  children={
239
248
  importantForAccessibility === 'no-hide-descendants'
240
249
  ? childrenWithImportantForAccessibility(otherProps.children)
@@ -13,5 +13,5 @@ exports.version = {
13
13
  major: 0,
14
14
  minor: 72,
15
15
  patch: 0,
16
- prerelease: 'rc.1',
16
+ prerelease: 'rc.3',
17
17
  };
@@ -258,14 +258,6 @@ const validAttributesForNonEventProps = {
258
258
  top: true,
259
259
  bottom: true,
260
260
 
261
- inset: true,
262
- insetBlock: true,
263
- insetBlockEnd: true,
264
- insetBlockStart: true,
265
- insetInline: true,
266
- insetInlineEnd: true,
267
- insetInlineStart: true,
268
-
269
261
  position: true,
270
262
 
271
263
  style: ReactNativeStyleAttributes,
@@ -236,14 +236,6 @@ const validAttributesForNonEventProps = {
236
236
  bottom: true,
237
237
  left: true,
238
238
 
239
- inset: true,
240
- insetBlock: true,
241
- insetBlockEnd: true,
242
- insetBlockStart: true,
243
- insetInline: true,
244
- insetInlineEnd: true,
245
- insetInlineStart: true,
246
-
247
239
  width: true,
248
240
  height: true,
249
241
 
@@ -260,14 +260,6 @@ const validAttributesForNonEventProps = {
260
260
  bottom: true,
261
261
  left: true,
262
262
 
263
- inset: true,
264
- insetBlock: true,
265
- insetBlockEnd: true,
266
- insetBlockStart: true,
267
- insetInline: true,
268
- insetInlineEnd: true,
269
- insetInlineStart: true,
270
-
271
263
  width: true,
272
264
  height: true,
273
265
 
@@ -69,13 +69,6 @@ export interface FlexStyle {
69
69
  flexShrink?: number | undefined;
70
70
  flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse' | undefined;
71
71
  height?: DimensionValue | undefined;
72
- inset?: DimensionValue | undefined;
73
- insetBlock?: DimensionValue | undefined;
74
- insetBlockEnd?: DimensionValue | undefined;
75
- insetBlockStart?: DimensionValue | undefined;
76
- insetInline?: DimensionValue | undefined;
77
- insetInlineEnd?: DimensionValue | undefined;
78
- insetInlineStart?: DimensionValue | undefined;
79
72
  justifyContent?:
80
73
  | 'flex-start'
81
74
  | 'flex-end'
@@ -134,80 +134,6 @@ type ____LayoutStyle_Internal = $ReadOnly<{
134
134
  */
135
135
  top?: DimensionValue,
136
136
 
137
- /** `inset` is a shorthand that corresponds to the top, right, bottom, and/or left properties.
138
- *
139
- * It works similarly to `inset` in CSS, but in React Native you
140
- * must use points or percentages. Ems and other units are not supported.
141
- *
142
- * See https://developer.mozilla.org/en-US/docs/Web/CSS/inset
143
- * for more details of how `inset` affects layout.
144
- */
145
- inset?: DimensionValue,
146
-
147
- /** `insetBlock` is a shorthand that corresponds to the `insetBlockStart` and `insetBlockEnd` properties.
148
- *
149
- * It works similarly to `inset-block` in CSS, but in React Native you
150
- * must use points or percentages. Ems and other units are not supported.
151
- *
152
- * See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block
153
- * for more details of how `inset-block` affects layout.
154
- */
155
- insetBlock?: DimensionValue,
156
-
157
- /** `insetBlockEnd` is a logical property that sets the length that an
158
- * element is offset in the block direction from its ending edge.
159
- *
160
- * It works similarly to `inset-block-end` in CSS, but in React Native you
161
- * must use points or percentages. Ems and other units are not supported.
162
- *
163
- * See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-end
164
- * for more details of how `inset-block-end` affects layout.
165
- */
166
- insetBlockEnd?: DimensionValue,
167
-
168
- /** `insetBlockStart` is a logical property that sets the length that an
169
- * element is offset in the block direction from its starting edge.
170
- *
171
- * It works similarly to `inset-block-start` in CSS, but in React Native you
172
- * must use points or percentages. Ems and other units are not supported.
173
- *
174
- * See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-start
175
- * for more details of how `inset-block-start` affects layout.
176
- */
177
- insetBlockStart?: DimensionValue,
178
-
179
- /** `insetInline` is a shorthand that corresponds to the `insetInlineStart` and `insetInlineEnd` properties.
180
- *
181
- * It works similarly to `inset-inline` in CSS, but in React Native you
182
- * must use points or percentages. Ems and other units are not supported.
183
- *
184
- * See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline
185
- * for more details of how `inset-inline` affects layout.
186
- */
187
- insetInline?: DimensionValue,
188
-
189
- /** `insetInlineEnd` is a logical property that sets the length that an
190
- * element is offset in the starting inline direction.
191
- *
192
- * It works similarly to `inset-inline-end` in CSS, but in React Native you
193
- * must use points or percentages. Ems and other units are not supported.
194
- *
195
- * See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-end
196
- * for more details of how `inset-inline-end` affects layout.
197
- */
198
- insetInlineEnd?: DimensionValue,
199
-
200
- /** `insetInlineStart` is a logical property that sets the length that an
201
- * element is offset in the starting inline direction.
202
- *
203
- * It works similarly to `inset-inline-start` in CSS, but in React Native you
204
- * must use points or percentages. Ems and other units are not supported.
205
- *
206
- * See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-start
207
- * for more details of how `inset-inline-start` affects layout.
208
- */
209
- insetInlineStart?: DimensionValue,
210
-
211
137
  /** `minWidth` is the minimum width for this component, in logical pixels.
212
138
  *
213
139
  * It works similarly to `min-width` in CSS, but in React Native you
@@ -208,6 +208,7 @@ const Text: React.AbstractComponent<
208
208
 
209
209
  const _accessible = Platform.select({
210
210
  ios: accessible !== false,
211
+ windows: accessible !== false,
211
212
  default: accessible,
212
213
  });
213
214
 
@@ -307,13 +308,26 @@ const Text: React.AbstractComponent<
307
308
  <NativeText
308
309
  {...textPropsLessStyle}
309
310
  {...eventHandlersForText}
310
- accessible={accessible !== false}
311
+ accessibilityLabel={ariaLabel ?? accessibilityLabel}
312
+ accessibilityRole={
313
+ role ? getAccessibilityRoleFromRole(role) : accessibilityRole
314
+ }
315
+ accessibilityState={nativeTextAccessibilityState}
316
+ accessible={
317
+ accessible == null && Platform.OS === 'android'
318
+ ? _hasOnPressOrOnLongPress
319
+ : _accessible
320
+ }
311
321
  allowFontScaling={allowFontScaling !== false}
322
+ disabled={_disabled}
312
323
  ellipsizeMode={ellipsizeMode ?? 'tail'}
313
324
  isHighlighted={isHighlighted}
325
+ nativeID={id ?? nativeID}
326
+ numberOfLines={numberOfLines}
327
+ ref={forwardedRef}
328
+ selectable={_selectable}
314
329
  selectionColor={selectionColor}
315
330
  style={((rest: any): TextStyleProp)}
316
- ref={forwardedRef}
317
331
  />
318
332
  </TextAncestor.Provider>
319
333
  </View>
@@ -324,13 +338,26 @@ const Text: React.AbstractComponent<
324
338
  <NativeText
325
339
  {...restProps}
326
340
  {...eventHandlersForText}
327
- accessible={accessible !== false}
341
+ accessibilityLabel={ariaLabel ?? accessibilityLabel}
342
+ accessibilityRole={
343
+ role ? getAccessibilityRoleFromRole(role) : accessibilityRole
344
+ }
345
+ accessibilityState={nativeTextAccessibilityState}
346
+ accessible={
347
+ accessible == null && Platform.OS === 'android'
348
+ ? _hasOnPressOrOnLongPress
349
+ : _accessible
350
+ }
328
351
  allowFontScaling={allowFontScaling !== false}
352
+ disabled={_disabled}
329
353
  ellipsizeMode={ellipsizeMode ?? 'tail'}
330
354
  isHighlighted={isHighlighted}
355
+ nativeID={id ?? nativeID}
356
+ numberOfLines={numberOfLines}
357
+ ref={forwardedRef}
358
+ selectable={_selectable}
331
359
  selectionColor={selectionColor}
332
360
  style={style}
333
- ref={forwardedRef}
334
361
  />
335
362
  </TextAncestor.Provider>
336
363
  );
@@ -13,26 +13,16 @@ ImageRequest::ImageRequest(ImageSource imageSource, std::shared_ptr<const ImageT
13
13
  coordinator_ = std::make_shared<ImageResponseObserverCoordinator>();
14
14
  }
15
15
 
16
- ImageRequest::ImageRequest(ImageRequest &&other) noexcept
17
- : imageSource_(std::move(other.imageSource_)),
18
- telemetry_(std::move(other.telemetry_)),
19
- coordinator_(std::move(other.coordinator_)) {
20
- other.coordinator_ = nullptr;
21
- other.cancelRequest_ = nullptr;
22
- other.telemetry_ = nullptr;
23
- other.imageSource_ = {};
16
+ void ImageRequest::setCancelationFunction(std::function<void(void)> cancelationFunction) {
17
+ cancelRequest_ = cancelationFunction;
24
18
  }
25
19
 
26
- ImageRequest::~ImageRequest() {
20
+ void ImageRequest::cancel() const {
27
21
  if (cancelRequest_) {
28
22
  cancelRequest_();
29
23
  }
30
24
  }
31
25
 
32
- void ImageRequest::setCancelationFunction(std::function<void(void)> cancelationFunction) {
33
- cancelRequest_ = cancelationFunction;
34
- }
35
-
36
26
  const ImageSource &ImageRequest::getImageSource() const {
37
27
  return imageSource_;
38
28
  }
@@ -125,12 +125,9 @@ void ControlViewManager::SetLayoutProps(
125
125
 
126
126
  void ControlViewManager::OnPropertiesUpdated(ShadowNodeBase *node) {
127
127
  auto control(node->GetView().as<xaml::Controls::Control>());
128
-
129
- // If developer specifies either the accessible and focusable prop to be false
130
- // remove accessibility and keyboard focus for component.
131
- const auto isTabStop = !node->IsDisable() && (node->IsAccessible() && node->IsFocusable());
132
- const auto accessibilityView =
133
- isTabStop ? xaml::Automation::Peers::AccessibilityView::Content : xaml::Automation::Peers::AccessibilityView::Raw;
128
+ const auto isTabStop = !node->IsDisable() && node->IsFocusable();
129
+ const auto accessibilityView = node->IsAccessible() ? xaml::Automation::Peers::AccessibilityView::Content
130
+ : xaml::Automation::Peers::AccessibilityView::Raw;
134
131
  control.IsTabStop(isTabStop);
135
132
  xaml::Automation::AutomationProperties::SetAccessibilityView(control, accessibilityView);
136
133
  }
@@ -595,20 +595,13 @@ void ViewViewManager::TryUpdateView(
595
595
  }
596
596
 
597
597
  void ViewViewManager::SyncFocusableAndAccessible(ViewShadowNode *pViewShadowNode, bool useControl) {
598
- // If developer specifies either the accessible and focusable prop to be false
599
- // remove accessibility and keyboard focus for component. Exception is made
600
- // for case where a View with undefined onPress is specified, where
601
- // component gains accessibility focus when either the accessible and focusable prop are true.
602
598
  if (useControl) {
603
599
  const auto isFocusable = pViewShadowNode->IsFocusable();
604
600
  const auto isAccessible = pViewShadowNode->IsAccessible();
605
- const auto isPressable = pViewShadowNode->OnClick();
606
601
  const auto isDisabled = pViewShadowNode->IsDisable();
607
- const auto isTabStop =
608
- (!isDisabled &&
609
- ((isPressable && isFocusable && isAccessible) || (!isPressable && (isFocusable || isAccessible))));
610
- const auto accessibilityView = isTabStop ? xaml::Automation::Peers::AccessibilityView::Content
611
- : xaml::Automation::Peers::AccessibilityView::Raw;
602
+ const auto isTabStop = !isDisabled && isFocusable;
603
+ const auto accessibilityView = isAccessible ? xaml::Automation::Peers::AccessibilityView::Content
604
+ : xaml::Automation::Peers::AccessibilityView::Raw;
612
605
  pViewShadowNode->GetControl().IsTabStop(isTabStop);
613
606
  xaml::Automation::AutomationProperties::SetAccessibilityView(pViewShadowNode->GetControl(), accessibilityView);
614
607
  }
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.72.0-preview.4</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.72.0-preview.6</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>72</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>f2076401425338dec2db2d115b886988ac70e57b</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>b9a2d51896667aadcd9a7c497631ca96fe0d1ca4</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -136,13 +136,6 @@ void YogaStylableProps::setProp(
136
136
  REBUILD_FIELD_YG_EDGES(border, "border", "Width");
137
137
 
138
138
  // Aliases
139
- RAW_SET_PROP_SWITCH_CASE(inset, "inset");
140
- RAW_SET_PROP_SWITCH_CASE(insetBlock, "insetBlock");
141
- RAW_SET_PROP_SWITCH_CASE(insetBlockEnd, "insetBlockEnd");
142
- RAW_SET_PROP_SWITCH_CASE(insetBlockStart, "insetBlockStart");
143
- RAW_SET_PROP_SWITCH_CASE(insetInline, "insetInline");
144
- RAW_SET_PROP_SWITCH_CASE(insetInlineEnd, "insetInlineEnd");
145
- RAW_SET_PROP_SWITCH_CASE(insetInlineStart, "insetInlineStart");
146
139
  RAW_SET_PROP_SWITCH_CASE(marginInline, "marginInline");
147
140
  RAW_SET_PROP_SWITCH_CASE(marginInlineStart, "marginInlineStart");
148
141
  RAW_SET_PROP_SWITCH_CASE(marginInlineEnd, "marginInlineEnd");
@@ -242,48 +235,6 @@ void YogaStylableProps::convertRawPropAliases(
242
235
  const PropsParserContext &context,
243
236
  YogaStylableProps const &sourceProps,
244
237
  RawProps const &rawProps) {
245
- inset = convertRawProp(
246
- context,
247
- rawProps,
248
- "inset",
249
- sourceProps.inset,
250
- CompactValue::ofUndefined());
251
- insetBlock = convertRawProp(
252
- context,
253
- rawProps,
254
- "insetBlock",
255
- sourceProps.insetBlock,
256
- CompactValue::ofUndefined());
257
- insetBlockEnd = convertRawProp(
258
- context,
259
- rawProps,
260
- "insetBlockEnd",
261
- sourceProps.insetBlockEnd,
262
- CompactValue::ofUndefined());
263
- insetBlockStart = convertRawProp(
264
- context,
265
- rawProps,
266
- "insetBlockStart",
267
- sourceProps.insetBlockStart,
268
- CompactValue::ofUndefined());
269
- insetInline = convertRawProp(
270
- context,
271
- rawProps,
272
- "insetInline",
273
- sourceProps.insetInline,
274
- CompactValue::ofUndefined());
275
- insetInlineEnd = convertRawProp(
276
- context,
277
- rawProps,
278
- "insetInlineEnd",
279
- sourceProps.insetInlineEnd,
280
- CompactValue::ofUndefined());
281
- insetInlineStart = convertRawProp(
282
- context,
283
- rawProps,
284
- "insetInlineStart",
285
- sourceProps.insetInlineStart,
286
- CompactValue::ofUndefined());
287
238
  marginInline = convertRawProp(
288
239
  context,
289
240
  rawProps,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.72.0-preview.4",
3
+ "version": "0.72.0-preview.6",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,10 +23,10 @@
23
23
  "dependencies": {
24
24
  "@babel/runtime": "^7.0.0",
25
25
  "@jest/create-cache-key-function": "^29.2.1",
26
- "@react-native-community/cli": "11.2.0",
27
- "@react-native-community/cli-platform-android": "11.2.0",
28
- "@react-native-community/cli-platform-ios": "11.2.0",
29
- "@react-native-windows/cli": "0.72.0-preview.3",
26
+ "@react-native-community/cli": "11.2.3",
27
+ "@react-native-community/cli-platform-android": "11.2.3",
28
+ "@react-native-community/cli-platform-ios": "11.2.3",
29
+ "@react-native-windows/cli": "0.72.0-preview.4",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "^0.72.0",
32
32
  "@react-native/codegen": "^0.72.3",
@@ -37,15 +37,15 @@
37
37
  "abort-controller": "^3.0.0",
38
38
  "anser": "^1.4.9",
39
39
  "base64-js": "^1.1.2",
40
- "deprecated-react-native-prop-types": "^4.0.0",
40
+ "deprecated-react-native-prop-types": "^4.1.0",
41
41
  "event-target-shim": "^5.0.1",
42
42
  "flow-enums-runtime": "^0.0.5",
43
43
  "invariant": "^2.2.4",
44
44
  "jest-environment-node": "^29.2.1",
45
45
  "jsc-android": "^250231.0.0",
46
46
  "memoize-one": "^5.0.0",
47
- "metro-runtime": "0.76.2",
48
- "metro-source-map": "0.76.2",
47
+ "metro-runtime": "0.76.4",
48
+ "metro-source-map": "0.76.4",
49
49
  "mkdirp": "^0.5.1",
50
50
  "nullthrows": "^1.1.1",
51
51
  "pretty-format": "^26.5.2",
@@ -76,10 +76,10 @@
76
76
  "flow-bin": "^0.202.0",
77
77
  "jscodeshift": "^0.14.0",
78
78
  "just-scripts": "^1.3.3",
79
- "metro-config": "0.76.2",
79
+ "metro-config": "0.76.4",
80
80
  "prettier": "^2.4.1",
81
81
  "react": "18.2.0",
82
- "react-native": "0.72.0-rc.1",
82
+ "react-native": "0.72.0-rc.3",
83
83
  "react-native-platform-override": "^1.9.4",
84
84
  "react-refresh": "^0.4.0",
85
85
  "typescript": "^4.9.5"