mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-04 09:15:16 +00:00
feat: PluginContext 中增加 utils / engineConfig
This commit is contained in:
parent
cc465469b2
commit
562e4e0953
@ -1,4 +1,4 @@
|
|||||||
import { Editor, Hotkey, hotkey, getSetter, registerSetter, getSettersMap } from '@ali/lowcode-editor-core';
|
import { Editor, Hotkey, hotkey, getSetter, registerSetter, getSettersMap, engineConfig, EngineConfig } from '@ali/lowcode-editor-core';
|
||||||
import { Skeleton } from '@ali/lowcode-editor-skeleton';
|
import { Skeleton } from '@ali/lowcode-editor-skeleton';
|
||||||
import { ILowCodePluginConfig, ILowCodePluginManager, ILowCodePluginContext, IDesignerCabin } from './plugin-types';
|
import { ILowCodePluginConfig, ILowCodePluginManager, ILowCodePluginContext, IDesignerCabin } from './plugin-types';
|
||||||
import { getLogger, Logger } from '../utils';
|
import { getLogger, Logger } from '../utils';
|
||||||
@ -8,7 +8,7 @@ import {
|
|||||||
removeBuiltinComponentAction,
|
removeBuiltinComponentAction,
|
||||||
} from '../component-meta';
|
} from '../component-meta';
|
||||||
import { Designer } from '../designer';
|
import { Designer } from '../designer';
|
||||||
import { Setters } from '../types';
|
import { Setters, Utils, utils } from '../types';
|
||||||
|
|
||||||
export default class PluginContext implements ILowCodePluginContext {
|
export default class PluginContext implements ILowCodePluginContext {
|
||||||
editor: Editor;
|
editor: Editor;
|
||||||
@ -19,6 +19,8 @@ export default class PluginContext implements ILowCodePluginContext {
|
|||||||
plugins: ILowCodePluginManager;
|
plugins: ILowCodePluginManager;
|
||||||
designerCabin: IDesignerCabin;
|
designerCabin: IDesignerCabin;
|
||||||
setters: Setters;
|
setters: Setters;
|
||||||
|
utils: Utils;
|
||||||
|
engineConfig: EngineConfig;
|
||||||
|
|
||||||
constructor(editor: Editor, plugins: ILowCodePluginManager) {
|
constructor(editor: Editor, plugins: ILowCodePluginManager) {
|
||||||
this.editor = editor;
|
this.editor = editor;
|
||||||
@ -32,6 +34,8 @@ export default class PluginContext implements ILowCodePluginContext {
|
|||||||
registerSetter,
|
registerSetter,
|
||||||
getSettersMap,
|
getSettersMap,
|
||||||
};
|
};
|
||||||
|
this.engineConfig = engineConfig;
|
||||||
|
this.utils = utils;
|
||||||
}
|
}
|
||||||
|
|
||||||
private createDesignerCabin(): IDesignerCabin {
|
private createDesignerCabin(): IDesignerCabin {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { CompositeObject, ComponentAction } from '@ali/lowcode-types';
|
import { CompositeObject, ComponentAction } from '@ali/lowcode-types';
|
||||||
import Logger from 'zen-logger';
|
import Logger from 'zen-logger';
|
||||||
import { Skeleton } from '@ali/lowcode-editor-skeleton';
|
import { Skeleton } from '@ali/lowcode-editor-skeleton';
|
||||||
import { Editor, Hotkey } from '@ali/lowcode-editor-core';
|
import { Editor, Hotkey, EngineConfig } from '@ali/lowcode-editor-core';
|
||||||
import {
|
import {
|
||||||
MetadataTransducer,
|
MetadataTransducer,
|
||||||
Designer,
|
Designer,
|
||||||
@ -54,6 +54,7 @@ export interface ILowCodePluginContext {
|
|||||||
designerCabin: IDesignerCabin;
|
designerCabin: IDesignerCabin;
|
||||||
setters: Setters;
|
setters: Setters;
|
||||||
utils: Utils;
|
utils: Utils;
|
||||||
|
engineConfig: EngineConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ILowCodePluginManagerPluginAccessor {
|
interface ILowCodePluginManagerPluginAccessor {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export type NodeRemoveOptions = {
|
|||||||
suppressRemoveEvent?: boolean;
|
suppressRemoveEvent?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const utils = {
|
export const utils = {
|
||||||
isNodeSchema,
|
isNodeSchema,
|
||||||
isFormEvent,
|
isFormEvent,
|
||||||
compatibleLegaoSchema,
|
compatibleLegaoSchema,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user