Skip to content

Commit 1f8d91f

Browse files
liujupingJackLian
authored andcommitted
feat: workspace mode supports webview type views
1 parent 1342481 commit 1f8d91f

17 files changed

Lines changed: 119 additions & 26 deletions

File tree

docs/docs/api/model/window.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ sidebar_position: 12
1616
### importSchema(schema: IPublicTypeNodeSchema)
1717
当前窗口导入 schema
1818

19+
相关类型:[IPublicTypeNodeSchema](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/node-schema.ts)
20+
1921
### changeViewType(viewName: string)
2022
修改当前窗口视图类型
2123

22-
### async save
24+
### async save()
2325
调用当前窗口视图保存钩子

docs/docs/api/workspace.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ sidebar_position: 12
3232
/** 注册资源 */
3333
registerResourceType(resourceName: string, resourceType: 'editor', options: IPublicResourceOptions): void;
3434
```
35+
36+
相关类型:[IPublicResourceOptions](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/resource-options.ts)

packages/editor-skeleton/src/layouts/left-area.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import { Area } from '../area';
77
export default class LeftArea extends Component<{ area: Area }> {
88
render() {
99
const { area } = this.props;
10+
if (area.isEmpty()) {
11+
return null;
12+
}
1013
return (
1114
<div className={classNames('lc-left-area', {
1215
'lc-area-visible': area.visible,

packages/editor-skeleton/src/layouts/right-area.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import { Panel } from '../widget/panel';
88
export default class RightArea extends Component<{ area: Area<any, Panel> }> {
99
render() {
1010
const { area } = this.props;
11+
if (area.isEmpty()) {
12+
return null;
13+
}
1114
return (
1215
<div className={classNames('lc-right-area engine-tabpane', {
1316
'lc-area-visible': area.visible,

packages/editor-skeleton/src/layouts/top-area.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import { Area } from '../area';
77
export default class TopArea extends Component<{ area: Area; itemClassName?: string }> {
88
render() {
99
const { area, itemClassName } = this.props;
10+
if (area.isEmpty()) {
11+
return null;
12+
}
1013
return (
1114
<div className={classNames('lc-top-area engine-actionpane', {
1215
'lc-area-visible': area.visible,

packages/editor-skeleton/src/layouts/workbench.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ body {
154154

155155
&.active {
156156
z-index: 999;
157+
background: #edeff3;
157158
}
158159
}
159160
}

packages/editor-skeleton/src/layouts/workbench.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,25 @@ import { SkeletonContext } from '../context';
1515
import { EditorConfig, PluginClassSet } from '@alilc/lowcode-types';
1616

1717
@observer
18-
export class Workbench extends Component<{ skeleton: Skeleton; config?: EditorConfig; components?: PluginClassSet; className?: string; topAreaItemClassName?: string }> {
18+
export class Workbench extends Component<{
19+
skeleton: Skeleton;
20+
config?: EditorConfig;
21+
components?: PluginClassSet;
22+
className?: string;
23+
topAreaItemClassName?: string;
24+
}> {
1925
constructor(props: any) {
2026
super(props);
2127
const { config, components, skeleton } = this.props;
2228
skeleton.buildFromConfig(config, components);
2329
}
2430

25-
// componentDidCatch(error: any) {
26-
// globalContext.get(Editor).emit('editor.skeleton.workbench.error', error);
27-
// }
28-
2931
render() {
30-
const { skeleton, className, topAreaItemClassName } = this.props;
32+
const {
33+
skeleton,
34+
className,
35+
topAreaItemClassName,
36+
} = this.props;
3137
return (
3238
<div className={classNames('lc-workbench', className)}>
3339
<SkeletonContext.Provider value={this.props.skeleton}>

packages/engine/src/engine-core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async function registryInnerPlugin(designer: Designer, editor: Editor, plugins:
6666
await plugins.register(OutlinePlugin, {}, { autoInit: true });
6767
await plugins.register(componentMetaParser(designer));
6868
await plugins.register(setterRegistry, {}, { autoInit: true });
69-
await plugins.register(defaultPanelRegistry(editor, designer));
69+
await plugins.register(defaultPanelRegistry(editor));
7070
await plugins.register(builtinHotkey);
7171
}
7272

packages/engine/src/inner-plugins/default-panel-registry.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SettingsPrimaryPane } from '@alilc/lowcode-editor-skeleton';
33
import DesignerPlugin from '@alilc/lowcode-plugin-designer';
44

55
// 注册默认的面板
6-
export const defaultPanelRegistry = (editor: any, designer: any) => {
6+
export const defaultPanelRegistry = (editor: any) => {
77
const fun = (ctx: IPublicModelPluginContext) => {
88
return {
99
init() {

packages/types/src/shell/model/window.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ export interface IPublicModelWindow {
88
changeViewType(viewName: string): void;
99

1010
/** 调用当前窗口视图保存钩子 */
11-
save(): Promise<{
12-
[viewName: string]: IPublicTypeNodeSchema | any;
13-
}>;
11+
save(): Promise<any>;
1412
}

0 commit comments

Comments
 (0)