Compare commits

..

49 Commits

Author SHA1 Message Date
wanglin2
067131f76d Merge branch 'feature' into main 2023-08-13 12:21:16 +08:00
wanglin2
f689d333f9 打包0.6.14 2023-08-13 12:20:31 +08:00
wanglin2
b3059bb6a3 Doc: update 2023-08-13 12:18:25 +08:00
wanglin2
b135f6a61c Demo:支持粘贴知犀思维导图的节点数据 2023-08-13 11:43:44 +08:00
wanglin2
2a8b71497f Feat:自定义处理剪贴板函数支持返回Promise实例 2023-08-13 09:49:29 +08:00
wanglin2
726ebc5e88 Feat:支持自定义处理剪贴板中的文本数据 2023-08-13 08:47:35 +08:00
wanglin2
2c56cd453c Demo:支持从右键菜单删除节点的超链接,备注 2023-08-12 22:45:41 +08:00
wanglin2
bf2f9b2697 Demo:修复退出禅模式后左下角的节点和字数统计未更新的问题 2023-08-12 22:17:38 +08:00
wanglin2
fbd061e8b3 Demo:修复大纲修改一个节点的文本后再点击其他节点时不聚焦的问题 2023-08-12 15:43:10 +08:00
wanglin2
680320ba76 Demo:修复基础样式侧边栏打开状态下,导入思维导图数据后侧边栏数据未更新的问题 2023-08-12 15:10:46 +08:00
wanglin2
0d992bd6b1 Demo:颜色选择器支持选择透明颜色 2023-08-12 14:58:32 +08:00
wanglin2
c80eacc5e7 Demo:修复在节点样式侧边栏里无法去除节点的文本修饰线样式的问题 2023-08-12 14:42:14 +08:00
wanglin2
6d202b4b7d Demo:修复无法在节点图片弹窗里删除节点图片的问题 2023-08-12 14:21:11 +08:00
wanglin2
94478fe9f3 Demo:修复开启输入自动进入文本编辑模式和其他输入框冲突的问题 2023-08-12 11:12:11 +08:00
wanglin2
5745e4567b Feat:修改复制粘贴实现方式,去除创建隐藏输入框,支持跨浏览器粘贴思维导图数据 2023-08-12 10:57:51 +08:00
wanglin2
c6a3f4ac7b Feat:去除创建隐藏输入框,通过navigator.clipboard实现复制粘贴 2023-08-11 17:39:04 +08:00
wanglin2
f6609b3050 更新群二维码 2023-08-11 09:11:30 +08:00
wanglin2
4d69778a50 打包0.6.13 2023-08-11 09:10:34 +08:00
wanglin2
c8dfbd3b87 Doc: update 2023-08-11 09:08:44 +08:00
wanglin2
c0aab1e921 Demo:分类整理图片文件 2023-08-10 16:56:04 +08:00
wanglin2
6efee6e859 打包 2023-08-10 10:09:08 +08:00
wanglin2
dd82bf0879 优化代码 2023-08-10 10:06:02 +08:00
街角小林
2d41b5f9e6 Merge pull request #250 from kalcaddle/main
修复部分小问题
2023-08-10 09:23:02 +08:00
街角小林
7e7b6fae9d Merge branch 'main' into main 2023-08-10 09:22:56 +08:00
街角小林
29020daaf0 Merge pull request #248 from Xbs233/main
fix:手势缩小时 会先放大一次 再缩小
2023-08-10 08:55:25 +08:00
wanglin2
6bcead7784 Demo:修复在大纲中插入新节点报错的问题 2023-08-10 08:50:26 +08:00
wanglin2
9625129691 Demo:完善右键菜单和富文本工具条的暗黑模式 2023-08-10 08:47:16 +08:00
warlee
765d0ee212 还原. 2023-08-09 18:58:52 +08:00
warlee
099d4cd78e 画布背景图为none时处理为空. 2023-08-09 18:56:14 +08:00
wanglin2
d9a6981df4 Fix:修复主题配置中背景图片为none时会发起一个异常请求的问题 2023-08-09 18:43:43 +08:00
wanglin2
bbf424c6d2 Feat:1.非富文本输入框进入编辑状态时取消默认全选;2.存在一个激活节点时,支持按下中文、数字、英文按键时自动进入文本编辑模式 2023-08-09 18:26:50 +08:00
warlee
5cde3b76fe Merge branch 'main' of https://github.com/kalcaddle/mind-map
* 'main' of https://github.com/kalcaddle/mind-map:
  打包
  Demo:组件卸载时解除绑定的事件
  打包
  Demo:一些耗时的操作添加loading
  Feat:去掉异步渲染节点的逻辑
2023-08-09 18:14:46 +08:00
warlee
75af742053 Merge branch 'wanglin2:main' into main 2023-08-09 18:04:00 +08:00
wanglin2
69e192ea9d Fix:修复在移动端激活节点、展开收起时等操作时会拉起输入法的问题 2023-08-09 17:22:23 +08:00
wanglin2
5a32c1d99d Fix:修复在移动端激活节点、展开收起时等操作时会拉起输入法的问题 2023-08-09 17:16:31 +08:00
wanglin2
e81e0a5512 Fix:修复快速拖动节点几次后会概率性报错的问题 2023-08-09 17:12:55 +08:00
wanglin2
2fef76c55c Feat:导出图片由html2canvas库改为dom-to-image-more库 2023-08-09 17:01:35 +08:00
wanglin2
49735950f2 打包 2023-08-09 09:37:20 +08:00
wanglin2
c005455144 Demo:组件卸载时解除绑定的事件 2023-08-09 09:36:08 +08:00
wanglin2
ca4afb5440 打包 2023-08-09 09:13:57 +08:00
wanglin2
885647cedf Demo:一些耗时的操作添加loading 2023-08-09 09:09:43 +08:00
wanglin2
dc8efbe3ef Feat:去掉异步渲染节点的逻辑 2023-08-09 09:08:45 +08:00
Xbs233
888b8e725a fix:手势缩小时 会先放大一次 再缩小
修复初次onTouchmove时 必然是放大的情况
2023-08-08 21:23:12 +08:00
warlee
15d65db19d Merge branch 'main' of https://github.com/kalcaddle/mind-map
* 'main' of https://github.com/kalcaddle/mind-map:
  '打包'
  Demo:保存视图数据的逻辑增加防抖操作,优化性能
