Skip to content

Commit 23af4b7

Browse files
committed
fix: plugin-schema export issue
1 parent 97794f6 commit 23af4b7

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

packages/plugin-schema/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.1 / 2022-04-26
2+
3+
* Fix [schema export issue](https://github.com/alibaba/lowcode-engine/issues/367)
4+
15
## 1.0.0 / 2022-02-16
26

37
* publish following changes

packages/plugin-schema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@alilc/lowcode-plugin-schema",
33
"author": "alvarto",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"description": "Show schema in lowcode editor",
66
"files": [
77
"es",

packages/plugin-schema/src/editor.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import MonacoEditor from '@alilc/lowcode-plugin-base-monaco-editor';
44

55
import { Dialog, Message, Button } from '@alifd/next';
66

7+
import { common } from '@alilc/lowcode-engine'
78
import { Project, Skeleton, Event } from '@alilc/lowcode-shell';
89
import { IEditorInstance } from '@alilc/lowcode-plugin-base-monaco-editor/lib/helper';
910

@@ -16,7 +17,7 @@ interface PluginCodeDiffProps {
1617
export default function PluginSchema({ project, skeleton, event }: PluginCodeDiffProps) {
1718
const [editorSize, setEditorSize] = useState({ width: 0, height: 0 });
1819
const [schemaValue, setSchemaValue] = useState(() => {
19-
const schema = project.exportSchema()
20+
const schema = project.exportSchema(common.designerCabin.TransformStage.Save)
2021
return schema?.componentsTree?.[0] ? JSON.stringify(schema.componentsTree[0], null, 2) : ''
2122
});
2223
const monacoEditorRef = useRef<IEditorInstance>();
@@ -31,7 +32,7 @@ export default function PluginSchema({ project, skeleton, event }: PluginCodeDif
3132
useEffect(() => {
3233
event.on('skeleton.panel-dock.active', (pluginName) => {
3334
if (pluginName == 'LowcodePluginAliLowcodePluginSchema') {
34-
const schema = project.exportSchema()
35+
const schema = project.exportSchema(common.designerCabin.TransformStage.Save)
3536
const str = schema?.componentsTree?.[0] ? JSON.stringify(schema.componentsTree[0], null, 2) : ''
3637
setSchemaValue(str);
3738
}
@@ -60,7 +61,7 @@ export default function PluginSchema({ project, skeleton, event }: PluginCodeDif
6061
}
6162

6263
project.importSchema({
63-
...project.exportSchema(),
64+
...project.exportSchema(common.designerCabin.TransformStage.Save),
6465
componentsTree: [json],
6566
});
6667
Message.success('Schema Saved!');

0 commit comments

Comments
 (0)