chore: 优化部分注释, 依赖引入

This commit is contained in:
lihao.ylh 2021-07-05 09:33:27 +08:00
parent 511b00f8f0
commit cfde6e49b9
2 changed files with 8 additions and 14 deletions

View File

@ -1,3 +1,5 @@
import { ReactElement } from 'react';
import { EventEmitter } from 'events';
import { obx, computed, autorun } from '@ali/lowcode-editor-core'; import { obx, computed, autorun } from '@ali/lowcode-editor-core';
import { import {
isDOMText, isDOMText,
@ -13,6 +15,7 @@ import {
NodeStatus, NodeStatus,
} from '@ali/lowcode-types'; } from '@ali/lowcode-types';
import { compatStage } from '@ali/lowcode-utils'; import { compatStage } from '@ali/lowcode-utils';
import { SettingTopEntry } from '@ali/lowcode-designer';
import { Props, getConvertedExtraKey } from './props/props'; import { Props, getConvertedExtraKey } from './props/props';
import { DocumentModel } from '../document-model'; import { DocumentModel } from '../document-model';
import { NodeChildren } from './node-children'; import { NodeChildren } from './node-children';
@ -20,9 +23,6 @@ import { Prop } from './props/prop';
import { ComponentMeta } from '../../component-meta'; import { ComponentMeta } from '../../component-meta';
import { ExclusiveGroup, isExclusiveGroup } from './exclusive-group'; import { ExclusiveGroup, isExclusiveGroup } from './exclusive-group';
import { TransformStage } from './transform-stage'; import { TransformStage } from './transform-stage';
import { ReactElement } from 'react';
import { SettingTopEntry } from 'designer/src/designer';
import { EventEmitter } from 'events';
import { includeSlot, removeSlot } from '../../utils/slot'; import { includeSlot, removeSlot } from '../../utils/slot';
import { foreachReverse } from '../../utils/tree'; import { foreachReverse } from '../../utils/tree';
import { NodeRemoveOptions } from '../../types'; import { NodeRemoveOptions } from '../../types';
@ -43,7 +43,7 @@ import { NodeRemoveOptions } from '../../types';
* conditionGroup use for condition, for exclusive * conditionGroup use for condition, for exclusive
* title display on outline * title display on outline
* ignored ignore this node will not publish to render, but will store * ignored ignore this node will not publish to render, but will store
* locked can not select/hover/ item on canvas but can control on outline * isLocked can not select/hover/ item on canvas but can control on outline
* hidden not visible on canvas * hidden not visible on canvas
* slotArgs like loopArgs, for slot node * slotArgs like loopArgs, for slot node
* *
@ -71,8 +71,8 @@ import { NodeRemoveOptions } from '../../types';
* ------- future support ----- * ------- future support -----
* conditionGroup * conditionGroup
* title * title
* ignore * ignored
* locked * isLocked
* hidden * hidden
*/ */
export class Node<Schema extends NodeSchema = NodeSchema> { export class Node<Schema extends NodeSchema = NodeSchema> {
@ -638,7 +638,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
const { componentName, id, children, props, ...extras } = data; const { componentName, id, children, props, ...extras } = data;
if (this.isSlot()) { if (this.isSlot()) {
foreachReverse( foreachReverse(
this.children, this.children!,
(subNode: Node) => { (subNode: Node) => {
subNode.remove(true, true); subNode.remove(true, true);
}, },
@ -952,8 +952,6 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
return { isContainerNode, isEmptyNode, isRGLContainerNode, isRGLNode, isRGL, rglNode }; return { isContainerNode, isEmptyNode, isRGLContainerNode, isRGLNode, isRGL, rglNode };
} }
/**
/** /**
* @deprecated * @deprecated
*/ */
@ -1024,10 +1022,6 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
* @deprecated * @deprecated
*/ */
registerAddon(key: string, exportData: () => any, isProp = false) { registerAddon(key: string, exportData: () => any, isProp = false) {
// if (this._addons[key]) {
// throw new Error(`node addon ${key} exist`);
// }
this._addons[key] = { exportData, isProp }; this._addons[key] = { exportData, isProp };
} }