Merge branch 'feature' into main
This commit is contained in:
commit
14bd7c3705
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "simple-mind-map",
|
"name": "simple-mind-map",
|
||||||
"version": "0.6.9",
|
"version": "0.6.9-fix.1",
|
||||||
"description": "一个简单的web在线思维导图",
|
"description": "一个简单的web在线思维导图",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class Render {
|
|||||||
this.themeConfig = this.mindMap.themeConfig
|
this.themeConfig = this.mindMap.themeConfig
|
||||||
this.draw = this.mindMap.draw
|
this.draw = this.mindMap.draw
|
||||||
// 渲染树,操作过程中修改的都是这里的数据
|
// 渲染树,操作过程中修改的都是这里的数据
|
||||||
this.renderTree = merge({}, this.mindMap.opt.data || {})
|
this.renderTree = merge({}, simpleDeepClone(this.mindMap.opt.data) || {})
|
||||||
// 是否重新渲染
|
// 是否重新渲染
|
||||||
this.reRender = false
|
this.reRender = false
|
||||||
// 是否正在渲染中
|
// 是否正在渲染中
|
||||||
|
|||||||
@ -13,15 +13,18 @@ class Search {
|
|||||||
this.matchNodeList = []
|
this.matchNodeList = []
|
||||||
// 当前所在的节点列表索引
|
// 当前所在的节点列表索引
|
||||||
this.currentIndex = -1
|
this.currentIndex = -1
|
||||||
// 是否正在跳转中
|
// 不要复位搜索文本
|
||||||
this.isJumping = false
|
this.notResetSearchText = false
|
||||||
this.onDataChange = this.onDataChange.bind(this)
|
this.onDataChange = this.onDataChange.bind(this)
|
||||||
this.mindMap.on('data_change', this.onDataChange)
|
this.mindMap.on('data_change', this.onDataChange)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 节点数据改变了,需要重新搜索
|
// 节点数据改变了,需要重新搜索
|
||||||
onDataChange() {
|
onDataChange() {
|
||||||
if (this.isJumping) return
|
if (this.notResetSearchText) {
|
||||||
|
this.notResetSearchText = false
|
||||||
|
return
|
||||||
|
}
|
||||||
this.searchText = ''
|
this.searchText = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +51,7 @@ class Search {
|
|||||||
this.searchText = ''
|
this.searchText = ''
|
||||||
this.matchNodeList = []
|
this.matchNodeList = []
|
||||||
this.currentIndex = -1
|
this.currentIndex = -1
|
||||||
this.isJumping = false
|
this.notResetSearchText = false
|
||||||
this.isSearching = false
|
this.isSearching = false
|
||||||
this.emitEvent()
|
this.emitEvent()
|
||||||
}
|
}
|
||||||
@ -77,9 +80,8 @@ class Search {
|
|||||||
this.currentIndex = 0
|
this.currentIndex = 0
|
||||||
}
|
}
|
||||||
let currentNode = this.matchNodeList[this.currentIndex]
|
let currentNode = this.matchNodeList[this.currentIndex]
|
||||||
this.isJumping = true
|
this.notResetSearchText = true
|
||||||
this.mindMap.execCommand('GO_TARGET_NODE', currentNode, () => {
|
this.mindMap.execCommand('GO_TARGET_NODE', currentNode, () => {
|
||||||
this.isJumping = false
|
|
||||||
callback()
|
callback()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -92,10 +94,16 @@ class Search {
|
|||||||
let currentNode = this.matchNodeList[this.currentIndex]
|
let currentNode = this.matchNodeList[this.currentIndex]
|
||||||
if (!currentNode) return
|
if (!currentNode) return
|
||||||
let text = this.getReplacedText(currentNode, this.searchText, replaceText)
|
let text = this.getReplacedText(currentNode, this.searchText, replaceText)
|
||||||
|
this.notResetSearchText = true
|
||||||
currentNode.setText(text, currentNode.nodeData.data.richText)
|
currentNode.setText(text, currentNode.nodeData.data.richText)
|
||||||
this.matchNodeList = this.matchNodeList.filter(node => {
|
this.matchNodeList = this.matchNodeList.filter(node => {
|
||||||
return currentNode !== node
|
return currentNode !== node
|
||||||
})
|
})
|
||||||
|
if (this.currentIndex > this.matchNodeList.length - 1) {
|
||||||
|
this.currentIndex = -1
|
||||||
|
} else {
|
||||||
|
this.currentIndex--
|
||||||
|
}
|
||||||
this.emitEvent()
|
this.emitEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.6.9-fix.1
|
||||||
|
|
||||||
|
Fix: 1.Fix the issue of incorrect replacement after a single search.
|
||||||
|
|
||||||
|
New: 1.We will no longer directly modify the incoming data object, but will make a deep copy internally.
|
||||||
|
|
||||||
## 0.6.9
|
## 0.6.9
|
||||||
|
|
||||||
Fix: 1.Fixed an issue where setting styles to summary nodes would cause summary nodes to disappear. 2.Fixed the issue of node content not rendering when creating a root instance again when customizing node content. 3.Fix the issue of losing focus when adding a new node while the node is in editing. 2.Fix the issue of continuously pressing the tab key not being able to continuously create child nodes.
|
Fix: 1.Fixed an issue where setting styles to summary nodes would cause summary nodes to disappear. 2.Fixed the issue of node content not rendering when creating a root instance again when customizing node content. 3.Fix the issue of losing focus when adding a new node while the node is in editing. 2.Fix the issue of continuously pressing the tab key not being able to continuously create child nodes.
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h1>Changelog</h1>
|
<h1>Changelog</h1>
|
||||||
|
<h2>0.6.9-fix.1</h2>
|
||||||
|
<p>Fix: 1.Fix the issue of incorrect replacement after a single search.</p>
|
||||||
|
<p>New: 1.We will no longer directly modify the incoming data object, but will make a deep copy internally.</p>
|
||||||
<h2>0.6.9</h2>
|
<h2>0.6.9</h2>
|
||||||
<p>Fix: 1.Fixed an issue where setting styles to summary nodes would cause summary nodes to disappear. 2.Fixed the issue of node content not rendering when creating a root instance again when customizing node content. 3.Fix the issue of losing focus when adding a new node while the node is in editing. 2.Fix the issue of continuously pressing the tab key not being able to continuously create child nodes.</p>
|
<p>Fix: 1.Fixed an issue where setting styles to summary nodes would cause summary nodes to disappear. 2.Fixed the issue of node content not rendering when creating a root instance again when customizing node content. 3.Fix the issue of losing focus when adding a new node while the node is in editing. 2.Fix the issue of continuously pressing the tab key not being able to continuously create child nodes.</p>
|
||||||
<p>New: 1.Replace existing <code>&nbsp;</code> in SVG when exporting Characters to avoid exporting SVG errors. 2.Support for search and replace.</p>
|
<p>New: 1.Replace existing <code>&nbsp;</code> in SVG when exporting Characters to avoid exporting SVG errors. 2.Support for search and replace.</p>
|
||||||
|
|||||||
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.6.9-fix.1
|
||||||
|
|
||||||
|
修复:1.修复搜索进行一次单个替换后再全部替换不正确的问题。
|
||||||
|
|
||||||
|
新增:1.不会再直接修改传入的data对象,内部会深拷贝一份。
|
||||||
|
|
||||||
## 0.6.9
|
## 0.6.9
|
||||||
|
|
||||||
修复:1.修复给概要节点设置样式概要节点会消失的问题。2.修复自定义节点内容时,二次创建根实例时节点内容不渲染的问题。3.修复节点处于编辑中时添加新节点时新节点的焦点丢失问题。 2.修复连续按tab键无法连续创建子节点的问题。
|
修复:1.修复给概要节点设置样式概要节点会消失的问题。2.修复自定义节点内容时,二次创建根实例时节点内容不渲染的问题。3.修复节点处于编辑中时添加新节点时新节点的焦点丢失问题。 2.修复连续按tab键无法连续创建子节点的问题。
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h1>Changelog</h1>
|
<h1>Changelog</h1>
|
||||||
|
<h2>0.6.9-fix.1</h2>
|
||||||
|
<p>修复:1.修复搜索进行一次单个替换后再全部替换不正确的问题。</p>
|
||||||
|
<p>新增:1.不会再直接修改传入的data对象,内部会深拷贝一份。</p>
|
||||||
<h2>0.6.9</h2>
|
<h2>0.6.9</h2>
|
||||||
<p>修复:1.修复给概要节点设置样式概要节点会消失的问题。2.修复自定义节点内容时,二次创建根实例时节点内容不渲染的问题。3.修复节点处于编辑中时添加新节点时新节点的焦点丢失问题。 2.修复连续按tab键无法连续创建子节点的问题。</p>
|
<p>修复:1.修复给概要节点设置样式概要节点会消失的问题。2.修复自定义节点内容时,二次创建根实例时节点内容不渲染的问题。3.修复节点处于编辑中时添加新节点时新节点的焦点丢失问题。 2.修复连续按tab键无法连续创建子节点的问题。</p>
|
||||||
<p>新增:1.导出svg时替换svg中存在的<code>&nbsp;</code>字符,避免导出的svg报错。 2.支持搜索和替换。</p>
|
<p>新增:1.导出svg时替换svg中存在的<code>&nbsp;</code>字符,避免导出的svg报错。 2.支持搜索和替换。</p>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user