diff --git a/README.md b/README.md
index 27232255..0255d124 100644
--- a/README.md
+++ b/README.md
@@ -144,4 +144,8 @@ const mindMap = new MindMap({
水车
+
+
+ 仓鼠
+
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.
+New: 1.Replace existing in SVG when exporting Characters to avoid exporting SVG errors. 2.Support for search and replace.
Demo: 1.When switching themes, it is supported to choose whether to overwrite the set basic style.
Fix: 1.Change the shortcut key for inserting a summary to Ctrl+G to avoid conflicts with the save shortcut key. 2.Fix the issue of abnormal switching between rich text editing configuration input boxes while nodes are being edited.
New: 1.Modify the copy, cut, and paste logic, and support pasting data from the clipboard.
diff --git a/web/src/pages/Doc/en/constructor/index.md b/web/src/pages/Doc/en/constructor/index.md index d4ca44d4..4c59a8fb 100644 --- a/web/src/pages/Doc/en/constructor/index.md +++ b/web/src/pages/Doc/en/constructor/index.md @@ -347,7 +347,7 @@ redo. All commands are as follows: | SET_NODE_CUSTOM_POSITION (v0.2.0+) | Set a custom position for a node | node (the node to set), left (custom x coordinate, default is undefined), top (custom y coordinate, default is undefined) | | RESET_LAYOUT (v0.2.0+) | Arrange layout with one click | | | SET_NODE_SHAPE (v0.2.4+) | Set the shape of a node | node (the node to set), shape (the shape, all shapes: [Shape.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/render/node/Shape.js)) | -| GO_TARGET_NODE(v0.6.7+) | Navigate to a node, and if the node is collapsed, it will automatically expand to that node | node(Node instance or node uid to locate) | +| GO_TARGET_NODE(v0.6.7+) | Navigate to a node, and if the node is collapsed, it will automatically expand to that node | node(Node instance or node uid to locate)、callback(v0.6.9+, Callback function after positioning completion) | ### setData(data) diff --git a/web/src/pages/Doc/en/constructor/index.vue b/web/src/pages/Doc/en/constructor/index.vue index 194a7e7d..d5d83af1 100644 --- a/web/src/pages/Doc/en/constructor/index.vue +++ b/web/src/pages/Doc/en/constructor/index.vue @@ -923,7 +923,7 @@ redo. All commands are as follows:水车
仓鼠
+1.simple-mind-map
This is an online mind map built using the simple-mind-map library and based
on Vue2.x and ElementUI. Features include:
水车
+仓鼠
+Copy a node, the active node is the node to be operated on, if there are multiple active nodes, only the first node will be operated on
-notRender: v0.6.9+, Boolean, Default is false, Do not trigger rendering.Set node data, i.e. the data in the data field, and will determine whether the
node needs to be re-rendered based on whether the node size has changed, data
is an object, e.g. {text: 'I am new text'}
++v0.6.9+
+
This plugin provides the ability to search and replace node content.
+import MindMap from 'simple-mind-map'
+import Search from 'simple-mind-map/src/plugins/Search.js'
+MindMap.usePlugin(Search)
+
+After registration and instantiation of MindMap, the instance can be obtained through mindMap.Search.
You can listen to 'search_info_change' event to get the number of current search results and the index currently located.
+mindMap.on('search_info_change', (data) => {
+ /*
+ data: {
+ currentIndex,// Index, from zero
+ total
+ }
+ */
+})
+
+searchText: Text to search for
callback: The callback function that completes this search will be triggered after jumping to the node
Search for node content, which can be called repeatedly. Each call will search and locate to the next matching node. If the search text changes, it will be searched again.
+End search.
+replaceText: Text to be replacedTo replace the content of the current node, call the 'search' method after calling it to replace the content of the currently located matching node.
+replaceText: Text to be replacedReplace all matching node contents, and call it after calling the 'search' method.
+node: Node instance
searchText: Text to search for
replaceText: Text to be replaced
Return the text content of the node after search and replacement. Note that the node content will not be actually changed, but is only used to calculate the content of a node after replacement.
+ +data of the data object, example:
size// { width, height } width and height of image
}
+++v0.6.9+
+
Get the type of a data, such as Boolean、Array.
Import:
import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'
diff --git a/web/src/pages/Doc/routerList.js b/web/src/pages/Doc/routerList.js
index b2a0fcb4..dd4d9db7 100644
--- a/web/src/pages/Doc/routerList.js
+++ b/web/src/pages/Doc/routerList.js
@@ -49,6 +49,7 @@ export default [
{ path: 'client', title: '客户端' },
{ path: 'touchEvent', title: 'TouchEvent插件' },
{ path: 'nodeImgAdjust', title: 'NodeImgAdjust插件' },
+ { path: 'search', title: 'Search插件' },
{ path: 'help1', title: '概要/关联线' },
{ path: 'help2', title: '客户端' }
]
@@ -80,7 +81,8 @@ export default [
{ path: 'xmind', title: 'XMind parse' },
{ path: 'deploy', title: 'Deploy' },
{ path: 'touchEvent', title: 'TouchEvent plugin' },
- { path: 'nodeImgAdjust', title: 'NodeImgAdjust plugin' }
+ { path: 'nodeImgAdjust', title: 'NodeImgAdjust plugin' },
+ { path: 'search', title: 'Search plugin' }
]
}
]
diff --git a/web/src/pages/Doc/zh/changelog/index.md b/web/src/pages/Doc/zh/changelog/index.md
index 7e302272..eb8ed945 100644
--- a/web/src/pages/Doc/zh/changelog/index.md
+++ b/web/src/pages/Doc/zh/changelog/index.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.6.9
+
+修复:1.修复给概要节点设置样式概要节点会消失的问题。2.修复自定义节点内容时,二次创建根实例时节点内容不渲染的问题。3.修复节点处于编辑中时添加新节点时新节点的焦点丢失问题。 2.修复连续按tab键无法连续创建子节点的问题。
+
+新增:1.导出svg时替换svg中存在的` `字符,避免导出的svg报错。 2.支持搜索和替换。
+
+Demo:1.切换主题时支持选择是否覆盖设置过的基础样式。
+
## 0.6.8
修复:1.修改插入概要的快捷键为Ctrl+G,避免和保存快捷键冲突。 2.修复节点正在编辑时切换富文本编辑配置输入框出现异常的问题。
diff --git a/web/src/pages/Doc/zh/changelog/index.vue b/web/src/pages/Doc/zh/changelog/index.vue
index 1652ac9f..098a4fa8 100644
--- a/web/src/pages/Doc/zh/changelog/index.vue
+++ b/web/src/pages/Doc/zh/changelog/index.vue
@@ -1,6 +1,10 @@
Changelog
+0.6.9
+修复:1.修复给概要节点设置样式概要节点会消失的问题。2.修复自定义节点内容时,二次创建根实例时节点内容不渲染的问题。3.修复节点处于编辑中时添加新节点时新节点的焦点丢失问题。 2.修复连续按tab键无法连续创建子节点的问题。
+新增:1.导出svg时替换svg中存在的 字符,避免导出的svg报错。 2.支持搜索和替换。
+Demo:1.切换主题时支持选择是否覆盖设置过的基础样式。
0.6.8
修复:1.修改插入概要的快捷键为Ctrl+G,避免和保存快捷键冲突。 2.修复节点正在编辑时切换富文本编辑配置输入框出现异常的问题。
新增:1.修改复制、剪切、粘贴逻辑,支持粘贴剪切板中的数据。
diff --git a/web/src/pages/Doc/zh/constructor/index.md b/web/src/pages/Doc/zh/constructor/index.md
index 056f7bdb..c9093f8e 100644
--- a/web/src/pages/Doc/zh/constructor/index.md
+++ b/web/src/pages/Doc/zh/constructor/index.md
@@ -340,7 +340,7 @@ mindMap.updateConfig({
| SET_NODE_CUSTOM_POSITION(v0.2.0+) | 设置节点自定义位置 | node(要设置的节点)、 left(自定义的x坐标,默认为undefined)、 top(自定义的y坐标,默认为undefined) |
| RESET_LAYOUT(v0.2.0+) | 一键整理布局 | |
| SET_NODE_SHAPE(v0.2.4+) | 设置节点形状 | node(要设置的节点)、shape(形状,全部形状:[Shape.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/src/core/render/node/Shape.js)) |
-| GO_TARGET_NODE(v0.6.7+) | 定位到某个节点,如果该节点被收起,那么会自动展开到该节点 | node(要定位到的节点实例或节点uid) |
+| GO_TARGET_NODE(v0.6.7+) | 定位到某个节点,如果该节点被收起,那么会自动展开到该节点 | node(要定位到的节点实例或节点uid)、callback(v0.6.9+,定位完成后的回调函数) |
### setData(data)
diff --git a/web/src/pages/Doc/zh/constructor/index.vue b/web/src/pages/Doc/zh/constructor/index.vue
index 03136cf4..8a44ba4f 100644
--- a/web/src/pages/Doc/zh/constructor/index.vue
+++ b/web/src/pages/Doc/zh/constructor/index.vue
@@ -918,7 +918,7 @@ mindMap.setTheme('主题名称')
GO_TARGET_NODE(v0.6.7+)
定位到某个节点,如果该节点被收起,那么会自动展开到该节点
-node(要定位到的节点实例或节点uid)
+node(要定位到的节点实例或节点uid)、callback(v0.6.9+,定位完成后的回调函数)
diff --git a/web/src/pages/Doc/zh/introduction/index.md b/web/src/pages/Doc/zh/introduction/index.md
index 40186852..df7ea6f3 100644
--- a/web/src/pages/Doc/zh/introduction/index.md
+++ b/web/src/pages/Doc/zh/introduction/index.md
@@ -155,4 +155,8 @@
水车
+
+
+ 仓鼠
+
\ No newline at end of file
diff --git a/web/src/pages/Doc/zh/introduction/index.vue b/web/src/pages/Doc/zh/introduction/index.vue
index 71f3fe74..c22a8644 100644
--- a/web/src/pages/Doc/zh/introduction/index.vue
+++ b/web/src/pages/Doc/zh/introduction/index.vue
@@ -8,19 +8,19 @@
特性
-
-
-
-
-
-
-
-
-
-
-json、png、svg、pdf、markdown,支持从json、xmind、markdown导入
-
-
+
+
+
+
+
+
+
+
+
+
+json、png、svg、pdf、markdown,支持从json、xmind、markdown导入
+
+
仓库目录介绍
1.simple-mind-map
@@ -28,11 +28,11 @@
2.web
使用simple-mind-map库,基于vue2.x、ElementUI搭建的在线思维导图。特性:
-
-
-
-
-
+
+
+
+
+
提供文档页面服务。
3.dist
@@ -115,6 +115,10 @@
水车
+
+
+ 仓鼠
+
diff --git a/web/src/pages/Doc/zh/render/index.md b/web/src/pages/Doc/zh/render/index.md
index bcb9ee0f..ee32bdb6 100644
--- a/web/src/pages/Doc/zh/render/index.md
+++ b/web/src/pages/Doc/zh/render/index.md
@@ -54,7 +54,9 @@
复制节点,操作节点为当前激活节点,有多个激活节点只会操作第一个节点
-### setNodeDataRender(node, data)
+### setNodeDataRender(node, data, notRender)
+
+- `notRender`:v0.6.9+,`Boolean`,默认为`false`,是否不要触发渲染。
设置节点数据,即`data`字段的数据,并会根据节点大小是否变化来判断是否需要重新渲染该节点,`data`为对象,如:`{text: '我是新文本'}`
diff --git a/web/src/pages/Doc/zh/render/index.vue b/web/src/pages/Doc/zh/render/index.vue
index 3a2d5d2b..27ee69ae 100644
--- a/web/src/pages/Doc/zh/render/index.vue
+++ b/web/src/pages/Doc/zh/render/index.vue
@@ -28,7 +28,10 @@
删除某个指定节点
copyNode()
复制节点,操作节点为当前激活节点,有多个激活节点只会操作第一个节点
-setNodeDataRender(node, data)
+setNodeDataRender(node, data, notRender)
+
+notRender:v0.6.9+,Boolean,默认为false,是否不要触发渲染。
+
设置节点数据,即data字段的数据,并会根据节点大小是否变化来判断是否需要重新渲染该节点,data为对象,如:{text: '我是新文本'}
moveNodeTo(node, toNode)
diff --git a/web/src/pages/Doc/zh/search/index.md b/web/src/pages/Doc/zh/search/index.md
new file mode 100644
index 00000000..736ef63f
--- /dev/null
+++ b/web/src/pages/Doc/zh/search/index.md
@@ -0,0 +1,68 @@
+# Search 插件
+
+> v0.6.9+
+
+该插件提供搜索和替换节点内容的功能。
+
+## 注册
+
+```js
+import MindMap from 'simple-mind-map'
+import Search from 'simple-mind-map/src/plugins/Search.js'
+MindMap.usePlugin(Search)
+```
+
+注册完且实例化`MindMap`后可通过`mindMap.search`获取到该实例。
+
+## 事件
+
+### search_info_change
+
+可以通过监听`search_info_change`事件来获取当前搜索结果的数量和当前定位到的索引。
+
+```js
+mindMap.on('search_info_change', (data) => {
+ /*
+ data: {
+ currentIndex,// 索引,从0开始
+ total
+ }
+ */
+})
+```
+
+## 方法
+
+### search(searchText, callback)
+
+- `searchText`:要进行搜索的文本
+
+- `callback`:本次搜索完成的回调函数,会在跳转到节点后触发
+
+搜索节点内容,可以重复调用,每调一次,会搜索和定位到下一个匹配的节点。如果搜索文本改变了,那么会重新搜索。
+
+### endSearch()
+
+结束搜索。
+
+### replace(replaceText)
+
+- `replaceText`:要进行替换的文本
+
+替换当前节点内容,要在调用了`search`方法之后调用,会替换当前定位到的匹配节点内容。
+
+### replaceAll(replaceText)
+
+- `replaceText`:要进行替换的文本
+
+替换所有匹配的节点内容,要在调用了`search`方法之后调用。
+
+### getReplacedText(node, searchText, replaceText)
+
+- `node`:节点实例
+
+- `searchText`:要进行搜索的文本
+
+- `replaceText`:要进行替换的文本
+
+返回该节点搜索和替换后的文本内容,注意,不会实际改变节点内容,只是用来计算一个节点替换后的内容。
\ No newline at end of file
diff --git a/web/src/pages/Doc/zh/search/index.vue b/web/src/pages/Doc/zh/search/index.vue
new file mode 100644
index 00000000..997de619
--- /dev/null
+++ b/web/src/pages/Doc/zh/search/index.vue
@@ -0,0 +1,74 @@
+
+
+ Search 插件
+
+v0.6.9+
+
+该插件提供搜索和替换节点内容的功能。
+注册
+import MindMap from 'simple-mind-map'
+import Search from 'simple-mind-map/src/plugins/Search.js'
+MindMap.usePlugin(Search)
+
+注册完且实例化MindMap后可通过mindMap.search获取到该实例。
+事件
+search_info_change
+可以通过监听search_info_change事件来获取当前搜索结果的数量和当前定位到的索引。
+mindMap.on('search_info_change', (data) => {
+ /*
+ data: {
+ currentIndex,// 索引,从0开始
+ total
+ }
+ */
+})
+
+方法
+search(searchText, callback)
+
+-
+
searchText:要进行搜索的文本
+
+-
+
callback:本次搜索完成的回调函数,会在跳转到节点后触发
+
+
+搜索节点内容,可以重复调用,每调一次,会搜索和定位到下一个匹配的节点。如果搜索文本改变了,那么会重新搜索。
+endSearch()
+结束搜索。
+replace(replaceText)
+
+replaceText:要进行替换的文本
+
+替换当前节点内容,要在调用了search方法之后调用,会替换当前定位到的匹配节点内容。
+replaceAll(replaceText)
+
+replaceText:要进行替换的文本
+
+替换所有匹配的节点内容,要在调用了search方法之后调用。
+getReplacedText(node, searchText, replaceText)
+
+-
+
node:节点实例
+
+-
+
searchText:要进行搜索的文本
+
+-
+
replaceText:要进行替换的文本
+
+
+返回该节点搜索和替换后的文本内容,注意,不会实际改变节点内容,只是用来计算一个节点替换后的内容。
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/web/src/pages/Doc/zh/utils/index.md b/web/src/pages/Doc/zh/utils/index.md
index a1f48086..814205e5 100644
--- a/web/src/pages/Doc/zh/utils/index.md
+++ b/web/src/pages/Doc/zh/utils/index.md
@@ -191,6 +191,12 @@ copyNodeTree({}, node)
}
```
+#### getType(data)
+
+> v0.6.9+
+
+获取一个数据的类型,比如`Boolean`、`Array`等。
+
## 在canvas中模拟css的背景属性
引入:
diff --git a/web/src/pages/Doc/zh/utils/index.vue b/web/src/pages/Doc/zh/utils/index.vue
index e874c85e..0552eabb 100644
--- a/web/src/pages/Doc/zh/utils/index.vue
+++ b/web/src/pages/Doc/zh/utils/index.vue
@@ -129,6 +129,11 @@
size// { width, height } 图片宽高
}
+++v0.6.9+
+
获取一个数据的类型,比如Boolean、Array等。
引入:
import drawBackgroundImageToCanvas from 'simple-mind-map/src/utils/simulateCSSBackgroundInCanvas'
diff --git a/web/src/pages/Edit/components/Search.vue b/web/src/pages/Edit/components/Search.vue
index 9fdda8a4..396ac1fe 100644
--- a/web/src/pages/Edit/components/Search.vue
+++ b/web/src/pages/Edit/components/Search.vue
@@ -6,7 +6,7 @@
替换{{ $t('search.replace') }}
@@ -26,19 +26,23 @@
- 取消
+ {{
+ $t('search.cancel')
+ }}
- 替换
- 全部替换
+ {{
+ $t('search.replace')
+ }}
+ {{
+ $t('search.replaceAll')
+ }}