From 0c5494012c5f9f0667a87d8e5c119724fad49478 Mon Sep 17 00:00:00 2001 From: janryWang Date: Wed, 9 Jun 2021 23:44:09 +0800 Subject: [PATCH] =?UTF-8?q?chore(versions):=20=F0=9F=98=8A=20publish=20v0.?= =?UTF-8?q?1.21?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ lerna.json | 2 +- packages/core/package.json | 4 ++-- packages/playground/package.json | 12 ++++++------ packages/react-sandbox/package.json | 6 +++--- packages/react-settings-form/package.json | 8 ++++---- .../src/components/PolyInput/index.tsx | 8 ++++++-- packages/react/package.json | 6 +++--- .../react/src/widgets/DragSourceWidget/index.tsx | 12 +++++++----- .../react/src/widgets/DragSourceWidget/styles.less | 11 +++++++++-- packages/shared/package.json | 2 +- 11 files changed, 48 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1756eee1a..406341dd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v0.1.20(2021-06-09) + +### :rocket: Improve Performance + +1. [perf(core): improve performance](https://github.com/alibaba/designable/commit/326067f) :point_right: ( [janryWang](https://github.com/janryWang) ) + ## v0.1.19(2021-06-09) ### :rocket: Improve Performance diff --git a/lerna.json b/lerna.json index f370294f5..f4718451e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.1.20", + "version": "0.1.21", "npmClient": "yarn", "useWorkspaces": true, "npmClientArgs": ["--ignore-engines"], diff --git a/packages/core/package.json b/packages/core/package.json index 67d2a59bf..bd9dbeff7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@designable/core", - "version": "0.1.20", + "version": "0.1.21", "license": "MIT", "main": "lib", "types": "lib/index.d.ts", @@ -15,7 +15,7 @@ "build:umd": "rollup --config" }, "dependencies": { - "@designable/shared": "0.1.20", + "@designable/shared": "0.1.21", "@formily/json-schema": "^2.0.0-beta.50", "@formily/path": "^2.0.0-beta.50", "@formily/reactive": "^2.0.0-beta.50", diff --git a/packages/playground/package.json b/packages/playground/package.json index e576a8a97..177cacfd4 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -1,6 +1,6 @@ { "name": "@designable/playground", - "version": "0.1.20", + "version": "0.1.21", "license": "MIT", "private": true, "engines": { @@ -25,11 +25,11 @@ "webpack-dev-server": "^3.10.1" }, "dependencies": { - "@designable/core": "0.1.20", - "@designable/react": "0.1.20", - "@designable/react-sandbox": "0.1.20", - "@designable/react-settings-form": "0.1.20", - "@designable/shared": "0.1.20", + "@designable/core": "0.1.21", + "@designable/react": "0.1.21", + "@designable/react-sandbox": "0.1.21", + "@designable/react-settings-form": "0.1.21", + "@designable/shared": "0.1.21", "@formily/reactive": "^2.0.0-beta.50", "@formily/reactive-react": "^2.0.0-beta.50", "antd": "^4.15.2", diff --git a/packages/react-sandbox/package.json b/packages/react-sandbox/package.json index 113b20794..ef27b6cc9 100644 --- a/packages/react-sandbox/package.json +++ b/packages/react-sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@designable/react-sandbox", - "version": "0.1.20", + "version": "0.1.21", "license": "MIT", "main": "lib", "types": "lib/index.d.ts", @@ -18,8 +18,8 @@ "react": "16.x || 17.x" }, "dependencies": { - "@designable/react": "0.1.20", - "@designable/shared": "0.1.20" + "@designable/react": "0.1.21", + "@designable/shared": "0.1.21" }, "publishConfig": { "access": "public" diff --git a/packages/react-settings-form/package.json b/packages/react-settings-form/package.json index 274cf9518..e6d9b9eea 100644 --- a/packages/react-settings-form/package.json +++ b/packages/react-settings-form/package.json @@ -1,6 +1,6 @@ { "name": "@designable/react-settings-form", - "version": "0.1.20", + "version": "0.1.21", "license": "MIT", "main": "lib", "types": "lib/index.d.ts", @@ -21,9 +21,9 @@ "antd": "^4.15.5" }, "dependencies": { - "@designable/core": "0.1.20", - "@designable/react": "0.1.20", - "@designable/shared": "0.1.20", + "@designable/core": "0.1.21", + "@designable/react": "0.1.21", + "@designable/shared": "0.1.21", "@formily/antd": "^2.0.0-beta.50", "@formily/core": "^2.0.0-beta.50", "@formily/react": "^2.0.0-beta.50", diff --git a/packages/react-settings-form/src/components/PolyInput/index.tsx b/packages/react-settings-form/src/components/PolyInput/index.tsx index 05ef4d866..00b422eb0 100644 --- a/packages/react-settings-form/src/components/PolyInput/index.tsx +++ b/packages/react-settings-form/src/components/PolyInput/index.tsx @@ -42,8 +42,12 @@ const createTypes = ( include: string[] ) => { return types.filter(({ type }) => { - if (include?.includes?.(type)) return true - if (exclude?.includes?.(type)) return false + if (Array.isArray(include) && include.length) { + return include.includes(type) + } + if (Array.isArray(exclude) && exclude.length) { + return !exclude.includes(type) + } return true }) } diff --git a/packages/react/package.json b/packages/react/package.json index 4ee0bd0c9..c36c37e11 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@designable/react", - "version": "0.1.20", + "version": "0.1.21", "license": "MIT", "main": "lib", "types": "lib/index.d.ts", @@ -19,8 +19,8 @@ "react": "16.x || 17.x" }, "dependencies": { - "@designable/core": "0.1.20", - "@designable/shared": "0.1.20", + "@designable/core": "0.1.21", + "@designable/shared": "0.1.21", "@formily/reactive": "^2.0.0-beta.50", "@formily/reactive-react": "^2.0.0-beta.50", "@juggle/resize-observer": "^3.3.1" diff --git a/packages/react/src/widgets/DragSourceWidget/index.tsx b/packages/react/src/widgets/DragSourceWidget/index.tsx index 86101c984..98122160c 100644 --- a/packages/react/src/widgets/DragSourceWidget/index.tsx +++ b/packages/react/src/widgets/DragSourceWidget/index.tsx @@ -62,11 +62,13 @@ export const DragSourceWidget: React.FC = observer( {props.title || `sources.${props.name}`} -
- {designer.source.mapSourcesByGroup( - props.name, - isFn(props.children) ? props.children : renderNode - )} +
+
+ {designer.source.mapSourcesByGroup( + props.name, + isFn(props.children) ? props.children : renderNode + )} +
) diff --git a/packages/react/src/widgets/DragSourceWidget/styles.less b/packages/react/src/widgets/DragSourceWidget/styles.less index 292b57468..e71e8d25e 100644 --- a/packages/react/src/widgets/DragSourceWidget/styles.less +++ b/packages/react/src/widgets/DragSourceWidget/styles.less @@ -2,6 +2,7 @@ .@{prefix-cls}-drag-source { flex-wrap: wrap; + &-header { display: flex; align-items: center; @@ -27,12 +28,17 @@ } } + &-content-wrapper { + display: flex; + justify-content: center; + } + &-content { - padding: 10px; + margin: 10px; + width: 260px; display: flex; flex-wrap: wrap; display: none; - justify-content: center; } &.expand { @@ -60,6 +66,7 @@ display: flex; align-items: center; font-size: 12px; + &:hover { border: 1px dashed var(--dn-drag-source-item-hover-border-color); color: var(--dn-drag-source-item-hover-color); diff --git a/packages/shared/package.json b/packages/shared/package.json index 6307412b8..289e30661 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@designable/shared", - "version": "0.1.20", + "version": "0.1.21", "license": "MIT", "main": "lib", "types": "lib/index.d.ts",