@office-iss/react-native-win32 0.66.4 → 0.66.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
@@ -26,6 +26,8 @@
26
26
  <PROJECT_ROOT>/Libraries/Pressability/Pressability.js
27
27
  <PROJECT_ROOT>/Libraries/Pressability/HoverState.js
28
28
  <PROJECT_ROOT>/Libraries/StyleSheet/StyleSheet.js
29
+ <PROJECT_ROOT>/Libraries/Text/Text.js
30
+ <PROJECT_ROOT>/Libraries/Text/TextNativeComponent.js
29
31
  <PROJECT_ROOT>/Libraries/Types/CoreEventTypes.js
30
32
  <PROJECT_ROOT>/Libraries/Utilities/DeviceInfo.js
31
33
  <PROJECT_ROOT>/Libraries/Utilities/Dimensions.js
package/CHANGELOG.json CHANGED
@@ -2,7 +2,37 @@
2
2
  "name": "@office-iss/react-native-win32",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 24 Jan 2022 16:10:41 GMT",
5
+ "date": "Wed, 14 Sep 2022 18:18:47 GMT",
6
+ "tag": "@office-iss/react-native-win32_v0.66.6",
7
+ "version": "0.66.6",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "comment": "Backport Add `accessibilityAccessKey` prop to ViewWin32",
12
+ "author": "ruaraki@microsoft.com",
13
+ "commit": "1261c051e6e130a2101dfc80bff4589ad7033eb4",
14
+ "package": "@office-iss/react-native-win32"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Mon, 21 Feb 2022 16:09:42 GMT",
21
+ "tag": "@office-iss/react-native-win32_v0.66.5",
22
+ "version": "0.66.5",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "comment": "forward isPressble to native text component",
27
+ "author": "30809111+acoates-ms@users.noreply.github.com",
28
+ "commit": "12e82b184f7f78aa1fcfbe3dd700daef70257356",
29
+ "package": "@office-iss/react-native-win32"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Mon, 24 Jan 2022 16:11:33 GMT",
6
36
  "tag": "@office-iss/react-native-win32_v0.66.4",
7
37
  "version": "0.66.4",
8
38
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,17 +1,33 @@
1
1
  # Change Log - @office-iss/react-native-win32
2
2
 
3
- This log was last generated on Mon, 24 Jan 2022 16:10:41 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 14 Sep 2022 18:18:47 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## 0.66.4
7
+ ## 0.66.6
8
8
 
9
- Mon, 24 Jan 2022 16:10:41 GMT
9
+ Wed, 14 Sep 2022 18:18:47 GMT
10
10
 
11
11
  ### Patches
12
12
 
13
- - Promote 0.66 to legacy (ngerlem@microsoft.com)
13
+ - Backport Add `accessibilityAccessKey` prop to ViewWin32 (ruaraki@microsoft.com)
14
14
 
15
+ ## 0.66.5
16
+
17
+ Mon, 21 Feb 2022 16:09:42 GMT
18
+
19
+ ### Patches
20
+
21
+ - forward isPressble to native text component (30809111+acoates-ms@users.noreply.github.com)
22
+
23
+ ## 0.66.4
24
+
25
+ Mon, 24 Jan 2022 16:11:33 GMT
26
+
27
+ ### Patches
28
+
29
+ - Promote 0.66 to legacy (ngerlem@microsoft.com)
30
+
15
31
  ## 0.66.3
16
32
 
17
33
  Mon, 17 Jan 2022 16:12:35 GMT
