@office-iss/react-native-win32 0.66.0 → 0.67.0-preview.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/.eslintignore +2 -0
- package/.flowconfig +1 -1
- package/CHANGELOG.json +195 -19
- package/CHANGELOG.md +89 -13
- package/Libraries/ActionSheetIOS/ActionSheetIOS.js +14 -1
- package/Libraries/ActionSheetIOS/NativeActionSheetManager.js +2 -0
- package/Libraries/Animated/AnimatedEvent.js +23 -4
- package/Libraries/Animated/NativeAnimatedHelper.js +2 -2
- package/Libraries/Animated/components/AnimatedImage.js +3 -3
- package/Libraries/Animated/components/AnimatedScrollView.js +3 -3
- package/Libraries/Animated/components/AnimatedText.js +3 -3
- package/Libraries/Animated/components/AnimatedView.js +1 -3
- package/Libraries/Animated/createAnimatedComponent.js +3 -34
- package/Libraries/Components/Button/ButtonWin32.js +2 -2
- package/Libraries/Components/Button/ButtonWin32.js.map +1 -1
- package/Libraries/Components/Button.js +3 -0
- package/Libraries/Components/DatePicker/DatePickerIOS.ios.js +3 -6
- package/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js +4 -7
- package/Libraries/Components/EnterString.win32.js +3 -3
- package/Libraries/Components/EnterString.win32.js.map +1 -1
- package/Libraries/Components/ScrollView/AndroidHorizontalScrollViewNativeComponent.js +1 -0
- package/Libraries/Components/ScrollView/ScrollView.js +17 -16
- package/Libraries/Components/ScrollView/ScrollViewStickyHeader.js +268 -252
- package/Libraries/Components/Text/Tests/TextWin32Test.d.ts +0 -1
- package/Libraries/Components/Text/TextWin32.Props.d.ts +2 -2
- package/Libraries/Components/Text/TextWin32.Props.js.map +1 -1
- package/Libraries/Components/Text/TextWin32.js +1 -1
- package/Libraries/Components/Text/TextWin32.js.map +1 -1
- package/Libraries/Components/TextInput/Tests/TextInputTest.d.ts +0 -1
- package/Libraries/Components/TextInput/TextInput.win32.js +6 -6
- package/Libraries/Components/TextInput/TextInput.win32.js.map +1 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.d.ts +0 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js +1 -1
- package/Libraries/Components/Touchable/Tests/TouchableWin32Test.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js +2 -2
- package/Libraries/Components/Touchable/TouchableNativeFeedback.win32.js.map +1 -1
- package/Libraries/Components/Touchable/TouchableWin32.js +2 -2
- package/Libraries/Components/Touchable/TouchableWin32.js.map +1 -1
- package/Libraries/Components/View/ReactNativeViewViewConfig.win32.js +1 -0
- package/Libraries/Components/View/Tests/ViewWin32Test.d.ts +0 -1
- package/Libraries/Components/View/Tests/ViewWin32Test.js +44 -2
- package/Libraries/Components/View/Tests/ViewWin32Test.js.map +1 -1
- package/Libraries/Components/View/View.js +1 -1
- package/Libraries/Components/View/View.win32.js +1 -1
- package/Libraries/Components/View/ViewAccessibility.js +1 -1
- package/Libraries/Components/View/ViewWin32.Props.d.ts +4 -6
- package/Libraries/Components/View/ViewWin32.Props.js.map +1 -1
- package/Libraries/Components/View/ViewWin32.js +5 -5
- package/Libraries/Components/View/ViewWin32.js.map +1 -1
- package/Libraries/Core/ExceptionsManager.js +45 -80
- package/Libraries/Core/ExtendedError.js +0 -1
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/Core/setUpBatchedBridge.js +1 -1
- package/Libraries/Core/setUpGlobals.js +2 -4
- package/Libraries/Core/setUpTimers.js +2 -2
- package/Libraries/Image/Image.ios.js +6 -0
- package/Libraries/Image/Image.win32.js +6 -0
- package/Libraries/Image/ImageBackground.js +10 -8
- package/Libraries/Image/ImageProps.js +28 -0
- package/Libraries/Image/Tests/ImageWin32Test.d.ts +0 -1
- package/Libraries/LogBox/Data/LogBoxData.js +18 -19
- package/Libraries/LogBox/UI/LogBoxImages/alert-triangle.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-left.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/chevron-right.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/close.png +0 -0
- package/Libraries/LogBox/UI/LogBoxImages/loader.png +0 -0
- package/Libraries/NewAppScreen/components/logo.png +0 -0
- package/Libraries/PermissionsAndroid/NativePermissionsAndroid.js +2 -1
- package/Libraries/PermissionsAndroid/PermissionsAndroid.js +2 -0
- package/Libraries/PersonaCoin/PersonaCoin.js +3 -2
- package/Libraries/PersonaCoin/PersonaCoin.js.map +1 -1
- package/Libraries/Pressability/Pressability.js +13 -13
- package/Libraries/Pressability/PressabilityPerformanceEventEmitter.js +1 -1
- package/Libraries/ReactNative/AppRegistry.js +4 -2
- package/Libraries/Renderer/implementations/ReactFabric-dev.fb.js +1569 -875
- package/Libraries/Renderer/implementations/ReactFabric-prod.fb.js +529 -319
- package/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js +570 -362
- package/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js +1592 -891
- package/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js +521 -311
- package/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js +562 -354
- package/Libraries/Share/Share.js +1 -1
- package/Libraries/StyleSheet/normalizeColor.js +2 -2
- package/Libraries/Text/TextProps.js +1 -7
- package/Libraries/TurboModule/TurboModuleRegistry.js +1 -1
- package/Libraries/Utilities/HMRClient.js +1 -1
- package/flow/global.js +45 -0
- package/index.js +15 -10
- package/index.win32.js +15 -10
- package/jest/mockModal.js +31 -0
- package/jest/setup.js +5 -3
- package/overrides.json +7 -13
- package/package.json +20 -18
- package/rntypes/BatchedBridge.d.ts +23 -0
- package/rntypes/Devtools.d.ts +20 -0
- package/rntypes/LaunchScreen.d.ts +9 -0
- package/rntypes/globals.d.ts +496 -0
- package/rntypes/index.d.ts +9966 -0
- package/rntypes/legacy-properties.d.ts +266 -0
- package/src/Libraries/Components/Text/TextWin32.Props.ts +2 -2
- package/src/Libraries/Components/View/Tests/ViewWin32Test.tsx +64 -0
- package/src/Libraries/Components/View/ViewWin32.Props.ts +7 -12
- package/src/rntypes/BatchedBridge.d.ts +23 -0
- package/src/rntypes/Devtools.d.ts +20 -0
- package/src/rntypes/LaunchScreen.d.ts +9 -0
- package/src/rntypes/globals.d.ts +496 -0
- package/src/rntypes/index.d.ts +9966 -0
- package/src/rntypes/legacy-properties.d.ts +266 -0
- package/src/typings-index.ts +11 -4
- package/typings-index.d.ts +3 -1
- package/typings-index.js +7 -5
- package/typings-index.js.map +1 -1
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js +0 -87
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroid.win32.js +0 -30
- package/Libraries/Components/DatePickerAndroid/DatePickerAndroidTypes.js +0 -30
- package/Libraries/Components/StaticContainer.react.js +0 -51
- package/Libraries/Components/Touchable/ensurePositiveDelayProps.js +0 -25
- package/Libraries/Interaction/InteractionMixin.js +0 -54
- package/Libraries/ReactNative/queryLayoutByID.js +0 -58
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewWin32Test.js","sourceRoot":"","sources":["../../../../src/Libraries/Components/View/Tests/ViewWin32Test.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AACb,kDAAyB;AACzB,+CAAoE;AACpE,4CAAyC;AAGzC,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,OAAO;KACrB;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,CAAC;QACjB,eAAe,EAAE,YAAY;QAC7B,cAAc,EAAE,cAAc;KAC/B;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,CAAC;QACT,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE,GAAG;QACb,SAAS,EAAE,EAAE;KACd;IACD,QAAQ,EAAE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,gBAAgB;QACvB,WAAW,EAAE,uDAAuD;QACpE,MAAM;YACJ,OAAO,8BAAC,aAAa,OAAG,CAAC;QAC3B,CAAC;KACF;CACF,CAAC","sourcesContent":["'use strict';\nimport React from 'react'\nimport { StyleSheet, Text, TouchableHighlight } from 'react-native';\nimport { ViewWin32 } from '../ViewWin32';\nimport { Cursor, IKeyboardEvent, IHandledKeyboardEvent } from '../ViewWin32.Props';\n\nconst styles = StyleSheet.create({\n border: {\n borderStyle: 'dotted',\n borderColor: 'black',\n },\n keyComponentRoot: {\n borderWidth: 2,\n flexDirection: 'row',\n marginVertical: 5,\n backgroundColor: 'whitesmoke',\n justifyContent: 'space-around',\n },\n keyEnterVisualizer: {\n margin: 5,\n alignItems: 'center',\n minWidth: 100,\n minHeight: 30,\n },\n blackbox: { height: 30, width: 30, borderColor: 'black', borderWidth: 3 },\n});\n\ninterface IFocusableComponentState {\n hasFocus: boolean;\n}\n\nclass FocusMoverTestComponent extends React.Component<{}, IFocusableComponentState> {\n private _focusTarget: ViewWin32 = null;\n private readonly _labeledBy: React.RefObject<ViewWin32>;\n\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n this._labeledBy = React.createRef<ViewWin32>();\n }\n public render() {\n return (\n <ViewWin32>\n <ViewWin32 ref={this._labeledBy} accessibilityLabel=\"separate label for test\" accessibilityItemType=\"Comment\" />\n <ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>\n <TouchableHighlight onPress={this._onPress}>\n <ViewWin32 accessibilityLabeledBy={this._labeledBy} style={styles.blackbox} />\n </TouchableHighlight>\n <ViewWin32\n ref={this._setRef}\n focusable\n style={this.state.hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n >\n <Text>{this.state.hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _setRef = (ref: ViewWin32) => {\n this._focusTarget = ref;\n };\n\n private readonly _onPress = () => {\n if (this._focusTarget !== undefined) {\n this._focusTarget.focus();\n }\n };\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n}\n\ninterface IKeyboardableComponentState {\n lastKeyDown: string;\n lastKeyUp: string;\n}\n\nconst handledNativeKeyboardEvents: IHandledKeyboardEvent[] = [\n { key: 'ArrowDown' },\n { key: 'ArrowUp' },\n { key: 'ArrowLeft' },\n { key: 'ArrowRight' },\n { key: 'Tab' },\n];\n\nclass KeyboardTestComponent extends React.Component<{}, IFocusableComponentState & IKeyboardableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n lastKeyDown: null,\n lastKeyUp: null,\n };\n }\n\n public render() {\n return (\n <ViewWin32 keyDownEvents={handledNativeKeyboardEvents} keyUpEvents={handledNativeKeyboardEvents}>\n <ViewWin32\n style={this.state.hasFocus ? [styles.keyComponentRoot, styles.border] : styles.keyComponentRoot}\n focusable\n onKeyUp={this._onKeyUp}\n onKeyDown={this._onKeyDown}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n >\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyDown</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyDown !== null ? this.state.lastKeyDown : ' '}</Text>\n </ViewWin32>\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyUp</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyUp !== null ? this.state.lastKeyUp : ' '}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n\n private readonly _onKeyUp = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyUp: ev.nativeEvent.key, lastKeyDown: null });\n };\n\n private readonly _onKeyDown = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyDown: ev.nativeEvent.key, lastKeyUp: null });\n };\n}\n\ninterface IHoverComponentProps {\n color: string;\n}\nclass HoverTestComponent extends React.Component<IHoverComponentProps, IFocusableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n }\n\n public render() {\n return (\n <ViewWin32\n onMouseEnter={this._onMouseEnter}\n onMouseLeave={this._onMouseLeave}\n style={this.state.hasFocus ? [styles.blackbox, { backgroundColor: this.props.color }] : styles.blackbox}\n />\n );\n }\n private readonly _onMouseLeave = () => {\n this.setState({ hasFocus: false });\n };\n private readonly _onMouseEnter = () => {\n this.setState({ hasFocus: true });\n };\n}\n\nclass HoverExample extends React.Component {\n public render() {\n return (\n <ViewWin32 style={{ flexDirection: 'row', marginHorizontal: 75, justifyContent: 'space-around' }}>\n <HoverTestComponent color=\"red\" />\n <HoverTestComponent color=\"orange\" />\n <HoverTestComponent color=\"yellow\" />\n <HoverTestComponent color=\"green\" />\n <HoverTestComponent color=\"blue\" />\n <HoverTestComponent color=\"indigo\" />\n <HoverTestComponent color=\"violet\" />\n </ViewWin32>\n );\n }\n}\n\nconst ToolTipExample: React.FunctionComponent<{}> = () => {\n return (\n <ViewWin32\n style={{\n backgroundColor: 'red',\n height: 100,\n width: 100,\n }}\n tooltip=\"Example tooltip\"\n cursor=\"pointer\"\n />\n );\n};\n\ninterface ICursorTestComponentProps {\n cursor: Cursor\n}\n\nconst CursorTestComponent: React.FunctionComponent<ICursorTestComponentProps> = (props) => {\n return (\n <ViewWin32 style={{flexDirection: 'column'}}>\n <Text>{props.cursor}</Text>\n <ViewWin32 cursor={props.cursor} style={styles.blackbox} />\n </ViewWin32>\n )\n}\n\nconst CursorExample: React.FunctionComponent = () => {\n return (\n <ViewWin32 style={{ flexDirection: 'row', justifyContent: 'space-around' }}>\n <CursorTestComponent cursor='auto' />\n <CursorTestComponent cursor='default' />\n <CursorTestComponent cursor='help' />\n <CursorTestComponent cursor='nesw-resize' />\n <CursorTestComponent cursor='not-allowed' />\n <CursorTestComponent cursor='ns-resize' />\n <CursorTestComponent cursor='nwse-resize' />\n <CursorTestComponent cursor='pointer' />\n <CursorTestComponent cursor='wait' />\n <CursorTestComponent cursor='move' />\n <CursorTestComponent cursor='text' />\n <CursorTestComponent cursor='we-resize' />\n </ViewWin32>\n );\n}\n\nexport const title = 'ViewWin32';\nexport const displayName = 'ViewWin32 Example';\nexport const description = 'All the stock View props plus Win32 specific ones';\nexport const examples = [\n {\n title: 'focus() method example',\n description: 'Each of these black boxes moves focus to the ViewWin32 on the right',\n render(): JSX.Element {\n return (\n <ViewWin32>\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n </ViewWin32>\n );\n },\n },\n {\n title: 'KeyboardEvents example',\n description: 'Native keyboarding has been prevented',\n render(): JSX.Element {\n return <KeyboardTestComponent />;\n },\n },\n {\n title: 'Hover example',\n description: 'Hover a rainbow',\n render(): JSX.Element {\n return <HoverExample />;\n },\n },\n {\n title: 'Tooltip example',\n description: 'Displays a tooltip on hover',\n render(): JSX.Element {\n return <ToolTipExample />;\n },\n },\n {\n title: 'Cursor example',\n description: 'Each of these boxes should display a different cursor',\n render(): JSX.Element {\n return <CursorExample />;\n },\n },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"ViewWin32Test.js","sourceRoot":"","sources":["../../../../src/Libraries/Components/View/Tests/ViewWin32Test.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;AACb,kDAAyB;AACzB,+CAAoE;AACpE,4CAAyC;AAGzC,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,OAAO;KACrB;IACD,gBAAgB,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,CAAC;QACjB,eAAe,E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,OAAO,8BAAC,YAAY,OAAG,CAAC;QAC1B,CAAC;KACF;IACD;QACE,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,6BAA6B;QAC1C,MAAM;YACJ,OAAO,8BAAC,cAAc,OAAG,CAAC;QAC5B,CAAC;KACF;IACD;QACE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,uDAAuD;QACpE,MAAM;YACJ,OAAO,8BAAC,aAAa,OAAG,CAAC;QAC3B,CAAC;KACF;IACD;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,kDAAkD;QAC/D,MAAM;YACJ,OAAO,8BAAC,sBAAsB,OAAG,CAAC;QACpC,CAAC;KACF;CACF,CAAC","sourcesContent":["'use strict';\nimport React from 'react'\nimport { StyleSheet, Text, TouchableHighlight } from 'react-native';\nimport { ViewWin32 } from '../ViewWin32';\nimport { Cursor, IKeyboardEvent, IHandledKeyboardEvent } from '../ViewWin32.Props';\n\nconst styles = StyleSheet.create({\n border: {\n borderStyle: 'dotted',\n borderColor: 'black',\n },\n keyComponentRoot: {\n borderWidth: 2,\n flexDirection: 'row',\n marginVertical: 5,\n backgroundColor: 'whitesmoke',\n justifyContent: 'space-around',\n },\n keyEnterVisualizer: {\n margin: 5,\n alignItems: 'center',\n minWidth: 100,\n minHeight: 30,\n },\n blackbox: { height: 30, width: 30, borderColor: 'black', borderWidth: 3 },\n});\n\ninterface IFocusableComponentState {\n hasFocus: boolean;\n}\n\nclass FocusMoverTestComponent extends React.Component<{}, IFocusableComponentState> {\n private _focusTarget: ViewWin32 = null;\n private readonly _labeledBy: React.RefObject<ViewWin32>;\n\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n this._labeledBy = React.createRef<ViewWin32>();\n }\n public render() {\n return (\n <ViewWin32>\n <ViewWin32 ref={this._labeledBy} accessibilityLabel=\"separate label for test\" accessibilityItemType=\"Comment\" />\n <ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>\n <TouchableHighlight onPress={this._onPress}>\n <ViewWin32 accessibilityLabeledBy={this._labeledBy} style={styles.blackbox} />\n </TouchableHighlight>\n <ViewWin32\n ref={this._setRef}\n focusable\n style={this.state.hasFocus ? { backgroundColor: '#aee8fcff' } : { backgroundColor: '#00000000' }}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n enableFocusRing={false}\n >\n <Text>{this.state.hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _setRef = (ref: ViewWin32) => {\n this._focusTarget = ref;\n };\n\n private readonly _onPress = () => {\n if (this._focusTarget !== undefined) {\n this._focusTarget.focus();\n }\n };\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n}\n\ninterface IKeyboardableComponentState {\n lastKeyDown: string;\n lastKeyUp: string;\n}\n\nconst handledNativeKeyboardEvents: IHandledKeyboardEvent[] = [\n { key: 'ArrowDown' },\n { key: 'ArrowUp' },\n { key: 'ArrowLeft' },\n { key: 'ArrowRight' },\n { key: 'Tab' },\n];\n\nclass KeyboardTestComponent extends React.Component<{}, IFocusableComponentState & IKeyboardableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n lastKeyDown: null,\n lastKeyUp: null,\n };\n }\n\n public render() {\n return (\n <ViewWin32 keyDownEvents={handledNativeKeyboardEvents} keyUpEvents={handledNativeKeyboardEvents}>\n <ViewWin32\n style={this.state.hasFocus ? [styles.keyComponentRoot, styles.border] : styles.keyComponentRoot}\n focusable\n onKeyUp={this._onKeyUp}\n onKeyDown={this._onKeyDown}\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n enableFocusRing={false}\n >\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyDown</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyDown !== null ? this.state.lastKeyDown : ' '}</Text>\n </ViewWin32>\n <ViewWin32 style={styles.keyEnterVisualizer}>\n <Text>OnKeyUp</Text>\n <Text>----</Text>\n <Text>{this.state.lastKeyUp !== null ? this.state.lastKeyUp : ' '}</Text>\n </ViewWin32>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n\n private readonly _onKeyUp = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyUp: ev.nativeEvent.key, lastKeyDown: null });\n };\n\n private readonly _onKeyDown = (ev: IKeyboardEvent) => {\n this.setState({ lastKeyDown: ev.nativeEvent.key, lastKeyUp: null });\n };\n}\n\ninterface IHoverComponentProps {\n color: string;\n}\nclass HoverTestComponent extends React.Component<IHoverComponentProps, IFocusableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n }\n\n public render() {\n return (\n <ViewWin32\n onMouseEnter={this._onMouseEnter}\n onMouseLeave={this._onMouseLeave}\n style={this.state.hasFocus ? [styles.blackbox, { backgroundColor: this.props.color }] : styles.blackbox}\n />\n );\n }\n private readonly _onMouseLeave = () => {\n this.setState({ hasFocus: false });\n };\n private readonly _onMouseEnter = () => {\n this.setState({ hasFocus: true });\n };\n}\n\nclass HoverExample extends React.Component {\n public render() {\n return (\n <ViewWin32 style={{ flexDirection: 'row', marginHorizontal: 75, justifyContent: 'space-around' }}>\n <HoverTestComponent color=\"red\" />\n <HoverTestComponent color=\"orange\" />\n <HoverTestComponent color=\"yellow\" />\n <HoverTestComponent color=\"green\" />\n <HoverTestComponent color=\"blue\" />\n <HoverTestComponent color=\"indigo\" />\n <HoverTestComponent color=\"violet\" />\n </ViewWin32>\n );\n }\n}\n\nconst ToolTipExample: React.FunctionComponent<{}> = () => {\n return (\n <ViewWin32\n style={{\n backgroundColor: 'red',\n height: 100,\n width: 100,\n }}\n tooltip=\"Example tooltip\"\n cursor=\"pointer\"\n />\n );\n};\n\ninterface ICursorTestComponentProps {\n cursor: Cursor\n}\n\nconst CursorTestComponent: React.FunctionComponent<ICursorTestComponentProps> = (props) => {\n return (\n <ViewWin32 style={{flexDirection: 'column'}}>\n <Text>{props.cursor}</Text>\n <ViewWin32 cursor={props.cursor} style={styles.blackbox} />\n </ViewWin32>\n )\n}\n\nconst CursorExample: React.FunctionComponent = () => {\n return (\n <ViewWin32 style={{ flexDirection: 'row', justifyContent: 'space-around' }}>\n <CursorTestComponent cursor='auto' />\n <CursorTestComponent cursor='default' />\n <CursorTestComponent cursor='help' />\n <CursorTestComponent cursor='nesw-resize' />\n <CursorTestComponent cursor='not-allowed' />\n <CursorTestComponent cursor='ns-resize' />\n <CursorTestComponent cursor='nwse-resize' />\n <CursorTestComponent cursor='pointer' />\n <CursorTestComponent cursor='wait' />\n <CursorTestComponent cursor='move' />\n <CursorTestComponent cursor='text' />\n <CursorTestComponent cursor='we-resize' />\n </ViewWin32>\n );\n}\nclass EnableFocusRingExample extends React.Component<{}, IFocusableComponentState> {\n public constructor(props) {\n super(props);\n this.state = {\n hasFocus: false,\n };\n }\n \n public render() {\n return (\n <ViewWin32 style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-around', marginVertical: 5 }}>\n <ViewWin32\n style={{\n backgroundColor: 'pink',\n height: 100,\n width: 100,\n }}\n enableFocusRing={true}\n focusable\n >\n <Text>enableFocusRing set to true</Text>\n </ViewWin32>\n <ViewWin32\n style={{\n backgroundColor: 'pink',\n height: 100,\n width: 100,\n }}\n enableFocusRing={false}\n focusable\n onFocus={this._onFocus}\n onBlur={this._onBlur}\n >\n <>\n <Text>enableFocusRing set to false</Text>\n <Text>{this.state.hasFocus ? 'Focus: Yes' : 'Focus: No'}</Text>\n </>\n </ViewWin32>\n </ViewWin32>\n );\n }\n\n private readonly _onFocus = () => {\n this.setState({\n hasFocus: true,\n });\n };\n\n private readonly _onBlur = () => {\n this.setState({\n hasFocus: false,\n });\n };\n}\n\n\nexport const title = 'ViewWin32';\nexport const displayName = 'ViewWin32 Example';\nexport const description = 'All the stock View props plus Win32 specific ones';\nexport const examples = [\n {\n title: 'focus() method example',\n description: 'Each of these black boxes moves focus to the ViewWin32 on the right',\n render(): JSX.Element {\n return (\n <ViewWin32>\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n <FocusMoverTestComponent />\n </ViewWin32>\n );\n },\n },\n {\n title: 'KeyboardEvents example',\n description: 'Native keyboarding has been prevented',\n render(): JSX.Element {\n return <KeyboardTestComponent />;\n },\n },\n {\n title: 'Hover example',\n description: 'Hover a rainbow',\n render(): JSX.Element {\n return <HoverExample />;\n },\n },\n {\n title: 'Tooltip example',\n description: 'Displays a tooltip on hover',\n render(): JSX.Element {\n return <ToolTipExample />;\n },\n },\n {\n title: 'Cursor example',\n description: 'Each of these boxes should display a different cursor',\n render(): JSX.Element {\n return <CursorExample />;\n },\n },\n {\n title: 'EnableFocusRing example',\n description: 'Displays focus visuals that are driven by native',\n render(): JSX.Element {\n return <EnableFocusRingExample />;\n },\n },\n];\n"]}
|
|
@@ -21,7 +21,7 @@ export type Props = ViewProps;
|
|
|
21
21
|
* supports layout with flexbox, style, some touch handling, and accessibility
|
|
22
22
|
* controls.
|
|
23
23
|
*
|
|
24
|
-
* @see https://reactnative.dev/docs/view
|
|
24
|
+
* @see https://reactnative.dev/docs/view
|
|
25
25
|
*/
|
|
26
26
|
const View: React.AbstractComponent<
|
|
27
27
|
ViewProps,
|
|
@@ -22,7 +22,7 @@ export type Props = ViewProps;
|
|
|
22
22
|
* supports layout with flexbox, style, some touch handling, and accessibility
|
|
23
23
|
* controls.
|
|
24
24
|
*
|
|
25
|
-
* @see https://reactnative.dev/docs/view
|
|
25
|
+
* @see https://reactnative.dev/docs/view
|
|
26
26
|
*/
|
|
27
27
|
const View: React.AbstractComponent<
|
|
28
28
|
ViewProps,
|
|
@@ -40,9 +40,6 @@ export declare type AccessibilityActionInfo = Readonly<{
|
|
|
40
40
|
name: AccessibilityActionName;
|
|
41
41
|
label?: string;
|
|
42
42
|
}>;
|
|
43
|
-
export declare type AccessibilityActionEvent = RN.NativeSyntheticEvent<Readonly<{
|
|
44
|
-
actionName: string;
|
|
45
|
-
}>>;
|
|
46
43
|
export declare type AccessibilityState = RN.AccessibilityState & {
|
|
47
44
|
multiselectable?: boolean;
|
|
48
45
|
required?: boolean;
|
|
@@ -85,9 +82,9 @@ export declare type BasePropsWin32 = {
|
|
|
85
82
|
*/
|
|
86
83
|
accessibilityControls?: React.RefObject<any>;
|
|
87
84
|
/**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
+
*/
|
|
91
88
|
accessibilityItemType?: string;
|
|
92
89
|
};
|
|
93
90
|
export declare type ViewWin32OmitTypes = RN.ViewPropsAndroid & RN.ViewPropsIOS & RN.AccessibilityPropsAndroid & Omit<RN.AccessibilityPropsIOS, SharedAccessibilityPropsIOSandWin32> & OmittedAccessibilityPropsWin32;
|
|
@@ -117,6 +114,7 @@ export interface IViewWin32Props extends Omit<RN.ViewProps, ViewWin32OmitTypes>,
|
|
|
117
114
|
accessibilitySetSize?: number;
|
|
118
115
|
animationClass?: string;
|
|
119
116
|
focusable?: boolean;
|
|
117
|
+
enableFocusRing?: boolean;
|
|
120
118
|
/**
|
|
121
119
|
* The onBlur event occurs when an element loses focus. The opposite of onBlur is onFocus. Note that in React
|
|
122
120
|
* Native, unlike in the web, the onBlur event bubbles (similar to onFocusOut in the web).
|
|
@@ -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
|
|
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 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"]}
|
|
@@ -35,17 +35,17 @@ exports.ViewWin32 = react_1.default.forwardRef((props, ref) => {
|
|
|
35
35
|
const { accessibilityLabeledBy, accessibilityDescribedBy, accessibilityControls, ...rest } = props;
|
|
36
36
|
react_1.default.useLayoutEffect(() => {
|
|
37
37
|
if (accessibilityLabeledBy !== undefined && accessibilityLabeledBy.current !== null) {
|
|
38
|
-
setLabeledByTarget(react_native_1.findNodeHandle(accessibilityLabeledBy.current));
|
|
38
|
+
setLabeledByTarget((0, react_native_1.findNodeHandle)(accessibilityLabeledBy.current));
|
|
39
39
|
}
|
|
40
40
|
}, [accessibilityLabeledBy]);
|
|
41
41
|
react_1.default.useLayoutEffect(() => {
|
|
42
42
|
if (accessibilityDescribedBy !== undefined && accessibilityDescribedBy.current !== null) {
|
|
43
|
-
setDescribedByTarget(react_native_1.findNodeHandle(accessibilityDescribedBy.current));
|
|
43
|
+
setDescribedByTarget((0, react_native_1.findNodeHandle)(accessibilityDescribedBy.current));
|
|
44
44
|
}
|
|
45
45
|
}, [accessibilityDescribedBy]);
|
|
46
46
|
react_1.default.useLayoutEffect(() => {
|
|
47
47
|
if (accessibilityControls !== undefined && accessibilityControls.current !== null) {
|
|
48
|
-
setControlsTarget(react_native_1.findNodeHandle(accessibilityControls.current));
|
|
48
|
+
setControlsTarget((0, react_native_1.findNodeHandle)(accessibilityControls.current));
|
|
49
49
|
}
|
|
50
50
|
}, [accessibilityControls]);
|
|
51
51
|
/**
|
|
@@ -61,11 +61,11 @@ exports.ViewWin32 = react_1.default.forwardRef((props, ref) => {
|
|
|
61
61
|
*/
|
|
62
62
|
if (localRef) {
|
|
63
63
|
localRef.focus = () => {
|
|
64
|
-
react_native_1.UIManager.dispatchViewManagerCommand(react_native_1.findNodeHandle(localRef), react_native_1.UIManager.getViewManagerConfig('RCTView').Commands.focus, null);
|
|
64
|
+
react_native_1.UIManager.dispatchViewManagerCommand((0, react_native_1.findNodeHandle)(localRef), react_native_1.UIManager.getViewManagerConfig('RCTView').Commands.focus, null);
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
});
|
|
69
|
-
return react_1.default.createElement(react_native_1.View,
|
|
69
|
+
return react_1.default.createElement(react_native_1.View, { ref: setNativeRef, ...rest, ...((controlsTarget !== null) ? { accessibilityControls: controlsTarget } : {}), ...((labeledByTarget !== null) ? { accessibilityLabeledBy: labeledByTarget } : {}), ...((describedByTarget !== null) ? { accessibilityDescribedBy: describedByTarget } : {}) });
|
|
70
70
|
});
|
|
71
71
|
//# sourceMappingURL=ViewWin32.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewWin32.js","sourceRoot":"","sources":["../../../src/Libraries/Components/View/ViewWin32.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;AAEH,kDAAyB;AAEzB,+CAA+D;AAE/D,MAAM,gBAAgB,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAgBxD,QAAA,SAAS,GAAG,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ourcesContent":["/**\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"]}
|
|
@@ -56,92 +56,57 @@ function reportException(
|
|
|
56
56
|
isFatal: boolean,
|
|
57
57
|
reportToConsole: boolean, // only true when coming from handleException; the error has not yet been logged
|
|
58
58
|
) {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
const namePrefix = e.name == null || e.name === '' ? '' : `${e.name}: `;
|
|
70
|
-
|
|
71
|
-
if (!message.startsWith(namePrefix)) {
|
|
72
|
-
message = namePrefix + message;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
message =
|
|
76
|
-
e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`;
|
|
59
|
+
const parseErrorStack = require('./Devtools/parseErrorStack');
|
|
60
|
+
const stack = parseErrorStack(e?.stack);
|
|
61
|
+
const currentExceptionID = ++exceptionID;
|
|
62
|
+
const originalMessage = e.message || '';
|
|
63
|
+
let message = originalMessage;
|
|
64
|
+
if (e.componentStack != null) {
|
|
65
|
+
message += `\n\nThis error is located at:${e.componentStack}`;
|
|
66
|
+
}
|
|
67
|
+
const namePrefix = e.name == null || e.name === '' ? '' : `${e.name}: `;
|
|
77
68
|
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
if (!message.startsWith(namePrefix)) {
|
|
70
|
+
message = namePrefix + message;
|
|
71
|
+
}
|
|
80
72
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
73
|
+
message =
|
|
74
|
+
e.jsEngine == null ? message : `${message}, js engine: ${e.jsEngine}`;
|
|
75
|
+
|
|
76
|
+
const data = preprocessException({
|
|
77
|
+
message,
|
|
78
|
+
originalMessage: message === originalMessage ? null : originalMessage,
|
|
79
|
+
name: e.name == null || e.name === '' ? null : e.name,
|
|
80
|
+
componentStack:
|
|
81
|
+
typeof e.componentStack === 'string' ? e.componentStack : null,
|
|
82
|
+
stack,
|
|
83
|
+
id: currentExceptionID,
|
|
84
|
+
isFatal,
|
|
85
|
+
extraData: {
|
|
86
|
+
jsEngine: e.jsEngine,
|
|
87
|
+
rawStack: e.stack,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
if (reportToConsole) {
|
|
92
|
+
// we feed back into console.error, to make sure any methods that are
|
|
93
|
+
// monkey patched on top of console.error are called when coming from
|
|
94
|
+
// handleException
|
|
95
|
+
console.error(data.message);
|
|
96
|
+
}
|
|
93
97
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
if (__DEV__) {
|
|
99
|
+
const LogBox = require('../LogBox/LogBox');
|
|
100
|
+
LogBox.addException({
|
|
101
|
+
...data,
|
|
102
|
+
isComponentError: !!e.isComponentError,
|
|
98
103
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// handleException
|
|
104
|
-
console.error(data.message);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (__DEV__ && isHandledByLogBox) {
|
|
108
|
-
const LogBox = require('../LogBox/LogBox');
|
|
109
|
-
LogBox.addException({
|
|
110
|
-
...data,
|
|
111
|
-
isComponentError: !!e.isComponentError,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
if (isFatal || e.type !== 'warn') {
|
|
104
|
+
} else if (isFatal || e.type !== 'warn') {
|
|
105
|
+
const NativeExceptionsManager = require('./NativeExceptionsManager')
|
|
106
|
+
.default;
|
|
107
|
+
if (NativeExceptionsManager) {
|
|
116
108
|
NativeExceptionsManager.reportException(data);
|
|
117
|
-
|
|
118
|
-
if (__DEV__ && !global.RN$Express) {
|
|
119
|
-
if (e.preventSymbolication === true) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const symbolicateStackTrace = require('./Devtools/symbolicateStackTrace');
|
|
123
|
-
symbolicateStackTrace(stack)
|
|
124
|
-
.then(({stack: prettyStack}) => {
|
|
125
|
-
if (prettyStack) {
|
|
126
|
-
NativeExceptionsManager.updateExceptionMessage(
|
|
127
|
-
data.message,
|
|
128
|
-
prettyStack,
|
|
129
|
-
currentExceptionID,
|
|
130
|
-
);
|
|
131
|
-
} else {
|
|
132
|
-
throw new Error('The stack is null');
|
|
133
|
-
}
|
|
134
|
-
})
|
|
135
|
-
.catch(error => {
|
|
136
|
-
console.log('Unable to symbolicate stack trace: ' + error.message);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
109
|
}
|
|
140
|
-
} else if (reportToConsole) {
|
|
141
|
-
// we feed back into console.error, to make sure any methods that are
|
|
142
|
-
// monkey patched on top of console.error are called when coming from
|
|
143
|
-
// handleException
|
|
144
|
-
console.error(e);
|
|
145
110
|
}
|
|
146
111
|
}
|
|
147
112
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
let registerModule;
|
|
14
|
-
if (global.RN$Bridgeless && global.RN$registerCallableModule) {
|
|
14
|
+
if (global.RN$Bridgeless === true && global.RN$registerCallableModule) {
|
|
15
15
|
registerModule = global.RN$registerCallableModule;
|
|
16
16
|
} else {
|
|
17
17
|
const BatchedBridge = require('../BatchedBridge/BatchedBridge');
|
|
@@ -14,15 +14,13 @@
|
|
|
14
14
|
* Sets up global variables for React Native.
|
|
15
15
|
* You can use this module directly, or just require InitializeCore.
|
|
16
16
|
*/
|
|
17
|
-
if (global.GLOBAL === undefined) {
|
|
18
|
-
global.GLOBAL = global;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
17
|
if (global.window === undefined) {
|
|
18
|
+
// $FlowFixMe[cannot-write]
|
|
22
19
|
global.window = global;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
if (global.self === undefined) {
|
|
23
|
+
// $FlowFixMe[cannot-write]
|
|
26
24
|
global.self = global;
|
|
27
25
|
}
|
|
28
26
|
|
|
@@ -28,7 +28,7 @@ const hasNativePromise = isNativeFunction(Promise);
|
|
|
28
28
|
const hasPromiseQueuedToJSVM = hasNativePromise || hasHermesPromiseQueuedToJSVM;
|
|
29
29
|
|
|
30
30
|
// In bridgeless mode, timers are host functions installed from cpp.
|
|
31
|
-
if (
|
|
31
|
+
if (global.RN$Bridgeless !== true) {
|
|
32
32
|
/**
|
|
33
33
|
* Set up timers.
|
|
34
34
|
* You can use this module directly, or just require InitializeCore.
|
|
@@ -65,7 +65,7 @@ if (hasPromiseQueuedToJSVM) {
|
|
|
65
65
|
// When promise was polyfilled hence is queued to the RN microtask queue,
|
|
66
66
|
// we polyfill the immediate APIs as aliases to the ReactNativeMicrotask APIs.
|
|
67
67
|
// Note that in bridgeless mode, immediate APIs are installed from cpp.
|
|
68
|
-
if (
|
|
68
|
+
if (global.RN$Bridgeless !== true) {
|
|
69
69
|
polyfillGlobal(
|
|
70
70
|
'setImmediate',
|
|
71
71
|
() => require('./Timers/JSTimers').queueReactNativeMicrotask,
|
|
@@ -12,6 +12,7 @@ import DeprecatedImagePropType from '../DeprecatedPropTypes/DeprecatedImagePropT
|
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
14
14
|
|
|
15
|
+
import ImageInjection from './ImageInjection';
|
|
15
16
|
import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
|
|
16
17
|
import flattenStyle from '../StyleSheet/flattenStyle';
|
|
17
18
|
import resolveAssetSource from './resolveAssetSource';
|
|
@@ -168,6 +169,11 @@ Image = React.forwardRef<
|
|
|
168
169
|
ImagePropsType,
|
|
169
170
|
React.ElementRef<typeof ImageViewNativeComponent>,
|
|
170
171
|
>(Image);
|
|
172
|
+
|
|
173
|
+
if (ImageInjection.unstable_createImageComponent != null) {
|
|
174
|
+
Image = ImageInjection.unstable_createImageComponent(Image);
|
|
175
|
+
}
|
|
176
|
+
|
|
171
177
|
Image.displayName = 'Image';
|
|
172
178
|
|
|
173
179
|
/**
|
|
@@ -12,6 +12,7 @@ import DeprecatedImagePropType from '../DeprecatedPropTypes/DeprecatedImagePropT
|
|
|
12
12
|
import * as React from 'react';
|
|
13
13
|
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
14
14
|
|
|
15
|
+
import ImageInjection from './ImageInjection';
|
|
15
16
|
import ImageAnalyticsTagContext from './ImageAnalyticsTagContext';
|
|
16
17
|
import flattenStyle from '../StyleSheet/flattenStyle';
|
|
17
18
|
import resolveAssetSource from './resolveAssetSource';
|
|
@@ -203,6 +204,11 @@ Image = React.forwardRef<
|
|
|
203
204
|
ImagePropsType,
|
|
204
205
|
React.ElementRef<typeof ImageViewNativeComponent>,
|
|
205
206
|
>(Image);
|
|
207
|
+
|
|
208
|
+
if (ImageInjection.unstable_createImageComponent != null) {
|
|
209
|
+
Image = ImageInjection.unstable_createImageComponent(Image);
|
|
210
|
+
}
|
|
211
|
+
|
|
206
212
|
Image.displayName = 'Image';
|
|
207
213
|
|
|
208
214
|
/**
|
|
@@ -10,10 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import Image from './Image';
|
|
14
|
+
import * as React from 'react';
|
|
15
|
+
import StyleSheet from '../StyleSheet/StyleSheet';
|
|
16
|
+
import flattenStyle from '../StyleSheet/flattenStyle';
|
|
17
|
+
import View from '../Components/View/View';
|
|
18
|
+
import type {ImageBackgroundProps} from './ImageProps';
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* Very simple drop-in replacement for <Image> which supports nesting views.
|
|
@@ -39,7 +41,7 @@ const View = require('../Components/View/View');
|
|
|
39
41
|
* AppRegistry.registerComponent('DisplayAnImageBackground', () => DisplayAnImageBackground);
|
|
40
42
|
* ```
|
|
41
43
|
*/
|
|
42
|
-
class ImageBackground extends React.Component
|
|
44
|
+
class ImageBackground extends React.Component<ImageBackgroundProps> {
|
|
43
45
|
setNativeProps(props: Object) {
|
|
44
46
|
// Work-around flow
|
|
45
47
|
const viewRef = this._viewRef;
|
|
@@ -56,7 +58,7 @@ class ImageBackground extends React.Component<$FlowFixMeProps> {
|
|
|
56
58
|
|
|
57
59
|
render(): React.Node {
|
|
58
60
|
const {children, style, imageStyle, imageRef, ...props} = this.props;
|
|
59
|
-
|
|
61
|
+
const flattenedStyle = flattenStyle(style);
|
|
60
62
|
return (
|
|
61
63
|
<View
|
|
62
64
|
accessibilityIgnoresInvertColors={true}
|
|
@@ -74,8 +76,8 @@ class ImageBackground extends React.Component<$FlowFixMeProps> {
|
|
|
74
76
|
// So, we have to proxy/reapply these styles explicitly for actual <Image> component.
|
|
75
77
|
// This workaround should be removed after implementing proper support of
|
|
76
78
|
// intrinsic content size of the <Image>.
|
|
77
|
-
width:
|
|
78
|
-
height:
|
|
79
|
+
width: flattenedStyle?.width,
|
|
80
|
+
height: flattenedStyle?.height,
|
|
79
81
|
},
|
|
80
82
|
imageStyle,
|
|
81
83
|
]}
|
|
@@ -15,6 +15,8 @@ import type {EdgeInsetsProp} from '../StyleSheet/EdgeInsetsPropType';
|
|
|
15
15
|
import type {ImageSource} from './ImageSource';
|
|
16
16
|
import type {ViewStyleProp, ImageStyleProp} from '../StyleSheet/StyleSheet';
|
|
17
17
|
import type {ViewProps} from '../Components/View/ViewPropTypes';
|
|
18
|
+
import type {Node, Ref} from 'react';
|
|
19
|
+
import typeof Image from './Image';
|
|
18
20
|
|
|
19
21
|
export type ImageLoadEvent = SyntheticEvent<
|
|
20
22
|
$ReadOnly<{|
|
|
@@ -171,3 +173,29 @@ export type ImageProps = {|
|
|
|
171
173
|
src?: empty,
|
|
172
174
|
children?: empty,
|
|
173
175
|
|};
|
|
176
|
+
|
|
177
|
+
export type ImageBackgroundProps = $ReadOnly<{|
|
|
178
|
+
...ImageProps,
|
|
179
|
+
children?: Node,
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Style applied to the outer View component
|
|
183
|
+
*
|
|
184
|
+
* See https://reactnative.dev/docs/imagebackground#style
|
|
185
|
+
*/
|
|
186
|
+
style?: ?ViewStyleProp,
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Style applied to the inner Image component
|
|
190
|
+
*
|
|
191
|
+
* See https://reactnative.dev/docs/imagebackground#imagestyle
|
|
192
|
+
*/
|
|
193
|
+
imageStyle?: ?ImageStyleProp,
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Allows to set a reference to the inner Image component
|
|
197
|
+
*
|
|
198
|
+
* See https://reactnative.dev/docs/imagebackground#imageref
|
|
199
|
+
*/
|
|
200
|
+
imageRef?: Ref<Image>,
|
|
201
|
+
|}>;
|