Merge branch 'release/1.0.56' into release/0.16.0

This commit is contained in:
力皓 2021-06-10 19:18:08 +08:00
commit 12097d1949
45 changed files with 354 additions and 109 deletions

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
### Bug Fixes
* fieldId 有值时跳过 initial, 因为在目前 vc 的 fieldId 实现是每次返回不同的值 ([0360572](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/03605724769b72ab28aa6c4ae7311c10257dd8f0))
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)

View File

@ -1,6 +1,6 @@
{
"lerna": "2.11.0",
"version": "1.0.53",
"version": "1.0.54",
"npmClient": "tnpm",
"registry": "http://registry.npm.alibaba-inc.com",
"useWorkspaces": true,

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-designer
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-designer

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-designer",
"version": "1.0.53",
"version": "1.0.54",
"description": "Designer for Ali LowCode Engine",
"main": "lib/index.js",
"module": "es/index.js",
@ -14,9 +14,9 @@
},
"license": "MIT",
"dependencies": {
"@ali/lowcode-editor-core": "1.0.53",
"@ali/lowcode-types": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-editor-core": "1.0.54",
"@ali/lowcode-types": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"classnames": "^2.2.6",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",

View File

@ -752,14 +752,16 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
*/
setupDetecting() {
const doc = this.contentDocument!;
const { detecting } = this.designer;
const { detecting, dragon } = this.designer;
const hover = (e: MouseEvent) => {
if (!detecting.enable || this.designMode !== 'design') {
return;
}
const nodeInst = this.getNodeInstanceFromElement(e.target as Element);
detecting.capture(nodeInst?.node || null);
e.stopPropagation();
if (!engineConfig.get('enableMouseEventPropagationInCanvas', false) || dragon.dragging) {
e.stopPropagation();
}
};
const leave = () => detecting.leave(this.project.currentDocument);
@ -770,7 +772,9 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
doc.addEventListener(
'mousemove',
(e: Event) => {
e.stopPropagation();
if (!engineConfig.get('enableMouseEventPropagationInCanvas', false) || dragon.dragging) {
e.stopPropagation();
}
},
true,
);

View File

@ -4,15 +4,16 @@ import { SettingPropEntry } from './setting-prop-entry';
import { SettingEntry } from './setting-entry';
import { computed, obx } from '@ali/lowcode-editor-core';
import { cloneDeep } from '@ali/lowcode-utils';
import { ISetValueOptions } from '../../types';
function getSettingFieldCollectorKey(parent: SettingEntry, config: FieldConfig) {
let top = parent;
let cur = parent;
const path = [config.name];
while (top !== parent.top) {
if (top instanceof SettingField && top.type !== 'group') {
path.unshift(top.name);
while (cur !== parent.top) {
if (cur instanceof SettingField && cur.type !== 'group') {
path.unshift(cur.name);
}
top = top.parent;
cur = cur.parent;
}
return path.join('.');
}
@ -140,7 +141,7 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
private hotValue: any;
setValue(val: any, isHotValue?: boolean, force?: boolean, extraOptions?: any) {
setValue(val: any, isHotValue?: boolean, force?: boolean, extraOptions?: ISetValueOptions) {
if (isHotValue) {
this.setHotValue(val, extraOptions);
return;
@ -172,9 +173,14 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
this.valueChange();
}
setHotValue(data: any, options?: any) {
setHotValue(data: any, options?: ISetValueOptions) {
this.hotValue = data;
const value = this.transducer.toNative(data);
if (options) {
options.fromSetHotValue = true;
} else {
options = { fromSetHotValue: true };
}
if (this.isUseVariable()) {
const oldValue = this.getValue();
this.setValue({
@ -191,7 +197,7 @@ export class SettingField extends SettingPropEntry implements SettingEntry {
return;
}
this.valueChange();
this.valueChange(options);
}
onEffect(action: () => void): () => void {

View File

@ -6,6 +6,8 @@ import { Node } from '../../document';
import { ComponentMeta } from '../../component-meta';
import { Designer } from '../designer';
import { EventEmitter } from 'events';
import { ISetValueOptions } from '../../types';
import { isSettingField } from './setting-field';
export class SettingPropEntry implements SettingEntry {
// === static properties ===
@ -162,7 +164,7 @@ export class SettingPropEntry implements SettingEntry {
/**
*
*/
setValue(val: any, isHotValue?: boolean, force?: boolean, extraOptions?: any) {
setValue(val: any, isHotValue?: boolean, force?: boolean, extraOptions?: ISetValueOptions) {
const oldValue = this.getValue();
if (this.type === 'field') {
this.parent.setPropValue(this.name, val);
@ -178,6 +180,10 @@ export class SettingPropEntry implements SettingEntry {
}
}
this.notifyValueChange(oldValue, val);
// 如果 fromSetHotValue那么在 setHotValue 中已经调用过 valueChange 了
if (!extraOptions?.fromSetHotValue) {
this.valueChange(extraOptions);
}
}
/**
@ -272,8 +278,12 @@ export class SettingPropEntry implements SettingEntry {
/**
* @deprecated
*/
valueChange() {
this.emitter.emit('valuechange');
valueChange(options: ISetValueOptions = {}) {
this.emitter.emit('valuechange', options);
if (this.parent && isSettingField(this.parent)) {
this.parent.valueChange(options);
}
}
notifyValueChange(oldValue: any, newValue:any) {
@ -288,15 +298,6 @@ export class SettingPropEntry implements SettingEntry {
return false;
}
/*
getConfig<K extends keyof IPropConfig>(configName?: K): IPropConfig[K] | IPropConfig {
if (configName) {
return this.config[configName];
}
return this.config;
}
*/
getVariableValue() {
const v = this.getValue();
if (isJSExpression(v)) {

View File

@ -1,11 +1,12 @@
import { untracked, computed, obx, engineConfig } from '@ali/lowcode-editor-core';
import { CompositeValue, isJSExpression, isJSSlot, JSSlot, SlotSchema } from '@ali/lowcode-types';
import { CompositeValue, FieldConfig, isJSExpression, isJSSlot, JSSlot, SlotSchema } from '@ali/lowcode-types';
import { uniqueId, isPlainObject, hasOwnProperty, compatStage } from '@ali/lowcode-utils';
import { PropStash } from './prop-stash';
import { valueToSource } from './value-to-source';
import { Props } from './props';
import { SlotNode, Node } from '../node';
import { TransformStage } from '../transform-stage';
import { getFocusedElement } from 'medium-editor';
export const UNSET = Symbol.for('unset');
export type UNSET = typeof UNSET;
@ -14,10 +15,40 @@ export interface IPropParent {
delete(prop: Prop): void;
readonly props: Props;
readonly owner: Node;
readonly path: string[];
}
export type ValueTypes = 'unset' | 'literal' | 'map' | 'list' | 'expression' | 'slot';
function hasItemsInMetadata(prop: Prop) {
const path = prop.path;
const { configure } = prop.getNode().componentMeta.getMetadata();
if (!path || path.length === 0) return false;
let props = configure?.props;
while (path.length > 0) {
let name = path.shift();
let matchedProp = getMatchedProp(props, name!);
if (!matchedProp) return false;
if (path.length === 0) return !!matchedProp?.items;
props = matchedProp.items;
}
}
function getMatchedProp(props: FieldConfig[] | undefined, name: string): FieldConfig | null {
let found = null;
if (!props) return null;
for (const prop of props) {
if (prop.name === name) {
found = prop;
break;
} else if (prop.type === 'group' && prop.items) {
found = getMatchedProp(prop.items, name);
if (found) return found;
}
}
return found;
}
export class Prop implements IPropParent {
readonly isProp = true;
@ -253,6 +284,21 @@ export class Prop implements IPropParent {
};
}
this.dispose();
// 将父属性设置成一个对象,得同时把子属性都设值,同时清空其他子属性
if (this._type === 'map' && isPlainObject(val)) {
this.items?.forEach((item) => {
// @ts-ignore
if ([item.key] in val) {
// @ts-ignore
item.setValue(val[item.key]);
} else {
this.clearPropValue(item.key!);
}
});
}
if (oldValue !== this._value) {
editor?.emit('node.innerProp.change', {
node: this.owner,
@ -261,7 +307,6 @@ export class Prop implements IPropParent {
newValue: this._value,
});
}
this.dispose();
}
@computed getValue(): CompositeValue {
@ -358,7 +403,13 @@ export class Prop implements IPropParent {
@obx.val private _maps: Map<string | number, Prop> | null = null;
@computed private get items(): Prop[] | null {
get path(): string[] {
return (this.parent.path || []).concat(this.key as string);
}
private get items(): Prop[] | null {
// 不在元数据配置项中的,不产生 items
if (!hasItemsInMetadata(this)) return null;
let _items: any;
untracked(() => {
_items = this._items;

View File

@ -37,6 +37,8 @@ export class Props implements IPropParent {
return maps;
}
readonly path = [];
get props(): Props {
return this;
}

View File

@ -18,4 +18,21 @@ const utils = {
compatibleLegaoSchema,
getNodeSchemaById,
};
export type Utils = typeof utils;
export type Utils = typeof utils;
export enum PROP_VALUE_CHANGED_TYPE {
/**
* normal set value
*/
SET_VALUE = 'SET_VALUE',
/**
* value changed caused by sub-prop value change
*/
SUB_VALUE_CHANGE = 'SUB_VALUE_CHANGE',
}
export interface ISetValueOptions {
disableMutator?: boolean;
type?: PROP_VALUE_CHANGED_TYPE;
fromSetHotValue?: boolean;
}

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-editor-core
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-editor-core

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-editor-core",
"version": "1.0.53",
"version": "1.0.54",
"description": "Core Api for Ali lowCode engine",
"license": "MIT",
"main": "lib/index.js",
@ -13,8 +13,8 @@
"build": "build-scripts build --skip-demo"
},
"dependencies": {
"@ali/lowcode-types": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-types": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"@alifd/next": "^1.19.16",
"@recore/obx": "^1.0.9",
"@recore/obx-react": "^1.0.8",

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-editor-preset-general

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-editor-preset-general",
"version": "1.0.53",
"version": "1.0.54",
"description": "Ali General Editor Preset",
"main": "lib/index.js",
"private": true,
@ -14,12 +14,12 @@
},
"license": "MIT",
"dependencies": {
"@ali/lowcode-editor-core": "1.0.53",
"@ali/lowcode-editor-skeleton": "1.0.53",
"@ali/lowcode-plugin-designer": "1.0.53",
"@ali/lowcode-plugin-outline-pane": "1.0.53",
"@ali/lowcode-types": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-editor-core": "1.0.54",
"@ali/lowcode-editor-skeleton": "1.0.54",
"@ali/lowcode-plugin-designer": "1.0.54",
"@ali/lowcode-plugin-outline-pane": "1.0.54",
"@ali/lowcode-types": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"@alifd/next": "^1.19.12",
"@alife/theme-lowcode-dark": "^0.1.0",
"@alife/theme-lowcode-light": "^0.1.0",

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-editor-skeleton

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-editor-skeleton",
"version": "1.0.53",
"version": "1.0.54",
"description": "alibaba lowcode editor skeleton",
"main": "lib/index.js",
"module": "es/index.js",
@ -19,10 +19,10 @@
"editor"
],
"dependencies": {
"@ali/lowcode-designer": "1.0.53",
"@ali/lowcode-editor-core": "1.0.53",
"@ali/lowcode-types": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-designer": "1.0.54",
"@ali/lowcode-editor-core": "1.0.54",
"@ali/lowcode-types": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"@ali/ve-icons": "latest",
"@ali/ve-less-variables": "^2.0.0",
"@alifd/next": "^1.20.12",

View File

@ -1,9 +1,9 @@
import { Component, Fragment } from 'react';
import { Icon, Button } from '@alifd/next';
import { SetterType, FieldConfig } from '@ali/lowcode-types';
import { SetterType, FieldConfig, CustomView } from '@ali/lowcode-types';
import { createSettingFieldView } from '../settings/settings-pane';
import { PopupContext, PopupPipe } from '../popup';
import { SettingField } from '@ali/lowcode-designer';
import { isSettingField, SettingField } from '@ali/lowcode-designer';
import './style.less';
import { Title } from '@ali/lowcode-editor-core';
@ -165,11 +165,17 @@ class FormSetter extends Component<FormSetterProps> {
super(props);
const { config, field } = props;
const { extraProps } = field;
this.items = (config?.items || []).map((conf) => field.createField({
...conf,
setValue: extraProps?.setValue,
}));
field.items.forEach((item: SettingField | CustomView) => {
if (isSettingField(item)) {
const originalSetValue = item.extraProps.setValue;
item.extraProps.setValue = (...args) => {
// 调用子字段本身的 setValue
originalSetValue?.apply(null, args);
// 调用父字段本身的 setValue
extraProps.setValue?.apply(null, args);
};
}
});
// TODO: extraConfig for custom fields
}
@ -181,7 +187,7 @@ class FormSetter extends Component<FormSetterProps> {
const { field } = this.props;
return (
<div className="lc-setter-object lc-block-setter">
{this.items.map((item, index) => createSettingFieldView(item, field, index))}
{field.items.map((item, index) => createSettingFieldView(item, field, index))}
</div>
);
}

View File

@ -69,13 +69,13 @@ export class SettingsMain {
if (!this.designer) {
this.designer = nodes[0].document.designer;
}
let lastSettings = this._settings;
// obx 的一些响应式计算会延迟到下一个时钟周期,导致 prop.parent 获取不到,这里也做一个延迟
executePendingFn(() => {
lastSettings?.purge();
}, 2000);
this._settings = this.designer.createSettingEntry(nodes);
// 当节点只有一个时,复用 node 上挂载的 settingEntry不会产生平行的两个实例这样在整个系统中对
// 某个节点操作的 SettingTopEntry 只有一个实例,后续的 getProp() 也会拿到相同的 SettingField 实例
if (nodes.length === 1) {
this._settings = nodes[0].settingEntry;
} else {
this._settings = this.designer.createSettingEntry(nodes);
}
}
purge() {

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-engine
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-engine

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-engine",
"version": "1.0.53",
"version": "1.0.54",
"description": "Universal API for AliLowCode engine",
"main": "lib/engine-core.js",
"module": "es/engine-core.js",
@ -18,14 +18,14 @@
},
"license": "MIT",
"dependencies": {
"@ali/lowcode-designer": "1.0.53",
"@ali/lowcode-editor-core": "1.0.53",
"@ali/lowcode-designer": "1.0.54",
"@ali/lowcode-editor-core": "1.0.54",
"@ali/lowcode-editor-setters": "1.0.30",
"@ali/lowcode-editor-skeleton": "1.0.53",
"@ali/lowcode-editor-skeleton": "1.0.54",
"@ali/lowcode-engine-ext": "^1.0.0",
"@ali/lowcode-plugin-designer": "1.0.53",
"@ali/lowcode-plugin-outline-pane": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-plugin-designer": "1.0.54",
"@ali/lowcode-plugin-outline-pane": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"@ali/ve-i18n-util": "^2.0.0",
"@ali/ve-icons": "^4.1.9",
"@ali/ve-less-variables": "2.0.3",

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-ignitor
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-ignitor

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-ignitor",
"version": "1.0.53",
"version": "1.0.54",
"description": "点火器bootstrap lce project",
"main": "lib/index.js",
"private": true,

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-plugin-designer
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-plugin-designer

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-designer",
"version": "1.0.53",
"version": "1.0.54",
"description": "alibaba lowcode editor designer plugin",
"files": [
"es",
@ -20,7 +20,7 @@
],
"author": "xiayang.xy",
"dependencies": {
"@ali/lowcode-editor-core": "1.0.53",
"@ali/lowcode-editor-core": "1.0.54",
"react": "^16.8.1",
"react-dom": "^16.8.1"
},

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-plugin-outline-pane",
"version": "1.0.53",
"version": "1.0.54",
"description": "Outline pane for Ali lowCode engine",
"files": [
"es",
@ -14,10 +14,10 @@
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
"@ali/lowcode-designer": "1.0.53",
"@ali/lowcode-editor-core": "1.0.53",
"@ali/lowcode-types": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-designer": "1.0.54",
"@ali/lowcode-editor-core": "1.0.54",
"@ali/lowcode-types": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"@alifd/next": "^1.19.16",
"classnames": "^2.2.6",
"react": "^16",

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-rax-renderer
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-rax-renderer

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-rax-renderer",
"version": "1.0.53",
"version": "1.0.54",
"description": "Rax renderer for Ali lowCode engine",
"main": "lib/index.js",
"module": "lib/index.js",
@ -30,8 +30,8 @@
"build": "build-scripts build"
},
"dependencies": {
"@ali/lowcode-renderer-core": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-renderer-core": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"rax-find-dom-node": "^1.0.1"
},
"devDependencies": {

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-rax-simulator-renderer",
"version": "1.0.53",
"version": "1.0.54",
"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.53",
"@ali/lowcode-rax-renderer": "1.0.53",
"@ali/lowcode-types": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-designer": "1.0.54",
"@ali/lowcode-rax-renderer": "1.0.54",
"@ali/lowcode-types": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"@ali/recore-rax": "^1.2.4",
"@ali/vu-css-style": "^1.0.2",
"@recore/obx": "^1.0.8",

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-react-renderer
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-react-renderer

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-react-renderer",
"version": "1.0.53",
"version": "1.0.54",
"description": "react renderer for ali lowcode engine",
"main": "lib/index.js",
"module": "es/index.js",
@ -23,7 +23,7 @@
"react"
],
"dependencies": {
"@ali/lowcode-renderer-core": "1.0.53",
"@ali/lowcode-renderer-core": "1.0.54",
"@alifd/next": "^1.21.16"
},
"devDependencies": {

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-react-simulator-renderer",
"version": "1.0.53",
"version": "1.0.54",
"description": "react simulator renderer for alibaba lowcode designer",
"main": "lib/index.js",
"module": "es/index.js",
@ -16,10 +16,10 @@
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo"
},
"dependencies": {
"@ali/lowcode-designer": "1.0.53",
"@ali/lowcode-react-renderer": "1.0.53",
"@ali/lowcode-types": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-designer": "1.0.54",
"@ali/lowcode-react-renderer": "1.0.54",
"@ali/lowcode-types": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"@ali/vu-css-style": "^1.0.2",
"@recore/obx": "^1.0.8",
"@recore/obx-react": "^1.0.7",

View File

@ -48,8 +48,8 @@ export class DocumentInstance {
this.disposeFunctions.push(host.onActivityEvent((data: ActivityData, ctx: any) => {
if (host.mutedActivityEvent || (ctx && ctx.doc !== this.document)) return;
// 当节点数小数 300 个时,不走入增量更新逻辑,后面优化、细化逻辑后逐步放开限制
if (this.document.nodesMap.size < 300) return;
// 当节点数小数 200 个时,不走入增量更新逻辑,后面优化、细化逻辑后逐步放开限制
if (this.document.nodesMap.size < 200) return;
if (tid) clearTimeout(tid);
// 临时关闭全量计算 schema 的逻辑,在增量计算结束后,来一次全量计算
@ -59,7 +59,7 @@ export class DocumentInstance {
if (supportsQuickPropSetting(data, this)) {
setInstancesProp(data, this);
} else {
this._schema = applyActivities(this._schema!, data);
// this._schema = applyActivities(this._schema!, data);
}
} else if (data.type === ActivityType.ADDED) {
// FIXME: 待补充 节点增加 逻辑

View File

@ -1,6 +1,7 @@
import { ReactInstance } from 'react';
import { ActivityData, isJSSlot } from '@ali/lowcode-types';
import { DocumentInstance } from '../renderer';
import { isReactClass } from '@ali/lowcode-utils';
interface UtilsMetadata {
name: string;
@ -55,9 +56,9 @@ function haveForceUpdate(instances: any[]): boolean {
export function supportsQuickPropSetting(data: ActivityData, doc: DocumentInstance) {
const { payload } = data;
const { schema, prop } = payload;
const nodeId = schema.id!;
const { componentName, id: nodeId } = schema;
// const key = data.payload.prop.key;
const instances = doc.instancesMap.get(nodeId);
const instances = doc.instancesMap.get(nodeId!);
const propKey = getUppermostPropKey(prop);
let value = (schema.props as any)[propKey];
@ -65,14 +66,28 @@ export function supportsQuickPropSetting(data: ActivityData, doc: DocumentInstan
nodeId &&
Array.isArray(instances) &&
instances.length > 0 &&
haveForceUpdate(instances) &&
propKey &&
// 不是 extraProp
!propKey.startsWith('___') &&
!isJSSlot(value)
!isJSSlot(value) &&
// functional component 不支持 ref.props 直接设值,是 readonly 的
isReactClass((doc.container?.components as any)[componentName]) &&
haveForceUpdate(instances) &&
// 黑名单组件通常会把 schema / children 魔改,导致直接设置 props 失效
isAllowedComponent(componentName)
);
}
// 不允许走快捷设置的组件黑名单
const DISABLED__QUICK_SETTING_COMPONENT_NAMES = [
'Filter', // 查询组件
'Filter2', // 查询组件
'TableField', // 明细组件
];
function isAllowedComponent(name: string): boolean {
return !DISABLED__QUICK_SETTING_COMPONENT_NAMES.includes(name);
}
/**
*
* @param data

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-renderer-core
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-renderer-core

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-renderer-core",
"version": "1.0.53",
"version": "1.0.54",
"description": "renderer core",
"license": "MIT",
"main": "lib/index.js",

View File

@ -372,7 +372,7 @@ export default function baseRenererFactory() {
}
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?.__ctx?.lceKey ? '' : idy));
return schema.map((item, idy) => this.__createVirtualDom(item, self, parentInfo, item?.__ctx?.lceKey ? '' : String(idy)));
}
// FIXME
const _children = this.getSchemaChildren(schema);
@ -484,6 +484,7 @@ export default function baseRenererFactory() {
}
props.key = props.key || `${schema.__ctx.lceKey}_${schema.__ctx.idx || 0}_${idx !== undefined ? idx : ''}`;
} else if (typeof idx === 'number' && !props.key) {
// 仅当循环场景走这里
props.key = idx;
}

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-types
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-types

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-types",
"version": "1.0.53",
"version": "1.0.54",
"description": "Types for Ali lowCode engine",
"files": [
"es",

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
**Note:** Version bump only for package @ali/lowcode-utils
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)
**Note:** Version bump only for package @ali/lowcode-utils

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-utils",
"version": "1.0.53",
"version": "1.0.54",
"description": "Utils for Ali lowCode engine",
"files": [
"es",
@ -14,7 +14,7 @@
"test:snapshot": "ava --update-snapshots"
},
"dependencies": {
"@ali/lowcode-types": "1.0.53",
"@ali/lowcode-types": "1.0.54",
"@alifd/next": "^1.19.16",
"lodash.get": "^4.4.2",
"react": "^16"

View File

@ -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.
## [1.0.54](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.53...v1.0.54) (2021-06-08)
### Bug Fixes
* fieldId 有值时跳过 initial, 因为在目前 vc 的 fieldId 实现是每次返回不同的值 ([0360572](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/03605724769b72ab28aa6c4ae7311c10257dd8f0))
## [1.0.53](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/v1.0.52...v1.0.53) (2021-06-07)

View File

@ -1,6 +1,6 @@
{
"name": "@ali/lowcode-vision-polyfill",
"version": "1.0.53",
"version": "1.0.54",
"description": "Vision Polyfill for Ali lowCode engine",
"main": "lib/index.js",
"private": true,
@ -18,10 +18,10 @@
},
"license": "MIT",
"dependencies": {
"@ali/lowcode-designer": "1.0.53",
"@ali/lowcode-editor-core": "1.0.53",
"@ali/lowcode-editor-skeleton": "1.0.53",
"@ali/lowcode-utils": "1.0.53",
"@ali/lowcode-designer": "1.0.54",
"@ali/lowcode-editor-core": "1.0.54",
"@ali/lowcode-editor-skeleton": "1.0.54",
"@ali/lowcode-utils": "1.0.54",
"@ali/ve-i18n-util": "^2.0.0",
"@ali/ve-icons": "^4.1.9",
"@ali/ve-less-variables": "2.0.3",