From 99b46a3eee96f8ba92edf2ea29adaea0ad2a543e Mon Sep 17 00:00:00 2001 From: janrywang Date: Tue, 24 Aug 2021 20:46:47 +0800 Subject: [PATCH] fix(designable): fix can not drag object to array cards in initialization --- designable/antd/package.json | 8 ++++---- designable/antd/src/shared.ts | 1 + designable/next/package.json | 8 ++++---- designable/next/src/shared.ts | 1 + designable/setters/package.json | 8 ++++---- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/designable/antd/package.json b/designable/antd/package.json index bd276ce43bd..54841b5be65 100644 --- a/designable/antd/package.json +++ b/designable/antd/package.json @@ -29,7 +29,7 @@ "start": "webpack-dev-server --config playground/webpack.dev.ts" }, "devDependencies": { - "@designable/react-settings-form": "^0.5.3", + "@designable/react-settings-form": "^0.5.4", "autoprefixer": "^9.0", "file-loader": "^5.0.2", "fs-extra": "^8.1.0", @@ -55,9 +55,9 @@ "react-is": ">=16.8.0 || >=17.0.0" }, "dependencies": { - "@designable/core": "^0.5.3", - "@designable/formily": "^0.5.3", - "@designable/react": "^0.5.3", + "@designable/core": "^0.5.4", + "@designable/formily": "^0.5.4", + "@designable/react": "^0.5.4", "@formily/antd": "2.0.0-rc.3", "@formily/core": "2.0.0-rc.3", "@formily/designable-setters": "2.0.0-rc.3", diff --git a/designable/antd/src/shared.ts b/designable/antd/src/shared.ts index 6056212c5ab..0edd6e34f8c 100644 --- a/designable/antd/src/shared.ts +++ b/designable/antd/src/shared.ts @@ -25,6 +25,7 @@ export const matchChildComponent = ( ) => { if (name === '*') return true const componentName = node?.props?.['x-component'] + if (!componentName) return false if (typeof name === 'function') return name(componentName || '', node, context) if (Array.isArray(name)) return name.includes(componentName) diff --git a/designable/next/package.json b/designable/next/package.json index 0538653cf93..21ba8a03fd8 100644 --- a/designable/next/package.json +++ b/designable/next/package.json @@ -29,7 +29,7 @@ "start": "webpack-dev-server --config playground/webpack.dev.ts" }, "devDependencies": { - "@designable/react-settings-form": "^0.5.3", + "@designable/react-settings-form": "^0.5.4", "autoprefixer": "^9.0", "file-loader": "^5.0.2", "fs-extra": "^8.1.0", @@ -56,9 +56,9 @@ "react-is": ">=16.8.0 || >=17.0.0" }, "dependencies": { - "@designable/core": "^0.5.3", - "@designable/formily": "^0.5.3", - "@designable/react": "^0.5.3", + "@designable/core": "^0.5.4", + "@designable/formily": "^0.5.4", + "@designable/react": "^0.5.4", "@formily/core": "2.0.0-rc.3", "@formily/designable-setters": "2.0.0-rc.3", "@formily/next": "2.0.0-rc.3", diff --git a/designable/next/src/shared.ts b/designable/next/src/shared.ts index d6558939550..42347831f5c 100644 --- a/designable/next/src/shared.ts +++ b/designable/next/src/shared.ts @@ -25,6 +25,7 @@ export const matchChildComponent = ( ) => { if (name === '*') return true const componentName = node?.props?.['x-component'] + if (!componentName) return false if (typeof name === 'function') return name(componentName || '', node, context) if (Array.isArray(name)) return name.includes(componentName) diff --git a/designable/setters/package.json b/designable/setters/package.json index 4920fe8a68c..7fc7524fb72 100644 --- a/designable/setters/package.json +++ b/designable/setters/package.json @@ -39,10 +39,10 @@ "react-is": ">=16.8.0 || >=17.0.0" }, "dependencies": { - "@designable/core": "^0.5.3", - "@designable/formily": "^0.5.3", - "@designable/react": "^0.5.3", - "@designable/react-settings-form": "^0.5.3", + "@designable/core": "^0.5.4", + "@designable/formily": "^0.5.4", + "@designable/react": "^0.5.4", + "@designable/react-settings-form": "^0.5.4", "@formily/antd": "2.0.0-rc.3", "@formily/core": "2.0.0-rc.3", "@formily/react": "2.0.0-rc.3",