@office-iss/react-native-win32 0.70.0 → 0.70.2
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/CHANGELOG.json +37 -1
- package/CHANGELOG.md +23 -6
- package/Libraries/Components/View/ReactNativeViewAttributes.win32.js +1 -0
- package/Libraries/Components/View/ViewWin32.Props.d.ts +5 -0
- package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
- package/Libraries/Network/RCTNetworking.win32.js +87 -63
- package/Libraries/Utilities/Dimensions.win32.js +108 -11
- package/package.json +1 -1
- package/src/Libraries/Components/View/ViewWin32.Props.ts +5 -0
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,43 @@
|
|
|
2
2
|
"name": "@office-iss/react-native-win32",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Mon,
|
|
5
|
+
"date": "Mon, 26 Sep 2022 15:09:39 GMT",
|
|
6
|
+
"tag": "@office-iss/react-native-win32_v0.70.2",
|
|
7
|
+
"version": "0.70.2",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "julio.rocha@microsoft.com",
|
|
12
|
+
"package": "@office-iss/react-native-win32",
|
|
13
|
+
"commit": "ecd361d52e6efeeb66bb9d1404997d6b06027a0f",
|
|
14
|
+
"comment": "Consolidate JavaScript HTTP module specifications"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Mon, 19 Sep 2022 15:10:14 GMT",
|
|
21
|
+
"tag": "@office-iss/react-native-win32_v0.70.1",
|
|
22
|
+
"version": "0.70.1",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "patboyd@microsoft.com",
|
|
27
|
+
"package": "@office-iss/react-native-win32",
|
|
28
|
+
"commit": "a197f9946b8cd95ffe500a509e4ca7e02db18060",
|
|
29
|
+
"comment": "Add Dimensions.win32 implementation to support text scale factor"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"author": "ruaraki@microsoft.com",
|
|
33
|
+
"package": "@office-iss/react-native-win32",
|
|
34
|
+
"commit": "5678cd67e7cdb78939597f95455ad4fbc8ab9f37",
|
|
35
|
+
"comment": "Add `accessibilityAccessKey` prop to ViewWin32 (#10527)"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "Mon, 12 Sep 2022 17:54:20 GMT",
|
|
6
42
|
"tag": "@office-iss/react-native-win32_v0.70.0",
|
|
7
43
|
"version": "0.70.0",
|
|
8
44
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
# Change Log - @office-iss/react-native-win32
|
|
2
2
|
|
|
3
|
-
This log was last generated on Mon,
|
|
3
|
+
This log was last generated on Mon, 26 Sep 2022 15:09:39 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## 0.70.
|
|
7
|
+
## 0.70.2
|
|
8
8
|
|
|
9
|
-
Mon,
|
|
9
|
+
Mon, 26 Sep 2022 15:09:39 GMT
|
|
10
10
|
|
|
11
11
|
### Patches
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
- Integrate 70 Stable (34109996+chiaramooney@users.noreply.github.com)
|
|
15
|
-
- Bump @react-native-windows/virtualized-list to v0.70.0
|
|
13
|
+
- Consolidate JavaScript HTTP module specifications (julio.rocha@microsoft.com)
|
|
16
14
|
|
|
15
|
+
## 0.70.1
|
|
16
|
+
|
|
17
|
+
Mon, 19 Sep 2022 15:10:14 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Add Dimensions.win32 implementation to support text scale factor (patboyd@microsoft.com)
|
|
22
|
+
- Add `accessibilityAccessKey` prop to ViewWin32 (#10527) (ruaraki@microsoft.com)
|
|
23
|
+
|
|
24
|
+
## 0.70.0
|
|
25
|
+
|
|
26
|
+
Mon, 12 Sep 2022 17:54:20 GMT
|
|
27
|
+
|
|
28
|
+
### Patches
|
|
29
|
+
|
|
30
|
+
- Add Toggle action to accessibilityActionName (krsiler@microsoft.com)
|
|
31
|
+
- Integrate 70 Stable (34109996+chiaramooney@users.noreply.github.com)
|
|
32
|
+
- Bump @react-native-windows/virtualized-list to v0.70.0
|
|
33
|
+
|
|
17
34
|
## 0.70.0-preview.2
|
|
18
35
|
|
|
19
36
|
Tue, 23 Aug 2022 23:36:52 GMT
|
|
@@ -36,6 +36,7 @@ const UIView = {
|
|
|
36
36
|
needsOffscreenAlphaCompositing: true,
|
|
37
37
|
style: ReactNativeStyleAttributes,
|
|
38
38
|
// [Windows
|
|
39
|
+
accessibilityAccessKey: true,
|
|
39
40
|
enableFocusRing: true,
|
|
40
41
|
cursor: true,
|
|
41
42
|
textStyle: true, // Once we flush out our JS theming story this property will no longer be needed
|
|
@@ -94,6 +94,11 @@ export declare type ViewWin32OmitTypes = RN.ViewPropsAndroid & RN.ViewPropsIOS &
|
|
|
94
94
|
export interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {
|
|
95
95
|
type?: React.ElementType;
|
|
96
96
|
children?: React.ReactNode;
|
|
97
|
+
/**
|
|
98
|
+
* An access key to hook up to the UIA_AccessKey_Property.
|
|
99
|
+
* Access keys are used in keyboard navigation to allow quick navigation to UI in an application.
|
|
100
|
+
*/
|
|
101
|
+
accessibilityAccessKey?: string;
|
|
97
102
|
accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;
|
|
98
103
|
/**
|
|
99
104
|
* 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 | '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\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 | '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\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"]}
|
|
@@ -1,93 +1,117 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright (c)
|
|
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.
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
6
4
|
*
|
|
5
|
+
* @flow strict-local
|
|
7
6
|
* @format
|
|
8
|
-
* @flow
|
|
9
7
|
*/
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
// It will add the necessary requestId, so that you don't have to generate it yourself.
|
|
13
|
-
import NativeEventEmitter from '../EventEmitter/NativeEventEmitter';
|
|
14
|
-
import convertRequestBody from './convertRequestBody';
|
|
15
|
-
|
|
16
|
-
// [Win32
|
|
17
|
-
import type {RequestBody} from './convertRequestBody';
|
|
18
|
-
const NativeModules = require('../BatchedBridge/NativeModules');
|
|
19
|
-
const RCTNetworkingNative = NativeModules.Networking;
|
|
20
|
-
// Win32]
|
|
9
|
+
'use strict';
|
|
21
10
|
|
|
22
|
-
|
|
11
|
+
import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter';
|
|
12
|
+
const RCTNetworkingNative =
|
|
13
|
+
require('../BatchedBridge/NativeModules').Networking; // [Windows]
|
|
14
|
+
import {type NativeResponseType} from './XMLHttpRequest';
|
|
15
|
+
import convertRequestBody, {type RequestBody} from './convertRequestBody';
|
|
16
|
+
import {type EventSubscription} from '../vendor/emitter/EventEmitter';
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
type RCTNetworkingEventDefinitions = $ReadOnly<{
|
|
19
|
+
didSendNetworkData: [
|
|
20
|
+
[
|
|
21
|
+
number, // requestId
|
|
22
|
+
number, // progress
|
|
23
|
+
number, // total
|
|
24
|
+
],
|
|
25
|
+
],
|
|
26
|
+
didReceiveNetworkResponse: [
|
|
27
|
+
[
|
|
28
|
+
number, // requestId
|
|
29
|
+
number, // status
|
|
30
|
+
?{[string]: string}, // responseHeaders
|
|
31
|
+
?string, // responseURL
|
|
32
|
+
],
|
|
33
|
+
],
|
|
34
|
+
didReceiveNetworkData: [
|
|
35
|
+
[
|
|
36
|
+
number, // requestId
|
|
37
|
+
string, // response
|
|
38
|
+
],
|
|
39
|
+
],
|
|
40
|
+
didReceiveNetworkIncrementalData: [
|
|
41
|
+
[
|
|
42
|
+
number, // requestId
|
|
43
|
+
string, // responseText
|
|
44
|
+
number, // progress
|
|
45
|
+
number, // total
|
|
46
|
+
],
|
|
47
|
+
],
|
|
48
|
+
didReceiveNetworkDataProgress: [
|
|
49
|
+
[
|
|
50
|
+
number, // requestId
|
|
51
|
+
number, // loaded
|
|
52
|
+
number, // total
|
|
53
|
+
],
|
|
54
|
+
],
|
|
55
|
+
didCompleteNetworkResponse: [
|
|
56
|
+
[
|
|
57
|
+
number, // requestId
|
|
58
|
+
string, // error
|
|
59
|
+
boolean, // timeOutError
|
|
60
|
+
],
|
|
61
|
+
],
|
|
62
|
+
}>;
|
|
33
63
|
|
|
34
64
|
let _requestId = 1;
|
|
35
65
|
function generateRequestId(): number {
|
|
36
66
|
return _requestId++;
|
|
37
67
|
}
|
|
38
68
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
69
|
+
const RCTNetworking = {
|
|
70
|
+
addListener<K: $Keys<RCTNetworkingEventDefinitions>>(
|
|
71
|
+
eventType: K,
|
|
72
|
+
listener: (...$ElementType<RCTNetworkingEventDefinitions, K>) => mixed,
|
|
73
|
+
context?: mixed,
|
|
74
|
+
): EventSubscription {
|
|
75
|
+
return RCTDeviceEventEmitter.addListener(eventType, listener, context);
|
|
76
|
+
},
|
|
48
77
|
|
|
49
78
|
sendRequest(
|
|
50
79
|
method: string,
|
|
51
80
|
trackingName: string,
|
|
52
81
|
url: string,
|
|
53
|
-
headers:
|
|
82
|
+
headers: {...},
|
|
54
83
|
data: RequestBody,
|
|
55
|
-
responseType:
|
|
84
|
+
responseType: NativeResponseType,
|
|
56
85
|
incrementalUpdates: boolean,
|
|
57
86
|
timeout: number,
|
|
58
|
-
callback: (requestId: number) =>
|
|
87
|
+
callback: (requestId: number) => void,
|
|
59
88
|
withCredentials: boolean,
|
|
60
89
|
) {
|
|
61
|
-
const body = convertRequestBody(data);
|
|
62
|
-
if (body && body.formData) {
|
|
63
|
-
body.formData = body.formData.map(part => ({
|
|
64
|
-
...part,
|
|
65
|
-
headers: convertHeadersMapToArray(part.headers),
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
90
|
const requestId = generateRequestId();
|
|
91
|
+
const body = convertRequestBody(data);
|
|
69
92
|
RCTNetworkingNative.sendRequest(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
93
|
+
{
|
|
94
|
+
method,
|
|
95
|
+
url,
|
|
96
|
+
requestId,
|
|
97
|
+
data: {...body, trackingName},
|
|
98
|
+
headers,
|
|
99
|
+
responseType,
|
|
100
|
+
incrementalUpdates,
|
|
101
|
+
timeout,
|
|
102
|
+
withCredentials,
|
|
103
|
+
},
|
|
104
|
+
callback,
|
|
80
105
|
);
|
|
81
|
-
|
|
82
|
-
}
|
|
106
|
+
},
|
|
83
107
|
|
|
84
108
|
abortRequest(requestId: number) {
|
|
85
|
-
RCTNetworkingNative.abortRequest(requestId);
|
|
86
|
-
}
|
|
109
|
+
RCTNetworkingNative.abortRequest(requestId);
|
|
110
|
+
},
|
|
87
111
|
|
|
88
|
-
clearCookies(callback: (result: boolean) =>
|
|
89
|
-
RCTNetworkingNative.clearCookies(callback);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
112
|
+
clearCookies(callback: (result: boolean) => void) {
|
|
113
|
+
RCTNetworkingNative.clearCookies(callback);
|
|
114
|
+
},
|
|
115
|
+
};
|
|
92
116
|
|
|
93
|
-
module.exports =
|
|
117
|
+
module.exports = RCTNetworking;
|
|
@@ -6,29 +6,126 @@
|
|
|
6
6
|
* @flow
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import EventEmitter, {
|
|
10
|
+
type EventSubscription,
|
|
11
|
+
} from '../vendor/emitter/EventEmitter';
|
|
12
|
+
import RCTDeviceEventEmitter from '../EventEmitter/RCTDeviceEventEmitter';
|
|
13
|
+
import NativeDeviceInfo, {
|
|
14
|
+
type DisplayMetrics,
|
|
15
|
+
type DisplayMetricsAndroid,
|
|
16
|
+
type DimensionsPayload,
|
|
17
|
+
} from './NativeDeviceInfo';
|
|
18
|
+
import invariant from 'invariant';
|
|
10
19
|
|
|
20
|
+
const eventEmitter = new EventEmitter<{
|
|
21
|
+
change: [DimensionsPayload],
|
|
22
|
+
}>();
|
|
23
|
+
let dimensionsInitialized = false;
|
|
24
|
+
let dimensions: DimensionsPayload;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* While a global Dimensions object for window and screen dimensions is too simple for Win32,
|
|
28
|
+
* attached to this object is also fontScale which is a system global value. We expose this value
|
|
29
|
+
* for large text scaling support while leaving other window dimension information undefined. These undefined
|
|
30
|
+
* values will cause rendering issues if used but should avoid runtime failures in JS.
|
|
31
|
+
*/
|
|
11
32
|
class Dimensions {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
33
|
+
/**
|
|
34
|
+
* NOTE: `useWindowDimensions` is the preferred API for React components.
|
|
35
|
+
*
|
|
36
|
+
* Initial dimensions are set before `runApplication` is called so they should
|
|
37
|
+
* be available before any other require's are run, but may be updated later.
|
|
38
|
+
*
|
|
39
|
+
* Note: Although dimensions are available immediately, they may change (e.g
|
|
40
|
+
* due to device rotation) so any rendering logic or styles that depend on
|
|
41
|
+
* these constants should try to call this function on every render, rather
|
|
42
|
+
* than caching the value (for example, using inline styles rather than
|
|
43
|
+
* setting a value in a `StyleSheet`).
|
|
44
|
+
*
|
|
45
|
+
* Example: `const {height, width} = Dimensions.get('window');`
|
|
46
|
+
*
|
|
47
|
+
* @param {string} dim Name of dimension as defined when calling `set`.
|
|
48
|
+
* @returns {DisplayMetrics? | DisplayMetricsAndroid?} Value for the dimension.
|
|
49
|
+
*/
|
|
50
|
+
static get(dim: string): DisplayMetrics | DisplayMetricsAndroid {
|
|
51
|
+
invariant(dimensions[dim], 'No dimension set for key ' + dim);
|
|
52
|
+
return dimensions[dim];
|
|
16
53
|
}
|
|
17
54
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
55
|
+
/**
|
|
56
|
+
* This should only be called from native code by sending the
|
|
57
|
+
* didUpdateDimensions event.
|
|
58
|
+
*
|
|
59
|
+
* @param {DimensionsPayload} dims Simple string-keyed object of dimensions to set
|
|
60
|
+
*/
|
|
61
|
+
static set(dims: $ReadOnly<DimensionsPayload>): void {
|
|
62
|
+
let {screen, window} = dims;
|
|
63
|
+
const {windowPhysicalPixels} = dims;
|
|
64
|
+
if (windowPhysicalPixels) {
|
|
65
|
+
window = {
|
|
66
|
+
width: windowPhysicalPixels.width,
|
|
67
|
+
height: windowPhysicalPixels.height,
|
|
68
|
+
scale: windowPhysicalPixels.scale,
|
|
69
|
+
fontScale: windowPhysicalPixels.fontScale,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const {screenPhysicalPixels} = dims;
|
|
73
|
+
if (screenPhysicalPixels) {
|
|
74
|
+
screen = {
|
|
75
|
+
width: screenPhysicalPixels.width,
|
|
76
|
+
height: screenPhysicalPixels.height,
|
|
77
|
+
scale: screenPhysicalPixels.scale,
|
|
78
|
+
fontScale: screenPhysicalPixels.fontScale,
|
|
79
|
+
};
|
|
80
|
+
} else if (screen == null) {
|
|
81
|
+
screen = window;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
dimensions = {window, screen};
|
|
85
|
+
if (dimensionsInitialized) {
|
|
86
|
+
// Don't fire 'change' the first time the dimensions are set.
|
|
87
|
+
eventEmitter.emit('change', dimensions);
|
|
88
|
+
} else {
|
|
89
|
+
dimensionsInitialized = true;
|
|
90
|
+
}
|
|
22
91
|
}
|
|
23
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Add an event handler. Supported events:
|
|
95
|
+
*
|
|
96
|
+
* - `change`: Fires when a property within the `Dimensions` object changes. The argument
|
|
97
|
+
* to the event handler is an object with `window` and `screen` properties whose values
|
|
98
|
+
* are the same as the return values of `Dimensions.get('window')` and
|
|
99
|
+
* `Dimensions.get('screen')`, respectively.
|
|
100
|
+
*/
|
|
24
101
|
static addEventListener(
|
|
25
102
|
type: 'change',
|
|
26
103
|
handler: Function,
|
|
27
104
|
): EventSubscription {
|
|
28
|
-
|
|
29
|
-
|
|
105
|
+
invariant(
|
|
106
|
+
type === 'change',
|
|
107
|
+
'Trying to subscribe to unknown event: "%s"',
|
|
108
|
+
type,
|
|
30
109
|
);
|
|
110
|
+
return eventEmitter.addListener(type, handler);
|
|
31
111
|
}
|
|
32
112
|
}
|
|
33
113
|
|
|
114
|
+
let initialDims: ?$ReadOnly<DimensionsPayload> =
|
|
115
|
+
global.nativeExtensions &&
|
|
116
|
+
global.nativeExtensions.DeviceInfo &&
|
|
117
|
+
global.nativeExtensions.DeviceInfo.Dimensions;
|
|
118
|
+
if (!initialDims) {
|
|
119
|
+
// Subscribe before calling getConstants to make sure we don't miss any updates in between.
|
|
120
|
+
RCTDeviceEventEmitter.addListener(
|
|
121
|
+
'didUpdateDimensions',
|
|
122
|
+
(update: DimensionsPayload) => {
|
|
123
|
+
Dimensions.set(update);
|
|
124
|
+
},
|
|
125
|
+
);
|
|
126
|
+
initialDims = NativeDeviceInfo.getConstants().Dimensions;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
Dimensions.set(initialDims);
|
|
130
|
+
|
|
34
131
|
module.exports = Dimensions;
|
package/package.json
CHANGED
|
@@ -192,6 +192,11 @@ export type ViewWin32OmitTypes = RN.ViewPropsAndroid &
|
|
|
192
192
|
export interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>, BasePropsWin32 {
|
|
193
193
|
type?: React.ElementType;
|
|
194
194
|
children?: React.ReactNode;
|
|
195
|
+
/**
|
|
196
|
+
* An access key to hook up to the UIA_AccessKey_Property.
|
|
197
|
+
* Access keys are used in keyboard navigation to allow quick navigation to UI in an application.
|
|
198
|
+
*/
|
|
199
|
+
accessibilityAccessKey?: string;
|
|
195
200
|
accessibilityActions?: ReadonlyArray<AccessibilityActionInfo>;
|
|
196
201
|
/**
|
|
197
202
|
* Tells a person using a screen reader what kind of annotation they
|