@office-iss/react-native-win32 0.71.0 → 0.71.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.flowconfig +1 -0
  2. package/CHANGELOG.json +16 -1
  3. package/CHANGELOG.md +12 -4
  4. package/Libraries/Components/Button/ButtonWin32.Props.d.ts +2 -2
  5. package/Libraries/Components/Button/ButtonWin32.d.ts +1 -1
  6. package/Libraries/Components/Button/ButtonWin32.js +6 -4
  7. package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
  8. package/Libraries/Components/Pressable/Pressable.win32.js +0 -1
  9. package/Libraries/Components/Text/TextWin32.Props.d.ts +3 -9
  10. package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
  11. package/Libraries/Components/Text/TextWin32.d.ts +1 -1
  12. package/Libraries/Components/Text/TextWin32.js.map +1 -1
  13. package/Libraries/Components/TextInput/TextInput.Types.win32.d.ts +9 -9
  14. package/Libraries/Components/TextInput/TextInput.win32.js +1150 -154
  15. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +4 -4
  16. package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
  17. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -16
  18. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +99 -24
  19. package/Libraries/Components/Touchable/TouchableWin32.Props.d.ts +2 -2
  20. package/Libraries/Components/Touchable/TouchableWin32.Props.js.map +1 -1
  21. package/Libraries/Components/Touchable/TouchableWin32.Types.d.ts +9 -9
  22. package/Libraries/Components/Touchable/TouchableWin32.js +5 -6
  23. package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
  24. package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +29 -10
  25. package/Libraries/Components/View/Tests/ViewWin32Test.js +31 -51
  26. package/Libraries/Components/View/Tests/ViewWin32Test.js.map +1 -1
  27. package/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
  28. package/Libraries/Components/View/ViewAccessibility.win32.js +178 -0
  29. package/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
  30. package/Libraries/Components/View/ViewPropTypes.win32.js +23 -0
  31. package/Libraries/Components/View/ViewWin32.d.ts +30 -12
  32. package/Libraries/Components/View/ViewWin32.js +161 -71
  33. package/Libraries/Image/Image.win32.js +0 -1
  34. package/Libraries/Pressability/Pressability.win32.js +2 -2
  35. package/Libraries/Utilities/AcessibilityMapping.win32.js +156 -0
  36. package/Libraries/__tests__/ButtonWin32-test.js +1 -1
  37. package/Libraries/platform-types.d.ts +7 -13
  38. package/index.win32.js +1 -1
  39. package/jest.config.js +2 -4
  40. package/overrides.json +38 -8
  41. package/package.json +5 -5
  42. package/src/Libraries/Components/Button/ButtonWin32.tsx +8 -8
  43. package/src/Libraries/Components/Text/TextWin32.Props.ts +2 -15
  44. package/src/Libraries/Components/Text/TextWin32.tsx +6 -2
  45. package/src/Libraries/Components/Touchable/Tests/TouchableWin32Test.tsx +5 -5
  46. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.d.ts +119 -0
  47. package/src/Libraries/Components/Touchable/TouchableWin32.Props.tsx +1 -1
  48. package/src/Libraries/Components/Touchable/TouchableWin32.tsx +6 -7
  49. package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +28 -52
  50. package/src/Libraries/Components/View/ViewAccessibility.win32.d.ts +527 -0
  51. package/src/Libraries/Components/View/ViewPropTypes.win32.d.ts +372 -0
  52. package/src/Libraries/Components/View/ViewWin32.d.ts +30 -0
  53. package/src/Libraries/platform-types.d.ts +7 -13
  54. package/types/modules/BatchedBridge.d.ts +32 -0
  55. package/types/modules/Codegen.d.ts +74 -0
  56. package/types/modules/Devtools.d.ts +31 -0
  57. package/types/modules/LaunchScreen.d.ts +18 -0
  58. package/types/modules/globals.d.ts +577 -0
  59. package/types/private/TimerMixin.d.ts +19 -0
  60. package/types/private/Utilities.d.ts +10 -0
  61. package/types/public/DeprecatedPropertiesAlias.d.ts +205 -0
  62. package/types/public/Insets.d.ts +15 -0
  63. package/types/public/ReactNativeRenderer.d.ts +149 -0
  64. package/types/public/ReactNativeTypes.d.ts +143 -0
  65. package/Libraries/Components/TextInput/TextInput.win32.d.ts +0 -68
  66. package/Libraries/Components/TextInput/TextInput.win32.js.map +0 -1
  67. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.d.ts +0 -7
  68. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js +0 -3
  69. package/Libraries/Components/Touchable/TouchableNativeFeedback.Props.js.map +0 -1
  70. package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js.map +0 -1
  71. package/Libraries/Components/View/ViewWin32.Props.d.ts +0 -174
  72. package/Libraries/Components/View/ViewWin32.Props.js +0 -11
  73. package/Libraries/Components/View/ViewWin32.Props.js.map +0 -1
  74. package/Libraries/Components/View/ViewWin32.js.map +0 -1
  75. package/src/Libraries/Components/TextInput/TextInput.win32.tsx +0 -217
  76. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.Props.ts +0 -9
  77. package/src/Libraries/Components/Touchable/TouchableNativeFeedback.win32.tsx +0 -27
  78. package/src/Libraries/Components/View/ViewWin32.Props.ts +0 -281
  79. package/src/Libraries/Components/View/ViewWin32.tsx +0 -119
