diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ebee77..59bd550 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.11.6 + +取消第一次点击鼠标的吸附。 + +修改timeline选中颜色。 ## 0.11.5 diff --git a/package.json b/package.json index 0df845f..dadaad7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "pub": "node ./script/publish.js", "changelog": "node ./script/changelog.js", "translate": "node ./script/translate.js", - "translateText":"node ./script/translateText.js" + "translateText": "node ./script/translateText.js" }, "private": true, "devDependencies": { @@ -39,5 +39,6 @@ "npx prettier --write ./packages/dooringx-dumi-doc/docs ./packages/dooringx-lib/src", "git add ." ] - } + }, + "dependencies": {} } diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md index 3749bfa..565df1c 100644 --- a/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md +++ b/packages/dooringx-dumi-doc/docs/ChangeLog/index.en.md @@ -5,6 +5,9 @@ nav: title: change log order: 6 --- +## 0.11.6 +Cancel the first mouse click. +Modify the selected color of timeline. ## 0.11.5 Fix reference line adsorption and wrong displacement bug Change the position of the rotation justification diff --git a/packages/dooringx-dumi-doc/docs/ChangeLog/index.md b/packages/dooringx-dumi-doc/docs/ChangeLog/index.md index 6935615..211526d 100644 --- a/packages/dooringx-dumi-doc/docs/ChangeLog/index.md +++ b/packages/dooringx-dumi-doc/docs/ChangeLog/index.md @@ -5,6 +5,11 @@ nav: title: 变更日志 order: 6 --- +## 0.11.6 + +取消第一次点击鼠标的吸附。 + +修改timeline选中颜色。 ## 0.11.5 diff --git a/packages/dooringx-lib/package.json b/packages/dooringx-lib/package.json index a51a001..c0217fe 100644 --- a/packages/dooringx-lib/package.json +++ b/packages/dooringx-lib/package.json @@ -1,5 +1,5 @@ { - "version": "0.11.5", + "version": "0.11.6", "license": "MIT", "main": "dist/index.js", "module": "dist/dooringx-lib.esm.js", diff --git a/packages/dooringx-lib/src/components/timeLine/timeline.tsx b/packages/dooringx-lib/src/components/timeLine/timeline.tsx index 8ebf87c..61e822f 100644 --- a/packages/dooringx-lib/src/components/timeLine/timeline.tsx +++ b/packages/dooringx-lib/src/components/timeLine/timeline.tsx @@ -80,7 +80,7 @@ const SortableItem = SortableElement( minWidth: leftWidth, borderRight: borderColor, borderBottom: borderColor, - backgroundColor: value.value.focus ? 'rgb(118 118 118)' : 'initial', + backgroundColor: value.value.focus ? '#76767680' : 'initial', cursor: 'pointer', }} > diff --git a/packages/dooringx-lib/src/core/markline/calcRender.ts b/packages/dooringx-lib/src/core/markline/calcRender.ts index 573f87b..46f731f 100644 --- a/packages/dooringx-lib/src/core/markline/calcRender.ts +++ b/packages/dooringx-lib/src/core/markline/calcRender.ts @@ -259,7 +259,7 @@ export function marklineCalRender(config: UserConfig, iframe: boolean): LinesTyp } else { marklineState.cache[v.id] = rstyle; } - newMarklineDisplay(realStyle, rstyle, lines, focus); + newMarklineDisplay(realStyle, rstyle, lines); // if (lines.x.length !== 0 || lines.y.length !== 0) { // break; 这里不能break要算完所有值 // } diff --git a/packages/dooringx-lib/src/core/markline/normalMode.ts b/packages/dooringx-lib/src/core/markline/normalMode.ts index 138db1b..1fdadbd 100644 --- a/packages/dooringx-lib/src/core/markline/normalMode.ts +++ b/packages/dooringx-lib/src/core/markline/normalMode.ts @@ -141,106 +141,43 @@ export function marklineDisplay( export function newMarklineDisplay( focusStyle: RealStyle, unFocusStyle: RealStyle, - lines: LinesTypes, - focus: IBlockType + lines: LinesTypes ) { const { top, height, left, width } = focusStyle; const { top: t, height: h, left: l, width: w } = unFocusStyle; - let diffY = 0; // 头对头 - if (Math.abs(t - top) < marklineConfig.indent) { + if (Math.abs(t - top) <= 1) { lines.x.push(t); - diffY = t - top; - } - // 中对头 - else if (Math.abs(t - (top + height / 2)) < marklineConfig.indent) { - lines.x.push(t); - diffY = t - (top + height / 2); } // 尾对头 - else if (Math.abs(t - (top + height)) < marklineConfig.indent) { + else if (Math.abs(t - (top + height)) <= 1) { lines.x.push(t); - diffY = t - (top + height); - } - // 头对中 - else if (Math.abs(t + h / 2 - top) < marklineConfig.indent) { - lines.x.push(t + h / 2); - diffY = t + h / 2 - top; - } - // 中对中 - else if (Math.abs(t + h / 2 - top - height / 2) < marklineConfig.indent) { - lines.x.push(t + h / 2); - diffY = t + h / 2 - top - height / 2; - } - // 尾对中 - else if (Math.abs(t + h / 2 - top - height) < marklineConfig.indent) { - lines.x.push(t + h / 2); - diffY = t + h / 2 - top - height; } // 头对尾 - else if (Math.abs((t + h - top) / 2) < marklineConfig.indent) { + else if (Math.abs((t + h - top) / 2) <= 1) { lines.x.push(t + h); - diffY = (t + h - top) / 2; - } - // 中对尾 - else if (Math.abs(t + h - top - height / 2) < marklineConfig.indent) { - lines.x.push(t + h); - diffY = t + h - top - height / 2; } // 尾对尾 - else if (Math.abs((t + h - top - height) / 2) < marklineConfig.indent) { + else if (Math.abs((t + h - top - height) / 2) <= 1) { lines.x.push(t + h); - diffY = (t + h - top - height) / 2; } - focus.top = Math.round(focus.top + diffY); // 纵线 // 头对头 - let diffX = 0; - if (Math.abs(l - left) < marklineConfig.indent) { + if (Math.abs(l - left) <= 1) { lines.y.push(l); - diffX = l - left; - } - // 中对头 - else if (Math.abs(l - (left + width / 2)) < marklineConfig.indent) { - lines.y.push(l); - diffX = l - (left + width / 2); } // 尾对头 - else if (Math.abs(l - (left + width)) < marklineConfig.indent) { + else if (Math.abs(l - (left + width)) <= 1) { lines.y.push(l); - diffX = l - (left + width); - } - // 头对中 - else if (Math.abs(l + w / 2 - left) < marklineConfig.indent) { - lines.y.push(l + w / 2); - diffX = l + w / 2 - left; - } - // 中对中 - else if (Math.abs(l + w / 2 - left - width / 2) < marklineConfig.indent) { - lines.y.push(l + w / 2); - diffX = l + w / 2 - left - width / 2; - } - // 尾对中 - else if (Math.abs(l + w / 2 - left - width) < marklineConfig.indent) { - lines.y.push(l + w / 2); - diffX = l + w / 2 - left - width; } // 头对尾 - else if (Math.abs(l + w - left) < marklineConfig.indent) { + else if (Math.abs(l + w - left) <= 1) { lines.y.push(l + w); - diffX = l + w - left; - } - // 中对尾 - else if (Math.abs(l + w - left - width / 2) < marklineConfig.indent) { - lines.y.push(l + w); - diffX = l + w - left - width / 2; } // 尾对尾 - else if (Math.abs(l + w - left - width) < marklineConfig.indent) { + else if (Math.abs(l + w - left - width) <= 1) { lines.y.push(l + w); - diffX = l + w - left - width; } - focus.left = Math.round(focus.left + diffX); } /** diff --git a/packages/dooringx-plugin-template/package.json b/packages/dooringx-plugin-template/package.json index 95ae690..ccb2cd2 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.11.5", + "version": "0.11.6", "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 c984c7b..26de48e 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.11.5", + "dooringx-lib": "^0.11.6", "postcss": "^8.3.6", "rollup-plugin-peer-deps-external": "^2.2.4", "rollup-plugin-postcss": "^4.0.1",