@office-iss/react-native-win32 0.73.4 → 0.73.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.
package/.flowconfig CHANGED
@@ -10,6 +10,7 @@
10
10
  ; initRNLibraries build step
11
11
  <PROJECT_ROOT>/index.js
12
12
  <PROJECT_ROOT>/Libraries/Alert/Alert.js
13
+ <PROJECT_ROOT>/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js
13
14
  <PROJECT_ROOT>/Libraries/Components/Button.js
14
15
  <PROJECT_ROOT>/Libraries/Components/Pressable/Pressable.js
15
16
  <PROJECT_ROOT>/Libraries/Components/SafeAreaView/SafeAreaView.js
package/CHANGELOG.json CHANGED
@@ -2,7 +2,43 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 06 May 2024 15:14:33 GMT",
5
+ "date": "Thu, 23 May 2024 15:39:24 GMT",
6
+ "version": "0.73.6",
7
+ "tag": "@office-iss/react-native-win32_v0.73.6",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "30809111+acoates-ms@users.noreply.github.com",
12
+ "package": "@office-iss/react-native-win32",
13
+ "commit": "0e1b8e1d5fec5a25b43234733ebcf621bde8c04e",
14
+ "comment": "Fix for PaperUIManger"
15
+ },
16
+ {
17
+ "author": "email not defined",
18
+ "package": "@office-iss/react-native-win32",
19
+ "commit": "4c08164bf076cae9c341b048fa4bad145a63be08",
20
+ "comment": "integrate 73.8"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Wed, 15 May 2024 20:50:52 GMT",
27
+ "version": "0.73.5",
28
+ "tag": "@office-iss/react-native-win32_v0.73.5",
29
+ "comments": {
30
+ "patch": [
31
+ {
32
+ "author": "krsiler@microsoft.com",
33
+ "package": "@office-iss/react-native-win32",
34
+ "commit": "239531987a0df509d06ca52c8e6ed9ca03ead70b",
35
+ "comment": "add support for announceForAccessibilityWithOptions"
36
+ }
37
+ ]
38
+ }
39
+ },
40
+ {
41
+ "date": "Mon, 06 May 2024 15:14:45 GMT",
6
42
  "version": "0.73.4",
7
43
  "tag": "@office-iss/react-native-win32_v0.73.4",
8
44
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,34 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- This log was last generated on Mon, 06 May 2024 15:14:33 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 23 May 2024 15:39:24 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.73.4
7
+ ## 0.73.6
8
8
 
9
- Mon, 06 May 2024 15:14:33 GMT
9
+ Thu, 23 May 2024 15:39:24 GMT
10
10
 
11
11
  ### Patches
12
12
 
13
- - PaperUIManager running as turbomodule fix (30809111+acoates-ms@users.noreply.github.com)
13
+ - Fix for PaperUIManger (30809111+acoates-ms@users.noreply.github.com)
14
+ - integrate 73.8 (email not defined)
14
15
 
16
+ ## 0.73.5
17
+
18
+ Wed, 15 May 2024 20:50:52 GMT
19
+
20
+ ### Patches
21
+
22
+ - add support for announceForAccessibilityWithOptions (krsiler@microsoft.com)
23
+
24
+ ## 0.73.4
25
+
26
+ Mon, 06 May 2024 15:14:45 GMT
27
+
28
+ ### Patches
29
+
30
+ - PaperUIManager running as turbomodule fix (30809111+acoates-ms@users.noreply.github.com)
31
+
15
32
  ## 0.73.3
16
33
 
17
34
  Fri, 26 Apr 2024 22:42:37 GMT
@@ -134,10 +134,14 @@ export interface AccessibilityInfoStatic {
134
134
  * - `announcement`: The string announced by the screen reader.
135
135
  * - `options`: An object that configures the reading options.
136
136
  * - `queue`: The announcement will be queued behind existing announcements. iOS only.
137
+ * - `nativeID`: The nativeID of the element to send the announcement from. win32 only.
137
138
  */
138
139
  announceForAccessibilityWithOptions(
139
140
  announcement: string,
140
- options: {queue?: boolean | undefined},
141
+ options: {
142
+ queue?: boolean | undefined;
143
+ nativeID?: string | undefined; // win32
144
+ },
141
145
  ): void;
142
146
 
143
147
  /**
@@ -17,6 +17,7 @@ import {sendAccessibilityEvent} from '../../ReactNative/RendererProxy';
17
17
  import Platform from '../../Utilities/Platform';
18
18
  import legacySendAccessibilityEvent from './legacySendAccessibilityEvent';
19
19
  import NativeAccessibilityInfo from './NativeAccessibilityInfo';
20
+ import NativeAccessibilityInfoWin32 from './NativeAccessibilityInfoWin32';
20
21
  import NativeAccessibilityManagerIOS from './NativeAccessibilityManager';
21
22
 
22
23
  // Events that are only supported on Android.
@@ -166,12 +167,18 @@ const AccessibilityInfo = {
166
167
  */
167
168
  isReduceMotionEnabled(): Promise<boolean> {
168
169
  return new Promise((resolve, reject) => {
169
- if (Platform.OS === 'android' || Platform.OS === 'win32') {
170
+ if (Platform.OS === 'android') {
170
171
  if (NativeAccessibilityInfo != null) {
171
172
  NativeAccessibilityInfo.isReduceMotionEnabled(resolve);
172
173
  } else {
173
174
  reject(null);
174
175
  }
176
+ } else if (Platform.OS === 'win32') {
177
+ if (NativeAccessibilityInfoWin32 != null) {
178
+ NativeAccessibilityInfoWin32.isReduceMotionEnabled(resolve);
179
+ } else {
180
+ reject(null);
181
+ }
175
182
  } else {
176
183
  if (NativeAccessibilityManagerIOS != null) {
177
184
  NativeAccessibilityManagerIOS.getCurrentReduceMotionState(
@@ -248,12 +255,18 @@ const AccessibilityInfo = {
248
255
  */
249
256
  isScreenReaderEnabled(): Promise<boolean> {
250
257
  return new Promise((resolve, reject) => {
251
- if (Platform.OS === 'android' || Platform.OS === 'win32') {
258
+ if (Platform.OS === 'android') {
252
259
  if (NativeAccessibilityInfo != null) {
253
260
  NativeAccessibilityInfo.isTouchExplorationEnabled(resolve);
254
261
  } else {
255
262
  reject(null);
256
263
  }
264
+ } else if (Platform.OS === 'win32') {
265
+ if (NativeAccessibilityInfoWin32 != null) {
266
+ NativeAccessibilityInfoWin32.isTouchExplorationEnabled(resolve);
267
+ } else {
268
+ reject(null);
269
+ }
257
270
  } else {
258
271
  if (NativeAccessibilityManagerIOS != null) {
259
272
  NativeAccessibilityManagerIOS.getCurrentVoiceOverState(
@@ -370,8 +383,10 @@ const AccessibilityInfo = {
370
383
  * See https://reactnative.dev/docs/accessibilityinfo#announceforaccessibility
371
384
  */
372
385
  announceForAccessibility(announcement: string): void {
373
- if (Platform.OS === 'android' || Platform.OS === 'win32') {
386
+ if (Platform.OS === 'android') {
374
387
  NativeAccessibilityInfo?.announceForAccessibility(announcement);
388
+ } else if (Platform.OS === 'win32') {
389
+ NativeAccessibilityInfoWin32?.announceForAccessibility(announcement);
375
390
  } else {
376
391
  NativeAccessibilityManagerIOS?.announceForAccessibility(announcement);
377
392
  }
@@ -382,18 +397,33 @@ const AccessibilityInfo = {
382
397
  * - `announcement`: The string announced by the screen reader.
383
398
  * - `options`: An object that configures the reading options.
384
399
  * - `queue`: The announcement will be queued behind existing announcements. iOS only.
400
+ * - `nativeID`: The nativeID of the element to send the announcement from. win32 only.
385
401
  */
386
402
  announceForAccessibilityWithOptions(
387
403
  announcement: string,
388
- options: {queue?: boolean},
404
+ options: {
405
+ queue?: boolean,
406
+ nativeID?: string, // win32
407
+ },
389
408
  ): void {
390
- if (Platform.OS === 'android' || Platform.OS === 'win32') {
409
+ if (Platform.OS === 'android') {
391
410
  NativeAccessibilityInfo?.announceForAccessibility(announcement);
411
+ } else if (Platform.OS === 'win32') {
412
+ if (NativeAccessibilityInfoWin32?.announceForAccessibilityWithOptions) {
413
+ NativeAccessibilityInfoWin32?.announceForAccessibilityWithOptions(
414
+ announcement,
415
+ options,
416
+ );
417
+ } else {
418
+ NativeAccessibilityInfoWin32?.announceForAccessibility(announcement);
419
+ }
392
420
  } else {
393
421
  if (NativeAccessibilityManagerIOS?.announceForAccessibilityWithOptions) {
422
+ const {nativeID: _, ...iosOptions} = options;
423
+ // $FlowFixMe[prop-missing]
394
424
  NativeAccessibilityManagerIOS?.announceForAccessibilityWithOptions(
395
425
  announcement,
396
- options,
426
+ iosOptions,
397
427
  );
398
428
  } else {
399
429
  NativeAccessibilityManagerIOS?.announceForAccessibility(announcement);
@@ -407,7 +437,7 @@ const AccessibilityInfo = {
407
437
  * See https://reactnative.dev/docs/accessibilityinfo#getrecommendedtimeoutmillis
408
438
  */
409
439
  getRecommendedTimeoutMillis(originalTimeout: number): Promise<number> {
410
- if (Platform.OS === 'android' || Platform.OS === 'win32') {
440
+ if (Platform.OS === 'android') {
411
441
  return new Promise((resolve, reject) => {
412
442
  if (NativeAccessibilityInfo?.getRecommendedTimeoutMillis) {
413
443
  NativeAccessibilityInfo.getRecommendedTimeoutMillis(
@@ -418,6 +448,17 @@ const AccessibilityInfo = {
418
448
  resolve(originalTimeout);
419
449
  }
420
450
  });
451
+ } else if (Platform.OS === 'win32') {
452
+ return new Promise((resolve, reject) => {
453
+ if (NativeAccessibilityInfoWin32?.getRecommendedTimeoutMillis) {
454
+ NativeAccessibilityInfoWin32.getRecommendedTimeoutMillis(
455
+ originalTimeout,
456
+ resolve,
457
+ );
458
+ } else {
459
+ resolve(originalTimeout);
460
+ }
461
+ });
421
462
  } else {
422
463
  return Promise.resolve(originalTimeout);
423
464
  }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * @format
6
+ * @flow
7
+ */
8
+
9
+ import type {TurboModule} from '../../TurboModule/RCTExport';
10
+
11
+ import * as TurboModuleRegistry from '../../TurboModule/TurboModuleRegistry';
12
+
13
+ export interface Spec extends TurboModule {
14
+ +isReduceMotionEnabled: (
15
+ onSuccess: (isReduceMotionEnabled: boolean) => void,
16
+ ) => void;
17
+ +isTouchExplorationEnabled: (
18
+ onSuccess: (isScreenReaderEnabled: boolean) => void,
19
+ ) => void;
20
+ +isAccessibilityServiceEnabled?: ?(
21
+ onSuccess: (isAccessibilityServiceEnabled: boolean) => void,
22
+ ) => void;
23
+ +setAccessibilityFocus: (reactTag: number) => void;
24
+ +announceForAccessibility: (announcement: string) => void;
25
+ // [Win32
26
+ +announceForAccessibilityWithOptions?: (
27
+ announcement: string,
28
+ options: {queue?: boolean, nativeID?: string},
29
+ ) => void;
30
+ // Win32]
31
+ +getRecommendedTimeoutMillis?: (
32
+ mSec: number,
33
+ onSuccess: (recommendedTimeoutMillis: number) => void,
34
+ ) => void;
35
+ }
36
+
37
+ export default (TurboModuleRegistry.get<Spec>('AccessibilityInfo'): ?Spec);
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
- patch: 6,
15
+ patch: 8,
16
16
  prerelease: null,
17
17
  };
@@ -86,6 +86,10 @@ for (const propName of Object.getOwnPropertyNames(
86
86
  // $FlowFixMe
87
87
  UIManagerJS[propName] = NativeUIManager[propName];
88
88
  }
89
+ for (const propName of Object.getOwnPropertyNames(NativeUIManager)) {
90
+ // $FlowFixMe
91
+ UIManagerJS[propName] = NativeUIManager[propName];
92
+ }
89
93
  // Windows]
90
94
 
91
95
  /* $FlowFixMe(>=0.123.0 site=react_native_fb) This comment suppresses an error
package/overrides.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "**/__snapshots__/**",
8
8
  "src/rntypes/**"
9
9
  ],
10
- "baseVersion": "0.73.6",
10
+ "baseVersion": "0.73.8",
11
11
  "overrides": [
12
12
  {
13
13
  "type": "derived",
@@ -39,11 +39,16 @@
39
39
  "issue": 11041
40
40
  },
41
41
  {
42
- "type": "patch",
42
+ "type": "derived",
43
+ "file": "src/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts",
44
+ "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.d.ts",
45
+ "baseHash": "f55fda723b8dc0f9836f2fa4a4a766ed45c71c00"
46
+ },
47
+ {
48
+ "type": "derived",
43
49
  "file": "src/Libraries/Components/AccessibilityInfo/AccessibilityInfo.win32.js",
44
50
  "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js",
45
- "baseHash": "163927cc271b53109f06eaf5fc6d30a9af8cb27e",
46
- "issue": 4578
51
+ "baseHash": "163927cc271b53109f06eaf5fc6d30a9af8cb27e"
47
52
  },
48
53
  {
49
54
  "type": "copy",
@@ -52,6 +57,12 @@
52
57
  "baseHash": "d37b2f72125246ababf3260e99ef790ce76fe3bb",
53
58
  "issue": 4578
54
59
  },
60
+ {
61
+ "type": "derived",
62
+ "file": "src/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfoWin32.js",
63
+ "baseFile": "packages/react-native/Libraries/Components/AccessibilityInfo/NativeAccessibilityInfo.js",
64
+ "baseHash": "9427a7feebfbe3de606b2d100439cabf2faa8661"
65
+ },
55
66
  {
56
67
  "type": "derived",
57
68
  "file": "src/Libraries/Components/Button.win32.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.73.4",
3
+ "version": "0.73.6",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -85,7 +85,7 @@
85
85
  "just-scripts": "^1.3.3",
86
86
  "prettier": "^2.4.1",
87
87
  "react": "18.2.0",
88
- "react-native": "0.73.6",
88
+ "react-native": "0.73.8",
89
89
  "react-native-platform-override": "^1.9.16",
90
90
  "typescript": "^4.9.5"
91
91
  },
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @format
8
+ */
9
+
10
+ import type * as React from 'react';
11
+ import {HostComponent} from '../../../types/public/ReactNativeTypes';
12
+ import {EmitterSubscription} from '../../vendor/emitter/EventEmitter';
13
+
14
+ type AccessibilityChangeEventName =
15
+ | 'change' // deprecated, maps to screenReaderChanged
16
+ | 'boldTextChanged' // iOS-only Event
17
+ | 'grayscaleChanged' // iOS-only Event
18
+ | 'invertColorsChanged' // iOS-only Event
19
+ | 'reduceMotionChanged'
20
+ | 'screenReaderChanged'
21
+ | 'reduceTransparencyChanged'; // iOS-only Event
22
+
23
+ type AccessibilityChangeEvent = boolean;
24
+
25
+ type AccessibilityChangeEventHandler = (
26
+ event: AccessibilityChangeEvent,
27
+ ) => void;
28
+
29
+ type AccessibilityAnnouncementEventName = 'announcementFinished'; // iOS-only Event
30
+
31
+ type AccessibilityAnnouncementFinishedEvent = {
32
+ announcement: string;
33
+ success: boolean;
34
+ };
35
+
36
+ type AccessibilityAnnouncementFinishedEventHandler = (
37
+ event: AccessibilityAnnouncementFinishedEvent,
38
+ ) => void;
39
+
40
+ type AccessibilityEventTypes = 'click' | 'focus' | 'viewHoverEnter';
41
+
42
+ /**
43
+ * @see https://reactnative.dev/docs/accessibilityinfo
44
+ */
45
+ export interface AccessibilityInfoStatic {
46
+ /**
47
+ * Query whether bold text is currently enabled.
48
+ *
49
+ * @platform ios
50
+ */
51
+ isBoldTextEnabled: () => Promise<boolean>;
52
+
53
+ /**
54
+ * Query whether grayscale is currently enabled.
55
+ *
56
+ * @platform ios
57
+ */
58
+ isGrayscaleEnabled: () => Promise<boolean>;
59
+
60
+ /**
61
+ * Query whether invert colors is currently enabled.
62
+ *
63
+ * @platform ios
64
+ */
65
+ isInvertColorsEnabled: () => Promise<boolean>;
66
+
67
+ /**
68
+ * Query whether reduce motion is currently enabled.
69
+ */
70
+ isReduceMotionEnabled: () => Promise<boolean>;
71
+
72
+ /**
73
+ * Query whether reduce motion and prefer cross-fade transitions settings are currently enabled.
74
+ *
75
+ * Returns a promise which resolves to a boolean.
76
+ * The result is `true` when prefer cross-fade transitions is enabled and `false` otherwise.
77
+ */
78
+ prefersCrossFadeTransitions(): Promise<boolean>;
79
+
80
+ /**
81
+ * Query whether reduce transparency is currently enabled.
82
+ *
83
+ * @platform ios
84
+ */
85
+ isReduceTransparencyEnabled: () => Promise<boolean>;
86
+
87
+ /**
88
+ * Query whether a screen reader is currently enabled.
89
+ */
90
+ isScreenReaderEnabled: () => Promise<boolean>;
91
+
92
+ /**
93
+ * Query whether Accessibility Service is currently enabled.
94
+ *
95
+ * Returns a promise which resolves to a boolean.
96
+ * The result is `true` when any service is enabled and `false` otherwise.
97
+ *
98
+ * @platform android
99
+ */
100
+ isAccessibilityServiceEnabled(): Promise<boolean>;
101
+
102
+ /**
103
+ * Add an event handler. Supported events:
104
+ * - announcementFinished: iOS-only event. Fires when the screen reader has finished making an announcement.
105
+ * The argument to the event handler is a dictionary with these keys:
106
+ * - announcement: The string announced by the screen reader.
107
+ * - success: A boolean indicating whether the announcement was successfully made.
108
+ * - AccessibilityEventName constants other than announcementFinished: Fires on accessibility feature change.
109
+ * The argument to the event handler is a boolean.
110
+ * The boolean is true when the related event's feature is enabled and false otherwise.
111
+ *
112
+ */
113
+ addEventListener(
114
+ eventName: AccessibilityChangeEventName,
115
+ handler: AccessibilityChangeEventHandler,
116
+ ): EmitterSubscription;
117
+ addEventListener(
118
+ eventName: AccessibilityAnnouncementEventName,
119
+ handler: AccessibilityAnnouncementFinishedEventHandler,
120
+ ): EmitterSubscription;
121
+
122
+ /**
123
+ * Set accessibility focus to a react component.
124
+ */
125
+ setAccessibilityFocus: (reactTag: number) => void;
126
+
127
+ /**
128
+ * Post a string to be announced by the screen reader.
129
+ */
130
+ announceForAccessibility: (announcement: string) => void;
131
+
132
+ /**
133
+ * Post a string to be announced by the screen reader.
134
+ * - `announcement`: The string announced by the screen reader.
135
+ * - `options`: An object that configures the reading options.
136
+ * - `queue`: The announcement will be queued behind existing announcements. iOS only.
137
+ * - `nativeID`: The nativeID of the element to send the announcement from. win32 only.
138
+ */
139
+ announceForAccessibilityWithOptions(
140
+ announcement: string,
141
+ options: {
142
+ queue?: boolean | undefined;
143
+ nativeID?: string | undefined; // win32
144
+ },
145
+ ): void;
146
+
147
+ /**
148
+ * Gets the timeout in millisecond that the user needs.
149
+ * This value is set in "Time to take action (Accessibility timeout)" of "Accessibility" settings.
150
+ *
151
+ * @platform android
152
+ */
153
+ getRecommendedTimeoutMillis: (originalTimeout: number) => Promise<number>;
154
+ sendAccessibilityEvent: (
155
+ handle: React.ElementRef<HostComponent<unknown>>,
156
+ eventType: AccessibilityEventTypes,
157
+ ) => void;
158
+ }
159
+
160
+ export const AccessibilityInfo: AccessibilityInfoStatic;
161
+ export type AccessibilityInfo = AccessibilityInfoStatic;