mind-elixir 4.3.5 → 4.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MindElixir.iife.js +12 -12
- package/dist/MindElixir.js +999 -981
- package/dist/MindElixirLite.iife.js +7 -7
- package/dist/MindElixirLite.js +910 -454
- package/dist/example.iife.js +2 -2
- package/dist/example.js +44 -8
- package/dist/types/arrow.d.ts +12 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/linkDiv.d.ts +1 -1
- package/dist/types/methods.d.ts +2 -1
- package/dist/types/nodeOperation.d.ts +1 -1
- package/dist/types/plugin/contextMenu.d.ts +2 -3
- package/dist/types/types/dom.d.ts +1 -1
- package/dist/types/types/index.d.ts +8 -3
- package/dist/types/utils/generateBranch.d.ts +7 -6
- package/dist/types/utils/layout.d.ts +1 -1
- package/dist/types/utils/svg.d.ts +1 -1
- package/package.json +3 -3
- package/readme.md +21 -4
- package/readme.cn.md +0 -207
package/dist/example.iife.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var example=function(){"use strict";return{nodeData:{id:"me-root",topic:"Mind Elixir",tags:["Mind Map Core"],children:[{topic:"logo2",id:"56dae51a90d350a8",direction:0,expanded:!0,children:[{id:"use-image",topic:"mind-elixir",image:{url:"https://raw.githubusercontent.com/ssshooter/mind-elixir-core/master/images/logo2.png",height:100,width:90,fit:"contain"}}]},{topic:"What is Mind Elixir",id:"bd4313fbac40284b",direction:0,expanded:!0,children:[{topic:"A mind map core",id:"beeb823afd6d2114"},{topic:"Free",id:"c1f068377de9f3a0"},{topic:"Open-Source",id:"c1f06d38a09f23ca"},{topic:"Use without JavaScript framework",id:"c1f06e4cbcf16463",expanded:!0,children:[]},{topic:"Use in your own project",id:"c1f1f11a7fbf7550",children:[{topic:"import MindElixir from 'mind-elixir'",id:"c1f1e245b0a89f9b"},{topic:"new MindElixir({...}).init(data)",id:"c1f1ebc7072c8928"}]},{topic:"Easy to use",id:"c1f0723c07b408d7",expanded:!0,children:[{topic:"Use it like other mind map application",id:"c1f09612fd89920d"}]}]},{topic:"Basics",id:"bd1b66c4b56754d9",direction:0,expanded:!0,children:[{topic:"tab - Create a child node",id:"bd1b6892bcab126a"},{topic:"enter - Create a sibling node",id:"bd1b6b632a434b27"},{topic:"del - Remove a node",id:"bd1b983085187c0a"}]},{topic:"Focus mode",id:"bd1b9b94a9a7a913",direction:1,expanded:!0,children:[{topic:"Right click and select Focus Mode",id:"bd1bb2ac4bbab458"},{topic:"Right click and select Cancel Focus Mode",id:"bd1bb4b14d6697c3"}]},{topic:"Left menu",id:"bd1b9d1816ede134",direction:0,expanded:!0,children:[{topic:"Node distribution",id:"bd1ba11e620c3c1a",expanded:!0,children:[{topic:"Left",id:"bd1c1cb51e6745d3"},{topic:"Right",id:"bd1c1e12fd603ff6"},{topic:"Both l & r",id:"bd1c1f03def5c97b"}]}]},{topic:"Bottom menu",id:"bd1ba66996df4ba4",direction:1,expanded:!0,children:[{topic:"Full screen",id:"bd1ba81d9bc95a7e"},{topic:"Return to Center",id:"bd1babdd5c18a7a2"},{topic:"Zoom in",id:"bd1bae68e0ab186e"},{topic:"Zoom out",id:"bd1bb06377439977"}]},{topic:"Link",id:"bd1beff607711025",direction:0,expanded:!0,children:[{topic:"Right click and select Link",id:"bd1bf320da90046a"},{topic:"Click the target you want to link",id:"bd1bf6f94ff2e642"},{topic:"Modify link with control points",id:"bd1c0c4a487bd036"}]},{topic:"Node style",id:"bd1c217f9d0b20bd",direction:0,expanded:!0,children:[{topic:"Font Size",id:"bd1c24420cd2c2f5",style:{fontSize:"32",color:"#3298db"}},{topic:"Font Color",id:"bd1c2a59b9a2739c",style:{color:"#c0392c"}},{topic:"Background Color",id:"bd1c2de33f057eb4",style:{color:"#bdc3c7",background:"#2c3e50"}},{topic:"Add tags",id:"bd1cff58364436d0",tags:["Completed"]},{topic:"Add icons",id:"bd1d0317f7e8a61a",icons:["😂"],tags:["www"]},{topic:"Bolder",id:"bd41fd4ca32322a4",style:{fontWeight:"bold"}},{topic:"Hyper link",id:"bd41fd4ca32322a5",hyperLink:"https://github.com/ssshooter/mind-elixir-core"}]},{topic:"Draggable",id:"bd1f03fee1f63bc6",direction:1,expanded:!0,children:[{topic:`Drag a node to another node
|
|
1
|
+
var example=function(){"use strict";return{nodeData:{id:"me-root",topic:"Mind Elixir",tags:["Mind Map Core"],children:[{topic:"logo2",id:"56dae51a90d350a8",direction:0,expanded:!0,children:[{id:"use-image",topic:"mind-elixir",image:{url:"https://raw.githubusercontent.com/ssshooter/mind-elixir-core/master/images/logo2.png",height:100,width:90,fit:"contain"}}]},{topic:"What is Mind Elixir",id:"bd4313fbac40284b",direction:0,expanded:!0,children:[{topic:"A mind map core",id:"beeb823afd6d2114"},{topic:"Free",id:"c1f068377de9f3a0"},{topic:"Open-Source",id:"c1f06d38a09f23ca"},{topic:"Use without JavaScript framework",id:"c1f06e4cbcf16463",expanded:!0,children:[]},{topic:"Use in your own project",id:"c1f1f11a7fbf7550",children:[{topic:"import MindElixir from 'mind-elixir'",id:"c1f1e245b0a89f9b"},{topic:"new MindElixir({...}).init(data)",id:"c1f1ebc7072c8928"}]},{topic:"Easy to use",id:"c1f0723c07b408d7",expanded:!0,children:[{topic:"Use it like other mind map application",id:"c1f09612fd89920d"}]}]},{topic:"Basics",id:"bd1b66c4b56754d9",direction:0,expanded:!0,children:[{topic:"tab - Create a child node",id:"bd1b6892bcab126a"},{topic:"enter - Create a sibling node",id:"bd1b6b632a434b27"},{topic:"del - Remove a node",id:"bd1b983085187c0a"}]},{topic:"Focus mode",id:"bd1b9b94a9a7a913",direction:1,expanded:!0,children:[{topic:"Right click and select Focus Mode",id:"bd1bb2ac4bbab458"},{topic:"Right click and select Cancel Focus Mode",id:"bd1bb4b14d6697c3"}]},{topic:"Left menu",id:"bd1b9d1816ede134",direction:0,expanded:!0,children:[{topic:"Node distribution",id:"bd1ba11e620c3c1a",expanded:!0,children:[{topic:"Left",id:"bd1c1cb51e6745d3"},{topic:"Right",id:"bd1c1e12fd603ff6"},{topic:"Both l & r",id:"bd1c1f03def5c97b"}]}]},{topic:"Bottom menu",id:"bd1ba66996df4ba4",direction:1,expanded:!0,children:[{topic:"Full screen",id:"bd1ba81d9bc95a7e"},{topic:"Return to Center",id:"bd1babdd5c18a7a2"},{topic:"Zoom in",id:"bd1bae68e0ab186e"},{topic:"Zoom out",id:"bd1bb06377439977"}]},{topic:"Link",id:"bd1beff607711025",direction:0,expanded:!0,children:[{topic:"Right click and select Link",id:"bd1bf320da90046a"},{topic:"Click the target you want to link",id:"bd1bf6f94ff2e642"},{topic:"Modify link with control points",id:"bd1c0c4a487bd036"},{topic:"Bidirectional link is",id:"4da8dbbc7b71be99"},{topic:"Also available.",id:"4da8ded27033a710"}]},{topic:"Node style",id:"bd1c217f9d0b20bd",direction:0,expanded:!0,children:[{topic:"Font Size",id:"bd1c24420cd2c2f5",style:{fontSize:"32",color:"#3298db"}},{topic:"Font Color",id:"bd1c2a59b9a2739c",style:{color:"#c0392c"}},{topic:"Background Color",id:"bd1c2de33f057eb4",style:{color:"#bdc3c7",background:"#2c3e50"}},{topic:"Add tags",id:"bd1cff58364436d0",tags:["Completed"]},{topic:"Add icons",id:"bd1d0317f7e8a61a",icons:["😂"],tags:["www"]},{topic:"Bolder",id:"bd41fd4ca32322a4",style:{fontWeight:"bold"}},{topic:"Hyper link",id:"bd41fd4ca32322a5",hyperLink:"https://github.com/ssshooter/mind-elixir-core"}]},{topic:"Draggable",id:"bd1f03fee1f63bc6",direction:1,expanded:!0,children:[{topic:`Drag a node to another node
|
|
2
2
|
and the former one will become a child node of latter one`,id:"bd1f07c598e729dc"}]},{topic:"Export data",id:"beeb7586973430db",direction:1,expanded:!0,children:[{topic:"JSON",id:"beeb784cc189375f"},{topic:"HTML",id:"beeb7a6bec2d68f5"},{topic:"SVG",id:"beeb7a6bec2d68e6"}]},{topic:"dangerouslySetInnerHTML",id:"c00a1cf60baa44f0",children:[{topic:"Katex",id:"c00a2264f4532611",children:[{topic:"",id:"c00a2264f4532612",dangerouslySetInnerHTML:'<div class="math math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.85em;"><span style="top:-3.01em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">x</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.35em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.85em;"><span style="top:-3.01em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em;">y</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.35em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">a</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">b</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">c</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span></div>'}]},{topic:"Code Block",id:"c00a2264fdaw32612",children:[{topic:"",id:"c00a2264f4532613",dangerouslySetInnerHTML:`<pre class="language-javascript"><code class="language-javascript"><span class="token keyword">let</span> message <span class="token operator">=</span> <span class="token string">'Hello world'</span>
|
|
3
|
-
<span class="token function">alert</span><span class="token punctuation">(</span>message<span class="token punctuation">)</span></code></pre>`}]},{topic:"Customized Div",id:"c00a2264f4532615",children:[{topic:"",id:"c00a2264f4532614",dangerouslySetInnerHTML:'<div><style>.title{font-size:50px}</style><div class="title">Title</div><div style="color: red; font-size: 20px;">Hello world</div></div>'}]}]},{topic:"Caution",id:"bd42dad21aaf6bae",direction:0,style:{background:"#f1c40e"},expanded:!0,children:[{topic:"Only save manually",id:"bd42e1d0163ebf04",expanded:!0,children:[{topic:"Save button in the top-right corner",id:"bd42e619051878b3",branchColor:"green",expanded:!0,children:[]},{topic:"ctrl + S",id:"bd42e97d7ac35e99"}]}]}],expanded:!0},arrows:[{id:"ac5fb1df7345e9c4",label:"Render",from:"beeb784cc189375f",to:"beeb7a6bec2d68f5",delta1:{x:142.8828125,y:-57},delta2:{x:146.1171875,y:45}}],summaries:[{id:"a5e68e6a2ce1b648",parent:"bd42e1d0163ebf04",start:0,end:1,text:"summary"},{id:"a5e6978f1bc69f4a",parent:"bd4313fbac40284b",start:3,end:5,text:"summary"}],direction:2,theme:{name:"Latte",palette:["#dd7878","#ea76cb","#8839ef","#e64553","#fe640b","#df8e1d","#40a02b","#209fb5","#1e66f5","#7287fd"],cssVar:{"--main-color":"#444446","--main-bgcolor":"#ffffff","--color":"#777777","--bgcolor":"#f6f6f6","--panel-color":"#444446","--panel-bgcolor":"#ffffff","--panel-border-color":"#eaeaea"}}}}();
|
|
3
|
+
<span class="token function">alert</span><span class="token punctuation">(</span>message<span class="token punctuation">)</span></code></pre>`}]},{topic:"Customized Div",id:"c00a2264f4532615",children:[{topic:"",id:"c00a2264f4532614",dangerouslySetInnerHTML:'<div><style>.title{font-size:50px}</style><div class="title">Title</div><div style="color: red; font-size: 20px;">Hello world</div></div>'}]},{topic:"Video",id:"c00a2264ffadw19",children:[{topic:"",id:"c00a2264f453fv14",dangerouslySetInnerHTML:'<iframe src="//player.bilibili.com/player.html?bvid=BV1aTxMehEjK&poster=1&autoplay=0&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>'}]}],direction:1},{topic:"Caution",id:"bd42dad21aaf6bae",direction:0,style:{background:"#f1c40e"},expanded:!0,children:[{topic:"Only save manually",id:"bd42e1d0163ebf04",expanded:!0,children:[{topic:"Save button in the top-right corner",id:"bd42e619051878b3",branchColor:"green",expanded:!0,children:[]},{topic:"ctrl + S",id:"bd42e97d7ac35e99"}]}]}],expanded:!0},arrows:[{id:"ac5fb1df7345e9c4",label:"Render",from:"beeb784cc189375f",to:"beeb7a6bec2d68f5",delta1:{x:142.8828125,y:-57},delta2:{x:146.1171875,y:45},bidirectional:!1},{id:"4da8e3367b63b640",label:"Bidirectional!",from:"4da8dbbc7b71be99",to:"4da8ded27033a710",delta1:{x:-186,y:7},delta2:{x:-155,y:28},bidirectional:!0}],summaries:[{id:"a5e68e6a2ce1b648",parent:"bd42e1d0163ebf04",start:0,end:1,text:"summary"},{id:"a5e6978f1bc69f4a",parent:"bd4313fbac40284b",start:3,end:5,text:"summary"}],direction:2,theme:{name:"Latte",palette:["#dd7878","#ea76cb","#8839ef","#e64553","#fe640b","#df8e1d","#40a02b","#209fb5","#1e66f5","#7287fd"],cssVar:{"--main-color":"#444446","--main-bgcolor":"#ffffff","--color":"#777777","--bgcolor":"#f6f6f6","--panel-color":"#444446","--panel-bgcolor":"#ffffff","--panel-border-color":"#eaeaea"}}}}();
|
package/dist/example.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
<span class="token function">alert</span><span class="token punctuation">(</span>message<span class="token punctuation">)</span></code></pre>`, e = '<div><style>.title{font-size:50px}</style><div class="title">Title</div><div style="color: red; font-size: 20px;">Hello world</div></div>', t = {
|
|
1
|
+
const a = {
|
|
3
2
|
nodeData: {
|
|
4
3
|
id: "me-root",
|
|
5
4
|
topic: "Mind Elixir",
|
|
@@ -178,6 +177,14 @@ const s = '<div class="math math-display"><span class="katex-display"><span clas
|
|
|
178
177
|
{
|
|
179
178
|
topic: "Modify link with control points",
|
|
180
179
|
id: "bd1c0c4a487bd036"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
topic: "Bidirectional link is",
|
|
183
|
+
id: "4da8dbbc7b71be99"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
topic: "Also available.",
|
|
187
|
+
id: "4da8ded27033a710"
|
|
181
188
|
}
|
|
182
189
|
]
|
|
183
190
|
},
|
|
@@ -279,7 +286,7 @@ and the former one will become a child node of latter one`,
|
|
|
279
286
|
{
|
|
280
287
|
topic: "",
|
|
281
288
|
id: "c00a2264f4532612",
|
|
282
|
-
dangerouslySetInnerHTML: s
|
|
289
|
+
dangerouslySetInnerHTML: '<div class="math math-display"><span class="katex-display"><span class="katex"><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4em;vertical-align:-0.95em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.85em;"><span style="top:-3.01em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">x</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.35em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.85em;"><span style="top:-3.01em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.03588em;">y</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.35em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">]</span></span></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">[</span></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">a</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">b</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.45em;"><span style="top:-3.61em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">c</span></span></span><span style="top:-2.41em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal">d</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.95em;"><span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">]</span></span></span></span></span></span></span></div>'
|
|
283
290
|
}
|
|
284
291
|
]
|
|
285
292
|
},
|
|
@@ -290,7 +297,8 @@ and the former one will become a child node of latter one`,
|
|
|
290
297
|
{
|
|
291
298
|
topic: "",
|
|
292
299
|
id: "c00a2264f4532613",
|
|
293
|
-
dangerouslySetInnerHTML:
|
|
300
|
+
dangerouslySetInnerHTML: `<pre class="language-javascript"><code class="language-javascript"><span class="token keyword">let</span> message <span class="token operator">=</span> <span class="token string">'Hello world'</span>
|
|
301
|
+
<span class="token function">alert</span><span class="token punctuation">(</span>message<span class="token punctuation">)</span></code></pre>`
|
|
294
302
|
}
|
|
295
303
|
]
|
|
296
304
|
},
|
|
@@ -301,11 +309,23 @@ and the former one will become a child node of latter one`,
|
|
|
301
309
|
{
|
|
302
310
|
topic: "",
|
|
303
311
|
id: "c00a2264f4532614",
|
|
304
|
-
dangerouslySetInnerHTML:
|
|
312
|
+
dangerouslySetInnerHTML: '<div><style>.title{font-size:50px}</style><div class="title">Title</div><div style="color: red; font-size: 20px;">Hello world</div></div>'
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
topic: "Video",
|
|
318
|
+
id: "c00a2264ffadw19",
|
|
319
|
+
children: [
|
|
320
|
+
{
|
|
321
|
+
topic: "",
|
|
322
|
+
id: "c00a2264f453fv14",
|
|
323
|
+
dangerouslySetInnerHTML: '<iframe src="//player.bilibili.com/player.html?bvid=BV1aTxMehEjK&poster=1&autoplay=0&danmaku=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>'
|
|
305
324
|
}
|
|
306
325
|
]
|
|
307
326
|
}
|
|
308
|
-
]
|
|
327
|
+
],
|
|
328
|
+
direction: 1
|
|
309
329
|
},
|
|
310
330
|
{
|
|
311
331
|
topic: "Caution",
|
|
@@ -352,7 +372,23 @@ and the former one will become a child node of latter one`,
|
|
|
352
372
|
delta2: {
|
|
353
373
|
x: 146.1171875,
|
|
354
374
|
y: 45
|
|
355
|
-
}
|
|
375
|
+
},
|
|
376
|
+
bidirectional: !1
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
id: "4da8e3367b63b640",
|
|
380
|
+
label: "Bidirectional!",
|
|
381
|
+
from: "4da8dbbc7b71be99",
|
|
382
|
+
to: "4da8ded27033a710",
|
|
383
|
+
delta1: {
|
|
384
|
+
x: -186,
|
|
385
|
+
y: 7
|
|
386
|
+
},
|
|
387
|
+
delta2: {
|
|
388
|
+
x: -155,
|
|
389
|
+
y: 28
|
|
390
|
+
},
|
|
391
|
+
bidirectional: !0
|
|
356
392
|
}
|
|
357
393
|
],
|
|
358
394
|
summaries: [
|
|
@@ -387,5 +423,5 @@ and the former one will become a child node of latter one`,
|
|
|
387
423
|
}
|
|
388
424
|
};
|
|
389
425
|
export {
|
|
390
|
-
|
|
426
|
+
a as default
|
|
391
427
|
};
|
package/dist/types/arrow.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { CustomSvg, Topic } from './types/dom';
|
|
2
2
|
import type { MindElixirInstance, Uid } from './index';
|
|
3
|
+
/**
|
|
4
|
+
* FYI
|
|
5
|
+
* p1: starting point
|
|
6
|
+
* p2: control point of starting point
|
|
7
|
+
* p3: control point of ending point
|
|
8
|
+
* p4: ending point
|
|
9
|
+
*/
|
|
3
10
|
export type Arrow = {
|
|
4
11
|
id: string;
|
|
5
12
|
label: string;
|
|
@@ -13,6 +20,7 @@ export type Arrow = {
|
|
|
13
20
|
x: number;
|
|
14
21
|
y: number;
|
|
15
22
|
};
|
|
23
|
+
bidirectional?: boolean;
|
|
16
24
|
};
|
|
17
25
|
export type DivData = {
|
|
18
26
|
cx: number;
|
|
@@ -22,7 +30,10 @@ export type DivData = {
|
|
|
22
30
|
ctrlX: number;
|
|
23
31
|
ctrlY: number;
|
|
24
32
|
};
|
|
25
|
-
export
|
|
33
|
+
export type ArrowOptions = {
|
|
34
|
+
bidirectional?: boolean;
|
|
35
|
+
};
|
|
36
|
+
export declare const createArrow: (this: MindElixirInstance, from: Topic, to: Topic, options?: ArrowOptions) => void;
|
|
26
37
|
export declare const removeArrow: (this: MindElixirInstance, linkSvg?: CustomSvg) => void;
|
|
27
38
|
export declare const selectArrow: (this: MindElixirInstance, link: CustomSvg) => void;
|
|
28
39
|
export declare const unselectArrow: (this: MindElixirInstance) => void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare namespace MindElixir {
|
|
|
22
22
|
renderArrow(this: MindElixirInstance): void;
|
|
23
23
|
editArrowLabel(this: MindElixirInstance, el: import("./types/dom").CustomSvg): void;
|
|
24
24
|
tidyArrow(this: MindElixirInstance): void;
|
|
25
|
-
createArrow: (this: MindElixirInstance, from: import("./types/dom").Topic, to: import("./types/dom").Topic) => void;
|
|
25
|
+
createArrow: (this: MindElixirInstance, from: import("./types/dom").Topic, to: import("./types/dom").Topic, options?: import("./arrow").ArrowOptions) => void;
|
|
26
26
|
removeArrow: (this: MindElixirInstance, linkSvg?: import("./types/dom").CustomSvg) => void;
|
|
27
27
|
selectArrow: (this: MindElixirInstance, link: import("./types/dom").CustomSvg) => void;
|
|
28
28
|
unselectArrow: (this: MindElixirInstance) => void;
|
package/dist/types/linkDiv.d.ts
CHANGED
package/dist/types/methods.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MindElixirInstance, MindElixirData } from './index';
|
|
2
2
|
import * as nodeOperation from './nodeOperation';
|
|
3
|
+
import * as arrow from './arrow';
|
|
3
4
|
import * as summary from './summary';
|
|
4
5
|
export type OperationMap = typeof nodeOperation;
|
|
5
6
|
export type Operations = keyof OperationMap;
|
|
@@ -23,7 +24,7 @@ declare const methods: {
|
|
|
23
24
|
renderArrow(this: MindElixirInstance): void;
|
|
24
25
|
editArrowLabel(this: MindElixirInstance, el: import("./index").CustomSvg): void;
|
|
25
26
|
tidyArrow(this: MindElixirInstance): void;
|
|
26
|
-
createArrow: (this: MindElixirInstance, from: import("./index").Topic, to: import("./index").Topic) => void;
|
|
27
|
+
createArrow: (this: MindElixirInstance, from: import("./index").Topic, to: import("./index").Topic, options?: arrow.ArrowOptions) => void;
|
|
27
28
|
removeArrow: (this: MindElixirInstance, linkSvg?: import("./index").CustomSvg) => void;
|
|
28
29
|
selectArrow: (this: MindElixirInstance, link: import("./index").CustomSvg) => void;
|
|
29
30
|
unselectArrow: (this: MindElixirInstance) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Topic } from './types/dom';
|
|
2
|
-
import type
|
|
2
|
+
import { type MindElixirInstance, type NodeObj } from './types/index';
|
|
3
3
|
export declare const rmSubline: (tpc: Topic) => void;
|
|
4
4
|
export declare const reshapeNode: (this: MindElixirInstance, tpc: Topic, patchData: Partial<NodeObj>) => void;
|
|
5
5
|
export declare const insertSibling: (this: MindElixirInstance, type: "before" | "after", el?: Topic, node?: NodeObj) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MindElixirInstance } from '../types/index';
|
|
2
2
|
import './contextMenu.less';
|
|
3
|
-
type
|
|
3
|
+
export type ContextMenuOption = {
|
|
4
4
|
focus?: boolean;
|
|
5
5
|
link?: boolean;
|
|
6
6
|
extend?: {
|
|
@@ -9,5 +9,4 @@ type Options = {
|
|
|
9
9
|
onclick: (e: MouseEvent) => void;
|
|
10
10
|
}[];
|
|
11
11
|
};
|
|
12
|
-
export default function (mind: MindElixirInstance, option
|
|
13
|
-
export {};
|
|
12
|
+
export default function (mind: MindElixirInstance, option?: ContextMenuOption): () => void;
|
|
@@ -46,5 +46,5 @@ export type CustomLine = SVGPathElement;
|
|
|
46
46
|
export type CustomArrow = SVGPathElement;
|
|
47
47
|
export interface CustomSvg extends SVGGElement {
|
|
48
48
|
arrowObj: Arrow;
|
|
49
|
-
children: HTMLCollection & [CustomLine, CustomArrow, SVGTextElement];
|
|
49
|
+
children: HTMLCollection & [CustomLine, CustomArrow, CustomArrow, SVGTextElement];
|
|
50
50
|
}
|
|
@@ -8,7 +8,12 @@ import type { Summary, SummarySvgGroup } from '../summary';
|
|
|
8
8
|
import type SelectionArea from '@viselect/vanilla';
|
|
9
9
|
import type { MainLineParams, SubLineParams } from '../utils/generateBranch';
|
|
10
10
|
import type { Locale } from '../i18n';
|
|
11
|
-
|
|
11
|
+
import type { ContextMenuOption } from '../plugin/contextMenu';
|
|
12
|
+
export { type MindElixirMethods } from '../methods';
|
|
13
|
+
export declare enum DirectionClass {
|
|
14
|
+
LHS = "lhs",
|
|
15
|
+
RHS = "rhs"
|
|
16
|
+
}
|
|
12
17
|
type Before = Partial<{
|
|
13
18
|
[K in Operations]: (...args: Parameters<OperationMap[K]>) => Promise<boolean> | boolean;
|
|
14
19
|
}>;
|
|
@@ -72,7 +77,7 @@ export interface MindElixirInstance extends MindElixirMethods {
|
|
|
72
77
|
draggable: boolean;
|
|
73
78
|
editable: boolean;
|
|
74
79
|
contextMenu: boolean;
|
|
75
|
-
contextMenuOption
|
|
80
|
+
contextMenuOption?: ContextMenuOption;
|
|
76
81
|
toolBar: boolean;
|
|
77
82
|
keypress: boolean;
|
|
78
83
|
mouseSelectionButton: 0 | 2;
|
|
@@ -124,7 +129,7 @@ export type Options = {
|
|
|
124
129
|
draggable?: boolean;
|
|
125
130
|
editable?: boolean;
|
|
126
131
|
contextMenu?: boolean;
|
|
127
|
-
contextMenuOption?:
|
|
132
|
+
contextMenuOption?: ContextMenuOption;
|
|
128
133
|
toolBar?: boolean;
|
|
129
134
|
keypress?: boolean;
|
|
130
135
|
mouseSelectionButton?: 0 | 2;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MindElixirInstance } from '..';
|
|
2
|
-
|
|
2
|
+
import { DirectionClass } from '..';
|
|
3
|
+
export interface MainLineParams {
|
|
3
4
|
pT: number;
|
|
4
5
|
pL: number;
|
|
5
6
|
pW: number;
|
|
@@ -8,10 +9,10 @@ export type MainLineParams = {
|
|
|
8
9
|
cL: number;
|
|
9
10
|
cW: number;
|
|
10
11
|
cH: number;
|
|
11
|
-
direction:
|
|
12
|
+
direction: DirectionClass;
|
|
12
13
|
containerHeight: number;
|
|
13
|
-
}
|
|
14
|
-
export
|
|
14
|
+
}
|
|
15
|
+
export interface SubLineParams {
|
|
15
16
|
pT: number;
|
|
16
17
|
pL: number;
|
|
17
18
|
pW: number;
|
|
@@ -20,8 +21,8 @@ export type SubLineParams = {
|
|
|
20
21
|
cL: number;
|
|
21
22
|
cW: number;
|
|
22
23
|
cH: number;
|
|
23
|
-
direction:
|
|
24
|
+
direction: DirectionClass;
|
|
24
25
|
isFirst: boolean | undefined;
|
|
25
|
-
}
|
|
26
|
+
}
|
|
26
27
|
export declare function main({ pT, pL, pW, pH, cT, cL, cW, cH, direction, containerHeight }: MainLineParams): string;
|
|
27
28
|
export declare function sub(this: MindElixirInstance, { pT, pL, pW, pH, cT, cL, cW, cH, direction, isFirst }: SubLineParams): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Children } from '../types/dom';
|
|
2
|
-
import type
|
|
2
|
+
import { type MindElixirInstance, type NodeObj } from '../types/index';
|
|
3
3
|
export declare const layout: (this: MindElixirInstance) => void;
|
|
4
4
|
export declare const layoutChildren: (mei: MindElixirInstance, data: NodeObj[]) => Children;
|
|
@@ -3,5 +3,5 @@ import type { CustomSvg } from '../types/dom';
|
|
|
3
3
|
export declare const createPath: (d: string, color: string, width: string) => SVGPathElement;
|
|
4
4
|
export declare const createLinkSvg: (klass: string) => SVGSVGElement;
|
|
5
5
|
export declare const createLine: () => SVGLineElement;
|
|
6
|
-
export declare const createSvgGroup: (d: string,
|
|
6
|
+
export declare const createSvgGroup: (d: string, arrowd1: string, arrowd2: string) => CustomSvg;
|
|
7
7
|
export declare const editSvgText: (mei: MindElixirInstance, textEl: SVGTextElement, onblur: (div: HTMLDivElement) => void) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mind-elixir",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Mind elixir is a free open source mind map core.",
|
|
6
6
|
"keywords": [
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@types/node": "^20.14.2",
|
|
78
78
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
79
79
|
"@typescript-eslint/parser": "^5.62.0",
|
|
80
|
-
"@viselect/vanilla": "
|
|
80
|
+
"@viselect/vanilla": "3.5.1",
|
|
81
81
|
"eslint": "^8.57.0",
|
|
82
82
|
"eslint-config-prettier": "^8.10.0",
|
|
83
83
|
"eslint-plugin-prettier": "^4.2.1",
|
|
@@ -89,4 +89,4 @@
|
|
|
89
89
|
"vite": "^4.5.3",
|
|
90
90
|
"vite-plugin-css-injected-by-js": "^3.5.1"
|
|
91
91
|
}
|
|
92
|
-
}
|
|
92
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<a href="mind-elixir.com" target="_blank" rel="noopener noreferrer">
|
|
2
|
+
<a href="https://docs.mind-elixir.com" target="_blank" rel="noopener noreferrer">
|
|
3
3
|
<img width="150" src="https://raw.githubusercontent.com/ssshooter/mind-elixir-core/master/images/logo2.png" alt="mindelixir logo2">
|
|
4
4
|
</a>
|
|
5
5
|
<h1 align="center">Mind Elixir</h1>
|
|
@@ -23,7 +23,13 @@
|
|
|
23
23
|
</a>
|
|
24
24
|
</p>
|
|
25
25
|
|
|
26
|
-
[
|
|
26
|
+
[English](/readme.md)
|
|
27
|
+
[中文](/readme/zh.md)
|
|
28
|
+
[Español](/readme/es.md)
|
|
29
|
+
[Français](/readme/fr.md)
|
|
30
|
+
[Português](/readme/pt.md)
|
|
31
|
+
[Русский](/readme/ru.md)
|
|
32
|
+
[日本語](/readme/ja.md)
|
|
27
33
|
|
|
28
34
|
Mind elixir is a open source JavaScript mind map core. You can use it with any frontend framework you like.
|
|
29
35
|
|
|
@@ -62,9 +68,10 @@ Features:
|
|
|
62
68
|
- [APIs](#apis)
|
|
63
69
|
- [Theme](#theme)
|
|
64
70
|
- [Shortcuts](#shortcuts)
|
|
65
|
-
- [
|
|
71
|
+
- [Ecosystem](#ecosystem)
|
|
66
72
|
- [Development](#development)
|
|
67
73
|
- [Thanks](#thanks)
|
|
74
|
+
- [Contributors](#contributors)
|
|
68
75
|
|
|
69
76
|
</details>
|
|
70
77
|
|
|
@@ -379,7 +386,7 @@ Be aware that Mind Elixir will not observe the change of `prefers-color-scheme`.
|
|
|
379
386
|
| Ctrl + "-" | Zoom Out Mind Map |
|
|
380
387
|
| Ctrl + 0 | Reset Zoom Level |
|
|
381
388
|
|
|
382
|
-
##
|
|
389
|
+
## Ecosystem
|
|
383
390
|
|
|
384
391
|
- [@mind-elixir/node-menu](https://github.com/ssshooter/node-menu)
|
|
385
392
|
- [@mind-elixir/node-menu-neo](https://github.com/ssshooter/node-menu-neo)
|
|
@@ -387,6 +394,8 @@ Be aware that Mind Elixir will not observe the change of `prefers-color-scheme`.
|
|
|
387
394
|
- [@mind-elixir/export-html](https://github.com/ssshooter/export-html)
|
|
388
395
|
- [mind-elixir-react](https://github.com/ssshooter/mind-elixir-react)
|
|
389
396
|
|
|
397
|
+
PRs are welcome!
|
|
398
|
+
|
|
390
399
|
## Development
|
|
391
400
|
|
|
392
401
|
```
|
|
@@ -415,3 +424,11 @@ pnpm doc:md
|
|
|
415
424
|
## Thanks
|
|
416
425
|
|
|
417
426
|
- [@viselect/vanilla](https://github.com/simonwep/selection/tree/master/packages/vanilla)
|
|
427
|
+
|
|
428
|
+
## Contributors
|
|
429
|
+
|
|
430
|
+
Thanks for your contributions to Mind Elixir! Your support and dedication make this project better.
|
|
431
|
+
|
|
432
|
+
<a href="https://github.com/SSShooter/mind-elixir-core/graphs/contributors">
|
|
433
|
+
<img src="https://contrib.rocks/image?repo=SSShooter/mind-elixir-core&columns=6" />
|
|
434
|
+
</a>
|
package/readme.cn.md
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
<p align="center"><a href="mind-elixir.com" target="_blank" rel="noopener noreferrer"><img width="150" src="https://raw.githubusercontent.com/ssshooter/mind-elixir-core/master/images/logo2.png" alt="mindelixir logo2"></a></p>
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<a href="https://www.npmjs.com/package/mind-elixir">
|
|
5
|
-
<img src="https://img.shields.io/npm/v/mind-elixir" alt="version">
|
|
6
|
-
</a>
|
|
7
|
-
<img src="https://img.shields.io/npm/l/mind-elixir" alt="license">
|
|
8
|
-
<a href="https://app.codacy.com/gh/ssshooter/mind-elixir-core?utm_source=github.com&utm_medium=referral&utm_content=ssshooter/mind-elixir-core&utm_campaign=Badge_Grade_Settings">
|
|
9
|
-
<img src="https://api.codacy.com/project/badge/Grade/09fadec5bf094886b30cea6aabf3a88b" alt="code quality">
|
|
10
|
-
</a>
|
|
11
|
-
<a href="https://bundlephobia.com/result?p=mind-elixir">
|
|
12
|
-
<img src="https://badgen.net/bundlephobia/dependency-count/mind-elixir" alt="dependency-count">
|
|
13
|
-
</a>
|
|
14
|
-
<a href="https://packagephobia.com/result?p=mind-elixir">
|
|
15
|
-
<img src="https://packagephobia.com/badge?p=mind-elixir" alt="dependency-count">
|
|
16
|
-
</a>
|
|
17
|
-
</p>
|
|
18
|
-
|
|
19
|
-
Mind elixir 是一个无框架依赖的思维导图内核
|
|
20
|
-
|
|
21
|
-
[English](https://github.com/ssshooter/mind-elixir-core/blob/master/readme.md)
|
|
22
|
-
|
|
23
|
-
## 立即尝试
|
|
24
|
-
|
|
25
|
-

|
|
26
|
-
|
|
27
|
-
https://mind-elixir.com/#/
|
|
28
|
-
|
|
29
|
-
### Playground
|
|
30
|
-
|
|
31
|
-
https://codepen.io/ssshooter/pen/GVQRYK
|
|
32
|
-
|
|
33
|
-
with React https://codesandbox.io/s/mind-elixir-react-9sisb
|
|
34
|
-
|
|
35
|
-
with Vue https://codesandbox.io/s/mind-elixir-vue-nqjjl
|
|
36
|
-
|
|
37
|
-
## 如何使用
|
|
38
|
-
|
|
39
|
-
### 安装
|
|
40
|
-
|
|
41
|
-
#### NPM
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
npm i mind-elixir -S
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
```javascript
|
|
48
|
-
import MindElixir, { E } from 'mind-elixir'
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
#### Script 标签
|
|
52
|
-
|
|
53
|
-
```html
|
|
54
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/mind-elixir/dist/mind-elixir.js"></script>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### HTML 结构
|
|
58
|
-
|
|
59
|
-
```html
|
|
60
|
-
<div id="map"></div>
|
|
61
|
-
<style>
|
|
62
|
-
#map {
|
|
63
|
-
height: 500px;
|
|
64
|
-
width: 100%;
|
|
65
|
-
}
|
|
66
|
-
</style>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### 初始化
|
|
70
|
-
|
|
71
|
-
```javascript
|
|
72
|
-
import MindElixir, { E } from 'mind-elixir'
|
|
73
|
-
import { exportSvg, exportPng } from '../dist/painter'
|
|
74
|
-
import example from '../dist/example1'
|
|
75
|
-
|
|
76
|
-
let options = {
|
|
77
|
-
el: '#map',
|
|
78
|
-
direction: MindElixir.LEFT,
|
|
79
|
-
// create new map data
|
|
80
|
-
data: MindElixir.new('new topic') or example,
|
|
81
|
-
// the data return from `.getData()`
|
|
82
|
-
draggable: true, // default true
|
|
83
|
-
contextMenu: true, // default true
|
|
84
|
-
toolBar: true, // default true
|
|
85
|
-
nodeMenu: true, // default true
|
|
86
|
-
keypress: true, // default true
|
|
87
|
-
locale: 'en', // [zh_CN,zh_TW,en,ja,pt] waiting for PRs
|
|
88
|
-
overflowHidden: false, // default false
|
|
89
|
-
mainLinkStyle: 2, // [1,2] default 1
|
|
90
|
-
contextMenuOption: {
|
|
91
|
-
focus: true,
|
|
92
|
-
link: true,
|
|
93
|
-
extend: [
|
|
94
|
-
{
|
|
95
|
-
name: 'Node edit',
|
|
96
|
-
onclick: () => {
|
|
97
|
-
alert('extend menu')
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
},
|
|
102
|
-
allowUndo: false,
|
|
103
|
-
before: {
|
|
104
|
-
insertSibling(el, obj) {
|
|
105
|
-
return true
|
|
106
|
-
},
|
|
107
|
-
async addChild(el, obj) {
|
|
108
|
-
await sleep()
|
|
109
|
-
return true
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
let mind = new MindElixir(options)
|
|
115
|
-
mind.init()
|
|
116
|
-
|
|
117
|
-
// get a node
|
|
118
|
-
E('node-id')
|
|
119
|
-
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### 数据结构
|
|
123
|
-
|
|
124
|
-
```javascript
|
|
125
|
-
// whole node data structure up to now
|
|
126
|
-
{
|
|
127
|
-
topic: 'node topic',
|
|
128
|
-
id: 'bd1c24420cd2c2f5',
|
|
129
|
-
style: { fontSize: '32', color: '#3298db', background: '#ecf0f1' },
|
|
130
|
-
parent: null,
|
|
131
|
-
tags: ['Tag'],
|
|
132
|
-
icons: ['😀'],
|
|
133
|
-
hyperLink: 'https://github.com/ssshooter/mind-elixir-core',
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### 事件处理
|
|
138
|
-
|
|
139
|
-
```javascript
|
|
140
|
-
mind.bus.addListener('operation', operation => {
|
|
141
|
-
console.log(operation)
|
|
142
|
-
// return {
|
|
143
|
-
// name: action name,
|
|
144
|
-
// obj: target object
|
|
145
|
-
// }
|
|
146
|
-
|
|
147
|
-
// name: [insertSibling|addChild|removeNode|beginEdit|finishEdit]
|
|
148
|
-
// obj: target
|
|
149
|
-
|
|
150
|
-
// name: moveNode
|
|
151
|
-
// obj: {from:target1,to:target2}
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
mind.bus.addListener('selectNode', node => {
|
|
155
|
-
console.log(node)
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
mind.bus.addListener('expandNode', node => {
|
|
159
|
-
console.log('expandNode: ', node)
|
|
160
|
-
})
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### 数据导出
|
|
164
|
-
|
|
165
|
-
```javascript
|
|
166
|
-
mind.getData() // javascript object, see src/example.js
|
|
167
|
-
mind.getDataString() // stringify object
|
|
168
|
-
mind.getDataMd() // markdown
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### 输出图片
|
|
172
|
-
|
|
173
|
-
**WIP**
|
|
174
|
-
|
|
175
|
-
```javascript
|
|
176
|
-
import painter from 'mind-elixir/dist/painter'
|
|
177
|
-
painter.exportSvg()
|
|
178
|
-
painter.exportPng()
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### 操作拦截
|
|
182
|
-
|
|
183
|
-
```javascript
|
|
184
|
-
let mind = new MindElixir({
|
|
185
|
-
...
|
|
186
|
-
before: {
|
|
187
|
-
insertSibling(el, obj) {
|
|
188
|
-
console.log(el, obj)
|
|
189
|
-
if (this.currentNode.nodeObj.parent.root) {
|
|
190
|
-
return false
|
|
191
|
-
}
|
|
192
|
-
return true
|
|
193
|
-
},
|
|
194
|
-
async addChild(el, obj) {
|
|
195
|
-
await sleep()
|
|
196
|
-
if (this.currentNode.nodeObj.parent.root) {
|
|
197
|
-
return false
|
|
198
|
-
}
|
|
199
|
-
return true
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
})
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## 文档
|
|
206
|
-
|
|
207
|
-
https://docs.mind-elixir.com/zh-Hans/
|