mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-02 01:58:11 +00:00
feat: export nodeChildrenSymbol && remove some unnecessary editor.set
This commit is contained in:
parent
85704c3694
commit
e83adcee81
@ -20,6 +20,15 @@ import { AssetsJson, AssetLoader } from '@alilc/lowcode-utils';
|
||||
|
||||
EventEmitter.defaultMaxListeners = 100;
|
||||
|
||||
// inner instance keys which should not be stored in config
|
||||
const keyBlacklist = [
|
||||
'designer',
|
||||
'skeleton',
|
||||
'currentDocument',
|
||||
'simulator',
|
||||
'plugins',
|
||||
];
|
||||
|
||||
export declare interface Editor extends StrictEventEmitter<EventEmitter, GlobalEvent.EventConfig> {
|
||||
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
@ -73,7 +82,9 @@ export class Editor extends (EventEmitter as any) implements IEditor {
|
||||
return;
|
||||
}
|
||||
// store the data to engineConfig while invoking editor.set()
|
||||
engineConfig.set(key as any, data);
|
||||
if (!keyBlacklist.includes(key as string)) {
|
||||
engineConfig.set(key as any, data);
|
||||
}
|
||||
this.context.set(key, data);
|
||||
this.notifyGot(key);
|
||||
}
|
||||
|
||||
@ -37,14 +37,10 @@ globalContext.register(editor, Editor);
|
||||
globalContext.register(editor, 'editor');
|
||||
|
||||
const innerSkeleton = new InnerSkeleton(editor);
|
||||
editor.set(Skeleton, innerSkeleton);
|
||||
editor.set('skeleton' as any, innerSkeleton);
|
||||
engineConfig.set('skeleton' as any, innerSkeleton);
|
||||
|
||||
const designer = new Designer({ editor });
|
||||
editor.set(Designer, designer);
|
||||
editor.set('designer' as any, designer);
|
||||
engineConfig.set('designer' as any, designer);
|
||||
|
||||
const plugins = new LowCodePluginManager(editor).toProxy();
|
||||
editor.set('plugins' as any, plugins);
|
||||
|
||||
@ -2,6 +2,7 @@ import {
|
||||
projectSymbol,
|
||||
documentSymbol,
|
||||
nodeSymbol,
|
||||
nodeChildrenSymbol,
|
||||
designerSymbol,
|
||||
skeletonSymbol,
|
||||
editorSymbol,
|
||||
@ -13,6 +14,7 @@ export default {
|
||||
projectSymbol,
|
||||
documentSymbol,
|
||||
nodeSymbol,
|
||||
nodeChildrenSymbol,
|
||||
skeletonSymbol,
|
||||
editorSymbol,
|
||||
designerSymbol,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer/';
|
||||
import renderer from 'react-test-renderer';
|
||||
import schema from '../fixtures/schema/basic';
|
||||
import '../utils/react-env-init';
|
||||
import rendererFactory from '../../src/renderer/renderer';
|
||||
|
||||
@ -2,6 +2,15 @@ import { hotkey, HotkeyCallback } from '@alilc/lowcode-editor-core';
|
||||
import { Disposable } from '@alilc/lowcode-types';
|
||||
|
||||
export default class Hotkey {
|
||||
get callbacks() {
|
||||
return hotkey.callBacks;
|
||||
}
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
get callBacks() {
|
||||
return this.callbacks;
|
||||
}
|
||||
/**
|
||||
* 绑定快捷键
|
||||
* @param combos 快捷键,格式如:['command + s'] 、['ctrl + shift + s'] 等
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user