@@ -1,174 +0,0 @@
1
- import React from 'react';
2
- import RN = require('react-native');
3
- declare type Omit<T, K> = Pick<T, Exclude<keyof T, keyof K>>;
4
- declare type PartiallyRequired<T, Keys extends keyof T = keyof T> = Pick<Partial<T>, Exclude<keyof T, Keys>> & Pick<T, Keys>;
5
- /**
6
- * All of TOrigin except Key from TUse
7
- */
8
- export declare type UseFrom<TOrigin, TUse, Key extends keyof TUse> = Pick<TOrigin, Exclude<keyof TOrigin, Key>> & Pick<TUse, Key>;
9
- export declare enum EventPhase {
10
- None = 0,
11
- Capturing = 1,
12
- AtTarget = 2,
13
- Bubbling = 3
14
- }
15
- export interface INativeKeyboardEvent {
16
- altKey: boolean;
17
- ctrlKey: boolean;
18
- metaKey: boolean;
19
- shiftKey: boolean;
20
- key: string;
21
- eventPhase: EventPhase;
22
- }
23
- export declare type IKeyboardEvent = RN.NativeSyntheticEvent<INativeKeyboardEvent>;
24
- export declare type IHandledKeyboardEvent = PartiallyRequired<INativeKeyboardEvent, 'key'>;
25
- export interface IViewWin32 {
26
- focus: () => void;
27
- }
28
- export declare type ARIARole = 'alert' | 'alertdialog' | 'application' | 'button' | 'checkbox' | 'combobox' | 'dialog' | 'group' | 'link' | 'listitem' | 'menu' | 'menubar' | 'menuitem' | 'none' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'scrollbar' | 'search' | 'spinbutton' | 'switch' | 'tab' | 'tablist' | 'tabpanel' | 'textbox' | 'timer' | 'toolbar' | 'tree' | 'treeitem';
29
- export declare type AnnotationType = 'AdvanceProofingIssue' | 'Author' | 'CircularReferenceError' | 'Comment' | 'ConflictingChange' | 'DataValidationError' | 'DeletionChange' | 'EditingLockedChange' | 'Endnote' | 'ExternalChange' | 'Footer' | 'Footnote' | 'FormatChange' | 'FormulaError' | 'GrammarError' | 'Header' | 'Highlighted' | 'InsertionChange' | 'Mathematics' | 'MoveChange' | 'SpellingError' | 'TrackChanges' | 'Unknown' | 'UnsyncedChange';
30
- export declare type AccessibilityAnnotationInfo = Readonly<{
31
- typeID: AnnotationType;
32
- typeName?: string;
33
- author?: string;
34
- dateTime?: string;
35
- target?: string;
36
- }>;
37
- export declare type AccessibilityActionName = RN.AccessibilityActionName | 'AddToSelection' | 'RemoveFromSelection' | 'Select' | 'Expand' | 'Collapse' | 'Toggle';
38
- export declare type Cursor = 'auto' | 'default' | 'pointer' | 'help' | 'not-allowed' | 'wait' | 'move' | 'nesw-resize' | 'ns-resize' | 'nwse-resize' | 'we-resize' | 'text';
39
- export declare type AccessibilityActionInfo = Readonly<{
40
- name: AccessibilityActionName;
41
- label?: string;
42
- }>;
43
- export declare type AccessibilityState = RN.AccessibilityState & {
44
- multiselectable?: boolean;
45
- required?: boolean;
46
- };
47
- export declare type SharedAccessibilityPropsIOSandWin32 = {
48
- onAccessibilityTap?: () => void;
49
- };
50
- export declare type OmittedAccessibilityPropsWin32 = {
51
- accessibilityActions?: ReadonlyArray<RN.AccessibilityActionInfo>;
52
- accessibilityRole?: RN.AccessibilityRole;
53
- accessibilityState?: RN.AccessibilityState;
54
- };
55
- export declare type BasePropsWin32 = {
56
- /**
57
- * Tells a person using a screen reader the type of element they are focused on.
58
- *
59
- * Overrides the `accessibilityRole` prop on React Native to accept a subset of ARIA roles.
60
- *
61
- * Possible values for ARIARole are: alert, alertdialog, application, button, checkbox,
62
- * comobox, dialog, group, link, menu, menubar, menuitem, none, presentation, progressbar,
63
- * radio, radiogroup, scrollbar, search, spinbutton, switch, tab, tablist, tabpanel, textbox,
64
- * timer, toolbar, tree, and treeitem.
65
- */
66
- accessibilityRole?: RN.AccessibilityRole | ARIARole;
67
- accessibilityState?: AccessibilityState;
68
- accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;
69
- /**
70
- * Windows Accessibility extensions for allowing other DOM elements to label or describe a given element.
71
- *
72
- * Defined as a reference to another DOM element inheriting from the primary base classes of React-Native elements.
73
- * The reference will be converted to a native reference (tag) before passing to the native platform.
74
- */
75
- accessibilityDescribedBy?: React.RefObject<any>;
76
- accessibilityLabeledBy?: React.RefObject<any>;
77
- /**
78
- * Identifies the element whose contents or presence are controlled by another element.
79
- *
80
- * This is mainly used for a Textbox with a Dropdown PeoplePicker-type list. This allows an
81
- * accessibility tool to query those other providers for properties and listen to their events.
82
- */
83
- accessibilityControls?: React.RefObject<any>;
84
- /**
85
- * Identifies the ItemType property, which is a text string describing the type of the automation element.
86
- * 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".
87
- */
88
- accessibilityItemType?: string;
89
- /**
90
- * Defines the level of an element in a hierarchical structure or the heading level of a text element.
91
- * Note: accessibilityRole="header" must be used if using this property to define a heading level.
92
- */
93
- accessibilityLevel?: number;
94
- };
95
- export declare type ViewWin32OmitTypes = RN.ViewPropsAndroid & RN.ViewPropsIOS & RN.AccessibilityPropsAndroid & Omit<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> & OmittedAccessibilityPropsWin32;
96
- /**
97
- * Properties for ViewWin32 component
98
- */
99
- export interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {
100
- type?: React.ElementType;
101
- children?: React.ReactNode;
102
- /**
103
- * An access key to hook up to the UIA_AccessKey_Property.
104
- * Access keys are used in keyboard navigation to allow quick navigation to UI in an application.
105
- */
106
- accessibilityAccessKey?: string;
107
- accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;
108
- /**
109
- * Tells a person using a screen reader what kind of annotation they
110
- * have selected. If available, it will also tell a person the author of the annotation and
111
- * the date and time the annotation was posted.
112
- *
113
- * Note: If typeID is 'Unknown', a typeName must be provided.
114
- */
115
- accessibilityAnnotation?: AccessibilityAnnotationInfo;
116
- /**
117
- * accessibilityDescription provides more detailed information specific to the element (i.e. last edit date, full location for a file)
118
- * while accessibilityHint provides infomation on what will happen when they perform an action.
119
- *
120
- */
121
- accessibilityDescription?: string;
122
- accessibilityPositionInSet?: number;
123
- accessibilitySetSize?: number;
124
- animationClass?: string;
125
- focusable?: boolean;
126
- enableFocusRing?: boolean;
127
- alwaysShowToolTip?: boolean;
128
- /**
129
- * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
130
- * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
131
- *
132
- * `ev.target === ev.currentTarget` when the focus is being lost from this component.
133
- * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
134
- */
135
- onBlur?: (ev: RN.NativeSyntheticEvent<{}>) => void;
136
- /**
137
- * The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
138
- * Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
139
- *
140
- * `ev.target === ev.currentTarget` when the focus is being lost from this component.
141
- * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
142
- */
143
- onBlurCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;
144
- /**
145
- * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
146
- * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
147
- *
148
- * `ev.target === ev.currentTarget` when the focus is being lost from this component.
149
- * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
150
- */
151
- onFocus?: (ev: RN.NativeSyntheticEvent<{}>) => void;
152
- /**
153
- * The onFocus event occurs when an element gets focus. The opposite of onFocus is onBlur. Note that in React
154
- * Native, unlike in the web, the onFocus event bubbles (similar to onFocusIn in the web).
155
- *
156
- * `ev.target === ev.currentTarget` when the focus is being lost from this component.
157
- * `ev.target !== ev.currentTarget` when the focus is being lost from a descendant.
158
- */
159
- onFocusCapture?: (ev: RN.NativeSyntheticEvent<{}>) => void;
160
- onKeyDown?: (args: IKeyboardEvent) => void;
161
- onKeyDownCapture?: (args: IKeyboardEvent) => void;
162
- onKeyUp?: (args: IKeyboardEvent) => void;
163
- onKeyUpCapture?: (args: IKeyboardEvent) => void;
164
- onMouseEnter?: () => void;
165
- onMouseLeave?: () => void;
166
- keyDownEvents?: IHandledKeyboardEvent[];
167
- keyUpEvents?: IHandledKeyboardEvent[];
168
- /**
169
- * Provides a screentip to be used on hover of the view
170
- */
171
- tooltip?: string;
172
- cursor?: Cursor;
173
- }
174
- export {};
@@ -1,11 +0,0 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EventPhase = void 0;
4
- var EventPhase;
5
- (function (EventPhase) {
6
- EventPhase[EventPhase["None"] = 0] = "None";
7
- EventPhase[EventPhase["Capturing"] = 1] = "Capturing";
8
- EventPhase[EventPhase["AtTarget"] = 2] = "AtTarget";
9
- EventPhase[EventPhase["Bubbling"] = 3] = "Bubbling";
10
- })(EventPhase = exports.EventPhase || (exports.EventPhase = {}));
11
- //# sourceMappingURL=ViewWin32.Props.js.map
@@ -1 +0,0 @@
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 | 'listitem'\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 | 'Toggle';\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 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 /**\n * Defines the level of an element in a hierarchical structure or the heading level of a text element.\n * Note: accessibilityRole=\"header\" must be used if using this property to define a heading level.\n */\n accessibilityLevel?: number;\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 accessibilityPositionInSet?: number;\n\n accessibilitySetSize?: number;\n animationClass?: string;\n focusable?: boolean;\n enableFocusRing?: boolean;\n /*\n * overrides the default behavior of some components that do not show a tooltip. i.e. components in a menu\n */\n alwaysShowToolTip?: 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 +0,0 @@
1
- {"version":3,"file":"ViewWin32.js","sourceRoot":"","sources":["../../../src/Libraries/Components/View/ViewWin32.tsx"],"names":[],"mappings":"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","sourcesContent":["/**\n * Copyright: Microsoft 2015\n *\n * RN-specific implementation of the cross-platform View abstraction.\n */\n\nimport React from 'react'\nimport RN = require('react-native');\nimport { View, findNodeHandle, UIManager } from 'react-native';\nimport { IViewWin32Props, UseFrom } from './ViewWin32.Props';\nconst setAndForwardRef = require('../../Utilities/setAndForwardRef');\n\n/**\n * Basic View component with additional Win32 specific functionality\n */\n\ntype InnerViewWin32Props = UseFrom<IViewWin32Props, RN.ViewProps, 'accessibilityRole'> &\n UseFrom<IViewWin32Props, RN.ViewProps, 'accessibilityState'> &\n UseFrom<IViewWin32Props, RN.ViewProps, 'accessibilityActions'> &\n UseFrom<IViewWin32Props, RN.ViewProps, 'onAccessibilityAction'>;\n\ntype ViewWin32Type = React.ForwardRefExoticComponent<\nIViewWin32Props & React.RefAttributes<View>\n> &\n View;\n\nexport const ViewWin32 = React.forwardRef(\n (props: IViewWin32Props, ref: React.Ref<any>) => {\n\n /**\n * Check for raw text in the DOM.\n */\n if (__DEV__) {\n if (props) {\n React.Children.toArray(props.children).forEach(item => {\n if (typeof item === 'string') {\n console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);\n }\n });\n }\n }\n\n /**\n * Process accessibility refs into node handles after initial DOM render, before sent across the bridge.\n * useLayoutEffect will invalidate the render to assess the ref-based accessibility properties.\n */\n\n const [labeledByTarget, setLabeledByTarget] = React.useState(null);\n const [describedByTarget, setDescribedByTarget] = React.useState(null);\n const [controlsTarget, setControlsTarget] = React.useState(null);\n const {accessibilityLabeledBy, accessibilityDescribedBy, accessibilityControls, ...rest} = props;\n\n React.useLayoutEffect(() => {\n if (accessibilityLabeledBy !== undefined && accessibilityLabeledBy.current !== null)\n {\n setLabeledByTarget(findNodeHandle(accessibilityLabeledBy.current as\n | null\n | number\n | React.Component<any, any, any>\n | React.ComponentClass<any, any>));\n }\n }, [accessibilityLabeledBy]);\n\n React.useLayoutEffect(() => {\n if (accessibilityDescribedBy !== undefined && accessibilityDescribedBy.current !== null)\n {\n setDescribedByTarget(findNodeHandle(accessibilityDescribedBy.current as\n | null\n | number\n | React.Component<any, any, any>\n | React.ComponentClass<any, any>));\n }\n }, [accessibilityDescribedBy]);\n \n React.useLayoutEffect(() => {\n if(accessibilityControls !== undefined && accessibilityControls.current !== null)\n {\n setControlsTarget(findNodeHandle(accessibilityControls.current as\n | null\n | number\n | React.Component<any, any, any>\n | React.ComponentClass<any, any>));\n }\n }, [accessibilityControls]);\n\n /**\n * Set up the forwarding ref to enable adding the focus method.\n */\n const focusRef = React.useRef<ViewWin32>();\n const setNativeRef = setAndForwardRef({\n getForwardedRef: () => ref,\n setLocalRef: localRef => {\n focusRef.current = localRef; \n\n /**\n * Add focus() as a callable function to the forwarded reference.\n */\n if (localRef)\n {\n localRef.focus = () => {\n UIManager.dispatchViewManagerCommand(\n findNodeHandle(localRef),\n UIManager.getViewManagerConfig('RCTView').Commands.focus,\n null\n );\n };\n }\n },\n });\n\n return <View ref={setNativeRef}\n {...(rest as InnerViewWin32Props)}\n {...((controlsTarget !== null) ? {accessibilityControls:controlsTarget} : {})}\n {...((labeledByTarget !== null) ? {accessibilityLabeledBy:labeledByTarget} : {})}\n {...((describedByTarget !== null) ? {accessibilityDescribedBy:describedByTarget} : {})}\n />;\n });\n\nexport type ViewWin32 = ViewWin32Type;\n"]}
@@ -1,217 +0,0 @@
1
- /**
2
- * @providesModule TextInput
3
- */
4
- 'use strict';
5
-
6
- /**
7
- * This is a forked and slightly modified version of React Native's TextInput.
8
- * The fork is necessary as platform checks in the base implementation made the
9
- * control unusable on win32. In addition to cleaning up some of the code, this
10
- * fork also uses Typescript rather than Flow for type safety.
11
- *
12
- * More general documentation on this control can be found at
13
- * https://facebook.github.io/react-native/docs/textinput.html
14
- *
15
- * The original implementation can be found at
16
- * https://github.com/facebook/react-native/blob/1013a010492a7bef5ff58073a088ac924a986e9e/Libraries/Components/TextInput/TextInput.js
17
- *
18
- * This control does not support the full React Native TextInput interface yet.
19
- * Most of the work necessary to make that happen needs to happen on the native side.
20
- * Future work on the JS side may include:
21
- * 1. Expanded typings for some of the events
22
- * 2. Additional work to manage selection
23
- * 3. Any base/default styling work
24
- */
25
-
26
-
27
- import {
28
- findNodeHandle,
29
- requireNativeComponent,
30
- TextInputProps,
31
- NativeMethods,
32
- UIManager
33
- } from 'react-native';
34
- import {
35
- IBlurEvent,
36
- IChangeEvent,
37
- IFocusEvent,
38
- } from './TextInput.Types.win32';
39
- import React from 'react'
40
-
41
- const TextAncestor = require('../../Text/TextAncestor');
42
- const TextInputState = require('./TextInputState');
43
-
44
- type RCTTextInputProps = TextInputProps & {
45
- text: string;
46
- };
47
-
48
- // RCTTextInput is the native component that win32 understands
49
- const RCTTextInput = requireNativeComponent<RCTTextInputProps>('RCTTextInput');
50
-
51
- // Adding typings on ViewManagers is problematic as available functionality is not known until
52
- // registration at runtime and would require native and js to always be in sync.
53
- const TextInputViewManager: any = UIManager.getViewManagerConfig('RCTTextInput');
54
-
55
- class TextInput extends React.Component<TextInputProps, {}> {
56
- // TODO: Once the native side begins supporting programmatic selection
57
- // this will become important for selection management
58
- // private _lastNativeTextSelection: any;
59
-
60
- private _rafID: number;
61
-
62
- private readonly _inputRef: React.RefObject<React.Component<RCTTextInputProps> & Readonly<NativeMethods>>;
63
- private _lastNativeText: string;
64
- private _eventCount = 0;
65
-
66
- constructor(props) {
67
- super(props);
68
- this._inputRef = React.createRef();
69
- }
70
-
71
- /**
72
- * On mount TextInput needs to register itself with TextInputState
73
- * and conditionally request an animation frame for focus.
74
- */
75
- public componentDidMount() {
76
- this._lastNativeText = this.props.value;
77
-
78
- TextInputState.registerInput(this);
79
-
80
- if (this.props.autoFocus) {
81
- this._rafID = requestAnimationFrame(this.focus);
82
- }
83
- }
84
-
85
- /**
86
- * This is an unfortunate consequence of having controlled TextInputs.
87
- * Tree diffing reconciliation will not always send down text values
88
- * This sets text explicitly.
89
- */
90
- public componentDidUpdate() {
91
- if ((this._lastNativeText !== this._getText())) {
92
- this._getText() && this.setNativeText(this._getText());
93
- }
94
-
95
- return;
96
- }
97
-
98
- /**
99
- * Pre-unmoun the TextInput should blur, unregister and clean up
100
- * the animation frame for focus (edge cases)
101
- */
102
- public componentWillUnmount() {
103
- // blur
104
- if (this.isFocused()) {
105
- this.blur();
106
- }
107
-
108
- // unregister
109
- TextInputState.unregisterInput(this);
110
-
111
- // cancel animationFrame
112
- if (this._rafID !== null) {
113
- cancelAnimationFrame(this._rafID);
114
- }
115
- if (this._rafID) {
116
- return;
117
- }
118
- return;
119
- }
120
-
121
- public render() {
122
- const props: TextInputProps = { ...this.props };
123
-
124
- // By default fontScaling is turned on.
125
- // win32 ignores this prop for the time being
126
- props.allowFontScaling = (this.props.allowFontScaling === null
127
- || this.props.allowFontScaling === undefined)
128
- ? true : this.props.allowFontScaling;
129
-
130
- return (
131
- <TextAncestor.Provider value={ true }>
132
- <RCTTextInput
133
- { ...props }
134
- ref={ this._inputRef }
135
- text={ this._getText() }
136
- onFocus={ this._onFocus }
137
- onBlur={ this._onBlur }
138
- onChange={ this._onChange }
139
- />
140
- </TextAncestor.Provider>
141
- );
142
- }
143
-
144
- /**
145
- * Returns true if the TextInput is focused
146
- */
147
- public isFocused(): boolean {
148
- return TextInputState.currentlyFocusedInput() === this;
149
- }
150
-
151
- /**
152
- * Focuses the TextInput
153
- */
154
- public focus = (): void => {
155
- TextInputState.setFocusedTextInput(this);
156
- UIManager.
157
- dispatchViewManagerCommand(findNodeHandle(this), TextInputViewManager.Commands.focus, null);
158
- }
159
-
160
- /**
161
- * Blurs the TextInput
162
- */
163
- public blur = (): void => {
164
- TextInputState.blurTextInput(this);
165
- UIManager.
166
- dispatchViewManagerCommand(findNodeHandle(this), TextInputViewManager.Commands.blur, null);
167
- }
168
-
169
- /**
170
- * Use clear for programmatic clearing of the text
171
- */
172
- public clear = (): void => {
173
- this.setNativeText('');
174
- }
175
-
176
- private readonly setEventCount = (): void => {
177
- UIManager.
178
- dispatchViewManagerCommand(findNodeHandle(this), TextInputViewManager.Commands.setEventCount,
179
- [ this._eventCount ]);
180
- }
181
-
182
- private readonly setNativeText = (val: string): void => {
183
- if (this._lastNativeText !== val) {
184
- UIManager.
185
- dispatchViewManagerCommand(findNodeHandle(this), TextInputViewManager.Commands.setNativeText,
186
- [ val ]);
187
- }
188
- }
189
-
190
- private readonly _getText = (): string | null => {
191
- return this.props.value || (this.props.defaultValue || null);
192
- }
193
-
194
- private readonly _onChange = (e: IChangeEvent): void => {
195
- const text = e.nativeEvent.text;
196
- this._eventCount = e.nativeEvent.eventCount;
197
- this.setEventCount();
198
-
199
- this.props.onChange && this.props.onChange(e);
200
- this.props.onChangeText && this.props.onChangeText(text);
201
- this._lastNativeText = text;
202
-
203
- this.forceUpdate();
204
- return;
205
- }
206
-
207
- private readonly _onFocus = (e: IFocusEvent): void => {
208
- this.focus();
209
- this.props.onFocus && this.props.onFocus(e);
210
- }
211
-
212
- private readonly _onBlur = (e: IBlurEvent): void => {
213
- this.props.onBlur && this.props.onBlur(e);
214
- }
215
- }
216
-
217
- export = TextInput;
@@ -1,9 +0,0 @@
1
- import { IViewWin32Props } from '../View/ViewWin32.Props';
2
-
3
- export interface ITouchableNativeFeedbackProps extends IViewWin32Props {
4
- // ViewProperties {
5
- onPress: (event: Record<string, any>) => void;
6
- disabled?: boolean;
7
- accessibilityLabel: string;
8
- tooltip?: string;
9
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- * All rights reserved.
4
- *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule TouchableNativeFeedback
10
- */
11
-
12
- 'use strict';
13
-
14
- import React from 'react'
15
- import { requireNativeComponent } from 'react-native';
16
-
17
- import { ITouchableNativeFeedbackProps } from './TouchableNativeFeedback.Props';
18
-
19
- class TouchableNativeFeedback extends React.Component<ITouchableNativeFeedbackProps, {}> {
20
- public render() {
21
- return <RCTTouchableNativeFeedback {...this.props}>{this.props.children}</RCTTouchableNativeFeedback>;
22
- }
23
- }
24
-
25
- const RCTTouchableNativeFeedback = requireNativeComponent('RCTTouchableNativeFeedback');
26
-
27
- export = TouchableNativeFeedback;