mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-19 08:42:52 +00:00
28 lines
828 B
TypeScript
28 lines
828 B
TypeScript
import { editorViewSymbol, pluginContextSymbol } from '../symbols';
|
|
import { IPublicModelPluginContext } from '@alilc/lowcode-types';
|
|
import { IViewContext } from '@alilc/lowcode-workspace';
|
|
|
|
export class EditorView {
|
|
[editorViewSymbol]: IViewContext;
|
|
|
|
[pluginContextSymbol]: IPublicModelPluginContext;
|
|
|
|
constructor(editorView: IViewContext) {
|
|
this[editorViewSymbol] = editorView;
|
|
this[pluginContextSymbol] = this[editorViewSymbol].innerPlugins._getLowCodePluginContext({
|
|
pluginName: '',
|
|
});
|
|
}
|
|
|
|
toProxy() {
|
|
return new Proxy(this, {
|
|
get(target, prop, receiver) {
|
|
if ((target[pluginContextSymbol] as any)[prop as string]) {
|
|
return Reflect.get(target[pluginContextSymbol], prop, receiver);
|
|
}
|
|
return Reflect.get(target, prop, receiver);
|
|
},
|
|
});
|
|
}
|
|
}
|