-
+
);
}
diff --git a/packages/editor-skeleton/src/components/field/index.less b/packages/editor-skeleton/src/components/field/index.less
index 6e4cc3560..cc5f0139f 100644
--- a/packages/editor-skeleton/src/components/field/index.less
+++ b/packages/editor-skeleton/src/components/field/index.less
@@ -1,6 +1,10 @@
@x-gap: 12px;
@y-gap: 8px;
+.lc-settings-content > .lc-field:first-child > .lc-field-head{
+ border-top: none !important;
+}
+
.lc-field {
.lc-field-head {
display: flex;
@@ -68,17 +72,7 @@
&.lc-inline-field {
display: flex;
align-items: center;
- // for top-level style
- padding: 16px;
- &:first-child{
- padding-top: 16px;
- }
- &:last-child{
- padding-bottom: 16px;
- }
- &+.lc-inline-field{
- padding-top: 0;
- }
+ margin: 12px;
> .lc-field-head {
width: 70px;
@@ -96,11 +90,11 @@
}
}
- &.lc-block-field, &.lc-accordion-field {
+ &.lc-block-field, &.lc-accordion-field, &.lc-entry-field {
display: block;
&:first-child {
> .lc-field-head {
- border-top: none;
+ // border-top: none;
}
}
> .lc-field-head {
@@ -112,7 +106,7 @@
border-top: 1px solid var(--color-line-normal,rgba(31,56,88,.1));
border-bottom: 1px solid var(--color-line-normal,rgba(31,56,88,.1));
color: var(--color-title);
- padding: 0 16px;
+ padding: 0 12px;
user-select: none;
> .lc-field-icon {
@@ -121,18 +115,30 @@
}
> .lc-field-body {
- // padding: @y-gap @x-gap/2;
padding: 12px;
- .lc-inline-field{
- margin-bottom: 12px;
- &:last-child{
+
+ .lc-inline-field {
+ margin: 12px 0;
+
+ &:first-child {
+ margin-top: 0;
+ }
+ &:last-child {
margin-bottom: 0;
}
}
}
- + .lc-inline-field {
- border-top: 1px solid var(--color-line-normal);
+ // + .lc-inline-field {
+ // border-top: 1px solid var(--color-line-normal);
+ // }
+ }
+
+ &.lc-entry-field {
+ margin-bottom: 6px;
+
+ > .lc-field-head {
+ cursor: pointer;
}
}
@@ -153,6 +159,10 @@
&.lc-accordion-field {
position: relative;
+
+ > .lc-field-head {
+ cursor: pointer;
+ }
&.lc-field-is-collapsed {
margin-bottom: 6px;
@@ -179,37 +189,35 @@
// 2rd level reset
.lc-field-body {
- .lc-inline-field {
- // padding: @y-gap @x-gap/2 0 @x-gap/2;
- padding: 0;
- &:first-child {
- padding-top: 0;
- }
- + .lc-accordion-field, +.lc-block-field {
- margin-top: @y-gap;
- }
- }
+ // .lc-inline-field {
+ // &:first-child {
+ // padding-top: 0;
+ // }
+ // + .lc-accordion-field, +.lc-block-field {
+ // margin-top: @y-gap;
+ // }
+ // }
- .lc-field {
- border-top: none !important;
- }
+ // .lc-field {
+ // border-top: none !important;
+ // }
- .lc-accordion-field, .lc-block-field {
- > .lc-field-head {
- padding-left: @x-gap;
- background: var(--color-block-background-light);
- border-bottom: none;
- border-top: none;
- > .lc-field-icon {
- // margin-right: @x-gap/2;
- margin-right: 0;
- }
- }
+ // .lc-accordion-field, .lc-block-field {
+ // > .lc-field-head {
+ // padding-left: @x-gap;
+ // background: var(--color-block-background-light);
+ // border-bottom: none;
+ // border-top: none;
+ // > .lc-field-icon {
+ // // margin-right: @x-gap/2;
+ // margin-right: 0;
+ // }
+ // }
- > .lc-field-body {
- padding: 8px;
- }
- }
+ // > .lc-field-body {
+ // padding: 8px;
+ // }
+ // }
// 3rd level field title width should short
// .lc-field-body .lc-inline-field {
@@ -220,8 +228,8 @@
// }
// }
// }
- >.lc-block-setter {
- flex: 1;
- }
+ // >.lc-block-setter {
+ // flex: 1;
+ // }
}
}
diff --git a/packages/editor-skeleton/src/components/settings/settings-pane.tsx b/packages/editor-skeleton/src/components/settings/settings-pane.tsx
index ac4c1af22..2950aa1de 100644
--- a/packages/editor-skeleton/src/components/settings/settings-pane.tsx
+++ b/packages/editor-skeleton/src/components/settings/settings-pane.tsx
@@ -1,21 +1,30 @@
-import { Component, MouseEvent } from 'react';
-import { shallowIntl, createSetterContent, observer } from '@ali/lowcode-editor-core';
+import { Component, MouseEvent, Fragment } from 'react';
+import { shallowIntl, createSetterContent, observer, obx, Title } from '@ali/lowcode-editor-core';
import { createContent } from '@ali/lowcode-utils';
-import { Field, createField } from '../field';
-import PopupService, { PopupPipe } from '../popup';
+import { createField } from '../field';
import { SkeletonContext } from '../../context';
import { SettingField, isSettingField, SettingTopEntry, SettingEntry } from '@ali/lowcode-designer';
+import { Icon } from '@alifd/next';
import { isSetterConfig, CustomView } from '@ali/lowcode-types';
import { intl } from '../../locale';
-import { Skeleton } from 'editor-skeleton/src/skeleton';
+import { Skeleton } from '../../skeleton';
+import { Stage } from '../../widget/stage';
@observer
class SettingFieldView extends Component<{ field: SettingField }> {
+ static contextType = SkeletonContext;
+
render() {
const { field } = this.props;
const { extraProps } = field;
- const { condition, defaultValue } = extraProps;
- const visible = field.isSingle && typeof condition === 'function' ? condition(field) !== false : true;
+ const { condition, defaultValue, display } = extraProps;
+ let visible;
+ try {
+ visible = field.isSingle && typeof condition === 'function' ? condition(field) !== false : true;
+ } catch (error) {
+ console.error('exception when condition (hidden) is excuted', error);
+ }
+
if (!visible) {
return null;
}
@@ -59,7 +68,26 @@ class SettingFieldView extends Component<{ field: SettingField }> {
value = field.getValue();
}
+ const skeleton = this.context as Skeleton;
+ const { stages } = skeleton;
+
// todo: error handling
+ let stageName;
+ if (display === 'entry') {
+ const stage = stages.add({
+ type: 'Widget',
+ name: field.getNode().id + '_' + field.name.toString(),
+ content: (
+
+ {field.items.map((item, index) => createSettingFieldView(item, field, index))}
+
+ ),
+ props: {
+ title: field.title,
+ },
+ });
+ stageName = stage.name;
+ }
return createField(
{
@@ -69,9 +97,12 @@ class SettingFieldView extends Component<{ field: SettingField }> {
valueState: field.isRequired ? 10 : field.valueState,
onExpandChange: (expandState) => field.setExpanded(expandState),
onClear: () => field.clearValue(),
+ // field: field,
+ // stages,
+ stageName,
...extraProps,
},
- createSetterContent(setterType, {
+ !stageName && createSetterContent(setterType, {
...shallowIntl(setterProps),
forceInline: extraProps.forceInline,
key: field.id,
@@ -104,6 +135,8 @@ class SettingFieldView extends Component<{ field: SettingField }> {
@observer
class SettingGroupView extends Component<{ field: SettingField }> {
+ static contextType = SkeletonContext;
+
shouldComponentUpdate() {
return false;
}
@@ -111,36 +144,54 @@ class SettingGroupView extends Component<{ field: SettingField }> {
render() {
const { field } = this.props;
const { extraProps } = field;
- const { condition } = extraProps;
+ const { condition, display } = extraProps;
const visible = field.isSingle && typeof condition === 'function' ? condition(field) !== false : true;
if (!visible) {
return null;
}
+ const skeleton = this.context as Skeleton;
+ const { stages } = skeleton;
+
+ let stageName;
+ if (display === 'entry') {
+ const stage = stages.add({
+ type: 'Widget',
+ name: field.getNode().id + '_' + field.name.toString(),
+ content: (
+
+ {field.items.map((item, index) => createSettingFieldView(item, field, index))}
+
+ ),
+ props: {
+ title: field.title,
+ },
+ });
+ stageName = stage.name;
+ }
+
// todo: split collapsed state | field.items for optimize
- return (
-
{
- field.setExpanded(expandState);
- }}
- >
- {field.items.map((item, index) => createSettingFieldView(item, field, index))}
-
- );
+ return createField({
+ meta: field.componentMeta?.npm || field.componentMeta?.componentName || '',
+ title: field.title,
+ collapsed: !field.expanded,
+ onExpandChange: (expandState) => field.setExpanded(expandState),
+ // field: field,
+ // stages,
+ stageName,
+ },
+ field.items.map((item, index) => createSettingFieldView(item, field, index)),
+ display);
}
}
export function createSettingFieldView(item: SettingField | CustomView, field: SettingEntry, index?: number) {
if (isSettingField(item)) {
if (item.isGroup) {
- return
;
+ return
;
} else {
- return ;
+ return ;
}
} else {
return createContent(item, { key: index, field });
@@ -155,20 +206,19 @@ export type SettingsPaneProps = {
@observer
export class SettingsPane extends Component {
static contextType = SkeletonContext;
+ @obx
+ private currentStage?: Stage;
+
shouldComponentUpdate() {
return false;
}
- private popupPipe = new PopupPipe();
- private pipe = this.popupPipe.create();
-
private handleClick = (e: MouseEvent) => {
// compatiable vision stageBox
// TODO: optimize these codes
const { usePopup = true } = this.props;
if (!usePopup) return;
const pane = e.currentTarget as HTMLDivElement;
- let entry: any;
function getTarget(node: any): any {
if (!pane.contains(node) || (node.nodeName === 'A' && node.getAttribute('href'))) {
return null;
@@ -176,7 +226,6 @@ export class SettingsPane extends Component {
const target = node.dataset ? node.dataset.stageTarget : null;
if (target) {
- entry = node;
return target;
}
return getTarget(node.parentNode);
@@ -192,22 +241,40 @@ export class SettingsPane extends Component {
}
const stage = skeleton.stages.container.get(target);
if (stage) {
- this.pipe.send(stage.content, stage.title);
- this.pipe.show(entry);
+ if (this.currentStage) {
+ stage.setPrevious(this.currentStage);
+ }
+ this.currentStage = stage;
}
};
+ private popStage() {
+ this.currentStage = this.currentStage?.getPrevious();
+ }
+
render() {
- const { target } = this.props;
- const items = target.items;
+ let { target } = this.props;
+
return (
- {/* todo: add head for single use */}
-
-
- {items.map((item, index) => createSettingFieldView(item, target, index))}
-
-
+ {
+ this.currentStage && (
+
+
+
+
+ )
+ }
+
+ {
+ this.currentStage ? this.currentStage.content : target.items.map((item, index) => createSettingFieldView(item, target, index))
+ }
+
);
}
diff --git a/packages/editor-skeleton/src/components/settings/style.less b/packages/editor-skeleton/src/components/settings/style.less
index a76bfbc78..826e6393d 100644
--- a/packages/editor-skeleton/src/components/settings/style.less
+++ b/packages/editor-skeleton/src/components/settings/style.less
@@ -3,6 +3,42 @@
height: 100%;
overflow: hidden;
+ .lc-settings-content {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 100%;
+ overflow-y: auto;
+ }
+
+ .lc-setting-stage-back + .lc-settings-content {
+ top: 38px;
+ }
+
+ .lc-setting-stage-back {
+ height: 32px;
+ width: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-weight: 500;
+ background: var(--color-block-background-shallow, rgba(31,56,88,.06));
+ color: var(--color-title);
+ padding: 0 16px;
+ user-select: none;
+ position: relative;
+ margin-bottom: 4px;
+ position: absolute;
+
+ .lc-setting-stage-back-icon {
+ position: absolute;
+ left: 8px;
+ top: 8px;
+ color: #8F9BB3;
+ cursor: pointer;
+ }
+ }
+
.lc-settings-notice {
text-align: center;
font-size: 12px;
diff --git a/packages/editor-skeleton/src/transducers/addon-combine.ts b/packages/editor-skeleton/src/transducers/addon-combine.ts
index 35844ab29..dfd206535 100644
--- a/packages/editor-skeleton/src/transducers/addon-combine.ts
+++ b/packages/editor-skeleton/src/transducers/addon-combine.ts
@@ -132,10 +132,11 @@ export default function(metadata: TransformedComponentMetadata): TransformedComp
let l = propsGroup.length;
while (l-- > 0) {
const item = propsGroup[l];
- if (item.type === 'group' && (item.title === '高级' || item.title?.label === '高级')) {
- advanceGroup = item.items || [];
- propsGroup.splice(l, 1);
- } else if (item.name === '__style__' || item.name === 'containerStyle' || item.name === 'pageStyle') {
+ // if (item.type === 'group' && (item.title === '高级' || item.title?.label === '高级')) {
+ // advanceGroup = item.items || [];
+ // propsGroup.splice(l, 1);
+ // }
+ if (item.name === '__style__' || item.name === 'containerStyle' || item.name === 'pageStyle') {
propsGroup.splice(l, 1);
stylesGroup.push(item);
if (item.extraProps?.defaultCollapsed && item.name !== 'containerStyle') {
@@ -212,6 +213,9 @@ export default function(metadata: TransformedComponentMetadata): TransformedComp
}, {
componentName: 'VariableSetter'
}],
+ extraProps: {
+ display: 'block',
+ },
});
}
if (supports.loop !== false) {
@@ -252,18 +256,28 @@ export default function(metadata: TransformedComponentMetadata): TransformedComp
}
},
},
- {
- name: 'key',
- title: '循环 Key',
- setter: [{
- componentName: 'StringSetter',
- }, {
- componentName: 'VariableSetter'
- }],
- },
],
+ extraProps: {
+ display: 'accordion',
+ },
})
}
+ advanceGroup.push({
+ name: 'key',
+ title: {
+ label: '渲染唯一标识(key)',
+ tip: '搭配「条件渲染」或「循环渲染」时使用,和 react 组件中的 key 原理相同,点击查看帮助',
+ docUrl: 'https://yuque.antfin-inc.com/legao/help3.0/ca5in7',
+ },
+ setter: [{
+ componentName: 'StringSetter',
+ }, {
+ componentName: 'VariableSetter'
+ }],
+ extraProps: {
+ display: 'block',
+ },
+ },)
}
if (advanceGroup.length > 0) {
combined.push({
diff --git a/packages/plugin-components-pane/CHANGELOG.md b/packages/plugin-components-pane/CHANGELOG.md
index dffaac9e9..c503d52c8 100644
--- a/packages/plugin-components-pane/CHANGELOG.md
+++ b/packages/plugin-components-pane/CHANGELOG.md
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.36](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.35...@ali/lowcode-plugin-components-pane@0.8.36) (2020-07-29)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-components-pane
+
+
+## [0.8.35](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.34...@ali/lowcode-plugin-components-pane@0.8.35) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-components-pane
+
+
+## [0.8.34](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.33...@ali/lowcode-plugin-components-pane@0.8.34) (2020-07-23)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-components-pane
+
## [0.8.33](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.32...@ali/lowcode-plugin-components-pane@0.8.33) (2020-07-22)
diff --git a/packages/plugin-components-pane/package.json b/packages/plugin-components-pane/package.json
index 8d61f118d..b0cb52123 100644
--- a/packages/plugin-components-pane/package.json
+++ b/packages/plugin-components-pane/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-components-pane",
- "version": "0.8.33",
+ "version": "0.8.36",
"description": "alibaba lowcode editor component-list plugin",
"files": [
"es/",
@@ -20,8 +20,8 @@
],
"author": "xiayang.xy",
"dependencies": {
- "@ali/lowcode-designer": "^0.9.31",
- "@ali/lowcode-editor-core": "^0.8.24",
+ "@ali/lowcode-designer": "^0.9.34",
+ "@ali/lowcode-editor-core": "^0.8.25",
"@ali/lowcode-types": "^0.8.13",
"@ali/ve-component-list": "^1.1.1",
"@alifd/next": "^1.19.19",
diff --git a/packages/plugin-designer/CHANGELOG.md b/packages/plugin-designer/CHANGELOG.md
index a989e6179..650f250be 100644
--- a/packages/plugin-designer/CHANGELOG.md
+++ b/packages/plugin-designer/CHANGELOG.md
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.9.34](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.33...@ali/lowcode-plugin-designer@0.9.34) (2020-07-29)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-designer
+
+
+## [0.9.33](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.32...@ali/lowcode-plugin-designer@0.9.33) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-designer
+
+
+## [0.9.32](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.31...@ali/lowcode-plugin-designer@0.9.32) (2020-07-23)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-designer
+
## [0.9.31](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.30...@ali/lowcode-plugin-designer@0.9.31) (2020-07-22)
diff --git a/packages/plugin-designer/package.json b/packages/plugin-designer/package.json
index d38e5e566..acd8b78e7 100644
--- a/packages/plugin-designer/package.json
+++ b/packages/plugin-designer/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-designer",
- "version": "0.9.31",
+ "version": "0.9.34",
"description": "alibaba lowcode editor designer plugin",
"files": [
"es",
@@ -20,8 +20,8 @@
],
"author": "xiayang.xy",
"dependencies": {
- "@ali/lowcode-designer": "^0.9.31",
- "@ali/lowcode-editor-core": "^0.8.24",
+ "@ali/lowcode-designer": "^0.9.34",
+ "@ali/lowcode-editor-core": "^0.8.25",
"react": "^16.8.1",
"react-dom": "^16.8.1"
},
diff --git a/packages/plugin-event-bind-dialog/CHANGELOG.md b/packages/plugin-event-bind-dialog/CHANGELOG.md
index eda5f9ed7..b179ceeff 100644
--- a/packages/plugin-event-bind-dialog/CHANGELOG.md
+++ b/packages/plugin-event-bind-dialog/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.24](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-event-bind-dialog@0.8.23...@ali/lowcode-plugin-event-bind-dialog@0.8.24) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-event-bind-dialog
+
## [0.8.23](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-event-bind-dialog@0.8.22...@ali/lowcode-plugin-event-bind-dialog@0.8.23) (2020-07-22)
diff --git a/packages/plugin-event-bind-dialog/package.json b/packages/plugin-event-bind-dialog/package.json
index 566115b4a..6a837a28d 100644
--- a/packages/plugin-event-bind-dialog/package.json
+++ b/packages/plugin-event-bind-dialog/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-event-bind-dialog",
- "version": "0.8.23",
+ "version": "0.8.24",
"description": "alibaba lowcode editor event bind dialog plugin",
"files": [
"es",
@@ -19,7 +19,7 @@
],
"author": "zude.hzd",
"dependencies": {
- "@ali/lowcode-editor-core": "^0.8.24",
+ "@ali/lowcode-editor-core": "^0.8.25",
"@ali/lowcode-types": "^0.8.13",
"@alifd/next": "^1.19.16",
"react": "^16.8.1",
diff --git a/packages/plugin-outline-pane/CHANGELOG.md b/packages/plugin-outline-pane/CHANGELOG.md
index 2c1deffac..114e65695 100644
--- a/packages/plugin-outline-pane/CHANGELOG.md
+++ b/packages/plugin-outline-pane/CHANGELOG.md
@@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.40](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.39...@ali/lowcode-plugin-outline-pane@0.8.40) (2020-07-29)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
+
+
+## [0.8.39](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.38...@ali/lowcode-plugin-outline-pane@0.8.39) (2020-07-28)
+
+
+### Bug Fixes
+
+* 🐛 getPrototype is undefined ([95b3409](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/95b3409))
+
+
+
+
+
+## [0.8.38](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.37...@ali/lowcode-plugin-outline-pane@0.8.38) (2020-07-23)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
+
## [0.8.37](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.36...@ali/lowcode-plugin-outline-pane@0.8.37) (2020-07-22)
diff --git a/packages/plugin-outline-pane/package.json b/packages/plugin-outline-pane/package.json
index d774dd08b..9a2d6d41a 100644
--- a/packages/plugin-outline-pane/package.json
+++ b/packages/plugin-outline-pane/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-outline-pane",
- "version": "0.8.37",
+ "version": "0.8.40",
"description": "Outline pane for Ali lowCode engine",
"files": [
"es",
@@ -14,8 +14,8 @@
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
- "@ali/lowcode-designer": "^0.9.31",
- "@ali/lowcode-editor-core": "^0.8.24",
+ "@ali/lowcode-designer": "^0.9.34",
+ "@ali/lowcode-editor-core": "^0.8.25",
"@ali/lowcode-types": "^0.8.13",
"@ali/lowcode-utils": "^0.8.15",
"@alifd/next": "^1.19.16",
diff --git a/packages/plugin-outline-pane/src/views/root-tree-node.tsx b/packages/plugin-outline-pane/src/views/root-tree-node.tsx
index 08f7fee1c..bdaae0c65 100644
--- a/packages/plugin-outline-pane/src/views/root-tree-node.tsx
+++ b/packages/plugin-outline-pane/src/views/root-tree-node.tsx
@@ -29,7 +29,7 @@ class ModalTreeNodeView extends Component<{ treeNode: TreeNode }> {
render() {
const { treeNode } = this.props;
const modalNodes = treeNode.children?.filter((item) => {
- return item.node.getPrototype().isModal();
+ return item.node.getPrototype()?.isModal();
});
if (!modalNodes || modalNodes.length === 0) {
return null;
diff --git a/packages/plugin-sample-logo/CHANGELOG.md b/packages/plugin-sample-logo/CHANGELOG.md
index af2869449..fb5b40aac 100644
--- a/packages/plugin-sample-logo/CHANGELOG.md
+++ b/packages/plugin-sample-logo/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.23](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-logo@0.8.22...@ali/lowcode-plugin-sample-logo@0.8.23) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-sample-logo
+
## [0.8.22](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-logo@0.8.21...@ali/lowcode-plugin-sample-logo@0.8.22) (2020-07-22)
diff --git a/packages/plugin-sample-logo/package.json b/packages/plugin-sample-logo/package.json
index 21d6820d6..f3d8502b7 100644
--- a/packages/plugin-sample-logo/package.json
+++ b/packages/plugin-sample-logo/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-sample-logo",
- "version": "0.8.22",
+ "version": "0.8.23",
"description": "alibaba lowcode editor logo plugin",
"files": [
"es/",
@@ -20,7 +20,7 @@
],
"author": "xiayang.xy",
"dependencies": {
- "@ali/lowcode-editor-core": "^0.8.24",
+ "@ali/lowcode-editor-core": "^0.8.25",
"react": "^16.8.1"
},
"devDependencies": {
diff --git a/packages/plugin-sample-preview/CHANGELOG.md b/packages/plugin-sample-preview/CHANGELOG.md
index 282e3d244..18979e973 100644
--- a/packages/plugin-sample-preview/CHANGELOG.md
+++ b/packages/plugin-sample-preview/CHANGELOG.md
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.38](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.37...@ali/lowcode-plugin-sample-preview@0.8.38) (2020-07-29)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-sample-preview
+
+
+## [0.8.37](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.36...@ali/lowcode-plugin-sample-preview@0.8.37) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-sample-preview
+
+
+## [0.8.36](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.35...@ali/lowcode-plugin-sample-preview@0.8.36) (2020-07-23)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-sample-preview
+
## [0.8.35](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.34...@ali/lowcode-plugin-sample-preview@0.8.35) (2020-07-22)
diff --git a/packages/plugin-sample-preview/package.json b/packages/plugin-sample-preview/package.json
index d7862bec9..5cdd112d6 100644
--- a/packages/plugin-sample-preview/package.json
+++ b/packages/plugin-sample-preview/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-sample-preview",
- "version": "0.8.35",
+ "version": "0.8.38",
"description": "alibaba lowcode editor sample preview plugin",
"files": [
"es",
@@ -18,8 +18,8 @@
"editor"
],
"dependencies": {
- "@ali/lowcode-designer": "^0.9.31",
- "@ali/lowcode-editor-core": "^0.8.24",
+ "@ali/lowcode-designer": "^0.9.34",
+ "@ali/lowcode-editor-core": "^0.8.25",
"@alifd/next": "^1.x",
"react": "^16.8.1"
},
diff --git a/packages/plugin-source-editor/CHANGELOG.md b/packages/plugin-source-editor/CHANGELOG.md
index cc1a3be01..8835f9a52 100644
--- a/packages/plugin-source-editor/CHANGELOG.md
+++ b/packages/plugin-source-editor/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.21](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-source-editor@0.8.20...@ali/lowcode-plugin-source-editor@0.8.21) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-source-editor
+
## [0.8.20](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-source-editor@0.8.19...@ali/lowcode-plugin-source-editor@0.8.20) (2020-07-22)
diff --git a/packages/plugin-source-editor/package.json b/packages/plugin-source-editor/package.json
index 1cea72c9a..6ae6f48e7 100644
--- a/packages/plugin-source-editor/package.json
+++ b/packages/plugin-source-editor/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-source-editor",
- "version": "0.8.20",
+ "version": "0.8.21",
"description": "alibaba lowcode editor source-editor plugin",
"files": [
"es",
@@ -19,7 +19,7 @@
],
"author": "zude.hzd",
"dependencies": {
- "@ali/lowcode-editor-core": "^0.8.24",
+ "@ali/lowcode-editor-core": "^0.8.25",
"@alifd/next": "^1.19.16",
"js-beautify": "^1.10.1",
"prettier": "^1.18.2",
diff --git a/packages/plugin-undo-redo/CHANGELOG.md b/packages/plugin-undo-redo/CHANGELOG.md
index f60335c68..9cc712520 100644
--- a/packages/plugin-undo-redo/CHANGELOG.md
+++ b/packages/plugin-undo-redo/CHANGELOG.md
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.38](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.37...@ali/lowcode-plugin-undo-redo@0.8.38) (2020-07-29)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-undo-redo
+
+
+## [0.8.37](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.36...@ali/lowcode-plugin-undo-redo@0.8.37) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-undo-redo
+
+
+## [0.8.36](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.35...@ali/lowcode-plugin-undo-redo@0.8.36) (2020-07-23)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-undo-redo
+
## [0.8.35](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.34...@ali/lowcode-plugin-undo-redo@0.8.35) (2020-07-22)
diff --git a/packages/plugin-undo-redo/package.json b/packages/plugin-undo-redo/package.json
index 69876c788..3367e6196 100644
--- a/packages/plugin-undo-redo/package.json
+++ b/packages/plugin-undo-redo/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-undo-redo",
- "version": "0.8.35",
+ "version": "0.8.38",
"description": "alibaba lowcode editor undo redo plugin",
"files": [
"es",
@@ -19,9 +19,9 @@
],
"author": "xiayang.xy",
"dependencies": {
- "@ali/lowcode-designer": "^0.9.31",
- "@ali/lowcode-editor-core": "^0.8.24",
- "@ali/lowcode-editor-skeleton": "^0.8.37",
+ "@ali/lowcode-designer": "^0.9.34",
+ "@ali/lowcode-editor-core": "^0.8.25",
+ "@ali/lowcode-editor-skeleton": "^0.8.40",
"@ali/lowcode-types": "^0.8.13",
"@ali/lowcode-utils": "^0.8.15",
"react": "^16.8.1",
diff --git a/packages/plugin-variable-bind-dialog/CHANGELOG.md b/packages/plugin-variable-bind-dialog/CHANGELOG.md
index 365fa709e..604ffe18c 100644
--- a/packages/plugin-variable-bind-dialog/CHANGELOG.md
+++ b/packages/plugin-variable-bind-dialog/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.22](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-variable-bind-dialog@0.8.21...@ali/lowcode-plugin-variable-bind-dialog@0.8.22) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-variable-bind-dialog
+
## [0.8.21](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-variable-bind-dialog@0.8.20...@ali/lowcode-plugin-variable-bind-dialog@0.8.21) (2020-07-22)
diff --git a/packages/plugin-variable-bind-dialog/package.json b/packages/plugin-variable-bind-dialog/package.json
index 966664694..428c8e4cd 100644
--- a/packages/plugin-variable-bind-dialog/package.json
+++ b/packages/plugin-variable-bind-dialog/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-variable-bind-dialog",
- "version": "0.8.21",
+ "version": "0.8.22",
"description": "alibaba lowcode editor variable bind dialog plugin",
"files": [
"es",
@@ -19,7 +19,7 @@
],
"author": "zude.hzd",
"dependencies": {
- "@ali/lowcode-editor-core": "^0.8.24",
+ "@ali/lowcode-editor-core": "^0.8.25",
"@alifd/next": "^1.19.16",
"react": "^16.8.1",
"react-dom": "^16.8.1"
diff --git a/packages/plugin-zh-en/CHANGELOG.md b/packages/plugin-zh-en/CHANGELOG.md
index 24998abd1..5f2ab9f43 100644
--- a/packages/plugin-zh-en/CHANGELOG.md
+++ b/packages/plugin-zh-en/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-zh-en@0.8.25...@ali/lowcode-plugin-zh-en@0.8.26) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-zh-en
+
## [0.8.25](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-zh-en@0.8.24...@ali/lowcode-plugin-zh-en@0.8.25) (2020-07-22)
diff --git a/packages/plugin-zh-en/package.json b/packages/plugin-zh-en/package.json
index bfd198480..6dfd15d59 100644
--- a/packages/plugin-zh-en/package.json
+++ b/packages/plugin-zh-en/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-zh-en",
- "version": "0.8.25",
+ "version": "0.8.26",
"description": "alibaba lowcode editor zhong english plugin",
"files": [
"es",
@@ -14,7 +14,7 @@
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
- "@ali/lowcode-editor-core": "^0.8.24",
+ "@ali/lowcode-editor-core": "^0.8.25",
"@ali/lowcode-types": "^0.8.13",
"@ali/lowcode-utils": "^0.8.15",
"react": "^16.8.1",
diff --git a/packages/rax-simulator-renderer/CHANGELOG.md b/packages/rax-simulator-renderer/CHANGELOG.md
index 21dd145ce..d1c984a55 100644
--- a/packages/rax-simulator-renderer/CHANGELOG.md
+++ b/packages/rax-simulator-renderer/CHANGELOG.md
@@ -3,6 +3,33 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.37](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.36...@ali/lowcode-rax-simulator-renderer@0.8.37) (2020-07-29)
+
+
+### Bug Fixes
+
+* getSuitablePlace ([03e7c57](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/03e7c57))
+
+
+
+
+
+## [0.8.36](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.35...@ali/lowcode-rax-simulator-renderer@0.8.36) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
+
+
+## [0.8.35](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.34...@ali/lowcode-rax-simulator-renderer@0.8.35) (2020-07-23)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
+
## [0.8.34](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.33...@ali/lowcode-rax-simulator-renderer@0.8.34) (2020-07-22)
diff --git a/packages/rax-simulator-renderer/package.json b/packages/rax-simulator-renderer/package.json
index 54507ea83..a07c5c11e 100644
--- a/packages/rax-simulator-renderer/package.json
+++ b/packages/rax-simulator-renderer/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@ali/lowcode-rax-simulator-renderer",
- "version": "0.8.34",
+ "version": "0.8.37",
"description": "rax simulator renderer for alibaba lowcode designer",
"main": "lib/index.js",
"module": "es/index.js",
@@ -14,7 +14,7 @@
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
- "@ali/lowcode-designer": "^0.9.31",
+ "@ali/lowcode-designer": "^0.9.34",
"@ali/lowcode-rax-renderer": "^0.1.6",
"@ali/lowcode-types": "^0.8.13",
"@ali/lowcode-utils": "^0.8.15",
@@ -52,5 +52,6 @@
"require": [
"ts-node/register"
]
- }
+ },
+ "homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-rax-simulator-renderer@0.8.36/build/index.html"
}
diff --git a/packages/react-renderer/CHANGELOG.md b/packages/react-renderer/CHANGELOG.md
index de753369b..bd5db0087 100644
--- a/packages/react-renderer/CHANGELOG.md
+++ b/packages/react-renderer/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.17](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-renderer@0.8.16...@ali/lowcode-react-renderer@0.8.17) (2020-07-29)
+
+
+### Bug Fixes
+
+* slot 兼容问题 + loop key bug fix ([bc64017](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/bc64017))
+
+
+
+
## [0.8.16](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-renderer@0.8.15...@ali/lowcode-react-renderer@0.8.16) (2020-07-22)
diff --git a/packages/react-renderer/package.json b/packages/react-renderer/package.json
index ab26a8e1e..9198f95c2 100644
--- a/packages/react-renderer/package.json
+++ b/packages/react-renderer/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-react-renderer",
- "version": "0.8.16",
+ "version": "0.8.17",
"description": "react renderer for ali lowcode engine",
"main": "lib/index.js",
"module": "es/index.js",
diff --git a/packages/react-renderer/src/engine/base.jsx b/packages/react-renderer/src/engine/base.jsx
index b2456deb4..775e77a9b 100644
--- a/packages/react-renderer/src/engine/base.jsx
+++ b/packages/react-renderer/src/engine/base.jsx
@@ -309,6 +309,8 @@ export default class BaseEngine extends PureComponent {
if (scopeKey && this.__compScopes[scopeKey]) {
props.__scope = this.__compScopes[scopeKey];
}
+ // FIXME 这里清除 key 是为了避免循环渲染中更改 key 导致的渲染重复
+ props.key = '';
if (schema.__ctx && schema.__ctx.lunaKey) {
if (!isFileSchema(schema)) {
engine && engine.props.onCompGetCtx(schema, self);
@@ -317,6 +319,7 @@ export default class BaseEngine extends PureComponent {
} else if (typeof idx === 'number' && !props.key) {
props.key = idx;
}
+
props.__id = schema.id;
const renderComp = (props) => {
return engine.createElement(
diff --git a/packages/react-simulator-renderer/CHANGELOG.md b/packages/react-simulator-renderer/CHANGELOG.md
index ba33dcec4..0ed87eaaa 100644
--- a/packages/react-simulator-renderer/CHANGELOG.md
+++ b/packages/react-simulator-renderer/CHANGELOG.md
@@ -3,6 +3,30 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [0.8.40](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.39...@ali/lowcode-react-simulator-renderer@0.8.40) (2020-07-29)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
+
+
+## [0.8.39](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.38...@ali/lowcode-react-simulator-renderer@0.8.39) (2020-07-28)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
+
+
+## [0.8.38](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.37...@ali/lowcode-react-simulator-renderer@0.8.38) (2020-07-23)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
+
## [0.8.37](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.36...@ali/lowcode-react-simulator-renderer@0.8.37) (2020-07-22)
diff --git a/packages/react-simulator-renderer/package.json b/packages/react-simulator-renderer/package.json
index 859da7eb8..e51bc8ba7 100644
--- a/packages/react-simulator-renderer/package.json
+++ b/packages/react-simulator-renderer/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@ali/lowcode-react-simulator-renderer",
- "version": "0.8.37",
+ "version": "0.8.40",
"description": "react simulator renderer for alibaba lowcode designer",
"main": "lib/index.js",
"module": "es/index.js",
@@ -13,8 +13,8 @@
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
- "@ali/lowcode-designer": "^0.9.31",
- "@ali/lowcode-react-renderer": "^0.8.16",
+ "@ali/lowcode-designer": "^0.9.34",
+ "@ali/lowcode-react-renderer": "^0.8.17",
"@ali/lowcode-types": "^0.8.13",
"@ali/lowcode-utils": "^0.8.15",
"@ali/vu-css-style": "^1.0.2",
diff --git a/packages/react-simulator-renderer/src/renderer.ts b/packages/react-simulator-renderer/src/renderer.ts
index afe970ef7..ca6022274 100644
--- a/packages/react-simulator-renderer/src/renderer.ts
+++ b/packages/react-simulator-renderer/src/renderer.ts
@@ -213,55 +213,77 @@ export class SimulatorRenderer implements BuiltinSimulatorRenderer {
}
createComponent(schema: ComponentSchema): Component | null {
- const _schema = {
+ let _schema: any = {
...schema,
};
_schema.methods = {};
_schema.lifeCycles = {};
+ const node = host.document.createNode(_schema);
+ _schema = node.export(TransformStage.Render);
+
const processPropsSchema = (propsSchema: any, propsMap: any): any => {
if (!propsSchema) {
return {};
}
- const result = { ...propsSchema };
+ let result = { ...propsSchema };
const reg = /^(?:this\.props|props)\.(\S+)$/;
- Object.keys(propsSchema).map((key: string) => {
- if (propsSchema[key].type === 'JSExpression') {
- const { value } = propsSchema[key];
+ Object.keys(result).map((key: string) => {
+ if (result[key].type === 'JSExpression') {
+ const { value } = result[key];
const matched = reg.exec(value);
if (matched) {
const propName = matched[1];
result[key] = propsMap[propName];
}
+ } else if (result[key].type === 'JSSlot') {
+ const schema = result[key].value;
+ result[key] = createElement(Ele, {schema, propsMap: {}});
}
});
+
return result;
};
- const getElement = (componentsMap: any, schema: any, propsMap: any): ReactElement => {
- const Com = componentsMap[schema.componentName];
- let children = null;
- if (schema.children && schema.children.length > 0) {
- children = schema.children.map((item: any) => getElement(componentsMap, item, propsMap));
- }
- const _leaf = host.document.designer.currentDocument?.createNode(schema);
- const node = host.document.createNode(schema);
- let { props } = schema;
- props = host.document.designer.transformProps(props, node, TransformStage.Init);
- props = host.document.designer.transformProps(props, node, TransformStage.Upgrade);
- props = processPropsSchema(props, propsMap);
- props = host.document.designer.transformProps(props, node, TransformStage.Render);
- return createElement(Com, { ...props, _leaf }, children);
- };
-
const renderer = this;
+ const componentsMap = renderer.componentsMap;
+
+ class Ele extends React.Component<{ schema: any, propsMap: any }> {
+ private isModal: boolean;
+
+ constructor(props: any){
+ super(props);
+ const componentMeta = host.document.getComponentMeta(props.schema.componentName);
+ if (componentMeta?.prototype?.isModal()) {
+ this.isModal = true;
+ return;
+ }
+ }
+
+ render() {
+ if (this.isModal) {
+ return null;
+ }
+ const { schema, propsMap } = this.props;
+ const Com = componentsMap[schema.componentName];
+ let children = null;
+ if (schema.children && schema.children.length > 0) {
+ children = schema.children.map((item: any) => createElement(Ele, {schema: item, propsMap}));
+ }
+ const props = processPropsSchema(schema.props, propsMap);
+ const _leaf = host.document.createNode(schema);
+
+ return createElement(Com, {...props, _leaf}, children);
+ }
+ }
+
class Com extends React.Component {
render() {
- const componentsMap = renderer.componentsMap;
- let children = null;
+ let children = [];
+ const propsMap = this.props;
if (_schema.children && Array.isArray(_schema.children)) {
- children = _schema.children?.map((item: any) => getElement(componentsMap, item, this.props));
+ children = _schema.children.map((item: any) => createElement(Ele, {schema: item, propsMap}));
}
return createElement(React.Fragment, {}, children);
}