X Tutup
Skip to content

Commit a0033a0

Browse files
committed
fix: dataSource pane export schema
1 parent 55bf1d6 commit a0033a0

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

packages/plugin-datasource-pane/src/classname-setter/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { PureComponent } from 'react';
22
import PropTypes from 'prop-types';
33
import { Select } from '@alifd/next';
4+
import { common } from '@alilc/lowcode-engine';
45

56
interface Color {
67
rgb: any;
@@ -27,7 +28,7 @@ export default class ClassNameView extends PureComponent<PluginProps> {
2728

2829
getClassNameList = () => {
2930
const { project } = this.context;
30-
const schema = project.exportSchema();
31+
const schema = project.exportSchema(common.designerCabin.TransformStage.Save);
3132
const { css } = schema.componentsTree[0];
3233
const classNameList = [];
3334
const re = /\.?\w+[^{]+\{[^}]*\}/g;

packages/plugin-datasource-pane/src/components/ClassNameView/ClassNameView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { PureComponent } from 'react';
22
import PropTypes from 'prop-types';
33
import { Select } from '@alifd/next';
4-
4+
import { common } from '@alilc/lowcode-engine';
55

66
export interface PluginProps {
77
value: string;
@@ -30,7 +30,7 @@ export default class ClassNameView extends PureComponent<PluginProps, ClassNameV
3030

3131
getClassNameList = () => {
3232
const { project } = this.context;
33-
const schema = project.exportSchema();
33+
const schema = project.exportSchema(common.designerCabin.TransformStage.Save);
3434
const { css } = schema.componentsTree[0];
3535
const classNameList: string[] = [];
3636
const re = /\.?\w+[^{]+\{[^}]*\}/g;

packages/plugin-datasource-pane/src/pane/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { isSchemaValid, correctSchema } from '../utils/schema';
2424
import { createStateService } from '../utils/stateMachine';
2525
import { DataSourcePaneContext } from '../utils/panel-context';
2626
import { mergeTwoObjectListByKey } from '../utils/misc';
27+
import { common } from '@alilc/lowcode-engine';
2728

2829
import './index.scss';
2930

@@ -119,7 +120,7 @@ export default class DataSourcePanePlugin extends PureComponent<
119120
handleSchemaChange = (schema: DataSource) => {
120121
const { project, onSchemaChange } = this.props;
121122
if (project) {
122-
const docSchema = project.exportSchema();
123+
const docSchema = project.exportSchema(common.designerCabin.TransformStage.Save);
123124
if (!_isEmpty(docSchema)) {
124125
_set(docSchema, 'componentsTree[0].dataSource', schema);
125126
project.importSchema(docSchema);
@@ -148,7 +149,7 @@ export default class DataSourcePanePlugin extends PureComponent<
148149

149150
if (!active) return null;
150151

151-
const projectSchema = project.exportSchema() ?? {};
152+
const projectSchema = project.exportSchema(common.designerCabin.TransformStage.Save) ?? {};
152153
let schema = defaultSchema;
153154
if (_isFunction(defaultSchema)) {
154155
schema = defaultSchema();

0 commit comments

Comments
 (0)
X Tutup