mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-10 18:03:01 +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)
|
||||
|
||||
### skeleton
|
||||
|
||||
应用级别的面板管理
|
||||
|
||||
```typescript
|
||||
get skeleton(): IPublicApiSkeleton
|
||||
```
|
||||
|
||||
关联模型 [IPublicApiSkeleton](./skeleton)
|
||||
|
||||
### 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;
|
||||
}
|
||||
|
||||
export class Skeleton {
|
||||
export class Skeleton implements ISkeleton {
|
||||
private panels = new Map<string, Panel>();
|
||||
|
||||
private containers = new Map<string, WidgetContainer<any>>();
|
||||
|
||||
@ -3,6 +3,7 @@ import { IWorkspace } from '@alilc/lowcode-workspace';
|
||||
import { resourceSymbol, workspaceSymbol } from '../symbols';
|
||||
import { Resource as ShellResource, Window as ShellWindow } from '../model';
|
||||
import { Plugins } from './plugins';
|
||||
import { Skeleton } from './skeleton';
|
||||
|
||||
export class Workspace implements IPublicApiWorkspace {
|
||||
readonly [workspaceSymbol]: IWorkspace;
|
||||
@ -92,6 +93,10 @@ export class Workspace implements IPublicApiWorkspace {
|
||||
return new Plugins(this[workspaceSymbol].plugins, true);
|
||||
}
|
||||
|
||||
get skeleton() {
|
||||
return new Skeleton(this[workspaceSymbol].skeleton, 'workspace', true);
|
||||
}
|
||||
|
||||
get windows() {
|
||||
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 { IResource, Resource } from './resource';
|
||||
import { IResourceType, ResourceType } from './resource-type';
|
||||
import { ISkeleton } from '@alilc/lowcode-editor-skeleton';
|
||||
|
||||
enum EVENT {
|
||||
CHANGE_WINDOW = 'change_window',
|
||||
@ -33,6 +34,8 @@ export interface IWorkspace extends Omit<IPublicApiWorkspace<
|
||||
|
||||
plugins: ILowCodePluginManager;
|
||||
|
||||
skeleton: ISkeleton;
|
||||
|
||||
resourceTypeMap: Map<string, ResourceType>;
|
||||
|
||||
getResourceList(): IResource[];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user