From 0c9309956c288133d699915717f284f5c9a5063e Mon Sep 17 00:00:00 2001 From: yehuozhili <673632758@qq.com> Date: Thu, 7 Apr 2022 00:11:31 +0800 Subject: [PATCH] update 0.13.3 --- CHANGELOG.md | 4 ++++ .../docs/ChangeLog/index.en.md | 8 ++++--- .../dooringx-dumi-doc/docs/ChangeLog/index.md | 4 ++++ .../dooringx-example/src/pages/iframeTest.tsx | 2 +- packages/dooringx-lib/package.json | 2 +- .../dooringx-lib/src/components/preview.tsx | 6 +++++- .../src/components/rightConfig.tsx | 8 +++++-- packages/dooringx-lib/src/config/index.tsx | 21 +++++++++++++++++-- .../dooringx-lib/src/core/components/index.ts | 7 ++++++- .../src/core/eventCenter/index.ts | 4 ++-- packages/dooringx-lib/src/core/store/index.ts | 4 ++-- .../src/core/storeChanger/index.ts | 2 +- .../dooringx-plugin-template/package.json | 2 +- .../template/template.json | 2 +- 14 files changed, 58 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23af8bc..4c382f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.13.3 + +修复title失效,增加右侧面板配置 + ## 0.13.2 修复自定义动画可能失效问题。 diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md index 4f6f850..c8019fb 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.3 +Fix the Title Failure and add the right panel configuration ## 0.13.2 Fixed possible invalidation of custom animation. ## 0.13.1 @@ -38,7 +40,7 @@ Timeline adds auto focus function. ## 0.11.7 Cancel the multi selection adsorption function. ## 0.11.6 -Cancel the first mouse click. +Cancel the adsorption of the first mouse click. Modify the selected color of timeline. ## 0.11.5 Fix reference line adsorption and wrong displacement bug @@ -99,7 +101,7 @@ 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 globalconfig function on the right is changed to the custom type +The custom rightglobalcustom type on the right is changed to the function passed in config ## 0.7.5 Change the roller direction. ## 0.7.4 @@ -134,7 +136,7 @@ Remove the runtime export and get all properties from config. 2. Control component adds ruler control. ## 0.3.0 1. Add a ruler. The containerwrapper needs to pass config before it can be used. -2. Modify container minimum drag 667. Fix the inconsistency between the distance between the canvas and the mouse when zooming down and dragging. +2. Drag the smallest container 667. Fix the inconsistency between the distance between the canvas and the mouse when zooming down and dragging. 3. Innercontainerdragup needs to pass config. ## 0.2.0 Modify the transmission of the commander to obtain the config. The commander will no longer be exported from the index. When it needs to be used, it will be obtained from the config. Add the class name on the left to facilitate customization. diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.md index 8dbab61..d0dd2a9 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.3 + +修复title失效,增加右侧面板配置 + ## 0.13.2 修复自定义动画可能失效问题。 diff --git a/packages/dooringx-example/src/pages/iframeTest.tsx b/packages/dooringx-example/src/pages/iframeTest.tsx index bcafd8e..1e9dcdc 100644 --- a/packages/dooringx-example/src/pages/iframeTest.tsx +++ b/packages/dooringx-example/src/pages/iframeTest.tsx @@ -2,7 +2,7 @@ * @Author: yehuozhili * @Date: 2021-07-17 10:12:11 * @LastEditors: yehuozhili - * @LastEditTime: 2021-08-19 16:52:27 + * @LastEditTime: 2022-04-05 21:54:45 * @FilePath: \dooringx\packages\dooringx-example\src\pages\iframeTest.tsx */ diff --git a/packages/dooringx-lib/package.json b/packages/dooringx-lib/package.json index bb2138e..5cfd90c 100644 --- a/packages/dooringx-lib/package.json +++ b/packages/dooringx-lib/package.json @@ -1,5 +1,5 @@ { - "version": "0.13.2", + "version": "0.13.3", "license": "MIT", "main": "dist/index.js", "module": "dist/dooringx-lib.esm.js", diff --git a/packages/dooringx-lib/src/components/preview.tsx b/packages/dooringx-lib/src/components/preview.tsx index 781c7c2..f26d11c 100644 --- a/packages/dooringx-lib/src/components/preview.tsx +++ b/packages/dooringx-lib/src/components/preview.tsx @@ -2,7 +2,7 @@ * @Author: yehuozhili * @Date: 2021-03-14 05:40:37 * @LastEditors: yehuozhili - * @LastEditTime: 2022-04-01 14:29:39 + * @LastEditTime: 2022-04-06 22:07:33 * @FilePath: \dooringx\packages\dooringx-lib\src\components\preview.tsx */ import Container from './container'; @@ -64,6 +64,10 @@ function Preview(props: PreviewProps): ReactElement { // 设置全局 const global = props.config.getStore().getData().globalState; const bodyColor = global?.bodyColor; + const title = global?.title; + if (title) { + document.title = title; + } if (bodyColor) { document.body.style.backgroundColor = bodyColor; } diff --git a/packages/dooringx-lib/src/components/rightConfig.tsx b/packages/dooringx-lib/src/components/rightConfig.tsx index 3fa349a..fc71a65 100644 --- a/packages/dooringx-lib/src/components/rightConfig.tsx +++ b/packages/dooringx-lib/src/components/rightConfig.tsx @@ -2,12 +2,12 @@ * @Author: yehuozhili * @Date: 2021-03-14 05:42:13 * @LastEditors: yehuozhili - * @LastEditTime: 2022-01-20 12:21:48 + * @LastEditTime: 2022-04-06 22:59:57 * @FilePath: \dooringx\packages\dooringx-lib\src\components\rightConfig.tsx */ import { CreateOptionsRes } from '../core/components/formTypes'; import { IBlockType, IStoreData } from '../core/store/storetype'; -import { CSSProperties, PropsWithChildren, useEffect, useMemo, useState } from 'react'; +import { CSSProperties, PropsWithChildren, ReactNode, useEffect, useMemo, useState } from 'react'; import React from 'react'; import { Tabs, Input, Row, Col, Checkbox, InputNumber } from 'antd'; import UserConfig from '../config'; @@ -24,6 +24,8 @@ const colStyle: CSSProperties = { interface RightConfigProps { state: IStoreData; config: UserConfig; + globalExtra?: ReactNode; + modalExtra?: ReactNode; } /** @@ -261,6 +263,7 @@ function RightConfig(props: PropsWithChildren) { > + {props.globalExtra && props.globalExtra} )} {!current && !isEdit && customGlobal && customGlobal(props.config)} @@ -288,6 +291,7 @@ function RightConfig(props: PropsWithChildren) { > + {props.modalExtra && props.modalExtra} )} diff --git a/packages/dooringx-lib/src/config/index.tsx b/packages/dooringx-lib/src/config/index.tsx index 1d3da35..9017a5b 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-04-04 20:17:55 + * @LastEditTime: 2022-04-06 22:27:51 * @FilePath: \dooringx\packages\dooringx-lib\src\config\index.tsx */ import React from 'react'; @@ -171,7 +171,7 @@ export const defaultStore: IMainStoreData = { }, globalState: { containerColor: 'rgba(255,255,255,1)', - title: 'dooring', + title: 'Dooringx', bodyColor: 'rgba(255,255,255,1)', script: [], customAnimate: [], @@ -507,6 +507,23 @@ export class UserConfig { return this.commanderRegister; } + /** + * + * 用于获取当前store数据,已判断弹窗编辑 不会储存正在编辑的内容 + * @returns + * @memberof UserConfig + */ + getCurrentData() { + let data: IStoreData; + const isEdit = this.storeChanger.isEdit(); + if (isEdit) { + data = this.storeChanger.getOrigin()!.now; + } else { + data = this.store.getData(); + } + return data; + } + /** * * 以默认设置重置配置项 diff --git a/packages/dooringx-lib/src/core/components/index.ts b/packages/dooringx-lib/src/core/components/index.ts index c1b6c25..6bfd230 100644 --- a/packages/dooringx-lib/src/core/components/index.ts +++ b/packages/dooringx-lib/src/core/components/index.ts @@ -2,9 +2,10 @@ * @Author: yehuozhili * @Date: 2021-03-14 04:29:09 * @LastEditors: yehuozhili - * @LastEditTime: 2021-07-10 18:34:34 + * @LastEditTime: 2022-04-06 22:21:00 * @FilePath: \dooringx\packages\dooringx-lib\src\core\components\index.ts */ +import { ComponentItemFactory } from './abstract'; import { ComponentItem } from './componentItem'; /** @@ -58,6 +59,10 @@ class ComponentRegister { // console.error(`${item.name} component has registed`); return; } + if (!(item instanceof ComponentItemFactory)) { + console.error(item, 'may be a problem in register'); + } + this.componentMap[item.name] = item; this.componentList.push(item); this.emit(); diff --git a/packages/dooringx-lib/src/core/eventCenter/index.ts b/packages/dooringx-lib/src/core/eventCenter/index.ts index 4b1cb0c..058f1a9 100644 --- a/packages/dooringx-lib/src/core/eventCenter/index.ts +++ b/packages/dooringx-lib/src/core/eventCenter/index.ts @@ -2,8 +2,8 @@ * @Author: yehuozhili * @Date: 2021-04-06 19:33:17 * @LastEditors: yehuozhili - * @LastEditTime: 2021-07-09 16:33:22 - * @FilePath: \DooringV2\packages\dooringx-lib\src\core\eventCenter\index.ts + * @LastEditTime: 2022-04-06 17:23:54 + * @FilePath: \dooringx\packages\dooringx-lib\src\core\eventCenter\index.ts */ import UserConfig from '../../config'; import { FunctionCenter, FunctionCenterType } from '../functionCenter'; diff --git a/packages/dooringx-lib/src/core/store/index.ts b/packages/dooringx-lib/src/core/store/index.ts index e7d2f69..9debe72 100644 --- a/packages/dooringx-lib/src/core/store/index.ts +++ b/packages/dooringx-lib/src/core/store/index.ts @@ -2,7 +2,7 @@ * @Author: yehuozhili * @Date: 2021-03-14 04:29:09 * @LastEditors: yehuozhili - * @LastEditTime: 2021-08-16 11:18:41 + * @LastEditTime: 2022-04-05 17:08:35 * @FilePath: \dooringx\packages\dooringx-lib\src\core\store\index.ts */ import { IStoreData } from './storetype'; @@ -47,7 +47,7 @@ class Store { * * 重置需要注册事件 * @param {IStoreData[]} initData - * @param {boolean} [check=false] 检查编辑弹窗状态 + * @param {boolean} [check=false] 清空编辑弹窗状态 * @memberof Store */ resetToInitData(initData: IStoreData[], check = false) { diff --git a/packages/dooringx-lib/src/core/storeChanger/index.ts b/packages/dooringx-lib/src/core/storeChanger/index.ts index cd9c010..640eac3 100644 --- a/packages/dooringx-lib/src/core/storeChanger/index.ts +++ b/packages/dooringx-lib/src/core/storeChanger/index.ts @@ -2,7 +2,7 @@ * @Author: yehuozhili * @Date: 2021-04-05 14:55:31 * @LastEditors: yehuozhili - * @LastEditTime: 2021-08-27 10:38:58 + * @LastEditTime: 2022-04-05 17:02:34 * @FilePath: \dooringx\packages\dooringx-lib\src\core\storeChanger\index.ts */ diff --git a/packages/dooringx-plugin-template/package.json b/packages/dooringx-plugin-template/package.json index bda998b..7fbe537 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.2", + "version": "0.13.3", "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 ec65c9e..ce45f63 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.2", + "dooringx-lib": "^0.13.3", "postcss": "^8.3.6", "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-postcss": "^4.0.1",