mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-28 04:40:32 +00:00
Merge branch 'master' into release/1.0.0
This commit is contained in:
commit
5e375a2e0b
@ -493,10 +493,5 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
### Features
|
||||
|
||||
<<<<<<< HEAD
|
||||
* complet preview ([56c16ff](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/56c16ff))
|
||||
* double outline & ZH_EN support ([b379bd7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/b379bd7))
|
||||
=======
|
||||
* complet preview ([56c16ff](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/56c16ffa5c39c2d01abd9cfa90fea49a4539da1d))
|
||||
* double outline & ZH_EN support ([b379bd7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/b379bd7c0c488ef24f825760750a13d3fa083c96))
|
||||
>>>>>>> df955e1db90ff104cd11160def80113cfd6faccc
|
||||
|
||||
@ -70,5 +70,9 @@
|
||||
<body>
|
||||
<!-- lowcode engine globals -->
|
||||
<div id="lce-container"></div>
|
||||
<!-- vision 测试使用
|
||||
<script src="/js/editor-preset-vision.js"></script>
|
||||
<script src="https://dev.g.alicdn.com/vision/visualengine-utils/5.0.0/engine-utils.js"></script>
|
||||
-->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -149,25 +149,25 @@
|
||||
"prototypeViewsUrl": null,
|
||||
"prototypeUrls": {
|
||||
"default": [
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.5/proto.bb4ec38.css",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.5/proto.ed31eab.js"
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.25/proto.2f23cdf.css",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.25/proto.9a739a7.js"
|
||||
]
|
||||
},
|
||||
"prototypeConfigsUrl": [
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.5/proto.bb4ec38.css",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.5/proto.ed31eab.js"
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.25/proto.2f23cdf.css",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.25/proto.9a739a7.js"
|
||||
],
|
||||
"alias": "",
|
||||
"urls": [
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.5/view.f2b6dde.css",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.5/view.46f546f.js",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.5/view.mobile.f2b6dde.css",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.5/view.mobile.6b901e9.js"
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.25/view.d6d0d1f.css",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.25/view.14bb8e8.js",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.25/view.mobile. d6d0d1f.css",
|
||||
"https://g.alicdn.com/legao-comp/web_bundle_0724/@ali/vc-deep-mobile/2.0.1-beta.25/view.mobile.fe36565.js"
|
||||
],
|
||||
"library": "AliVcDeepMobile",
|
||||
"components": null,
|
||||
"packageName": "@ali/vc-deep-mobile",
|
||||
"version": "2.0.1-beta.5"
|
||||
"version": "2.0.1-beta.25"
|
||||
},
|
||||
{
|
||||
"prototypeViewsUrl": null,
|
||||
|
||||
@ -1 +1,2 @@
|
||||
// import './vision';
|
||||
import './editor';
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-designer@0.14.0...@ali/lowcode-designer@1.0.0) (2020-08-17)
|
||||
|
||||
@ -45,11 +46,86 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-designer@0.9.37...@ali/lowcode-designer@0.10.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.9.43"></a>
|
||||
## [0.9.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-designer@0.9.42...@ali/lowcode-designer@0.9.43) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修改移动端设备宽度 ([cd7b1e6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/cd7b1e6))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.9.42"></a>
|
||||
## [0.9.42](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-designer@0.9.41...@ali/lowcode-designer@0.9.42) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* createComponent 支持所有 schema ([7f946f5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/7f946f5))
|
||||
* 不对外暴露 Node ([05957ce](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/05957ce))
|
||||
* 卡片内容不可用拖动 ([6a85c43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/6a85c43))
|
||||
* 处理选区的 toolkit 位置不对的 bug ([bfc63db](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/bfc63db))
|
||||
* 快捷键增加判断 ([0f64829](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/0f64829))
|
||||
* 快捷键增加判断 ([e18a231](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/e18a231))
|
||||
* 组件缺失占位 ([aff2f34](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/aff2f34))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 导出的schema增加componentsMap ([dbc958c](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/dbc958c))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.9.41"></a>
|
||||
## [0.9.41](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-designer@0.9.40...@ali/lowcode-designer@0.9.41) (2020-08-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* canDropIn 为 boolean 时失效 ([7508fb6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/7508fb6))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.9.40"></a>
|
||||
## [0.9.40](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-designer@0.9.39...@ali/lowcode-designer@0.9.40) (2020-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fieldId 重复问题 ([e761b1a](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/e761b1a))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.9.39"></a>
|
||||
## [0.9.39](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-designer@0.9.38...@ali/lowcode-designer@0.9.39) (2020-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 增加兼容 API ([2960446](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/2960446))
|
||||
* 复制之后 fieldId 重复 ([36621ea](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/36621ea))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.9.38"></a>
|
||||
## [0.9.38](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-designer@0.9.37...@ali/lowcode-designer@0.9.38) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
<<<<<<< HEAD
|
||||
* 兼容modal模式 ([1092ee9](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/1092ee9))
|
||||
=======
|
||||
* 修复 preset-vision 版本 lifeCycles 丢失以及 slot 初始化问题 ([7cf6d24](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/7cf6d24))
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
@ -66,7 +66,9 @@ class Toolbar extends Component<{ observed: OffsetObserver }> {
|
||||
const MARGIN = 1;
|
||||
const BORDER = 2;
|
||||
const SPACE_HEIGHT = BAR_HEIGHT + MARGIN + BORDER;
|
||||
const SPACE_MINIMUM_WIDTH = 140; // magic number
|
||||
let style: any;
|
||||
// 计算 toolbar 的上/下位置
|
||||
if (observed.top > SPACE_HEIGHT) {
|
||||
style = {
|
||||
top: -SPACE_HEIGHT,
|
||||
@ -83,10 +85,12 @@ class Toolbar extends Component<{ observed: OffsetObserver }> {
|
||||
top: Math.max(MARGIN, MARGIN - observed.top),
|
||||
};
|
||||
}
|
||||
if (observed.width < 140) {
|
||||
// 计算 toolbar 的左/右位置
|
||||
if (SPACE_MINIMUM_WIDTH > observed.left + observed.width) {
|
||||
style.left = Math.max(-BORDER, observed.left - width - BORDER);
|
||||
} else {
|
||||
style.right = Math.max(-BORDER, observed.right - width - BORDER);
|
||||
style.justifyContent = 'flex-start';
|
||||
}
|
||||
const { node } = observed;
|
||||
const actions: ReactNodeArray = [];
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
&-device-mobile {
|
||||
left: 50%;
|
||||
width: 460px;
|
||||
width: 378px;
|
||||
transform: translateX(-50%);
|
||||
box-shadow: 0 2px 10px 0 rgba(31,56,88,.15);
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ import {
|
||||
CanvasPoint,
|
||||
} from '../designer';
|
||||
import { parseMetadata } from './utils/parse-metadata';
|
||||
import { ComponentMetadata, ComponentSchema } from '@ali/lowcode-types';
|
||||
import { ComponentMetadata, NodeSchema } from '@ali/lowcode-types';
|
||||
import { BuiltinSimulatorRenderer } from './renderer';
|
||||
import clipboard from '../designer/clipboard';
|
||||
import { LiveEditing } from './live-editing/live-editing';
|
||||
@ -302,6 +302,11 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
|
||||
const nodeInst = this.getNodeInstanceFromElement(downEvent.target as Element);
|
||||
const node = nodeInst?.node || this.document.rootNode;
|
||||
if (!node?.isValidComponent()) {
|
||||
// 对于未注册组件直接返回
|
||||
return;
|
||||
}
|
||||
|
||||
const isMulti = downEvent.metaKey || downEvent.ctrlKey;
|
||||
const isLeftButton = downEvent.which === 1 || downEvent.button === 0;
|
||||
const checkSelect = (e: MouseEvent) => {
|
||||
@ -538,7 +543,7 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
return this.renderer?.getComponent(componentName) || null;
|
||||
}
|
||||
|
||||
createComponent(schema: ComponentSchema): Component | null {
|
||||
createComponent(schema: NodeSchema): Component | null {
|
||||
return this.renderer?.createComponent(schema) || null;
|
||||
}
|
||||
|
||||
@ -835,20 +840,35 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
|
||||
this.scroller.cancel();
|
||||
}
|
||||
|
||||
// ========= drag location logic: hepler for locate ==========
|
||||
// ========= drag location logic: helper for locate ==========
|
||||
|
||||
/**
|
||||
* @see ISensor
|
||||
*/
|
||||
locate(e: LocateEvent): any {
|
||||
const { dragObject } = e;
|
||||
const { nodes } = dragObject;
|
||||
|
||||
const operationalNodes = nodes?.filter((node: any) => {
|
||||
const onMoveHook = node.componentMeta?.getMetadata()?.experimental?.callbacks?.onMoveHook;
|
||||
const canMove = onMoveHook && typeof onMoveHook === 'function' ? onMoveHook() : true;
|
||||
|
||||
return canMove;
|
||||
});
|
||||
|
||||
if (!operationalNodes || operationalNodes.length === 0) {
|
||||
return;
|
||||
}
|
||||
this.sensing = true;
|
||||
this.scroller.scrolling(e);
|
||||
const dropContainer = this.getDropContainer(e);
|
||||
const canDropIn = dropContainer?.container?.componentMeta?.prototype?.options?.canDropIn;
|
||||
|
||||
if (
|
||||
!dropContainer ||
|
||||
canDropIn === false ||
|
||||
// too dirty
|
||||
(typeof dropContainer.container?.componentMeta?.prototype?.options?.canDropIn === 'function' &&
|
||||
!dropContainer.container?.componentMeta?.prototype?.options?.canDropIn(e.dragObject.nodes[0]))
|
||||
(typeof canDropIn === 'function' && !canDropIn(operationalNodes[0]))
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import { ComponentInstance, NodeInstance, Component } from '../simulator';
|
||||
import { ComponentSchema } from '@ali/lowcode-types';
|
||||
import { NodeSchema } from '@ali/lowcode-types';
|
||||
|
||||
export interface BuiltinSimulatorRenderer {
|
||||
readonly isSimulatorRenderer: true;
|
||||
createComponent(schema: ComponentSchema): Component | null;
|
||||
createComponent(schema: NodeSchema): Component | null;
|
||||
getComponent(componentName: string): Component;
|
||||
getComponentInstances(id: string): ComponentInstance[] | null;
|
||||
getClosestNodeInstance(from: ComponentInstance, nodeId?: string): NodeInstance<ComponentInstance> | null;
|
||||
|
||||
@ -137,13 +137,13 @@ export class ComponentMeta {
|
||||
}
|
||||
}
|
||||
|
||||
private parseMetadata(metadta: ComponentMetadata) {
|
||||
const { componentName, npm } = metadta;
|
||||
private parseMetadata(metadata: ComponentMetadata) {
|
||||
const { componentName, npm } = metadata;
|
||||
this._npm = npm;
|
||||
this._componentName = componentName;
|
||||
|
||||
// 额外转换逻辑
|
||||
this._transformedMetadata = this.transformMetadata(metadta);
|
||||
this._transformedMetadata = this.transformMetadata(metadata);
|
||||
|
||||
const title = this._transformedMetadata.title;
|
||||
if (title) {
|
||||
@ -381,7 +381,10 @@ const builtinComponentActions: ComponentAction[] = [
|
||||
action(node: Node) {
|
||||
// node.remove();
|
||||
const { document: doc, parent, index } = node;
|
||||
parent && doc.insertNode(parent, node, index, true);
|
||||
if (parent) {
|
||||
const newNode = doc.insertNode(parent, node, index + 1, true);
|
||||
newNode.select();
|
||||
}
|
||||
},
|
||||
},
|
||||
important: true,
|
||||
|
||||
@ -77,7 +77,9 @@ hotkey.bind(['backspace', 'del'], (e: KeyboardEvent) => {
|
||||
const topItems = sel.getTopNodes();
|
||||
// TODO: check can remove
|
||||
topItems.forEach((node) => {
|
||||
doc.removeNode(node);
|
||||
if (node.canPerformAction('remove')) {
|
||||
doc.removeNode(node);
|
||||
}
|
||||
});
|
||||
sel.clear();
|
||||
});
|
||||
@ -102,8 +104,13 @@ hotkey.bind(['command+c', 'ctrl+c', 'command+x', 'ctrl+x'], (e, action) => {
|
||||
}
|
||||
e.preventDefault();
|
||||
|
||||
const selected = doc.selection.getTopNodes(true);
|
||||
if (!selected || selected.length < 1) return;
|
||||
let selected = doc.selection.getTopNodes(true);
|
||||
selected = selected.filter((node) => {
|
||||
return node.canPerformAction('copy');
|
||||
})
|
||||
if (!selected || selected.length < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
const componentsMap = {};
|
||||
const componentsTree = selected.map((item) => item.export(TransformStage.Clone));
|
||||
|
||||
@ -20,6 +20,15 @@ export type GetDataType<T, NodeType> = T extends undefined
|
||||
: any
|
||||
: T;
|
||||
|
||||
export interface ComponentMap {
|
||||
componentName: string;
|
||||
package: string;
|
||||
version?: string;
|
||||
destructuring?: boolean;
|
||||
exportName?: string;
|
||||
subName?: string;
|
||||
}
|
||||
|
||||
export class DocumentModel {
|
||||
/**
|
||||
* 根节点 类型有:Page/Component/Block
|
||||
@ -301,8 +310,11 @@ export class DocumentModel {
|
||||
}
|
||||
|
||||
import(schema: RootSchema, checkId = false) {
|
||||
// TODO: do purge
|
||||
this.nodes.forEach(node => {
|
||||
this.destroyNode(node);
|
||||
});
|
||||
this.rootNode.import(schema as any, checkId);
|
||||
// todo: purge something
|
||||
// todo: select added and active track added
|
||||
}
|
||||
|
||||
@ -493,9 +505,13 @@ export class DocumentModel {
|
||||
}
|
||||
|
||||
// add toData
|
||||
toData() {
|
||||
toData(extraComps?: string[]) {
|
||||
const node = this.project?.currentDocument?.export(TransformStage.Save);
|
||||
return { componentsTree: [node] };
|
||||
const data = {
|
||||
componentsMap: this.getComponentsMap(extraComps),
|
||||
componentsTree: [node],
|
||||
};
|
||||
return data;
|
||||
}
|
||||
|
||||
getHistory(): History {
|
||||
@ -564,6 +580,37 @@ export class DocumentModel {
|
||||
return this.rootNodeVisitorMap[name];
|
||||
}
|
||||
|
||||
getComponentsMap(extraComps?: string[]) {
|
||||
const componentsMap: ComponentMap[] = [];
|
||||
// 组件去重
|
||||
const map: any = {};
|
||||
for (let node of this.nodesMap.values()) {
|
||||
const { componentName } = node || {};
|
||||
if (!map[componentName] && node?.componentMeta?.npm?.package) {
|
||||
map[componentName] = true;
|
||||
componentsMap.push({
|
||||
componentName,
|
||||
package: node?.componentMeta?.npm?.package,
|
||||
});
|
||||
}
|
||||
}
|
||||
// 合并外界传入的自定义渲染的组件
|
||||
if (Array.isArray(extraComps)) {
|
||||
extraComps.forEach(c => {
|
||||
if (c && !map[c]) {
|
||||
const m = this.getComponentMeta(c);
|
||||
if (m && m.npm?.package) {
|
||||
componentsMap.push({
|
||||
componentName: c,
|
||||
package: m.npm?.package,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return componentsMap;
|
||||
}
|
||||
|
||||
onNodeCreate(func: (node: Node) => void) {
|
||||
this.emitter.on('nodecreate', func);
|
||||
return () => {
|
||||
@ -584,6 +631,13 @@ export class DocumentModel {
|
||||
refresh() {
|
||||
console.warn('refresh method is deprecated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
onRefresh(func: () => void) {
|
||||
console.warn('onRefresh method is deprecated');
|
||||
}
|
||||
}
|
||||
|
||||
export function isDocumentModel(obj: any): obj is DocumentModel {
|
||||
|
||||
@ -36,8 +36,6 @@ export class History {
|
||||
|
||||
this.obx = autorun(() => {
|
||||
const data = logger();
|
||||
// TODO: remove this line
|
||||
console.info('log');
|
||||
if (this.justWokeup) {
|
||||
this.justWokeup = false;
|
||||
return;
|
||||
|
||||
@ -87,7 +87,7 @@ export class NodeChildren {
|
||||
return this.size > 0;
|
||||
}
|
||||
|
||||
@computed length() {
|
||||
@computed get length(): number {
|
||||
return this.children.length;
|
||||
}
|
||||
|
||||
|
||||
@ -653,6 +653,16 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
slotNode.internalSetParent(this as ParentalNode, true);
|
||||
this._slots.push(slotNode);
|
||||
}
|
||||
/**
|
||||
* 当前node对应组件是否已注册可用
|
||||
*/
|
||||
isValidComponent() {
|
||||
const allComponents = this.document?.designer?.componentsMap;
|
||||
if (allComponents && allComponents[this.componentName]) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除一个节点
|
||||
@ -692,6 +702,14 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
this.document.destroyNode(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可执行某action
|
||||
*/
|
||||
canPerformAction(action: string): boolean {
|
||||
const availableActions = this.componentMeta?.availableActions?.map((action) => action.name) || [];
|
||||
return availableActions.indexOf(action) >= 0;
|
||||
}
|
||||
|
||||
// ======= compatible apis ====
|
||||
isEmpty(): boolean {
|
||||
return this.children ? this.children.isEmpty() : true;
|
||||
@ -702,6 +720,7 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
getComponentName() {
|
||||
return this.componentName;
|
||||
}
|
||||
|
||||
insertBefore(node: Node, ref?: Node, useMutator = true) {
|
||||
this.children?.insert(node, ref ? ref.index : null, useMutator);
|
||||
}
|
||||
@ -855,10 +874,20 @@ export class Node<Schema extends NodeSchema = NodeSchema> {
|
||||
return this.document.simulator?.computeRect(this) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
getPrototype() {
|
||||
return this.componentMeta.prototype;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
setPrototype(proto: any) {
|
||||
this.componentMeta.prototype = proto;
|
||||
}
|
||||
|
||||
getIcon() {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
@ -71,6 +71,10 @@ export class Prop implements IPropParent {
|
||||
}
|
||||
|
||||
if (type === 'literal' || type === 'expression') {
|
||||
// TODO 后端改造之后删除此逻辑
|
||||
if (this._value === null && stage === TransformStage.Save) {
|
||||
return '';
|
||||
}
|
||||
return this._value;
|
||||
}
|
||||
|
||||
@ -181,7 +185,7 @@ export class Prop implements IPropParent {
|
||||
this._code = null;
|
||||
const t = typeof val;
|
||||
if (val == null) {
|
||||
this._value = undefined;
|
||||
// this._value = undefined;
|
||||
this._type = 'literal';
|
||||
} else if (t === 'string' || t === 'number' || t === 'boolean') {
|
||||
this._type = 'literal';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component as ReactComponent, ComponentType } from 'react';
|
||||
import { ComponentMetadata, ComponentSchema } from '@ali/lowcode-types';
|
||||
import { ComponentMetadata, NodeSchema } from '@ali/lowcode-types';
|
||||
import { ISensor, Point, ScrollTarget, IScrollable } from './designer';
|
||||
import { Node } from './document';
|
||||
|
||||
@ -127,9 +127,9 @@ export interface ISimulatorHost<P = object> extends ISensor {
|
||||
*/
|
||||
getComponentInstances(node: Node): ComponentInstance[] | null;
|
||||
/**
|
||||
* 根据低代码组件 schema 创建组件类
|
||||
* 根据 schema 创建组件类
|
||||
*/
|
||||
createComponent(schema: ComponentSchema): Component | null;
|
||||
createComponent(schema: NodeSchema): Component | null;
|
||||
/**
|
||||
* 根据节点获取节点的组件运行上下文
|
||||
*/
|
||||
|
||||
@ -3,48 +3,88 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general-beta@0.14.0...@ali/lowcode-editor-preset-general-beta@1.0.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.9.28"></a>
|
||||
## [0.9.28](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general@0.9.27...@ali/lowcode-editor-preset-general@0.9.28) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general-beta
|
||||
|
||||
<a name="0.14.0"></a>
|
||||
# [0.14.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general-beta@0.13.0...@ali/lowcode-editor-preset-general-beta@0.14.0) (2020-08-17)
|
||||
=======
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="0.9.27"></a>
|
||||
## [0.9.27](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general@0.9.26...@ali/lowcode-editor-preset-general@0.9.27) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general-beta
|
||||
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general-beta@0.11.0...@ali/lowcode-editor-preset-general-beta@0.13.0) (2020-08-17)
|
||||
=======
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="0.9.26"></a>
|
||||
## [0.9.26](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general@0.9.25...@ali/lowcode-editor-preset-general@0.9.26) (2020-08-07)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general-beta
|
||||
|
||||
<a name="0.12.0"></a>
|
||||
# [0.12.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general-beta@0.11.0...@ali/lowcode-editor-preset-general-beta@0.12.0) (2020-08-17)
|
||||
=======
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="0.9.25"></a>
|
||||
## [0.9.25](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general@0.9.24...@ali/lowcode-editor-preset-general@0.9.25) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general-beta
|
||||
|
||||
<a name="0.11.0"></a>
|
||||
# 0.11.0 (2020-08-16)
|
||||
=======
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="0.9.24"></a>
|
||||
## [0.9.24](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general@0.9.23...@ali/lowcode-editor-preset-general@0.9.24) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general-beta
|
||||
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general@0.9.22...@ali/lowcode-editor-preset-general@0.10.0) (2020-08-14)
|
||||
=======
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-general
|
||||
|
||||
<a name="0.9.23"></a>
|
||||
## [0.9.23](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-general@0.9.22...@ali/lowcode-editor-preset-general@0.9.23) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.13.0...@ali/lowcode-editor-preset-vision@1.0.0) (2020-08-17)
|
||||
|
||||
@ -13,12 +14,28 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.12.0...@ali/lowcode-editor-preset-vision@0.13.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.45"></a>
|
||||
## [0.8.45](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.8.44...@ali/lowcode-editor-preset-vision@0.8.45) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 兼容 rpx ([5050af7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/5050af7))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.8.44"></a>
|
||||
## [0.8.44](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.8.43...@ali/lowcode-editor-preset-vision@0.8.44) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-vision
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.12.0"></a>
|
||||
# [0.12.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.10.0...@ali/lowcode-editor-preset-vision@0.12.0) (2020-08-17)
|
||||
|
||||
@ -37,10 +54,35 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.9.0...@ali/lowcode-editor-preset-vision@0.10.0) (2020-08-16)
|
||||
=======
|
||||
<a name="0.8.43"></a>
|
||||
## [0.8.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.8.42...@ali/lowcode-editor-preset-vision@0.8.43) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* createComponent 支持所有 schema ([7f946f5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/7f946f5))
|
||||
* upgradePropsReducer ([e68977f](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/e68977f))
|
||||
* vision 大包 window 指向问题 ([aa1b526](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/aa1b526))
|
||||
* 不对外暴露 Node ([05957ce](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/05957ce))
|
||||
* 支持 AC 组件 ([c287bad](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/c287bad))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.8.42"></a>
|
||||
## [0.8.42](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.8.41...@ali/lowcode-editor-preset-vision@0.8.42) (2020-08-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* vision API 兼容 DockPane.getDocks() ([f72fb66](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/f72fb66))
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-vision
|
||||
|
||||
<a name="0.9.0"></a>
|
||||
@ -50,6 +92,42 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-preset-vision
|
||||
=======
|
||||
<a name="0.8.41"></a>
|
||||
## [0.8.41](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.8.40...@ali/lowcode-editor-preset-vision@0.8.41) (2020-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fieldId 重复问题 ([e761b1a](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/e761b1a))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.8.40"></a>
|
||||
## [0.8.40](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.8.39...@ali/lowcode-editor-preset-vision@0.8.40) (2020-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 保存区块按钮渲染异常 ([33a7227](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/33a7227))
|
||||
* 增加兼容 API ([2960446](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/2960446))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.8.39"></a>
|
||||
## [0.8.39](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.8.38...@ali/lowcode-editor-preset-vision@0.8.39) (2020-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复 preset-vision 版本 lifeCycles 丢失以及 slot 初始化问题 ([7cf6d24](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/7cf6d24))
|
||||
* 框架样式调整 ([58790c5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/58790c5))
|
||||
|
||||
|
||||
|
||||
>>>>>>> master
|
||||
|
||||
<a name="0.8.38"></a>
|
||||
## [0.8.38](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-preset-vision@0.8.37...@ali/lowcode-editor-preset-vision@0.8.38) (2020-08-04)
|
||||
|
||||
@ -2,6 +2,7 @@ import lg from '@ali/vu-logger';
|
||||
import { ComponentClass, ComponentType } from 'react';
|
||||
import Prototype, { isPrototype } from './prototype';
|
||||
import { designer } from '../editor';
|
||||
import trunk from './trunk';
|
||||
|
||||
function basename(name: string) {
|
||||
return name ? (/[^\/]+$/.exec(name) || [''])[0] : '';
|
||||
@ -65,6 +66,22 @@ export default class Bundle {
|
||||
this.recursivelyRegisterPrototypes(prototype, item);
|
||||
}
|
||||
});
|
||||
|
||||
// invoke prototype mocker while the prototype does not exist
|
||||
Object.keys(this.viewsMap).forEach((viewName) => {
|
||||
const test = this;
|
||||
// console.log(test, viewName);
|
||||
if (!this.prototypeList.find((proto) => proto.getComponentName() === viewName)) {
|
||||
const mockedPrototype = trunk.mockComponentPrototype(this.viewsMap[viewName]);
|
||||
if (mockedPrototype) {
|
||||
mockedPrototype.setView(this.viewsMap[viewName]);
|
||||
this.registerPrototype(mockedPrototype);
|
||||
if (!mockedPrototype.getPackageName()) {
|
||||
mockedPrototype.setPackageName((this.viewsMap[viewName] as any)._packageName_);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getFromMeta(componentName: string): Prototype {
|
||||
@ -148,7 +165,7 @@ export default class Bundle {
|
||||
}
|
||||
if (isPrototype(proto)) {
|
||||
const componentName = proto.getComponentName()!;
|
||||
if (!proto.getView() && this.viewsMap[componentName]) {
|
||||
if (this.viewsMap[componentName]) {
|
||||
proto.setView(this.viewsMap[componentName]);
|
||||
}
|
||||
if (cp.name && !proto.getPackageName()) {
|
||||
|
||||
@ -213,8 +213,8 @@ class Prototype {
|
||||
static addGlobalExtraActions = addGlobalExtraActions;
|
||||
static removeGlobalPropsConfigure = removeGlobalPropsConfigure;
|
||||
static overridePropsConfigure = overridePropsConfigure;
|
||||
static create(config: OldPrototypeConfig | ComponentMetadata | ComponentMeta, lookup: boolean = false) {
|
||||
return new Prototype(config, lookup);
|
||||
static create(config: OldPrototypeConfig | ComponentMetadata | ComponentMeta, extraConfigs: any = null, lookup: boolean = false) {
|
||||
return new Prototype(config, extraConfigs, lookup);
|
||||
}
|
||||
|
||||
readonly isPrototype = true;
|
||||
@ -224,7 +224,7 @@ class Prototype {
|
||||
return this.meta.npm?.package;
|
||||
}
|
||||
|
||||
constructor(input: OldPrototypeConfig | ComponentMetadata | ComponentMeta, lookup: boolean = false) {
|
||||
constructor(input: OldPrototypeConfig | ComponentMetadata | ComponentMeta, extraConfigs: any = null, lookup: boolean = false) {
|
||||
if (lookup) {
|
||||
this.meta = designer.getComponentMeta(input.componentName);
|
||||
this.options = this.meta.getMetadata();
|
||||
@ -279,15 +279,15 @@ class Prototype {
|
||||
|
||||
private category?: string;
|
||||
getCategory() {
|
||||
if (this.category != null) {
|
||||
return this.category;
|
||||
if (this.options.category != null) {
|
||||
return this.options.category;
|
||||
}
|
||||
|
||||
return this.meta.getMetadata().tags?.[0] || '*';
|
||||
}
|
||||
|
||||
setCategory(category: string) {
|
||||
this.category = category;
|
||||
this.options.category = category;
|
||||
}
|
||||
|
||||
getIcon() {
|
||||
|
||||
@ -3,11 +3,13 @@ import { EventEmitter } from 'events';
|
||||
import { registerSetter, RegisteredSetter, getSetter } from '@ali/lowcode-editor-core';
|
||||
import Bundle from './bundle';
|
||||
import { CustomView } from '@ali/lowcode-types';
|
||||
import Prototype from './prototype';
|
||||
|
||||
export class Trunk {
|
||||
private trunk: any[] = [];
|
||||
private emitter: EventEmitter = new EventEmitter();
|
||||
private metaBundle = new Bundle();
|
||||
private componentPrototypeMocker: any;
|
||||
|
||||
isReady() {
|
||||
return this.getList().length > 0;
|
||||
@ -25,7 +27,13 @@ export class Trunk {
|
||||
|
||||
getList(): any[] {
|
||||
const list = this.trunk.reduceRight((prev, cur) => prev.concat(cur.getList()), []);
|
||||
return Array.from(new Set(list));
|
||||
const result: Prototype[] = [];
|
||||
list.forEach((item: Prototype) => {
|
||||
if (!result.find(r => r.options.componentName === item.options.componentName)) {
|
||||
result.push(item);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
getPrototype(name: string) {
|
||||
@ -98,8 +106,16 @@ export class Trunk {
|
||||
console.warn('Trunk.afterLoadBundle is deprecated');
|
||||
}
|
||||
|
||||
registerComponentPrototypeMocker() {
|
||||
console.warn('Trunk.registerComponentPrototypeMocker is deprecated');
|
||||
registerComponentPrototypeMocker(mocker: any) {
|
||||
this.componentPrototypeMocker = mocker;
|
||||
}
|
||||
|
||||
mockComponentPrototype(bundle: any) {
|
||||
if (!this.componentPrototypeMocker) {
|
||||
lg.error('ERROR: no component prototypeMocker is set');
|
||||
}
|
||||
return this.componentPrototypeMocker
|
||||
&& this.componentPrototypeMocker.mockPrototype(bundle);
|
||||
}
|
||||
|
||||
setPackages() {
|
||||
@ -113,6 +129,10 @@ export class Trunk {
|
||||
}
|
||||
return setter;
|
||||
}
|
||||
|
||||
getRecents(limit: number) {
|
||||
return this.getList().filter((prototype) => prototype.getCategory()).slice(0, limit);
|
||||
}
|
||||
}
|
||||
|
||||
export default new Trunk();
|
||||
|
||||
@ -564,7 +564,7 @@ export function upgradeActions(actions?: Array<ComponentType<any> | ReactElement
|
||||
if (typeof content === 'function') {
|
||||
const fn = content as () => ReactElement;
|
||||
content = (({ node }: any) => {
|
||||
fn.call(node);
|
||||
return fn.call(node);
|
||||
}) as any;
|
||||
}
|
||||
return {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { isJSBlock, isJSExpression, isJSSlot, isI18nData } from '@ali/lowcode-types';
|
||||
import { isPlainObject, hasOwnProperty } from '@ali/lowcode-utils';
|
||||
import { globalContext, Editor } from '@ali/lowcode-editor-core';
|
||||
import { Designer, LiveEditing, TransformStage, Node } from '@ali/lowcode-designer';
|
||||
import { Designer, LiveEditing, TransformStage, Node, getConvertedExtraKey } from '@ali/lowcode-designer';
|
||||
import Outline, { OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
||||
import { toCss } from '@ali/vu-css-style';
|
||||
import logger from '@ali/vu-logger';
|
||||
@ -25,10 +25,17 @@ export const designer = new Designer({ editor: editor });
|
||||
editor.set(Designer, designer);
|
||||
editor.set('designer', designer);
|
||||
|
||||
const nodeCache: any = {};
|
||||
designer.project.onCurrentDocumentChange((doc) => {
|
||||
doc.onRendererReady(() => {
|
||||
bus.emit(VE_EVENTS.VE_PAGE_PAGE_READY);
|
||||
});
|
||||
doc.onNodeCreate((node) => {
|
||||
nodeCache[node.id] = node;
|
||||
});
|
||||
doc.onNodeDestroy((node) => {
|
||||
delete nodeCache[node.id];
|
||||
});
|
||||
});
|
||||
|
||||
interface Variable {
|
||||
@ -42,49 +49,61 @@ function isVariable(obj: any): obj is Variable {
|
||||
}
|
||||
|
||||
function upgradePropsReducer(props: any) {
|
||||
if (!isPlainObject(props)) {
|
||||
if (!props || !isPlainObject(props)) {
|
||||
return props;
|
||||
}
|
||||
if (isJSBlock(props)) {
|
||||
if (props.value.componentName === 'Slot') {
|
||||
return {
|
||||
type: 'JSSlot',
|
||||
title: (props.value.props as any)?.slotTitle,
|
||||
name: (props.value.props as any)?.slotName,
|
||||
value: props.value.children,
|
||||
};
|
||||
} else {
|
||||
return props.value;
|
||||
}
|
||||
}
|
||||
if (isVariable(props)) {
|
||||
return {
|
||||
type: 'JSExpression',
|
||||
value: props.variable,
|
||||
mock: props.value,
|
||||
};
|
||||
}
|
||||
const newProps: any = {};
|
||||
Object.entries<any>(props).forEach(([key, val]) => {
|
||||
if (/^__slot__/.test(key) && val === true) {
|
||||
Object.keys(props).forEach(key => {
|
||||
if (/^__slot__/.test(key) && props[key] === true) {
|
||||
return;
|
||||
}
|
||||
if (isJSBlock(val)) {
|
||||
if (val.value.componentName === 'Slot') {
|
||||
val = {
|
||||
type: 'JSSlot',
|
||||
title: (val.value.props as any)?.slotTitle,
|
||||
name: (val.value.props as any)?.slotName,
|
||||
value: val.value.children,
|
||||
};
|
||||
} else {
|
||||
val = val.value;
|
||||
}
|
||||
}
|
||||
// todo: deep find
|
||||
if (isVariable(val)) {
|
||||
val = {
|
||||
type: 'JSExpression',
|
||||
value: val.variable,
|
||||
mock: val.value,
|
||||
};
|
||||
}
|
||||
newProps[key] = val;
|
||||
newProps[key] = upgradePropsReducer(props[key]);
|
||||
});
|
||||
return newProps;
|
||||
}
|
||||
|
||||
// 升级 Props
|
||||
designer.addPropsReducer(upgradePropsReducer, TransformStage.Upgrade);
|
||||
|
||||
// 节点 props 初始化
|
||||
designer.addPropsReducer((props, node) => {
|
||||
// run initials
|
||||
const newProps: any = {
|
||||
...props,
|
||||
};
|
||||
if (newProps.fieldId) {
|
||||
const fieldIds: any = [];
|
||||
Object.keys(nodeCache).forEach(nodeId => {
|
||||
const fieldId = nodeCache[nodeId].getPropValue('fieldId');
|
||||
if (fieldId) {
|
||||
fieldIds.push(fieldId);
|
||||
}
|
||||
});
|
||||
if (fieldIds.indexOf(props.fieldId) >= 0) {
|
||||
newProps.fieldId = undefined;
|
||||
}
|
||||
}
|
||||
const initials = node.componentMeta.getMetadata().experimental?.initials;
|
||||
if (initials) {
|
||||
const newProps: any = {
|
||||
...props,
|
||||
};
|
||||
const getRealValue = (propValue: any) => {
|
||||
if (isVariable(propValue)) {
|
||||
return propValue.value;
|
||||
@ -98,22 +117,10 @@ designer.addPropsReducer((props, node) => {
|
||||
// FIXME! this implements SettingTarget
|
||||
try {
|
||||
// FIXME! item.name could be 'xxx.xxx'
|
||||
const ov = props[item.name];
|
||||
const ov = newProps[item.name];
|
||||
const v = item.initial(node as any, getRealValue(ov));
|
||||
if (!ov && v !== undefined) {
|
||||
if (isVariable(ov)) {
|
||||
newProps[item.name] = {
|
||||
...ov,
|
||||
value: v,
|
||||
};
|
||||
} else if (isJSExpression(ov)) {
|
||||
newProps[item.name] = {
|
||||
...ov,
|
||||
mock: v,
|
||||
};
|
||||
} else {
|
||||
newProps[item.name] = v;
|
||||
}
|
||||
if (ov === undefined && v !== undefined) {
|
||||
newProps[item.name] = v;
|
||||
}
|
||||
} catch (e) {
|
||||
if (hasOwnProperty(props, item.name)) {
|
||||
@ -124,11 +131,19 @@ designer.addPropsReducer((props, node) => {
|
||||
node.props.add(newProps[item.name], item.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
return newProps;
|
||||
}, TransformStage.Init);
|
||||
|
||||
return newProps;
|
||||
designer.addPropsReducer((props: any, node: Node) => {
|
||||
if (node.isRoot() && props && props.lifeCycles) {
|
||||
return {
|
||||
...props,
|
||||
lifeCycles: {},
|
||||
}
|
||||
}
|
||||
return props;
|
||||
}, TransformStage.Init);
|
||||
}, TransformStage.Render);
|
||||
|
||||
function filterReducer(props: any, node: Node): any {
|
||||
const filters = node.componentMeta.getMetadata().experimental?.filters;
|
||||
@ -188,6 +203,20 @@ function compatiableReducer(props: any) {
|
||||
}
|
||||
// FIXME: Dirty fix, will remove this reducer
|
||||
designer.addPropsReducer(compatiableReducer, TransformStage.Save);
|
||||
// 兼容历史版本的 Page 组件
|
||||
designer.addPropsReducer((props: any, node: Node) => {
|
||||
const lifeCycleNames = ['didMount', 'willUnmount'];
|
||||
if (node.isRoot()) {
|
||||
lifeCycleNames.forEach(key => {
|
||||
if (props[key]) {
|
||||
const lifeCycles = node.props.getPropValue(getConvertedExtraKey('lifeCycles')) || {};
|
||||
lifeCycles[key] = props[key];
|
||||
node.props.setPropValue(getConvertedExtraKey('lifeCycles'), lifeCycles);
|
||||
}
|
||||
});
|
||||
}
|
||||
return props;
|
||||
}, TransformStage.Save);
|
||||
|
||||
// 设计器组件样式处理
|
||||
function stylePropsReducer(props: any, node: any) {
|
||||
@ -231,7 +260,9 @@ function appendStyleNode(props: any, styleProp: any, cssClass: string, cssId: st
|
||||
s.setAttribute('id', cssId);
|
||||
doc.getElementsByTagName('head')[0].appendChild(s);
|
||||
|
||||
s.appendChild(doc.createTextNode(styleProp.replace(/:root/g, '.' + cssClass)));
|
||||
s.appendChild(doc.createTextNode(styleProp.replace(/(\d+)rpx/g, (a, b) => {
|
||||
return `${b / 2}px`;
|
||||
}).replace(/:root/g, '.' + cssClass)));
|
||||
}
|
||||
}
|
||||
designer.addPropsReducer(stylePropsReducer, TransformStage.Render);
|
||||
|
||||
@ -163,7 +163,7 @@ export {
|
||||
Symbols,
|
||||
};
|
||||
|
||||
const version = '6.0.0(LowcodeEngine 0.9.0-beta)';
|
||||
const version = '6.0.0(LowcodeEngine 0.9.3)';
|
||||
|
||||
console.log(
|
||||
`%c VisionEngine %c v${version} `,
|
||||
|
||||
@ -42,7 +42,6 @@ const pages = Object.assign(project, {
|
||||
componentsTree[0].componentName = componentsTree[0].componentName || 'Page';
|
||||
// FIXME
|
||||
if (componentsTree[0].componentName === 'Page' || componentsTree[0].componentName === 'Component') {
|
||||
componentsTree[0].lifeCycles = {};
|
||||
componentsTree[0].methods = {};
|
||||
}
|
||||
}
|
||||
@ -56,6 +55,11 @@ const pages = Object.assign(project, {
|
||||
},
|
||||
true,
|
||||
);
|
||||
|
||||
// FIXME: 根本原因应该是 propStash 导致的,这样可以避免页面加载之后就被标记为 isModified
|
||||
setTimeout(() => {
|
||||
project.currentDocument?.history.savePoint();
|
||||
}, 0);
|
||||
},
|
||||
addPage(data: OldPageData | RootSchema) {
|
||||
if (isPageDataV1(data)) {
|
||||
|
||||
@ -161,6 +161,9 @@ const actionPane = Object.assign(skeleton.topArea, {
|
||||
setActions() {
|
||||
// empty
|
||||
},
|
||||
get actions() {
|
||||
return skeleton.topArea.container.items;
|
||||
},
|
||||
});
|
||||
const dockPane = Object.assign(skeleton.leftArea, {
|
||||
/**
|
||||
@ -210,6 +213,9 @@ const dockPane = Object.assign(skeleton.leftArea, {
|
||||
setFixed(flag: boolean) {
|
||||
// todo:
|
||||
},
|
||||
getDocks() {
|
||||
return skeleton.leftFloatArea?.container.items;
|
||||
},
|
||||
});
|
||||
const tabPane = Object.assign(skeleton.rightArea, {
|
||||
setFloat(flag: boolean) {
|
||||
|
||||
@ -49,7 +49,7 @@ html.engine-blur #engine {
|
||||
.engine-main {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: relative;
|
||||
position: fixed;
|
||||
|
||||
.ve-icon-button {
|
||||
> .ve-icon-contents {
|
||||
@ -121,4 +121,4 @@ html.engine-preview-mode {
|
||||
align-items: center;
|
||||
line-height: 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,14 +3,20 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.13.0...@ali/lowcode-editor-skeleton@1.0.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.49"></a>
|
||||
## [0.8.49](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.8.48...@ali/lowcode-editor-skeleton@0.8.49) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.12.0...@ali/lowcode-editor-skeleton@0.13.0) (2020-08-17)
|
||||
|
||||
@ -21,28 +27,51 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.12.0"></a>
|
||||
# [0.12.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.10.0...@ali/lowcode-editor-skeleton@0.12.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.48"></a>
|
||||
## [0.8.48](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.8.47...@ali/lowcode-editor-skeleton@0.8.48) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove console ([6889123](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/6889123))
|
||||
* setter 报错不影响页面渲染 ([c0a6022](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/c0a6022))
|
||||
* vision 大包 window 指向问题 ([aa1b526](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/aa1b526))
|
||||
* 钉住行为调整 ([91a390e](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/91a390e))
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.10.0...@ali/lowcode-editor-skeleton@0.11.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.47"></a>
|
||||
## [0.8.47](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.8.46...@ali/lowcode-editor-skeleton@0.8.47) (2020-08-07)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.9.0...@ali/lowcode-editor-skeleton@0.10.0) (2020-08-16)
|
||||
=======
|
||||
<a name="0.8.46"></a>
|
||||
## [0.8.46](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.8.45...@ali/lowcode-editor-skeleton@0.8.46) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.9.0"></a>
|
||||
# [0.9.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.8.43...@ali/lowcode-editor-skeleton@0.9.0) (2020-08-14)
|
||||
|
||||
@ -61,6 +90,23 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
|
||||
|
||||
=======
|
||||
<a name="0.8.45"></a>
|
||||
## [0.8.45](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.8.44...@ali/lowcode-editor-skeleton@0.8.45) (2020-08-06)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
|
||||
<a name="0.8.44"></a>
|
||||
## [0.8.44](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.8.43...@ali/lowcode-editor-skeleton@0.8.44) (2020-08-06)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-editor-skeleton
|
||||
>>>>>>> master
|
||||
|
||||
<a name="0.8.43"></a>
|
||||
## [0.8.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-editor-skeleton@0.8.42...@ali/lowcode-editor-skeleton@0.8.43) (2020-08-04)
|
||||
|
||||
@ -25,6 +25,7 @@ export class Field extends Component<FieldProps> {
|
||||
state = {
|
||||
collapsed: this.props.collapsed,
|
||||
display: this.props.defaultDisplay || 'inline',
|
||||
hasError: false,
|
||||
};
|
||||
|
||||
constructor(props: any) {
|
||||
@ -88,6 +89,10 @@ export class Field extends Component<FieldProps> {
|
||||
}
|
||||
}
|
||||
|
||||
static getDerivedStateFromError() {
|
||||
return { hasError: true };
|
||||
}
|
||||
|
||||
getTipContent(propName: string, tip?: any): any {
|
||||
let tipContent = (
|
||||
<div>
|
||||
@ -114,6 +119,11 @@ export class Field extends Component<FieldProps> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { hasError } = this.state;
|
||||
if (hasError) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { className, children, meta, title, valueState, onClear, name: propName, tip } = this.props;
|
||||
const { display, collapsed } = this.state;
|
||||
const isAccordion = display === 'accordion';
|
||||
|
||||
@ -63,6 +63,13 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
|
||||
const { area } = this.props;
|
||||
if (area.visible) {
|
||||
this.focusing?.active();
|
||||
// 关闭当前fixed区域的面板
|
||||
// TODO: 看看有没有更合适的地方
|
||||
const fixedContainer = area?.skeleton?.leftFixedArea?.container;
|
||||
const currentFixed = fixedContainer?.current;
|
||||
if (currentFixed) {
|
||||
fixedContainer.unactive(currentFixed);
|
||||
}
|
||||
} else {
|
||||
this.focusing?.suspense();
|
||||
}
|
||||
|
||||
@ -239,7 +239,7 @@ body {
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: var(--dock-pane-width);
|
||||
min-width: var(--dock-fixed-pane-width);
|
||||
// min-width: var(--dock-fixed-pane-width);
|
||||
left: calc(var(--left-area-width) + 1px);
|
||||
background-color: var(--color-pane-background);
|
||||
box-shadow: 4px 6px 6px 0 rgba(31,50,88,0.08);
|
||||
|
||||
@ -3,48 +3,78 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.13.0...@ali/lowcode-plugin-components-pane@1.0.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.45"></a>
|
||||
## [0.8.45](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.44...@ali/lowcode-plugin-components-pane@0.8.45) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-components-pane
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.12.0...@ali/lowcode-plugin-components-pane@0.13.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.44"></a>
|
||||
## [0.8.44](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.43...@ali/lowcode-plugin-components-pane@0.8.44) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-components-pane
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.12.0"></a>
|
||||
# [0.12.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.10.0...@ali/lowcode-plugin-components-pane@0.12.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.43"></a>
|
||||
## [0.8.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.42...@ali/lowcode-plugin-components-pane@0.8.43) (2020-08-07)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-components-pane
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.10.0...@ali/lowcode-plugin-components-pane@0.11.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.42"></a>
|
||||
## [0.8.42](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.41...@ali/lowcode-plugin-components-pane@0.8.42) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-components-pane
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.9.0...@ali/lowcode-plugin-components-pane@0.10.0) (2020-08-16)
|
||||
=======
|
||||
<a name="0.8.41"></a>
|
||||
## [0.8.41](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.40...@ali/lowcode-plugin-components-pane@0.8.41) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-components-pane
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.9.0"></a>
|
||||
# [0.9.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.39...@ali/lowcode-plugin-components-pane@0.9.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.8.40"></a>
|
||||
## [0.8.40](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-components-pane@0.8.39...@ali/lowcode-plugin-components-pane@0.8.40) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
@ -3,48 +3,78 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.14.0...@ali/lowcode-plugin-designer@1.0.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.9.43"></a>
|
||||
## [0.9.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.42...@ali/lowcode-plugin-designer@0.9.43) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.14.0"></a>
|
||||
# [0.14.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.13.0...@ali/lowcode-plugin-designer@0.14.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.9.42"></a>
|
||||
## [0.9.42](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.41...@ali/lowcode-plugin-designer@0.9.42) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.11.0...@ali/lowcode-plugin-designer@0.13.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.9.41"></a>
|
||||
## [0.9.41](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.40...@ali/lowcode-plugin-designer@0.9.41) (2020-08-07)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.12.0"></a>
|
||||
# [0.12.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.11.0...@ali/lowcode-plugin-designer@0.12.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.9.40"></a>
|
||||
## [0.9.40](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.39...@ali/lowcode-plugin-designer@0.9.40) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.10.0...@ali/lowcode-plugin-designer@0.11.0) (2020-08-16)
|
||||
=======
|
||||
<a name="0.9.39"></a>
|
||||
## [0.9.39](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.38...@ali/lowcode-plugin-designer@0.9.39) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-designer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.37...@ali/lowcode-plugin-designer@0.10.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.9.38"></a>
|
||||
## [0.9.38](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-designer@0.9.37...@ali/lowcode-plugin-designer@0.9.38) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
@ -3,14 +3,20 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.13.0...@ali/lowcode-plugin-outline-pane@1.0.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.49"></a>
|
||||
## [0.8.49](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.48...@ali/lowcode-plugin-outline-pane@0.8.49) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.12.0...@ali/lowcode-plugin-outline-pane@0.13.0) (2020-08-17)
|
||||
|
||||
@ -21,28 +27,54 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.12.0"></a>
|
||||
# [0.12.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.10.0...@ali/lowcode-plugin-outline-pane@0.12.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.48"></a>
|
||||
## [0.8.48](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.47...@ali/lowcode-plugin-outline-pane@0.8.48) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 卡片内容不可用拖动 ([6a85c43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/6a85c43))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.8.47"></a>
|
||||
## [0.8.47](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.46...@ali/lowcode-plugin-outline-pane@0.8.47) (2020-08-07)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.10.0...@ali/lowcode-plugin-outline-pane@0.11.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.46"></a>
|
||||
## [0.8.46](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.45...@ali/lowcode-plugin-outline-pane@0.8.46) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.9.0...@ali/lowcode-plugin-outline-pane@0.10.0) (2020-08-16)
|
||||
=======
|
||||
<a name="0.8.45"></a>
|
||||
## [0.8.45](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.44...@ali/lowcode-plugin-outline-pane@0.8.45) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.9.0"></a>
|
||||
# [0.9.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.43...@ali/lowcode-plugin-outline-pane@0.9.0) (2020-08-14)
|
||||
|
||||
@ -53,6 +85,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
|
||||
|
||||
=======
|
||||
<a name="0.8.44"></a>
|
||||
## [0.8.44](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.43...@ali/lowcode-plugin-outline-pane@0.8.44) (2020-08-06)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-outline-pane
|
||||
>>>>>>> master
|
||||
|
||||
<a name="0.8.43"></a>
|
||||
## [0.8.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-outline-pane@0.8.42...@ali/lowcode-plugin-outline-pane@0.8.43) (2020-08-04)
|
||||
|
||||
@ -122,15 +122,27 @@ export class OutlineMain implements ISensor, ITreeBoard, IScrollable {
|
||||
locate(e: LocateEvent): DropLocation | undefined | null {
|
||||
this.sensing = true;
|
||||
this.scroller?.scrolling(e);
|
||||
const { globalY, dragObject } = e;
|
||||
const { nodes } = dragObject;
|
||||
|
||||
const tree = this._master?.currentTree;
|
||||
if (!tree || !this._shell) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const operationalNodes = nodes?.filter((node: any) => {
|
||||
const onMoveHook = node.componentMeta?.getMetadata()?.experimental?.callbacks?.onMoveHook;
|
||||
const canMove = onMoveHook && typeof onMoveHook === 'function' ? onMoveHook() : true;
|
||||
|
||||
return canMove;
|
||||
});
|
||||
|
||||
if (!operationalNodes || operationalNodes.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const document = tree.document;
|
||||
const designer = document.designer;
|
||||
const { globalY, dragObject } = e;
|
||||
const pos = getPosFromEvent(e, this._shell);
|
||||
const irect = this.getInsertionRect();
|
||||
const originLoc = document.dropLocation;
|
||||
@ -196,7 +208,7 @@ export class OutlineMain implements ISensor, ITreeBoard, IScrollable {
|
||||
let focusSlots = pos.focusSlots;
|
||||
let { node } = treeNode;
|
||||
if (isDragNodeObject(dragObject)) {
|
||||
const nodes = dragObject.nodes;
|
||||
const nodes = operationalNodes;
|
||||
let i = nodes.length;
|
||||
let p: any = node;
|
||||
while (i-- > 0) {
|
||||
|
||||
@ -3,38 +3,59 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.15.0...@ali/lowcode-plugin-sample-preview@1.0.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.47"></a>
|
||||
## [0.8.47](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.46...@ali/lowcode-plugin-sample-preview@0.8.47) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-sample-preview
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.15.0"></a>
|
||||
# [0.15.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.14.0...@ali/lowcode-plugin-sample-preview@0.15.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.46"></a>
|
||||
## [0.8.46](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.45...@ali/lowcode-plugin-sample-preview@0.8.46) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-sample-preview
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.14.0"></a>
|
||||
# [0.14.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.12.0...@ali/lowcode-plugin-sample-preview@0.14.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.45"></a>
|
||||
## [0.8.45](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.44...@ali/lowcode-plugin-sample-preview@0.8.45) (2020-08-07)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-sample-preview
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.12.0...@ali/lowcode-plugin-sample-preview@0.13.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.44"></a>
|
||||
## [0.8.44](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.43...@ali/lowcode-plugin-sample-preview@0.8.44) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-sample-preview
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.12.0"></a>
|
||||
# [0.12.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.11.0...@ali/lowcode-plugin-sample-preview@0.12.0) (2020-08-16)
|
||||
|
||||
@ -48,20 +69,30 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.10.0...@ali/lowcode-plugin-sample-preview@0.11.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.8.43"></a>
|
||||
## [0.8.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.42...@ali/lowcode-plugin-sample-preview@0.8.43) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-sample-preview
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.9.0...@ali/lowcode-plugin-sample-preview@0.10.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.8.42"></a>
|
||||
## [0.8.42](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.41...@ali/lowcode-plugin-sample-preview@0.8.42) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-sample-preview
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.9.0"></a>
|
||||
# [0.9.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.41...@ali/lowcode-plugin-sample-preview@0.9.0) (2020-08-14)
|
||||
|
||||
@ -79,6 +110,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
|
||||
|
||||
=======
|
||||
>>>>>>> master
|
||||
<a name="0.8.41"></a>
|
||||
## [0.8.41](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-sample-preview@0.8.40...@ali/lowcode-plugin-sample-preview@0.8.41) (2020-08-04)
|
||||
|
||||
|
||||
@ -3,46 +3,72 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.13.0...@ali/lowcode-plugin-undo-redo@1.0.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.47"></a>
|
||||
## [0.8.47](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.46...@ali/lowcode-plugin-undo-redo@0.8.47) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-undo-redo
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.12.0...@ali/lowcode-plugin-undo-redo@0.13.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.46"></a>
|
||||
## [0.8.46](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.45...@ali/lowcode-plugin-undo-redo@0.8.46) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-undo-redo
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.12.0"></a>
|
||||
# [0.12.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.10.0...@ali/lowcode-plugin-undo-redo@0.12.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.45"></a>
|
||||
## [0.8.45](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.44...@ali/lowcode-plugin-undo-redo@0.8.45) (2020-08-07)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-undo-redo
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.10.0...@ali/lowcode-plugin-undo-redo@0.11.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.44"></a>
|
||||
## [0.8.44](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.43...@ali/lowcode-plugin-undo-redo@0.8.44) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-undo-redo
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.9.0...@ali/lowcode-plugin-undo-redo@0.10.0) (2020-08-16)
|
||||
=======
|
||||
<a name="0.8.43"></a>
|
||||
## [0.8.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.42...@ali/lowcode-plugin-undo-redo@0.8.43) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-undo-redo
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.9.0"></a>
|
||||
# [0.9.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.41...@ali/lowcode-plugin-undo-redo@0.9.0) (2020-08-14)
|
||||
|
||||
@ -53,6 +79,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
|
||||
|
||||
=======
|
||||
<a name="0.8.42"></a>
|
||||
## [0.8.42](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.41...@ali/lowcode-plugin-undo-redo@0.8.42) (2020-08-06)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-plugin-undo-redo
|
||||
>>>>>>> master
|
||||
|
||||
<a name="0.8.41"></a>
|
||||
## [0.8.41](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-plugin-undo-redo@0.8.40...@ali/lowcode-plugin-undo-redo@0.8.41) (2020-08-04)
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-renderer@0.5.0...@ali/lowcode-rax-renderer@1.0.0) (2020-08-17)
|
||||
|
||||
@ -44,6 +45,20 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-renderer
|
||||
|
||||
<a name="0.1.6"></a>
|
||||
=======
|
||||
<a name="0.1.7"></a>
|
||||
## [0.1.7](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-renderer@0.1.6...@ali/lowcode-rax-renderer@0.1.7) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **rax-render:** hidden无效 ([08a3e36](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/08a3e36))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.1.6"></a>
|
||||
>>>>>>> master
|
||||
## [0.1.6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-renderer@0.1.5...@ali/lowcode-rax-renderer@0.1.6) (2020-07-22)
|
||||
|
||||
|
||||
@ -112,7 +127,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
### Features
|
||||
|
||||
* init rax-render ([7167767](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/7167767))
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
|
||||
>>>>>>> master
|
||||
&&
|
||||
&&
|
||||
||
|
||||
|
||||
@ -241,6 +241,10 @@ export default class BaseEngine extends Component {
|
||||
if (!isSchema(schema)) return null;
|
||||
let Comp = components[schema.componentName] || engine.getNotFoundComponent();
|
||||
|
||||
if (schema.hidden) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (schema.loop !== undefined) {
|
||||
return this.__createLoopVirtualDom(
|
||||
{
|
||||
|
||||
@ -3,14 +3,20 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.15.0...@ali/lowcode-rax-simulator-renderer@1.0.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.47"></a>
|
||||
## [0.8.47](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.46...@ali/lowcode-rax-simulator-renderer@0.8.47) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.15.0"></a>
|
||||
# [0.15.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.14.0...@ali/lowcode-rax-simulator-renderer@0.15.0) (2020-08-17)
|
||||
|
||||
@ -29,36 +35,67 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.12.0...@ali/lowcode-rax-simulator-renderer@0.13.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.46"></a>
|
||||
## [0.8.46](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.45...@ali/lowcode-rax-simulator-renderer@0.8.46) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update package.json ([f1ec59c](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/f1ec59c))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.8.45"></a>
|
||||
## [0.8.45](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.44...@ali/lowcode-rax-simulator-renderer@0.8.45) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.12.0"></a>
|
||||
# [0.12.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.11.0...@ali/lowcode-rax-simulator-renderer@0.12.0) (2020-08-16)
|
||||
=======
|
||||
<a name="0.8.44"></a>
|
||||
## [0.8.44](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.43...@ali/lowcode-rax-simulator-renderer@0.8.44) (2020-08-07)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.10.0...@ali/lowcode-rax-simulator-renderer@0.11.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.8.43"></a>
|
||||
## [0.8.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.42...@ali/lowcode-rax-simulator-renderer@0.8.43) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.9.0...@ali/lowcode-rax-simulator-renderer@0.10.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.8.42"></a>
|
||||
## [0.8.42](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.41...@ali/lowcode-rax-simulator-renderer@0.8.42) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.9.0"></a>
|
||||
# [0.9.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.40...@ali/lowcode-rax-simulator-renderer@0.9.0) (2020-08-14)
|
||||
|
||||
@ -66,6 +103,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-rax-simulator-renderer
|
||||
=======
|
||||
<a name="0.8.41"></a>
|
||||
## [0.8.41](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.40...@ali/lowcode-rax-simulator-renderer@0.8.41) (2020-08-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 修复 preset-vision 版本 lifeCycles 丢失以及 slot 初始化问题 ([7cf6d24](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/7cf6d24))
|
||||
|
||||
|
||||
|
||||
>>>>>>> master
|
||||
|
||||
<a name="0.8.40"></a>
|
||||
## [0.8.40](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-rax-simulator-renderer@0.8.39...@ali/lowcode-rax-simulator-renderer@0.8.40) (2020-08-04)
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-renderer@0.15.0...@ali/lowcode-react-renderer@1.0.0) (2020-08-17)
|
||||
|
||||
@ -61,10 +62,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.9.0"></a>
|
||||
# [0.9.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-renderer@0.8.17...@ali/lowcode-react-renderer@0.9.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.8.18"></a>
|
||||
## [0.8.18](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-renderer@0.8.17...@ali/lowcode-react-renderer@0.8.18) (2020-08-14)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
<<<<<<< HEAD
|
||||
* dropdown and menu schema ([ae1d125](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/ae1d125))
|
||||
* parse custom methods function ([87d8b86](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/87d8b86))
|
||||
|
||||
@ -72,6 +78,11 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
### Features
|
||||
|
||||
* 🎸 add demo-server ([df35c6a](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/df35c6a))
|
||||
=======
|
||||
* remove debugger ([a835dc6](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/a835dc6))
|
||||
* render error样式 ([d601d5e](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/d601d5e))
|
||||
* 组件缺失占位 ([aff2f34](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/aff2f34))
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
@ -30,14 +30,33 @@ class FaultComponent extends PureComponent {
|
||||
render() {
|
||||
// FIXME: errorlog
|
||||
console.error('render error', this.props);
|
||||
return <Div>RenderError</Div>;
|
||||
const { _componentName: componentName } = this.props;
|
||||
return <Div
|
||||
style={{
|
||||
backgroundColor: '#DE2710',
|
||||
padding: '15px',
|
||||
fontSize: '18px',
|
||||
textAlign: 'center',
|
||||
color: 'white',
|
||||
}}
|
||||
>组件 {componentName} 渲染错误,请打开控制台排查</Div>;;
|
||||
}
|
||||
}
|
||||
|
||||
class NotFoundComponent extends PureComponent {
|
||||
render() {
|
||||
console.error('component not found', this.props);
|
||||
return <Div {...this.props} />;
|
||||
console.error('component not found:', this.props);
|
||||
const { _componentName: componentName } = this.props;
|
||||
return <Div
|
||||
{...this.props}
|
||||
style={{
|
||||
backgroundColor: '#3E91C9',
|
||||
padding: '15px',
|
||||
fontSize: '18px',
|
||||
textAlign: 'center',
|
||||
color: 'white',
|
||||
}}
|
||||
>组件 {componentName} 无视图,请打开控制台排查</Div>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="1.0.0"></a>
|
||||
# [1.0.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.15.0...@ali/lowcode-react-simulator-renderer@1.0.0) (2020-08-17)
|
||||
|
||||
@ -29,10 +30,39 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.13.0"></a>
|
||||
# [0.13.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.12.0...@ali/lowcode-react-simulator-renderer@0.13.0) (2020-08-17)
|
||||
=======
|
||||
<a name="0.8.49"></a>
|
||||
## [0.8.49](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.48...@ali/lowcode-react-simulator-renderer@0.8.49) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 支持低代码组件样式 ([6e64be1](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/6e64be1))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.8.48"></a>
|
||||
## [0.8.48](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.47...@ali/lowcode-react-simulator-renderer@0.8.48) (2020-08-14)
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<a name="0.8.47"></a>
|
||||
## [0.8.47](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.46...@ali/lowcode-react-simulator-renderer@0.8.47) (2020-08-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* createComponent 支持所有 schema ([7f946f5](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/7f946f5))
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<a name="0.12.0"></a>
|
||||
@ -45,22 +75,47 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
||||
|
||||
<a name="0.11.0"></a>
|
||||
# [0.11.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.10.0...@ali/lowcode-react-simulator-renderer@0.11.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.8.46"></a>
|
||||
## [0.8.46](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.45...@ali/lowcode-react-simulator-renderer@0.8.46) (2020-08-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 部分低代码组件渲染报错 ([093015c](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/commit/093015c))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="0.8.45"></a>
|
||||
## [0.8.45](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.44...@ali/lowcode-react-simulator-renderer@0.8.45) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.10.0"></a>
|
||||
# [0.10.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.9.0...@ali/lowcode-react-simulator-renderer@0.10.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.8.44"></a>
|
||||
## [0.8.44](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.43...@ali/lowcode-react-simulator-renderer@0.8.44) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
**Note:** Version bump only for package @ali/lowcode-react-simulator-renderer
|
||||
|
||||
<<<<<<< HEAD
|
||||
<a name="0.9.0"></a>
|
||||
# [0.9.0](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.42...@ali/lowcode-react-simulator-renderer@0.9.0) (2020-08-14)
|
||||
=======
|
||||
<a name="0.8.43"></a>
|
||||
## [0.8.43](https://gitlab.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/compare/@ali/lowcode-react-simulator-renderer@0.8.42...@ali/lowcode-react-simulator-renderer@0.8.43) (2020-08-06)
|
||||
>>>>>>> master
|
||||
|
||||
|
||||
|
||||
|
||||
@ -6,8 +6,15 @@ import { computed, obx } from '@recore/obx';
|
||||
import { Asset } from '@ali/lowcode-utils';
|
||||
import { getClientRects } from './utils/get-client-rects';
|
||||
import { reactFindDOMNodes, FIBER_KEY } from './utils/react-find-dom-nodes';
|
||||
import { isElement, cursor, setNativeSelection, buildComponents, getSubComponent, AssetLoader } from '@ali/lowcode-utils';
|
||||
import { RootSchema, ComponentSchema, TransformStage } from '@ali/lowcode-types';
|
||||
import {
|
||||
isElement,
|
||||
cursor,
|
||||
setNativeSelection,
|
||||
buildComponents,
|
||||
getSubComponent,
|
||||
AssetLoader,
|
||||
} from '@ali/lowcode-utils';
|
||||
import { RootSchema, ComponentSchema, TransformStage, NodeSchema } from '@ali/lowcode-types';
|
||||
// just use types
|
||||
import { BuiltinSimulatorRenderer, NodeInstance, Component } from '@ali/lowcode-designer';
|
||||
import Slot from './builtin-components/slot';
|
||||
@ -216,13 +223,22 @@ export class SimulatorRenderer implements BuiltinSimulatorRenderer {
|
||||
return this.instancesMap.get(id) || null;
|
||||
}
|
||||
|
||||
createComponent(schema: ComponentSchema): Component | null {
|
||||
createComponent(schema: NodeSchema): Component | null {
|
||||
let _schema: any = {
|
||||
...schema,
|
||||
};
|
||||
_schema.methods = {};
|
||||
_schema.lifeCycles = {};
|
||||
|
||||
if (schema.componentName === 'Component' && (schema as ComponentSchema).css) {
|
||||
const doc = window.document;
|
||||
const s = doc.createElement('style');
|
||||
s.setAttribute('type', 'text/css');
|
||||
s.setAttribute('id', `Component-${schema.id || ''}`);
|
||||
s.appendChild(doc.createTextNode((schema as ComponentSchema).css || ''));
|
||||
doc.getElementsByTagName('head')[0].appendChild(s);
|
||||
}
|
||||
|
||||
const node = host.document.createNode(_schema);
|
||||
_schema = node.export(TransformStage.Render);
|
||||
|
||||
@ -234,14 +250,14 @@ export class SimulatorRenderer implements BuiltinSimulatorRenderer {
|
||||
const result = { ...propsSchema };
|
||||
const reg = /^(?:this\.props|props)\.(\S+)$/;
|
||||
Object.keys(result).map((key: string) => {
|
||||
if (result[key].type === 'JSExpression') {
|
||||
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') {
|
||||
} else if (result[key]?.type === 'JSSlot') {
|
||||
const schema = result[key].value;
|
||||
result[key] = createElement(Ele, { schema, propsMap: {} });
|
||||
}
|
||||
@ -271,6 +287,9 @@ export class SimulatorRenderer implements BuiltinSimulatorRenderer {
|
||||
}
|
||||
const { schema, propsMap } = this.props;
|
||||
const Com = componentsMap[schema.componentName];
|
||||
if (!Com) {
|
||||
return null;
|
||||
}
|
||||
let children = null;
|
||||
if (schema.children && schema.children.length > 0) {
|
||||
children = schema.children.map((item: any) => createElement(Ele, { schema: item, propsMap }));
|
||||
@ -283,13 +302,23 @@ export class SimulatorRenderer implements BuiltinSimulatorRenderer {
|
||||
}
|
||||
|
||||
class Com extends React.Component {
|
||||
// TODO: 暂时解决性能问题
|
||||
shouldComponentUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
render() {
|
||||
let children = [];
|
||||
const propsMap = this.props;
|
||||
if (_schema.children && Array.isArray(_schema.children)) {
|
||||
children = _schema.children.map((item: any) => createElement(Ele, { schema: item, propsMap }));
|
||||
const componentName = _schema.componentName;
|
||||
if (componentName === 'Component') {
|
||||
let children = [];
|
||||
const propsMap = this.props || {};
|
||||
if (_schema.children && Array.isArray(_schema.children)) {
|
||||
children = _schema.children.map((item: any) => createElement(Ele, { schema: item, propsMap }));
|
||||
}
|
||||
return createElement('div', {}, children);
|
||||
} else {
|
||||
return createElement(Ele, { schema: _schema, propsMap: {} });
|
||||
}
|
||||
return createElement(React.Fragment, {}, children);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user