mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:52:51 +00:00
feat: get editor from this or params
This commit is contained in:
parent
9fd28efd0e
commit
70120a033a
@ -1,10 +1,10 @@
|
|||||||
import React, { Component, Fragment } from 'react';
|
import React, { Component, Fragment } from 'react';
|
||||||
import DragResizeEngine from './drag-resize-engine';
|
import DragResizeEngine from './drag-resize-engine';
|
||||||
import { observer, computed, globalContext } from '@alilc/lowcode-editor-core';
|
import { observer, computed } from '@alilc/lowcode-editor-core';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { SimulatorContext } from '../context';
|
import { SimulatorContext } from '../context';
|
||||||
import { BuiltinSimulatorHost } from '../host';
|
import { BuiltinSimulatorHost } from '../host';
|
||||||
import { OffsetObserver, Designer } from '../../designer';
|
import { OffsetObserver, Designer, INode } from '../../designer';
|
||||||
import { Node } from '../../document';
|
import { Node } from '../../document';
|
||||||
import { normalizeTriggers } from '../../utils/misc';
|
import { normalizeTriggers } from '../../utils/misc';
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ export class BoxResizingInstance extends Component<{
|
|||||||
// this.hoveringCapture.setBoundary(this.outline);
|
// this.hoveringCapture.setBoundary(this.outline);
|
||||||
this.willBind();
|
this.willBind();
|
||||||
|
|
||||||
const resize = (e: MouseEvent, direction: string, node: any, moveX: number, moveY: number) => {
|
const resize = (e: MouseEvent, direction: string, node: INode, moveX: number, moveY: number) => {
|
||||||
const { advanced } = node.componentMeta;
|
const { advanced } = node.componentMeta;
|
||||||
if (
|
if (
|
||||||
advanced.callbacks &&
|
advanced.callbacks &&
|
||||||
@ -149,7 +149,7 @@ export class BoxResizingInstance extends Component<{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const resizeStart = (e: MouseEvent, direction: string, node: any) => {
|
const resizeStart = (e: MouseEvent, direction: string, node: INode) => {
|
||||||
const { advanced } = node.componentMeta;
|
const { advanced } = node.componentMeta;
|
||||||
if (
|
if (
|
||||||
advanced.callbacks &&
|
advanced.callbacks &&
|
||||||
@ -161,7 +161,7 @@ export class BoxResizingInstance extends Component<{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const resizeEnd = (e: MouseEvent, direction: string, node: any) => {
|
const resizeEnd = (e: MouseEvent, direction: string, node: INode) => {
|
||||||
const { advanced } = node.componentMeta;
|
const { advanced } = node.componentMeta;
|
||||||
if (
|
if (
|
||||||
advanced.callbacks &&
|
advanced.callbacks &&
|
||||||
@ -172,8 +172,7 @@ export class BoxResizingInstance extends Component<{
|
|||||||
advanced.callbacks.onResizeEnd(e, cbNode);
|
advanced.callbacks.onResizeEnd(e, cbNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = node.document?.designer.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
const npm = node?.componentMeta?.npm;
|
const npm = node?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
ComponentType,
|
ComponentType,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { observer, computed, Tip, globalContext } from '@alilc/lowcode-editor-core';
|
import { observer, computed, Tip } from '@alilc/lowcode-editor-core';
|
||||||
import { createIcon, isReactComponent, isActionContentObject } from '@alilc/lowcode-utils';
|
import { createIcon, isReactComponent, isActionContentObject } from '@alilc/lowcode-utils';
|
||||||
import { IPublicTypeActionContentObject } from '@alilc/lowcode-types';
|
import { IPublicTypeActionContentObject } from '@alilc/lowcode-types';
|
||||||
import { BuiltinSimulatorHost } from '../host';
|
import { BuiltinSimulatorHost } from '../host';
|
||||||
@ -131,8 +131,7 @@ function createAction(content: ReactNode | ComponentType<any> | IPublicTypeActio
|
|||||||
className="lc-borders-action"
|
className="lc-borders-action"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
action && action(node.internalToShellNode()!);
|
action && action(node.internalToShellNode()!);
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = node.document?.designer.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
const npm = node?.componentMeta?.npm;
|
const npm = node?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { obx, globalContext } from '@alilc/lowcode-editor-core';
|
import { obx } from '@alilc/lowcode-editor-core';
|
||||||
import { IPublicTypePluginConfig, IPublicTypeLiveTextEditingConfig } from '@alilc/lowcode-types';
|
import { IPublicTypePluginConfig, IPublicTypeLiveTextEditingConfig } from '@alilc/lowcode-types';
|
||||||
import { Node, Prop } from '../../document';
|
import { INode, Prop } from '../../document';
|
||||||
|
|
||||||
const EDITOR_KEY = 'data-setter-prop';
|
const EDITOR_KEY = 'data-setter-prop';
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ function defaultSaveContent(content: string, prop: Prop) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface EditingTarget {
|
export interface EditingTarget {
|
||||||
node: Node;
|
node: INode;
|
||||||
rootElement: HTMLElement;
|
rootElement: HTMLElement;
|
||||||
event: MouseEvent;
|
event: MouseEvent;
|
||||||
}
|
}
|
||||||
@ -47,13 +47,16 @@ export class LiveEditing {
|
|||||||
|
|
||||||
@obx.ref private _editing: Prop | null = null;
|
@obx.ref private _editing: Prop | null = null;
|
||||||
|
|
||||||
|
private _dispose?: () => void;
|
||||||
|
|
||||||
|
private _save?: () => void;
|
||||||
|
|
||||||
apply(target: EditingTarget) {
|
apply(target: EditingTarget) {
|
||||||
const { node, event, rootElement } = target;
|
const { node, event, rootElement } = target;
|
||||||
const targetElement = event.target as HTMLElement;
|
const targetElement = event.target as HTMLElement;
|
||||||
const { liveTextEditing } = node.componentMeta;
|
const { liveTextEditing } = node.componentMeta;
|
||||||
|
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = node.document?.designer.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
const npm = node?.componentMeta?.npm;
|
const npm = node?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || node?.componentMeta?.componentName || '';
|
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') || node?.componentMeta?.componentName || '';
|
||||||
@ -166,10 +169,6 @@ export class LiveEditing {
|
|||||||
return this._editing;
|
return this._editing;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _dispose?: () => void;
|
|
||||||
|
|
||||||
private _save?: () => void;
|
|
||||||
|
|
||||||
saveAndDispose() {
|
saveAndDispose() {
|
||||||
if (this._save) {
|
if (this._save) {
|
||||||
this._save();
|
this._save();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { Overlay } from '@alifd/next';
|
import { Overlay } from '@alifd/next';
|
||||||
import React, { MouseEvent } from 'react';
|
import React, { MouseEvent } from 'react';
|
||||||
import { Title, globalContext } from '@alilc/lowcode-editor-core';
|
import { Title } from '@alilc/lowcode-editor-core';
|
||||||
import { canClickNode } from '@alilc/lowcode-utils';
|
import { canClickNode } from '@alilc/lowcode-utils';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
@ -66,8 +66,7 @@ export default class InstanceNodeSelector extends React.Component<IProps, IState
|
|||||||
|
|
||||||
if (canClick && typeof node.select === 'function') {
|
if (canClick && typeof node.select === 'function') {
|
||||||
node.select();
|
node.select();
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = node.document?.designer.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
const npm = node?.componentMeta?.npm;
|
const npm = node?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
[npm?.package, npm?.componentName].filter((item) => !!item).join('-') ||
|
||||||
|
|||||||
@ -60,6 +60,8 @@ export function buildFilter(rule?: string | string[] | RegExp | IPublicTypeNesti
|
|||||||
export interface IComponentMeta extends IPublicModelComponentMeta<INode> {
|
export interface IComponentMeta extends IPublicModelComponentMeta<INode> {
|
||||||
prototype?: any;
|
prototype?: any;
|
||||||
|
|
||||||
|
liveTextEditing?: IPublicTypeLiveTextEditingConfig[];
|
||||||
|
|
||||||
get rootSelector(): string | undefined;
|
get rootSelector(): string | undefined;
|
||||||
|
|
||||||
setMetadata(metadata: IPublicTypeComponentMetadata): void;
|
setMetadata(metadata: IPublicTypeComponentMetadata): void;
|
||||||
|
|||||||
@ -148,6 +148,10 @@ export interface IDocumentModel extends Omit<IPublicModelDocumentModel<
|
|||||||
suspense(): void;
|
suspense(): void;
|
||||||
|
|
||||||
close(): void;
|
close(): void;
|
||||||
|
|
||||||
|
unlinkNode(node: INode): void;
|
||||||
|
|
||||||
|
destroyNode(node: INode): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DocumentModel implements IDocumentModel {
|
export class DocumentModel implements IDocumentModel {
|
||||||
@ -333,6 +337,7 @@ export class DocumentModel implements IDocumentModel {
|
|||||||
this.import(schema as IPublicTypeRootSchema, true);
|
this.import(schema as IPublicTypeRootSchema, true);
|
||||||
this.simulator?.rerender();
|
this.simulator?.rerender();
|
||||||
},
|
},
|
||||||
|
this,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.setupListenActiveNodes();
|
this.setupListenActiveNodes();
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { reaction, untracked, globalContext, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
|
import { reaction, untracked, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
|
||||||
import { IPublicTypeNodeSchema, IPublicModelHistory, IPublicTypeDisposable } from '@alilc/lowcode-types';
|
import { IPublicTypeNodeSchema, IPublicModelHistory, IPublicTypeDisposable } from '@alilc/lowcode-types';
|
||||||
import { Logger } from '@alilc/lowcode-utils';
|
import { Logger } from '@alilc/lowcode-utils';
|
||||||
|
import { IDocumentModel } from '../designer';
|
||||||
|
|
||||||
const logger = new Logger({ level: 'warn', bizName: 'history' });
|
const logger = new Logger({ level: 'warn', bizName: 'history' });
|
||||||
|
|
||||||
@ -37,10 +38,12 @@ export class History<T = IPublicTypeNodeSchema> implements IHistory {
|
|||||||
return this.session.data;
|
return this.session.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private timeGap: number = 1000;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
dataFn: () => T | null,
|
dataFn: () => T | null,
|
||||||
private redoer: (data: T) => void,
|
private redoer: (data: T) => void,
|
||||||
private timeGap: number = 1000,
|
private document?: IDocumentModel,
|
||||||
) {
|
) {
|
||||||
this.session = new Session(0, null, this.timeGap);
|
this.session = new Session(0, null, this.timeGap);
|
||||||
this.records = [this.session];
|
this.records = [this.session];
|
||||||
@ -130,8 +133,7 @@ export class History<T = IPublicTypeNodeSchema> implements IHistory {
|
|||||||
}
|
}
|
||||||
const cursor = this.session.cursor - 1;
|
const cursor = this.session.cursor - 1;
|
||||||
this.go(cursor);
|
this.go(cursor);
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = this.document?.designer.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -144,8 +146,7 @@ export class History<T = IPublicTypeNodeSchema> implements IHistory {
|
|||||||
}
|
}
|
||||||
const cursor = this.session.cursor + 1;
|
const cursor = this.session.cursor + 1;
|
||||||
this.go(cursor);
|
this.go(cursor);
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = this.document?.designer.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { obx, computed, globalContext, makeObservable, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
|
import { obx, computed, makeObservable, IEventBus, createModuleEventBus } from '@alilc/lowcode-editor-core';
|
||||||
import { Node, INode } from './node';
|
import { Node, INode } from './node';
|
||||||
import { IPublicTypeNodeData, IPublicModelNodeChildren, IPublicEnumTransformStage, IPublicTypeDisposable } from '@alilc/lowcode-types';
|
import { IPublicTypeNodeData, IPublicModelNodeChildren, IPublicEnumTransformStage, IPublicTypeDisposable } from '@alilc/lowcode-types';
|
||||||
import { shallowEqual, compatStage, isNodeSchema } from '@alilc/lowcode-utils';
|
import { shallowEqual, compatStage, isNodeSchema } from '@alilc/lowcode-utils';
|
||||||
@ -16,12 +16,12 @@ export interface INodeChildren extends Omit<IPublicModelNodeChildren<INode>,
|
|||||||
'isEmpty' |
|
'isEmpty' |
|
||||||
'notEmpty'
|
'notEmpty'
|
||||||
> {
|
> {
|
||||||
|
children: INode[];
|
||||||
|
|
||||||
get owner(): INode;
|
get owner(): INode;
|
||||||
|
|
||||||
get length(): number;
|
get length(): number;
|
||||||
|
|
||||||
children: INode[];
|
|
||||||
|
|
||||||
unlinkChild(node: INode): void;
|
unlinkChild(node: INode): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -239,11 +239,8 @@ export class NodeChildren implements INodeChildren {
|
|||||||
}
|
}
|
||||||
const { document } = node;
|
const { document } = node;
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
if (globalContext.has('editor')) {
|
const editor = node.document?.designer.editor;
|
||||||
const workspace = globalContext.get('workspace');
|
editor?.eventBus.emit('node.remove', { node, index: i });
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
editor.eventBus.emit('node.remove', { node, index: i });
|
|
||||||
}
|
|
||||||
document?.unlinkNode(node);
|
document?.unlinkNode(node);
|
||||||
document?.selection.remove(node.id);
|
document?.selection.remove(node.id);
|
||||||
document?.destroyNode(node);
|
document?.destroyNode(node);
|
||||||
@ -281,15 +278,12 @@ export class NodeChildren implements INodeChildren {
|
|||||||
const i = children.map(d => d.id).indexOf(node.id);
|
const i = children.map(d => d.id).indexOf(node.id);
|
||||||
|
|
||||||
if (node.parent) {
|
if (node.parent) {
|
||||||
if (globalContext.has('editor')) {
|
const editor = node.document?.designer.editor;
|
||||||
const workspace = globalContext.get('workspace');
|
editor?.eventBus.emit('node.remove.topLevel', {
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
editor.eventBus.emit('node.remove.topLevel', {
|
|
||||||
node,
|
node,
|
||||||
index: node.index,
|
index: node.index,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
if (index < children.length) {
|
if (index < children.length) {
|
||||||
@ -317,11 +311,8 @@ export class NodeChildren implements INodeChildren {
|
|||||||
});
|
});
|
||||||
this.emitter.emit('insert', node);
|
this.emitter.emit('insert', node);
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
if (globalContext.has('editor')) {
|
const editor = node.document?.designer.editor;
|
||||||
const workspace = globalContext.get('workspace');
|
editor?.eventBus.emit('node.add', { node });
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
editor.eventBus.emit('node.add', { node });
|
|
||||||
}
|
|
||||||
if (useMutator) {
|
if (useMutator) {
|
||||||
this.reportModified(node, this.owner, { type: 'insert' });
|
this.reportModified(node, this.owner, { type: 'insert' });
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,8 +53,7 @@ export class SettingsPrimaryPane extends Component<ISettingsPrimaryPaneProps, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderBreadcrumb() {
|
renderBreadcrumb() {
|
||||||
const { settings } = this.main;
|
const { settings, editor } = this.main;
|
||||||
const { config } = this.props;
|
|
||||||
// const shouldIgnoreRoot = config.props?.ignoreRoot;
|
// const shouldIgnoreRoot = config.props?.ignoreRoot;
|
||||||
const { shouldIgnoreRoot } = this.state;
|
const { shouldIgnoreRoot } = this.state;
|
||||||
if (!settings) {
|
if (!settings) {
|
||||||
@ -73,8 +72,6 @@ export class SettingsPrimaryPane extends Component<ISettingsPrimaryPaneProps, {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const workspace = globalContext.get('workspace');
|
|
||||||
const editor = this.props.engineEditor;
|
|
||||||
const designer = editor.get('designer');
|
const designer = editor.get('designer');
|
||||||
const current = designer?.currentSelection?.getNodes()?.[0];
|
const current = designer?.currentSelection?.getNodes()?.[0];
|
||||||
let node: INode | null = settings.first;
|
let node: INode | null = settings.first;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { Component, ReactElement } from 'react';
|
import { Component, ReactElement } from 'react';
|
||||||
import { Icon } from '@alifd/next';
|
import { Icon } from '@alifd/next';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Title, observer, Tip, globalContext } from '@alilc/lowcode-editor-core';
|
import { Title, observer, Tip } from '@alilc/lowcode-editor-core';
|
||||||
import { DockProps } from '../../types';
|
import { DockProps } from '../../types';
|
||||||
import { PanelDock } from '../../widget/panel-dock';
|
import { PanelDock } from '../../widget/panel-dock';
|
||||||
import { composeTitle } from '../../widget/utils';
|
import { composeTitle } from '../../widget/utils';
|
||||||
@ -116,14 +116,12 @@ export class DraggableLineView extends Component<{ panel: Panel }> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 抛出事件,对于有些需要 panel 插件随着 度变化进行再次渲染的,由panel插件内部监听事件实现
|
// 抛出事件,对于有些需要 panel 插件随着 度变化进行再次渲染的,由panel插件内部监听事件实现
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = this.props.panel.skeleton.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
editor?.eventBus.emit('dockpane.drag', width);
|
editor?.eventBus.emit('dockpane.drag', width);
|
||||||
}
|
}
|
||||||
|
|
||||||
onDragChange(type: 'start' | 'end') {
|
onDragChange(type: 'start' | 'end') {
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = this.props.panel.skeleton.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
editor?.eventBus.emit('dockpane.dragchange', type);
|
editor?.eventBus.emit('dockpane.dragchange', type);
|
||||||
// builtinSimulator 屏蔽掉 鼠标事件
|
// builtinSimulator 屏蔽掉 鼠标事件
|
||||||
editor?.eventBus.emit('designer.builtinSimulator.disabledEvents', type === 'start');
|
editor?.eventBus.emit('designer.builtinSimulator.disabledEvents', type === 'start');
|
||||||
@ -187,8 +185,7 @@ export class TitledPanelView extends Component<{ panel: Panel; area?: string }>
|
|||||||
if (!panel.inited) {
|
if (!panel.inited) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = panel.skeleton.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
const panelName = area ? `${area}-${panel.name}` : panel.name;
|
const panelName = area ? `${area}-${panel.name}` : panel.name;
|
||||||
editor?.eventBus.emit('skeleton.panel.toggle', {
|
editor?.eventBus.emit('skeleton.panel.toggle', {
|
||||||
name: panelName || '',
|
name: panelName || '',
|
||||||
@ -250,8 +247,7 @@ export class PanelView extends Component<{
|
|||||||
if (!panel.inited) {
|
if (!panel.inited) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const workspace = globalContext.get('workspace');
|
const editor = panel.skeleton.editor;
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
|
||||||
const panelName = area ? `${area}-${panel.name}` : panel.name;
|
const panelName = area ? `${area}-${panel.name}` : panel.name;
|
||||||
editor?.eventBus.emit('skeleton.panel.toggle', {
|
editor?.eventBus.emit('skeleton.panel.toggle', {
|
||||||
name: panelName || '',
|
name: panelName || '',
|
||||||
|
|||||||
@ -183,6 +183,9 @@ export class Workspace implements IWorkspace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private remove(index: number) {
|
private remove(index: number) {
|
||||||
|
if (index < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const window = this.windows[index];
|
const window = this.windows[index];
|
||||||
this.windows.splice(index, 1);
|
this.windows.splice(index, 1);
|
||||||
if (this.window === window) {
|
if (this.window === window) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user