mind-elixir 4.1.4 → 4.1.5
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 +1 -1
- package/dist/MindElixir.js +1 -1
- package/dist/MindElixirLite.iife.js +1 -1
- package/dist/MindElixirLite.js +1 -1
- package/dist/types/arrow.d.ts +31 -0
- package/dist/types/const.d.ts +8 -0
- package/dist/types/dev.d.ts +1 -0
- package/dist/types/docs.d.ts +9 -0
- package/dist/types/exampleData/1.cn.d.ts +125 -0
- package/dist/types/exampleData/1.d.ts +3 -0
- package/dist/types/exampleData/2.d.ts +3 -0
- package/dist/types/exampleData/3.d.ts +3 -0
- package/dist/types/exampleData/htmlText.d.ts +3 -0
- package/dist/types/i18n.d.ts +16 -0
- package/dist/types/index.d.ts +107 -0
- package/dist/types/interact.d.ts +132 -0
- package/dist/types/linkDiv.d.ts +15 -0
- package/dist/types/methods.d.ts +86 -0
- package/dist/types/mouse.d.ts +2 -0
- package/dist/types/nodeOperation.d.ts +18 -0
- package/dist/types/plugin/contextMenu.d.ts +3 -0
- package/dist/types/plugin/exportImage.d.ts +3 -0
- package/dist/types/plugin/keypress.d.ts +2 -0
- package/dist/types/plugin/mobileMenu.d.ts +3 -0
- package/dist/types/plugin/nodeDraggable.d.ts +2 -0
- package/dist/types/plugin/operationHistory.d.ts +2 -0
- package/dist/types/plugin/selection.d.ts +2 -0
- package/dist/types/plugin/toolBar.d.ts +3 -0
- package/dist/types/summary.d.ts +18 -0
- package/dist/types/types/dom.d.ts +50 -0
- package/dist/types/types/global.d.ts +7 -0
- package/dist/types/types/index.d.ts +169 -0
- package/dist/types/utils/LinkDragMoveHelper.d.ts +28 -0
- package/dist/types/utils/dom.d.ts +18 -0
- package/dist/types/utils/domManipulation.d.ts +5 -0
- package/dist/types/utils/dragMoveHelper.d.ts +7 -0
- package/dist/types/utils/generateBranch.d.ts +27 -0
- package/dist/types/utils/index.d.ts +30 -0
- package/dist/types/utils/layout.d.ts +4 -0
- package/dist/types/utils/objectManipulation.d.ts +7 -0
- package/dist/types/utils/pubsub.d.ts +80 -0
- package/dist/types/utils/svg.d.ts +7 -0
- package/dist/types/utils/theme.d.ts +4 -0
- package/package.json +2 -2
package/dist/MindElixir.iife.js
CHANGED
|
@@ -9,4 +9,4 @@ var MindElixir=function(){"use strict";const Hn="";(function(e){var t,n,o,s,i,r,
|
|
|
9
9
|
|
|
10
10
|
`:t+="".padStart(s-7," ")+"- "+o[i].topic+`
|
|
11
11
|
`,o[i].children&&n(o[i].children||[],s+1)}return n(e.children||[],2),t},getDataString:function(){const e=Ve(this);return JSON.stringify(e,(t,n)=>{if(!(t==="parent"&&typeof n!="string"))return n})},initLeft:function(){this.direction=0,this.refresh()},initRight:function(){this.direction=1,this.refresh()},initSide:function(){this.direction=2,this.refresh()},install:function(e){e(this)},refresh:function(e){e&&(e=JSON.parse(JSON.stringify(e)),this.nodeData=e.nodeData,this.arrows=e.arrows||[],this.summaries=e.summaries||[]),D(this.nodeData),this.layout(),this.linkDiv()},scale:function(e){this.scaleVal=e,this.map.style.transform="scale("+e+")"},selectNode:function(e,t,n){if(e){if(this.clearSelection(),typeof e=="string"){const o=C(e);return o?this.selectNode(o):void 0}e.className="selected",e.scrollIntoView({block:"nearest",inline:"nearest"}),this.currentNode=e,t?this.bus.fire("selectNewNode",e.nodeObj):this.bus.fire("selectNode",e.nodeObj,n)}},selectNodes:function(e){this.clearSelection();for(const t of e)t.className="selected";this.currentNodes=e,this.bus.fire("selectNodes",e.map(t=>t.nodeObj))},setLocale:function(e){this.locale=e,this.refresh()},toCenter:function(){this.container.scrollTo(1e4-this.container.offsetWidth/2,1e4-this.container.offsetHeight/2)},unselectNode:function(){this.currentNode&&(this.currentNode.className=""),this.currentNode=null,this.bus.fire("unselectNode")},unselectNodes:function(){if(this.currentNodes)for(const e of this.currentNodes)e.classList.remove("selected");this.currentNodes=null,this.bus.fire("unselectNodes")}},Symbol.toStringTag,{value:"Module"})),We={create:function(e){return{dom:e,moved:!1,mousedown:!1,handleMouseMove(t){this.mousedown&&(this.moved=!0,this.cb&&this.cb(t.movementX,t.movementY))},handleMouseDown(t){t.button===0&&(this.mousedown=!0)},handleClear(t){this.mousedown=!1},cb:null,init(t,n){this.cb=n,this.handleClear=this.handleClear.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),t.addEventListener("mousemove",this.handleMouseMove),t.addEventListener("mouseleave",this.handleClear),t.addEventListener("mouseup",this.handleClear),this.dom.addEventListener("mousedown",this.handleMouseDown)},destory(t){t.removeEventListener("mousemove",this.handleMouseMove),t.removeEventListener("mouseleave",this.handleClear),t.removeEventListener("mouseup",this.handleClear),this.dom.removeEventListener("mousedown",this.handleMouseDown)},clear(){this.moved=!1,this.mousedown=!1}}}};function ie(e,t,n){const{offsetLeft:o,offsetTop:s}=O(e.nodes,t),i=t.offsetWidth,r=t.offsetHeight,c=o+i/2,l=s+r/2,h=c+n.x,a=l+n.y;return{w:i,h:r,cx:c,cy:l,ctrlX:h,ctrlY:a}}function W(e){let t,n;const o=(e.cy-e.ctrlY)/(e.ctrlX-e.cx);return o>e.h/e.w||o<-e.h/e.w?e.cy-e.ctrlY<0?(t=e.cx-e.h/2/o,n=e.cy+e.h/2):(t=e.cx+e.h/2/o,n=e.cy-e.h/2):e.cx-e.ctrlX<0?(t=e.cx+e.w/2,n=e.cy-e.w*o/2):(t=e.cx-e.w/2,n=e.cy+e.w*o/2),{x:t,y:n}}const rn=function(e,t,n,o){const s=document.createElementNS("http://www.w3.org/2000/svg","text");return N(s,{"text-anchor":"middle",x:t+"",y:n+"",fill:o||"#666"}),s.dataset.type="custom-link",s.innerHTML=e,s},Ue=function(e,t,n,o,s){if(!t||!n)return;performance.now();const i=ie(e,t,o.delta1),r=ie(e,n,o.delta2),{x:c,y:l}=W(i),{ctrlX:h,ctrlY:a}=i,{ctrlX:d,ctrlY:u}=r,{x:g,y:p}=W(r),m=xe(d,u,g,p),f=mt(`M ${c} ${l} C ${h} ${a} ${d} ${u} ${g} ${p}`,`M ${m.x1} ${m.y1} L ${g} ${p} L ${m.x2} ${m.y2}`),v=c/8+h*3/8+d*3/8+g/8,y=l/8+a*3/8+u*3/8+p/8,b=rn(o.label,v,y,e.theme.cssVar["--color"]);f.appendChild(b),f.arrowObj=o,f.dataset.linkid=o.id,e.linkSvgGroup.appendChild(f),s||(e.arrows.push(o),e.currentArrow=f,Xe(e,o,i,r)),performance.now()},cn=function(e,t){const n={id:U(),label:"Custom Link",from:e.nodeObj.id,to:t.nodeObj.id,delta1:{x:0,y:-200},delta2:{x:0,y:-200}};Ue(this,e,t,n),this.bus.fire("operation",{name:"createArrow",obj:n})},ln=function(e){let t;if(e?t=e:t=this.currentArrow,!t)return;Ye(this);const n=t.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),t.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},an=function(e){this.currentArrow=e;const t=e.arrowObj,n=C(t.from),o=C(t.to),s=ie(this,n,t.delta1),i=ie(this,o,t.delta2);Xe(this,t,s,i)},dn=function(){this.currentArrow=null,Ye(this)},Ye=function(e){e.linkController.style.display="none",e.P2.style.display="none",e.P3.style.display="none"},Xe=function(e,t,n,o){var u;e.linkController.style.display="initial",e.P2.style.display="initial",e.P3.style.display="initial",e.nodes.appendChild(e.linkController),e.nodes.appendChild(e.P2),e.nodes.appendChild(e.P3);let{x:s,y:i}=W(n),{ctrlX:r,ctrlY:c}=n,{ctrlX:l,ctrlY:h}=o,{x:a,y:d}=W(o);e.P2.style.cssText=`top:${c}px;left:${r}px;`,e.P3.style.cssText=`top:${h}px;left:${l}px;`,N(e.line1,{x1:s+"",y1:i+"",x2:r+"",y2:c+""}),N(e.line2,{x1:l+"",y1:h+"",x2:a+"",y2:d+""}),e.helper1&&(e.helper1.destory(e.map),(u=e.helper2)==null||u.destory(e.map)),e.helper1=We.create(e.P2),e.helper2=We.create(e.P3),e.helper1.init(e.map,(g,p)=>{var y;r=r+g/e.scaleVal,c=c+p/e.scaleVal;const m=W({...n,ctrlX:r,ctrlY:c});s=m.x,i=m.y;const f=s/8+r*3/8+l*3/8+a/8,v=i/8+c*3/8+h*3/8+d/8;e.P2.style.top=c+"px",e.P2.style.left=r+"px",(y=e.currentArrow)==null||y.children[0].setAttribute("d",`M ${s} ${i} C ${r} ${c} ${l} ${h} ${a} ${d}`),N(e.currentArrow.children[2],{x:f+"",y:v+""}),N(e.line1,{x1:s+"",y1:i+"",x2:r+"",y2:c+""}),t.delta1.x=r-n.cx,t.delta1.y=c-n.cy}),e.helper2.init(e.map,(g,p)=>{var b,x;l=l+g/e.scaleVal,h=h+p/e.scaleVal;const m=W({...o,ctrlX:l,ctrlY:h});a=m.x,d=m.y;const f=s/8+r*3/8+l*3/8+a/8,v=i/8+c*3/8+h*3/8+d/8,y=xe(l,h,a,d);e.P3.style.top=h+"px",e.P3.style.left=l+"px",(b=e.currentArrow)==null||b.children[0].setAttribute("d",`M ${s} ${i} C ${r} ${c} ${l} ${h} ${a} ${d}`),(x=e.currentArrow)==null||x.children[1].setAttribute("d",`M ${y.x1} ${y.y1} L ${a} ${d} L ${y.x2} ${y.y2}`),N(e.currentArrow.children[2],{x:f+"",y:v+""}),N(e.line2,{x1:l+"",y1:h+"",x2:a+"",y2:d+""}),t.delta2.x=l-o.cx,t.delta2.y=h-o.cy})};function hn(){this.linkSvgGroup.innerHTML="";for(let e=0;e<this.arrows.length;e++){const t=this.arrows[e];try{Ue(this,C(t.from),C(t.to),t,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function un(e){if(!e)return;const t=e.children[2];Ce(this,t,n=>{var i;const o=e.arrowObj,s=((i=n.textContent)==null?void 0:i.trim())||"";s===""?o.label=origin:o.label=s,n.remove(),s!==origin&&(t.innerHTML=o.label,this.linkDiv(),this.bus.fire("operation",{name:"finishEditArrowLabel",obj:o}))})}function fn(){this.arrows=this.arrows.filter(e=>ee(e.from,this.nodeData)&&ee(e.to,this.nodeData))}const pn=Object.freeze(Object.defineProperty({__proto__:null,createArrow:cn,editArrowLabel:un,removeArrow:ln,renderArrow:hn,selectArrow:an,tidyArrow:fn,unselectArrow:dn},Symbol.toStringTag,{value:"Module"})),mn=function(e){var l,h;if(e.length===0)throw new Error("No selected node.");if(e.length===1){const a=e[0].nodeObj,d=e[0].nodeObj.parent;if(!d)throw new Error("Can not select root node.");const u=d.children.findIndex(g=>a===g);return{parent:d.id,start:u,end:u}}let t=0;const n=e.map(a=>{let d=a.nodeObj;const u=[];for(;d.parent;){const g=d.parent,p=g.children,m=p==null?void 0:p.indexOf(d);d=g,u.unshift({node:d,index:m})}return u.length>t&&(t=u.length),u});let o=0;e:for(;o<t;o++){const a=(l=n[0][o])==null?void 0:l.node;for(let d=1;d<n.length;d++)if(((h=n[d][o])==null?void 0:h.node)!==a)break e}if(!o)throw new Error("Can not select root node.");const s=n.map(a=>a[o-1].index).sort(),i=s[0]||0,r=s[s.length-1]||0,c=n[0][o-1].node;if(!c.parent)throw new Error("Please select nodes in the same main topic.");return{parent:c.id,start:i,end:r}},gn=function(e){const t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.setAttribute("id",e),t},Ge=function(e,t){const n=document.createElementNS("http://www.w3.org/2000/svg","path");return N(n,{d:e,stroke:t||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Je=function(e,t,n,o,s){const i=document.createElementNS("http://www.w3.org/2000/svg","text");return N(i,{"text-anchor":o,x:t+"",y:n+"",fill:s||"#666"}),i.innerHTML=e,i},vn=e=>C(e).parentElement.parentElement,yn=function({parent:e,start:t}){var i,r;const n=C(e),o=n.nodeObj;let s;return o.parent?s=(i=n.closest("me-main"))==null?void 0:i.className:s=(r=C(o.children[t].id).closest("me-main"))==null?void 0:r.className,s},Ze=function(e,t){var S;const{id:n,text:o,parent:s,start:i,end:r}=t,c=e.nodes,h=C(s).nodeObj,a=yn(t);let d=1/0,u=0,g=0,p=0;for(let R=i;R<=r;R++){const J=(S=h.children)==null?void 0:S[R];if(!J)return e.removeSummary(n),null;const F=vn(J.id),{offsetLeft:le,offsetTop:tt}=O(c,F);R===i&&(g=tt),R===r&&(p=tt+F.offsetHeight),le<d&&(d=le),F.offsetWidth+le>u&&(u=F.offsetWidth+le)}let m,f;const v=g+10,y=p+10,b=(v+y)/2,x=e.theme.cssVar["--color"];a==="lhs"?(m=Ge(`M ${d+10} ${v} c -5 0 -10 5 -10 10 L ${d} ${y-10} c 0 5 5 10 10 10 M ${d} ${b} h -10`,x),f=Je(o,d-20,b+6,"end",x)):(m=Ge(`M ${u-10} ${v} c 5 0 10 5 10 10 L ${u} ${y-10} c 0 5 -5 10 -10 10 M ${u} ${b} h 10`,x),f=Je(o,u+20,b+6,"start",x));const w=gn("s-"+n);return w.appendChild(m),w.appendChild(f),w.summaryObj=t,e.summarySvg.appendChild(w),w},bn=Object.freeze(Object.defineProperty({__proto__:null,createSummary:function(){let e=[];this.currentNode?e=[this.currentNode]:this.currentNodes&&(e=this.currentNodes);const{parent:t,start:n,end:o}=mn(e),s={id:U(),parent:t,start:n,end:o,text:"summary"},i=Ze(this,s);this.summaries.push(s),this.editSummary(i),this.bus.fire("operation",{name:"createSummary",obj:s})},editSummary:function(e){if(!e)return;const t=e.childNodes[1];Ce(this,t,n=>{var i;const o=e.summaryObj,s=((i=n.textContent)==null?void 0:i.trim())||"";s===""?o.text=origin:o.text=s,n.remove(),s!==origin&&(t.innerHTML=o.text,this.linkDiv(),this.bus.fire("operation",{name:"finishEditSummary",obj:o}))})},removeSummary:function(e){var n;const t=this.summaries.findIndex(o=>o.id===e);t>-1&&(this.summaries.splice(t,1),(n=document.querySelector("#s-"+e))==null||n.remove()),this.bus.fire("operation",{name:"removeSummary",obj:{id:e}})},renderSummary:function(){this.summarySvg.innerHTML="",this.summaries.forEach(e=>{try{Ze(this,e)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(e){const t=e.children[1].getBBox(),n=6,o=3,s=document.createElementNS("http://www.w3.org/2000/svg","rect");N(s,{x:t.x-n+"",y:t.y-n+"",width:t.width+n*2+"",height:t.height+n*2+"",rx:o+"",stroke:this.theme.cssVar["--selected"]||"#4dc4ff","stroke-width":"2",fill:"none"}),s.classList.add("selected"),e.appendChild(s),this.currentSummary=e},unselectSummary:function(){var e,t;(t=(e=this.currentSummary)==null?void 0:e.querySelector("rect"))==null||t.remove(),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),M="http://www.w3.org/2000/svg";function xn(e,t){const n=document.createElementNS(M,"svg");return N(n,{version:"1.1",xmlns:M,height:e,width:t}),n}function wn(e,t){return(parseInt(e)-parseInt(t))/2}function En(e,t,n,o){const s=document.createElementNS(M,"g");let i="";return e.text?i=e.text.textContent:i=e.childNodes[0].textContent,i.split(`
|
|
12
|
-
`).forEach((c,l)=>{const h=document.createElementNS(M,"text");N(h,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+wn(t.lineHeight,t.fontSize)*(l+1)+parseFloat(t.fontSize)*(l+1)+"","text-anchor":"start","font-family":t.fontFamily,"font-size":`${t.fontSize}`,"font-weight":`${t.fontWeight}`,fill:`${t.color}`}),h.innerHTML=c,s.appendChild(h)}),s}function Nn(e,t,n,o){var c;let s="";(c=e.nodeObj)!=null&&c.dangerouslySetInnerHTML?s=e.nodeObj.dangerouslySetInnerHTML:e.text?s=e.text.textContent:s=e.childNodes[0].textContent;const i=document.createElementNS(M,"foreignObject");N(i,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+"",width:t.width,height:t.height});const r=document.createElement("div");return N(r,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`}),r.innerHTML=s,i.appendChild(r),i}function Cn(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=O(e.nodes,t),i=document.createElementNS(M,"rect");return N(i,{x:o+"",y:s+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),i}function re(e,t,n=!1){const o=getComputedStyle(t),{offsetLeft:s,offsetTop:i}=O(e.nodes,t),r=document.createElementNS(M,"rect");N(r,{x:s+"",y:i+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const c=document.createElementNS(M,"g");c.appendChild(r);let l;return n?l=Nn(t,o,s,i):l=En(t,o,s,i),c.appendChild(l),c}function Sn(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=O(e.nodes,t),i=document.createElementNS(M,"a"),r=document.createElementNS(M,"text");return N(r,{x:o+"",y:s+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),r.innerHTML=t.textContent,i.appendChild(r),i.setAttribute("href",t.href),i}function _n(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=O(e.nodes,t),i=document.createElementNS(M,"image");return N(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:t.src}),i}const ce=100,Mn='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',Ln=(e,t=!1)=>{var d,u,g;const n=e.nodes,o=n.offsetHeight+ce*2,s=n.offsetWidth+ce*2,i=xn(o+"px",s+"px"),r=document.createElementNS(M,"svg"),c=document.createElementNS(M,"rect");N(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:e.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(p=>{const m=p.cloneNode(!0),{offsetLeft:f,offsetTop:v}=O(n,p.parentElement);m.setAttribute("x",`${f}`),m.setAttribute("y",`${v}`),r.appendChild(m)});const l=(d=n.querySelector(".lines"))==null?void 0:d.cloneNode(!0);l&&r.appendChild(l);const h=(u=n.querySelector(".topiclinks"))==null?void 0:u.cloneNode(!0);h&&r.appendChild(h);const a=(g=n.querySelector(".summary"))==null?void 0:g.cloneNode(!0);return a&&r.appendChild(a),n.querySelectorAll("me-tpc").forEach(p=>{p.nodeObj.dangerouslySetInnerHTML?r.appendChild(re(e,p,!t)):(r.appendChild(Cn(e,p)),r.appendChild(re(e,p.text,!t)))}),n.querySelectorAll(".tags > span").forEach(p=>{r.appendChild(re(e,p))}),n.querySelectorAll(".icons > span").forEach(p=>{r.appendChild(re(e,p))}),n.querySelectorAll(".hyper-link").forEach(p=>{r.appendChild(Sn(e,p))}),n.querySelectorAll("img").forEach(p=>{r.appendChild(_n(e,p))}),N(r,{x:ce+"",y:ce+"",overflow:"visible"}),i.appendChild(r),i},kn=(e,t)=>(t&&e.insertAdjacentHTML("afterbegin","<style>"+t+"</style>"),Mn+e.outerHTML);function Tn(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=s=>{t(s.target.result)},o.onerror=s=>{n(s)},o.readAsDataURL(e)})}const An=Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(e=!1,t){const n=this.exportSvg(e,t),o=await Tn(n);return new Promise((s,i)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const c=document.createElement("canvas");c.width=r.width,c.height=r.height,c.getContext("2d").drawImage(r,0,0),c.toBlob(s,"image/png",1)},r.src=o,r.onerror=i})},exportSvg:function(e=!1,t){const n=Ln(this,e),o=kn(n,t);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"}));function jn(e,t){return async function(...n){const o=this.before[t];o&&!await o.apply(this,n)||e.apply(this,n)}}const Qe=Object.keys(Ke),et={};for(let e=0;e<Qe.length;e++){const t=Qe[e];et[t]=jn(Ke[t],t)}const Dn={getObjById:ee,generateNewObj:st,layout:ct,linkDiv:gt,editTopic:pt,createWrapper:dt,createParent:ht,createChildren:ut,createTopic:ft,findEle:C,changeTheme:Ft,...sn,...et,...pn,...bn,...An,init(e){if(!e||!e.nodeData)return new Error("MindElixir: `data` is required");e.direction!==void 0&&(this.direction=e.direction),this.changeTheme(e.theme||this.theme,!1),this.nodeData=e.nodeData,D(this.nodeData),this.arrows=e.arrows||[],this.summaries=e.summaries||[],this.tidyArrow(),this.toolBar&&jt(this),this.keypress&&Nt(this),this.editable&&Rt(this),nt()&&this.mobileMenu?Ct(this):this.contextMenu&&this.disposable.push(vt(this,this.contextMenuOption)),this.draggable&&Mt(this),this.allowUndo&&kt(this),this.toCenter(),this.layout(),this.linkDiv()},destroy(){var e,t;this.disposable.forEach(n=>n()),(e=this.mindElixirBox)==null||e.remove(),this.mindElixirBox=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNode=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,(t=this.selection)==null||t.destroy(),this.selection=void 0}};function On({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:l,containerHeight:h}){let a=t+n/2;const d=e+o/2;let u;l==="lhs"?u=i+r:u=i;const g=s+c/2,m=(1-Math.abs(g-d)/h)*.25*(n/2);return l==="lhs"?a=a-n/10-m:a=a+n/10+m,`M ${a} ${d} Q ${a} ${g} ${u} ${g}`}function $n({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:l,isFirst:h}){let a=0,d=0;h?a=e+o/2:a=e+o;const u=s+c;let g=0,p=0,m=0;const f=Math.abs(a-u)/300*j;return l==="lhs"?(m=t,g=m+j,p=m-j,d=i+j,`M ${g} ${a} C ${m} ${a} ${m+f} ${u} ${p} ${u} H ${d}`):(m=t+n,g=m-j,p=m+j,d=i+r-j,`M ${g} ${a} C ${m} ${a} ${m-f} ${u} ${p} ${u} H ${d}`)}const Pn="4.1.
|
|
12
|
+
`).forEach((c,l)=>{const h=document.createElementNS(M,"text");N(h,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+wn(t.lineHeight,t.fontSize)*(l+1)+parseFloat(t.fontSize)*(l+1)+"","text-anchor":"start","font-family":t.fontFamily,"font-size":`${t.fontSize}`,"font-weight":`${t.fontWeight}`,fill:`${t.color}`}),h.innerHTML=c,s.appendChild(h)}),s}function Nn(e,t,n,o){var c;let s="";(c=e.nodeObj)!=null&&c.dangerouslySetInnerHTML?s=e.nodeObj.dangerouslySetInnerHTML:e.text?s=e.text.textContent:s=e.childNodes[0].textContent;const i=document.createElementNS(M,"foreignObject");N(i,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+"",width:t.width,height:t.height});const r=document.createElement("div");return N(r,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`}),r.innerHTML=s,i.appendChild(r),i}function Cn(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=O(e.nodes,t),i=document.createElementNS(M,"rect");return N(i,{x:o+"",y:s+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),i}function re(e,t,n=!1){const o=getComputedStyle(t),{offsetLeft:s,offsetTop:i}=O(e.nodes,t),r=document.createElementNS(M,"rect");N(r,{x:s+"",y:i+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const c=document.createElementNS(M,"g");c.appendChild(r);let l;return n?l=Nn(t,o,s,i):l=En(t,o,s,i),c.appendChild(l),c}function Sn(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=O(e.nodes,t),i=document.createElementNS(M,"a"),r=document.createElementNS(M,"text");return N(r,{x:o+"",y:s+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),r.innerHTML=t.textContent,i.appendChild(r),i.setAttribute("href",t.href),i}function _n(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=O(e.nodes,t),i=document.createElementNS(M,"image");return N(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:t.src}),i}const ce=100,Mn='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',Ln=(e,t=!1)=>{var d,u,g;const n=e.nodes,o=n.offsetHeight+ce*2,s=n.offsetWidth+ce*2,i=xn(o+"px",s+"px"),r=document.createElementNS(M,"svg"),c=document.createElementNS(M,"rect");N(c,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:e.theme.cssVar["--bgcolor"]}),i.appendChild(c),n.querySelectorAll(".subLines").forEach(p=>{const m=p.cloneNode(!0),{offsetLeft:f,offsetTop:v}=O(n,p.parentElement);m.setAttribute("x",`${f}`),m.setAttribute("y",`${v}`),r.appendChild(m)});const l=(d=n.querySelector(".lines"))==null?void 0:d.cloneNode(!0);l&&r.appendChild(l);const h=(u=n.querySelector(".topiclinks"))==null?void 0:u.cloneNode(!0);h&&r.appendChild(h);const a=(g=n.querySelector(".summary"))==null?void 0:g.cloneNode(!0);return a&&r.appendChild(a),n.querySelectorAll("me-tpc").forEach(p=>{p.nodeObj.dangerouslySetInnerHTML?r.appendChild(re(e,p,!t)):(r.appendChild(Cn(e,p)),r.appendChild(re(e,p.text,!t)))}),n.querySelectorAll(".tags > span").forEach(p=>{r.appendChild(re(e,p))}),n.querySelectorAll(".icons > span").forEach(p=>{r.appendChild(re(e,p))}),n.querySelectorAll(".hyper-link").forEach(p=>{r.appendChild(Sn(e,p))}),n.querySelectorAll("img").forEach(p=>{r.appendChild(_n(e,p))}),N(r,{x:ce+"",y:ce+"",overflow:"visible"}),i.appendChild(r),i},kn=(e,t)=>(t&&e.insertAdjacentHTML("afterbegin","<style>"+t+"</style>"),Mn+e.outerHTML);function Tn(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=s=>{t(s.target.result)},o.onerror=s=>{n(s)},o.readAsDataURL(e)})}const An=Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(e=!1,t){const n=this.exportSvg(e,t),o=await Tn(n);return new Promise((s,i)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const c=document.createElement("canvas");c.width=r.width,c.height=r.height,c.getContext("2d").drawImage(r,0,0),c.toBlob(s,"image/png",1)},r.src=o,r.onerror=i})},exportSvg:function(e=!1,t){const n=Ln(this,e),o=kn(n,t);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"}));function jn(e,t){return async function(...n){const o=this.before[t];o&&!await o.apply(this,n)||e.apply(this,n)}}const Qe=Object.keys(Ke),et={};for(let e=0;e<Qe.length;e++){const t=Qe[e];et[t]=jn(Ke[t],t)}const Dn={getObjById:ee,generateNewObj:st,layout:ct,linkDiv:gt,editTopic:pt,createWrapper:dt,createParent:ht,createChildren:ut,createTopic:ft,findEle:C,changeTheme:Ft,...sn,...et,...pn,...bn,...An,init(e){if(!e||!e.nodeData)return new Error("MindElixir: `data` is required");e.direction!==void 0&&(this.direction=e.direction),this.changeTheme(e.theme||this.theme,!1),this.nodeData=e.nodeData,D(this.nodeData),this.arrows=e.arrows||[],this.summaries=e.summaries||[],this.tidyArrow(),this.toolBar&&jt(this),this.keypress&&Nt(this),this.editable&&Rt(this),nt()&&this.mobileMenu?Ct(this):this.contextMenu&&this.disposable.push(vt(this,this.contextMenuOption)),this.draggable&&Mt(this),this.allowUndo&&kt(this),this.toCenter(),this.layout(),this.linkDiv()},destroy(){var e,t;this.disposable.forEach(n=>n()),(e=this.mindElixirBox)==null||e.remove(),this.mindElixirBox=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNode=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,(t=this.selection)==null||t.destroy(),this.selection=void 0}};function On({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:l,containerHeight:h}){let a=t+n/2;const d=e+o/2;let u;l==="lhs"?u=i+r:u=i;const g=s+c/2,m=(1-Math.abs(g-d)/h)*.25*(n/2);return l==="lhs"?a=a-n/10-m:a=a+n/10+m,`M ${a} ${d} Q ${a} ${g} ${u} ${g}`}function $n({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:r,cH:c,direction:l,isFirst:h}){let a=0,d=0;h?a=e+o/2:a=e+o;const u=s+c;let g=0,p=0,m=0;const f=Math.abs(a-u)/300*j;return l==="lhs"?(m=t,g=m+j,p=m-j,d=i+j,`M ${g} ${a} C ${m} ${a} ${m+f} ${u} ${p} ${u} H ${d}`):(m=t+n,g=m-j,p=m+j,d=i+r-j,`M ${g} ${a} C ${m} ${a} ${m-f} ${u} ${p} ${u} H ${d}`)}const Pn="4.1.5",G=document;function A({el:e,direction:t,locale:n,draggable:o,editable:s,contextMenu:i,contextMenuOption:r,toolBar:c,keypress:l,mouseSelectionButton:h,before:a,newTopicName:d,allowUndo:u,generateMainBranch:g,generateSubBranch:p,overflowHidden:m,mobileMenu:f,theme:v}){let y=null;const b=Object.prototype.toString.call(e);if(b==="[object HTMLDivElement]"?y=e:b==="[object String]"&&(y=document.querySelector(e)),!y)throw new Error("MindElixir: el is not a valid element");y.className+=" mind-elixir",y.innerHTML="",y.style.setProperty("--gap",j+"px"),this.mindElixirBox=y,this.disposable=[],this.before=a||{},this.locale=n||"en",this.contextMenuOption=r,this.contextMenu=i===void 0?!0:i,this.toolBar=c===void 0?!0:c,this.keypress=l===void 0?!0:l,this.mouseSelectionButton=h||0,this.mobileMenu=f||!1,this.direction=typeof t=="number"?t:1,this.draggable=o===void 0?!0:o,this.newTopicName=d||"new node",this.editable=s===void 0?!0:s,this.allowUndo=u===void 0?!1:u,this.currentNode=null,this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.generateMainBranch=g||On,this.generateSubBranch=p||$n,this.overflowHidden=m||!1,this.bus=rt.create(),this.container=G.createElement("div"),this.container.className="map-container";const x=window.matchMedia("(prefers-color-scheme: dark)");this.theme=v||(x.matches?be:ye);const w=G.createElement("div");w.className="map-canvas",this.map=w,this.map.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.mindElixirBox.appendChild(this.container),this.nodes=G.createElement("me-nodes"),this.nodes.className="main-node-container",this.lines=Y("lines"),this.summarySvg=Y("summary"),this.linkController=Y("linkcontroller"),this.P2=G.createElement("div"),this.P3=G.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=Ne(),this.line2=Ne(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=Y("topiclinks"),this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":it(this)}return A.prototype=Dn,A.LEFT=L,A.RIGHT=P,A.SIDE=Z,A.THEME=ye,A.DARK_THEME=be,A.version=Pn,A.E=C,A.new=e=>({nodeData:{id:U(),topic:e||"new topic",children:[]}}),A}();
|
package/dist/MindElixir.js
CHANGED
|
@@ -2333,7 +2333,7 @@ function go({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction:
|
|
|
2333
2333
|
const f = Math.abs(a - u) / 300 * D;
|
|
2334
2334
|
return l === "lhs" ? (m = t, g = m + D, p = m - D, d = i + D, `M ${g} ${a} C ${m} ${a} ${m + f} ${u} ${p} ${u} H ${d}`) : (m = t + n, g = m - D, p = m + D, d = i + r - D, `M ${g} ${a} C ${m} ${a} ${m - f} ${u} ${p} ${u} H ${d}`);
|
|
2335
2335
|
}
|
|
2336
|
-
const vo = "4.1.
|
|
2336
|
+
const vo = "4.1.5", Y = document;
|
|
2337
2337
|
function A({
|
|
2338
2338
|
el: e,
|
|
2339
2339
|
direction: t,
|
|
@@ -7,4 +7,4 @@ var MindElixirLite=function(){"use strict";const Ht="";(function(e){var t,n,o,s,
|
|
|
7
7
|
|
|
8
8
|
`:t+="".padStart(s-7," ")+"- "+o[i].topic+`
|
|
9
9
|
`,o[i].children&&n(o[i].children||[],s+1)}return n(e.children||[],2),t},getDataString:function(){const e=xe(this);return JSON.stringify(e,(t,n)=>{if(!(t==="parent"&&typeof n!="string"))return n})},initLeft:function(){this.direction=0,this.refresh()},initRight:function(){this.direction=1,this.refresh()},initSide:function(){this.direction=2,this.refresh()},install:function(e){e(this)},refresh:function(e){e&&(e=JSON.parse(JSON.stringify(e)),this.nodeData=e.nodeData,this.arrows=e.arrows||[],this.summaries=e.summaries||[]),ee(this.nodeData),this.layout(),this.linkDiv()},scale:function(e){this.scaleVal=e,this.map.style.transform="scale("+e+")"},selectNode:function(e,t,n){if(e){if(this.clearSelection(),typeof e=="string"){const o=L(e);return o?this.selectNode(o):void 0}e.className="selected",e.scrollIntoView({block:"nearest",inline:"nearest"}),this.currentNode=e,t?this.bus.fire("selectNewNode",e.nodeObj):this.bus.fire("selectNode",e.nodeObj,n)}},selectNodes:function(e){this.clearSelection();for(const t of e)t.className="selected";this.currentNodes=e,this.bus.fire("selectNodes",e.map(t=>t.nodeObj))},setLocale:function(e){this.locale=e,this.refresh()},toCenter:function(){this.container.scrollTo(1e4-this.container.offsetWidth/2,1e4-this.container.offsetHeight/2)},unselectNode:function(){this.currentNode&&(this.currentNode.className=""),this.currentNode=null,this.bus.fire("unselectNode")},unselectNodes:function(){if(this.currentNodes)for(const e of this.currentNodes)e.classList.remove("selected");this.currentNodes=null,this.bus.fire("unselectNodes")}},Symbol.toStringTag,{value:"Module"})),we={create:function(e){return{dom:e,moved:!1,mousedown:!1,handleMouseMove(t){this.mousedown&&(this.moved=!0,this.cb&&this.cb(t.movementX,t.movementY))},handleMouseDown(t){t.button===0&&(this.mousedown=!0)},handleClear(t){this.mousedown=!1},cb:null,init(t,n){this.cb=n,this.handleClear=this.handleClear.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),t.addEventListener("mousemove",this.handleMouseMove),t.addEventListener("mouseleave",this.handleClear),t.addEventListener("mouseup",this.handleClear),this.dom.addEventListener("mousedown",this.handleMouseDown)},destory(t){t.removeEventListener("mousemove",this.handleMouseMove),t.removeEventListener("mouseleave",this.handleClear),t.removeEventListener("mouseup",this.handleClear),this.dom.removeEventListener("mousedown",this.handleMouseDown)},clear(){this.moved=!1,this.mousedown=!1}}}};function Y(e,t,n){const{offsetLeft:o,offsetTop:s}=A(e.nodes,t),i=t.offsetWidth,r=t.offsetHeight,l=o+i/2,c=s+r/2,d=l+n.x,h=c+n.y;return{w:i,h:r,cx:l,cy:c,ctrlX:d,ctrlY:h}}function q(e){let t,n;const o=(e.cy-e.ctrlY)/(e.ctrlX-e.cx);return o>e.h/e.w||o<-e.h/e.w?e.cy-e.ctrlY<0?(t=e.cx-e.h/2/o,n=e.cy+e.h/2):(t=e.cx+e.h/2/o,n=e.cy-e.h/2):e.cx-e.ctrlX<0?(t=e.cx+e.w/2,n=e.cy-e.w*o/2):(t=e.cx-e.w/2,n=e.cy+e.w*o/2),{x:t,y:n}}const it=function(e,t,n,o){const s=document.createElementNS("http://www.w3.org/2000/svg","text");return x(s,{"text-anchor":"middle",x:t+"",y:n+"",fill:o||"#666"}),s.dataset.type="custom-link",s.innerHTML=e,s},_e=function(e,t,n,o,s){if(!t||!n)return;performance.now();const i=Y(e,t,o.delta1),r=Y(e,n,o.delta2),{x:l,y:c}=q(i),{ctrlX:d,ctrlY:h}=i,{ctrlX:a,ctrlY:f}=r,{x:m,y:u}=q(r),p=ie(a,f,m,u),g=Ie(`M ${l} ${c} C ${d} ${h} ${a} ${f} ${m} ${u}`,`M ${p.x1} ${p.y1} L ${m} ${u} L ${p.x2} ${p.y2}`),y=l/8+d*3/8+a*3/8+m/8,v=c/8+h*3/8+f*3/8+u/8,w=it(o.label,y,v,e.theme.cssVar["--color"]);g.appendChild(w),g.arrowObj=o,g.dataset.linkid=o.id,e.linkSvgGroup.appendChild(g),s||(e.arrows.push(o),e.currentArrow=g,Se(e,o,i,r)),performance.now()},rt=function(e,t){const n={id:te(),label:"Custom Link",from:e.nodeObj.id,to:t.nodeObj.id,delta1:{x:0,y:-200},delta2:{x:0,y:-200}};_e(this,e,t,n),this.bus.fire("operation",{name:"createArrow",obj:n})},lt=function(e){let t;if(e?t=e:t=this.currentArrow,!t)return;Ee(this);const n=t.arrowObj.id;this.arrows=this.arrows.filter(o=>o.id!==n),t.remove(),this.bus.fire("operation",{name:"removeArrow",obj:{id:n}})},ct=function(e){this.currentArrow=e;const t=e.arrowObj,n=L(t.from),o=L(t.to),s=Y(this,n,t.delta1),i=Y(this,o,t.delta2);Se(this,t,s,i)},at=function(){this.currentArrow=null,Ee(this)},Ee=function(e){e.linkController.style.display="none",e.P2.style.display="none",e.P3.style.display="none"},Se=function(e,t,n,o){var f;e.linkController.style.display="initial",e.P2.style.display="initial",e.P3.style.display="initial",e.nodes.appendChild(e.linkController),e.nodes.appendChild(e.P2),e.nodes.appendChild(e.P3);let{x:s,y:i}=q(n),{ctrlX:r,ctrlY:l}=n,{ctrlX:c,ctrlY:d}=o,{x:h,y:a}=q(o);e.P2.style.cssText=`top:${l}px;left:${r}px;`,e.P3.style.cssText=`top:${d}px;left:${c}px;`,x(e.line1,{x1:s+"",y1:i+"",x2:r+"",y2:l+""}),x(e.line2,{x1:c+"",y1:d+"",x2:h+"",y2:a+""}),e.helper1&&(e.helper1.destory(e.map),(f=e.helper2)==null||f.destory(e.map)),e.helper1=we.create(e.P2),e.helper2=we.create(e.P3),e.helper1.init(e.map,(m,u)=>{var v;r=r+m/e.scaleVal,l=l+u/e.scaleVal;const p=q({...n,ctrlX:r,ctrlY:l});s=p.x,i=p.y;const g=s/8+r*3/8+c*3/8+h/8,y=i/8+l*3/8+d*3/8+a/8;e.P2.style.top=l+"px",e.P2.style.left=r+"px",(v=e.currentArrow)==null||v.children[0].setAttribute("d",`M ${s} ${i} C ${r} ${l} ${c} ${d} ${h} ${a}`),x(e.currentArrow.children[2],{x:g+"",y:y+""}),x(e.line1,{x1:s+"",y1:i+"",x2:r+"",y2:l+""}),t.delta1.x=r-n.cx,t.delta1.y=l-n.cy}),e.helper2.init(e.map,(m,u)=>{var w,_;c=c+m/e.scaleVal,d=d+u/e.scaleVal;const p=q({...o,ctrlX:c,ctrlY:d});h=p.x,a=p.y;const g=s/8+r*3/8+c*3/8+h/8,y=i/8+l*3/8+d*3/8+a/8,v=ie(c,d,h,a);e.P3.style.top=d+"px",e.P3.style.left=c+"px",(w=e.currentArrow)==null||w.children[0].setAttribute("d",`M ${s} ${i} C ${r} ${l} ${c} ${d} ${h} ${a}`),(_=e.currentArrow)==null||_.children[1].setAttribute("d",`M ${v.x1} ${v.y1} L ${h} ${a} L ${v.x2} ${v.y2}`),x(e.currentArrow.children[2],{x:g+"",y:y+""}),x(e.line2,{x1:c+"",y1:d+"",x2:h+"",y2:a+""}),t.delta2.x=c-o.cx,t.delta2.y=d-o.cy})};function ht(){this.linkSvgGroup.innerHTML="";for(let e=0;e<this.arrows.length;e++){const t=this.arrows[e];try{_e(this,L(t.from),L(t.to),t,!0)}catch{}}this.nodes.appendChild(this.linkSvgGroup)}function dt(e){if(!e)return;const t=e.children[2];de(this,t,n=>{var i;const o=e.arrowObj,s=((i=n.textContent)==null?void 0:i.trim())||"";s===""?o.label=origin:o.label=s,n.remove(),s!==origin&&(t.innerHTML=o.label,this.linkDiv(),this.bus.fire("operation",{name:"finishEditArrowLabel",obj:o}))})}function ut(){this.arrows=this.arrows.filter(e=>F(e.from,this.nodeData)&&F(e.to,this.nodeData))}const ft=Object.freeze(Object.defineProperty({__proto__:null,createArrow:rt,editArrowLabel:dt,removeArrow:lt,renderArrow:ht,selectArrow:ct,tidyArrow:ut,unselectArrow:at},Symbol.toStringTag,{value:"Module"})),pt=function(e){var c,d;if(e.length===0)throw new Error("No selected node.");if(e.length===1){const h=e[0].nodeObj,a=e[0].nodeObj.parent;if(!a)throw new Error("Can not select root node.");const f=a.children.findIndex(m=>h===m);return{parent:a.id,start:f,end:f}}let t=0;const n=e.map(h=>{let a=h.nodeObj;const f=[];for(;a.parent;){const m=a.parent,u=m.children,p=u==null?void 0:u.indexOf(a);a=m,f.unshift({node:a,index:p})}return f.length>t&&(t=f.length),f});let o=0;e:for(;o<t;o++){const h=(c=n[0][o])==null?void 0:c.node;for(let a=1;a<n.length;a++)if(((d=n[a][o])==null?void 0:d.node)!==h)break e}if(!o)throw new Error("Can not select root node.");const s=n.map(h=>h[o-1].index).sort(),i=s[0]||0,r=s[s.length-1]||0,l=n[0][o-1].node;if(!l.parent)throw new Error("Please select nodes in the same main topic.");return{parent:l.id,start:i,end:r}},mt=function(e){const t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.setAttribute("id",e),t},Ce=function(e,t){const n=document.createElementNS("http://www.w3.org/2000/svg","path");return x(n,{d:e,stroke:t||"#666",fill:"none","stroke-linecap":"round","stroke-width":"2"}),n},Le=function(e,t,n,o,s){const i=document.createElementNS("http://www.w3.org/2000/svg","text");return x(i,{"text-anchor":o,x:t+"",y:n+"",fill:s||"#666"}),i.innerHTML=e,i},gt=e=>L(e).parentElement.parentElement,vt=function({parent:e,start:t}){var i,r;const n=L(e),o=n.nodeObj;let s;return o.parent?s=(i=n.closest("me-main"))==null?void 0:i.className:s=(r=L(o.children[t].id).closest("me-main"))==null?void 0:r.className,s},Me=function(e,t){var Te;const{id:n,text:o,parent:s,start:i,end:r}=t,l=e.nodes,d=L(s).nodeObj,h=vt(t);let a=1/0,f=0,m=0,u=0;for(let I=i;I<=r;I++){const Ne=(Te=d.children)==null?void 0:Te[I];if(!Ne)return e.removeSummary(n),null;const U=gt(Ne.id),{offsetLeft:J,offsetTop:Ae}=A(l,U);I===i&&(m=Ae),I===r&&(u=Ae+U.offsetHeight),J<a&&(a=J),U.offsetWidth+J>f&&(f=U.offsetWidth+J)}let p,g;const y=m+10,v=u+10,w=(y+v)/2,_=e.theme.cssVar["--color"];h==="lhs"?(p=Ce(`M ${a+10} ${y} c -5 0 -10 5 -10 10 L ${a} ${v-10} c 0 5 5 10 10 10 M ${a} ${w} h -10`,_),g=Le(o,a-20,w+6,"end",_)):(p=Ce(`M ${f-10} ${y} c 5 0 10 5 10 10 L ${f} ${v-10} c 0 5 -5 10 -10 10 M ${f} ${w} h 10`,_),g=Le(o,f+20,w+6,"start",_));const E=mt("s-"+n);return E.appendChild(p),E.appendChild(g),E.summaryObj=t,e.summarySvg.appendChild(E),E},yt=Object.freeze(Object.defineProperty({__proto__:null,createSummary:function(){let e=[];this.currentNode?e=[this.currentNode]:this.currentNodes&&(e=this.currentNodes);const{parent:t,start:n,end:o}=pt(e),s={id:te(),parent:t,start:n,end:o,text:"summary"},i=Me(this,s);this.summaries.push(s),this.editSummary(i),this.bus.fire("operation",{name:"createSummary",obj:s})},editSummary:function(e){if(!e)return;const t=e.childNodes[1];de(this,t,n=>{var i;const o=e.summaryObj,s=((i=n.textContent)==null?void 0:i.trim())||"";s===""?o.text=origin:o.text=s,n.remove(),s!==origin&&(t.innerHTML=o.text,this.linkDiv(),this.bus.fire("operation",{name:"finishEditSummary",obj:o}))})},removeSummary:function(e){var n;const t=this.summaries.findIndex(o=>o.id===e);t>-1&&(this.summaries.splice(t,1),(n=document.querySelector("#s-"+e))==null||n.remove()),this.bus.fire("operation",{name:"removeSummary",obj:{id:e}})},renderSummary:function(){this.summarySvg.innerHTML="",this.summaries.forEach(e=>{try{Me(this,e)}catch{}}),this.nodes.insertAdjacentElement("beforeend",this.summarySvg)},selectSummary:function(e){const t=e.children[1].getBBox(),n=6,o=3,s=document.createElementNS("http://www.w3.org/2000/svg","rect");x(s,{x:t.x-n+"",y:t.y-n+"",width:t.width+n*2+"",height:t.height+n*2+"",rx:o+"",stroke:this.theme.cssVar["--selected"]||"#4dc4ff","stroke-width":"2",fill:"none"}),s.classList.add("selected"),e.appendChild(s),this.currentSummary=e},unselectSummary:function(){var e,t;(t=(e=this.currentSummary)==null?void 0:e.querySelector("rect"))==null||t.remove(),this.currentSummary=null}},Symbol.toStringTag,{value:"Module"})),C="http://www.w3.org/2000/svg";function bt(e,t){const n=document.createElementNS(C,"svg");return x(n,{version:"1.1",xmlns:C,height:e,width:t}),n}function xt(e,t){return(parseInt(e)-parseInt(t))/2}function wt(e,t,n,o){const s=document.createElementNS(C,"g");let i="";return e.text?i=e.text.textContent:i=e.childNodes[0].textContent,i.split(`
|
|
10
|
-
`).forEach((l,c)=>{const d=document.createElementNS(C,"text");x(d,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+xt(t.lineHeight,t.fontSize)*(c+1)+parseFloat(t.fontSize)*(c+1)+"","text-anchor":"start","font-family":t.fontFamily,"font-size":`${t.fontSize}`,"font-weight":`${t.fontWeight}`,fill:`${t.color}`}),d.innerHTML=l,s.appendChild(d)}),s}function _t(e,t,n,o){var l;let s="";(l=e.nodeObj)!=null&&l.dangerouslySetInnerHTML?s=e.nodeObj.dangerouslySetInnerHTML:e.text?s=e.text.textContent:s=e.childNodes[0].textContent;const i=document.createElementNS(C,"foreignObject");x(i,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+"",width:t.width,height:t.height});const r=document.createElement("div");return x(r,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`}),r.innerHTML=s,i.appendChild(r),i}function Et(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=A(e.nodes,t),i=document.createElementNS(C,"rect");return x(i,{x:o+"",y:s+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),i}function G(e,t,n=!1){const o=getComputedStyle(t),{offsetLeft:s,offsetTop:i}=A(e.nodes,t),r=document.createElementNS(C,"rect");x(r,{x:s+"",y:i+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const l=document.createElementNS(C,"g");l.appendChild(r);let c;return n?c=_t(t,o,s,i):c=wt(t,o,s,i),l.appendChild(c),l}function St(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=A(e.nodes,t),i=document.createElementNS(C,"a"),r=document.createElementNS(C,"text");return x(r,{x:o+"",y:s+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),r.innerHTML=t.textContent,i.appendChild(r),i.setAttribute("href",t.href),i}function Ct(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=A(e.nodes,t),i=document.createElementNS(C,"image");return x(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:t.src}),i}const K=100,Lt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',Mt=(e,t=!1)=>{var a,f,m;const n=e.nodes,o=n.offsetHeight+K*2,s=n.offsetWidth+K*2,i=bt(o+"px",s+"px"),r=document.createElementNS(C,"svg"),l=document.createElementNS(C,"rect");x(l,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:e.theme.cssVar["--bgcolor"]}),i.appendChild(l),n.querySelectorAll(".subLines").forEach(u=>{const p=u.cloneNode(!0),{offsetLeft:g,offsetTop:y}=A(n,u.parentElement);p.setAttribute("x",`${g}`),p.setAttribute("y",`${y}`),r.appendChild(p)});const c=(a=n.querySelector(".lines"))==null?void 0:a.cloneNode(!0);c&&r.appendChild(c);const d=(f=n.querySelector(".topiclinks"))==null?void 0:f.cloneNode(!0);d&&r.appendChild(d);const h=(m=n.querySelector(".summary"))==null?void 0:m.cloneNode(!0);return h&&r.appendChild(h),n.querySelectorAll("me-tpc").forEach(u=>{u.nodeObj.dangerouslySetInnerHTML?r.appendChild(G(e,u,!t)):(r.appendChild(Et(e,u)),r.appendChild(G(e,u.text,!t)))}),n.querySelectorAll(".tags > span").forEach(u=>{r.appendChild(G(e,u))}),n.querySelectorAll(".icons > span").forEach(u=>{r.appendChild(G(e,u))}),n.querySelectorAll(".hyper-link").forEach(u=>{r.appendChild(St(e,u))}),n.querySelectorAll("img").forEach(u=>{r.appendChild(Ct(e,u))}),x(r,{x:K+"",y:K+"",overflow:"visible"}),i.appendChild(r),i},Tt=(e,t)=>(t&&e.insertAdjacentHTML("afterbegin","<style>"+t+"</style>"),Lt+e.outerHTML);function Nt(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=s=>{t(s.target.result)},o.onerror=s=>{n(s)},o.readAsDataURL(e)})}const At={getObjById:F,generateNewObj:$e,layout:He,linkDiv:Fe,editTopic:Re,createWrapper:ze,createParent:Oe,createChildren:je,createTopic:qe,findEle:L,changeTheme:nt,...st,...{},...ft,...yt,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(e=!1,t){const n=this.exportSvg(e,t),o=await Nt(n);return new Promise((s,i)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const l=document.createElement("canvas");l.width=r.width,l.height=r.height,l.getContext("2d").drawImage(r,0,0),l.toBlob(s,"image/png",1)},r.src=o,r.onerror=i})},exportSvg:function(e=!1,t){const n=Mt(this,e),o=Tt(n,t);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"})),init(e){if(!e||!e.nodeData)return new Error("MindElixir: `data` is required");e.direction!==void 0&&(this.direction=e.direction),this.changeTheme(e.theme||this.theme,!1),this.nodeData=e.nodeData,ee(this.nodeData),this.arrows=e.arrows||[],this.summaries=e.summaries||[],this.tidyArrow(),this.toolBar&&Ye(this),this.toCenter(),this.layout(),this.linkDiv()},destroy(){var e,t;this.disposable.forEach(n=>n()),(e=this.mindElixirBox)==null||e.remove(),this.mindElixirBox=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNode=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,(t=this.selection)==null||t.destroy(),this.selection=void 0}};function $t({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:r,cH:l,direction:c,containerHeight:d}){let h=t+n/2;const a=e+o/2;let f;c==="lhs"?f=i+r:f=i;const m=s+l/2,p=(1-Math.abs(m-a)/d)*.25*(n/2);return c==="lhs"?h=h-n/10-p:h=h+n/10+p,`M ${h} ${a} Q ${h} ${m} ${f} ${m}`}function kt({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:r,cH:l,direction:c,isFirst:d}){let h=0,a=0;d?h=e+o/2:h=e+o;const f=s+l;let m=0,u=0,p=0;const g=Math.abs(h-f)/300*N;return c==="lhs"?(p=t,m=p+N,u=p-N,a=i+N,`M ${m} ${h} C ${p} ${h} ${p+g} ${f} ${u} ${f} H ${a}`):(p=t+n,m=p-N,u=p+N,a=i+r-N,`M ${m} ${h} C ${p} ${h} ${p-g} ${f} ${u} ${f} H ${a}`)}const Dt="4.1.
|
|
10
|
+
`).forEach((l,c)=>{const d=document.createElementNS(C,"text");x(d,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+xt(t.lineHeight,t.fontSize)*(c+1)+parseFloat(t.fontSize)*(c+1)+"","text-anchor":"start","font-family":t.fontFamily,"font-size":`${t.fontSize}`,"font-weight":`${t.fontWeight}`,fill:`${t.color}`}),d.innerHTML=l,s.appendChild(d)}),s}function _t(e,t,n,o){var l;let s="";(l=e.nodeObj)!=null&&l.dangerouslySetInnerHTML?s=e.nodeObj.dangerouslySetInnerHTML:e.text?s=e.text.textContent:s=e.childNodes[0].textContent;const i=document.createElementNS(C,"foreignObject");x(i,{x:n+parseInt(t.paddingLeft)+"",y:o+parseInt(t.paddingTop)+"",width:t.width,height:t.height});const r=document.createElement("div");return x(r,{xmlns:"http://www.w3.org/1999/xhtml",style:`font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`}),r.innerHTML=s,i.appendChild(r),i}function Et(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=A(e.nodes,t),i=document.createElementNS(C,"rect");return x(i,{x:o+"",y:s+"",rx:n.borderRadius,ry:n.borderRadius,width:n.width,height:n.height,fill:n.backgroundColor,stroke:n.borderColor,"stroke-width":n.borderWidth}),i}function G(e,t,n=!1){const o=getComputedStyle(t),{offsetLeft:s,offsetTop:i}=A(e.nodes,t),r=document.createElementNS(C,"rect");x(r,{x:s+"",y:i+"",rx:o.borderRadius,ry:o.borderRadius,width:o.width,height:o.height,fill:o.backgroundColor,stroke:o.borderColor,"stroke-width":o.borderWidth});const l=document.createElementNS(C,"g");l.appendChild(r);let c;return n?c=_t(t,o,s,i):c=wt(t,o,s,i),l.appendChild(c),l}function St(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=A(e.nodes,t),i=document.createElementNS(C,"a"),r=document.createElementNS(C,"text");return x(r,{x:o+"",y:s+parseInt(n.fontSize)+"","text-anchor":"start","font-family":n.fontFamily,"font-size":`${n.fontSize}`,"font-weight":`${n.fontWeight}`,fill:`${n.color}`}),r.innerHTML=t.textContent,i.appendChild(r),i.setAttribute("href",t.href),i}function Ct(e,t){const n=getComputedStyle(t),{offsetLeft:o,offsetTop:s}=A(e.nodes,t),i=document.createElementNS(C,"image");return x(i,{x:o+"",y:s+"",width:n.width+"",height:n.height+"",href:t.src}),i}const K=100,Lt='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',Mt=(e,t=!1)=>{var a,f,m;const n=e.nodes,o=n.offsetHeight+K*2,s=n.offsetWidth+K*2,i=bt(o+"px",s+"px"),r=document.createElementNS(C,"svg"),l=document.createElementNS(C,"rect");x(l,{x:"0",y:"0",width:`${s}`,height:`${o}`,fill:e.theme.cssVar["--bgcolor"]}),i.appendChild(l),n.querySelectorAll(".subLines").forEach(u=>{const p=u.cloneNode(!0),{offsetLeft:g,offsetTop:y}=A(n,u.parentElement);p.setAttribute("x",`${g}`),p.setAttribute("y",`${y}`),r.appendChild(p)});const c=(a=n.querySelector(".lines"))==null?void 0:a.cloneNode(!0);c&&r.appendChild(c);const d=(f=n.querySelector(".topiclinks"))==null?void 0:f.cloneNode(!0);d&&r.appendChild(d);const h=(m=n.querySelector(".summary"))==null?void 0:m.cloneNode(!0);return h&&r.appendChild(h),n.querySelectorAll("me-tpc").forEach(u=>{u.nodeObj.dangerouslySetInnerHTML?r.appendChild(G(e,u,!t)):(r.appendChild(Et(e,u)),r.appendChild(G(e,u.text,!t)))}),n.querySelectorAll(".tags > span").forEach(u=>{r.appendChild(G(e,u))}),n.querySelectorAll(".icons > span").forEach(u=>{r.appendChild(G(e,u))}),n.querySelectorAll(".hyper-link").forEach(u=>{r.appendChild(St(e,u))}),n.querySelectorAll("img").forEach(u=>{r.appendChild(Ct(e,u))}),x(r,{x:K+"",y:K+"",overflow:"visible"}),i.appendChild(r),i},Tt=(e,t)=>(t&&e.insertAdjacentHTML("afterbegin","<style>"+t+"</style>"),Lt+e.outerHTML);function Nt(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=s=>{t(s.target.result)},o.onerror=s=>{n(s)},o.readAsDataURL(e)})}const At={getObjById:F,generateNewObj:$e,layout:He,linkDiv:Fe,editTopic:Re,createWrapper:ze,createParent:Oe,createChildren:je,createTopic:qe,findEle:L,changeTheme:nt,...st,...{},...ft,...yt,...Object.freeze(Object.defineProperty({__proto__:null,exportPng:async function(e=!1,t){const n=this.exportSvg(e,t),o=await Nt(n);return new Promise((s,i)=>{const r=new Image;r.setAttribute("crossOrigin","anonymous"),r.onload=()=>{const l=document.createElement("canvas");l.width=r.width,l.height=r.height,l.getContext("2d").drawImage(r,0,0),l.toBlob(s,"image/png",1)},r.src=o,r.onerror=i})},exportSvg:function(e=!1,t){const n=Mt(this,e),o=Tt(n,t);return new Blob([o],{type:"image/svg+xml"})}},Symbol.toStringTag,{value:"Module"})),init(e){if(!e||!e.nodeData)return new Error("MindElixir: `data` is required");e.direction!==void 0&&(this.direction=e.direction),this.changeTheme(e.theme||this.theme,!1),this.nodeData=e.nodeData,ee(this.nodeData),this.arrows=e.arrows||[],this.summaries=e.summaries||[],this.tidyArrow(),this.toolBar&&Ye(this),this.toCenter(),this.layout(),this.linkDiv()},destroy(){var e,t;this.disposable.forEach(n=>n()),(e=this.mindElixirBox)==null||e.remove(),this.mindElixirBox=void 0,this.nodeData=void 0,this.arrows=void 0,this.summaries=void 0,this.currentArrow=void 0,this.currentNode=void 0,this.currentNodes=void 0,this.currentSummary=void 0,this.waitCopy=void 0,this.theme=void 0,this.direction=void 0,this.bus=void 0,this.container=void 0,this.map=void 0,this.lines=void 0,this.linkController=void 0,this.linkSvgGroup=void 0,this.P2=void 0,this.P3=void 0,this.line1=void 0,this.line2=void 0,this.nodes=void 0,(t=this.selection)==null||t.destroy(),this.selection=void 0}};function $t({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:r,cH:l,direction:c,containerHeight:d}){let h=t+n/2;const a=e+o/2;let f;c==="lhs"?f=i+r:f=i;const m=s+l/2,p=(1-Math.abs(m-a)/d)*.25*(n/2);return c==="lhs"?h=h-n/10-p:h=h+n/10+p,`M ${h} ${a} Q ${h} ${m} ${f} ${m}`}function kt({pT:e,pL:t,pW:n,pH:o,cT:s,cL:i,cW:r,cH:l,direction:c,isFirst:d}){let h=0,a=0;d?h=e+o/2:h=e+o;const f=s+l;let m=0,u=0,p=0;const g=Math.abs(h-f)/300*N;return c==="lhs"?(p=t,m=p+N,u=p-N,a=i+N,`M ${m} ${h} C ${p} ${h} ${p+g} ${f} ${u} ${f} H ${a}`):(p=t+n,m=p-N,u=p+N,a=i+r-N,`M ${m} ${h} C ${p} ${h} ${p-g} ${f} ${u} ${f} H ${a}`)}const Dt="4.1.5",V=document;function T({el:e,direction:t,locale:n,draggable:o,editable:s,contextMenu:i,contextMenuOption:r,toolBar:l,keypress:c,mouseSelectionButton:d,before:h,newTopicName:a,allowUndo:f,generateMainBranch:m,generateSubBranch:u,overflowHidden:p,mobileMenu:g,theme:y}){let v=null;const w=Object.prototype.toString.call(e);if(w==="[object HTMLDivElement]"?v=e:w==="[object String]"&&(v=document.querySelector(e)),!v)throw new Error("MindElixir: el is not a valid element");v.className+=" mind-elixir",v.innerHTML="",v.style.setProperty("--gap",N+"px"),this.mindElixirBox=v,this.disposable=[],this.before=h||{},this.locale=n||"en",this.contextMenuOption=r,this.contextMenu=i===void 0?!0:i,this.toolBar=l===void 0?!0:l,this.keypress=c===void 0?!0:c,this.mouseSelectionButton=d||0,this.mobileMenu=g||!1,this.direction=typeof t=="number"?t:1,this.draggable=o===void 0?!0:o,this.newTopicName=a||"new node",this.editable=s===void 0?!0:s,this.allowUndo=f===void 0?!1:f,this.currentNode=null,this.currentArrow=null,this.scaleVal=1,this.tempDirection=null,this.generateMainBranch=m||$t,this.generateSubBranch=u||kt,this.overflowHidden=p||!1,this.bus=De.create(),this.container=V.createElement("div"),this.container.className="map-container";const _=window.matchMedia("(prefers-color-scheme: dark)");this.theme=y||(_.matches?oe:ne);const E=V.createElement("div");E.className="map-canvas",this.map=E,this.map.setAttribute("tabindex","0"),this.container.appendChild(this.map),this.mindElixirBox.appendChild(this.container),this.nodes=V.createElement("me-nodes"),this.nodes.className="main-node-container",this.lines=R("lines"),this.summarySvg=R("summary"),this.linkController=R("linkcontroller"),this.P2=V.createElement("div"),this.P3=V.createElement("div"),this.P2.className=this.P3.className="circle",this.P2.style.display=this.P3.style.display="none",this.line1=he(),this.line2=he(),this.linkController.appendChild(this.line1),this.linkController.appendChild(this.line2),this.linkSvgGroup=R("topiclinks"),this.map.appendChild(this.nodes),this.overflowHidden?this.container.style.overflow="hidden":ke(this)}return T.prototype=At,T.LEFT=P,T.RIGHT=Q,T.SIDE=Z,T.THEME=ne,T.DARK_THEME=oe,T.version=Dt,T.E=L,T}();
|
package/dist/MindElixirLite.js
CHANGED
|
@@ -1522,7 +1522,7 @@ function dn({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction:
|
|
|
1522
1522
|
const g = Math.abs(h - f) / 300 * N;
|
|
1523
1523
|
return c === "lhs" ? (p = t, m = p + N, u = p - N, a = i + N, `M ${m} ${h} C ${p} ${h} ${p + g} ${f} ${u} ${f} H ${a}`) : (p = t + n, m = p - N, u = p + N, a = i + r - N, `M ${m} ${h} C ${p} ${h} ${p - g} ${f} ${u} ${f} H ${a}`);
|
|
1524
1524
|
}
|
|
1525
|
-
const un = "4.1.
|
|
1525
|
+
const un = "4.1.5", V = document;
|
|
1526
1526
|
function $({
|
|
1527
1527
|
el: e,
|
|
1528
1528
|
direction: t,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CustomSvg, Topic } from './types/dom';
|
|
2
|
+
import type { MindElixirInstance, Uid } from './index';
|
|
3
|
+
export type Arrow = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
from: Uid;
|
|
7
|
+
to: Uid;
|
|
8
|
+
delta1: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
delta2: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type DivData = {
|
|
18
|
+
cx: number;
|
|
19
|
+
cy: number;
|
|
20
|
+
w: number;
|
|
21
|
+
h: number;
|
|
22
|
+
ctrlX: number;
|
|
23
|
+
ctrlY: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const createArrow: (this: MindElixirInstance, from: Topic, to: Topic) => void;
|
|
26
|
+
export declare const removeArrow: (this: MindElixirInstance, linkSvg?: CustomSvg) => void;
|
|
27
|
+
export declare const selectArrow: (this: MindElixirInstance, link: CustomSvg) => void;
|
|
28
|
+
export declare const unselectArrow: (this: MindElixirInstance) => void;
|
|
29
|
+
export declare function renderArrow(this: MindElixirInstance): void;
|
|
30
|
+
export declare function editArrowLabel(this: MindElixirInstance, el: CustomSvg): void;
|
|
31
|
+
export declare function tidyArrow(this: MindElixirInstance): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Theme } from '.';
|
|
2
|
+
export declare const LEFT = 0;
|
|
3
|
+
export declare const RIGHT = 1;
|
|
4
|
+
export declare const SIDE = 2;
|
|
5
|
+
export declare const DOWN = 3;
|
|
6
|
+
export declare const GAP = 30;
|
|
7
|
+
export declare const THEME: Theme;
|
|
8
|
+
export declare const DARK_THEME: Theme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Arrow } from './arrow';
|
|
2
|
+
import type methods from './methods';
|
|
3
|
+
import type { MindElixirMethods } from './methods';
|
|
4
|
+
import type { Summary, SummarySvgGroup } from './summary';
|
|
5
|
+
import type { MindElixirData, MindElixirInstance, NodeObj, NodeObjExport, Options, Theme } from './types';
|
|
6
|
+
import type { MainLineParams, SubLineParams } from './utils/generateBranch';
|
|
7
|
+
import type { Locale } from './i18n';
|
|
8
|
+
export { methods, Theme, Options, MindElixirMethods, MindElixirInstance, MindElixirData, NodeObj, NodeObjExport, Summary, SummarySvgGroup, Arrow, MainLineParams, SubLineParams, Locale, };
|
|
9
|
+
export * from './types/dom';
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
nodeData: {
|
|
3
|
+
id: string;
|
|
4
|
+
topic: string;
|
|
5
|
+
children: ({
|
|
6
|
+
topic: string;
|
|
7
|
+
id: string;
|
|
8
|
+
direction: number;
|
|
9
|
+
expanded: boolean;
|
|
10
|
+
children: ({
|
|
11
|
+
topic: string;
|
|
12
|
+
id: string;
|
|
13
|
+
children?: undefined;
|
|
14
|
+
expanded?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
topic: string;
|
|
17
|
+
id: string;
|
|
18
|
+
children: {
|
|
19
|
+
topic: string;
|
|
20
|
+
id: string;
|
|
21
|
+
}[];
|
|
22
|
+
expanded?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
topic: string;
|
|
25
|
+
id: string;
|
|
26
|
+
expanded: boolean;
|
|
27
|
+
children: {
|
|
28
|
+
topic: string;
|
|
29
|
+
id: string;
|
|
30
|
+
}[];
|
|
31
|
+
})[];
|
|
32
|
+
style?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
topic: string;
|
|
35
|
+
id: string;
|
|
36
|
+
direction: number;
|
|
37
|
+
expanded: boolean;
|
|
38
|
+
children: ({
|
|
39
|
+
topic: string;
|
|
40
|
+
id: string;
|
|
41
|
+
style: {
|
|
42
|
+
fontSize: string;
|
|
43
|
+
color: string;
|
|
44
|
+
background?: undefined;
|
|
45
|
+
fontWeight?: undefined;
|
|
46
|
+
};
|
|
47
|
+
tags?: undefined;
|
|
48
|
+
icons?: undefined;
|
|
49
|
+
} | {
|
|
50
|
+
topic: string;
|
|
51
|
+
id: string;
|
|
52
|
+
style: {
|
|
53
|
+
color: string;
|
|
54
|
+
fontSize?: undefined;
|
|
55
|
+
background?: undefined;
|
|
56
|
+
fontWeight?: undefined;
|
|
57
|
+
};
|
|
58
|
+
tags?: undefined;
|
|
59
|
+
icons?: undefined;
|
|
60
|
+
} | {
|
|
61
|
+
topic: string;
|
|
62
|
+
id: string;
|
|
63
|
+
style: {
|
|
64
|
+
color: string;
|
|
65
|
+
background: string;
|
|
66
|
+
fontSize?: undefined;
|
|
67
|
+
fontWeight?: undefined;
|
|
68
|
+
};
|
|
69
|
+
tags?: undefined;
|
|
70
|
+
icons?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
topic: string;
|
|
73
|
+
id: string;
|
|
74
|
+
tags: string[];
|
|
75
|
+
style?: undefined;
|
|
76
|
+
icons?: undefined;
|
|
77
|
+
} | {
|
|
78
|
+
topic: string;
|
|
79
|
+
id: string;
|
|
80
|
+
icons: string[];
|
|
81
|
+
style?: undefined;
|
|
82
|
+
tags?: undefined;
|
|
83
|
+
} | {
|
|
84
|
+
topic: string;
|
|
85
|
+
id: string;
|
|
86
|
+
style: {
|
|
87
|
+
fontWeight: string;
|
|
88
|
+
fontSize?: undefined;
|
|
89
|
+
color?: undefined;
|
|
90
|
+
background?: undefined;
|
|
91
|
+
};
|
|
92
|
+
tags?: undefined;
|
|
93
|
+
icons?: undefined;
|
|
94
|
+
})[];
|
|
95
|
+
style?: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
topic: string;
|
|
98
|
+
id: string;
|
|
99
|
+
direction: number;
|
|
100
|
+
style: {
|
|
101
|
+
background: string;
|
|
102
|
+
};
|
|
103
|
+
expanded: boolean;
|
|
104
|
+
children: {
|
|
105
|
+
topic: string;
|
|
106
|
+
id: string;
|
|
107
|
+
expanded: boolean;
|
|
108
|
+
children: ({
|
|
109
|
+
topic: string;
|
|
110
|
+
id: string;
|
|
111
|
+
expanded: boolean;
|
|
112
|
+
children: never[];
|
|
113
|
+
} | {
|
|
114
|
+
topic: string;
|
|
115
|
+
id: string;
|
|
116
|
+
expanded?: undefined;
|
|
117
|
+
children?: undefined;
|
|
118
|
+
})[];
|
|
119
|
+
}[];
|
|
120
|
+
})[];
|
|
121
|
+
expanded: boolean;
|
|
122
|
+
};
|
|
123
|
+
arrows: never[];
|
|
124
|
+
};
|
|
125
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const katexHTML = "<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>";
|
|
2
|
+
export declare const codeBlock = "<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>\n<span class=\"token function\">alert</span><span class=\"token punctuation\">(</span>message<span class=\"token punctuation\">)</span></code></pre>";
|
|
3
|
+
export declare const styledDiv = "<div><style>.title{font-size:50px}</style><div class=\"title\">Title</div><div style=\"color: red; font-size: 20px;\">Hello world</div></div>";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type LangPack = {
|
|
2
|
+
addChild: string;
|
|
3
|
+
addParent: string;
|
|
4
|
+
addSibling: string;
|
|
5
|
+
removeNode: string;
|
|
6
|
+
focus: string;
|
|
7
|
+
cancelFocus: string;
|
|
8
|
+
moveUp: string;
|
|
9
|
+
moveDown: string;
|
|
10
|
+
link: string;
|
|
11
|
+
clickTips: string;
|
|
12
|
+
summary: string;
|
|
13
|
+
};
|
|
14
|
+
export type Locale = 'cn' | 'zh_CN' | 'zh_TW' | 'en' | 'ru' | 'ja' | 'pt' | 'it' | 'es';
|
|
15
|
+
declare const i18n: Record<Locale, LangPack>;
|
|
16
|
+
export default i18n;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import './index.less';
|
|
2
|
+
import './iconfont/iconfont.js';
|
|
3
|
+
import { LEFT, RIGHT, SIDE, DARK_THEME, THEME } from './const';
|
|
4
|
+
import { findEle } from './utils/dom';
|
|
5
|
+
export * from './types/index';
|
|
6
|
+
export * from './types/dom';
|
|
7
|
+
import type { MindElixirData, MindElixirInstance, MindElixirMethods, Options } from './types/index';
|
|
8
|
+
declare function MindElixir(this: MindElixirInstance, { el, direction, locale, draggable, editable, contextMenu, contextMenuOption, toolBar, keypress, mouseSelectionButton, before, newTopicName, allowUndo, generateMainBranch, generateSubBranch, overflowHidden, mobileMenu, theme, }: Options): void;
|
|
9
|
+
declare namespace MindElixir {
|
|
10
|
+
export var prototype: {
|
|
11
|
+
init(this: MindElixirInstance, data: MindElixirData): Error | undefined;
|
|
12
|
+
destroy(this: Partial<MindElixirInstance>): void;
|
|
13
|
+
exportSvg: (this: MindElixirInstance, noForeignObject?: boolean, injectCss?: string) => Blob;
|
|
14
|
+
exportPng: (this: MindElixirInstance, noForeignObject?: boolean, injectCss?: string) => Promise<Blob | null>;
|
|
15
|
+
createSummary: (this: MindElixirInstance) => void;
|
|
16
|
+
removeSummary: (this: MindElixirInstance, id: string) => void;
|
|
17
|
+
selectSummary: (this: MindElixirInstance, el: import("./summary").SummarySvgGroup) => void;
|
|
18
|
+
unselectSummary: (this: MindElixirInstance) => void;
|
|
19
|
+
renderSummary: (this: MindElixirInstance) => void;
|
|
20
|
+
editSummary: (this: MindElixirInstance, el: import("./summary").SummarySvgGroup) => void;
|
|
21
|
+
renderArrow(this: MindElixirInstance): void;
|
|
22
|
+
editArrowLabel(this: MindElixirInstance, el: import("./types/dom").CustomSvg): void;
|
|
23
|
+
tidyArrow(this: MindElixirInstance): void;
|
|
24
|
+
createArrow: (this: MindElixirInstance, from: import("./types/dom").Topic, to: import("./types/dom").Topic) => void;
|
|
25
|
+
removeArrow: (this: MindElixirInstance, linkSvg?: import("./types/dom").CustomSvg) => void;
|
|
26
|
+
selectArrow: (this: MindElixirInstance, link: import("./types/dom").CustomSvg) => void;
|
|
27
|
+
unselectArrow: (this: MindElixirInstance) => void;
|
|
28
|
+
rmSubline: (this: MindElixirInstance, tpc: import("./types/dom").Topic) => Promise<void>;
|
|
29
|
+
reshapeNode: (this: MindElixirInstance, tpc: import("./types/dom").Topic, patchData: import("./types/index").NodeObj) => Promise<void>;
|
|
30
|
+
insertSibling: (this: MindElixirInstance, type: "before" | "after", el?: import("./types/dom").Topic | undefined, node?: import("./types/index").NodeObj | undefined) => Promise<void>;
|
|
31
|
+
insertParent: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined, node?: import("./types/index").NodeObj | undefined) => Promise<void>;
|
|
32
|
+
addChild: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined, node?: import("./types/index").NodeObj | undefined) => Promise<void>;
|
|
33
|
+
copyNode: (this: MindElixirInstance, node: import("./types/dom").Topic, to: import("./types/dom").Topic) => Promise<void>;
|
|
34
|
+
copyNodes: (this: MindElixirInstance, tpcs: import("./types/dom").Topic[], to: import("./types/dom").Topic) => Promise<void>;
|
|
35
|
+
moveUpNode: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined) => Promise<void>;
|
|
36
|
+
moveDownNode: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined) => Promise<void>;
|
|
37
|
+
removeNode: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined) => Promise<void>;
|
|
38
|
+
removeNodes: (this: MindElixirInstance, tpcs: import("./types/dom").Topic[]) => Promise<void>;
|
|
39
|
+
moveNodeIn: (this: MindElixirInstance, from: import("./types/dom").Topic[], to: import("./types/dom").Topic) => Promise<void>;
|
|
40
|
+
moveNodeBefore: (this: MindElixirInstance, from: import("./types/dom").Topic[], to: import("./types/dom").Topic) => Promise<void>;
|
|
41
|
+
moveNodeAfter: (this: MindElixirInstance, from: import("./types/dom").Topic[], to: import("./types/dom").Topic) => Promise<void>;
|
|
42
|
+
beginEdit: (this: MindElixirInstance, el?: import("./types/dom").Topic | undefined) => Promise<void>;
|
|
43
|
+
setNodeTopic: (this: MindElixirInstance, el: import("./types/dom").Topic, topic: string) => Promise<void>;
|
|
44
|
+
selectNode: (this: MindElixirInstance, targetElement: import("./types/dom").Topic, isNewNode?: boolean, e?: MouseEvent) => void;
|
|
45
|
+
unselectNode: (this: MindElixirInstance) => void;
|
|
46
|
+
selectNodes: (this: MindElixirInstance, tpc: import("./types/dom").Topic[]) => void;
|
|
47
|
+
unselectNodes: (this: MindElixirInstance) => void;
|
|
48
|
+
clearSelection: (this: MindElixirInstance) => void;
|
|
49
|
+
getDataString: (this: MindElixirInstance) => string;
|
|
50
|
+
getData: (this: MindElixirInstance) => MindElixirData;
|
|
51
|
+
getDataMd: (this: MindElixirInstance) => string;
|
|
52
|
+
enableEdit: (this: MindElixirInstance) => void;
|
|
53
|
+
disableEdit: (this: MindElixirInstance) => void;
|
|
54
|
+
scale: (this: MindElixirInstance, scaleVal: number) => void;
|
|
55
|
+
toCenter: (this: MindElixirInstance) => void;
|
|
56
|
+
install: (this: MindElixirInstance, plugin: (instance: MindElixirInstance) => void) => void;
|
|
57
|
+
focusNode: (this: MindElixirInstance, el: import("./types/dom").Topic) => void;
|
|
58
|
+
cancelFocus: (this: MindElixirInstance) => void;
|
|
59
|
+
initLeft: (this: MindElixirInstance) => void;
|
|
60
|
+
initRight: (this: MindElixirInstance) => void;
|
|
61
|
+
initSide: (this: MindElixirInstance) => void;
|
|
62
|
+
setLocale: (this: MindElixirInstance, locale: import("./i18n").Locale) => void;
|
|
63
|
+
expandNode: (this: MindElixirInstance, el: import("./types/dom").Topic, isExpand?: boolean) => void;
|
|
64
|
+
refresh: (this: MindElixirInstance, data?: MindElixirData) => void;
|
|
65
|
+
getObjById: (id: string, data: import("./types/index").NodeObj) => import("./types/index").NodeObj | null;
|
|
66
|
+
generateNewObj: (this: MindElixirInstance) => import("./types/index").NodeObjExport;
|
|
67
|
+
layout: (this: MindElixirInstance) => void;
|
|
68
|
+
linkDiv: (this: MindElixirInstance, mainNode?: import("./types/dom").Wrapper) => void;
|
|
69
|
+
editTopic: (this: MindElixirInstance, el: import("./types/dom").Topic) => void;
|
|
70
|
+
createWrapper: (this: MindElixirInstance, nodeObj: import("./types/index").NodeObj, omitChildren?: boolean) => {
|
|
71
|
+
grp: import("./types/dom").Wrapper;
|
|
72
|
+
top: import("./types/dom").Parent;
|
|
73
|
+
tpc: import("./types/dom").Topic;
|
|
74
|
+
};
|
|
75
|
+
createParent: (this: MindElixirInstance, nodeObj: import("./types/index").NodeObj) => {
|
|
76
|
+
p: import("./types/dom").Parent;
|
|
77
|
+
tpc: import("./types/dom").Topic;
|
|
78
|
+
};
|
|
79
|
+
createChildren: (this: MindElixirInstance, wrappers: import("./types/dom").Wrapper[]) => import("./types/dom").Children;
|
|
80
|
+
createTopic: (this: MindElixirInstance, nodeObj: import("./types/index").NodeObj) => import("./types/dom").Topic;
|
|
81
|
+
findEle: (id: string, instance?: MindElixirInstance) => import("./types/dom").Topic;
|
|
82
|
+
changeTheme: (this: MindElixirInstance, theme: import("./types/index").Theme, shouldRefresh?: boolean) => void;
|
|
83
|
+
};
|
|
84
|
+
export var LEFT: number;
|
|
85
|
+
export var RIGHT: number;
|
|
86
|
+
export var SIDE: number;
|
|
87
|
+
export var THEME: import("./types/index").Theme;
|
|
88
|
+
export var DARK_THEME: import("./types/index").Theme;
|
|
89
|
+
export var version: any;
|
|
90
|
+
export var E: (id: string, instance?: MindElixirInstance) => import("./types/dom").Topic;
|
|
91
|
+
var _a: (topic: string) => MindElixirData;
|
|
92
|
+
export { _a as new };
|
|
93
|
+
}
|
|
94
|
+
export interface MindElixirCtor {
|
|
95
|
+
new (options: Options): MindElixirInstance;
|
|
96
|
+
E: typeof findEle;
|
|
97
|
+
new: typeof MindElixir.new;
|
|
98
|
+
version: string;
|
|
99
|
+
LEFT: typeof LEFT;
|
|
100
|
+
RIGHT: typeof RIGHT;
|
|
101
|
+
SIDE: typeof SIDE;
|
|
102
|
+
THEME: typeof THEME;
|
|
103
|
+
DARK_THEME: typeof DARK_THEME;
|
|
104
|
+
prototype: MindElixirMethods;
|
|
105
|
+
}
|
|
106
|
+
declare const _default: MindElixirCtor;
|
|
107
|
+
export default _default;
|