diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d503939e..759dfa565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## v1.0.0-beta.40(2021-12-08) + +### :beetle: Bug Fixes + +1. [fix(react): fix NodePathWidget style](https://github.com/alibaba/designable/commit/814e5e6) :point_right: ( [zhili.wzl](https://github.com/zhili.wzl) ) + +1. [fix(react): fix prettier cdn version](https://github.com/alibaba/designable/commit/e6e0180) :point_right: ( [zhili.wzl](https://github.com/zhili.wzl) ) + +### :blush: Other Changes + +1. [chore: add sandbox example](https://github.com/alibaba/designable/commit/624076f) :point_right: ( [zhili.wzl](https://github.com/zhili.wzl) ) + ## v1.0.0-beta.39(2021-12-06) ### :beetle: Bug Fixes @@ -331,9 +343,3 @@ 1. [refactor(react): MainPanel -> StudioPanel](https://github.com/alibaba/designable/commit/74b344f) :point_right: ( [zhili.wzl](https://github.com/zhili.wzl) ) 1. [refactor(project): redesign Registry/DragSource (#59)](https://github.com/alibaba/designable/commit/764e7ec) :point_right: ( [Janry](https://github.com/Janry) ) - -## v0.5.29(2021-09-13) - -### :beetle: Bug Fixes - -1. [fix: Displaying the default DesignableFiled, all the time when prompted by text does not realise the real component name. (#58)](https://github.com/alibaba/designable/commit/1928f04) :point_right: ( [呆鸡](https://github.com/呆鸡) ) diff --git a/examples/basic/package.json b/examples/basic/package.json index d491a635d..499bbfb26 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -1,6 +1,6 @@ { "name": "@designable/basic-example", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "private": true, "engines": { @@ -25,11 +25,11 @@ "webpack-dev-server": "^3.10.1" }, "dependencies": { - "@designable/core": "1.0.0-beta.40", - "@designable/react": "1.0.0-beta.40", - "@designable/react-sandbox": "1.0.0-beta.40", - "@designable/react-settings-form": "1.0.0-beta.40", - "@designable/shared": "1.0.0-beta.40", + "@designable/core": "1.0.0-beta.41", + "@designable/react": "1.0.0-beta.41", + "@designable/react-sandbox": "1.0.0-beta.41", + "@designable/react-settings-form": "1.0.0-beta.41", + "@designable/shared": "1.0.0-beta.41", "@formily/reactive": "^2.0.2", "@formily/reactive-react": "^2.0.2", "antd": "^4.15.2", diff --git a/examples/sandbox/package.json b/examples/sandbox/package.json index 37ad34512..70262dd0d 100644 --- a/examples/sandbox/package.json +++ b/examples/sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@designable/sandbox-example", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "private": true, "engines": { @@ -25,11 +25,11 @@ "webpack-dev-server": "^3.10.1" }, "dependencies": { - "@designable/core": "1.0.0-beta.40", - "@designable/react": "1.0.0-beta.40", - "@designable/react-sandbox": "1.0.0-beta.40", - "@designable/react-settings-form": "1.0.0-beta.40", - "@designable/shared": "1.0.0-beta.40", + "@designable/core": "1.0.0-beta.41", + "@designable/react": "1.0.0-beta.41", + "@designable/react-sandbox": "1.0.0-beta.41", + "@designable/react-settings-form": "1.0.0-beta.41", + "@designable/shared": "1.0.0-beta.41", "@formily/reactive": "^2.0.2", "@formily/reactive-react": "^2.0.2", "antd": "^4.15.2", diff --git a/formily/antd/package.json b/formily/antd/package.json index 115c56149..92e0e1fab 100644 --- a/formily/antd/package.json +++ b/formily/antd/package.json @@ -1,6 +1,6 @@ { "name": "@designable/formily-antd", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "main": "lib", "module": "esm", @@ -24,7 +24,7 @@ "start": "webpack-dev-server --config playground/webpack.dev.ts" }, "devDependencies": { - "@designable/react-settings-form": "1.0.0-beta.40", + "@designable/react-settings-form": "1.0.0-beta.41", "@formily/antd": "^2.0.2", "@formily/core": "^2.0.2", "@formily/react": "^2.0.2", @@ -60,10 +60,10 @@ "react-is": ">=16.8.0 || >=17.0.0" }, "dependencies": { - "@designable/core": "1.0.0-beta.40", - "@designable/formily-setters": "1.0.0-beta.40", - "@designable/formily-transformer": "1.0.0-beta.40", - "@designable/react": "1.0.0-beta.40" + "@designable/core": "1.0.0-beta.41", + "@designable/formily-setters": "1.0.0-beta.41", + "@designable/formily-transformer": "1.0.0-beta.41", + "@designable/react": "1.0.0-beta.41" }, "publishConfig": { "access": "public" diff --git a/formily/next/package.json b/formily/next/package.json index 8a53447a3..e5284d9c2 100644 --- a/formily/next/package.json +++ b/formily/next/package.json @@ -1,6 +1,6 @@ { "name": "@designable/formily-next", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "main": "lib", "module": "esm", @@ -24,7 +24,7 @@ "start": "webpack-dev-server --config playground/webpack.dev.ts" }, "devDependencies": { - "@designable/react-settings-form": "1.0.0-beta.40", + "@designable/react-settings-form": "1.0.0-beta.41", "@formily/core": "^2.0.2", "@formily/next": "^2.0.2", "@formily/react": "^2.0.2", @@ -61,10 +61,10 @@ "react-is": ">=16.8.0 || >=17.0.0" }, "dependencies": { - "@designable/core": "1.0.0-beta.40", - "@designable/formily-setters": "1.0.0-beta.40", - "@designable/formily-transformer": "1.0.0-beta.40", - "@designable/react": "1.0.0-beta.40" + "@designable/core": "1.0.0-beta.41", + "@designable/formily-setters": "1.0.0-beta.41", + "@designable/formily-transformer": "1.0.0-beta.41", + "@designable/react": "1.0.0-beta.41" }, "publishConfig": { "access": "public" diff --git a/formily/setters/package.json b/formily/setters/package.json index 1dbe465c1..f71f33825 100644 --- a/formily/setters/package.json +++ b/formily/setters/package.json @@ -1,6 +1,6 @@ { "name": "@designable/formily-setters", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "main": "lib", "module": "esm", @@ -42,10 +42,10 @@ "react-is": ">=16.8.0 || >=17.0.0" }, "dependencies": { - "@designable/core": "1.0.0-beta.40", - "@designable/formily-transformer": "1.0.0-beta.40", - "@designable/react": "1.0.0-beta.40", - "@designable/react-settings-form": "1.0.0-beta.40" + "@designable/core": "1.0.0-beta.41", + "@designable/formily-transformer": "1.0.0-beta.41", + "@designable/react": "1.0.0-beta.41", + "@designable/react-settings-form": "1.0.0-beta.41" }, "publishConfig": { "access": "public" diff --git a/formily/transformer/package.json b/formily/transformer/package.json index b3a928f15..168f3b24b 100644 --- a/formily/transformer/package.json +++ b/formily/transformer/package.json @@ -1,6 +1,6 @@ { "name": "@designable/formily-transformer", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "main": "lib", "engines": { @@ -33,8 +33,8 @@ "@formily/json-schema": "^2.0.2" }, "dependencies": { - "@designable/core": "1.0.0-beta.40", - "@designable/shared": "1.0.0-beta.40" + "@designable/core": "1.0.0-beta.41", + "@designable/shared": "1.0.0-beta.41" }, "gitHead": "bda070c137ba0003cc4451b2208e089d2e326b23" } diff --git a/lerna.json b/lerna.json index f4f9a7d48..b7db3a0fa 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "npmClient": "yarn", "useWorkspaces": true, "npmClientArgs": ["--ignore-engines"], diff --git a/packages/core/package.json b/packages/core/package.json index 2f5c5cdb0..8aab55e13 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@designable/core", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "main": "lib", "types": "lib/index.d.ts", @@ -33,7 +33,7 @@ "@formily/reactive": "^2.0.2" }, "dependencies": { - "@designable/shared": "1.0.0-beta.40", + "@designable/shared": "1.0.0-beta.41", "@juggle/resize-observer": "^3.3.1" }, "publishConfig": { diff --git a/packages/core/src/drivers/ViewportResizeDriver.ts b/packages/core/src/drivers/ViewportResizeDriver.ts index 4dae0c898..57873eab3 100644 --- a/packages/core/src/drivers/ViewportResizeDriver.ts +++ b/packages/core/src/drivers/ViewportResizeDriver.ts @@ -27,10 +27,10 @@ export class ViewportResizeDriver extends EventDriver { } attach() { - if (this.contentWindow !== window) { + if (this.contentWindow && this.contentWindow !== window) { this.addEventListener('resize', this.onResize) } else { - if (this.container !== document) { + if (this.container && this.container !== document) { this.resizeObserver = new ResizeObserver(this.onResize) this.resizeObserver.observe(this.container as HTMLElement) } @@ -38,10 +38,10 @@ export class ViewportResizeDriver extends EventDriver { } detach() { - if (this.contentWindow !== window) { + if (this.contentWindow && this.contentWindow !== window) { this.removeEventListener('resize', this.onResize) } else if (this.resizeObserver) { - if (this.container !== document) { + if (this.container && this.container !== document) { this.resizeObserver.unobserve(this.container as HTMLElement) this.resizeObserver.disconnect() } diff --git a/packages/core/src/effects/useSelectionEffect.ts b/packages/core/src/effects/useSelectionEffect.ts index d2de2f1b8..1fdf01849 100644 --- a/packages/core/src/effects/useSelectionEffect.ts +++ b/packages/core/src/effects/useSelectionEffect.ts @@ -13,7 +13,8 @@ export const useSelectionEffect = (engine: Engine) => { const isHelpers = target?.closest?.( `*[${engine.props.nodeSelectionIdAttrName}]` ) - const currentWorkspace = engine.workbench.activeWorkspace + const currentWorkspace = + event.context.workspace ?? engine.workbench.activeWorkspace if (!currentWorkspace) return if (!el?.getAttribute) { const point = new Point(event.data.topClientX, event.data.topClientY) diff --git a/packages/core/src/models/Viewport.ts b/packages/core/src/models/Viewport.ts index 5a06bf58d..da3cfcf2a 100644 --- a/packages/core/src/models/Viewport.ts +++ b/packages/core/src/models/Viewport.ts @@ -258,13 +258,13 @@ export class Viewport { getOffsetPoint(topPoint: IPoint) { if (this.isIframe) { return { - x: topPoint.x - this.offsetX + this.contentWindow.scrollX, - y: topPoint.y - this.offsetY + this.contentWindow.scrollY, + x: topPoint.x - this.offsetX + (this.contentWindow?.scrollX ?? 0), + y: topPoint.y - this.offsetY + (this.contentWindow?.scrollY ?? 0), } } else { return { - x: topPoint.x - this.offsetX + this.viewportElement.scrollLeft, - y: topPoint.y - this.offsetY + this.viewportElement.scrollTop, + x: topPoint.x - this.offsetX + (this.viewportElement?.scrollLeft ?? 0), + y: topPoint.y - this.offsetY + (this.viewportElement?.scrollTop ?? 0), } } } diff --git a/packages/react-sandbox/package.json b/packages/react-sandbox/package.json index a4269a033..832d0fdf5 100644 --- a/packages/react-sandbox/package.json +++ b/packages/react-sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@designable/react-sandbox", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "main": "lib", "types": "lib/index.d.ts", @@ -26,8 +26,8 @@ "react": "16.x || 17.x" }, "dependencies": { - "@designable/react": "1.0.0-beta.40", - "@designable/shared": "1.0.0-beta.40" + "@designable/react": "1.0.0-beta.41", + "@designable/shared": "1.0.0-beta.41" }, "publishConfig": { "access": "public" diff --git a/packages/react-settings-form/package.json b/packages/react-settings-form/package.json index 609589401..e05835bd8 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": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "main": "lib", "types": "lib/index.d.ts", @@ -42,9 +42,9 @@ }, "dependencies": { "@babel/parser": "^7.14.7", - "@designable/core": "1.0.0-beta.40", - "@designable/react": "1.0.0-beta.40", - "@designable/shared": "1.0.0-beta.40", + "@designable/core": "1.0.0-beta.41", + "@designable/react": "1.0.0-beta.41", + "@designable/shared": "1.0.0-beta.41", "@monaco-editor/react": "^4.2.1", "monaco-editor": "^0.25.2", "prettier": "^2.3.2", diff --git a/packages/react/package.json b/packages/react/package.json index 3f5d07fd8..87dfb5124 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@designable/react", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "main": "lib", "types": "lib/index.d.ts", @@ -33,8 +33,8 @@ "react": "16.x || 17.x" }, "dependencies": { - "@designable/core": "1.0.0-beta.40", - "@designable/shared": "1.0.0-beta.40", + "@designable/core": "1.0.0-beta.41", + "@designable/shared": "1.0.0-beta.41", "@juggle/resize-observer": "^3.3.1", "dateformat": "^4.5.1" }, diff --git a/packages/shared/package.json b/packages/shared/package.json index 7596aef03..0a0af053f 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@designable/shared", - "version": "1.0.0-beta.40", + "version": "1.0.0-beta.41", "license": "MIT", "main": "lib", "types": "lib/index.d.ts",