Accessibility Inspector open-sourcing move and documentation
Summary: Replaces AXElementsInpector with normal inspector implementation, removes gating from external builds. Adds documentation to https://fbflipper.com/docs/layout-plugin.html. Reviewed By: passy Differential Revision: D9438713 fbshipit-source-id: 18616c6cbab339bf474d116cac128e1d4a5fc2be
This commit is contained in:
committed by
Facebook Github Bot
parent
9095b3a030
commit
7852a3886b
@@ -8,6 +8,7 @@
|
||||
import {Component} from 'react';
|
||||
import FlexRow from '../FlexRow.js';
|
||||
import {Elements} from './elements.js';
|
||||
import type {ContextMenuExtension} from 'sonar';
|
||||
|
||||
export type ElementID = string;
|
||||
|
||||
@@ -57,11 +58,13 @@ export default class ElementsInspector extends Component<{
|
||||
onElementHovered: ?(key: ?ElementID) => void,
|
||||
onValueChanged: ?(path: Array<string>, val: any) => void,
|
||||
selected: ?ElementID,
|
||||
focused?: ?ElementID,
|
||||
searchResults?: ?ElementSearchResultSet,
|
||||
root: ?ElementID,
|
||||
elements: {[key: ElementID]: Element},
|
||||
useAppSidebar?: boolean,
|
||||
alternateRowColor?: boolean,
|
||||
contextMenuExtensions?: Array<ContextMenuExtension>,
|
||||
}> {
|
||||
static defaultProps = {
|
||||
alternateRowColor: true,
|
||||
@@ -69,6 +72,7 @@ export default class ElementsInspector extends Component<{
|
||||
render() {
|
||||
const {
|
||||
selected,
|
||||
focused,
|
||||
elements,
|
||||
root,
|
||||
onElementExpanded,
|
||||
@@ -76,6 +80,7 @@ export default class ElementsInspector extends Component<{
|
||||
onElementHovered,
|
||||
searchResults,
|
||||
alternateRowColor,
|
||||
contextMenuExtensions,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
@@ -85,10 +90,12 @@ export default class ElementsInspector extends Component<{
|
||||
onElementSelected={onElementSelected}
|
||||
onElementHovered={onElementHovered}
|
||||
selected={selected}
|
||||
focused={focused}
|
||||
searchResults={searchResults}
|
||||
root={root}
|
||||
elements={elements}
|
||||
alternateRowColor={alternateRowColor}
|
||||
contextMenuExtensions={contextMenuExtensions}
|
||||
/>
|
||||
</FlexRow>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user