Delete Litho timeMachine
Summary: This plugin is rarely used and would need to be re-worked to work in a world where ComponentTree is not the only way of rendering a Litho hierarchy. Deleting for now for simplicity Reviewed By: adityasharat, passy Differential Revision: D42573698 fbshipit-source-id: 0d9cd713b668e6fc79cd5cddcdcb9f24ed98f927
This commit is contained in:
committed by
Facebook GitHub Bot
parent
92ac6988d5
commit
b31f8c8755
@@ -15,7 +15,6 @@ import {SketchPicker, CompactPicker} from 'react-color';
|
||||
import React, {KeyboardEvent} from 'react';
|
||||
import {HighlightContext} from '../Highlight';
|
||||
import {parseColor} from '../../utils/parseColor';
|
||||
import {TimelineDataDescription} from './TimelineDataDescription';
|
||||
import {theme} from '../theme';
|
||||
import {EditOutlined} from '@ant-design/icons';
|
||||
// This import is OK since it is a type-only import
|
||||
@@ -552,25 +551,6 @@ class DataDescriptionContainer extends PureComponent<{
|
||||
const highlighter = this.context;
|
||||
|
||||
switch (type) {
|
||||
case 'timeline': {
|
||||
return (
|
||||
<>
|
||||
<TimelineDataDescription
|
||||
canSetCurrent={editable}
|
||||
timeline={JSON.parse(val)}
|
||||
onClick={(id) => {
|
||||
this.props.commit({
|
||||
value: id,
|
||||
keep: true,
|
||||
clear: false,
|
||||
set: true,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
case 'number':
|
||||
return <NumberValue>{+val}</NumberValue>;
|
||||
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {Component, ReactNode} from 'react';
|
||||
import React from 'react';
|
||||
import {MarkerTimeline} from '../MarkerTimeline';
|
||||
import {Button} from 'antd';
|
||||
import {presetColors} from './DataDescription';
|
||||
import {DataInspector} from './DataInspector';
|
||||
|
||||
type TimePoint = {
|
||||
moment: number;
|
||||
display: string;
|
||||
color: string;
|
||||
key: string;
|
||||
properties: {[key: string]: string};
|
||||
};
|
||||
|
||||
type Timeline = {
|
||||
time: TimePoint[];
|
||||
current: string;
|
||||
};
|
||||
|
||||
type Props = {
|
||||
canSetCurrent?: boolean;
|
||||
timeline: Timeline;
|
||||
onClick: (selected: string) => void;
|
||||
};
|
||||
|
||||
type State = {
|
||||
selected: string;
|
||||
};
|
||||
|
||||
export class TimelineDataDescription extends Component<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
this.state = {selected: props.timeline.current};
|
||||
}
|
||||
|
||||
render(): ReactNode {
|
||||
const moments = Object.values(this.props.timeline.time);
|
||||
const firstMoment = moments[0].moment;
|
||||
const points = moments.map((value) => ({
|
||||
label: value.display,
|
||||
time: value.moment - firstMoment,
|
||||
color:
|
||||
Object.entries(presetColors).find(([k, _]) => k === value.color)?.[1] ??
|
||||
value.color,
|
||||
key: value.key,
|
||||
}));
|
||||
return (
|
||||
<>
|
||||
{this.props.canSetCurrent && (
|
||||
<div>
|
||||
<Button
|
||||
onClick={() => this.props.onClick(this.state.selected)}
|
||||
disabled={this.state.selected === this.props.timeline.current}>
|
||||
Set as current
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<MarkerTimeline
|
||||
points={points}
|
||||
onClick={(ids) => this.setState({selected: ids[0]})}
|
||||
maxGap={50}
|
||||
selected={this.state.selected}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<DataInspector
|
||||
data={
|
||||
this.props.timeline.time.find(
|
||||
(value) => value.key === this.state.selected,
|
||||
)?.properties ?? {}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user