GeezerVison is showing github.com — fix: project.exportSchema api lack stage param & setAssets should be … · profencer/lowcode-engine@0ea76a7
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/designer/src/project/project.ts +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import { EventEmitter } from 'events'; | 2 | 2 | import { obx, computed, makeObservable, action } from '@alilc/lowcode-editor-core'; | 3 | 3 | import { Designer } from '../designer'; | 4 | 4 | import { DocumentModel, isDocumentModel, isPageSchema } from '../document'; | 5 | | -import { ProjectSchema, RootSchema } from '@alilc/lowcode-types'; | | 5 | +import { ProjectSchema, RootSchema, TransformStage } from '@alilc/lowcode-types'; | 6 | 6 | import { ISimulatorHost } from '../simulator'; | 7 | 7 |
| 8 | 8 | export class Project { | @@ -52,12 +52,12 @@ export class Project { | 52 | 52 | /** | 53 | 53 | * 获取项目整体 schema | 54 | 54 | */ | 55 | | - getSchema(): ProjectSchema { | | 55 | + getSchema(stage: TransformStage = TransformStage.Render): ProjectSchema { | 56 | 56 | return { | 57 | 57 | ...this.data, | 58 | 58 | // TODO: future change this filter | 59 | 59 | componentsMap: this.currentDocument?.getComponentsMap(), | 60 | | - componentsTree: this.documents.filter((doc) => !doc.isBlank()).map((doc) => doc.schema), | | 60 | + componentsTree: this.documents.filter((doc) => !doc.isBlank()).map((doc) => doc.export(stage)), | 61 | 61 | i18n: this.i18n, | 62 | 62 | }; | 63 | 63 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/renderer-core/src/hoc/leaf.tsx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -238,7 +238,7 @@ export function leafWrapper(Comp: types.IBaseRenderComponent, { | 238 | 238 | const { | 239 | 239 | hidden = false, | 240 | 240 | condition = true, | 241 | | - } = this.leaf?.schema || {}; | | 241 | + } = this.leaf?.export(TransformStage.Render) || {}; | 242 | 242 | return { | 243 | 243 | nodeChildren: null, | 244 | 244 | childrenInState: false, | |
Collapse file Copy file name to clipboardExpand all lines: packages/shell/src/material.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,8 +34,8 @@ export default class Material { | 34 | 34 | * @param assets | 35 | 35 | * @returns | 36 | 36 | */ | 37 | | - setAssets(assets: AssetsJson) { | 38 | | - return this[editorSymbol].setAssets(assets); | | 37 | + async setAssets(assets: AssetsJson) { | | 38 | + return await this[editorSymbol].setAssets(assets); | 39 | 39 | } | 40 | 40 |
| 41 | 41 | /** | |
Collapse file Copy file name to clipboardExpand all lines: packages/shell/src/project.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -103,8 +103,8 @@ export default class Project { | 103 | 103 | * 导出 project | 104 | 104 | * @returns | 105 | 105 | */ | 106 | | - exportSchema() { | 107 | | - return this[projectSymbol].getSchema(); | | 106 | + exportSchema(stage: TransformStage = TransformStage.Render) { | | 107 | + return this[projectSymbol].getSchema(stage); | 108 | 108 | } | 109 | 109 |
| 110 | 110 | /** | |
|