diff --git a/packages/engine/src/modules/symbols.ts b/packages/engine/src/modules/symbols.ts index a0371abf9..435e8cbc2 100644 --- a/packages/engine/src/modules/symbols.ts +++ b/packages/engine/src/modules/symbols.ts @@ -12,6 +12,8 @@ import { propSymbol, simulatorHostSymbol, skeletonItemSymbol, + editorCabinSymbol, + skeletonCabinSymbol, } from '@alilc/lowcode-shell'; export default { @@ -25,6 +27,8 @@ export default { settingPropEntrySymbol: settingFieldSymbol, settingTopEntrySymbol, designerCabinSymbol, + editorCabinSymbol, + skeletonCabinSymbol, propSymbol, simulatorHostSymbol, skeletonItemSymbol, diff --git a/packages/shell/src/api/common.tsx b/packages/shell/src/api/common.tsx index 9f38cf109..3c2d2e5cc 100644 --- a/packages/shell/src/api/common.tsx +++ b/packages/shell/src/api/common.tsx @@ -1,4 +1,4 @@ -import { editorSymbol, skeletonSymbol, designerCabinSymbol, designerSymbol, settingFieldSymbol } from '../symbols'; +import { editorSymbol, skeletonSymbol, designerCabinSymbol, designerSymbol, settingFieldSymbol, editorCabinSymbol, skeletonCabinSymbol } from '../symbols'; import { isFormEvent as innerIsFormEvent, compatibleLegaoSchema as innerCompatibleLegaoSchema, @@ -36,6 +36,10 @@ import { getConvertedExtraKey as innerGetConvertedExtraKey, getOriginalExtraKey as innerGetOriginalExtraKey, IDesigner, + DropLocation as InnerDropLocation, + Designer as InnerDesigner, + Node as InnerNode, + LowCodePluginManager as InnerLowCodePluginManager, } from '@alilc/lowcode-designer'; import { Skeleton as InnerSkeleton, @@ -43,6 +47,8 @@ import { PopupContext as InnerPopupContext, PopupPipe as InnerPopupPipe, Workbench as InnerWorkbench, + SettingsPrimaryPane as InnerSettingsPrimaryPane, + registerDefaults as InnerRegisterDefaults, } from '@alilc/lowcode-editor-skeleton'; import { Editor, @@ -61,6 +67,7 @@ import { action as innerAction, runInAction as innerRunInAction, engineConfig as innerEngineConfig, + globalContext, } from '@alilc/lowcode-editor-core'; import { Dragon as ShellDragon } from '../model'; import { ReactNode } from 'react'; @@ -94,6 +101,10 @@ class DesignerCabin implements IPublicApiCommonDesignerCabin { DragObjectType: InnerDragObjectType, isDragNodeDataObject: innerIsDragNodeDataObject, isNode: innerIsNode, + DropLocation: InnerDropLocation, + Designer: InnerDesigner, + Node: InnerNode, + LowCodePluginManager: InnerLowCodePluginManager, }; } @@ -160,8 +171,19 @@ class DesignerCabin implements IPublicApiCommonDesignerCabin { class SkeletonCabin implements IPublicApiCommonSkeletonCabin { private readonly [skeletonSymbol]: InnerSkeleton; + readonly [skeletonCabinSymbol]: any; + constructor(skeleton: InnerSkeleton) { this[skeletonSymbol] = skeleton; + this[skeletonCabinSymbol] = { + Workbench: this.Workbench, + createSettingFieldView: this.createSettingFieldView, + PopupContext: InnerPopupContext, + PopupPipe: InnerPopupPipe, + SettingsPrimaryPane: InnerSettingsPrimaryPane, + registerDefaults: InnerRegisterDefaults, + Skeleton: InnerSkeleton, + }; } get Workbench(): any { @@ -242,8 +264,33 @@ class Utils implements IPublicApiCommonUtils { class EditorCabin implements IPublicApiCommonEditorCabin { private readonly [editorSymbol]: Editor; + /** + * @deprecated + */ + readonly [editorCabinSymbol]: any; + constructor(editor: Editor) { this[editorSymbol] = editor; + this[editorCabinSymbol] = { + Editor, + globalContext, + runInAction: innerRunInAction, + Title: InnerTitle, + Tip: InnerTip, + shallowIntl: innerShallowIntl, + createIntl: innerCreateIntl, + intl: innerIntl, + createSetterContent: this.createSetterContent.bind(this), + globalLocale: innerGlobalLocale, + obx: innerObx, + action: innerAction, + engineConfig: innerEngineConfig, + observable: innerObservable, + makeObservable: innerMakeObservable, + untracked: innerUntracked, + computed: innerComputed, + observer: innerObserver, + }; } /** diff --git a/packages/shell/src/symbols.ts b/packages/shell/src/symbols.ts index b4ec01c7e..cc1be4856 100644 --- a/packages/shell/src/symbols.ts +++ b/packages/shell/src/symbols.ts @@ -24,6 +24,8 @@ export const simulatorHostSymbol = Symbol('simulatorHost'); export const dragObjectSymbol = Symbol('dragObject'); export const locateEventSymbol = Symbol('locateEvent'); export const designerCabinSymbol = Symbol('designerCabin'); +export const editorCabinSymbol = Symbol('editorCabin'); +export const skeletonCabinSymbol = Symbol('skeletonCabin'); export const hotkeySymbol = Symbol('hotkey'); export const pluginsSymbol = Symbol('plugins'); export const workspaceSymbol = Symbol('workspace');