this.unactive(name));
+ }
+
add(item: T | G): T {
item = this.handle(item);
const origin = this.get(item.name);
diff --git a/packages/ignitor/CHANGELOG.md b/packages/ignitor/CHANGELOG.md
index ca7326dcc..5a921a83c 100644
--- a/packages/ignitor/CHANGELOG.md
+++ b/packages/ignitor/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-ignitor
+
+
+## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-ignitor
+
## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-14)
diff --git a/packages/ignitor/package.json b/packages/ignitor/package.json
index 8b057130e..34692758f 100644
--- a/packages/ignitor/package.json
+++ b/packages/ignitor/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-ignitor",
- "version": "1.0.24-beta.4",
+ "version": "1.0.26-beta.0",
"description": "点火器,bootstrap lce project",
"main": "lib/index.js",
"private": true,
diff --git a/packages/plugin-designer/CHANGELOG.md b/packages/plugin-designer/CHANGELOG.md
index 30cdcefc1..ca516d861 100644
--- a/packages/plugin-designer/CHANGELOG.md
+++ b/packages/plugin-designer/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-designer
+
+
+## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-designer
+
## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-14)
diff --git a/packages/plugin-designer/package.json b/packages/plugin-designer/package.json
index f7c2e911e..f799d2018 100644
--- a/packages/plugin-designer/package.json
+++ b/packages/plugin-designer/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-designer",
- "version": "1.0.24-beta.4",
+ "version": "1.0.26-beta.0",
"description": "alibaba lowcode editor designer plugin",
"files": [
"es",
@@ -20,8 +20,8 @@
],
"author": "xiayang.xy",
"dependencies": {
- "@ali/lowcode-designer": "^1.0.24-beta.4",
- "@ali/lowcode-editor-core": "^1.0.24-beta.4",
+ "@ali/lowcode-designer": "^1.0.26-beta.0",
+ "@ali/lowcode-editor-core": "^1.0.26-beta.0",
"react": "^16.8.1",
"react-dom": "^16.8.1"
},
diff --git a/packages/plugin-outline-pane/CHANGELOG.md b/packages/plugin-outline-pane/CHANGELOG.md
index 8756fecec..8df17dbba 100644
--- a/packages/plugin-outline-pane/CHANGELOG.md
+++ b/packages/plugin-outline-pane/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
+
+
+## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
+
## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-14)
diff --git a/packages/plugin-outline-pane/package.json b/packages/plugin-outline-pane/package.json
index 3b96342c9..4e00dc602 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": "1.0.24-beta.4",
+ "version": "1.0.26-beta.0",
"description": "Outline pane for Ali lowCode engine",
"files": [
"es",
@@ -14,10 +14,10 @@
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
- "@ali/lowcode-designer": "^1.0.24-beta.4",
- "@ali/lowcode-editor-core": "^1.0.24-beta.4",
- "@ali/lowcode-types": "^1.0.24-beta.4",
- "@ali/lowcode-utils": "^1.0.24-beta.4",
+ "@ali/lowcode-designer": "^1.0.26-beta.0",
+ "@ali/lowcode-editor-core": "^1.0.26-beta.0",
+ "@ali/lowcode-types": "^1.0.26-beta.0",
+ "@ali/lowcode-utils": "^1.0.26-beta.0",
"@alifd/next": "^1.19.16",
"classnames": "^2.2.6",
"react": "^16",
diff --git a/packages/rax-render/CHANGELOG.md b/packages/rax-render/CHANGELOG.md
index 40a07101e..07b365584 100644
--- a/packages/rax-render/CHANGELOG.md
+++ b/packages/rax-render/CHANGELOG.md
@@ -3,7 +3,26 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
-
+
+## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
+
+
+### Bug Fixes
+
+* rax perf ([3abe2ab](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/3abe2ab))
+
+
+
+
+
+## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-rax-renderer
+
+
## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-14)
@@ -11,7 +30,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
**Note:** Version bump only for package @ali/lowcode-rax-renderer
-
+
## [1.0.24-beta.3](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.2...v1.0.24-beta.3) (2020-12-11)
diff --git a/packages/rax-render/package.json b/packages/rax-render/package.json
index 36c77be0e..d3fe2816a 100644
--- a/packages/rax-render/package.json
+++ b/packages/rax-render/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-rax-renderer",
- "version": "1.0.24-beta.4",
+ "version": "1.0.26-beta.0",
"description": "Rax renderer for Ali lowCode engine",
"main": "lib/index.js",
"module": "lib/index.js",
@@ -37,7 +37,7 @@
"@ali/bzb-request": "2.6.1",
"@ali/lib-mtop": "^2.5.1",
"@ali/lowcode-datasource-engine": "^1.0.22",
- "@ali/lowcode-utils": "^1.0.24-beta.4",
+ "@ali/lowcode-utils": "^1.0.26-beta.0",
"@ali/ui-table": "^1.0.1-beta.6",
"classnames": "^2.2.6",
"debug": "^4.1.1",
diff --git a/packages/rax-render/src/comp/Div.ts b/packages/rax-render/src/comp/Div.ts
new file mode 100644
index 000000000..8db0dbd15
--- /dev/null
+++ b/packages/rax-render/src/comp/Div.ts
@@ -0,0 +1,11 @@
+import { createElement, PureComponent } from 'rax';
+
+export default class DivView extends PureComponent {
+ static displayName = 'Div';
+
+ static version = '0.0.0';
+
+ render(): any {
+ return createElement('div', this.props);
+ }
+}
diff --git a/packages/rax-render/src/engine/base.tsx b/packages/rax-render/src/engine/base.tsx
index f097a147f..c87a688da 100644
--- a/packages/rax-render/src/engine/base.tsx
+++ b/packages/rax-render/src/engine/base.tsx
@@ -23,6 +23,7 @@ import {
getFileCssName,
} from '../utils';
import VisualDom from '../comp/visualDom';
+import Div from '../comp/Div';
import AppContext from '../context/appContext';
import compWrapper from '../hoc/compWrapper';
@@ -248,185 +249,214 @@ export default class BaseEngine extends Component {
// parentInfo 父组件的信息,包含schema和Comp
// idx 若为循环渲染的循环Index
__createVirtualDom = (schema, self, parentInfo, idx) => {
- if (!schema) return null;
- // rax text prop 兼容处理
- if (schema.componentName === 'Text') {
- if (typeof schema.props.text === 'string') {
- schema = { ...schema };
- schema.children = [schema.props.text];
- }
- }
-
- const { __appHelper: appHelper, __components: components = {}, __componentsMap: componentsMap = {} } = this.props || {};
const { engine } = this.context || {};
- if (isJSExpression(schema)) {
- return parseExpression(schema, self);
- }
- if (typeof schema === 'string') return schema;
- if (typeof schema === 'number' || typeof schema === 'boolean') {
- return schema.toString();
- }
- if (Array.isArray(schema)) {
- if (schema.length === 1) return this.__createVirtualDom(schema[0], self, parentInfo);
- return schema.map((item, idx) => this.__createVirtualDom(item, self, parentInfo, item && item.__ctx && item.__ctx.lunaKey ? '' : idx));
- }
+ try {
+ if (!schema) return null;
+ if (schema.componentName === 'Text') { // 这个是不是不应该在这里处理
+ if (typeof schema.props.text === 'string') {
+ schema = { ...schema };
+ schema.children = [schema.props.text];
+ }
+ }
- // 解析占位组件
- if (schema.componentName === 'Flagment' && schema.children) {
- const tarChildren = isJSExpression(schema.children) ? parseExpression(schema.children, self) : schema.children;
- return this.__createVirtualDom(tarChildren, self, parentInfo);
- }
+ const { __appHelper: appHelper, __components: components = {} } = this.props || {};
- if (schema.$$typeof) {
- return schema;
- }
- if (!isSchema(schema)) return null;
- let Comp = components[schema.componentName] || engine.getNotFoundComponent();
+ if (isJSExpression(schema)) {
+ return parseExpression(schema, self);
+ }
+ if (isJSSlot(schema)) {
+ return this.__createVirtualDom(schema.value, self, parentInfo);
+ }
+ if (typeof schema === 'string') return schema;
+ if (typeof schema === 'number' || typeof schema === 'boolean') {
+ return schema.toString();
+ }
+ if (Array.isArray(schema)) {
+ if (schema.length === 1) return this.__createVirtualDom(schema[0], self, parentInfo);
+ return schema.map((item, idy) => this.__createVirtualDom(item, self, parentInfo, item && item.__ctx && item.__ctx.lunaKey ? '' : idy));
+ }
+ // FIXME
+ const _children = this.getSchemaChildren(schema);
+ // 解析占位组件
+ if (schema.componentName === 'Flagment' && _children) {
+ const tarChildren = isJSExpression(_children) ? parseExpression(_children, self) : _children;
+ return this.__createVirtualDom(tarChildren, self, parentInfo);
+ }
- if (schema.hidden) {
- return null;
- }
+ if (schema.$$typeof) {
+ return schema;
+ }
+ if (!isSchema(schema)) return null;
+ let Comp = components[schema.componentName] || engine.getNotFoundComponent();
- if (schema.loop !== undefined) {
- return this.__createLoopVirtualDom(
- {
- ...schema,
- loop: parseData(schema.loop, self),
- },
+ if (schema.hidden) {
+ return null;
+ }
+
+ if (schema.loop != null) {
+ const loop = parseData(schema.loop, self);
+ if ((Array.isArray(loop) && loop.length > 0) || isJSExpression(loop)) {
+ return this.__createLoopVirtualDom(
+ {
+ ...schema,
+ loop,
+ },
+ self,
+ parentInfo,
+ idx,
+ );
+ }
+ }
+ const condition = schema.condition == null ? true : parseData(schema.condition, self);
+ if (!condition) return null;
+
+ let scopeKey = '';
+ // 判断组件是否需要生成scope,且只生成一次,挂在this.__compScopes上
+ if (Comp.generateScope) {
+ const key = parseExpression(schema.props.key, self);
+ if (key) {
+ // 如果组件自己设置key则使用组件自己的key
+ scopeKey = key;
+ } else if (!schema.__ctx) {
+ // 在生产环境schema没有__ctx上下文,需要手动生成一个lunaKey
+ schema.__ctx = {
+ lunaKey: `luna${++scopeIdx}`,
+ };
+ scopeKey = schema.__ctx.lunaKey;
+ } else {
+ // 需要判断循环的情况
+ scopeKey = schema.__ctx.lunaKey + (idx !== undefined ? `_${idx}` : '');
+ }
+ if (!this.__compScopes[scopeKey]) {
+ this.__compScopes[scopeKey] = Comp.generateScope(this, schema);
+ }
+ }
+ // 如果组件有设置scope,需要为组件生成一个新的scope上下文
+ if (scopeKey && this.__compScopes[scopeKey]) {
+ const compSelf = { ...this.__compScopes[scopeKey] };
+ compSelf.__proto__ = self;
+ self = compSelf;
+ }
+
+ // 容器类组件的上下文通过props传递,避免context传递带来的嵌套问题
+ const otherProps = isFileSchema(schema)
+ ? {
+ __schema: schema,
+ __appHelper: appHelper,
+ __components: components,
+ }
+ : {};
+ if (engine && engine.props.designMode) {
+ otherProps.__designMode = engine.props.designMode;
+ }
+ const componentInfo = {};
+ const props =
+ this.__parseProps(schema.props, self, '', {
+ schema,
+ Comp,
+ componentInfo: {
+ ...componentInfo,
+ props: transformArrayToMap(componentInfo.props, 'name'),
+ },
+ }) || {};
+ // 对于可以获取到ref的组件做特殊处理
+ if (!acceptsRef(Comp)) {
+ Comp = compWrapper(Comp);
+ }
+ // if (acceptsRef(Comp)) {
+ otherProps.ref = (ref) => {
+ this.$(props.fieldId, ref); // 收集ref
+ const refProps = props.ref;
+ if (refProps && typeof refProps === 'string') {
+ this[refProps] = ref;
+ }
+ ref && engine && engine.props.onCompGetRef(schema, ref);
+ };
+ // }
+ // scope需要传入到组件上
+ 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);
+ }
+ props.key = props.key || `${schema.__ctx.lunaKey}_${schema.__ctx.idx || 0}_${idx !== undefined ? idx : ''}`;
+ } else if (typeof idx === 'number' && !props.key) {
+ props.key = idx;
+ }
+
+ props.__id = schema.id;
+ if (!props.key) {
+ props.key = props.__id;
+ }
+
+ let child = null;
+ if (/*!isFileSchema(schema) && */!!_children) {
+ child = this.__createVirtualDom(
+ isJSExpression(_children) ? parseExpression(_children, self) : _children,
+ self,
+ {
+ schema,
+ Comp,
+ },
+ );
+ }
+ const renderComp = (props) => engine.createElement(Comp, props, child);
+ // 设计模式下的特殊处理
+ if (engine && [DESIGN_MODE.EXTEND, DESIGN_MODE.BORDER].includes(engine.props.designMode)) {
+ // 对于overlay,dialog等组件为了使其在设计模式下显示,外层需要增加一个div容器
+ if (OVERLAY_LIST.includes(schema.componentName)) {
+ const { ref, ...overlayProps } = otherProps;
+ return (
+
+ {renderComp({ ...props, ...overlayProps })}
+
+ );
+ }
+ // 虚拟dom显示
+ if (componentInfo && componentInfo.parentRule) {
+ const parentList = componentInfo.parentRule.split(',');
+ const { schema: parentSchema, Comp: parentComp } = parentInfo;
+ if (
+ !parentList.includes(parentSchema.componentName) ||
+ parentComp !== components[parentSchema.componentName]
+ ) {
+ props.__componentName = schema.componentName;
+ Comp = VisualDom;
+ } else {
+ // 若虚拟dom在正常的渲染上下文中,就不显示设计模式了
+ props.__disableDesignMode = true;
+ }
+ }
+ }
+ return renderComp({ ...props, ...otherProps });
+ } catch (e) {
+ return engine.createElement(engine.getFaultComponent(), {
+ error: e,
+ schema,
self,
parentInfo,
idx,
- );
+ });
}
- const condition = schema.condition === undefined ? true : parseData(schema.condition, self);
- if (!condition) return null;
+ };
- let scopeKey = '';
- // 判断组件是否需要生成scope,且只生成一次,挂在this.__compScopes上
- if (Comp.generateScope) {
- const key = parseExpression(schema.props.key, self);
- if (key) {
- // 如果组件自己设置key则使用组件自己的key
- scopeKey = key;
- } else if (!schema.__ctx) {
- // 在生产环境schema没有__ctx上下文,需要手动生成一个lunaKey
- schema.__ctx = {
- lunaKey: `luna${++scopeIdx}`,
- };
- scopeKey = schema.__ctx.lunaKey;
- } else {
- // 需要判断循环的情况
- scopeKey = schema.__ctx.lunaKey + (idx !== undefined ? `_${idx}` : '');
- }
- if (!this.__compScopes[scopeKey]) {
- this.__compScopes[scopeKey] = Comp.generateScope(this, schema);
- }
+ getSchemaChildren = (schema) => {
+ if (!schema || !schema.props) {
+ return schema?.children;
}
- // 如果组件有设置scope,需要为组件生成一个新的scope上下文
- if (scopeKey && this.__compScopes[scopeKey]) {
- const compSelf = { ...this.__compScopes[scopeKey] };
- compSelf.__proto__ = self;
- self = compSelf;
+ if (!schema.children) return schema.props.children;
+ if (!schema.props.children) return schema.children;
+ let _children = [].concat(schema.children);
+ if (Array.isArray(schema.props.children)) {
+ _children = _children.concat(schema.props.children);
+ } else {
+ _children.push(schema.props.children);
}
-
- // 容器类组件的上下文通过props传递,避免context传递带来的嵌套问题
- const otherProps = isFileSchema(schema)
- ? {
- __schema: schema,
- __appHelper: appHelper,
- __components: components,
- }
- : {};
- if (engine && engine.props.designMode) {
- otherProps.__designMode = engine.props.designMode;
- }
- const componentInfo = componentsMap[schema.componentName] || {};
- const props = this.__parseProps(schema.props, self, '', {
- schema,
- Comp,
- componentInfo: {
- ...componentInfo,
- props: transformArrayToMap(componentInfo.props, 'name'),
- },
- });
- // 对于可以获取到ref的组件做特殊处理
- if (!acceptsRef(Comp)) {
- Comp = compWrapper(Comp);
- }
- otherProps.ref = (ref) => {
- this.$(props.fieldId, ref); // 收集ref
- const refProps = props.ref;
- if (refProps && typeof refProps === 'string') {
- this[refProps] = ref;
- }
- engine && engine.props.onCompGetRef(schema, ref);
- };
-
- // scope需要传入到组件上
- if (scopeKey && this.__compScopes[scopeKey]) {
- props.__scope = this.__compScopes[scopeKey];
- }
- if (schema.__ctx && schema.__ctx.lunaKey) {
- if (!isFileSchema(schema)) {
- engine && engine.props.onCompGetCtx(schema, self);
- }
- props.key = props.key || `${schema.__ctx.lunaKey}_${schema.__ctx.idx || 0}_${idx !== undefined ? idx : ''}`;
- } else if (typeof idx === 'number' && !props.key) {
- props.key = idx;
- }
- props.__id = schema.id;
-
- if (!isFileSchema(schema) && schema.children) {
- this.__createVirtualDom(
- isJSExpression(schema.children) ? parseExpression(schema.children, self) : schema.children,
- self,
- {
- schema,
- Comp,
- },
- );
- }
-
- const renderComp = (props) => engine.createElement(
- Comp,
- props,
- (!isFileSchema(schema) &&
- !!schema.children &&
- this.__createVirtualDom(
- isJSExpression(schema.children) ? parseExpression(schema.children, self) : schema.children,
- self,
- {
- schema,
- Comp,
- },
- ))
- || null,
- );
- // 设计模式下的特殊处理
- if (engine && [DESIGN_MODE.EXTEND, DESIGN_MODE.BORDER].includes(engine.props.designMode)) {
- // 对于overlay,dialog等组件为了使其在设计模式下显示,外层需要增加一个div容器
- if (OVERLAY_LIST.includes(schema.componentName)) {
- const { ref, ...overlayProps } = otherProps;
- return (
-
- {renderComp({ ...props, ...overlayProps })}
-
- );
- }
- // 虚拟dom显示
- if (componentInfo && componentInfo.parentRule) {
- const parentList = componentInfo.parentRule.split(',');
- const { schema: parentSchema, Comp: parentComp } = parentInfo;
- if (!parentList.includes(parentSchema.componentName) || parentComp !== components[parentSchema.componentName]) {
- props.__componentName = schema.componentName;
- Comp = VisualDom;
- } else {
- // 若虚拟dom在正常的渲染上下文中,就不显示设计模式了
- props.__disableDesignMode = true;
- }
- }
- }
- return renderComp({ ...props, ...otherProps });
+ return _children;
};
__createLoopVirtualDom = (schema, self, parentInfo, idx) => {
diff --git a/packages/rax-simulator-renderer/CHANGELOG.md b/packages/rax-simulator-renderer/CHANGELOG.md
index 9737c2763..266405338 100644
--- a/packages/rax-simulator-renderer/CHANGELOG.md
+++ b/packages/rax-simulator-renderer/CHANGELOG.md
@@ -3,6 +3,31 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
+
+
+### Bug Fixes
+
+* requestHandlersMap 没有加到 appContext 里 ([a8d43c3](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/a8d43c3))
+* simulator-renderer 补充丢失代码 ([67dd7e2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/67dd7e2))
+
+
+### Features
+
+* 支持 build sourceMap, 方便用户调试 ([6bf75cd](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/6bf75cd))
+
+
+
+
+
+## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
+
## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-14)
diff --git a/packages/rax-simulator-renderer/build.json b/packages/rax-simulator-renderer/build.json
index 70f118bdf..59f913b34 100644
--- a/packages/rax-simulator-renderer/build.json
+++ b/packages/rax-simulator-renderer/build.json
@@ -1,4 +1,5 @@
{
+ "sourceMap": true,
"plugins": [
[
"build-plugin-component",
diff --git a/packages/rax-simulator-renderer/package.json b/packages/rax-simulator-renderer/package.json
index 7f51d7cd6..0dc9eb257 100644
--- a/packages/rax-simulator-renderer/package.json
+++ b/packages/rax-simulator-renderer/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-rax-simulator-renderer",
- "version": "1.0.24-beta.4",
+ "version": "1.0.26-beta.0",
"description": "rax simulator renderer for alibaba lowcode designer",
"main": "lib/index.js",
"module": "es/index.js",
@@ -13,10 +13,10 @@
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
- "@ali/lowcode-designer": "^1.0.24-beta.4",
- "@ali/lowcode-rax-renderer": "^1.0.24-beta.4",
- "@ali/lowcode-types": "^1.0.24-beta.4",
- "@ali/lowcode-utils": "^1.0.24-beta.4",
+ "@ali/lowcode-designer": "^1.0.26-beta.0",
+ "@ali/lowcode-rax-renderer": "^1.0.26-beta.0",
+ "@ali/lowcode-types": "^1.0.26-beta.0",
+ "@ali/lowcode-utils": "^1.0.26-beta.0",
"@ali/recore-rax": "^1.2.4",
"@ali/vu-css-style": "^1.0.2",
"@recore/obx": "^1.0.8",
@@ -57,5 +57,5 @@
"publishConfig": {
"registry": "https://registry.npm.alibaba-inc.com"
},
- "homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-rax-simulator-renderer@1.0.24-beta.3/build/index.html"
+ "homepage": "https://unpkg.alibaba-inc.com/@ali/lowcode-rax-simulator-renderer@1.0.25-beta.1/build/index.html"
}
diff --git a/packages/rax-simulator-renderer/src/renderer.ts b/packages/rax-simulator-renderer/src/renderer.ts
index febfdb2cb..80441d474 100644
--- a/packages/rax-simulator-renderer/src/renderer.ts
+++ b/packages/rax-simulator-renderer/src/renderer.ts
@@ -257,6 +257,9 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
// sync designMode
this._designMode = host.designMode;
+ // sync requestHandlersMap
+ this._requestHandlersMap = host.requestHandlersMap;
+
// sync device
this._device = host.device;
@@ -318,6 +321,7 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
},
},
constants: {},
+ requestHandlersMap: this._requestHandlersMap,
};
host.injectionConsumer.consume((data) => {
// sync utils, i18n, contants,... config
@@ -357,6 +361,10 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
@computed get device() {
return this._device;
}
+ @obx.ref private _requestHandlersMap = null;
+ @computed get requestHandlersMap(): any {
+ return this._requestHandlersMap;
+ }
@obx.ref private _componentsMap = {};
@computed get componentsMap(): any {
return this._componentsMap;
diff --git a/packages/react-renderer/CHANGELOG.md b/packages/react-renderer/CHANGELOG.md
index c29ebd6c4..e15b58fa9 100644
--- a/packages/react-renderer/CHANGELOG.md
+++ b/packages/react-renderer/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-react-renderer
+
+
+## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-react-renderer
+
## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-14)
diff --git a/packages/react-renderer/package.json b/packages/react-renderer/package.json
index 41648d43c..adbce0fcf 100644
--- a/packages/react-renderer/package.json
+++ b/packages/react-renderer/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-react-renderer",
- "version": "1.0.24-beta.4",
+ "version": "1.0.26-beta.0",
"description": "react renderer for ali lowcode engine",
"main": "lib/index.js",
"module": "es/index.js",
diff --git a/packages/react-simulator-renderer/CHANGELOG.md b/packages/react-simulator-renderer/CHANGELOG.md
index e0f914f14..3a2cee7a2 100644
--- a/packages/react-simulator-renderer/CHANGELOG.md
+++ b/packages/react-simulator-renderer/CHANGELOG.md
@@ -3,6 +3,34 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
+
+
+### Bug Fixes
+
+* requestHandlersMap 没有加到 appContext 里 ([a8d43c3](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/a8d43c3))
+* simulator-renderer 补充丢失代码 ([67dd7e2](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/67dd7e2))
+
+
+### Features
+
+* 支持 build sourceMap, 方便用户调试 ([6bf75cd](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/6bf75cd))
+
+
+
+
+
+## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
+
+
+### Bug Fixes
+
+* 修复 prop 无法删除最后一个 item ([e18a386](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/e18a386))
+
+
+
+
## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-14)
diff --git a/packages/react-simulator-renderer/build.json b/packages/react-simulator-renderer/build.json
index 12c3c10c6..cc6d56cd4 100644
--- a/packages/react-simulator-renderer/build.json
+++ b/packages/react-simulator-renderer/build.json
@@ -1,4 +1,5 @@
{
+ "sourceMap": true,
"plugins": [
[
"build-plugin-component",
diff --git a/packages/react-simulator-renderer/package.json b/packages/react-simulator-renderer/package.json
index 5a86d5f05..3173ae318 100644
--- a/packages/react-simulator-renderer/package.json
+++ b/packages/react-simulator-renderer/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-react-simulator-renderer",
- "version": "1.0.24-beta.4",
+ "version": "1.0.26-beta.0",
"description": "react simulator renderer for alibaba lowcode designer",
"main": "lib/index.js",
"module": "es/index.js",
@@ -16,10 +16,10 @@
"build": "build-scripts build --skip-demo"
},
"dependencies": {
- "@ali/lowcode-designer": "^1.0.24-beta.4",
- "@ali/lowcode-react-renderer": "^1.0.24-beta.4",
- "@ali/lowcode-types": "^1.0.24-beta.4",
- "@ali/lowcode-utils": "^1.0.24-beta.4",
+ "@ali/lowcode-designer": "^1.0.26-beta.0",
+ "@ali/lowcode-react-renderer": "^1.0.26-beta.0",
+ "@ali/lowcode-types": "^1.0.26-beta.0",
+ "@ali/lowcode-utils": "^1.0.26-beta.0",
"@ali/vu-css-style": "^1.0.2",
"@recore/obx": "^1.0.8",
"@recore/obx-react": "^1.0.7",
diff --git a/packages/react-simulator-renderer/src/renderer-view.tsx b/packages/react-simulator-renderer/src/renderer-view.tsx
index aa758fe16..263a71e56 100644
--- a/packages/react-simulator-renderer/src/renderer-view.tsx
+++ b/packages/react-simulator-renderer/src/renderer-view.tsx
@@ -1,6 +1,8 @@
+import { Node } from '@ali/lowcode-designer';
import LowCodeRenderer from '@ali/lowcode-react-renderer';
import { ReactInstance, Fragment, Component, createElement } from 'react';
import { observer } from '@recore/obx-react';
+import { isFromVC } from '@ali/lowcode-utils';
import { SimulatorRendererContainer, DocumentInstance } from './renderer';
import { Router, Route, Switch } from 'react-router';
import './renderer.less';
@@ -103,7 +105,7 @@ class Layout extends Component<{ rendererContainer: SimulatorRendererContainer }
if (layout) {
const { Component, props, componentName } = layout;
if (Component) {
- return {children};
+ return {children};
}
if (componentName && rendererContainer.getComponent(componentName)) {
return createElement(
@@ -147,8 +149,10 @@ class Renderer extends Component<{
customCreateElement={(Component: any, props: any, children: any) => {
const { __id, __desingMode, ...viewProps } = props;
viewProps.componentId = __id;
- const leaf = documentInstance.getNode(__id);
- viewProps._leaf = leaf;
+ const leaf = documentInstance.getNode(__id) as Node;
+ if (isFromVC(leaf?.componentMeta)) {
+ viewProps._leaf = leaf;
+ }
viewProps._componentName = leaf?.componentName;
// 如果是容器 && 无children && 高宽为空 增加一个占位容器,方便拖动
if (
diff --git a/packages/react-simulator-renderer/src/renderer.ts b/packages/react-simulator-renderer/src/renderer.ts
index 79453ad0b..7bf47106e 100644
--- a/packages/react-simulator-renderer/src/renderer.ts
+++ b/packages/react-simulator-renderer/src/renderer.ts
@@ -211,6 +211,9 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
// sync designMode
this._designMode = host.designMode;
+ // sync requestHandlersMap
+ this._requestHandlersMap = host.requestHandlersMap;
+
// sync device
this._device = host.device;
});
@@ -261,10 +264,11 @@ export class SimulatorRendererContainer implements BuiltinSimulatorRenderer {
getUrlParams() {
const search = history.location.search;
return parseQuery(search);
- }
- }
+ },
+ },
},
constants: {},
+ requestHandlersMap: this._requestHandlersMap,
};
host.injectionConsumer.consume((data) => {
// sync utils, i18n, contants,... config
diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md
index 49bbd0f2e..0dad341e3 100644
--- a/packages/types/CHANGELOG.md
+++ b/packages/types/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-types
+
+
+## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-types
+
## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-14)
diff --git a/packages/types/package.json b/packages/types/package.json
index 514de44d8..f032c6377 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-types",
- "version": "1.0.24-beta.4",
+ "version": "1.0.26-beta.0",
"description": "Types for Ali lowCode engine",
"files": [
"es",
diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md
index 22b48bc14..55a31949c 100644
--- a/packages/utils/CHANGELOG.md
+++ b/packages/utils/CHANGELOG.md
@@ -3,6 +3,25 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## [1.0.26-beta.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.25-beta.1...v1.0.26-beta.0) (2020-12-22)
+
+
+
+
+**Note:** Version bump only for package @ali/lowcode-utils
+
+
+## [1.0.25-beta.1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.4...v1.0.25-beta.1) (2020-12-15)
+
+
+### Bug Fixes
+
+* 修复 prop 无法删除最后一个 item ([e18a386](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/e18a386))
+
+
+
+
## [1.0.24-beta.4](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.24-beta.3...v1.0.24-beta.4) (2020-12-14)
diff --git a/packages/utils/package.json b/packages/utils/package.json
index 57ed2f6fe..d378ee2e3 100644
--- a/packages/utils/package.json
+++ b/packages/utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-utils",
- "version": "1.0.24-beta.4",
+ "version": "1.0.26-beta.0",
"description": "Utils for Ali lowCode engine",
"files": [
"es",
@@ -14,7 +14,7 @@
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
- "@ali/lowcode-types": "^1.0.24-beta.4",
+ "@ali/lowcode-types": "^1.0.26-beta.0",
"@alifd/next": "^1.19.16",
"lodash.get": "^4.4.2",
"react": "^16"
diff --git a/packages/utils/src/misc.ts b/packages/utils/src/misc.ts
index a0f8f13ff..5428be93a 100644
--- a/packages/utils/src/misc.ts
+++ b/packages/utils/src/misc.ts
@@ -1,6 +1,7 @@
import { isI18NObject } from './is-object';
import get from 'lodash.get';
+import { ComponentMeta } from '@ali/lowcode-designer';
export function isUseI18NSetter(prototype: any, propName: string) {
const configure = prototype?.options?.configure;
@@ -43,3 +44,11 @@ export function waitForThing(obj: any, path: string): Promise {
}
return _innerWaitForThing(obj, path);
}
+
+/**
+ * 判断当前 meta 是否从 vc prototype 转换而来
+ * @param meta
+ */
+export function isFromVC(meta: ComponentMeta) {
+ return !!meta?.getMetadata()?.experimental;
+}
\ No newline at end of file