- 添加 Babel 配置文件支持 ES6+ 语法转换 - 添加 ESLint 忽略规则和配置文件 - 添加 Git 忽略规则文件 - 添加 Travis CI 配置文件 - 添加 1.4.2 版本变更日志文件 - 添加 Helm 图表辅助模板文件 - 添加 Helm 忽略规则文件
39 lines
816 B
JavaScript
39 lines
816 B
JavaScript
import Editor from '@components/Base/Editor';
|
|
import {
|
|
FLOW_CONTAINER,
|
|
FLOW_CLASS_NAME,
|
|
EVENT_BEFORE_ADD_PAGE,
|
|
EVENT_AFTER_ADD_PAGE,
|
|
} from '@common/constants';
|
|
import Page from '@components/Page';
|
|
import withGGEditorContext from '@common/context/GGEditorContext/withGGEditorContext';
|
|
|
|
class Flow extends Page {
|
|
static defaultProps = {
|
|
data: {
|
|
nodes: [],
|
|
edges: [],
|
|
},
|
|
};
|
|
|
|
get pageId() {
|
|
const { editor } = this.props;
|
|
|
|
return `${FLOW_CONTAINER}_${editor.id}`;
|
|
}
|
|
|
|
initPage() {
|
|
const { editor } = this.props;
|
|
|
|
editor.emit(EVENT_BEFORE_ADD_PAGE, { className: FLOW_CLASS_NAME });
|
|
|
|
this.page = new Editor.Flow(this.config);
|
|
|
|
editor.add(this.page);
|
|
|
|
editor.emit(EVENT_AFTER_ADD_PAGE, { page: this.page });
|
|
}
|
|
}
|
|
|
|
export default withGGEditorContext(Flow);
|