mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 02:12:56 +00:00
feat(workspace): add workspace.skeleton api
This commit is contained in:
parent
6b14986e8f
commit
1072ff36fb
@ -37,6 +37,16 @@ get plugins(): IPublicApiPlugins
|
|||||||
|
|
||||||
关联模型 [IPublicApiPlugins](./plugins)
|
关联模型 [IPublicApiPlugins](./plugins)
|
||||||
|
|
||||||
|
### skeleton
|
||||||
|
|
||||||
|
应用级别的面板管理
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
get skeleton(): IPublicApiSkeleton
|
||||||
|
```
|
||||||
|
|
||||||
|
关联模型 [IPublicApiSkeleton](./skeleton)
|
||||||
|
|
||||||
### windows
|
### windows
|
||||||
|
|
||||||
当前设计器的编辑窗口
|
当前设计器的编辑窗口
|
||||||
|
|||||||
@ -108,7 +108,7 @@ export interface ISkeleton extends Omit<IPublicApiSkeleton,
|
|||||||
add(config: IPublicTypeSkeletonConfig, extraConfig?: Record<string, any>): IWidget | Widget | Panel | Stage | Dock | PanelDock | undefined;
|
add(config: IPublicTypeSkeletonConfig, extraConfig?: Record<string, any>): IWidget | Widget | Panel | Stage | Dock | PanelDock | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Skeleton {
|
export class Skeleton implements ISkeleton {
|
||||||
private panels = new Map<string, Panel>();
|
private panels = new Map<string, Panel>();
|
||||||
|
|
||||||
private containers = new Map<string, WidgetContainer<any>>();
|
private containers = new Map<string, WidgetContainer<any>>();
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { IWorkspace } from '@alilc/lowcode-workspace';
|
|||||||
import { resourceSymbol, workspaceSymbol } from '../symbols';
|
import { resourceSymbol, workspaceSymbol } from '../symbols';
|
||||||
import { Resource as ShellResource, Window as ShellWindow } from '../model';
|
import { Resource as ShellResource, Window as ShellWindow } from '../model';
|
||||||
import { Plugins } from './plugins';
|
import { Plugins } from './plugins';
|
||||||
|
import { Skeleton } from './skeleton';
|
||||||
|
|
||||||
export class Workspace implements IPublicApiWorkspace {
|
export class Workspace implements IPublicApiWorkspace {
|
||||||
readonly [workspaceSymbol]: IWorkspace;
|
readonly [workspaceSymbol]: IWorkspace;
|
||||||
@ -92,6 +93,10 @@ export class Workspace implements IPublicApiWorkspace {
|
|||||||
return new Plugins(this[workspaceSymbol].plugins, true);
|
return new Plugins(this[workspaceSymbol].plugins, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get skeleton() {
|
||||||
|
return new Skeleton(this[workspaceSymbol].skeleton, 'workspace', true);
|
||||||
|
}
|
||||||
|
|
||||||
get windows() {
|
get windows() {
|
||||||
return this[workspaceSymbol].windows.map((d) => new ShellWindow(d));
|
return this[workspaceSymbol].windows.map((d) => new ShellWindow(d));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import { EditorWindow, WINDOW_STATE } from './window';
|
|||||||
import type { IEditorWindow } from './window';
|
import type { IEditorWindow } from './window';
|
||||||
import { IResource, Resource } from './resource';
|
import { IResource, Resource } from './resource';
|
||||||
import { IResourceType, ResourceType } from './resource-type';
|
import { IResourceType, ResourceType } from './resource-type';
|
||||||
|
import { ISkeleton } from '@alilc/lowcode-editor-skeleton';
|
||||||
|
|
||||||
enum EVENT {
|
enum EVENT {
|
||||||
CHANGE_WINDOW = 'change_window',
|
CHANGE_WINDOW = 'change_window',
|
||||||
@ -33,6 +34,8 @@ export interface IWorkspace extends Omit<IPublicApiWorkspace<
|
|||||||
|
|
||||||
plugins: ILowCodePluginManager;
|
plugins: ILowCodePluginManager;
|
||||||
|
|
||||||
|
skeleton: ISkeleton;
|
||||||
|
|
||||||
resourceTypeMap: Map<string, ResourceType>;
|
resourceTypeMap: Map<string, ResourceType>;
|
||||||
|
|
||||||
getResourceList(): IResource[];
|
getResourceList(): IResource[];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user