diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..63b42c78
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,5 @@
+FROM nginx
+RUN mkdir /app
+COPY ./index.html /app/
+COPY ./dist /app/dist/
+COPY nginx.conf /etc/nginx/nginx.conf
\ No newline at end of file
diff --git a/README.md b/README.md
index be4fc059..06bfaa6a 100644
--- a/README.md
+++ b/README.md
@@ -31,13 +31,26 @@ Github:[releases](https://github.com/wanglin2/mind-map/releases)。百度云
- [x] 支持逻辑结构图、思维导图、组织结构图、目录组织图、时间轴(横向、竖向)、鱼骨图等结构
- [x] 内置多种主题,允许高度自定义样式,支持注册新主题
- [x] 节点内容支持文本(普通文本、富文本)、图片、图标、超链接、备注、标签、概要、数学公式
-- [x] 节点支持拖拽(拖拽移动、自由调整)、多种节点形状,支持使用 DDM 完全自定义节点内容
+- [x] 节点支持拖拽(拖拽移动、自由调整)、多种节点形状;支持扩展节点内容、支持使用 DDM 完全自定义节点内容
- [x] 支持画布拖动、缩放
- [x] 支持鼠标按键拖动选择和 Ctrl+左键两种多选节点方式
-- [x] 支持导出为`json`、`png`、`svg`、`pdf`、`markdown`、`xmind`,支持从`json`、`xmind`、`markdown`导入
-- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条
+- [x] 支持导出为`json`、`png`、`svg`、`pdf`、`markdown`、`xmind`、`txt`,支持从`json`、`xmind`、`markdown`导入
+- [x] 支持快捷键、前进后退、关联线、搜索替换、小地图、水印、滚动条、手绘风格、彩虹线条
- [x] 提供丰富的配置,满足各种场景各种使用习惯
- [x] 支持协同编辑
+- [x] 支持演示模式
+
+官方提供了如下插件,可根据需求按需引入(某个功能不生效大概率是因为你没有引入对应的插件),具体使用方式请查看文档:
+
+> RichText(节点富文本插件)、Select(鼠标多选节点插件)、Drag(节点拖拽插件)、AssociativeLine(关联线插件)、Export(导出插件)、KeyboardNavigation(键盘导航插件)、MiniMap(小地图插件)、Watermark(水印插件)、TouchEvent(移动端触摸事件支持插件)、NodeImgAdjust(拖拽调整节点图片大小插件)、Search(搜索插件)、Painter(节点格式刷插件)、Scrollbar(滚动条插件)、Formula(数学公式插件)、Cooperate(协同编辑插件)、RainbowLines(彩虹线条插件)、Demonstrate(演示模式插件)、HandDrawnLikeStyle(手绘风格插件)[收费]
+
+本项目不会实现的特性:
+
+> 1.自由节点,即多个根节点;
+>
+> 2.概要节点后面继续添加节点;
+>
+> 如果你需要以上特性,那么本库可能无法满足你的需求。
# 安装
@@ -84,15 +97,15 @@ const mindMap = new MindMap({
# License
-[MIT](./LICENSE)。保留`mind-map`版权声明的情况下可随意商用。
+[MIT](./LICENSE)。保留`mind-map`版权声明的情况下可随意商用。如不想保留可联系作者。
# 微信交流群
-群聊人数较多,无法通过二维码入群,可以微信添加`wanglinguanfang`拉你入群。
+群聊人数较多,无法通过二维码入群,可以微信添加`wanglinguanfang`拉你入群。思维导图相关问题皆可在群里提问,不必私聊作者。
# star
-如果喜欢本项目,欢迎点个star,这对我们很重要。
+如果喜欢本项目,欢迎点个 star,这对我们很重要。
[](https://star-history.com/#wanglin2/mind-map&Date)
@@ -320,4 +333,36 @@ const mindMap = new MindMap({
sunniberg
+
+
+ 在下青铜五
+
+
+
+ 木星二号
+
+
+
+ 阿晨
+
+
+
+ 铁
+
+
+
+ 庆国
+
+
+
+ 孟照星
+
+
+
+ 子豪
+
+
+
+ 宏涛
+
${ge(e)}
`).join("")};let X=null;const ee=e=>{X||(X=document.createElement("div")),X.innerHTML=e;const t=X.querySelectorAll(".ql-formula");Array.from(t).forEach(e=>{const t=document.createTextNode("$smmformula$");e.parentNode.replaceChild(t,e)});const n=X.childNodes;let i=[];for(let o=0;o${ge(e)}
`).join(""),t.length>0){e=e.replace(/\$smmformula\$/g,''),X.innerHTML=e;const n=X.querySelectorAll(".smmformula");Array.from(n).forEach((e,n)=>{e.parentNode.replaceChild(t[n],e)}),e=X.innerHTML}return e},te=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),ne=(e,t)=>{const n={};return Object.keys(t).forEach(i=>{const o=e[i],a=t[i];if(_(o)===_(a)){if("Object"===_(o)){if(JSON.stringify(o)!==JSON.stringify(a))return void(n[i]=a)}else if(o!==a)return void(n[i]=a)}else n[i]=a}),n},ie=e=>!/^_/.test(e)&&!o["h"].includes(e),oe=e=>e.reduce((e,t)=>{const n=e.find(e=>e.type===t.type);return n?t.list.forEach(e=>{const t=n.list.find(t=>t.name===e.name);t?t.icon=e.icon:n.list.push(e)}):e.push({...t}),e},[]),ae=e=>{let t=[];return e.forEach(n=>{e.find(e=>e.uid!==n.uid&&e.isAncestor(n))||t.push(n)}),t},re=e=>{const t={},n={};e.forEach(e=>{const i=e.parent;if(i){const o=i.uid;n[o]=i;const a=e.getIndexInBrothers(),r={node:e,index:a};t[o]?t[o].find(e=>e.index===r.index)||t[o].push(r):t[o]=[r]}});const i=[];return Object.keys(t).forEach(e=>{if(t[e].length>1){const o=t[e].map(e=>e.index).sort((e,t)=>e-t);i.push({node:n[e],range:[o[0],o[o.length-1]]})}else i.push({node:t[e][0].node})}),i},le=(e,t,n,i,o,a,r,l)=>t>o&&a>e&&i>r&&l>n,ce=e=>{let t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),n.collapse(),t.removeAllRanges(),t.addRange(n)},de=e=>{let t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)},se=(e,t={})=>{const n=e=>{e.forEach(e=>{e.data={...e.data,...t},e.children&&e.children.length>0&&n(e.children)})};return n(e),e},ue=(e,t=!1)=>{const n=e=>{e.forEach(e=>{e.data||(e.data={}),(t||z(e.data.uid))&&(e.data.uid=I()),e.children&&e.children.length>0&&n(e.children)})};return n(e),e},he=e=>e?Array.isArray(e)?e:[e]:[],pe=e=>e.parent?e.parent.nodeData.children.findIndex(t=>t.data.uid===e.uid):0,me=(e,t)=>t.findIndex(t=>t.uid===e.uid),fe=e=>{let t=0;for(let o=0;o${ge(e)}
`).join("")};let X=null;const ee=e=>{X||(X=document.createElement("div")),X.innerHTML=e;const t=X.querySelectorAll(".ql-formula");Array.from(t).forEach(e=>{const t=document.createTextNode("$smmformula$");e.parentNode.replaceChild(t,e)});const n=X.childNodes;let i=[];for(let o=0;o${ge(e)}
`).join(""),t.length>0){e=e.replace(/\$smmformula\$/g,''),X.innerHTML=e;const n=X.querySelectorAll(".smmformula");Array.from(n).forEach((e,n)=>{e.parentNode.replaceChild(t[n],e)}),e=X.innerHTML}return e},te=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),ne=(e,t)=>{const n={};return Object.keys(t).forEach(i=>{const o=e[i],a=t[i];if(_(o)===_(a)){if("Object"===_(o)){if(JSON.stringify(o)!==JSON.stringify(a))return void(n[i]=a)}else if(o!==a)return void(n[i]=a)}else n[i]=a}),n},ie=e=>!/^_/.test(e)&&!o["g"].includes(e),oe=e=>e.reduce((e,t)=>{const n=e.find(e=>e.type===t.type);return n?t.list.forEach(e=>{const t=n.list.find(t=>t.name===e.name);t?t.icon=e.icon:n.list.push(e)}):e.push({...t}),e},[]),ae=e=>{let t=[];return e.forEach(n=>{e.find(e=>e.uid!==n.uid&&e.isAncestor(n))||t.push(n)}),t},re=e=>{const t={},n={};e.forEach(e=>{const i=e.parent;if(i){const o=i.uid;n[o]=i;const a=e.getIndexInBrothers(),r={node:e,index:a};t[o]?t[o].find(e=>e.index===r.index)||t[o].push(r):t[o]=[r]}});const i=[];return Object.keys(t).forEach(e=>{if(t[e].length>1){const o=t[e].map(e=>e.index).sort((e,t)=>e-t);i.push({node:n[e],range:[o[0],o[o.length-1]]})}else i.push({node:t[e][0].node})}),i},le=(e,t,n,i,o,a,r,l)=>t>o&&a>e&&i>r&&l>n,ce=e=>{let t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),n.collapse(),t.removeAllRanges(),t.addRange(n)},de=e=>{let t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)},se=(e,t={})=>{const n=e=>{e.forEach(e=>{e.data={...e.data,...t},e.children&&e.children.length>0&&n(e.children)})};return n(e),e},ue=(e,t=!1)=>{const n=e=>{e.forEach(e=>{e.data||(e.data={}),(t||z(e.data.uid))&&(e.data.uid=I()),e.children&&e.children.length>0&&n(e.children)})};return n(e),e},he=e=>e?Array.isArray(e)?e:[e]:[],pe=e=>e.parent?e.parent.nodeData.children.findIndex(t=>t.data.uid===e.uid):0,me=(e,t)=>t.findIndex(t=>t.uid===e.uid),fe=e=>{let t=0;for(let o=0;o")]),e._v(" into text wrapped in "),t("code",[e._v("\\n")]),e._v(".")]),t("h4",[e._v("textToNodeRichTextWithWrap(html)")]),t("blockquote",[t("p",[e._v("v0.6.12+")])]),t("p",[e._v("Convert the wrapped text of "),t("code",[e._v("
")]),e._v(" into node rich text content in the form of "),t("code",[e._v("
")]),e._v(".")]),t("h4",[e._v("isMobile()")]),t("blockquote",[t("p",[e._v("v0.6.13+")])]),t("p",[e._v("Determine if it is a mobile environment.")]),t("h4",[e._v("getTopAncestorsFomNodeList(list)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("list")]),e._v(": Arrray, Node instance list.")])]),t("p",[e._v("Find the top-level node list from the node instance list.")]),t("h4",[e._v("checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("p",[e._v("The parameter is the position of two rectangles.")]),t("p",[e._v("Determine if two rectangles overlap.")]),t("h4",[e._v("focusInput(el)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("el")]),e._v(": DOM nodes, elements that can be focused, typically input box elements.")])]),t("p",[e._v("Focus on the specified input box.")]),t("h4",[e._v("selectAllInput(el)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("el")]),e._v(": DOM nodes, elements that can be focused, typically input box elements.")])]),t("p",[e._v("Focus and select all specified input boxes.")]),t("h4",[e._v("addDataToAppointNodes(appointNodes, data = {})")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("p",[t("code",[e._v("appointNodes")]),e._v(":Node instance list, array type.")])]),t("li",[t("p",[t("code",[e._v("data")]),e._v(":The data to be attached to all nodes in the specified node instance list tree.")])])]),t("p",[e._v("Adding additional data to the specified node list tree data will modify the original data.")]),t("h4",[e._v("createUidForAppointNodes(appointNodes, createNewId)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("p",[t("code",[e._v("appointNodes")]),e._v(":Node instance list, array type.")])]),t("li",[t("p",[t("code",[e._v("createNewId")]),e._v(":v0.7.3-fix.1+, "),t("code",[e._v("Boolean")]),e._v(", default is "),t("code",[e._v("false")]),e._v(", If the node does not have a 'uid', a new 'uid' will be created. If 'true' is passed, a new 'uid' will be created regardless of whether the node data originally exists or not`")])])]),t("p",[e._v("Adding a uid to the specified node list tree data (if the uid does not exist) will modify the original data.")]),t("h4",[e._v("getNodeIndex(node)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("node")]),e._v(":Node instance.")])]),t("p",[e._v("Gets the position index of a node within its peers.")]),t("h4",[e._v("mergerIconList(list)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("list")]),e._v(":The array of node icons to be merged into the library.")])]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-comment"},[e._v("// const data = [")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// ];")]),e._v("\n\n"),t("span",{staticClass:"hljs-comment"},[e._v("// mergerIconList(data) result:")]),e._v("\n\n"),t("span",{staticClass:"hljs-comment"},[e._v("// [")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// ]")]),e._v("\n")])]),t("p",[e._v("Merge icon arrays.")]),t("h4",[e._v("htmlEscape(str)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("str")]),e._v(":String.")])]),t("p",[e._v("Escape the incoming string, currently escaping the following three characters:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("& -> &\n< -> <\n> -> >\n")])]),t("h4",[e._v("generateColorByContent(str)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("str")]),e._v(":String.")])]),t("p",[e._v("Generate colors based on incoming content, and the same content will generate the same color.")]),t("h4",[e._v("isSameObject(a, b)")]),t("blockquote",[t("p",[e._v("v0.7.3+")])]),t("ul",[t("li",[t("code",[e._v("a")]),e._v("、"),t("code",[e._v("b")]),e._v(": Object | Array, Two objects to compare")])]),t("p",[e._v("Determine whether two objects are the same, only handling objects or arrays.")]),t("h4",[e._v("getNodeDataIndex(node)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Gets the position index of a node within its sibling nodes.")]),t("h4",[e._v("getNodeIndexInNodeList(node, nodeList)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Find the index of a node from a list of nodes.")]),t("h4",[e._v("setDataToClipboard(data)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("ul",[t("li",[t("code",[e._v("data")]),e._v(":Object | Array")])]),t("p",[e._v("Set data to the user clipboard.")]),t("h4",[e._v("getDataFromClipboard()")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Reading text and images from the user's clipboard returns:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("{\n text,\n img\n}\n")])]),t("h4",[e._v("removeFromParentNodeData(node)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Remove the data of a node from its parent node's "),t("code",[e._v("nodeData.children")]),e._v(" list.")]),t("h4",[e._v("checkHasSupSubRelation()")]),t("blockquote",[t("p",[e._v("v0.8.1+")])]),t("p",[e._v("Determine whether there is a hierarchical relationship from the given node instance list.")]),t("h4",[e._v("handleSelfCloseTags(str)")]),t("blockquote",[t("p",[e._v("v0.9.1+")])]),t("ul",[t("li",[t("code",[e._v("str")]),e._v(": html string")])]),t("p",[e._v("Add a closed state to HTML self closing tags, "),t("code",[e._v('
")]),e._v(" into text wrapped in "),t("code",[e._v("\\n")]),e._v(".")]),t("h4",[e._v("textToNodeRichTextWithWrap(html)")]),t("blockquote",[t("p",[e._v("v0.6.12+")])]),t("p",[e._v("Convert the wrapped text of "),t("code",[e._v("
")]),e._v(" into node rich text content in the form of "),t("code",[e._v("
")]),e._v(".")]),t("h4",[e._v("isMobile()")]),t("blockquote",[t("p",[e._v("v0.6.13+")])]),t("p",[e._v("Determine if it is a mobile environment.")]),t("h4",[e._v("getTopAncestorsFomNodeList(list)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("list")]),e._v(": Arrray, Node instance list.")])]),t("p",[e._v("Find the top-level node list from the node instance list.")]),t("h4",[e._v("checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("p",[e._v("The parameter is the position of two rectangles.")]),t("p",[e._v("Determine if two rectangles overlap.")]),t("h4",[e._v("focusInput(el)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("el")]),e._v(": DOM nodes, elements that can be focused, typically input box elements.")])]),t("p",[e._v("Focus on the specified input box.")]),t("h4",[e._v("selectAllInput(el)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("el")]),e._v(": DOM nodes, elements that can be focused, typically input box elements.")])]),t("p",[e._v("Focus and select all specified input boxes.")]),t("h4",[e._v("addDataToAppointNodes(appointNodes, data = {})")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("p",[t("code",[e._v("appointNodes")]),e._v(":Node instance list, array type.")])]),t("li",[t("p",[t("code",[e._v("data")]),e._v(":The data to be attached to all nodes in the specified node instance list tree.")])])]),t("p",[e._v("Adding additional data to the specified node list tree data will modify the original data.")]),t("h4",[e._v("createUidForAppointNodes(appointNodes, createNewId)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("p",[t("code",[e._v("appointNodes")]),e._v(":Node instance list, array type.")])]),t("li",[t("p",[t("code",[e._v("createNewId")]),e._v(":v0.7.3-fix.1+, "),t("code",[e._v("Boolean")]),e._v(", default is "),t("code",[e._v("false")]),e._v(", If the node does not have a 'uid', a new 'uid' will be created. If 'true' is passed, a new 'uid' will be created regardless of whether the node data originally exists or not`")])])]),t("p",[e._v("Adding a uid to the specified node list tree data (if the uid does not exist) will modify the original data.")]),t("h4",[e._v("getNodeIndex(node)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("node")]),e._v(":Node instance.")])]),t("p",[e._v("Gets the position index of a node within its peers.")]),t("h4",[e._v("mergerIconList(list)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("list")]),e._v(":The array of node icons to be merged into the library.")])]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-comment"},[e._v("// const data = [")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// ];")]),e._v("\n\n"),t("span",{staticClass:"hljs-comment"},[e._v("// mergerIconList(data) result:")]),e._v("\n\n"),t("span",{staticClass:"hljs-comment"},[e._v("// [")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },")]),e._v("\n"),t("span",{staticClass:"hljs-comment"},[e._v("// ]")]),e._v("\n")])]),t("p",[e._v("Merge icon arrays.")]),t("h4",[e._v("htmlEscape(str)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("str")]),e._v(":String.")])]),t("p",[e._v("Escape the incoming string, currently escaping the following three characters:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("& -> &\n< -> <\n> -> >\n")])]),t("h4",[e._v("generateColorByContent(str)")]),t("blockquote",[t("p",[e._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[e._v("str")]),e._v(":String.")])]),t("p",[e._v("Generate colors based on incoming content, and the same content will generate the same color.")]),t("h4",[e._v("isSameObject(a, b)")]),t("blockquote",[t("p",[e._v("v0.7.3+")])]),t("ul",[t("li",[t("code",[e._v("a")]),e._v("、"),t("code",[e._v("b")]),e._v(": Object | Array, Two objects to compare")])]),t("p",[e._v("Determine whether two objects are the same, only handling objects or arrays.")]),t("h4",[e._v("getNodeDataIndex(node)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Gets the position index of a node within its sibling nodes.")]),t("h4",[e._v("getNodeIndexInNodeList(node, nodeList)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Find the index of a node from a list of nodes.")]),t("h4",[e._v("setDataToClipboard(data)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("ul",[t("li",[t("code",[e._v("data")]),e._v(":Object | Array")])]),t("p",[e._v("Set data to the user clipboard.")]),t("h4",[e._v("getDataFromClipboard()")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Reading text and images from the user's clipboard returns:")]),t("pre",{staticClass:"hljs"},[t("code",[e._v("{\n text,\n img\n}\n")])]),t("h4",[e._v("removeFromParentNodeData(node)")]),t("blockquote",[t("p",[e._v("v0.8.0+")])]),t("p",[e._v("Remove the data of a node from its parent node's "),t("code",[e._v("nodeData.children")]),e._v(" list.")]),t("h4",[e._v("checkHasSupSubRelation()")]),t("blockquote",[t("p",[e._v("v0.8.1+")])]),t("p",[e._v("Determine whether there is a hierarchical relationship from the given node instance list.")]),t("h4",[e._v("handleSelfCloseTags(str)")]),t("blockquote",[t("p",[e._v("v0.9.1+")])]),t("ul",[t("li",[t("code",[e._v("str")]),e._v(": html string")])]),t("p",[e._v("Add a closed state to HTML self closing tags, "),t("code",[e._v('
")]),v._v("形式的节点富文本内容转换成"),t("code",[v._v("\\n")]),v._v("换行的文本。")]),t("h4",[v._v("textToNodeRichTextWithWrap(html)")]),t("blockquote",[t("p",[v._v("v0.6.12+")])]),t("p",[v._v("将"),t("code",[v._v("
")]),v._v("换行的文本转换成"),t("code",[v._v("
")]),v._v("形式的节点富文本内容。")]),t("h4",[v._v("isMobile()")]),t("blockquote",[t("p",[v._v("v0.6.13+")])]),t("p",[v._v("判断是否是移动端环境。")]),t("h4",[v._v("getTopAncestorsFomNodeList(list)")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[v._v("list")]),v._v(":Arrray,节点实例列表。")])]),t("p",[v._v("从节点实例列表里找出最顶层的节点列表。")]),t("h4",[v._v("checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("p",[v._v("参数为两个矩形的位置。")]),t("p",[v._v("判断两个矩形是否重叠。")]),t("h4",[v._v("focusInput(el)")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[v._v("el")]),v._v(":DOM 节点,可聚焦的元素,一般为输入框元素。")])]),t("p",[v._v("聚焦指定输入框。")]),t("h4",[v._v("selectAllInput(el)")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[v._v("el")]),v._v(":DOM 节点,可聚焦的元素,一般为输入框元素。")])]),t("p",[v._v("聚焦并全选指定输入框。")]),t("h4",[v._v("addDataToAppointNodes(appointNodes, data = {})")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("ul",[t("li",[t("p",[t("code",[v._v("appointNodes")]),v._v(":节点实例列表,数组类型。")])]),t("li",[t("p",[t("code",[v._v("data")]),v._v(":要附加到指定节点实例列表树中所有节点的数据中的数据。")])])]),t("p",[v._v("给指定的节点列表树数据添加附加数据,会修改原数据。")]),t("h4",[v._v("createUidForAppointNodes(appointNodes, createNewId)")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("ul",[t("li",[t("p",[t("code",[v._v("appointNodes")]),v._v(":节点实例列表,数组类型。")])]),t("li",[t("p",[t("code",[v._v("createNewId")]),v._v(":v0.7.3-fix.1+,"),t("code",[v._v("Boolean")]),v._v(",默认为"),t("code",[v._v("false")]),v._v(",即如果节点不存在"),t("code",[v._v("uid")]),v._v("的话,会创建新的"),t("code",[v._v("uid")]),v._v("。如果传"),t("code",[v._v("true")]),v._v(",那么无论节点数据原来是否存在"),t("code",[v._v("uid")]),v._v(",都会创建新的"),t("code",[v._v("uid")])])])]),t("p",[v._v("给指定的节点列表树数据添加 uid(如果 uid 不存在的话),会修改原数据。")]),t("h4",[v._v("getNodeIndex(node)")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[v._v("node")]),v._v(":节点实例。")])]),t("p",[v._v("获取节点在同级里的位置索引。")]),t("h4",[v._v("mergerIconList(list)")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[v._v("list")]),v._v(":要合并到库内部的节点图标数组。")])]),t("pre",{staticClass:"hljs"},[t("code",[t("span",{staticClass:"hljs-comment"},[v._v("// const data = [")]),v._v("\n"),t("span",{staticClass:"hljs-comment"},[v._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },")]),v._v("\n"),t("span",{staticClass:"hljs-comment"},[v._v("// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },")]),v._v("\n"),t("span",{staticClass:"hljs-comment"},[v._v("// ];")]),v._v("\n\n"),t("span",{staticClass:"hljs-comment"},[v._v("// mergerIconList(data) 结果")]),v._v("\n\n"),t("span",{staticClass:"hljs-comment"},[v._v("// [")]),v._v("\n"),t("span",{staticClass:"hljs-comment"},[v._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },")]),v._v("\n"),t("span",{staticClass:"hljs-comment"},[v._v("// ]")]),v._v("\n")])]),t("p",[v._v("合并图标数组。")]),t("h4",[v._v("generateColorByContent(str)")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[v._v("str")]),v._v(":字符串。")])]),t("p",[v._v("根据传入的内容生成颜色,同样的内容会生成同样的颜色。")]),t("h4",[v._v("htmlEscape(str)")]),t("blockquote",[t("p",[v._v("v0.7.2+")])]),t("ul",[t("li",[t("code",[v._v("str")]),v._v(":字符串。")])]),t("p",[v._v("转义传入的字符串,目前会转义如下三个字符:")]),t("pre",{staticClass:"hljs"},[t("code",[v._v("& -> &\n< -> <\n> -> >\n")])]),t("h4",[v._v("isSameObject(a, b)")]),t("blockquote",[t("p",[v._v("v0.7.3+")])]),t("ul",[t("li",[t("code",[v._v("a")]),v._v("、"),t("code",[v._v("b")]),v._v(":Object | Array, 要进行对比的两个对象")])]),t("p",[v._v("判断两个对象是否相同,只处理对象或数组。")]),t("h4",[v._v("getNodeDataIndex(node)")]),t("blockquote",[t("p",[v._v("v0.8.0+")])]),t("p",[v._v("获取节点在兄弟节点中的位置索引。")]),t("h4",[v._v("getNodeIndexInNodeList(node, nodeList)")]),t("blockquote",[t("p",[v._v("v0.8.0+")])]),t("p",[v._v("从一个节点列表里找出某个节点的索引。")]),t("h4",[v._v("setDataToClipboard(data)")]),t("blockquote",[t("p",[v._v("v0.8.0+")])]),t("ul",[t("li",[t("code",[v._v("data")]),v._v(":Object | Array")])]),t("p",[v._v("将数据设置到用户剪切板中。")]),t("h4",[v._v("getDataFromClipboard()")]),t("blockquote",[t("p",[v._v("v0.8.0+")])]),t("p",[v._v("从用户剪贴板中读取文字和图片,返回:")]),t("pre",{staticClass:"hljs"},[t("code",[v._v("{\n text, img\n}\n")])]),t("h4",[v._v("removeFromParentNodeData(node)")]),t("blockquote",[t("p",[v._v("v0.8.0+")])]),t("p",[v._v("从节点的父节点的"),t("code",[v._v("nodeData.children")]),v._v("列表中移除该节点的数据。")]),t("h4",[v._v("checkHasSupSubRelation()")]),t("blockquote",[t("p",[v._v("v0.8.1+")])]),t("p",[v._v("从给定的节点实例列表里判断是否存在上下级关系。")]),t("h4",[v._v("handleSelfCloseTags(str)")]),t("blockquote",[t("p",[v._v("v0.9.1+")])]),t("ul",[t("li",[t("code",[v._v("str")]),v._v(":html 字符串")])]),t("p",[v._v("给 html 自闭合标签添加闭合状态,"),t("code",[v._v('
")]),v._v("形式的节点富文本内容转换成"),e("code",[v._v("\\n")]),v._v("换行的文本。")]),e("h4",[v._v("textToNodeRichTextWithWrap(html)")]),e("blockquote",[e("p",[v._v("v0.6.12+")])]),e("p",[v._v("将"),e("code",[v._v("
")]),v._v("换行的文本转换成"),e("code",[v._v("
")]),v._v("形式的节点富文本内容。")]),e("h4",[v._v("isMobile()")]),e("blockquote",[e("p",[v._v("v0.6.13+")])]),e("p",[v._v("判断是否是移动端环境。")]),e("h4",[v._v("getTopAncestorsFomNodeList(list)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("list")]),v._v(":Arrray,节点实例列表。")])]),e("p",[v._v("从节点实例列表里找出最顶层的节点列表。")]),e("h4",[v._v("checkTwoRectIsOverlap(minx1, maxx1, miny1, maxy1, minx2, maxx2, miny2, maxy2)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("p",[v._v("参数为两个矩形的位置。")]),e("p",[v._v("判断两个矩形是否重叠。")]),e("h4",[v._v("focusInput(el)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("el")]),v._v(":DOM 节点,可聚焦的元素,一般为输入框元素。")])]),e("p",[v._v("聚焦指定输入框。")]),e("h4",[v._v("selectAllInput(el)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("el")]),v._v(":DOM 节点,可聚焦的元素,一般为输入框元素。")])]),e("p",[v._v("聚焦并全选指定输入框。")]),e("h4",[v._v("addDataToAppointNodes(appointNodes, data = {})")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("p",[e("code",[v._v("appointNodes")]),v._v(":节点实例列表,数组类型。")])]),e("li",[e("p",[e("code",[v._v("data")]),v._v(":要附加到指定节点实例列表树中所有节点的数据中的数据。")])])]),e("p",[v._v("给指定的节点列表树数据添加附加数据,会修改原数据。")]),e("h4",[v._v("createUidForAppointNodes(appointNodes, createNewId)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("p",[e("code",[v._v("appointNodes")]),v._v(":节点实例列表,数组类型。")])]),e("li",[e("p",[e("code",[v._v("createNewId")]),v._v(":v0.7.3-fix.1+,"),e("code",[v._v("Boolean")]),v._v(",默认为"),e("code",[v._v("false")]),v._v(",即如果节点不存在"),e("code",[v._v("uid")]),v._v("的话,会创建新的"),e("code",[v._v("uid")]),v._v("。如果传"),e("code",[v._v("true")]),v._v(",那么无论节点数据原来是否存在"),e("code",[v._v("uid")]),v._v(",都会创建新的"),e("code",[v._v("uid")])])])]),e("p",[v._v("给指定的节点列表树数据添加 uid(如果 uid 不存在的话),会修改原数据。")]),e("h4",[v._v("getNodeIndex(node)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("node")]),v._v(":节点实例。")])]),e("p",[v._v("获取节点在同级里的位置索引。")]),e("h4",[v._v("mergerIconList(list)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("list")]),v._v(":要合并到库内部的节点图标数组。")])]),e("pre",{staticClass:"hljs"},[e("code",[e("span",{staticClass:"hljs-comment"},[v._v("// const data = [")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'b' }] },")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// { type: 'priority', name: '优先级图标', list: [{ name: '2', icon: 'c' }, { name: 3, icon: 'd' }] },")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// ];")]),v._v("\n\n"),e("span",{staticClass:"hljs-comment"},[v._v("// mergerIconList(data) 结果")]),v._v("\n\n"),e("span",{staticClass:"hljs-comment"},[v._v("// [")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// { type: 'priority', name: '优先级图标', list: [{ name: '1', icon: 'a' }, { name: 2, icon: 'c' }, { name: 3, icon: 'd' }] },")]),v._v("\n"),e("span",{staticClass:"hljs-comment"},[v._v("// ]")]),v._v("\n")])]),e("p",[v._v("合并图标数组。")]),e("h4",[v._v("generateColorByContent(str)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("str")]),v._v(":字符串。")])]),e("p",[v._v("根据传入的内容生成颜色,同样的内容会生成同样的颜色。")]),e("h4",[v._v("htmlEscape(str)")]),e("blockquote",[e("p",[v._v("v0.7.2+")])]),e("ul",[e("li",[e("code",[v._v("str")]),v._v(":字符串。")])]),e("p",[v._v("转义传入的字符串,目前会转义如下三个字符:")]),e("pre",{staticClass:"hljs"},[e("code",[v._v("& -> &\n< -> <\n> -> >\n")])]),e("h4",[v._v("isSameObject(a, b)")]),e("blockquote",[e("p",[v._v("v0.7.3+")])]),e("ul",[e("li",[e("code",[v._v("a")]),v._v("、"),e("code",[v._v("b")]),v._v(":Object | Array, 要进行对比的两个对象")])]),e("p",[v._v("判断两个对象是否相同,只处理对象或数组。")]),e("h4",[v._v("getNodeDataIndex(node)")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("p",[v._v("获取节点在兄弟节点中的位置索引。")]),e("h4",[v._v("getNodeIndexInNodeList(node, nodeList)")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("p",[v._v("从一个节点列表里找出某个节点的索引。")]),e("h4",[v._v("setDataToClipboard(data)")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("ul",[e("li",[e("code",[v._v("data")]),v._v(":Object | Array")])]),e("p",[v._v("将数据设置到用户剪切板中。")]),e("h4",[v._v("getDataFromClipboard()")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("p",[v._v("从用户剪贴板中读取文字和图片,返回:")]),e("pre",{staticClass:"hljs"},[e("code",[v._v("{\n text, img\n}\n")])]),e("h4",[v._v("removeFromParentNodeData(node)")]),e("blockquote",[e("p",[v._v("v0.8.0+")])]),e("p",[v._v("从节点的父节点的"),e("code",[v._v("nodeData.children")]),v._v("列表中移除该节点的数据。")]),e("h4",[v._v("checkHasSupSubRelation()")]),e("blockquote",[e("p",[v._v("v0.8.1+")])]),e("p",[v._v("从给定的节点实例列表里判断是否存在上下级关系。")]),e("h4",[v._v("handleSelfCloseTags(str)")]),e("blockquote",[e("p",[v._v("v0.9.1+")])]),e("ul",[e("li",[e("code",[v._v("str")]),v._v(":html 字符串")])]),e("p",[v._v("给 html 自闭合标签添加闭合状态,"),e("code",[v._v('