Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into release/1.1.7-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
JackLian committed May 11, 2023
2 parents a9c9dd4 + 5ada0a4 commit c18cc9b
Show file tree
Hide file tree
Showing 41 changed files with 69 additions and 42 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"yarn": "^1.22.17",
"rimraf": "^3.0.2",
"@types/react-router": "5.1.18",
"build-plugin-component": "^1.12.0",
"@alilc/build-plugin-lce": "^0.0.3",
"babel-jest": "^26.5.2",
"@alilc/lowcode-test-mate": "^1.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/designer/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": [
"build-plugin-component"
"@alilc/build-plugin-lce"
]
}
2 changes: 1 addition & 1 deletion packages/designer/build.test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"@alilc/lowcode-test-mate/plugin/index.ts"
],
"babelPlugins": [
Expand Down
2 changes: 1 addition & 1 deletion packages/designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"es"
],
"scripts": {
"build": "build-scripts build --skip-demo",
"build": "build-scripts build",
"test": "build-scripts test --config build.test.json",
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-core/build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"build-plugin-fusion",
"./build.plugin.js"
]
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"es"
],
"scripts": {
"build": "build-scripts build --skip-demo"
"build": "build-scripts build"
},
"dependencies": {
"@alifd/next": "^1.19.16",
Expand Down
4 changes: 2 additions & 2 deletions packages/editor-skeleton/build.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"build-plugin-fusion",
["build-plugin-moment-locales", {
"locales": ["zh-cn"]
}]
]
}
}
2 changes: 1 addition & 1 deletion packages/editor-skeleton/build.test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"@alilc/lowcode-test-mate/plugin/index.ts"
],
"babelPlugins": [
Expand Down
2 changes: 1 addition & 1 deletion packages/editor-skeleton/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"scripts": {
"test": "build-scripts test --config build.test.json",
"build": "build-scripts build --skip-demo"
"build": "build-scripts build"
},
"keywords": [
"lowcode",
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
[
"build-plugin-fusion",
{
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/build.test.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plugins": [
[
"build-plugin-component",
"@alilc/build-plugin-lce",
{
"filename": "editor-preset-vision",
"library": "LowcodeEditor",
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"start": "build-scripts start",
"version:update": "node ./scripts/version.js",
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build",
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
"test": "build-scripts test --config build.test.json --jest-passWithNoTests"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-designer/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": [
"build-plugin-component"
"@alilc/build-plugin-lce"
]
}
2 changes: 1 addition & 1 deletion packages/plugin-designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"module": "es/index.js",
"stylePath": "style.js",
"scripts": {
"build": "build-scripts build --skip-demo"
"build": "build-scripts build"
},
"keywords": [
"lowcode",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-outline-pane/build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"build-plugin-fusion",
["build-plugin-moment-locales", {
"locales": ["zh-cn"]
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-outline-pane/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "lib/index.js",
"module": "es/index.js",
"scripts": {
"build": "build-scripts build --skip-demo"
"build": "build-scripts build"
},
"dependencies": {
"@alifd/next": "^1.19.16",
Expand Down
19 changes: 19 additions & 0 deletions packages/plugin-outline-pane/src/controllers/tree-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ enum EVENT_NAMES {
titleLabelChanged = 'titleLabelChanged',

expandableChanged = 'expandableChanged',

conditionChanged = 'conditionChanged',
}

export default class TreeNode {
Expand Down Expand Up @@ -152,6 +154,10 @@ export default class TreeNode {
return this.node.slots.map((node) => this.tree.getTreeNode(node));
}

get condition(): boolean {
return this.node.hasCondition() && !this.node.conditionGroup;
}

get children(): TreeNode[] | null {
return this.node.children?.map((node) => this.tree.getTreeNode(node)) || null;
}
Expand Down Expand Up @@ -203,6 +209,15 @@ export default class TreeNode {
this.event.off(EVENT_NAMES.titleLabelChanged, fn);
};
}

onConditionChanged(fn: (treeNode: TreeNode) => void): IPublicTypeDisposable {
this.event.on(EVENT_NAMES.conditionChanged, fn);

return () => {
this.event.off(EVENT_NAMES.conditionChanged, fn);
};
}

onExpandableChanged(fn: (expandable: boolean) => void): IPublicTypeDisposable {
this.event.on(EVENT_NAMES.expandableChanged, fn);
return () => {
Expand All @@ -221,6 +236,10 @@ export default class TreeNode {
this.event.emit(EVENT_NAMES.titleLabelChanged, this.title);
}

notifyConditionChanged(): void {
this.event.emit(EVENT_NAMES.conditionChanged, this.condition);
}

setHidden(flag: boolean) {
if (this.node.conditionGroup) {
return;
Expand Down
3 changes: 3 additions & 0 deletions packages/plugin-outline-pane/src/controllers/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export class Tree {
if (key === '___title___') {
const treeNode = this.getTreeNodeById(node.id);
treeNode?.notifyTitleLabelChanged();
} else if (key === '___condition___') {
const treeNode = this.getTreeNodeById(node.id);
treeNode?.notifyConditionChanged();
}
});
}
Expand Down
9 changes: 8 additions & 1 deletion packages/plugin-outline-pane/src/views/tree-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default class TreeTitle extends PureComponent<{
state: {
editing: boolean;
title: string;
condition?: boolean;
} = {
editing: false,
title: '',
Expand Down Expand Up @@ -80,12 +81,18 @@ export default class TreeTitle extends PureComponent<{
this.setState({
editing: false,
title: treeNode.titleLabel,
condition: treeNode.condition,
});
treeNode.onTitleLabelChanged(() => {
this.setState({
title: treeNode.titleLabel,
});
});
treeNode.onConditionChanged(() => {
this.setState({
condition: treeNode.condition,
});
});
}

render() {
Expand Down Expand Up @@ -188,7 +195,7 @@ export default class TreeTitle extends PureComponent<{
<Tip>{intlNode('Loop')}</Tip>
</a>
)}
{node.hasCondition() && !node.conditionGroup && (
{this.state.condition && (
<a className="tree-node-tag cond">
{/* todo: click todo something */}
<IconCond />
Expand Down
2 changes: 1 addition & 1 deletion packages/rax-simulator-renderer/build.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"plugins": ["build-plugin-component", "./build.plugin.js"]
"plugins": ["@alilc/build-plugin-lce", "./build.plugin.js"]
}
2 changes: 1 addition & 1 deletion packages/rax-simulator-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dist"
],
"scripts": {
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build",
"build:umd": "build-scripts build --config build.umd.json"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-renderer/build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"build-plugin-fusion",
["build-plugin-moment-locales", {
"locales": ["zh-cn"]
Expand Down
2 changes: 1 addition & 1 deletion packages/react-renderer/build.test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"@alilc/lowcode-test-mate/plugin/index.ts"
]
}
2 changes: 1 addition & 1 deletion packages/react-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"test": "build-scripts test --config build.test.json",
"start": "build-scripts start",
"build": "build-scripts build --skip-demo",
"build": "build-scripts build",
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/react-simulator-renderer/build.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"plugins": ["build-plugin-component", "./build.plugin.js"]
"plugins": ["@alilc/build-plugin-lce", "./build.plugin.js"]
}
2 changes: 1 addition & 1 deletion packages/react-simulator-renderer/build.test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"@alilc/lowcode-test-mate/plugin/index.ts"
]
}
2 changes: 1 addition & 1 deletion packages/react-simulator-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"scripts": {
"test": "build-scripts test --config build.test.json",
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --skip-demo",
"build": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build",
"build:umd": "NODE_OPTIONS=--max_old_space_size=8192 build-scripts build --config build.umd.json",
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer-core/build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plugins": [
[
"build-plugin-component",
"@alilc/build-plugin-lce",
{
"babelPlugins": ["@babel/plugin-transform-typescript"]
}
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer-core/build.test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"@alilc/lowcode-test-mate/plugin/index.ts"
]
}
2 changes: 1 addition & 1 deletion packages/renderer-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"es"
],
"scripts": {
"build": "build-scripts build --skip-demo",
"build": "build-scripts build",
"test": "build-scripts test --config build.test.json",
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/shell/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": [
"build-plugin-component"
"@alilc/build-plugin-lce"
]
}
2 changes: 1 addition & 1 deletion packages/shell/build.test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"@alilc/lowcode-test-mate/plugin/index.ts"
]
}
4 changes: 1 addition & 3 deletions packages/shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"es"
],
"scripts": {
"build": "build-scripts build --skip-demo",
"test": "build-scripts test --config build.test.json",
"test:cov": "build-scripts test --config build.test.json --jest-coverage"
"build": "build-scripts build"
},
"license": "MIT",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": [
"build-plugin-component"
"@alilc/build-plugin-lce"
]
}
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "lib/index.js",
"module": "es/index.js",
"scripts": {
"build": "build-scripts build --skip-demo"
"build": "build-scripts build"
},
"dependencies": {
"@alilc/lowcode-datasource-types": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": [
"build-plugin-component"
"@alilc/build-plugin-lce"
]
}
2 changes: 1 addition & 1 deletion packages/utils/build.test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"@alilc/lowcode-test-mate/plugin/index.ts"
]
}
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"module": "es/index.js",
"scripts": {
"test": "build-scripts test --config build.test.json",
"build": "build-scripts build --skip-demo"
"build": "build-scripts build"
},
"dependencies": {
"@alifd/next": "^1.19.16",
Expand Down
2 changes: 1 addition & 1 deletion packages/workspace/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": [
"build-plugin-component"
"@alilc/build-plugin-lce"
]
}
2 changes: 1 addition & 1 deletion packages/workspace/build.test.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"plugins": [
"build-plugin-component",
"@alilc/build-plugin-lce",
"@alilc/lowcode-test-mate/plugin/index.ts"
]
}
Loading

0 comments on commit c18cc9b

Please sign in to comment.