GeezerVison is showing github.com — feat: resourceList children support different resourceName · codertony/lowcode-engine@ebe21c4
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/workspace/src/context/base-context.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,6 +16,7 @@ import { | 16 | 16 | ILowCodePluginManager, | 17 | 17 | } from '@alilc/lowcode-designer'; | 18 | 18 | import { | | 19 | + ISkeleton, | 19 | 20 | Skeleton as InnerSkeleton, | 20 | 21 | } from '@alilc/lowcode-editor-skeleton'; | 21 | 22 | import { | @@ -65,7 +66,7 @@ export interface IBasicContext extends Omit<IPublicModelPluginContext, 'workspac | 65 | 66 | designer: IDesigner; | 66 | 67 | registerInnerPlugins: () => Promise<void>; | 67 | 68 | innerSetters: InnerSetters; | 68 | | - innerSkeleton: InnerSkeleton; | | 69 | + innerSkeleton: ISkeleton; | 69 | 70 | innerHotkey: IHotKey; | 70 | 71 | innerPlugins: ILowCodePluginManager; | 71 | 72 | canvas: IPublicApiCanvas; | |
Collapse file Copy file name to clipboardExpand all lines: packages/workspace/src/inner-plugins/webview.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import { IPublicModelPluginContext } from '@alilc/lowcode-types'; | 2 | 2 |
| 3 | 3 | export function DesignerView(props: { | 4 | 4 | url: string; | 5 | | - viewName: string; | | 5 | + viewName?: string; | 6 | 6 | }) { | 7 | 7 | return ( | 8 | 8 | <div className="lc-designer lowcode-plugin-designer"> | |
Collapse file Copy file name to clipboardExpand all lines: packages/workspace/src/resource.ts +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +import { ISkeleton } from '@alilc/lowcode-editor-skeleton'; | 1 | 2 | import { IPublicTypeEditorView, IPublicResourceData, IPublicResourceTypeConfig, IBaseModelResource } from '@alilc/lowcode-types'; | 2 | 3 | import { Logger } from '@alilc/lowcode-utils'; | 3 | 4 | import { BasicContext, IBasicContext } from './context/base-context'; | @@ -9,6 +10,8 @@ const logger = new Logger({ level: 'warn', bizName: 'workspace:resource' }); | 9 | 10 | export interface IBaseResource<T> extends IBaseModelResource<T> { | 10 | 11 | readonly resourceType: ResourceType; | 11 | 12 |
| | 13 | + skeleton: ISkeleton; | | 14 | + | 12 | 15 | get editorViews(): IPublicTypeEditorView[]; | 13 | 16 |
| 14 | 17 | get defaultViewType(): string; | @@ -68,7 +71,7 @@ export class Resource implements IResource { | 68 | 71 | } | 69 | 72 |
| 70 | 73 | get children(): IResource[] { | 71 | | - return this.resourceData?.children?.map(d => new Resource(d, this.resourceType, this.workspace)) || []; | | 74 | + return this.resourceData?.children?.map(d => new Resource(d, this.workspace.getResourceType(d.resourceName || this.resourceType.name), this.workspace)) || []; | 72 | 75 | } | 73 | 76 |
| 74 | 77 | constructor(readonly resourceData: IPublicResourceData, readonly resourceType: IResourceType, readonly workspace: IWorkspace) { | |
Collapse file Copy file name to clipboardExpand all lines: packages/workspace/src/view/resource-view.tsx +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,14 +2,14 @@ import { PureComponent } from 'react'; | 2 | 2 | import { EditorView } from './editor-view'; | 3 | 3 | import { observer } from '@alilc/lowcode-editor-core'; | 4 | 4 | import TopArea from '../layouts/top-area'; | 5 | | -import { Resource } from '../resource'; | 6 | | -import { EditorWindow } from '../window'; | | 5 | +import { IResource } from '../resource'; | | 6 | +import { IEditorWindow } from '../window'; | 7 | 7 | import './resource-view.less'; | 8 | 8 |
| 9 | 9 | @observer | 10 | 10 | export class ResourceView extends PureComponent<{ | 11 | | - window: EditorWindow; | 12 | | - resource: Resource; | | 11 | + window: IEditorWindow; | | 12 | + resource: IResource; | 13 | 13 | }, any> { | 14 | 14 | render() { | 15 | 15 | const { skeleton } = this.props.resource; | |
Collapse file Copy file name to clipboardExpand all lines: packages/workspace/src/window.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,6 +15,8 @@ interface IWindowCOnfig { | 15 | 15 | export interface IEditorWindow extends Omit<IPublicModelWindow<IResource>, 'changeViewType'> { | 16 | 16 | readonly resource: IResource; | 17 | 17 |
| | 18 | + editorViews: Map<string, Context>; | | 19 | + | 18 | 20 | changeViewType: (name: string, ignoreEmit?: boolean) => void; | 19 | 21 | } | 20 | 22 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/workspace/src/workspace.ts +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,6 +27,8 @@ export interface IWorkspace extends Omit<IPublicApiWorkspace< | 27 | 27 | plugins: ILowCodePluginManager; | 28 | 28 |
| 29 | 29 | getResourceList(): IResource[]; | | 30 | + | | 31 | + getResourceType(resourceName: string): IResourceType; | 30 | 32 | } | 31 | 33 |
| 32 | 34 | export class Workspace implements IWorkspace { | |
|