mind-elixir 3.0.5-beta.1 → 3.1.0

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.
@@ -216,15 +216,16 @@ const $e = (e, t) => {
216
216
  function nt(e) {
217
217
  e.map.addEventListener("click", (t) => {
218
218
  var i;
219
- if (console.log("click", t), A.moved) {
219
+ if (A.moved) {
220
220
  A.clear();
221
221
  return;
222
222
  }
223
+ e.unselectNode(), e.unselectNodes(), e.unselectSummary();
223
224
  const n = t.target;
224
225
  if (n.tagName === "ME-EPD")
225
226
  e.expandNode(n.previousSibling);
226
227
  else if (e.editable)
227
- de(n) ? e.selectNode(n, !1, t) : n.tagName === "text" ? e.selectSummary(n.parentElement) : n.tagName === "path" ? ((i = n == null ? void 0 : n.parentElement) == null ? void 0 : i.tagName) === "g" && e.selectLink(n.parentElement) : n.className === "circle" || (e.unselectNode(), e.unselectNodes(), e.unselectSummary(), e.hideLinkController && e.hideLinkController());
228
+ de(n) ? e.selectNode(n, !1, t) : n.tagName === "text" ? e.selectSummary(n.parentElement) : n.tagName === "path" ? ((i = n == null ? void 0 : n.parentElement) == null ? void 0 : i.tagName) === "g" && e.selectLink(n.parentElement) : n.className === "circle" || e.hideLinkController && e.hideLinkController();
228
229
  else
229
230
  return;
230
231
  }), e.map.addEventListener("dblclick", (t) => {
@@ -423,7 +424,7 @@ const mt = function(e) {
423
424
  if (b && (b.style.top = (b.parentNode.offsetHeight - b.offsetHeight) / 2 + "px", l === "lhs" ? b.style.left = "-10px" : b.style.right = "-10px"), !(e && e !== s) && s.childElementCount) {
424
425
  const N = X("subLines"), v = s.lastChild;
425
426
  v.tagName === "svg" && v.remove(), s.appendChild(N);
426
- const y = s.firstChild, x = s.children[1].children, _ = Pe(x, y, l, !0);
427
+ const y = s.firstChild, E = s.children[1].children, _ = Pe(E, y, l, !0);
427
428
  N.appendChild(ft(_, a));
428
429
  }
429
430
  }
@@ -556,14 +557,14 @@ function yt(e, t) {
556
557
  const n = (v) => {
557
558
  const y = document.createElement("div");
558
559
  return y.innerText = v, y.style.cssText = "position:absolute;bottom:20px;left:50%;transform:translateX(-50%);", y;
559
- }, i = (v, y, x) => {
560
+ }, i = (v, y, E) => {
560
561
  const _ = document.createElement("li");
561
- return _.id = v, _.innerHTML = `<span>${Q(y)}</span><span>${Q(x)}</span>`, _;
562
+ return _.id = v, _.innerHTML = `<span>${Q(y)}</span><span>${Q(E)}</span>`, _;
562
563
  }, s = fe[e.locale] ? e.locale : "en", o = fe[s], r = i("cm-add_child", o.addChild, "tab"), l = i("cm-add_parent", o.addParent, ""), c = i("cm-add_sibling", o.addSibling, "enter"), u = i("cm-remove_child", o.removeNode, "delete"), d = i("cm-fucus", o.focus, ""), h = i("cm-unfucus", o.cancelFocus, ""), a = i("cm-up", o.moveUp, "PgUp"), p = i("cm-down", o.moveDown, "Pgdn"), g = i("cm-down", o.link, ""), m = i("cm-down", o.summary, ""), f = document.createElement("ul");
563
564
  if (f.className = "menu-list", f.appendChild(r), f.appendChild(l), f.appendChild(c), f.appendChild(u), (!t || t.focus) && (f.appendChild(d), f.appendChild(h)), f.appendChild(a), f.appendChild(p), f.appendChild(m), (!t || t.link) && f.appendChild(g), t && t.extend)
564
565
  for (let v = 0; v < t.extend.length; v++) {
565
- const y = t.extend[v], x = i(y.name, y.name, y.key || "");
566
- f.appendChild(x), x.onclick = (_) => {
566
+ const y = t.extend[v], E = i(y.name, y.name, y.key || "");
567
+ f.appendChild(E), E.onclick = (_) => {
567
568
  y.onclick(_);
568
569
  };
569
570
  }
@@ -575,9 +576,9 @@ function yt(e, t) {
575
576
  return;
576
577
  const y = v.target;
577
578
  if (y.tagName === "ME-TPC") {
578
- y.parentElement.tagName === "ME-ROOT" ? N = !0 : N = !1, N ? (d.className = "disabled", a.className = "disabled", p.className = "disabled", l.className = "disabled", c.className = "disabled", u.className = "disabled") : (d.className = "", a.className = "", p.className = "", l.className = "", c.className = "", u.className = ""), e.selectNode(y), b.hidden = !1;
579
- const x = f.offsetHeight, _ = f.offsetWidth;
580
- x + v.clientY > window.innerHeight ? (f.style.top = "", f.style.bottom = "0px") : (f.style.bottom = "", f.style.top = v.clientY + 15 + "px"), _ + v.clientX > window.innerWidth ? (f.style.left = "", f.style.right = "0px") : (f.style.right = "", f.style.left = v.clientX + 10 + "px");
579
+ y.parentElement.tagName === "ME-ROOT" ? N = !0 : N = !1, N ? (d.className = "disabled", a.className = "disabled", p.className = "disabled", l.className = "disabled", c.className = "disabled", u.className = "disabled") : (d.className = "", a.className = "", p.className = "", l.className = "", c.className = "", u.className = ""), e.currentNodes || e.selectNode(y), b.hidden = !1;
580
+ const E = f.offsetHeight, _ = f.offsetWidth;
581
+ E + v.clientY > window.innerHeight ? (f.style.top = "", f.style.bottom = "0px") : (f.style.bottom = "", f.style.top = v.clientY + 15 + "px"), _ + v.clientX > window.innerWidth ? (f.style.left = "", f.style.right = "0px") : (f.style.right = "", f.style.left = v.clientX + 10 + "px");
581
582
  }
582
583
  }, b.onclick = (v) => {
583
584
  v.target === b && (b.hidden = !0);
@@ -602,9 +603,9 @@ function yt(e, t) {
602
603
  const v = e.currentNode, y = n(o.clickTips);
603
604
  e.container.appendChild(y), e.map.addEventListener(
604
605
  "click",
605
- (x) => {
606
- x.preventDefault(), y.remove();
607
- const _ = x.target;
606
+ (E) => {
607
+ E.preventDefault(), y.remove();
608
+ const _ = E.target;
608
609
  _.parentElement.tagName === "ME-PARENT" || _.parentElement.tagName === "ME-ROOT" ? e.createLink(v, e.currentNode) : console.log("link cancel");
609
610
  },
610
611
  {
@@ -612,19 +613,19 @@ function yt(e, t) {
612
613
  }
613
614
  );
614
615
  }, m.onclick = () => {
615
- b.hidden = !0, e.currentNodes && e.currentNodes.length > 1 && (e.createSummary(), e.unselectNodes());
616
+ b.hidden = !0, e.createSummary(), e.unselectNodes();
616
617
  };
617
618
  }
618
619
  const Nt = (e) => {
619
620
  const t = e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");
620
621
  e.selectNode(t[Math.ceil(t.length / 2) - 1]);
621
- }, xt = (e) => {
622
+ }, Et = (e) => {
622
623
  const t = e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");
623
624
  e.selectNode(t[Math.ceil(t.length / 2) - 1]);
624
625
  }, pe = (e) => {
625
626
  e.selectNode(e.map.querySelector("me-root>me-tpc"));
626
627
  };
627
- function Et(e) {
628
+ function xt(e) {
628
629
  const t = {
629
630
  13: () => {
630
631
  e.insertSibling();
@@ -653,7 +654,7 @@ function Et(e) {
653
654
  if (!e.currentNode)
654
655
  return;
655
656
  const n = e.currentNode.nodeObj, i = e.currentNode.offsetParent.offsetParent.parentElement;
656
- n.root ? xt(e) : i.className === "lhs" ? (s = n.parent) != null && s.root ? pe(e) : e.selectParent() : i.className === "rhs" && e.selectFirstChild();
657
+ n.root ? Et(e) : i.className === "lhs" ? (s = n.parent) != null && s.root ? pe(e) : e.selectParent() : i.className === "rhs" && e.selectFirstChild();
657
658
  },
658
659
  33() {
659
660
  e.moveUpNode();
@@ -866,10 +867,10 @@ function Tt(e) {
866
867
  e.container.append(Mt(e)), e.container.append(Lt(e));
867
868
  }
868
869
  /*! @viselect/vanilla v3.3.1 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
869
- var $t = Object.defineProperty, At = (e, t, n) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, E = (e, t, n) => (At(e, typeof t != "symbol" ? t + "" : t, n), n);
870
+ var $t = Object.defineProperty, At = (e, t, n) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, x = (e, t, n) => (At(e, typeof t != "symbol" ? t + "" : t, n), n);
870
871
  class Ot {
871
872
  constructor() {
872
- E(this, "_listeners", /* @__PURE__ */ new Map()), E(this, "on", this.addEventListener), E(this, "off", this.removeEventListener), E(this, "emit", this.dispatchEvent);
873
+ x(this, "_listeners", /* @__PURE__ */ new Map()), x(this, "on", this.addEventListener), x(this, "off", this.removeEventListener), x(this, "emit", this.dispatchEvent);
873
874
  }
874
875
  addEventListener(t, n) {
875
876
  const i = this._listeners.get(t) ?? /* @__PURE__ */ new Set();
@@ -948,7 +949,7 @@ const Pt = () => matchMedia("(hover: none), (pointer: coarse)").matches, jt = ()
948
949
  class He extends Ot {
949
950
  constructor(t) {
950
951
  var n, i, s, o, r;
951
- super(), E(this, "_options"), E(this, "_selection", {
952
+ super(), x(this, "_options"), x(this, "_selection", {
952
953
  stored: [],
953
954
  selected: [],
954
955
  touched: [],
@@ -958,7 +959,7 @@ class He extends Ot {
958
959
  removed: []
959
960
  // Removed elements since last selection
960
961
  }
961
- }), E(this, "_area"), E(this, "_clippingElement"), E(this, "_targetElement"), E(this, "_targetRect"), E(this, "_selectables", []), E(this, "_latestElement"), E(this, "_areaRect", new DOMRect()), E(this, "_areaLocation", { y1: 0, x2: 0, y2: 0, x1: 0 }), E(this, "_singleClick", !0), E(this, "_frame"), E(this, "_scrollAvailable", !0), E(this, "_scrollingActive", !1), E(this, "_scrollSpeed", { x: 0, y: 0 }), E(this, "_scrollDelta", { x: 0, y: 0 }), E(this, "disable", this._bindStartEvents.bind(this, !1)), E(this, "enable", this._bindStartEvents), this._options = {
962
+ }), x(this, "_area"), x(this, "_clippingElement"), x(this, "_targetElement"), x(this, "_targetRect"), x(this, "_selectables", []), x(this, "_latestElement"), x(this, "_areaRect", new DOMRect()), x(this, "_areaLocation", { y1: 0, x2: 0, y2: 0, x1: 0 }), x(this, "_singleClick", !0), x(this, "_frame"), x(this, "_scrollAvailable", !0), x(this, "_scrollingActive", !1), x(this, "_scrollSpeed", { x: 0, y: 0 }), x(this, "_scrollDelta", { x: 0, y: 0 }), x(this, "disable", this._bindStartEvents.bind(this, !1)), x(this, "enable", this._bindStartEvents), this._options = {
962
963
  selectionAreaClass: "selection-area",
963
964
  selectionContainerClass: void 0,
964
965
  selectables: [],
@@ -1130,8 +1131,8 @@ class He extends Ot {
1130
1131
  let { x2: m, y2: f } = n;
1131
1132
  const { behaviour: { scrolling: { startScrollMargins: b } } } = o;
1132
1133
  m < a.left + b.x ? (t.x = u ? -B(a.left - m + b.x) : 0, m = m < a.left ? a.left : m) : m > a.right - b.x ? (t.x = d - u - h ? B(a.left + a.width - m - b.x) : 0, m = m > a.right ? a.right : m) : t.x = 0, f < a.top + b.y ? (t.y = r ? -B(a.top - f + b.y) : 0, f = f < a.top ? a.top : f) : f > a.bottom - b.y ? (t.y = l - r - c ? B(a.top + a.height - f - b.y) : 0, f = f > a.bottom ? a.bottom : f) : t.y = 0;
1133
- const N = ye(p, m), v = ye(g, f), y = ve(p, m), x = ve(g, f);
1134
- i.x = N, i.y = v, i.width = y - N, i.height = x - v;
1134
+ const N = ye(p, m), v = ye(g, f), y = ve(p, m), E = ve(g, f);
1135
+ i.x = N, i.y = v, i.width = y - N, i.height = E - v;
1135
1136
  }
1136
1137
  _redrawSelectionArea() {
1137
1138
  const { x: t, y: n, width: i, height: s } = this._areaRect, { style: o } = this._area;
@@ -1285,7 +1286,7 @@ class He extends Ot {
1285
1286
  ), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)));
1286
1287
  }
1287
1288
  }
1288
- E(He, "version", "3.3.1");
1289
+ x(He, "version", "3.3.1");
1289
1290
  function Ht(e) {
1290
1291
  const t = new He({
1291
1292
  selectables: ["#map me-tpc"],
@@ -1305,18 +1306,9 @@ function Ht(e) {
1305
1306
  // fullscreen containers.
1306
1307
  startScrollMargins: { x: 10, y: 10 }
1307
1308
  }
1308
- },
1309
- features: {
1310
- // Configuration in case a selectable gets just clicked.
1311
- singleTap: {
1312
- // Enable single-click selection (Also disables range-selection via shift + ctrl).
1313
- allow: !0,
1314
- // 'native' (element was mouse-event target) or 'touch' (element visually touched).
1315
- intersect: "native"
1316
- }
1317
1309
  }
1318
- }).on("beforestart", ({ event: n }) => !(n.button !== 0 || n.target.tagName === "ME-TPC" || n.target.id === "input-box")).on("start", ({ store: n, event: i }) => {
1319
- console.log(n, "store"), console.log(i, "event"), !i.ctrlKey && !i.metaKey && (e.unselectNodes(), t.clearSelection(!0, !0));
1310
+ }).on("beforestart", ({ event: n }) => !(n.button !== 0 || n.target.tagName === "ME-TPC" || n.target.id === "input-box")).on("start", ({ event: n }) => {
1311
+ !n.ctrlKey && !n.metaKey && (e.unselectNode(), e.unselectNodes(), e.unselectSummary(), t.clearSelection(!0, !0));
1320
1312
  }).on(
1321
1313
  "move",
1322
1314
  ({
@@ -1687,7 +1679,7 @@ const Rt = function(e, t, n) {
1687
1679
  toObj: i,
1688
1680
  originParentId: s
1689
1681
  }), console.timeEnd("moveNode");
1690
- }, xn = function(e, t) {
1682
+ }, En = function(e, t) {
1691
1683
  var u;
1692
1684
  const n = e.nodeObj, i = t.nodeObj, s = (u = n.parent) == null ? void 0 : u.id;
1693
1685
  et(n, i), T(this.nodeData), ne(e);
@@ -1698,7 +1690,7 @@ const Rt = function(e, t, n) {
1698
1690
  toObj: i,
1699
1691
  originParentId: s
1700
1692
  });
1701
- }, En = function(e, t) {
1693
+ }, xn = function(e, t) {
1702
1694
  var u;
1703
1695
  const n = e.nodeObj, i = t.nodeObj, s = (u = n.parent) == null ? void 0 : u.id;
1704
1696
  tt(n, i), T(this.nodeData), ne(e);
@@ -1724,8 +1716,8 @@ const Rt = function(e, t, n) {
1724
1716
  insertSibling: un,
1725
1717
  moveDownNode: vn,
1726
1718
  moveNode: Nn,
1727
- moveNodeAfter: En,
1728
- moveNodeBefore: xn,
1719
+ moveNodeAfter: xn,
1720
+ moveNodeBefore: En,
1729
1721
  moveUpNode: bn,
1730
1722
  removeNode: yn,
1731
1723
  reshapeNode: hn,
@@ -1763,7 +1755,7 @@ const Rt = function(e, t, n) {
1763
1755
  this.mousedown = !1, this.lastX = 0, this.lastY = 0;
1764
1756
  }
1765
1757
  };
1766
- }, xe = {
1758
+ }, Ee = {
1767
1759
  create: wn
1768
1760
  }, kn = function(e, t, n, i) {
1769
1761
  const s = this.map.getBoundingClientRect();
@@ -1782,7 +1774,7 @@ const Rt = function(e, t, n) {
1782
1774
  cy: d,
1783
1775
  w: r.width,
1784
1776
  h: r.height
1785
- }, b = ie(m, h, a), N = b.x, v = b.y, y = se(f, p, g), x = y.x, _ = y.y, D = Le(p, g, x, _), w = {
1777
+ }, b = ie(m, h, a), N = b.x, v = b.y, y = se(f, p, g), E = y.x, _ = y.y, D = Le(p, g, E, _), w = {
1786
1778
  id: "",
1787
1779
  label: "",
1788
1780
  from: e.nodeObj.id,
@@ -1796,8 +1788,8 @@ const Rt = function(e, t, n) {
1796
1788
  y: g - d
1797
1789
  }
1798
1790
  }, H = pt(
1799
- `M ${N} ${v} C ${h} ${a} ${p} ${g} ${x} ${_}`,
1800
- `M ${D.x1} ${D.y1} L ${x} ${_} L ${D.x2} ${D.y2}`
1791
+ `M ${N} ${v} C ${h} ${a} ${p} ${g} ${E} ${_}`,
1792
+ `M ${D.x1} ${D.y1} L ${E} ${_} L ${D.x2} ${D.y2}`
1801
1793
  );
1802
1794
  n && i ? (w.id = i.id, this.linkData[i.id] = w) : (w.id = K(), this.linkData[w.id] = w, this.currentLink = H), H.linkObj = w, H.dataset.linkid = w.id, this.linkSvgGroup.appendChild(H), n || this.showLinkController(h, a, p, g, w, m, f);
1803
1795
  }, Sn = function(e) {
@@ -1832,7 +1824,7 @@ const Rt = function(e, t, n) {
1832
1824
  let c = l.x, u = l.y;
1833
1825
  const d = se(r, n, i);
1834
1826
  let h = d.x, a = d.y;
1835
- this.P2.style.cssText = `top:${t}px;left:${e}px;`, this.P3.style.cssText = `top:${i}px;left:${n}px;`, this.line1.setAttribute("x1", c), this.line1.setAttribute("y1", u), this.line1.setAttribute("x2", e), this.line1.setAttribute("y2", t), this.line2.setAttribute("x1", n), this.line2.setAttribute("y1", i), this.line2.setAttribute("x2", h), this.line2.setAttribute("y2", a), this.helper1 && (this.helper1.destory(this.map), this.helper2.destory(this.map)), this.helper1 = xe.create(this.P2), this.helper2 = xe.create(this.P3), this.helper1.init(this.map, (p, g) => {
1827
+ this.P2.style.cssText = `top:${t}px;left:${e}px;`, this.P3.style.cssText = `top:${i}px;left:${n}px;`, this.line1.setAttribute("x1", c), this.line1.setAttribute("y1", u), this.line1.setAttribute("x2", e), this.line1.setAttribute("y2", t), this.line2.setAttribute("x1", n), this.line2.setAttribute("y1", i), this.line2.setAttribute("x2", h), this.line2.setAttribute("y2", a), this.helper1 && (this.helper1.destory(this.map), this.helper2.destory(this.map)), this.helper1 = Ee.create(this.P2), this.helper2 = Ee.create(this.P3), this.helper1.init(this.map, (p, g) => {
1836
1828
  var f;
1837
1829
  e = e - p / this.scaleVal, t = t - g / this.scaleVal;
1838
1830
  const m = ie(o, e, t);
@@ -1854,6 +1846,19 @@ const Rt = function(e, t, n) {
1854
1846
  showLinkController: Tn
1855
1847
  }, Symbol.toStringTag, { value: "Module" })), An = function(e) {
1856
1848
  var c, u;
1849
+ if (e.length === 0)
1850
+ throw new Error("No selected node.");
1851
+ if (e.length === 1) {
1852
+ const d = e[0].nodeObj, h = e[0].nodeObj.parent;
1853
+ if (!h)
1854
+ throw new Error("Can not select root node.");
1855
+ const a = h.children.findIndex((p) => d === p);
1856
+ return {
1857
+ parent: h.id,
1858
+ start: a,
1859
+ end: a
1860
+ };
1861
+ }
1857
1862
  let t = 0;
1858
1863
  const n = e.map((d) => {
1859
1864
  let h = d.nodeObj;
@@ -1868,15 +1873,14 @@ const Rt = function(e, t, n) {
1868
1873
  e:
1869
1874
  for (; i < t; i++) {
1870
1875
  const d = (c = n[0][i]) == null ? void 0 : c.node;
1871
- console.log(d);
1872
1876
  for (let h = 1; h < n.length; h++)
1873
1877
  if (((u = n[h][i]) == null ? void 0 : u.node) !== d)
1874
1878
  break e;
1875
1879
  }
1876
- const s = n.map((d) => d[i - 1].index).sort();
1877
- console.log(n, "parentChains");
1878
- const o = s[0] || 0, r = s[s.length - 1] || 0, l = n[0][i - 1].node;
1879
- return console.log(l), {
1880
+ const s = n.map((d) => d[i - 1].index).sort(), o = s[0] || 0, r = s[s.length - 1] || 0, l = n[0][i - 1].node;
1881
+ if (l.root)
1882
+ throw new Error("Please select nodes in the same main topic.");
1883
+ return {
1880
1884
  parent: l.id,
1881
1885
  start: o,
1882
1886
  end: r
@@ -1884,7 +1888,7 @@ const Rt = function(e, t, n) {
1884
1888
  }, On = function(e) {
1885
1889
  const t = document.createElementNS("http://www.w3.org/2000/svg", "g");
1886
1890
  return t.setAttribute("id", e), t;
1887
- }, Ee = function(e, t) {
1891
+ }, xe = function(e, t) {
1888
1892
  const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
1889
1893
  return le(n, {
1890
1894
  d: e,
@@ -1914,14 +1918,14 @@ const Rt = function(e, t, n) {
1914
1918
  }
1915
1919
  let m, f;
1916
1920
  const b = p + 10, N = g + 10, v = (b + N) / 2, y = e.theme.cssVar["--color"];
1917
- u === "lhs" ? (m = Ee(`M ${h + 10} ${b} c -5 0 -10 5 -10 10 L ${h} ${N - 10} c 0 5 5 10 10 10 M ${h} ${v} h -10`, y), f = Ce(i, h - 20, v + 6, "end", y)) : (m = Ee(`M ${a - 10} ${b} c 5 0 10 5 10 10 L ${a} ${N - 10} c 0 5 -5 10 -10 10 M ${a} ${v} h 10`, y), f = Ce(i, a + 20, v + 6, "start", y));
1918
- const x = On("s-" + n);
1919
- return x.appendChild(m), x.appendChild(f), x.summaryObj = t, e.summarySvg.appendChild(x), x;
1921
+ u === "lhs" ? (m = xe(`M ${h + 10} ${b} c -5 0 -10 5 -10 10 L ${h} ${N - 10} c 0 5 5 10 10 10 M ${h} ${v} h -10`, y), f = Ce(i, h - 20, v + 6, "end", y)) : (m = xe(`M ${a - 10} ${b} c 5 0 10 5 10 10 L ${a} ${N - 10} c 0 5 -5 10 -10 10 M ${a} ${v} h 10`, y), f = Ce(i, a + 20, v + 6, "start", y));
1922
+ const E = On("s-" + n);
1923
+ return E.appendChild(m), E.appendChild(f), E.summaryObj = t, e.summarySvg.appendChild(E), E;
1920
1924
  }, jn = function() {
1921
- if (!this.currentNodes)
1922
- return;
1923
- const { parent: e, start: t, end: n } = An(this.currentNodes), i = { id: K(), parent: e, start: t, end: n, text: "summary" }, s = qe(this, i);
1924
- this.summaries.push(i), this.editSummary(s);
1925
+ let e = [];
1926
+ this.currentNode ? e = [this.currentNode] : this.currentNodes && (e = this.currentNodes);
1927
+ const { parent: t, start: n, end: i } = An(e), s = { id: K(), parent: t, start: n, end: i, text: "summary" }, o = qe(this, s);
1928
+ this.summaries.push(s), this.editSummary(o);
1925
1929
  }, Dn = function(e) {
1926
1930
  var n;
1927
1931
  const t = this.summaries.findIndex((i) => i.id === e);
@@ -1969,7 +1973,7 @@ const Rt = function(e, t, n) {
1969
1973
  if (!n)
1970
1974
  return;
1971
1975
  const r = e.summaryObj, l = ((c = n.textContent) == null ? void 0 : c.trim()) || "";
1972
- console.log(l), l === "" ? r.text = i : r.text = l, n.remove(), l !== i && (t.innerHTML = r.text, this.linkDiv(), this.bus.fire("operation", {
1976
+ l === "" ? r.text = i : r.text = l, n.remove(), l !== i && (t.innerHTML = r.text, this.linkDiv(), this.bus.fire("operation", {
1973
1977
  name: "finishEditSummary",
1974
1978
  obj: r,
1975
1979
  origin: i
@@ -2014,7 +2018,7 @@ const Yn = {
2014
2018
  init(e) {
2015
2019
  if (!e || !e.nodeData)
2016
2020
  return new Error("MindElixir: `data` is required");
2017
- e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, T(this.nodeData), this.linkData = e.linkData || {}, this.summaries = e.summaries || [], this.toolBar && Tt(this), this.keypress && Et(this), Ye() && this.mobileMenu ? Ct(this) : this.contextMenu && yt(this, this.contextMenuOption), this.draggable && kt(this), this.allowUndo && St(this), Ht(this), this.toCenter(), this.layout(), this.linkDiv();
2021
+ e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, T(this.nodeData), this.linkData = e.linkData || {}, this.summaries = e.summaries || [], this.toolBar && Tt(this), this.keypress && xt(this), Ye() && this.mobileMenu ? Ct(this) : this.contextMenu && yt(this, this.contextMenuOption), this.draggable && kt(this), this.allowUndo && St(this), Ht(this), this.toCenter(), this.layout(), this.linkDiv();
2018
2022
  }
2019
2023
  }, W = document;
2020
2024
  function $({
@@ -2053,7 +2057,7 @@ $.RIGHT = R;
2053
2057
  $.SIDE = I;
2054
2058
  $.THEME = we;
2055
2059
  $.DARK_THEME = ke;
2056
- $.version = "3.0.5-beta.1";
2060
+ $.version = "3.1.0";
2057
2061
  $.E = C;
2058
2062
  $.new = (e) => ({
2059
2063
  nodeData: {