2023-08-08 17:22:00 +08:00
warlee
2ce0d4cd11 no message 2023-08-08 17:21:50 +08:00
warlee
13f3c2c20c - 移动端手势缩放优化: 按线性关系进行缩放,双指位移可以调整画布位置;
- 拖动画布优化: 只读模式拖拽画布时点击在子元素上时无法拖动问题处理(只读模式拖拽,鼠标中键拖拽,移动端拖拽)
2023-08-08 17:21:05 +08:00
wanglin2
d707329526 '打包' 2023-08-08 16:31:15 +08:00
wanglin2
69faa8bb3e Demo:保存视图数据的逻辑增加防抖操作,优化性能 2023-08-08 16:29:29 +08:00
wanglin2
86b184d5c1 Doc: update 2023-08-08 09:51:05 +08:00
141 changed files with 2310 additions and 671 deletions

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><link rel="icon" href="dist/logo.ico"><title>思绪思维导图</title><script>// 自定义静态资源的路径
window.externalPublicPath = './dist/'
// 接管应用
window.takeOverApp = false</script><link href="dist/css/chunk-vendors.css?f6cb6d932d2f3720fc06" rel="stylesheet"><link href="dist/css/app.css?f6cb6d932d2f3720fc06" rel="stylesheet"></head><body><noscript><strong>We're sorry but thoughts doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script>const getDataFromBackend = () => {
window.takeOverApp = false</script><link href="dist/css/chunk-vendors.css?385fe6c0328bd2e58384" rel="stylesheet"><link href="dist/css/app.css?385fe6c0328bd2e58384" rel="stylesheet"></head><body><noscript><strong>We're sorry but thoughts doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script>const getDataFromBackend = () => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve({
@@ -66,4 +66,4 @@
// 可以通过window.$bus.$on()来监听应用的一些事件
// 实例化页面
window.initApp()
}</script><script src="dist/js/chunk-vendors.js?f6cb6d932d2f3720fc06"></script><script src="dist/js/app.js?f6cb6d932d2f3720fc06"></script></body></html>
}</script><script src="dist/js/chunk-vendors.js?385fe6c0328bd2e58384"></script><script src="dist/js/app.js?385fe6c0328bd2e58384"></script></body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -1,17 +1,17 @@
{
"name": "simple-mind-map",
"version": "0.6.11-fix.1",
"version": "0.6.13",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.6.11-fix.1",
"version": "0.6.13",
"license": "MIT",
"dependencies": {
"@svgdotjs/svg.js": "^3.0.16",
"deepmerge": "^1.5.2",
"dom-to-image-more": "^3.1.6",
"eventemitter3": "^4.0.7",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"jszip": "^3.10.1",
"mdast-util-from-markdown": "^1.3.0",
@@ -255,6 +255,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
"optional": true,
"engines": {
"node": ">= 0.6.0"
}
@@ -411,6 +412,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
"optional": true,
"dependencies": {
"utrie": "^1.0.2"
}
@@ -516,6 +518,11 @@
"node": ">=6.0.0"
}
},
"node_modules/dom-to-image-more": {
"version": "3.1.6",
"resolved": "https://registry.npmjs.org/dom-to-image-more/-/dom-to-image-more-3.1.6.tgz",
"integrity": "sha512-VMO0jNme32T06mWtkOC9QXfj+1npoJxkaTFW0DCwBLguwBKMjqwndiDANxDnbZ0kvNEecwxkv0Zmgdr96cGtAA=="
},
"node_modules/dompurify": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.1.tgz",
@@ -937,6 +944,7 @@
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
"optional": true,
"dependencies": {
"css-line-break": "^2.1.0",
"text-segmentation": "^1.0.3"
@@ -2142,6 +2150,7 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
"optional": true,
"dependencies": {
"utrie": "^1.0.2"
}
@@ -2206,6 +2215,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
"optional": true,
"dependencies": {
"base64-arraybuffer": "^1.0.2"
}
@@ -2461,7 +2471,8 @@
"base64-arraybuffer": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ=="
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
@@ -2576,6 +2587,7 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
"optional": true,
"requires": {
"utrie": "^1.0.2"
}
@@ -2648,6 +2660,11 @@
"esutils": "^2.0.2"
}
},
"dom-to-image-more": {
"version": "3.1.6",
"resolved": "https://registry.npmjs.org/dom-to-image-more/-/dom-to-image-more-3.1.6.tgz",
"integrity": "sha512-VMO0jNme32T06mWtkOC9QXfj+1npoJxkaTFW0DCwBLguwBKMjqwndiDANxDnbZ0kvNEecwxkv0Zmgdr96cGtAA=="
},
"dompurify": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.1.tgz",
@@ -2966,6 +2983,7 @@
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
"optional": true,
"requires": {
"css-line-break": "^2.1.0",
"text-segmentation": "^1.0.3"
@@ -3749,6 +3767,7 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
"optional": true,
"requires": {
"utrie": "^1.0.2"
}
@@ -3800,6 +3819,7 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
"optional": true,
"requires": {
"base64-arraybuffer": "^1.0.2"
}

View File

@@ -1,6 +1,6 @@
{
"name": "simple-mind-map",
"version": "0.6.12",
"version": "0.6.14",
"description": "一个简单的web在线思维导图",
"authors": [
{
@@ -26,8 +26,8 @@
"dependencies": {
"@svgdotjs/svg.js": "^3.0.16",
"deepmerge": "^1.5.2",
"dom-to-image-more": "^3.1.6",
"eventemitter3": "^4.0.7",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"jszip": "^3.10.1",
"mdast-util-from-markdown": "^1.3.0",

View File

@@ -126,5 +126,30 @@ export const defaultOpt = {
// 指定内部一些元素节点文本编辑元素、节点备注显示元素、关联线文本编辑元素、节点图片调整按钮元素添加到的位置默认添加到document.body下
customInnerElsAppendTo: null,
// 拖拽元素时,指示元素新位置的块的最大高度
nodeDragPlaceholderMaxSize: 20
nodeDragPlaceholderMaxSize: 20,
// 是否在存在一个激活节点时,当按下中文、英文、数字按键时自动进入文本编辑模式
// 开启该特性后需要给你的输入框绑定keydown事件并禁止冒泡
enableAutoEnterTextEditWhenKeydown: false,
// 设置富文本节点编辑框和节点大小一致,形成伪原地编辑的效果
// 需要注意的是,只有当节点内只有文本、且形状是矩形才会有比较好的效果
richTextEditFakeInPlace: false,
// 自定义对剪贴板文本的处理。当按ctrl+v粘贴时会读取用户剪贴板中的文本和图片默认只会判断文本是否是普通文本和simple-mind-map格式的节点数据如果你想处理其他思维导图的数据比如processon、zhixi等那么可以传递一个函数接受当前剪贴板中的文本为参数返回处理后的数据可以返回两种类型
/*
1.返回一个纯文本,那么会直接以该文本创建一个子节点
2.返回一个节点对象,格式如下:
{
// 代表是simple-mind-map格式的数据
simpleMindMap: true,
// 节点数据同simple-mind-map节点数据格式
data: {
data: {
text: ''
},
children: []
}
}
*/
// 如果你的处理逻辑存在异步逻辑也可以返回一个promise
customHandleClipboardText: null
}

View File

@@ -108,6 +108,11 @@ export default class KeyCommand {
return arr
}
// 判断是否按下了组合键
hasCombinationKey(e) {
return e.ctrlKey || e.metaKey || e.altKey || e.shiftKey
}
// 获取快捷键对应的键值数组
getKeyCodeArr(key) {
let keyArr = key.split(/\s*\+\s*/)

View File

@@ -12,7 +12,8 @@ import {
simpleDeepClone,
walk,
bfsWalk,
loadImage
loadImage,
isUndef
} from '../../utils'
import { shapeList } from './node/Shape'
import { lineStyleProps } from '../../themes/default'
@@ -48,7 +49,7 @@ class Render {
this.themeConfig = this.mindMap.themeConfig
this.draw = this.mindMap.draw
// 渲染树,操作过程中修改的都是这里的数据
this.renderTree = merge({},this.mindMap.opt.data || {})
this.renderTree = merge({}, this.mindMap.opt.data || {})
// 是否重新渲染
this.reRender = false
// 是否正在渲染中
@@ -108,10 +109,13 @@ class Render {
this.mindMap.execCommand('CLEAR_ACTIVE_NODE')
}
})
// 粘贴事件
this.mindMap.on('paste', data => {
this.onPaste(data)
})
// let timer = null
// this.mindMap.on('view_data_change', () => {
// clearTimeout(timer)
// timer = setTimeout(() => {
// this.render()
// }, 300)
// })
}
// 注册命令
@@ -266,8 +270,7 @@ class Render {
this.copy = this.copy.bind(this)
this.mindMap.keyCommand.addShortcut('Control+c', this.copy)
this.mindMap.keyCommand.addShortcut('Control+v', () => {
// 隐藏输入框可能会失去焦点,所以要重新聚焦
this.textEdit.focusHiddenInput()
this.onPaste()
})
this.cut = this.cut.bind(this)
this.mindMap.keyCommand.addShortcut('Control+x', this.cut)
@@ -442,7 +445,12 @@ class Render {
}
// 插入同级节点,多个节点只会操作第一个节点
insertNode(openEdit = true, appointNodes = [], appointData = null) {
insertNode(
openEdit = true,
appointNodes = [],
appointData = null,
appointChildren = []
) {
appointNodes = this.formatAppointNodes(appointNodes)
if (this.activeNodeList.length <= 0 && appointNodes.length <= 0) {
return
@@ -478,14 +486,19 @@ class Render {
resetRichText: isRichText,
...(appointData || {})
},
children: []
children: [...appointChildren]
})
this.mindMap.render()
}
}
// 插入子节点
insertChildNode(openEdit = true, appointNodes = [], appointData = null) {
insertChildNode(
openEdit = true,
appointNodes = [],
appointData = null,
appointChildren = []
) {
appointNodes = this.formatAppointNodes(appointNodes)
if (this.activeNodeList.length <= 0 && appointNodes.length <= 0) {
return
@@ -516,7 +529,7 @@ class Render {
resetRichText: isRichText,
...(appointData || {})
},
children: []
children: [...appointChildren]
})
// 插入子节点时自动展开子节点
node.nodeData.data.expand = true
@@ -584,15 +597,29 @@ class Render {
// 复制节点
copy() {
this.beingCopyData = this.copyNode()
this.setCoptyDataToClipboard(this.beingCopyData)
}
// 剪切节点
cut() {
this.mindMap.execCommand('CUT_NODE', copyData => {
this.beingCopyData = copyData
this.setCoptyDataToClipboard(copyData)
})
}
// 将粘贴或剪切的数据设置到用户剪切板中
setCoptyDataToClipboard(data) {
if (navigator.clipboard) {
navigator.clipboard.writeText(
JSON.stringify({
simpleMindMap: true,
data
})
)
}
}
// 粘贴节点
paste() {
if (this.beingCopyData) {
@@ -601,7 +628,28 @@ class Render {
}
// 粘贴事件
async onPaste({ text, img }) {
async onPaste() {
// 读取剪贴板的文字和图片
let text = null
let img = null
if (navigator.clipboard) {
try {
text = await navigator.clipboard.readText()
const items = await navigator.clipboard.read()
if (items && items.length > 0) {
for (const clipboardItem of items) {
for (const type of clipboardItem.types) {
if (/^image\//.test(type)) {
img = await clipboardItem.getType(type)
break
}
}
}
}
} catch (error) {
console.log(error)
}
}
// 检查剪切板数据是否有变化
// 通过图片大小来判断图片是否发生变化,可能是不准确的,但是目前没有其他好方法
const imgSize = img ? img.size : 0
@@ -619,9 +667,47 @@ class Render {
if (this.currentBeingPasteType === CONSTANTS.PASTE_TYPE.CLIP_BOARD) {
// 存在文本,则创建子节点
if (text) {
this.mindMap.execCommand('INSERT_CHILD_NODE', false, [], {
text
})
// 判断粘贴的是否是simple-mind-map的数据
let smmData = null
let useDefault = true
// 用户自定义处理
if (this.mindMap.opt.customHandleClipboardText) {
try {
const res = await this.mindMap.opt.customHandleClipboardText(text)
if (!isUndef(res)) {
useDefault = false
if (typeof res === 'object' && res.simpleMindMap) {
smmData = res.data
} else {
text = String(res)
}
}
} catch (error) {}
}
// 默认处理
if (useDefault) {
try {
const parsedData = JSON.parse(text)
if (parsedData && parsedData.simpleMindMap) {
smmData = parsedData.data
}
} catch (error) {}
}
if (smmData) {
this.mindMap.execCommand(
'INSERT_CHILD_NODE',
false,
[],
{
...smmData.data
},
[...smmData.children]
)
} else {
this.mindMap.execCommand('INSERT_CHILD_NODE', false, [], {
text
})
}
}
// 存在图片,则添加到当前激活节点
if (img) {
@@ -888,7 +974,7 @@ class Render {
// 更新了连线的样式
let props = Object.keys(style)
let hasLineStyleProps = false
props.forEach((key) => {
props.forEach(key => {
if (lineStyleProps.includes(key)) {
hasLineStyleProps = true
}
@@ -1020,7 +1106,8 @@ class Render {
}
// 设置节点图片
setNodeImage(node, { url, title, width, height, custom = false }) {
setNodeImage(node, data) {
const { url, title, width, height, custom = false } = data || { url: '', title: '', width: 0, height: 0, custom: false }
this.setNodeDataRender(node, {
image: url,
imageTitle: title || '',

View File

@@ -10,16 +10,11 @@ export default class TextEdit {
this.currentNode = null
// 文本编辑框
this.textEditNode = null
// 隐藏的文本输入框
this.hiddenInputEl = null
// 节点激活时默认聚焦到隐藏输入框
this.enableFocus = true
// 文本编辑框是否显示
this.showTextEdit = false
// 如果编辑过程中缩放画布了,那么缓存当前编辑的内容
this.cacheEditingText = ''
this.bindEvent()
this.createHiddenInput()
}
// 事件
@@ -51,10 +46,6 @@ export default class TextEdit {
this.mindMap.on('before_node_active', () => {
this.hideEditTextBox()
})
// 节点激活事件
this.mindMap.on('node_active', () => {
this.focusHiddenInput()
})
// 注册编辑快捷键
this.mindMap.keyCommand.addShortcut('F2', () => {
if (this.renderer.activeNodeList.length <= 0) {
@@ -63,53 +54,29 @@ export default class TextEdit {
this.show(this.renderer.activeNodeList[0])
})
this.mindMap.on('scale', this.onScale)
}
// 创建一个隐藏的文本输入框
createHiddenInput() {
if (this.hiddenInputEl) return
this.hiddenInputEl = document.createElement('input')
this.hiddenInputEl.type = 'text'
this.hiddenInputEl.style.cssText = `
position: fixed;
left: -99999px;
top: -99999px;
`
// 监听粘贴事件
this.hiddenInputEl.addEventListener('paste', async event => {
event.preventDefault()
const text = (event.clipboardData || window.clipboardData).getData('text')
const files = event.clipboardData.files
let img = null
if (files.length > 0) {
for (let i = 0; i < files.length; i++) {
if (/^image\//.test(files[i].type)) {
img = files[i]
break
}
// // 监听按键事件,判断是否自动进入文本编辑模式
if (this.mindMap.opt.enableAutoEnterTextEditWhenKeydown) {
window.addEventListener('keydown', e => {
const activeNodeList = this.mindMap.renderer.activeNodeList
if (activeNodeList.length <= 0 || activeNodeList.length > 1) return
const node = activeNodeList[0]
// 当正在输入中文或英文或数字时,如果没有按下组合键,那么自动进入文本编辑模式
if (node && this.checkIsAutoEnterTextEditKey(e)) {
this.show(node)
}
}
this.mindMap.emit('paste', {
text,
img
})
})
document.body.appendChild(this.hiddenInputEl)
}
}
// 让隐藏的文本输入框聚焦
focusHiddenInput() {
if (this.hiddenInputEl && this.enableFocus) this.hiddenInputEl.focus()
}
// 关闭默认聚焦
stopFocusOnNodeActive() {
this.enableFocus = false
}
// 开启默认聚焦
openFocusOnNodeActive() {
this.enableFocus = true
// 判断是否是自动进入文本编模式的按钮
checkIsAutoEnterTextEditKey(e) {
const keyCode = e.keyCode
return (
(keyCode === 229 ||
(keyCode >= 65 && keyCode <= 90) ||
(keyCode >= 48 && keyCode <= 57)) &&
!this.mindMap.keyCommand.hasCombinationKey(e)
)
}
// 注册临时快捷键
@@ -148,7 +115,7 @@ export default class TextEdit {
this.mindMap.richText.showEditText(node, rect, isInserting)
return
}
this.showEditTextBox(node, rect)
this.showEditTextBox(node, rect, isInserting)
}
// 处理画布缩放
@@ -166,7 +133,8 @@ export default class TextEdit {
}
// 显示文本编辑框
showEditTextBox(node, rect) {
showEditTextBox(node, rect, isInserting) {
if (this.showTextEdit) return
this.mindMap.emit('before_show_text_edit')
this.registerTmpShortcut()
if (!this.textEditNode) {
@@ -179,10 +147,16 @@ export default class TextEdit {
this.textEditNode.addEventListener('click', e => {
e.stopPropagation()
})
this.textEditNode.addEventListener('mousedown', (e) => {
this.textEditNode.addEventListener('mousedown', e => {
e.stopPropagation()
})
const targetNode = this.mindMap.opt.customInnerElsAppendTo || document.body
this.textEditNode.addEventListener('keydown', e => {
if (this.checkIsAutoEnterTextEditKey(e)) {
e.stopPropagation()
}
})
const targetNode =
this.mindMap.opt.customInnerElsAppendTo || document.body
targetNode.appendChild(this.textEditNode)
}
let scale = this.mindMap.view.scale
@@ -209,12 +183,27 @@ export default class TextEdit {
}
this.showTextEdit = true
// 选中文本
if (!this.cacheEditingText) {
// if (!this.cacheEditingText) {
// this.selectNodeText()
// }
if (isInserting) {
this.selectNodeText()
} else {
this.focus()
}
this.cacheEditingText = ''
}
// 聚焦
focus() {
let selection = window.getSelection()
let range = document.createRange()
range.selectNodeContents(this.textEditNode)
range.collapse()
selection.removeAllRanges()
selection.addRange(range)
}
// 选中文本
selectNodeText() {
let selection = window.getSelection()

View File

@@ -1,6 +1,5 @@
import Style from './Style'
import Shape from './Shape'
import { asyncRun, nodeToHTML } from '../../../utils'
import { G, Rect, ForeignObject, SVG } from '@svgdotjs/svg.js'
import nodeGeneralizationMethods from './nodeGeneralization'
import nodeExpandBtnMethods from './nodeExpandBtn'
@@ -98,6 +97,8 @@ class Node {
this.isMultipleChoice = false
// 是否需要重新layout
this.needLayout = false
// 当前是否是隐藏状态
this.isHide = false
// 概要相关方法
Object.keys(nodeGeneralizationMethods).forEach(item => {
this[item] = nodeGeneralizationMethods[item].bind(this)
@@ -368,7 +369,13 @@ class Node {
})
}
this.group.add(this._unVisibleRectRegionNode)
this.renderer.layout.renderExpandBtnRect(this._unVisibleRectRegionNode, this.expandBtnSize, width, height, this)
this.renderer.layout.renderExpandBtnRect(
this._unVisibleRectRegionNode,
this.expandBtnSize,
width,
height,
this
)
}
}
@@ -388,7 +395,7 @@ class Node {
if (this.isRoot && e.which === 3 && !this.mindMap.opt.readonly) {
e.stopPropagation()
}
if (!this.isRoot && !this.mindMap.opt.readonly) {
if (!this.isRoot && e.which !== 2 && !this.mindMap.opt.readonly) {
e.stopPropagation()
}
// 多选和取消多选
@@ -414,7 +421,7 @@ class Node {
this.mindMap.emit('node_mousedown', this, e)
})
this.group.on('mouseup', e => {
if (!this.isRoot && !this.mindMap.opt.readonly) {
if (!this.isRoot && e.which !== 2 && !this.mindMap.opt.readonly) {
e.stopPropagation()
}
this.mindMap.emit('node_mouseup', this, e)
@@ -476,9 +483,7 @@ class Node {
if (!this.group) {
return
}
let {
alwaysShowExpandBtn
} = this.mindMap.opt
let { alwaysShowExpandBtn } = this.mindMap.opt
if (alwaysShowExpandBtn) {
// 需要移除展开收缩按钮
if (this._expandBtn && this.nodeData.children.length <= 0) {
@@ -500,11 +505,48 @@ class Node {
this.renderGeneralization()
// 更新节点位置
let t = this.group.transform()
// // 如果上次不在可视区内,且本次也不在,那么直接返回
// let { left: ox, top: oy } = this.getNodePosInClient(
// t.translateX,
// t.translateY
// )
// let oldIsInClient =
// ox > 0 && oy > 0 && ox < this.mindMap.width && oy < this.mindMap.height
// let { left: nx, top: ny } = this.getNodePosInClient(this.left, this.top)
// let newIsNotInClient =
// nx + this.width < 0 ||
// ny + this.height < 0 ||
// nx > this.mindMap.width ||
// ny > this.mindMap.height
// if (!oldIsInClient && newIsNotInClient) {
// if (!this.isHide) {
// this.isHide = true
// this.group.hide()
// }
// return
// }
// // 如果当前是隐藏状态,那么先显示
// if (this.isHide) {
// this.isHide = false
// this.group.show()
// }
// 如果节点位置没有变化,则返回
if (this.left === t.translateX && this.top === t.translateY) return
this.group.translate(this.left - t.translateX, this.top - t.translateY)
}
// 获取节点相当于画布的位置
getNodePosInClient(_left, _top) {
let drawTransform = this.mindMap.draw.transform()
let { scaleX, scaleY, translateX, translateY } = drawTransform
let left = _left * scaleX + translateX
let top = _top * scaleY + translateY
return {
left,
top
}
}
// 重新渲染节点,即重新创建节点内容、计算节点大小、计算节点内容布局、更新展开收起按钮,概要及位置
reRender() {
let sizeChange = this.getSize()
@@ -559,18 +601,14 @@ class Node {
this.nodeData.data.expand !== false
) {
let index = 0
asyncRun(
this.children.map(item => {
return () => {
item.render(() => {
index++
if (index >= this.children.length) {
callback()
}
})
this.children.forEach(item => {
item.render(() => {
index++
if (index >= this.children.length) {
callback()
}
})
)
})
} else {
callback()
}
@@ -592,13 +630,9 @@ class Node {
this.removeLine()
// 子节点
if (this.children && this.children.length) {
asyncRun(
this.children.map(item => {
return () => {
item.remove()
}
})
)
this.children.forEach(item => {
item.remove()
})
}
}
@@ -624,13 +658,9 @@ class Node {
}
// 子节点
if (this.children && this.children.length) {
asyncRun(
this.children.map(item => {
return () => {
item.hide()
}
})
)
this.children.forEach(item => {
item.hide()
})
}
}
@@ -650,13 +680,9 @@ class Node {
}
// 子节点
if (this.children && this.children.length) {
asyncRun(
this.children.map(item => {
return () => {
item.show()
}
})
)
this.children.forEach(item => {
item.show()
})
}
}

View File

@@ -17,7 +17,7 @@ class Style {
// 设置新样式
let { backgroundColor, backgroundImage, backgroundRepeat, backgroundPosition, backgroundSize } = themeConfig
el.style.backgroundColor = backgroundColor
if (backgroundImage) {
if (backgroundImage && backgroundImage !== 'none') {
el.style.backgroundImage = `url(${backgroundImage})`
el.style.backgroundRepeat = backgroundRepeat
el.style.backgroundPosition = backgroundPosition

View File

@@ -82,15 +82,20 @@ class View {
// 鼠标滚轮,向上和向左,都是缩小
case CONSTANTS.DIR.UP:
case CONSTANTS.DIR.LEFT:
mousewheelZoomActionReverse ? this.enlarge(cx, cy, isTouchPad) : this.narrow(cx, cy, isTouchPad)
mousewheelZoomActionReverse
? this.enlarge(cx, cy, isTouchPad)
: this.narrow(cx, cy, isTouchPad)
break
// 鼠标滚轮,向下和向右,都是放大
case CONSTANTS.DIR.DOWN:
case CONSTANTS.DIR.RIGHT:
mousewheelZoomActionReverse ? this.narrow(cx, cy, isTouchPad) : this.enlarge(cx, cy, isTouchPad)
mousewheelZoomActionReverse
? this.narrow(cx, cy, isTouchPad)
: this.enlarge(cx, cy, isTouchPad)
break
}
} else {// 鼠标滚轮事件控制画布移动
} else {
// 鼠标滚轮事件控制画布移动
let step = mousewheelMoveStep
if (isTouchPad) {
step = 5
@@ -147,6 +152,7 @@ class View {
// 平移x,y方向
translateXY(x, y) {
if (x === 0 && y === 0) return
this.x += x
this.y += y
this.transform()
@@ -154,24 +160,28 @@ class View {
// 平移x方向
translateX(step) {
if (step === 0) return
this.x += step
this.transform()
}
// 平移x方式到
translateXTo(x) {
if (x === 0) return
this.x = x
this.transform()
}
// 平移y方向
translateY(step) {
if (step === 0) return
this.y += step
this.transform()
}
// 平移y方向到
translateYTo(y) {
if (y === 0) return
this.y = y
this.transform()
}

View File

@@ -64,13 +64,13 @@ const transformXmind = async (content, files) => {
}
// 图片
if (node.image && /\.(jpg|jpeg|png|gif|webp)$/.test(node.image.src)) {
// 处理异步逻辑
let resolve = null
let promise = new Promise(_resolve => {
resolve = _resolve
})
waitLoadImageList.push(promise)
try {
// 处理异步逻辑
let resolve = null
let promise = new Promise(_resolve => {
resolve = _resolve
})
waitLoadImageList.push(promise)
// 读取图片
let imageType = /\.([^.]+)$/.exec(node.image.src)[1]
let imageBase64 =

View File

@@ -204,7 +204,7 @@ class Drag extends Base {
// 检测重叠节点
checkOverlapNode() {
if (!this.drawTransform) {
if (!this.drawTransform || !this.placeholder) {
return
}
const { nodeDragPlaceholderMaxSize } = this.mindMap.opt

View File

@@ -1,7 +1,12 @@
import Quill from 'quill'
import 'quill/dist/quill.snow.css'
import html2canvas from 'html2canvas'
import { walk, getTextFromHtml, isWhite, getVisibleColorFromTheme } from '../utils'
import domtoimage from 'dom-to-image-more'
import {
walk,
getTextFromHtml,
isWhite,
getVisibleColorFromTheme
} from '../utils'
import { CONSTANTS } from '../constants/constant'
let extended = false
@@ -150,6 +155,12 @@ class RichText {
if (this.showTextEdit) {
return
}
const {
richTextEditFakeInPlace,
customInnerElsAppendTo,
nodeTextEditZIndex,
textAutoWrapWidth
} = this.mindMap.opt
this.node = node
this.isInserting = isInserting
if (!rect) rect = node._textData.node.node.getBoundingClientRect()
@@ -163,19 +174,36 @@ class RichText {
let scaleX = rect.width / originWidth
let scaleY = rect.height / originHeight
// 内边距
const paddingX = 6
const paddingY = 4
let paddingX = 6
let paddingY = 4
if (richTextEditFakeInPlace) {
let paddingValue = node.getPaddingVale()
paddingX = paddingValue.paddingX
paddingY = paddingValue.paddingY
}
if (!this.textEditNode) {
this.textEditNode = document.createElement('div')
this.textEditNode.classList.add('smm-richtext-node-edit-wrap')
this.textEditNode.style.cssText = `position:fixed;box-sizing: border-box;box-shadow: 0 0 20px rgba(0,0,0,.5);outline: none; word-break: break-all;padding: ${paddingY}px ${paddingX}px;`
this.textEditNode.style.cssText = `
position:fixed;
box-sizing: border-box;
box-shadow: 0 0 20px rgba(0,0,0,.5);
outline: none;
word-break:
break-all;padding: ${paddingY}px ${paddingX}px;
`
this.textEditNode.addEventListener('click', e => {
e.stopPropagation()
})
this.textEditNode.addEventListener('mousedown', (e) => {
this.textEditNode.addEventListener('mousedown', e => {
e.stopPropagation()
})
const targetNode = this.mindMap.opt.customInnerElsAppendTo || document.body
this.textEditNode.addEventListener('keydown', e => {
if (this.mindMap.renderer.textEdit.checkIsAutoEnterTextEditKey(e)) {
e.stopPropagation()
}
})
const targetNode = customInnerElsAppendTo || document.body
targetNode.appendChild(this.textEditNode)
}
// 使用节点的填充色,否则如果节点颜色是白色的话编辑时看不见
@@ -183,18 +211,28 @@ class RichText {
let color = node.style.merge('color')
this.textEditNode.style.marginLeft = `-${paddingX * scaleX}px`
this.textEditNode.style.marginTop = `-${paddingY * scaleY}px`
this.textEditNode.style.zIndex = this.mindMap.opt.nodeTextEditZIndex
this.textEditNode.style.zIndex = nodeTextEditZIndex
this.textEditNode.style.backgroundColor =
bgColor === 'transparent' ? isWhite(color) ? getVisibleColorFromTheme(this.mindMap.themeConfig) : '#fff' : bgColor
bgColor === 'transparent'
? isWhite(color)
? getVisibleColorFromTheme(this.mindMap.themeConfig)
: '#fff'
: bgColor
this.textEditNode.style.minWidth = originWidth + paddingX * 2 + 'px'
this.textEditNode.style.minHeight = originHeight + 'px'
this.textEditNode.style.left = rect.left + 'px'
this.textEditNode.style.top = rect.top + 'px'
this.textEditNode.style.display = 'block'
this.textEditNode.style.maxWidth =
this.mindMap.opt.textAutoWrapWidth + paddingX * 2 + 'px'
this.textEditNode.style.maxWidth = textAutoWrapWidth + paddingX * 2 + 'px'
this.textEditNode.style.transform = `scale(${scaleX}, ${scaleY})`
this.textEditNode.style.transformOrigin = 'left top'
if (richTextEditFakeInPlace) {
this.textEditNode.style.borderRadius =
(node.style.merge('borderRadius') || 5) + 'px'
if (node.style.merge('shape') == 'roundedRectangle') {
this.textEditNode.style.borderRadius = (node.height || 50) + 'px'
}
}
if (!node.nodeData.data.richText) {
// 还不是富文本的情况
let text = node.nodeData.data.text.split(/\n/gim).join('<br>')
@@ -502,11 +540,16 @@ class RichText {
}
}
walk(node)
let canvas = await html2canvas(el, {
backgroundColor: null
})
// 如果使用html2canvas
// let canvas = await html2canvas(el, {
// backgroundColor: null
// })
// return canvas.toDataURL()
const res = await domtoimage.toPng(el)
this.mindMap.el.removeChild(el)
return canvas.toDataURL()
return res
}
// 将所有节点转换成非富文本节点

View File

@@ -6,7 +6,7 @@ class TouchEvent {
this.touchesNum = 0
this.singleTouchstartEvent = null
this.clickNum = 0
this.doubleTouchmoveDistance = 0
this.touchStartScaleView = null
this.bindEvent()
}
@@ -33,6 +33,7 @@ class TouchEvent {
// 手指按下事件
onTouchstart(e) {
this.touchesNum = e.touches.length
this.touchStartScaleView = null
if (this.touchesNum === 1) {
let touch = e.touches[0]
this.singleTouchstartEvent = touch
@@ -53,18 +54,46 @@ class TouchEvent {
let oy = touch1.clientY - touch2.clientY
let distance = Math.sqrt(Math.pow(ox, 2) + Math.pow(oy, 2))
// 以两指中心点进行缩放
let { x: touch1ClientX, y: touch1ClientY } = this.mindMap.toPos(touch1.clientX, touch1.clientY)
let { x: touch2ClientX, y: touch2ClientY } = this.mindMap.toPos(touch2.clientX, touch2.clientY)
let { x: touch1ClientX, y: touch1ClientY } = this.mindMap.toPos(
touch1.clientX,
touch1.clientY
)
let { x: touch2ClientX, y: touch2ClientY } = this.mindMap.toPos(
touch2.clientX,
touch2.clientY
)
let cx = (touch1ClientX + touch2ClientX) / 2
let cy = (touch1ClientY + touch2ClientY) / 2
if (distance > this.doubleTouchmoveDistance) {
// 放大
this.mindMap.view.enlarge(cx, cy, true)
} else {
// 缩小
this.mindMap.view.narrow(cx, cy, true)
// 手势缩放,基于最开始的位置进行缩放(基于前一个位置缩放不是线性关系); 缩放同时支持位置拖动
const view = this.mindMap.view
if (!this.touchStartScaleView) {
this.touchStartScaleView = {
distance: distance,
scale: view.scale,
x: view.x,
y: view.y,
cx: cx,
cy: cy
}
return
}
this.doubleTouchmoveDistance = distance
const viewBefore = this.touchStartScaleView
const scale = viewBefore.scale * (distance / viewBefore.distance)
if (Math.abs(distance - viewBefore.distance) <= 10) {
scale = viewBefore.scale
}
const ratio = 1 - scale / viewBefore.scale
view.scale = scale < 0.1 ? 0.1 : scale
view.x =
viewBefore.x +
(cx - viewBefore.x) * ratio +
(cx - viewBefore.cx) * scale
view.y =
viewBefore.y +
(cy - viewBefore.y) * ratio +
(cy - viewBefore.cy) * scale
view.transform()
this.mindMap.emit('scale', scale)
}
}
@@ -91,7 +120,7 @@ class TouchEvent {
}
this.touchesNum = 0
this.singleTouchstartEvent = null
this.doubleTouchmoveDistance = 0
this.touchStartScaleView = null
}
// 发送鼠标事件

View File

@@ -455,25 +455,25 @@ export const loadImage = imgFile => {
}
// 移除字符串中的html实体
export const removeHTMLEntities = (str) => {
[['&nbsp;', '&#160;']].forEach((item) => {
export const removeHTMLEntities = str => {
;[['&nbsp;', '&#160;']].forEach(item => {
str = str.replaceAll(item[0], item[1])
})
return str
}
// 获取一个数据的类型
export const getType = (data) => {
export const getType = data => {
return Object.prototype.toString.call(data).slice(7, -1)
}
// 判断一个数据是否是null和undefined和空字符串
export const isUndef = (data) => {
export const isUndef = data => {
return data === null || data === undefined || data === ''
}
// 移除html字符串中节点的内联样式
export const removeHtmlStyle = (html) => {
export const removeHtmlStyle = html => {
return html.replaceAll(/(<[^\s]+)\s+style=["'][^'"]+["']\s*(>)/g, '$1$2')
}
@@ -485,12 +485,12 @@ export const addHtmlStyle = (html, tag, style) => {
// 检查一个字符串是否是富文本字符
let checkIsRichTextEl = null
export const checkIsRichText = (str) => {
export const checkIsRichText = str => {
if (!checkIsRichTextEl) {
checkIsRichTextEl = document.createElement('div')
}
checkIsRichTextEl.innerHTML = str
for (let c = checkIsRichTextEl.childNodes, i = c.length; i--;) {
for (let c = checkIsRichTextEl.childNodes, i = c.length; i--; ) {
if (c[i].nodeType == 1) return true
}
return false
@@ -503,13 +503,20 @@ export const replaceHtmlText = (html, searchText, replaceText) => {
replaceHtmlTextEl = document.createElement('div')
}
replaceHtmlTextEl.innerHTML = html
let walk = (root) => {
let walk = root => {
let childNodes = root.childNodes
childNodes.forEach((node) => {
if (node.nodeType === 1) {// 元素节点
childNodes.forEach(node => {
if (node.nodeType === 1) {
// 元素节点
walk(node)
} else if (node.nodeType === 3) {// 文本节点
root.replaceChild(document.createTextNode(node.nodeValue.replaceAll(searchText, replaceText)), node)
} else if (node.nodeType === 3) {
// 文本节点
root.replaceChild(
document.createTextNode(
node.nodeValue.replaceAll(searchText, replaceText)
),
node
)
}
})
}
@@ -518,22 +525,39 @@ export const replaceHtmlText = (html, searchText, replaceText) => {
}
// 判断一个颜色是否是白色
export const isWhite = (color) => {
export const isWhite = color => {
color = String(color).replaceAll(/\s+/g, '')
return ['#fff', '#ffffff', '#FFF', '#FFFFFF', 'rgb(255,255,255)'].includes(color) || /rgba\(255,255,255,[^)]+\)/.test(color)
return (
['#fff', '#ffffff', '#FFF', '#FFFFFF', 'rgb(255,255,255)'].includes(
color
) || /rgba\(255,255,255,[^)]+\)/.test(color)
)
}
// 判断一个颜色是否是透明
export const isTransparent = (color) => {
export const isTransparent = color => {
color = String(color).replaceAll(/\s+/g, '')
return ['', 'transparent'].includes(color) || /rgba\(\d+,\d+,\d+,0\)/.test(color)
return (
['', 'transparent'].includes(color) || /rgba\(\d+,\d+,\d+,0\)/.test(color)
)
}
// 从当前主题里获取一个非透明非白色的颜色
export const getVisibleColorFromTheme = (themeConfig) => {
export const getVisibleColorFromTheme = themeConfig => {
let { lineColor, root, second, node } = themeConfig
let list = [lineColor, root.fillColor, root.color, second.fillColor, second.color, node.fillColor, node.color, root.borderColor, second.borderColor, node.borderColor]
for(let i = 0; i < list.length; i++) {
let list = [
lineColor,
root.fillColor,
root.color,
second.fillColor,
second.color,
node.fillColor,
node.color,
root.borderColor,
second.borderColor,
node.borderColor
]
for (let i = 0; i < list.length; i++) {
let color = list[i]
if (!isTransparent(color) && !isWhite(color)) {
return color
@@ -541,24 +565,26 @@ export const getVisibleColorFromTheme = (themeConfig) => {
}
}
// 将<p><span></span><p>形式的节点富文本内容转换成<br>换行的文本
// 将<p><span></span><p>形式的节点富文本内容转换成\n换行的文本
let nodeRichTextToTextWithWrapEl = null
export const nodeRichTextToTextWithWrap = (html) => {
export const nodeRichTextToTextWithWrap = html => {
if (!nodeRichTextToTextWithWrapEl) {
nodeRichTextToTextWithWrapEl = document.createElement('div')
}
nodeRichTextToTextWithWrapEl.innerHTML = html
const childNodes = nodeRichTextToTextWithWrapEl.childNodes
let res = ''
for(let i = 0; i < childNodes.length; i++) {
for (let i = 0; i < childNodes.length; i++) {
const node = childNodes[i]
if (node.nodeType === 1) {// 元素节点
if (node.nodeType === 1) {
// 元素节点
if (node.tagName.toLowerCase() === 'p') {
res += node.textContent + '\n'
} else {
res += node.textContent
}
} else if (node.nodeType === 3) {// 文本节点
} else if (node.nodeType === 3) {
// 文本节点
res += node.nodeValue
}
}
@@ -567,7 +593,7 @@ export const nodeRichTextToTextWithWrap = (html) => {
// 将<br>换行的文本转换成<p><span></span><p>形式的节点富文本内容
let textToNodeRichTextWithWrapEl = null
export const textToNodeRichTextWithWrap = (html) => {
export const textToNodeRichTextWithWrap = html => {
if (!textToNodeRichTextWithWrapEl) {
textToNodeRichTextWithWrapEl = document.createElement('div')
}
@@ -575,23 +601,34 @@ export const textToNodeRichTextWithWrap = (html) => {
const childNodes = textToNodeRichTextWithWrapEl.childNodes
let list = []
let str = ''
for(let i = 0; i < childNodes.length; i++) {
for (let i = 0; i < childNodes.length; i++) {
const node = childNodes[i]
if (node.nodeType === 1) {// 元素节点
if (node.nodeType === 1) {
// 元素节点
if (node.tagName.toLowerCase() === 'br') {
list.push(str)
str = ''
} else {
str += node.textContent
}
} else if (node.nodeType === 3) {// 文本节点
} else if (node.nodeType === 3) {
// 文本节点
str += node.nodeValue
}
}
if (str) {
list.push(str)
}
return list.map((item) => {
return `<p><span>${item}</span></p>`
}).join('')
}
return list
.map(item => {
return `<p><span>${item}</span></p>`
})
.join('')
}
// 判断是否是移动端环境
export const isMobile = () => {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
navigator.userAgent
)
}

View File

@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2479351 */
src: url('iconfont.woff2?t=1690537337895') format('woff2'),
url('iconfont.woff?t=1690537337895') format('woff'),
url('iconfont.ttf?t=1690537337895') format('truetype');
src: url('iconfont.woff2?t=1691822758372') format('woff2'),
url('iconfont.woff?t=1691822758372') format('woff'),
url('iconfont.ttf?t=1691822758372') format('truetype');
}
.iconfont {
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icontouming:before {
content: "\e60c";
}
.iconlieri:before {
content: "\e60b";
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,56 +1,56 @@
// 布局结构图片映射
export const layoutImgMap = {
logicalStructure: require('../assets/img/logicalStructure.png'),
mindMap: require('../assets/img/mindMap.png'),
organizationStructure: require('../assets/img/organizationStructure.png'),
catalogOrganization: require('../assets/img/catalogOrganization.png'),
timeline: require('../assets/img/timeline.png'),
timeline2: require('../assets/img/timeline2.png'),
fishbone: require('../assets/img/fishbone.png'),
verticalTimeline: require('../assets/img/verticalTimeline.png'),
logicalStructure: require('../assets/img/structures/logicalStructure.png'),
mindMap: require('../assets/img/structures/mindMap.png'),
organizationStructure: require('../assets/img/structures/organizationStructure.png'),
catalogOrganization: require('../assets/img/structures/catalogOrganization.png'),
timeline: require('../assets/img/structures/timeline.png'),
timeline2: require('../assets/img/structures/timeline2.png'),
fishbone: require('../assets/img/structures/fishbone.png'),
verticalTimeline: require('../assets/img/structures/verticalTimeline.png'),
}
// 主题图片映射
export const themeMap = {
default: require('../assets/img/default.jpg'),
classic: require('../assets/img/classic.jpg'),
minions: require('../assets/img/minions.jpg'),
pinkGrape: require('../assets/img/pinkGrape.jpg'),
mint: require('../assets/img/mint.jpg'),
gold: require('../assets/img/gold.jpg'),
vitalityOrange: require('../assets/img/vitalityOrange.jpg'),
greenLeaf: require('../assets/img/greenLeaf.jpg'),
dark2: require('../assets/img/dark2.jpg'),
skyGreen: require('../assets/img/skyGreen.jpg'),
classic2: require('../assets/img/classic2.jpg'),
classic3: require('../assets/img/classic3.jpg'),
classic4: require('../assets/img/classic4.jpg'),
classicGreen: require('../assets/img/classicGreen.jpg'),
classicBlue: require('../assets/img/classicBlue.jpg'),
blueSky: require('../assets/img/blueSky.jpg'),
brainImpairedPink: require('../assets/img/brainImpairedPink.jpg'),
dark: require('../assets/img/dark.jpg'),
earthYellow: require('../assets/img/earthYellow.jpg'),
freshGreen: require('../assets/img/freshGreen.jpg'),
freshRed: require('../assets/img/freshRed.jpg'),
romanticPurple: require('../assets/img/romanticPurple.jpg'),
simpleBlack: require('../assets/img/simpleBlack.jpg'),
courseGreen: require('../assets/img/courseGreen.jpg'),
coffee: require('../assets/img/coffee.jpg'),
redSpirit: require('../assets/img/redSpirit.jpg'),
blackHumour: require('../assets/img/blackHumour.jpg'),
lateNightOffice: require('../assets/img/lateNightOffice.jpg'),
blackGold: require('../assets/img/blackGold.jpg'),
autumn: require('../assets/img/autumn.jpg'),
avocado: require('../assets/img/avocado.jpg'),
orangeJuice: require('../assets/img/orangeJuice.jpg'),
oreo: require('../assets/img/oreo.jpg'),
shallowSea: require('../assets/img/shallowSea.jpg'),
lemonBubbles: require('../assets/img/lemonBubbles.jpg'),
rose: require('../assets/img/rose.jpg'),
seaBlueLine: require('../assets/img/seaBlueLine.jpg'),
neonLamp: require('../assets/img/neonLamp.jpg'),
darkNightLceBlade: require('../assets/img/darkNightLceBlade.jpg'),
morandi: require('../assets/img/morandi.jpg'),
default: require('../assets/img/themes/default.jpg'),
classic: require('../assets/img/themes/classic.jpg'),
minions: require('../assets/img/themes/minions.jpg'),
pinkGrape: require('../assets/img/themes/pinkGrape.jpg'),
mint: require('../assets/img/themes/mint.jpg'),
gold: require('../assets/img/themes/gold.jpg'),
vitalityOrange: require('../assets/img/themes/vitalityOrange.jpg'),
greenLeaf: require('../assets/img/themes/greenLeaf.jpg'),
dark2: require('../assets/img/themes/dark2.jpg'),
skyGreen: require('../assets/img/themes/skyGreen.jpg'),
classic2: require('../assets/img/themes/classic2.jpg'),
classic3: require('../assets/img/themes/classic3.jpg'),
classic4: require('../assets/img/themes/classic4.jpg'),
classicGreen: require('../assets/img/themes/classicGreen.jpg'),
classicBlue: require('../assets/img/themes/classicBlue.jpg'),
blueSky: require('../assets/img/themes/blueSky.jpg'),
brainImpairedPink: require('../assets/img/themes/brainImpairedPink.jpg'),
dark: require('../assets/img/themes/dark.jpg'),
earthYellow: require('../assets/img/themes/earthYellow.jpg'),
freshGreen: require('../assets/img/themes/freshGreen.jpg'),
freshRed: require('../assets/img/themes/freshRed.jpg'),
romanticPurple: require('../assets/img/themes/romanticPurple.jpg'),
simpleBlack: require('../assets/img/themes/simpleBlack.jpg'),
courseGreen: require('../assets/img/themes/courseGreen.jpg'),
coffee: require('../assets/img/themes/coffee.jpg'),
redSpirit: require('../assets/img/themes/redSpirit.jpg'),
blackHumour: require('../assets/img/themes/blackHumour.jpg'),
lateNightOffice: require('../assets/img/themes/lateNightOffice.jpg'),
blackGold: require('../assets/img/themes/blackGold.jpg'),
autumn: require('../assets/img/themes/autumn.jpg'),
avocado: require('../assets/img/themes/avocado.jpg'),
orangeJuice: require('../assets/img/themes/orangeJuice.jpg'),
oreo: require('../assets/img/themes/oreo.jpg'),
shallowSea: require('../assets/img/themes/shallowSea.jpg'),
lemonBubbles: require('../assets/img/themes/lemonBubbles.jpg'),
rose: require('../assets/img/themes/rose.jpg'),
seaBlueLine: require('../assets/img/themes/seaBlueLine.jpg'),
neonLamp: require('../assets/img/themes/neonLamp.jpg'),
darkNightLceBlade: require('../assets/img/themes/darkNightLceBlade.jpg'),
morandi: require('../assets/img/themes/morandi.jpg'),
}

View File

@@ -97,7 +97,8 @@ export const colorList = [
'#0C797D',
'#0062B1',
'#653294',
'#AB149E'
'#AB149E',
'transparent'
]
// 边框宽度

View File

@@ -77,7 +77,10 @@ export default {
level5: 'Level5',
level6: 'Level6',
zenMode: 'Zen mode',
fitCanvas: 'Fit canvas'
fitCanvas: 'Fit canvas',
removeImage: 'Remove image',
removeHyperlink: 'Remove hyperlink',
removeNote: 'Remove note'
},
count: {
words: 'Words',
@@ -167,6 +170,7 @@ export default {
italic: 'Italic',
textDecoration: 'Text decoration',
underline: 'Underline',
none: 'None',
lineThrough: 'Line through',
overline: 'Overline',
border: 'Border',

View File

@@ -77,7 +77,10 @@ export default {
level5: '五级主题',
level6: '六级主题',
zenMode: '禅模式',
fitCanvas: '适应画布'
fitCanvas: '适应画布',
removeImage: '移除图片',
removeHyperlink: '移除超链接',
removeNote: '移除备注'
},
count: {
words: '字数',
@@ -166,6 +169,7 @@ export default {
addFontWeight: '加粗',
italic: '斜体',
textDecoration: '划线',
none: '无',
underline: '下划线',
lineThrough: '中划线',
overline: '上划线',

View File

@@ -11,7 +11,7 @@ let langList = [
}
]
let StartList = ['introduction', 'start', 'deploy', 'client', 'translate', 'changelog']
let CourseList = new Array(21).fill(0).map((_, index) => {
let CourseList = new Array(22).fill(0).map((_, index) => {
return 'course' + (index + 1)
})
let APIList = [

View File

@@ -1,5 +1,63 @@
# Changelog
## 0.6.14
New:
> 1.Remove and create hidden input boxes, and copy and paste them through navigator. clipboard; Support cross browser pasting of mind map node data; Support custom processing of text data in the clipboard.
Demo:
> 1.Fix the issue of enabling input to automatically enter text editing mode and conflicting with other input boxes.
>
> 2.Fix the issue of not being able to delete node images in the node image pop-up window.
>
> 3.Fixed an issue where the text decoration line style of nodes cannot be removed in the node style sidebar.
>
> 4.The color selector supports selecting transparent colors.
>
> 5.Fix the issue of importing mind map data without updating the sidebar data when the basic style sidebar is open.
>
> 6.Fixed the issue of not focusing when modifying the text of one node in the outline and then clicking on other nodes.
>
> 7.Fixed an issue where the node and word count statistics in the bottom left corner were not updated after exiting Zen mode.
>
> 8.Support deleting hyperlinks and notes of nodes from the right-click menu.
>
> 9.Support pasting node data of Zhixi Mind Map.
## 0.6.13
Fix:
> 1.Fix the issue of the inability to drag the canvas while holding down the middle mouse button on a node in read-only mode.
>
> 2.Fixed the issue of probabilistic error reporting after quickly dragging nodes several times.
>
> 3.Fix the issue of pulling up the input method during operations such as activating nodes on the mobile end, expanding and collapsing.
>
> 4.Fix the issue where an exception request is initiated when the background image in the theme configuration is none.
New:
> 1.Mobile gesture scaling optimization: Scale according to a linear relationship, and adjust the canvas position with double finger displacement.
>
> 2.Remove the logic of asynchronous rendering nodes and improve the speed of creating new nodes.
>
> 3.The export of images has been changed from the html2canvas library to the dom to image more library to address the issue of missing text styles in exporting rich text nodes.
>
> 4.When a non rich text input box enters the editing state, it is deselected by default.
>
> 5.When there is an activation node, it supports automatically entering text editing mode when pressing the Chinese, numeric, or English buttons.
Demo
> 1.Add anti shake operations when saving view data to optimize performance.
>
> 2.Some time-consuming operations add loading effects.
>
> 3.Improve the dark mode of right-click menus and rich text toolbars.
## 0.6.12
Fix:

View File

@@ -1,6 +1,45 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.6.14</h2>
<p>New:</p>
<blockquote>
<p>1.Remove and create hidden input boxes, and copy and paste them through navigator. clipboard; Support cross browser pasting of mind map node data; Support custom processing of text data in the clipboard.</p>
</blockquote>
<p>Demo:</p>
<blockquote>
<p>1.Fix the issue of enabling input to automatically enter text editing mode and conflicting with other input boxes.</p>
<p>2.Fix the issue of not being able to delete node images in the node image pop-up window.</p>
<p>3.Fixed an issue where the text decoration line style of nodes cannot be removed in the node style sidebar.</p>
<p>4.The color selector supports selecting transparent colors.</p>
<p>5.Fix the issue of importing mind map data without updating the sidebar data when the basic style sidebar is open.</p>
<p>6.Fixed the issue of not focusing when modifying the text of one node in the outline and then clicking on other nodes.</p>
<p>7.Fixed an issue where the node and word count statistics in the bottom left corner were not updated after exiting Zen mode.</p>
<p>8.Support deleting hyperlinks and notes of nodes from the right-click menu.</p>
<p>9.Support pasting node data of Zhixi Mind Map.</p>
</blockquote>
<h2>0.6.13</h2>
<p>Fix:</p>
<blockquote>
<p>1.Fix the issue of the inability to drag the canvas while holding down the middle mouse button on a node in read-only mode.</p>
<p>2.Fixed the issue of probabilistic error reporting after quickly dragging nodes several times.</p>
<p>3.Fix the issue of pulling up the input method during operations such as activating nodes on the mobile end, expanding and collapsing.</p>
<p>4.Fix the issue where an exception request is initiated when the background image in the theme configuration is none.</p>
</blockquote>
<p>New:</p>
<blockquote>
<p>1.Mobile gesture scaling optimization: Scale according to a linear relationship, and adjust the canvas position with double finger displacement.</p>
<p>2.Remove the logic of asynchronous rendering nodes and improve the speed of creating new nodes.</p>
<p>3.The export of images has been changed from the html2canvas library to the dom to image more library to address the issue of missing text styles in exporting rich text nodes.</p>
<p>4.When a non rich text input box enters the editing state, it is deselected by default.</p>
<p>5.When there is an activation node, it supports automatically entering text editing mode when pressing the Chinese, numeric, or English buttons.</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.Add anti shake operations when saving view data to optimize performance.</p>
<p>2.Some time-consuming operations add loading effects.</p>
<p>3.Improve the dark mode of right-click menus and rich text toolbars.</p>
</blockquote>
<h2>0.6.12</h2>
<p>Fix:</p>
<blockquote>

View File

@@ -73,6 +73,10 @@ const mindMap = new MindMap({
| mouseScaleCenterUseMousePositionv0.6.4-fix.1+ | Boolean | true | Is the mouse zoom centered around the current position of the mouse, otherwise centered around the canvas | |
| customInnerElsAppendTov0.6.12+ | null/HTMLElement | null | Specify the location where some internal elements (node text editing element, node note display element, associated line text editing element, node image adjustment button element) are added, and default to document.body | |
| nodeDragPlaceholderMaxSizev0.6.12+ | Number | 20 | When dragging an element, the maximum height of the block indicating the new position of the element | |
| enableCreateHiddenInputv0.6.13+v0.6.14+ remove this feature | Boolean | true | Is it allowed to create a hidden input box that will be focused when the node is activated for pasting data and automatically entering the text editing state | |
| enableAutoEnterTextEditWhenKeydownv0.6.13+ | Boolean | true | Does it automatically enter text editing mode when pressing the Chinese, English, or numeric buttons when there is an activation node?| |
| richTextEditFakeInPlacev0.6.13+ | Boolean | false | Set the rich text node edit box to match the size of the node, creating a pseudo in place editing effect. It should be noted that only when there is only text within the node and the shape is rectangular, can the effect be better | |
| customHandleClipboardTextv0.6.14+ | Function | null | Customize the processing of clipboard text. When pressing ctrl+v to paste, it will read the text and images from the user's clipboard. By default, it will only determine whether the text is regular text and node data in simple mind map format. If you want to process data from other mind maps, such as process, zhixi, etc., you can pass a function that takes the text from the current clipboard as a parameter and returns the processed data, which can be of two types: 1.If a pure text is returned, a child node will be directly created with that text; 2.Returns a node object in the following format: { simpleMindMap: true, data: { data: { text: '' }, children: [] } }, The representative is data in simple bind map format, and the node data is in the same format as the simple bind map node data. If your processing logic has asynchronous logic, you can also return a promise | |
### Watermark config
@@ -323,8 +327,8 @@ redo. All commands are as follows:
| SELECT_ALL | Select all | |
| BACK | Go back a specified number of steps | step (the number of steps to go back, default is 1) |
| FORWARD | Go forward a specified number of steps | step (the number of steps to go forward, default is 1) |
| INSERT_NODE | Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective | openEditv0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true` 、 appointNodesv0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array、 appointDataOptional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) |
| INSERT_CHILD_NODE | Insert a child node, the active node or appoint node will be the operation node | openEditv0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true`)、 appointNodesv0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array、 appointDataOptional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) |
| INSERT_NODE | Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective | openEditv0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true` 、 appointNodesv0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array、 appointDataOptional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) 、 appointChildrenv0.6.14+, Optional, Specify the child nodes of the newly created node, array type |
| INSERT_CHILD_NODE | Insert a child node, the active node or appoint node will be the operation node | openEditv0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is `true`)、 appointNodesv0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array、 appointDataOptional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to [exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) 、 appointChildrenv0.6.14+, Optional, Specify the child nodes of the newly created node, array type |
| UP_NODE | Move node up, the active node will be the operation node. If there are multiple active nodes, only the first one will be effective. Using this command on the root node or the first node in the list will be invalid | |
| DOWN_NODE | Move node down, the active node will be the operation node. If there are multiple active nodes, only the first one will be effective. Using this command on the root node or the last node in the list will be invalid | |
| REMOVE_NODE | Remove node, the active node or appoint node will be the operation node | appointNodesv0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array |

View File

@@ -371,6 +371,34 @@
<td>When dragging an element, the maximum height of the block indicating the new position of the element</td>
<td></td>
</tr>
<tr>
<td>enableCreateHiddenInputv0.6.13+v0.6.14+ remove this feature</td>
<td>Boolean</td>
<td>true</td>
<td>Is it allowed to create a hidden input box that will be focused when the node is activated for pasting data and automatically entering the text editing state</td>
<td></td>
</tr>
<tr>
<td>enableAutoEnterTextEditWhenKeydownv0.6.13+</td>
<td>Boolean</td>
<td>true</td>
<td>Does it automatically enter text editing mode when pressing the Chinese, English, or numeric buttons when there is an activation node?</td>
<td></td>
</tr>
<tr>
<td>richTextEditFakeInPlacev0.6.13+</td>
<td>Boolean</td>
<td>false</td>
<td>Set the rich text node edit box to match the size of the node, creating a pseudo in place editing effect. It should be noted that only when there is only text within the node and the shape is rectangular, can the effect be better</td>
<td></td>
</tr>
<tr>
<td>customHandleClipboardTextv0.6.14+</td>
<td>Function</td>
<td>null</td>
<td>Customize the processing of clipboard text. When pressing ctrl+v to paste, it will read the text and images from the user's clipboard. By default, it will only determine whether the text is regular text and node data in simple mind map format. If you want to process data from other mind maps, such as process, zhixi, etc., you can pass a function that takes the text from the current clipboard as a parameter and returns the processed data, which can be of two types: 1.If a pure text is returned, a child node will be directly created with that text; 2.Returns a node object in the following format: { simpleMindMap: true, data: { data: { text: '' }, children: [] } }, The representative is data in simple bind map format, and the node data is in the same format as the simple bind map node data. If your processing logic has asynchronous logic, you can also return a promise</td>
<td></td>
</tr>
</tbody>
</table>
<h3>Watermark config</h3>
@@ -807,12 +835,12 @@ redo. All commands are as follows:</p>
<tr>
<td>INSERT_NODE</td>
<td>Insert a sibling node, the active node or appoint node will be the operation node. If there are multiple active nodes, only the first one will be effective</td>
<td>openEditv0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is <code>true</code> appointNodesv0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array appointDataOptional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to <a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js">exampleData.js</a> </td>
<td>openEditv0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is <code>true</code> 、 appointNodesv0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an arrayappointDataOptional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to <a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js">exampleData.js</a> )、 appointChildrenv0.6.14+, Optional, Specify the child nodes of the newly created node, array type</td>
</tr>
<tr>
<td>INSERT_CHILD_NODE</td>
<td>Insert a child node, the active node or appoint node will be the operation node</td>
<td>openEditv0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is <code>true</code> appointNodesv0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an array appointDataOptional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to <a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js">exampleData.js</a> </td>
<td>openEditv0.4.6+, Whether to activate the newly inserted node and enter editing mode, default is <code>true</code>)、 appointNodesv0.4.7+, Optional, appoint node, Specifying multiple nodes can pass an arrayappointDataOptional, Specify the data for the newly created node, Such as {text: 'xxx', ...}, Detailed structure can be referred to <a href="https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js">exampleData.js</a> )、 appointChildrenv0.6.14+, Optional, Specify the child nodes of the newly created node, array type</td>
</tr>
<tr>
<td>UP_NODE</td>

View File

@@ -58,4 +58,12 @@ Save the current registered shortcut data, then clear the shortcut data
> v0.2.3+
Restore saved shortcut data, then clear the cache data
Restore saved shortcut data, then clear the cache data
### hasCombinationKey(e)
> v0.6.13+
- `e`: Event object.
Determine if the combination key has been pressed.

View File

@@ -46,6 +46,14 @@ the shortcut will be removed</p>
<p>v0.2.3+</p>
</blockquote>
<p>Restore saved shortcut data, then clear the cache data</p>
<h3>hasCombinationKey(e)</h3>
<blockquote>
<p>v0.6.13+</p>
</blockquote>
<ul>
<li><code>e</code>: Event object.</li>
</ul>
<p>Determine if the combination key has been pressed.</p>
</div>
</template>

View File

@@ -14,7 +14,9 @@ The principle of this plugin is to use [Quill](https://github.com/quilljs/quill)
>
> This also caused a problem, that is, the function of exporting as a picture was affected, The original principle of exporting `svg` as an image is very simple, Get the `svg` string, and then create the `blob` data of the `type=image/svg+xml` type. Then use the `URL.createObjectURL` method to generate the `data:url` data. Then create a `Image` tag, use the `data:url` as the `src` of the image, and finally draw the image on the `canvas` object for export, However, after testing, when the `DOM` node is embedded in the `svg`, this method of export will cause errors, and after trying many ways, the perfect export effect cannot be achieved, The current method is to traverse the `foreignObject` node in `svg`, using [html2canvas](https://github.com/niklasvh/html2canvas) Convert the `DOM` node in the `foreignObject` node into an image and then replace the `foreignObject` node. This method can work, but it is very time-consuming. Because the `html2canvas` conversion takes a long time, it takes about 2 seconds to convert a node. This leads to the more nodes, the slower the conversion time. Therefore, it is recommended not to use this plugin if you cannot tolerate the long time of export.
The version of `v0.5.7+` directly uses `html2canvas` to convert the entire `svg`, which is no longer an issue with speed. However, there is currently a bug where the color of the node does not take effect after export.
> The version of `v0.5.7+` directly uses `html2canvas` to convert the entire `svg`, which is no longer an issue with speed. However, there is currently a bug where the color of the node does not take effect after export.
`V0.6.13+` version uses [dom-to-image-more](https://github.com/1904labs/dom-to-image-more) Replaced 'html2canvas' to address the issue of ineffective color export for nodes.
## Register

View File

@@ -14,7 +14,10 @@
<p>The following prompts exist in versions prior to v0.5.6:</p>
<p>This also caused a problem, that is, the function of exporting as a picture was affected, The original principle of exporting <code>svg</code> as an image is very simple, Get the <code>svg</code> string, and then create the <code>blob</code> data of the <code>type=image/svg+xml</code> type. Then use the <code>URL.createObjectURL</code> method to generate the <code>data:url</code> data. Then create a <code>Image</code> tag, use the <code>data:url</code> as the <code>src</code> of the image, and finally draw the image on the <code>canvas</code> object for export, However, after testing, when the <code>DOM</code> node is embedded in the <code>svg</code>, this method of export will cause errors, and after trying many ways, the perfect export effect cannot be achieved, The current method is to traverse the <code>foreignObject</code> node in <code>svg</code>, using <a href="https://github.com/niklasvh/html2canvas">html2canvas</a> Convert the <code>DOM</code> node in the <code>foreignObject</code> node into an image and then replace the <code>foreignObject</code> node. This method can work, but it is very time-consuming. Because the <code>html2canvas</code> conversion takes a long time, it takes about 2 seconds to convert a node. This leads to the more nodes, the slower the conversion time. Therefore, it is recommended not to use this plugin if you cannot tolerate the long time of export.</p>
</blockquote>
<blockquote>
<p>The version of <code>v0.5.7+</code> directly uses <code>html2canvas</code> to convert the entire <code>svg</code>, which is no longer an issue with speed. However, there is currently a bug where the color of the node does not take effect after export.</p>
</blockquote>
<p><code>V0.6.13+</code> version uses <a href="https://github.com/1904labs/dom-to-image-more">dom-to-image-more</a> Replaced 'html2canvas' to address the issue of ineffective color export for nodes.</p>
<h2>Register</h2>
<pre class="hljs"><code><span class="hljs-keyword">import</span> MindMap <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map&#x27;</span>
<span class="hljs-keyword">import</span> RichText <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map/src/plugins/RichText.js&#x27;</span>

View File

@@ -236,7 +236,7 @@ Determine whether a color is transparent.
> v0.6.12+
Convert the rich text content of nodes in the form of `<p><span></span><p>` into text wrapped in `<br>`.
Convert the rich text content of nodes in the form of `<p><span></span><p>` into text wrapped in `\n`.
#### textToNodeRichTextWithWrap(html)
@@ -244,6 +244,12 @@ Convert the rich text content of nodes in the form of `<p><span></span><p>` into
Convert the wrapped text of `<br>` into node rich text content in the form of `<p><span></span><p>`.
#### isMobile()
> v0.6.13+
Determine if it is a mobile environment.
## Simulate CSS background in Canvas
Import:

View File

@@ -168,12 +168,17 @@ and copying the <code>data</code> of the data object, example:</p>
<blockquote>
<p>v0.6.12+</p>
</blockquote>
<p>Convert the rich text content of nodes in the form of <code>&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;p&gt;</code> into text wrapped in <code>&lt;br&gt;</code>.</p>
<p>Convert the rich text content of nodes in the form of <code>&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;p&gt;</code> into text wrapped in <code>\n</code>.</p>
<h4>textToNodeRichTextWithWrap(html)</h4>
<blockquote>
<p>v0.6.12+</p>
</blockquote>
<p>Convert the wrapped text of <code>&lt;br&gt;</code> into node rich text content in the form of <code>&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;p&gt;</code>.</p>
<h4>isMobile()</h4>
<blockquote>
<p>v0.6.13+</p>
</blockquote>
<p>Determine if it is a mobile environment.</p>
<h2>Simulate CSS background in Canvas</h2>
<p>Import:</p>
<pre class="hljs"><code><span class="hljs-keyword">import</span> drawBackgroundImageToCanvas <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;simple-mind-map/src/utils/simulateCSSBackgroundInCanvas&#x27;</span>

View File

@@ -28,6 +28,7 @@ export default [
{ path: 'course19', title: '插入和扩展节点图标' },
{ path: 'course20', title: '如何自定义节点内容' },
{ path: 'course21', title: '如何复制、剪切、粘贴' },
{ path: 'course22', title: '如何实现搜索、替换' },
{ path: 'doExport', title: 'Export 插件' },
{ path: 'drag', title: 'Drag插件' },
{ path: 'introduction', title: '简介' },

View File

@@ -1,5 +1,63 @@
# Changelog
## 0.6.14
新增:
> 1.去除创建隐藏输入框通过navigator.clipboard实现复制粘贴支持跨浏览器粘贴思维导图节点数据支持自定义处理剪贴板中的文本数据。
Demo
> 1.修复开启输入自动进入文本编辑模式和其他输入框冲突的问题。
>
> 2.修复无法在节点图片弹窗里删除节点图片的问题。
>
> 3.修复在节点样式侧边栏里无法去除节点的文本修饰线样式的问题。
>
> 4.颜色选择器支持选择透明颜色。
>
> 5.修复基础样式侧边栏打开状态下,导入思维导图数据后侧边栏数据未更新的问题。
>
> 6.修复大纲修改一个节点的文本后再点击其他节点时不聚焦的问题。
>
> 7.修复退出禅模式后左下角的节点和字数统计未更新的问题。
>
> 8.支持从右键菜单删除节点的超链接、备注。
>
> 9.支持粘贴知犀思维导图的节点数据。
## 0.6.13
修复:
> 1.修复只读模式下鼠标中键按住节点无法拖动画布的问题。
>
> 2.修复快速拖动节点几次后会概率性报错的问题。
>
> 3.修复在移动端激活节点、展开收起时等操作时会拉起输入法的问题。
>
> 4.修复主题配置中背景图片为none时会发起一个异常请求的问题。
新增:
> 1.移动端手势缩放优化: 按线性关系进行缩放、双指位移可以调整画布位置。
>
> 2.去掉异步渲染节点的逻辑,提升创建新节点的速度。
>
> 3.导出图片由html2canvas库改为使用dom-to-image-more库解决导出富文本节点文字样式丢失的问题。
>
> 4.非富文本输入框进入编辑状态时取消默认全选。
>
> 5.存在一个激活节点时,支持按下中文、数字、英文按键时自动进入文本编辑模式。
Demo
> 1.保存视图数据时增加防抖操作,优化性能。
>
> 2.一些耗时的操作添加loading效果。
>
> 3.完善右键菜单和富文本工具条的暗黑模式。
## 0.6.12
修复:

View File

@@ -1,6 +1,45 @@
<template>
<div>
<h1>Changelog</h1>
<h2>0.6.14</h2>
<p>新增</p>
<blockquote>
<p>1.去除创建隐藏输入框通过navigator.clipboard实现复制粘贴支持跨浏览器粘贴思维导图节点数据支持自定义处理剪贴板中的文本数据</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.修复开启输入自动进入文本编辑模式和其他输入框冲突的问题</p>
<p>2.修复无法在节点图片弹窗里删除节点图片的问题</p>
<p>3.修复在节点样式侧边栏里无法去除节点的文本修饰线样式的问题</p>
<p>4.颜色选择器支持选择透明颜色</p>
<p>5.修复基础样式侧边栏打开状态下,导入思维导图数据后侧边栏数据未更新的问题</p>
<p>6.修复大纲修改一个节点的文本后再点击其他节点时不聚焦的问题</p>
<p>7.修复退出禅模式后左下角的节点和字数统计未更新的问题</p>
<p>8.支持从右键菜单删除节点的超链接备注</p>
<p>9.支持粘贴知犀思维导图的节点数据</p>
</blockquote>
<h2>0.6.13</h2>
<p>修复</p>
<blockquote>
<p>1.修复只读模式下鼠标中键按住节点无法拖动画布的问题</p>
<p>2.修复快速拖动节点几次后会概率性报错的问题</p>
<p>3.修复在移动端激活节点展开收起时等操作时会拉起输入法的问题</p>
<p>4.修复主题配置中背景图片为none时会发起一个异常请求的问题</p>
</blockquote>
<p>新增</p>
<blockquote>
<p>1.移动端手势缩放优化: 按线性关系进行缩放双指位移可以调整画布位置</p>
<p>2.去掉异步渲染节点的逻辑提升创建新节点的速度</p>
<p>3.导出图片由html2canvas库改为使用dom-to-image-more库解决导出富文本节点文字样式丢失的问题</p>
<p>4.非富文本输入框进入编辑状态时取消默认全选</p>
<p>5.存在一个激活节点时支持按下中文数字英文按键时自动进入文本编辑模式</p>
</blockquote>
<p>Demo</p>
<blockquote>
<p>1.保存视图数据时增加防抖操作优化性能</p>
<p>2.一些耗时的操作添加loading效果</p>
<p>3.完善右键菜单和富文本工具条的暗黑模式</p>
</blockquote>
<h2>0.6.12</h2>
<p>修复</p>
<blockquote>

View File

@@ -73,6 +73,10 @@ const mindMap = new MindMap({
| mouseScaleCenterUseMousePositionv0.6.4-fix.1+ | Boolean | true | 鼠标缩放是否以鼠标当前位置为中心点,否则以画布中心点 | |
| customInnerElsAppendTov0.6.12+ | null/HTMLElement | null | 指定内部一些元素节点文本编辑元素、节点备注显示元素、关联线文本编辑元素、节点图片调整按钮元素添加到的位置默认添加到document.body下 | |
| nodeDragPlaceholderMaxSizev0.6.12+ | Number | 20 | 拖拽元素时,指示元素新位置的块的最大高度 | |
| enableCreateHiddenInputv0.6.13+v0.6.14+版本已去除该特性) | Boolean | true | 是否允许创建一个隐藏的输入框,该输入框会在节点激活时聚焦,用于粘贴数据和自动进入文本编辑状态 | |
| enableAutoEnterTextEditWhenKeydownv0.6.13+ | Boolean | true | 是否在存在一个激活节点时,当按下中文、英文、数字按键时自动进入文本编辑模式 | |
| richTextEditFakeInPlacev0.6.13+ | Boolean | false | 设置富文本节点编辑框和节点大小一致,形成伪原地编辑的效果,需要注意的是,只有当节点内只有文本、且形状是矩形才会有比较好的效果 | |
| customHandleClipboardTextv0.6.14+ | Function | null | 自定义对剪贴板文本的处理。当按ctrl+v粘贴时会读取用户剪贴板中的文本和图片默认只会判断文本是否是普通文本和simple-mind-map格式的节点数据如果你想处理其他思维导图的数据比如processon、zhixi等那么可以传递一个函数接受当前剪贴板中的文本为参数返回处理后的数据可以返回两种类型1.返回一个纯文本那么会直接以该文本创建一个子节点2.返回一个节点对象,格式如下:{ simpleMindMap: true, data: { data: { text: '' }, children: [] } }代表是simple-mind-map格式的数据节点数据同simple-mind-map节点数据格式如果你的处理逻辑存在异步逻辑也可以返回一个promise | |
### 水印配置
@@ -315,8 +319,8 @@ mindMap.updateConfig({
| SELECT_ALL | 全选 | |
| BACK | 回退指定的步数 | step要回退的步数默认为1 |
| FORWARD | 前进指定的步数 | step要前进的步数默认为1 |
| INSERT_NODE | 插入同级节点,操作节点为当前激活的节点或指定节点,如果有多个激活节点,只会对第一个有效 | openEditv0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodesv0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData可选指定新创建节点的数据比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) |
| INSERT_CHILD_NODE | 插入子节点,操作节点为当前激活的节点或指定节点 | openEditv0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodesv0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData可选指定新创建节点的数据比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js) |
| INSERT_NODE | 插入同级节点,操作节点为当前激活的节点或指定节点,如果有多个激活节点,只会对第一个有效 | openEditv0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodesv0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData可选指定新创建节点的数据比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js)、 appointChildrenv0.6.14+,可选,指定新创建节点的子节点,数组类型) |
| INSERT_CHILD_NODE | 插入子节点,操作节点为当前激活的节点或指定节点 | openEditv0.4.6+,是否激活新插入的节点并进入编辑模式,默认为`true`)、 appointNodesv0.4.7+,可选,指定节点,指定多个节点可以传一个数组)、 appointData可选指定新创建节点的数据比如{text: 'xxx', ...},详细结构可以参考[exampleData.js](https://github.com/wanglin2/mind-map/blob/main/simple-mind-map/example/exampleData.js)、 appointChildrenv0.6.14+,可选,指定新创建节点的子节点,数组类型) |
| UP_NODE | 上移节点,操作节点为当前激活的节点,如果有多个激活节点,只会对第一个有效,对根节点或在列表里的第一个节点使用无效 | |
| DOWN_NODE | 操作节点为当前激活的节点,如果有多个激活节点,只会对第一个有效,对根节点或在列表里的最后一个节点使用无效 | |
| REMOVE_NODE | 删除节点,操作节点为当前激活的节点或指定节点 | appointNodesv0.4.7+,可选,指定节点,指定多个节点可以传一个数组) |

Some files were not shown because too many files have changed in this diff Show More