Skip to content

Commit 76f2fb6

Browse files
committed
fix(plugin-multiple-editor): use skeleton api
1 parent 9e22f4a commit 76f2fb6

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/plugin-multiple-editor/src/Service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { EditorController } from './Controller';
22
import { EditorHook } from './EditorHook';
3-
import type { Event } from '@alilc/lowcode-shell';
3+
import type { Skeleton } from '@alilc/lowcode-shell';
44

55
export enum PluginHooks {
66
onActive = 'onActive',
@@ -24,7 +24,7 @@ export class Service extends EditorHook {
2424

2525
public onSelectFileChange = this.hookFactory(PluginHooks.onSelectFileChange);
2626

27-
constructor(public controller: EditorController, private editor: Event) {
27+
constructor(public controller: EditorController, private skeleton: Skeleton) {
2828
super();
2929
}
3030

@@ -41,12 +41,12 @@ export class Service extends EditorHook {
4141
}
4242

4343
private setupHooks() {
44-
this.editor.on('skeleton.panel-dock.unactive', (pluginName) => {
44+
this.skeleton.onShowPanel((pluginName) => {
4545
if (pluginName === 'codeEditor') {
4646
this.triggerHook(PluginHooks.onDeActive);
4747
}
4848
});
49-
this.editor.on('skeleton.panel-dock.active', (pluginName) => {
49+
this.skeleton.onHidePanel((pluginName) => {
5050
if (pluginName === 'codeEditor') {
5151
this.triggerHook(PluginHooks.onActive);
5252
}

packages/plugin-multiple-editor/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const pluginCodeEditor = (
6262
schemaDock && schemaDock.disable();
6363
project.onSimulatorRendererReady(() => {
6464
schemaDock.enable();
65-
const service = new Service(editorController, editor);
65+
const service = new Service(editorController, ctx.skeleton);
6666
service.init({ plugins: options.plugins });
6767
editorController.init(project, editor, service);
6868
});

0 commit comments

Comments
 (0)