/** * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @flow * @format */ import React, {Component} from 'react'; import {Row, Col, Button, Tabs} from 'antd'; import EditValue from './EditValue'; import type {LayoutRecordT} from './LayoutRecord'; import type {Yoga$Direction} from 'yoga-layout'; import InfoText from './InfoText'; import './Editor.css'; const TabPane = Tabs.TabPane; type Props = { node: ?LayoutRecordT, onChangeLayout: (key: string, value: any) => void, onChangeSetting: (key: string, value: any) => void, direction: Yoga$Direction, selectedNodeIsRoot: boolean, onRemove?: () => void, onAdd?: () => void, }; export default class Editor extends Component { componentDidMount() { document.addEventListener('keydown', this.onKeyDown); } componentWillUnmount() { document.removeEventListener('keydown', this.onKeyDown); } onKeyDown = (e: KeyboardEvent) => { if ( (e.key === 'Delete' || e.key === 'Backspace') && this.props.onRemove && !(e.target instanceof HTMLInputElement) ) { this.props.onRemove(); } }; render() { const {node, selectedNodeIsRoot} = this.props; const disabled = !Boolean(node); return (

Direction Defines the direction of which text and items are laid out

Flex Direction Defines the direction of the main-axis

Basis Default size of a node along the main axis

Grow The factor of remaining space should be given to this node

Shrink The shrink factor of this element if parent has no space left

Flex Wrap Wrapping behaviour when child nodes don't fit into a single line

Justify Content Aligns child nodes along the main-axis

Align Items Aligns child nodes along the cross-axis

Align Self Override align items of parent

Align Content Alignment of lines along the cross-axis when wrapping

Width × Height Dimensions of the node

Aspect Ratio Width/Height aspect ratio of node

{['padding', 'border', 'margin'].map(property => ( ))}

Position Type Relative position offsets the node from it's calculated position. Absolute position removes the node from the flexbox flow and positions it at the given position.

); } }