Compare commits

...

5 Commits
0.6.1 ... 0.6.2

Author SHA1 Message Date
wanglin2
eec736be4d README: update 2023-06-20 16:43:10 +08:00
wanglin2
ffdf53941a Merge branch 'feature' into main 2023-06-20 16:39:55 +08:00
wanglin2
5676e952f3 打包0.6.2 2023-06-20 16:38:29 +08:00
wanglin2
e049ee6260 Doc: update 2023-06-20 16:35:36 +08:00
wanglin2
f1355c9d2a Fix:修复切换主题时节点样式没有随之切换的问题 2023-06-20 16:29:54 +08:00
16 changed files with 93 additions and 6 deletions

View File

@@ -96,6 +96,8 @@ MIT
> 厚椰乳一盒 + 纯牛奶半盒 + 冰块 + 咖啡液 = 生椰拿铁 yyds
> 转账请备注哦~你的头像和名称会出现在[文档页面](https://wanglin2.github.io/mind-map/#/doc/zh/introduction/%E8%AF%B7%E4%BD%9C%E8%80%85%E5%96%9D%E6%9D%AF%E5%92%96%E5%95%A1)
<p>
<img src="./web/src/assets/img/alipay.jpg" style="width: 300px" />
<img src="./web/src/assets/img/wechat.jpg" style="width: 300px" />

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{
"name": "simple-mind-map",
"version": "0.6.1",
"version": "0.6.2",
"description": "一个简单的web在线思维导图",
"authors": [
{

View File

@@ -259,4 +259,24 @@ export const layoutValueList = [
CONSTANTS.LAYOUT.TIMELINE,
CONSTANTS.LAYOUT.TIMELINE2,
CONSTANTS.LAYOUT.FISHBONE
]
// 节点数据中非样式的字段
export const nodeDataNoStylePropList = [
'text',
'image',
'imageTitle',
'imageSize',
'icon',
'tag',
'hyperlink',
'hyperlinkTitle',
'note',
'expand',
'isActive',
'generalization',
'richText',
'resetRichText',
'uid',
'activeStyle'
]

View File

@@ -798,6 +798,11 @@ class Node {
getData(key) {
return key ? this.nodeData.data[key] || '' : this.nodeData.data
}
// 是否存在自定义样式
hasCustomStyle() {
return this.style.hasCustomStyle()
}
}
export default Node

View File

@@ -1,4 +1,4 @@
import { tagColorList } from '../../../constants/constant'
import { tagColorList, nodeDataNoStylePropList } from '../../../constants/constant'
const rootProp = ['paddingX', 'paddingY']
const backgroundStyleProps = ['backgroundColor', 'backgroundImage', 'backgroundRepeat', 'backgroundPosition', 'backgroundSize']
@@ -209,6 +209,17 @@ class Style {
node2.fill({ color: color })
fillNode.fill({ color: fill })
}
// 是否设置了自定义的样式
hasCustomStyle() {
let res = false
Object.keys(this.ctx.nodeData.data).forEach((item) => {
if (!nodeDataNoStylePropList.includes(item)) {
res = true
}
})
return res
}
}
Style.cacheStyle = null

View File

@@ -64,8 +64,18 @@ function createIconNode() {
function createRichTextNode() {
let g = new G()
// 重新设置富文本节点内容
if (this.nodeData.data.resetRichText || [CONSTANTS.CHANGE_THEME].includes(this.mindMap.renderer.renderSource)) {
let recoverText = false
if (this.nodeData.data.resetRichText) {
delete this.nodeData.data.resetRichText
recoverText = true
}
if ([CONSTANTS.CHANGE_THEME].includes(this.mindMap.renderer.renderSource)) {
// 如果自定义过样式则不允许覆盖
if (!this.hasCustomStyle()) {
recoverText = true
}
}
if (recoverText) {
let text = getTextFromHtml(this.nodeData.data.text)
this.nodeData.data.text = `<p><span style="${this.style.createStyleText()}">${text}</span></p>`
}

View File

@@ -219,7 +219,7 @@ class RichText {
underline: node.style.merge('textDecoration') === 'underline',
strike: node.style.merge('textDecoration') === 'line-through'
}
this.formatAllText(style)
this.pureFormatAllText(style)
}
// 获取当前正在编辑的内容
@@ -325,7 +325,7 @@ class RichText {
// 中文输入结束
onCompositionEnd() {
if (!this.showTextEdit) {
if (!this.showTextEdit || !this.lostStyle) {
return
}
this.isCompositing = false
@@ -372,6 +372,11 @@ class RichText {
// 格式化所有文本
formatAllText(config = {}) {
this.syncFormatToNodeConfig(config)
this.pureFormatAllText(config)
}
// 纯粹的格式化所有文本
pureFormatAllText(config = {}) {
this.quill.formatText(0, this.quill.getLength(), config)
}

View File

@@ -1,5 +1,9 @@
# Changelog
## 0.6.2
Fix: 1.Fixed the problem that the new node does not change with the theme in rich Text mode.
## 0.6.1
Fix: 1.Fixed the issue of high movement sensitivity when using the touchpad when changing mouse scrolling to moving the canvas behavior.

View File

@@ -1,6 +1,8 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.6.2</h2>
<p>Fix: 1.Fixed the problem that the new node does not change with the theme in rich Text mode.</p>
<h2>0.6.1</h2>
<p>Fix: 1.Fixed the issue of high movement sensitivity when using the touchpad when changing mouse scrolling to moving the canvas behavior.</p>
<h2>0.6.0-fix.1</h2>

View File

@@ -56,6 +56,12 @@ Whether the node is currently being dragged
## Methods
### hasCustomStyle()
> v0.6.2+
Gets whether a custom style has been set.
### getSize()
Update the width and height of the node by recreating the node content, and return a Boolean value indicating whether the width and height have changed

View File

@@ -31,6 +31,11 @@
</blockquote>
<p>Whether the node is currently being dragged</p>
<h2>Methods</h2>
<h3>hasCustomStyle()</h3>
<blockquote>
<p>v0.6.2+</p>
</blockquote>
<p>Gets whether a custom style has been set.</p>
<h3>getSize()</h3>
<p>Update the width and height of the node by recreating the node content, and return a Boolean value indicating whether the width and height have changed</p>
<h3>render()</h3>

View File

@@ -1,5 +1,9 @@
# Changelog
## 0.6.2
修复1.修复富文本模式下,新建节点不随主题变化而变化的问题。
## 0.6.1
修复1.修复将鼠标滚动改为移动画布行为后,使用触控板操作时移动灵敏度过高的问题。

View File

@@ -1,6 +1,8 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.6.2</h2>
<p>修复1.修复富文本模式下新建节点不随主题变化而变化的问题</p>
<h2>0.6.1</h2>
<p>修复1.修复将鼠标滚动改为移动画布行为后使用触控板操作时移动灵敏度过高的问题</p>
<h2>0.6.0-fix.1</h2>

View File

@@ -56,6 +56,12 @@
## 方法
### hasCustomStyle()
> v0.6.2+
获取是否设置了自定义样式。
### getSize()
通过重新创建节点内容更新节点的宽高,返回一个布尔值,代表是否宽高发生了变化

View File

@@ -31,6 +31,11 @@
</blockquote>
<p>节点是否正在拖拽中</p>
<h2>方法</h2>
<h3>hasCustomStyle()</h3>
<blockquote>
<p>v0.6.2+</p>
</blockquote>
<p>获取是否设置了自定义样式</p>
<h3>getSize()</h3>
<p>通过重新创建节点内容更新节点的宽高返回一个布尔值代表是否宽高发生了变化</p>
<h3>render()</h3>