@@ -35,6 +35,7 @@ const UIView = {
35
35
  needsOffscreenAlphaCompositing: true,
36
36
  style: ReactNativeStyleAttributes,
37
37
  // [Windows
38
+ accessibilityAccessKey: true,
38
39
  enableFocusRing: true,
39
40
  cursor: true,
40
41
  textStyle: true, // Once we flush out our JS theming story this property will no longer be needed
@@ -97,6 +97,11 @@ export declare type ViewWin32OmitTypes = RN.ViewPropsAndroid & RN.ViewPropsIOS &
97
97
  export interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {
98
98
  type?: React.ElementType;
99
99
  children?: React.ReactNode;
100
+ /**
101
+ * An access key to hook up to the UIA_AccessKey_Property.
102
+ * Access keys are used in keyboard navigation to allow quick navigation to UI in an application.
103
+ */
104
+ accessibilityAccessKey?: string;
100
105
  accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;
101
106
  /**
102
107
  * Tells a person using a screen reader what kind of annotation they
@@ -1 +1 @@
1
- {"version":3,"file":"ViewWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/View/ViewWin32.Props.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAeb,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2CAAI,CAAA;IACJ,qDAAS,CAAA;IACT,mDAAQ,CAAA;IACR,mDAAQ,CAAA;AACV,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB","sourcesContent":["'use strict';\nimport React from 'react'\nimport RN = require('react-native');\n\n// removes from interface T the members of interface K\ntype Omit<T, K> = Pick<T, Exclude<keyof T, keyof K>>;\n\n// All of T becomes optional except for Keys\ntype PartiallyRequired<T, Keys extends keyof T = keyof T> = Pick<Partial<T>, Exclude<keyof T, Keys>> & Pick<T, Keys>;\n\n/**\n * All of TOrigin except Key from TUse\n */\nexport type UseFrom<TOrigin, TUse, Key extends keyof TUse> = Pick<TOrigin, Exclude<keyof TOrigin, Key>> & Pick<TUse, Key>;\n\nexport enum EventPhase {\n None,\n Capturing,\n AtTarget,\n Bubbling\n}\n\nexport interface INativeKeyboardEvent {\n altKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n key: string;\n eventPhase: EventPhase;\n}\nexport type IKeyboardEvent = RN.NativeSyntheticEvent<INativeKeyboardEvent>;\nexport type IHandledKeyboardEvent = PartiallyRequired<INativeKeyboardEvent, 'key'>;\n\nexport interface IViewWin32 {\n focus: () => void;\n}\n\nexport type ARIARole =\n | 'alert'\n | 'alertdialog'\n | 'application'\n | 'button'\n | 'checkbox'\n | 'combobox'\n | 'dialog'\n | 'group'\n | 'link'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'none'\n | 'presentation'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'scrollbar'\n | 'search'\n | 'spinbutton'\n | 'switch'\n | 'tab'\n | 'tablist'\n | 'tabpanel'\n | 'textbox'\n | 'timer'\n | 'toolbar'\n | 'tree'\n | 'treeitem';\n\nexport type AnnotationType =\n | 'AdvanceProofingIssue'\n | 'Author'\n | 'CircularReferenceError'\n | 'Comment'\n | 'ConflictingChange'\n | 'DataValidationError'\n | 'DeletionChange'\n | 'EditingLockedChange'\n | 'Endnote'\n | 'ExternalChange'\n | 'Footer'\n | 'Footnote'\n | 'FormatChange'\n | 'FormulaError'\n | 'GrammarError'\n | 'Header'\n | 'Highlighted'\n | 'InsertionChange'\n | 'Mathematics'\n | 'MoveChange'\n | 'SpellingError'\n | 'TrackChanges'\n | 'Unknown'\n | 'UnsyncedChange';\n\nexport type AccessibilityAnnotationInfo = Readonly<{\n typeID: AnnotationType;\n typeName?: string;\n author?: string;\n dateTime?: string;\n target?: string;\n}>;\n\nexport type AccessibilityActionName =\n | RN.AccessibilityActionName\n | 'AddToSelection'\n | 'RemoveFromSelection'\n | 'Select'\n | 'Expand'\n | 'Collapse';\n\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'pointer'\n | 'help'\n | 'not-allowed'\n | 'wait'\n | 'move'\n | 'nesw-resize'\n | 'ns-resize'\n | 'nwse-resize'\n | 'we-resize'\n | 'text'\n\nexport type AccessibilityActionInfo = Readonly<{\n name: AccessibilityActionName;\n label?: string;\n}>;\n\nexport type AccessibilityActionEvent = RN.NativeSyntheticEvent<\n Readonly<{\n actionName: string;\n }>\n >;\n\nexport type AccessibilityState = RN.AccessibilityState & { multiselectable?: boolean, required?: boolean };\n\nexport type SharedAccessibilityPropsIOSandWin32 = {\n onAccessibilityTap?: () => void;\n};\n\nexport type OmittedAccessibilityPropsWin32 = {\n accessibilityActions?: ReadonlyArray<RN.AccessibilityActionInfo>;\n accessibilityRole?: RN.AccessibilityRole;\n accessibilityState?: RN.AccessibilityState;\n};\n\nexport type BasePropsWin32 = {\n /**\n * Tells a person using a screen reader the type of element they are focused on.\n *\n * Overrides the `accessibilityRole` prop on React Native to accept a subset of ARIA roles.\n *\n * Possible values for ARIARole are: alert, alertdialog, application, button, checkbox,\n * comobox, dialog, group, link, menu, menubar, menuitem, none, presentation, progressbar,\n * radio, radiogroup, scrollbar, search, spinbutton, switch, tab, tablist, tabpanel, textbox,\n * timer, toolbar, tree, and treeitem.\n */\n accessibilityRole?: RN.AccessibilityRole | ARIARole;\n accessibilityState?: AccessibilityState;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n\n /**\n * Windows Accessibility extensions for allowing other DOM elements to label or describe a given element.\n *\n * Defined as a reference to another DOM element inheriting from the primary base classes of React-Native elements.\n * The reference will be converted to a native reference (tag) before passing to the native platform.\n */\n accessibilityDescribedBy?: React.RefObject<any>;\n accessibilityLabeledBy?: React.RefObject<any>;\n\n /**\n * Identifies the element whose contents or presence are controlled by another element. \n * \n * This is mainly used for a Textbox with a Dropdown PeoplePicker-type list. This allows an \n * accessibility tool to query those other providers for properties and listen to their events.\n */\n accessibilityControls?: React.RefObject<any>;\n\n /**\n * Identifies the ItemType property, which is a text string describing the type of the automation element.\n * ItemType is used to obtain information about items in a list, tree view, or data grid. For example, an item in a file directory view might be a \"Document File\" or a \"Folder\".\n */\n accessibilityItemType?: string; \n};\n\nexport type ViewWin32OmitTypes = RN.ViewPropsAndroid &\n RN.ViewPropsIOS &\n RN.AccessibilityPropsAndroid &\n Omit<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> &\n OmittedAccessibilityPropsWin32;\n\n/**\n * Properties for ViewWin32 component\n */\nexport interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {\n type?: React.ElementType;\n children?: React.ReactNode;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n /**\n * Tells a person using a screen reader what kind of annotation they\n * have selected. If available, it will also tell a person the author of the annotation and\n * the date and time the annotation was posted.\n *\n * Note: If typeID is 'Unknown', a typeName must be provided.\n */\n accessibilityAnnotation?: AccessibilityAnnotationInfo;\n /**\n * accessibilityDescription provides more detailed information specific to the element (i.e. last edit date, full location for a file)\n * while accessibilityHint provides infomation on what will happen when they perform an action.\n *\n */\n accessibilityDescription?: string;\n accessibilityLevel?: number;\n accessibilityPositionInSet?: number;\n\n accessibilitySetSize?: number;\n animationClass?: string;\n focusable?: boolean;\n enableFocusRing?: boolean;\n\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlur?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlurCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocus?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocusCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n\n onKeyDown?: (args: IKeyboardEvent) => void;\n onKeyDownCapture?: (args: IKeyboardEvent) => void;\n onKeyUp?: (args: IKeyboardEvent) => void;\n onKeyUpCapture?: (args: IKeyboardEvent) => void;\n\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n\n keyDownEvents?: IHandledKeyboardEvent[];\n keyUpEvents?: IHandledKeyboardEvent[];\n\n /**\n * Provides a screentip to be used on hover of the view\n */\n tooltip?: string;\n cursor?: Cursor;\n}\n"]}
1
+ {"version":3,"file":"ViewWin32.Props.js","sourceRoot":"","sources":["../../../src/Libraries/Components/View/ViewWin32.Props.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAeb,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2CAAI,CAAA;IACJ,qDAAS,CAAA;IACT,mDAAQ,CAAA;IACR,mDAAQ,CAAA;AACV,CAAC,EALW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAKrB","sourcesContent":["'use strict';\nimport React from 'react'\nimport RN = require('react-native');\n\n// removes from interface T the members of interface K\ntype Omit<T, K> = Pick<T, Exclude<keyof T, keyof K>>;\n\n// All of T becomes optional except for Keys\ntype PartiallyRequired<T, Keys extends keyof T = keyof T> = Pick<Partial<T>, Exclude<keyof T, Keys>> & Pick<T, Keys>;\n\n/**\n * All of TOrigin except Key from TUse\n */\nexport type UseFrom<TOrigin, TUse, Key extends keyof TUse> = Pick<TOrigin, Exclude<keyof TOrigin, Key>> & Pick<TUse, Key>;\n\nexport enum EventPhase {\n None,\n Capturing,\n AtTarget,\n Bubbling\n}\n\nexport interface INativeKeyboardEvent {\n altKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n shiftKey: boolean;\n key: string;\n eventPhase: EventPhase;\n}\nexport type IKeyboardEvent = RN.NativeSyntheticEvent<INativeKeyboardEvent>;\nexport type IHandledKeyboardEvent = PartiallyRequired<INativeKeyboardEvent, 'key'>;\n\nexport interface IViewWin32 {\n focus: () => void;\n}\n\nexport type ARIARole =\n | 'alert'\n | 'alertdialog'\n | 'application'\n | 'button'\n | 'checkbox'\n | 'combobox'\n | 'dialog'\n | 'group'\n | 'link'\n | 'menu'\n | 'menubar'\n | 'menuitem'\n | 'none'\n | 'presentation'\n | 'progressbar'\n | 'radio'\n | 'radiogroup'\n | 'scrollbar'\n | 'search'\n | 'spinbutton'\n | 'switch'\n | 'tab'\n | 'tablist'\n | 'tabpanel'\n | 'textbox'\n | 'timer'\n | 'toolbar'\n | 'tree'\n | 'treeitem';\n\nexport type AnnotationType =\n | 'AdvanceProofingIssue'\n | 'Author'\n | 'CircularReferenceError'\n | 'Comment'\n | 'ConflictingChange'\n | 'DataValidationError'\n | 'DeletionChange'\n | 'EditingLockedChange'\n | 'Endnote'\n | 'ExternalChange'\n | 'Footer'\n | 'Footnote'\n | 'FormatChange'\n | 'FormulaError'\n | 'GrammarError'\n | 'Header'\n | 'Highlighted'\n | 'InsertionChange'\n | 'Mathematics'\n | 'MoveChange'\n | 'SpellingError'\n | 'TrackChanges'\n | 'Unknown'\n | 'UnsyncedChange';\n\nexport type AccessibilityAnnotationInfo = Readonly<{\n typeID: AnnotationType;\n typeName?: string;\n author?: string;\n dateTime?: string;\n target?: string;\n}>;\n\nexport type AccessibilityActionName =\n | RN.AccessibilityActionName\n | 'AddToSelection'\n | 'RemoveFromSelection'\n | 'Select'\n | 'Expand'\n | 'Collapse';\n\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'pointer'\n | 'help'\n | 'not-allowed'\n | 'wait'\n | 'move'\n | 'nesw-resize'\n | 'ns-resize'\n | 'nwse-resize'\n | 'we-resize'\n | 'text'\n\nexport type AccessibilityActionInfo = Readonly<{\n name: AccessibilityActionName;\n label?: string;\n}>;\n\nexport type AccessibilityActionEvent = RN.NativeSyntheticEvent<\n Readonly<{\n actionName: string;\n }>\n >;\n\nexport type AccessibilityState = RN.AccessibilityState & { multiselectable?: boolean, required?: boolean };\n\nexport type SharedAccessibilityPropsIOSandWin32 = {\n onAccessibilityTap?: () => void;\n};\n\nexport type OmittedAccessibilityPropsWin32 = {\n accessibilityActions?: ReadonlyArray<RN.AccessibilityActionInfo>;\n accessibilityRole?: RN.AccessibilityRole;\n accessibilityState?: RN.AccessibilityState;\n};\n\nexport type BasePropsWin32 = {\n /**\n * Tells a person using a screen reader the type of element they are focused on.\n *\n * Overrides the `accessibilityRole` prop on React Native to accept a subset of ARIA roles.\n *\n * Possible values for ARIARole are: alert, alertdialog, application, button, checkbox,\n * comobox, dialog, group, link, menu, menubar, menuitem, none, presentation, progressbar,\n * radio, radiogroup, scrollbar, search, spinbutton, switch, tab, tablist, tabpanel, textbox,\n * timer, toolbar, tree, and treeitem.\n */\n accessibilityRole?: RN.AccessibilityRole | ARIARole;\n accessibilityState?: AccessibilityState;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n\n /**\n * Windows Accessibility extensions for allowing other DOM elements to label or describe a given element.\n *\n * Defined as a reference to another DOM element inheriting from the primary base classes of React-Native elements.\n * The reference will be converted to a native reference (tag) before passing to the native platform.\n */\n accessibilityDescribedBy?: React.RefObject<any>;\n accessibilityLabeledBy?: React.RefObject<any>;\n\n /**\n * Identifies the element whose contents or presence are controlled by another element. \n * \n * This is mainly used for a Textbox with a Dropdown PeoplePicker-type list. This allows an \n * accessibility tool to query those other providers for properties and listen to their events.\n */\n accessibilityControls?: React.RefObject<any>;\n\n /**\n * Identifies the ItemType property, which is a text string describing the type of the automation element.\n * ItemType is used to obtain information about items in a list, tree view, or data grid. For example, an item in a file directory view might be a \"Document File\" or a \"Folder\".\n */\n accessibilityItemType?: string; \n};\n\nexport type ViewWin32OmitTypes = RN.ViewPropsAndroid &\n RN.ViewPropsIOS &\n RN.AccessibilityPropsAndroid &\n Omit<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> &\n OmittedAccessibilityPropsWin32;\n\n/**\n * Properties for ViewWin32 component\n */\nexport interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {\n type?: React.ElementType;\n children?: React.ReactNode;\n /**\n * An access key to hook up to the UIA_AccessKey_Property.\n * Access keys are used in keyboard navigation to allow quick navigation to UI in an application.\n */\n accessibilityAccessKey?: string;\n accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;\n /**\n * Tells a person using a screen reader what kind of annotation they\n * have selected. If available, it will also tell a person the author of the annotation and\n * the date and time the annotation was posted.\n *\n * Note: If typeID is 'Unknown', a typeName must be provided.\n */\n accessibilityAnnotation?: AccessibilityAnnotationInfo;\n /**\n * accessibilityDescription provides more detailed information specific to the element (i.e. last edit date, full location for a file)\n * while accessibilityHint provides infomation on what will happen when they perform an action.\n *\n */\n accessibilityDescription?: string;\n accessibilityLevel?: number;\n accessibilityPositionInSet?: number;\n\n accessibilitySetSize?: number;\n animationClass?: string;\n focusable?: boolean;\n enableFocusRing?: boolean;\n\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlur?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React\n * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onBlurCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocus?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n /**\n * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React\n * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).\n *\n * `ev.target === ev.currentTarget` when the focus is being lost from this component.\n * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.\n */\n onFocusCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;\n\n onKeyDown?: (args: IKeyboardEvent) => void;\n onKeyDownCapture?: (args: IKeyboardEvent) => void;\n onKeyUp?: (args: IKeyboardEvent) => void;\n onKeyUpCapture?: (args: IKeyboardEvent) => void;\n\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n\n keyDownEvents?: IHandledKeyboardEvent[];\n keyUpEvents?: IHandledKeyboardEvent[];\n\n /**\n * Provides a screentip to be used on hover of the view\n */\n tooltip?: string;\n cursor?: Cursor;\n}\n"]}
@@ -0,0 +1,214 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its 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
+ * @flow strict-local
8
+ * @format
9
+ */
10
+
11
+ import DeprecatedTextPropTypes from '../DeprecatedPropTypes/DeprecatedTextPropTypes';
12
+ import * as PressabilityDebug from '../Pressability/PressabilityDebug';
13
+ import usePressability from '../Pressability/usePressability';
14
+ import StyleSheet from '../StyleSheet/StyleSheet';
15
+ import processColor from '../StyleSheet/processColor';
16
+ import TextAncestor from './TextAncestor';
17
+ import {NativeText, NativeVirtualText} from './TextNativeComponent';
18
+ import {type TextProps} from './TextProps';
19
+ import * as React from 'react';
20
+ import {useContext, useMemo, useState} from 'react';
21
+ import invariant from 'invariant';
22
+
23
+ /**
24
+ * Text is the fundamental component for displaying text.
25
+ *
26
+ * @see https://reactnative.dev/docs/text.html
27
+ */
28
+ const Text: React.AbstractComponent<
29
+ TextProps,
30
+ React.ElementRef<typeof NativeText | typeof NativeVirtualText>,
31
+ > = React.forwardRef((props: TextProps, forwardedRef) => {
32
+ const {
33
+ accessible,
34
+ allowFontScaling,
35
+ ellipsizeMode,
36
+ onLongPress,
37
+ onPress,
38
+ onPressIn,
39
+ onPressOut,
40
+ onResponderGrant,
41
+ onResponderMove,
42
+ onResponderRelease,
43
+ onResponderTerminate,
44
+ onResponderTerminationRequest,
45
+ onStartShouldSetResponder,
46
+ pressRetentionOffset,
47
+ suppressHighlighting,
48
+ ...restProps
49
+ } = props;
50
+
51
+ const [isHighlighted, setHighlighted] = useState(false);
52
+
53
+ const isPressable =
54
+ (onPress != null ||
55
+ onLongPress != null ||
56
+ onStartShouldSetResponder != null) &&
57
+ restProps.disabled !== true;
58
+
59
+ const initialized = useLazyInitialization(isPressable);
60
+ const config = useMemo(
61
+ () =>
62
+ initialized
63
+ ? {
64
+ disabled: !isPressable,
65
+ pressRectOffset: pressRetentionOffset,
66
+ onLongPress,
67
+ onPress,
68
+ onPressIn(event) {
69
+ setHighlighted(!suppressHighlighting);
70
+ onPressIn?.(event);
71
+ },
72
+ onPressOut(event) {
73
+ setHighlighted(false);
74
+ onPressOut?.(event);
75
+ },
76
+ onResponderTerminationRequest_DEPRECATED: onResponderTerminationRequest,
77
+ onStartShouldSetResponder_DEPRECATED: onStartShouldSetResponder,
78
+ }
79
+ : null,
80
+ [
81
+ initialized,
82
+ isPressable,
83
+ pressRetentionOffset,
84
+ onLongPress,
85
+ onPress,
86
+ onPressIn,
87
+ onPressOut,
88
+ onResponderTerminationRequest,
89
+ onStartShouldSetResponder,
90
+ suppressHighlighting,
91
+ ],
92
+ );
93
+
94
+ const eventHandlers = usePressability(config);
95
+ const eventHandlersForText = useMemo(
96
+ () =>
97
+ eventHandlers == null
98
+ ? null
99
+ : {
100
+ onResponderGrant(event) {
101
+ eventHandlers.onResponderGrant(event);
102
+ if (onResponderGrant != null) {
103
+ onResponderGrant(event);
104
+ }
105
+ },
106
+ onResponderMove(event) {
107
+ eventHandlers.onResponderMove(event);
108
+ if (onResponderMove != null) {
109
+ onResponderMove(event);
110
+ }
111
+ },
112
+ onResponderRelease(event) {
113
+ eventHandlers.onResponderRelease(event);
114
+ if (onResponderRelease != null) {
115
+ onResponderRelease(event);
116
+ }
117
+ },
118
+ onResponderTerminate(event) {
119
+ eventHandlers.onResponderTerminate(event);
120
+ if (onResponderTerminate != null) {
121
+ onResponderTerminate(event);
122
+ }
123
+ },
124
+ onResponderTerminationRequest:
125
+ eventHandlers.onResponderTerminationRequest,
126
+ onStartShouldSetResponder: eventHandlers.onStartShouldSetResponder,
127
+ },
128
+ [
129
+ eventHandlers,
130
+ onResponderGrant,
131
+ onResponderMove,
132
+ onResponderRelease,
133
+ onResponderTerminate,
134
+ ],
135
+ );
136
+
137
+ // TODO: Move this processing to the view configuration.
138
+ const selectionColor =
139
+ restProps.selectionColor == null
140
+ ? null
141
+ : processColor(restProps.selectionColor);
142
+
143
+ let style = restProps.style;
144
+ if (__DEV__) {
145
+ if (PressabilityDebug.isEnabled() && onPress != null) {
146
+ style = StyleSheet.compose(restProps.style, {
147
+ color: 'magenta',
148
+ });
149
+ }
150
+ }
151
+
152
+ let numberOfLines = restProps.numberOfLines;
153
+ if (numberOfLines != null && !(numberOfLines >= 0)) {
154
+ console.error(
155
+ `'numberOfLines' in <Text> must be a non-negative number, received: ${numberOfLines}. The value will be set to 0.`,
156
+ );
157
+ numberOfLines = 0;
158
+ }
159
+
160
+ const hasTextAncestor = useContext(TextAncestor);
161
+
162
+ return hasTextAncestor ? (
163
+ <NativeVirtualText
164
+ {...restProps}
165
+ {...eventHandlersForText}
166
+ isHighlighted={isHighlighted}
167
+ isPressable={isPressable} // This was added upstream in https://github.com/facebook/react-native/commit/f3bf2e4f51897f1bb71e37002c288ebf3b23cf78
168
+ numberOfLines={numberOfLines}
169
+ selectionColor={selectionColor}
170
+ style={style}
171
+ ref={forwardedRef}
172
+ />
173
+ ) : (
174
+ <TextAncestor.Provider value={true}>
175
+ <NativeText
176
+ {...restProps}
177
+ {...eventHandlersForText}
178
+ accessible={accessible !== false}
179
+ allowFontScaling={allowFontScaling !== false}
180
+ ellipsizeMode={ellipsizeMode ?? 'tail'}
181
+ isHighlighted={isHighlighted}
182
+ isPressable={isPressable} // [Win32] - We use this to optimize text hit testing
183
+ numberOfLines={numberOfLines}
184
+ selectionColor={selectionColor}
185
+ style={style}
186
+ ref={forwardedRef}
187
+ />
188
+ </TextAncestor.Provider>
189
+ );
190
+ });
191
+
192
+ Text.displayName = 'Text';
193
+
194
+ // TODO: Delete this.
195
+ Text.propTypes = DeprecatedTextPropTypes;
196
+
197
+ /**
198
+ * Returns false until the first time `newValue` is true, after which this will
199
+ * always return true. This is necessary to lazily initialize `Pressability` so
200
+ * we do not eagerly create one for every pressable `Text` component.
201
+ */
202
+ function useLazyInitialization(newValue: boolean): boolean {
203
+ const [oldValue, setValue] = useState(newValue);
204
+ if (!oldValue && newValue) {
205
+ setValue(newValue);
206
+ }
207
+ return oldValue;
208
+ }
209
+
210
+ // $FlowFixMe[incompatible-cast] - No good way to type a React.AbstractComponent with statics.
211
+ module.exports = (Text: typeof Text &
212
+ $ReadOnly<{
213
+ propTypes: typeof DeprecatedTextPropTypes,
214
+ }>);
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its 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
+ * @flow
8
+ * @format
9
+ */
10
+
1
11
  import ReactNativeViewAttributes from '../Components/View/ReactNativeViewAttributes';
2
12
  import UIManager from '../ReactNative/UIManager';
3
13
  import {type HostComponent} from '../Renderer/shims/ReactNativeTypes';
@@ -9,6 +19,10 @@ type NativeTextProps = $ReadOnly<{
9
19
  ...TextProps,
10
20
  isHighlighted?: ?boolean,
11
21
  selectionColor?: ?ProcessedColorValue,
22
+ // This is only needed for platforms that optimize text hit testing, e.g.,
23
+ // react-native-windows. It can be used to only hit test virtual text spans
24
+ // that have pressable events attached to them.
25
+ isPressable?: ?boolean,
12
26
  }>;
13
27
 
14
28
  export const NativeText: HostComponent<NativeTextProps> = (createReactNativeComponentClass(
@@ -18,6 +32,7 @@ export const NativeText: HostComponent<NativeTextProps> = (createReactNativeComp
18
32
  validAttributes: {
19
33
  ...ReactNativeViewAttributes.UIView,
20
34
  isHighlighted: true,
35
+ isPressable: true,
21
36
  numberOfLines: true,
22
37
  ellipsizeMode: true,
23
38
  allowFontScaling: true,
@@ -53,14 +68,14 @@ export const NativeText: HostComponent<NativeTextProps> = (createReactNativeComp
53
68
  ): any);
54
69
 
55
70
  export const NativeVirtualText: HostComponent<NativeTextProps> =
56
- !global.RN$Bridgeless &&
57
- UIManager.getViewManagerConfig('RCTVirtualText') == null
71
+ !global.RN$Bridgeless && !UIManager.hasViewManagerConfig('RCTVirtualText')
58
72
  ? NativeText
59
73
  : (createReactNativeComponentClass('RCTVirtualText', () => ({
60
74
  // $FlowFixMe[incompatible-call]
61
75
  validAttributes: {
62
76
  ...ReactNativeViewAttributes.UIView,
63
77
  isHighlighted: true,
78
+ isPressable: true,
64
79
  maxFontSizeMultiplier: true,
65
80
  },
66
81
  uiViewClassName: 'RCTVirtualText',
package/overrides.json CHANGED
@@ -445,7 +445,14 @@
445
445
  "baseHash": "afe4fc1e9aa91d08a7a1098e3bbd3b17a73b4a65"
446
446
  },
447
447
  {
448
- "type": "derived",
448
+ "type": "patch",
449
+ "file": "src/Libraries/Text/Text.win32.js",
450
+ "baseFile": "Libraries/Text/Text.js",
451
+ "baseHash": "8b90eb090dcfed88a40a38bbb51cbbd1e0d9ca9e",
452
+ "issue": 7074
453
+ },
454
+ {
455
+ "type": "patch",
449
456
  "file": "src/Libraries/Text/TextNativeComponent.win32.js",
450
457
  "baseFile": "Libraries/Text/TextNativeComponent.js",
451
458
  "baseHash": "1a196691fb0e9b656c348b7d42427c1c6163c9bb",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@office-iss/react-native-win32",
3
- "version": "0.66.4",
3
+ "version": "0.66.6",
4
4
  "description": "Implementation of react native on top of Office's Win32 platform.",
5
5
  "license": "MIT",
6
6
  "main": "./index.win32.js",
@@ -196,6 +196,11 @@ export type ViewWin32OmitTypes = RN.ViewPropsAndroid &
196
196
  export interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {
197
197
  type?: React.ElementType;
198
198
  children?: React.ReactNode;
199
+ /**
200
+ * An access key to hook up to the UIA_AccessKey_Property.
201
+ * Access keys are used in keyboard navigation to allow quick navigation to UI in an application.
202
+ */
203
+ accessibilityAccessKey?: string;
199
204
  accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;
200
205
  /**
201
206
  * Tells a person using a screen reader what kind of annotation they