Skip to content

Commit e83adce

Browse files
committed
feat: export nodeChildrenSymbol && remove some unnecessary editor.set
1 parent 85704c3 commit e83adce

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

packages/editor-core/src/editor.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ import { AssetsJson, AssetLoader } from '@alilc/lowcode-utils';
2020

2121
EventEmitter.defaultMaxListeners = 100;
2222

23+
// inner instance keys which should not be stored in config
24+
const keyBlacklist = [
25+
'designer',
26+
'skeleton',
27+
'currentDocument',
28+
'simulator',
29+
'plugins',
30+
];
31+
2332
export declare interface Editor extends StrictEventEmitter<EventEmitter, GlobalEvent.EventConfig> {
2433
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
2534
once(event: string | symbol, listener: (...args: any[]) => void): this;
@@ -73,7 +82,9 @@ export class Editor extends (EventEmitter as any) implements IEditor {
7382
return;
7483
}
7584
// store the data to engineConfig while invoking editor.set()
76-
engineConfig.set(key as any, data);
85+
if (!keyBlacklist.includes(key as string)) {
86+
engineConfig.set(key as any, data);
87+
}
7788
this.context.set(key, data);
7889
this.notifyGot(key);
7990
}

packages/engine/src/engine-core.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ globalContext.register(editor, Editor);
3737
globalContext.register(editor, 'editor');
3838

3939
const innerSkeleton = new InnerSkeleton(editor);
40-
editor.set(Skeleton, innerSkeleton);
4140
editor.set('skeleton' as any, innerSkeleton);
42-
engineConfig.set('skeleton' as any, innerSkeleton);
4341

4442
const designer = new Designer({ editor });
45-
editor.set(Designer, designer);
4643
editor.set('designer' as any, designer);
47-
engineConfig.set('designer' as any, designer);
4844

4945
const plugins = new LowCodePluginManager(editor).toProxy();
5046
editor.set('plugins' as any, plugins);

packages/engine/src/modules/symbols.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
projectSymbol,
33
documentSymbol,
44
nodeSymbol,
5+
nodeChildrenSymbol,
56
designerSymbol,
67
skeletonSymbol,
78
editorSymbol,
@@ -13,6 +14,7 @@ export default {
1314
projectSymbol,
1415
documentSymbol,
1516
nodeSymbol,
17+
nodeChildrenSymbol,
1618
skeletonSymbol,
1719
editorSymbol,
1820
designerSymbol,

packages/renderer-core/tests/renderer/renderer.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import renderer from 'react-test-renderer/';
2+
import renderer from 'react-test-renderer';
33
import schema from '../fixtures/schema/basic';
44
import '../utils/react-env-init';
55
import rendererFactory from '../../src/renderer/renderer';

packages/shell/src/hotkey.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ import { hotkey, HotkeyCallback } from '@alilc/lowcode-editor-core';
22
import { Disposable } from '@alilc/lowcode-types';
33

44
export default class Hotkey {
5+
get callbacks() {
6+
return hotkey.callBacks;
7+
}
8+
/**
9+
* @deprecated
10+
*/
11+
get callBacks() {
12+
return this.callbacks;
13+
}
514
/**
615
* 绑定快捷键
716
* @param combos 快捷键,格式如:['command + s'] 、['ctrl + shift + s'] 等

0 commit comments

Comments
 (0)