GeezerVison is showing github.com — feat: export nodeChildrenSymbol && remove some unnecessary editor.set · Alvison/lowcode-engine@e83adce
File treeExpand file treeCollapse file tree Open diff view settings renderer-core/tests/renderer
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/editor-core/src/editor.ts +12-1Lines changed: 12 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,6 +20,15 @@ import { AssetsJson, AssetLoader } from '@alilc/lowcode-utils'; | 20 | 20 |
| 21 | 21 | EventEmitter.defaultMaxListeners = 100; | 22 | 22 |
| | 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 | + | 23 | 32 | export declare interface Editor extends StrictEventEmitter<EventEmitter, GlobalEvent.EventConfig> { | 24 | 33 | addListener(event: string | symbol, listener: (...args: any[]) => void): this; | 25 | 34 | once(event: string | symbol, listener: (...args: any[]) => void): this; | @@ -73,7 +82,9 @@ export class Editor extends (EventEmitter as any) implements IEditor { | 73 | 82 | return; | 74 | 83 | } | 75 | 84 | // 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 | + } | 77 | 88 | this.context.set(key, data); | 78 | 89 | this.notifyGot(key); | 79 | 90 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/src/engine-core.ts -4Lines changed: 0 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -37,14 +37,10 @@ globalContext.register(editor, Editor); | 37 | 37 | globalContext.register(editor, 'editor'); | 38 | 38 |
| 39 | 39 | const innerSkeleton = new InnerSkeleton(editor); | 40 | | -editor.set(Skeleton, innerSkeleton); | 41 | 40 | editor.set('skeleton' as any, innerSkeleton); | 42 | | -engineConfig.set('skeleton' as any, innerSkeleton); | 43 | 41 |
| 44 | 42 | const designer = new Designer({ editor }); | 45 | | -editor.set(Designer, designer); | 46 | 43 | editor.set('designer' as any, designer); | 47 | | -engineConfig.set('designer' as any, designer); | 48 | 44 |
| 49 | 45 | const plugins = new LowCodePluginManager(editor).toProxy(); | 50 | 46 | editor.set('plugins' as any, plugins); | |
Collapse file Copy file name to clipboardExpand all lines: packages/engine/src/modules/symbols.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | projectSymbol, | 3 | 3 | documentSymbol, | 4 | 4 | nodeSymbol, | | 5 | + nodeChildrenSymbol, | 5 | 6 | designerSymbol, | 6 | 7 | skeletonSymbol, | 7 | 8 | editorSymbol, | @@ -13,6 +14,7 @@ export default { | 13 | 14 | projectSymbol, | 14 | 15 | documentSymbol, | 15 | 16 | nodeSymbol, | | 17 | + nodeChildrenSymbol, | 16 | 18 | skeletonSymbol, | 17 | 19 | editorSymbol, | 18 | 20 | designerSymbol, | |
Collapse file Copy file name to clipboardExpand all lines: packages/renderer-core/tests/renderer/renderer.test.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import React from 'react'; | 2 | | -import renderer from 'react-test-renderer/'; | | 2 | +import renderer from 'react-test-renderer'; | 3 | 3 | import schema from '../fixtures/schema/basic'; | 4 | 4 | import '../utils/react-env-init'; | 5 | 5 | import rendererFactory from '../../src/renderer/renderer'; | |
Collapse file Copy file name to clipboardExpand all lines: packages/shell/src/hotkey.ts +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,15 @@ import { hotkey, HotkeyCallback } from '@alilc/lowcode-editor-core'; | 2 | 2 | import { Disposable } from '@alilc/lowcode-types'; | 3 | 3 |
| 4 | 4 | export default class Hotkey { | | 5 | + get callbacks() { | | 6 | + return hotkey.callBacks; | | 7 | + } | | 8 | + /** | | 9 | + * @deprecated | | 10 | + */ | | 11 | + get callBacks() { | | 12 | + return this.callbacks; | | 13 | + } | 5 | 14 | /** | 6 | 15 | * 绑定快捷键 | 7 | 16 | * @param combos 快捷键,格式如:['command + s'] 、['ctrl + shift + s'] 等 | |
|