GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: resourceList children support different resourceName · bruceywave/lowcode-engine@ebe21c4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/workspace/src
    • context
      • base-context.ts
    • inner-plugins
      • webview.tsx
    • resource.ts
    • view
      • resource-view.tsx
    • window.ts
    • workspace.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/workspace/src/context/base-context.ts‎

Copy file name to clipboardExpand all lines: packages/workspace/src/context/base-context.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
ILowCodePluginManager,
1717
} from '@alilc/lowcode-designer';
1818
import {
19+
ISkeleton,
1920
Skeleton as InnerSkeleton,
2021
} from '@alilc/lowcode-editor-skeleton';
2122
import {
@@ -65,7 +66,7 @@ export interface IBasicContext extends Omit<IPublicModelPluginContext, 'workspac
6566
designer: IDesigner;
6667
registerInnerPlugins: () => Promise<void>;
6768
innerSetters: InnerSetters;
68-
innerSkeleton: InnerSkeleton;
69+
innerSkeleton: ISkeleton;
6970
innerHotkey: IHotKey;
7071
innerPlugins: ILowCodePluginManager;
7172
canvas: IPublicApiCanvas;
Collapse file

‎packages/workspace/src/inner-plugins/webview.tsx‎

Copy file name to clipboardExpand all lines: packages/workspace/src/inner-plugins/webview.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { IPublicModelPluginContext } from '@alilc/lowcode-types';
22

33
export function DesignerView(props: {
44
url: string;
5-
viewName: string;
5+
viewName?: string;
66
}) {
77
return (
88
<div className="lc-designer lowcode-plugin-designer">
Collapse file

‎packages/workspace/src/resource.ts‎

Copy file name to clipboardExpand all lines: packages/workspace/src/resource.ts
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ISkeleton } from '@alilc/lowcode-editor-skeleton';
12
import { IPublicTypeEditorView, IPublicResourceData, IPublicResourceTypeConfig, IBaseModelResource } from '@alilc/lowcode-types';
23
import { Logger } from '@alilc/lowcode-utils';
34
import { BasicContext, IBasicContext } from './context/base-context';
@@ -9,6 +10,8 @@ const logger = new Logger({ level: 'warn', bizName: 'workspace:resource' });
910
export interface IBaseResource<T> extends IBaseModelResource<T> {
1011
readonly resourceType: ResourceType;
1112

13+
skeleton: ISkeleton;
14+
1215
get editorViews(): IPublicTypeEditorView[];
1316

1417
get defaultViewType(): string;
@@ -68,7 +71,7 @@ export class Resource implements IResource {
6871
}
6972

7073
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)) || [];
7275
}
7376

7477
constructor(readonly resourceData: IPublicResourceData, readonly resourceType: IResourceType, readonly workspace: IWorkspace) {
Collapse file

‎packages/workspace/src/view/resource-view.tsx‎

Copy file name to clipboardExpand all lines: packages/workspace/src/view/resource-view.tsx
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { PureComponent } from 'react';
22
import { EditorView } from './editor-view';
33
import { observer } from '@alilc/lowcode-editor-core';
44
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';
77
import './resource-view.less';
88

99
@observer
1010
export class ResourceView extends PureComponent<{
11-
window: EditorWindow;
12-
resource: Resource;
11+
window: IEditorWindow;
12+
resource: IResource;
1313
}, any> {
1414
render() {
1515
const { skeleton } = this.props.resource;
Collapse file

‎packages/workspace/src/window.ts‎

Copy file name to clipboardExpand all lines: packages/workspace/src/window.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ interface IWindowCOnfig {
1515
export interface IEditorWindow extends Omit<IPublicModelWindow<IResource>, 'changeViewType'> {
1616
readonly resource: IResource;
1717

18+
editorViews: Map<string, Context>;
19+
1820
changeViewType: (name: string, ignoreEmit?: boolean) => void;
1921
}
2022

Collapse file

‎packages/workspace/src/workspace.ts‎

Copy file name to clipboardExpand all lines: packages/workspace/src/workspace.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export interface IWorkspace extends Omit<IPublicApiWorkspace<
2727
plugins: ILowCodePluginManager;
2828

2929
getResourceList(): IResource[];
30+
31+
getResourceType(resourceName: string): IResourceType;
3032
}
3133

3234
export class Workspace implements IWorkspace {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.