diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ca368e..ce95432 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.13.1 + +修复定制动画重载画布的编辑问题。 + ## 0.13.0 添加自定义动画,可以自由定制动画了。 diff --git a/README.md b/README.md index fbcf908..956e7c7 100644 --- a/README.md +++ b/README.md @@ -155,5 +155,5 @@ MIT ## Todo -重构动画 - +重构数据源 +完善文档 diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md index ce7281d..a402cc2 100644 --- a/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md +++ b/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md @@ -5,6 +5,8 @@ nav: title: change log order: 6 --- +## 0.13.1 +Fixed editing problem of custom animation overloaded canvas. ## 0.13.0 Add custom animation, you can customize the animation freely. ## 0.12.4 @@ -34,7 +36,7 @@ Timeline adds auto focus function. ## 0.11.7 Cancel the multi selection adsorption function. ## 0.11.6 -Cancel the adsorption of the first mouse click. +Cancel the first mouse click. Modify the selected color of timeline. ## 0.11.5 Fix reference line adsorption and wrong displacement bug @@ -95,13 +97,13 @@ The minimum value of canvas drag is changed to 0. ## 0.7.7 Optimize the drag logic of the canvas to move more smoothly. ## 0.7.6 -The custom rightglobalcustom type on the right is changed to the function passed in config +The custom globalconfig function on the right is changed to the custom type ## 0.7.5 Change the roller direction. ## 0.7.4 Fix box move bug. ## 0.7.3 -Pop up and fix the problem. +Fix pop-up location and selection issues. ## 0.7.2 Fix the impact of locking components. You can't drag, zoom or rotate during locking. ## 0.7.1 diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.md index f4f922e..7ff133b 100644 --- a/packages/dooringx-dumi-doc/docs/ChangeLog/index.md +++ b/packages/dooringx-dumi-doc/docs/ChangeLog/index.md @@ -5,6 +5,10 @@ nav: title: 变更日志 order: 6 --- +## 0.13.1 + +修复定制动画重载画布的编辑问题。 + ## 0.13.0 添加自定义动画,可以自由定制动画了。 diff --git a/packages/dooringx-example/.umirc.ts b/packages/dooringx-example/.umirc.ts index 3139585..f3c4905 100644 --- a/packages/dooringx-example/.umirc.ts +++ b/packages/dooringx-example/.umirc.ts @@ -2,7 +2,7 @@ * @Author: yehuozhili * @Date: 2021-07-07 11:11:52 * @LastEditors: yehuozhili - * @LastEditTime: 2022-01-13 15:42:40 + * @LastEditTime: 2022-04-03 23:02:07 * @FilePath: \dooringx\packages\dooringx-example\.umirc.ts */ import { defineConfig } from 'umi'; diff --git a/packages/dooringx-lib/README.md b/packages/dooringx-lib/README.md index fbcf908..956e7c7 100644 --- a/packages/dooringx-lib/README.md +++ b/packages/dooringx-lib/README.md @@ -155,5 +155,5 @@ MIT ## Todo -重构动画 - +重构数据源 +完善文档 diff --git a/packages/dooringx-lib/package.json b/packages/dooringx-lib/package.json index 901b964..f59ea7c 100644 --- a/packages/dooringx-lib/package.json +++ b/packages/dooringx-lib/package.json @@ -1,5 +1,5 @@ { - "version": "0.13.0", + "version": "0.13.1", "license": "MIT", "main": "dist/index.js", "module": "dist/dooringx-lib.esm.js", diff --git a/packages/dooringx-lib/src/config/index.tsx b/packages/dooringx-lib/src/config/index.tsx index 6a2ac5d..1d3da35 100644 --- a/packages/dooringx-lib/src/config/index.tsx +++ b/packages/dooringx-lib/src/config/index.tsx @@ -2,7 +2,7 @@ * @Author: yehuozhili * @Date: 2021-02-25 21:16:58 * @LastEditors: yehuozhili - * @LastEditTime: 2022-01-12 17:26:07 + * @LastEditTime: 2022-04-04 20:17:55 * @FilePath: \dooringx\packages\dooringx-lib\src\config\index.tsx */ import React from 'react'; @@ -451,9 +451,16 @@ export class UserConfig { return JSON.parse(json); } + /** + * + * 重设store并根据store重设 + * @param {IStoreData[]} data + * @memberof UserConfig + */ resetData(data: IStoreData[]) { this.store.resetToInitData(data, true); this.toRegist(); + this.animateFactory.syncStoreToConfig(this); } getWrapperMove() { @@ -478,6 +485,9 @@ export class UserConfig { getStoreChanger() { return this.storeChanger; } + getAnimateFactory() { + return this.animateFactory; + } getConfig() { return this.initConfig; } diff --git a/packages/dooringx-lib/src/core/AnimateFactory/index.ts b/packages/dooringx-lib/src/core/AnimateFactory/index.ts index 9860b34..ff05ea4 100644 --- a/packages/dooringx-lib/src/core/AnimateFactory/index.ts +++ b/packages/dooringx-lib/src/core/AnimateFactory/index.ts @@ -163,6 +163,26 @@ export class AnimateFactory { } } + /** + * + * 将store中的配置写入config + * 注意!只在导入新store后使用 + * @memberof AnimateFactory + */ + syncStoreToConfig(config: UserConfig) { + const store = config.getStore(); + let data: IStoreData; + const isEdit = config.getStoreChanger().isEdit(); + if (isEdit) { + const origin = config.getStoreChanger().getOrigin()!; + data = origin.data[origin.current]; + } else { + data = store.getData(); + } + const dataAnimate = data.globalState?.customAnimate; + this.customAnimateName = [...dataAnimate]; + } + /** * * 将用户输入转换为新的动画 diff --git a/packages/dooringx-lib/src/hooks/index.ts b/packages/dooringx-lib/src/hooks/index.ts index a3b665a..14611ca 100644 --- a/packages/dooringx-lib/src/hooks/index.ts +++ b/packages/dooringx-lib/src/hooks/index.ts @@ -2,7 +2,7 @@ * @Author: yehuozhili * @Date: 2021-03-14 05:35:15 * @LastEditors: yehuozhili - * @LastEditTime: 2021-07-20 16:18:29 + * @LastEditTime: 2022-04-04 20:13:58 * @FilePath: \dooringx\packages\dooringx-lib\src\hooks\index.ts */ import { useEffect, useMemo, useState } from 'react'; diff --git a/packages/dooringx-plugin-template/package.json b/packages/dooringx-plugin-template/package.json index 504eb4b..9bfce55 100644 --- a/packages/dooringx-plugin-template/package.json +++ b/packages/dooringx-plugin-template/package.json @@ -1,6 +1,6 @@ { "name": "dooringx-plugin-template", - "version": "0.13.0", + "version": "0.13.1", "description": "> TODO: description", "author": "yehuozhili <673632758@qq.com>", "homepage": "https://github.com/H5-Dooring/dooringx#readme", diff --git a/packages/dooringx-plugin-template/template/template.json b/packages/dooringx-plugin-template/template/template.json index dce21be..74f81c2 100644 --- a/packages/dooringx-plugin-template/template/template.json +++ b/packages/dooringx-plugin-template/template/template.json @@ -40,7 +40,7 @@ "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@svgr/rollup": "^5.5.0", - "dooringx-lib": "^0.13.0", + "dooringx-lib": "^0.13.1", "postcss": "^8.3.6", "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-postcss": "^4.0.1",