mind-elixir 5.9.3 → 5.10.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.
@@ -1,72 +1,72 @@
1
- class x {
1
+ class S {
2
2
  node;
3
3
  children = [];
4
4
  // slots[i] represents elements that appear *before* children[i]
5
5
  // slots[children.length] represents elements that appear *after* all children
6
6
  slots;
7
- constructor(e) {
8
- this.node = e;
9
- const s = e.children?.length ?? 0;
10
- this.slots = Array.from({ length: s + 1 }, () => []);
7
+ constructor(o) {
8
+ this.node = o;
9
+ const d = o.children?.length ?? 0;
10
+ this.slots = Array.from({ length: d + 1 }, () => []);
11
11
  }
12
12
  }
13
- function j(a) {
14
- const { nodeData: e, arrows: s = [], summaries: n = [] } = a, o = /* @__PURE__ */ new Map();
15
- function r(t) {
16
- const d = new x(t);
17
- return o.set(t.id, d), t.children && (d.children = t.children.map(r)), d;
13
+ function j(c) {
14
+ const { nodeData: o, arrows: d = [], summaries: e = [] } = c, r = /* @__PURE__ */ new Map();
15
+ function n(t) {
16
+ const s = new S(t);
17
+ return r.set(t.id, s), t.children && (s.children = t.children.map(n)), s;
18
18
  }
19
- const i = r(e), l = [], g = /* @__PURE__ */ new Set();
20
- for (const t of s) {
21
- g.add(t.from), g.add(t.to);
22
- const d = t.metadata, u = d?.parentId, p = d?.index ?? 1 / 0;
23
- if (!u) {
19
+ const i = n(o), l = [], m = /* @__PURE__ */ new Set();
20
+ for (const t of d) {
21
+ m.add(t.from), m.add(t.to);
22
+ const s = t.metadata, p = s?.parentId, y = s?.index ?? 1 / 0;
23
+ if (!p) {
24
24
  l.push(t);
25
25
  continue;
26
26
  }
27
- const w = o.get(u);
28
- if (w) {
29
- const y = Math.min(p, w.children.length);
30
- w.slots[y].push({ type: "arrow", arrow: t });
27
+ const g = r.get(p);
28
+ if (g) {
29
+ const w = Math.min(y, g.children.length);
30
+ g.slots[w].push({ type: "arrow", arrow: t });
31
31
  } else
32
32
  l.push(t);
33
33
  }
34
- for (const t of n) {
35
- const d = o.get(t.parent);
36
- if (d) {
37
- const u = Math.min(t.end + 1, d.children.length);
38
- d.slots[u].push({ type: "summary", summary: t });
34
+ for (const t of e) {
35
+ const s = r.get(t.parent);
36
+ if (s) {
37
+ const p = Math.min(t.end + 1, s.children.length);
38
+ s.slots[p].push({ type: "summary", summary: t });
39
39
  }
40
40
  }
41
- function h(t) {
42
- return o.get(t)?.node.metadata?.refId ?? t;
41
+ function a(t) {
42
+ return r.get(t)?.node.metadata?.refId ?? t;
43
43
  }
44
- const f = [];
45
- function c(t, d) {
46
- const u = " ".repeat(d), p = " ".repeat(d + 1), w = t.node.metadata, y = [t.node.topic], M = w?.refId ?? (g.has(t.node.id) ? t.node.id : void 0);
47
- M && y.push(`[^${M}]`), t.node.style && Object.keys(t.node.style).length > 0 && y.push(JSON.stringify(t.node.style)), f.push(`${u}- ${y.join(" ")}`);
44
+ const h = [];
45
+ function u(t, s) {
46
+ const p = " ".repeat(s), y = " ".repeat(s + 1), g = t.node.metadata, w = [t.node.topic], C = g?.refId ?? (m.has(t.node.id) ? t.node.id : void 0);
47
+ C && w.push(`[^${C}]`), t.node.style && Object.keys(t.node.style).length > 0 && w.push(JSON.stringify(t.node.style)), h.push(`${p}- ${w.join(" ")}`);
48
48
  for (let I = 0; I <= t.children.length; I++) {
49
- for (const C of t.slots[I])
50
- if (C.type === "arrow") {
51
- const m = C.arrow, $ = m.bidirectional ? `<-${m.label ?? ""}->` : `>-${m.label ?? ""}->`;
52
- f.push(`${p}- > [^${h(m.from)}] ${$} [^${h(m.to)}]`);
53
- } else if (C.type === "summary") {
54
- const m = C.summary, $ = m.end - m.start + 1, b = $ === t.children.length ? "" : `:${$} `;
55
- f.push(`${p}- }${b}${m.label}`);
49
+ for (const N of t.slots[I])
50
+ if (N.type === "arrow") {
51
+ const f = N.arrow, x = f.bidirectional ? `<-${f.label ?? ""}->` : `>-${f.label ?? ""}->`, b = f.delta1 ? ` (${f.delta1.x},${f.delta1.y})` : "", M = f.delta2 ? ` (${f.delta2.x},${f.delta2.y})` : "";
52
+ h.push(`${y}- > [^${a(f.from)}]${b} ${x}${M} [^${a(f.to)}]`);
53
+ } else if (N.type === "summary") {
54
+ const f = N.summary, x = f.end - f.start + 1, b = x === t.children.length ? "" : `:${x} `;
55
+ h.push(`${y}- }${b}${f.label}`);
56
56
  }
57
- I < t.children.length && c(t.children[I], d + 1);
57
+ I < t.children.length && u(t.children[I], s + 1);
58
58
  }
59
59
  }
60
- c(i, 0);
60
+ u(i, 0);
61
61
  for (const t of l) {
62
- const d = t.bidirectional ? `<-${t.label ?? ""}->` : `>-${t.label ?? ""}->`;
63
- f.push(`- > [^${h(t.from)}] ${d} [^${h(t.to)}]`);
62
+ const s = t.bidirectional ? `<-${t.label ?? ""}->` : `>-${t.label ?? ""}->`, p = t.delta1 ? ` (${t.delta1.x},${t.delta1.y})` : "", y = t.delta2 ? ` (${t.delta2.x},${t.delta2.y})` : "";
63
+ h.push(`- > [^${a(t.from)}]${p} ${s}${y} [^${a(t.to)}]`);
64
64
  }
65
- return f.join(`
65
+ return h.join(`
66
66
  `) + `
67
67
  `;
68
68
  }
69
- function N() {
69
+ function $() {
70
70
  return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substring(2)).substring(2, 18);
71
71
  }
72
72
  const k = `- Root Node
@@ -94,135 +94,141 @@ const k = `- Root Node
94
94
  - > [^node-2-1] <-Link position is not restricted, as long as the id can be found during rendering-> [^id8]
95
95
 
96
96
  `;
97
- function v(a, e = "Root") {
98
- const s = a.split(`
99
- `).filter((h) => h.trim());
100
- if (s.length === 0)
97
+ function A(c, o = "Root") {
98
+ const d = c.split(`
99
+ `).filter((a) => a.trim());
100
+ if (d.length === 0)
101
101
  throw new Error("Failed to parse plaintext: no root node found");
102
- const n = {
102
+ const e = {
103
103
  arrowLines: [],
104
104
  nodeIdMap: /* @__PURE__ */ new Map()
105
- }, o = [], r = [], i = [];
106
- for (const h of s) {
107
- const f = S(h), c = T(h);
108
- for (; r.length > 0 && r[r.length - 1].indent >= f; )
109
- r.pop();
110
- const t = r.length > 0 ? r[r.length - 1].node : null, d = t ? t.children ??= [] : i;
111
- if (c.type === "arrow") {
112
- n.arrowLines.push({
113
- content: c.content,
105
+ }, r = [], n = [], i = [];
106
+ for (const a of d) {
107
+ const h = v(a), u = T(a);
108
+ for (; n.length > 0 && n[n.length - 1].indent >= h; )
109
+ n.pop();
110
+ const t = n.length > 0 ? n[n.length - 1].node : null, s = t ? t.children ??= [] : i;
111
+ if (u.type === "arrow") {
112
+ e.arrowLines.push({
113
+ content: u.content,
114
114
  parentId: t?.id ?? null,
115
- index: d.length
115
+ index: s.length
116
116
  });
117
117
  continue;
118
118
  }
119
- if (c.type === "summary") {
120
- const w = O(c.content, d, t?.id ?? "");
121
- w && o.push(w);
119
+ if (u.type === "summary") {
120
+ const g = O(u.content, s, t?.id ?? "");
121
+ g && r.push(g);
122
122
  continue;
123
123
  }
124
- const u = N(), p = {
125
- topic: c.topic,
126
- id: u
124
+ const p = $(), y = {
125
+ topic: u.topic,
126
+ id: p
127
127
  };
128
- c.style && (p.style = c.style), c.refId && (n.nodeIdMap.set(c.refId, u), p.metadata = { refId: c.refId }), d.push(p), r.push({ indent: f, node: p });
128
+ u.style && (y.style = u.style), u.refId && (e.nodeIdMap.set(u.refId, p), y.metadata = { refId: u.refId }), s.push(y), n.push({ indent: h, node: y });
129
129
  }
130
130
  if (i.length === 0)
131
131
  throw new Error("Failed to parse plaintext: no root node found");
132
132
  let l;
133
133
  i.length === 1 ? l = i[0] : l = {
134
- topic: e,
135
- id: N(),
134
+ topic: o,
135
+ id: $(),
136
136
  children: i
137
137
  };
138
- const g = n.arrowLines.map(({ content: h, parentId: f, index: c }) => {
139
- const t = R(h, n);
140
- return t && (t.metadata = { parentId: f, index: c }), t;
141
- }).filter((h) => h !== null);
138
+ const m = e.arrowLines.map(({ content: a, parentId: h, index: u }) => {
139
+ const t = R(a, e);
140
+ return t && (t.metadata = { parentId: h, index: u }), t;
141
+ }).filter((a) => a !== null);
142
142
  return {
143
143
  nodeData: l,
144
- arrows: g.length > 0 ? g : void 0,
145
- summaries: o.length > 0 ? o : void 0
144
+ arrows: m.length > 0 ? m : void 0,
145
+ summaries: r.length > 0 ? r : void 0
146
146
  };
147
147
  }
148
- function S(a) {
149
- const e = a.match(/^(\s*)/);
150
- return e ? e[1].length : 0;
148
+ function v(c) {
149
+ const o = c.match(/^(\s*)/);
150
+ return o ? o[1].length : 0;
151
151
  }
152
- function L(a) {
152
+ function L(c) {
153
153
  try {
154
- const e = a.trim().startsWith("{") ? a : `{${a}}`;
155
- return JSON.parse(e);
154
+ const o = c.trim().startsWith("{") ? c : `{${c}}`;
155
+ return JSON.parse(o);
156
156
  } catch {
157
157
  return {};
158
158
  }
159
159
  }
160
- function T(a) {
161
- const s = a.trim().replace(/^-\s*/, "");
162
- if (s.startsWith(">"))
160
+ function T(c) {
161
+ const d = c.trim().replace(/^-\s*/, "");
162
+ if (d.startsWith(">"))
163
163
  return {
164
164
  type: "arrow",
165
165
  topic: "",
166
- content: s.substring(1).trim()
166
+ content: d.substring(1).trim()
167
167
  };
168
- if (s.startsWith("}"))
168
+ if (d.startsWith("}"))
169
169
  return {
170
170
  type: "summary",
171
171
  topic: "",
172
- content: s.substring(1).trim()
172
+ content: d.substring(1).trim()
173
173
  };
174
- let n = s, o, r;
175
- const i = n.match(/\[\^([\w-]+)\]/);
176
- i && (o = i[1], n = n.replace(i[0], "").trim());
177
- const l = n.match(/\{([^}]+)\}/);
178
- return l && (r = L(l[1]), n = n.replace(l[0], "").trim()), {
174
+ let e = d, r, n;
175
+ const i = e.match(/\[\^([\w-]+)\]/);
176
+ i && (r = i[1], e = e.replace(i[0], "").trim());
177
+ const l = e.match(/\{([^}]+)\}/);
178
+ return l && (n = L(l[1]), e = e.replace(l[0], "").trim()), {
179
179
  type: "node",
180
- topic: n,
181
- content: n,
182
- refId: o,
183
- style: r
180
+ topic: e,
181
+ content: e,
182
+ refId: r,
183
+ style: n
184
184
  };
185
185
  }
186
- function R(a, e) {
187
- const s = a.match(/\[\^([\w-]+)\]\s*<-([^-]*)->\s*\[\^([\w-]+)\]/);
188
- if (s) {
189
- const o = s[1], r = s[2].trim(), i = s[3];
186
+ function R(c, o) {
187
+ const d = c.match(
188
+ /\[\^([\w-]+)\](?:\s*\(([\d.-]+),([\d.-]+)\))?\s*<-([^-]*)->(?:\s*\(([\d.-]+),([\d.-]+)\))?\s*\[\^([\w-]+)\]/
189
+ );
190
+ if (d) {
191
+ const r = d[1], n = d[2], i = d[3], l = d[4].trim(), m = d[5], a = d[6], h = d[7];
190
192
  return {
191
- id: N(),
192
- label: r,
193
- from: e.nodeIdMap.get(o) || o,
194
- to: e.nodeIdMap.get(i) || i,
193
+ id: $(),
194
+ label: l,
195
+ from: o.nodeIdMap.get(r) || r,
196
+ to: o.nodeIdMap.get(h) || h,
197
+ delta1: n && i ? { x: Number(n), y: Number(i) } : void 0,
198
+ delta2: m && a ? { x: Number(m), y: Number(a) } : void 0,
195
199
  bidirectional: !0
196
200
  };
197
201
  }
198
- const n = a.match(/\[\^([\w-]+)\]\s*>-([^-]*)->\s*\[\^([\w-]+)\]/);
199
- if (n) {
200
- const o = n[1], r = n[2].trim(), i = n[3];
202
+ const e = c.match(/\[\^([\w-]+)\](?:\s*\(([\d.-]+),([\d.-]+)\))?\s*>-([^-]*)->(?:\s*\(([\d.-]+),([\d.-]+)\))?\s*\[\^([\w-]+)\]/);
203
+ if (e) {
204
+ const r = e[1], n = e[2], i = e[3], l = e[4].trim(), m = e[5], a = e[6], h = e[7];
201
205
  return {
202
- id: N(),
203
- label: r,
204
- from: e.nodeIdMap.get(o) || o,
205
- to: e.nodeIdMap.get(i) || i
206
+ id: $(),
207
+ label: l,
208
+ from: o.nodeIdMap.get(r) || r,
209
+ to: o.nodeIdMap.get(h) || h,
210
+ delta1: n && i ? { x: Number(n), y: Number(i) } : void 0,
211
+ delta2: m && a ? { x: Number(m), y: Number(a) } : void 0
206
212
  };
207
213
  }
208
214
  return null;
209
215
  }
210
- function O(a, e, s) {
211
- const n = a.match(/^:(\d+)\s+(.*)/);
212
- let o, r;
213
- if (n ? (o = parseInt(n[1], 10), r = n[2]) : (o = e.length, r = a.trim()), e.length === 0 || o === 0)
216
+ function O(c, o, d) {
217
+ const e = c.match(/^:(\d+)\s+(.*)/);
218
+ let r, n;
219
+ if (e ? (r = parseInt(e[1], 10), n = e[2]) : (r = o.length, n = c.trim()), o.length === 0 || r === 0)
214
220
  return null;
215
- const i = e.slice(-o), l = e.indexOf(i[0]), g = e.indexOf(i[i.length - 1]);
221
+ const i = o.slice(-r), l = o.indexOf(i[0]), m = o.indexOf(i[i.length - 1]);
216
222
  return {
217
- id: N(),
218
- label: r,
219
- parent: s,
223
+ id: $(),
224
+ label: n,
225
+ parent: d,
220
226
  start: l,
221
- end: g
227
+ end: m
222
228
  };
223
229
  }
224
230
  export {
225
231
  j as mindElixirToPlaintext,
226
232
  k as plaintextExample,
227
- v as plaintextToMindElixir
233
+ A as plaintextToMindElixir
228
234
  };
package/dist/i18n.js ADDED
@@ -0,0 +1,242 @@
1
+ const e = {
2
+ addChild: "插入子节点",
3
+ addParent: "插入父节点",
4
+ addSibling: "插入同级节点",
5
+ removeNode: "删除节点",
6
+ focus: "专注",
7
+ cancelFocus: "取消专注",
8
+ moveUp: "上移",
9
+ moveDown: "下移",
10
+ link: "连接",
11
+ linkBidirectional: "双向连接",
12
+ clickTips: "请点击目标节点",
13
+ summary: "摘要"
14
+ }, i = e, o = {
15
+ addChild: "插入子節點",
16
+ addParent: "插入父節點",
17
+ addSibling: "插入同級節點",
18
+ removeNode: "刪除節點",
19
+ focus: "專注",
20
+ cancelFocus: "取消專注",
21
+ moveUp: "上移",
22
+ moveDown: "下移",
23
+ link: "連接",
24
+ linkBidirectional: "雙向連接",
25
+ clickTips: "請點擊目標節點",
26
+ summary: "摘要"
27
+ }, n = {
28
+ addChild: "Add child",
29
+ addParent: "Add parent",
30
+ addSibling: "Add sibling",
31
+ removeNode: "Remove node",
32
+ focus: "Focus Mode",
33
+ cancelFocus: "Cancel Focus Mode",
34
+ moveUp: "Move up",
35
+ moveDown: "Move down",
36
+ link: "Link",
37
+ linkBidirectional: "Bidirectional Link",
38
+ clickTips: "Please click the target node",
39
+ summary: "Summary"
40
+ }, a = {
41
+ addChild: "Добавить дочерний элемент",
42
+ addParent: "Добавить родительский элемент",
43
+ addSibling: "Добавить на этом уровне",
44
+ removeNode: "Удалить узел",
45
+ focus: "Режим фокусировки",
46
+ cancelFocus: "Отменить режим фокусировки",
47
+ moveUp: "Поднять выше",
48
+ moveDown: "Опустить ниже",
49
+ link: "Ссылка",
50
+ linkBidirectional: "Двунаправленная ссылка",
51
+ clickTips: "Пожалуйста, нажмите на целевой узел",
52
+ summary: "Описание"
53
+ }, d = {
54
+ addChild: "子ノードを追加する",
55
+ addParent: "親ノードを追加します",
56
+ addSibling: "兄弟ノードを追加する",
57
+ removeNode: "ノードを削除",
58
+ focus: "集中",
59
+ cancelFocus: "集中解除",
60
+ moveUp: "上へ移動",
61
+ moveDown: "下へ移動",
62
+ link: "コネクト",
63
+ linkBidirectional: "双方向リンク",
64
+ clickTips: "ターゲットノードをクリックしてください",
65
+ summary: "概要"
66
+ }, l = {
67
+ addChild: "Adicionar item filho",
68
+ addParent: "Adicionar item pai",
69
+ addSibling: "Adicionar item irmao",
70
+ removeNode: "Remover item",
71
+ focus: "Modo Foco",
72
+ cancelFocus: "Cancelar Modo Foco",
73
+ moveUp: "Mover para cima",
74
+ moveDown: "Mover para baixo",
75
+ link: "Link",
76
+ linkBidirectional: "Link bidirecional",
77
+ clickTips: "Favor clicar no item alvo",
78
+ summary: "Resumo"
79
+ }, c = {
80
+ addChild: "Aggiungi figlio",
81
+ addParent: "Aggiungi genitore",
82
+ addSibling: "Aggiungi fratello",
83
+ removeNode: "Rimuovi nodo",
84
+ focus: "Modalità Focus",
85
+ cancelFocus: "Annulla Modalità Focus",
86
+ moveUp: "Sposta su",
87
+ moveDown: "Sposta giù",
88
+ link: "Collega",
89
+ linkBidirectional: "Collegamento bidirezionale",
90
+ clickTips: "Si prega di fare clic sul nodo di destinazione",
91
+ summary: "Unisci nodi"
92
+ }, r = {
93
+ addChild: "Agregar hijo",
94
+ addParent: "Agregar padre",
95
+ addSibling: "Agregar hermano",
96
+ removeNode: "Eliminar nodo",
97
+ focus: "Modo Enfoque",
98
+ cancelFocus: "Cancelar Modo Enfoque",
99
+ moveUp: "Mover hacia arriba",
100
+ moveDown: "Mover hacia abajo",
101
+ link: "Enlace",
102
+ linkBidirectional: "Enlace bidireccional",
103
+ clickTips: "Por favor haga clic en el nodo de destino",
104
+ summary: "Resumen"
105
+ }, s = {
106
+ addChild: "Ajout enfant",
107
+ addParent: "Ajout parent",
108
+ addSibling: "Ajout voisin",
109
+ removeNode: "Supprimer",
110
+ focus: "Cibler",
111
+ cancelFocus: "Retour",
112
+ moveUp: "Monter",
113
+ moveDown: "Descendre",
114
+ link: "Lier",
115
+ linkBidirectional: "Lien bidirectionnel",
116
+ clickTips: "Cliquer sur le noeud cible",
117
+ summary: "Annoter"
118
+ }, t = {
119
+ addChild: "자식 추가",
120
+ addParent: "부모 추가",
121
+ addSibling: "형제 추가",
122
+ removeNode: "노드 삭제",
123
+ focus: "포커스 모드",
124
+ cancelFocus: "포커스 모드 취소",
125
+ moveUp: "위로 이동",
126
+ moveDown: "아래로 이동",
127
+ link: "연결",
128
+ linkBidirectional: "양방향 연결",
129
+ clickTips: "대상 노드를 클릭하십시오",
130
+ summary: "요약"
131
+ }, u = {
132
+ addChild: "Adaugă sub-nod",
133
+ addParent: "Adaugă nod părinte",
134
+ addSibling: "Adaugă nod la același nivel",
135
+ removeNode: "Șterge nodul",
136
+ focus: "Focalizare",
137
+ cancelFocus: "Anulează focalizarea",
138
+ moveUp: "Mută în sus",
139
+ moveDown: "Mută în jos",
140
+ link: "Creează legătură",
141
+ linkBidirectional: "Creează legătură bidirecțională",
142
+ clickTips: "Click pe nodul țintă",
143
+ summary: "Rezumat"
144
+ }, m = {
145
+ addChild: "Tilføj barn",
146
+ addParent: "Tilføj forælder",
147
+ addSibling: "Tilføj søskende",
148
+ removeNode: "Fjern node",
149
+ focus: "Fokus-tilstand",
150
+ cancelFocus: "Annuller fokus-tilstand",
151
+ moveUp: "Flyt op",
152
+ moveDown: "Flyt ned",
153
+ link: "Link",
154
+ linkBidirectional: "To-vejs link",
155
+ clickTips: "Klik på målknuden",
156
+ summary: "Resumé"
157
+ }, k = {
158
+ addChild: "Lisää lapsi",
159
+ addParent: "Lisää vanhempi",
160
+ addSibling: "Lisää sisarus",
161
+ removeNode: "Poista solmu",
162
+ focus: "Kohdistustila",
163
+ cancelFocus: "Peruuta kohdistustila",
164
+ moveUp: "Siirrä ylös",
165
+ moveDown: "Siirrä alas",
166
+ link: "Linkki",
167
+ linkBidirectional: "Kaksisuuntainen linkki",
168
+ clickTips: "Klikkaa kohdesolmua",
169
+ summary: "Yhteenveto"
170
+ }, v = {
171
+ addChild: "Kind hinzufügen",
172
+ addParent: "Eltern hinzufügen",
173
+ addSibling: "Geschwister hinzufügen",
174
+ removeNode: "Knoten entfernen",
175
+ focus: "Fokusmodus",
176
+ cancelFocus: "Fokusmodus abbrechen",
177
+ moveUp: "Nach oben verschieben",
178
+ moveDown: "Nach unten verschieben",
179
+ link: "Link",
180
+ linkBidirectional: "Zweiseitiger Link",
181
+ clickTips: "Bitte klicken Sie auf den Zielknoten",
182
+ summary: "Zusammenfassung"
183
+ }, g = {
184
+ addChild: "Kind toevoegen",
185
+ addParent: "Ouder toevoegen",
186
+ addSibling: "Broer/Zus toevoegen",
187
+ removeNode: "Knoop verwijderen",
188
+ focus: "Focusmodus",
189
+ cancelFocus: "Focusmodus annuleren",
190
+ moveUp: "Omhoog verplaatsen",
191
+ moveDown: "Omlaag verplaatsen",
192
+ link: "Link",
193
+ linkBidirectional: "Bidirectionele link",
194
+ clickTips: "Klik op de doelknoop",
195
+ summary: "Samenvatting"
196
+ }, p = {
197
+ addChild: "Legg til barn",
198
+ addParent: "Legg til forelder",
199
+ addSibling: "Legg til søsken",
200
+ removeNode: "Fjern node",
201
+ focus: "Fokusmodus",
202
+ cancelFocus: "Avbryt fokusmodus",
203
+ moveUp: "Flytt opp",
204
+ moveDown: "Flytt ned",
205
+ link: "Lenke",
206
+ linkBidirectional: "Toveis lenke",
207
+ clickTips: "Klikk på målnoden",
208
+ summary: "Sammendrag"
209
+ }, f = {
210
+ addChild: "Lägg till barn",
211
+ addParent: "Lägg till förälder",
212
+ addSibling: "Lägg till syskon",
213
+ removeNode: "Ta bort nod",
214
+ focus: "Fokusläge",
215
+ cancelFocus: "Avbryt fokusläge",
216
+ moveUp: "Flytta upp",
217
+ moveDown: "Flytta ner",
218
+ link: "Länk",
219
+ linkBidirectional: "Tvåvägslänk",
220
+ clickTips: "Klicka på målnoden",
221
+ summary: "Sammanfattning"
222
+ };
223
+ export {
224
+ e as cn,
225
+ m as da,
226
+ v as de,
227
+ n as en,
228
+ r as es,
229
+ k as fi,
230
+ s as fr,
231
+ c as it,
232
+ d as ja,
233
+ t as ko,
234
+ p as nb,
235
+ g as nl,
236
+ l as pt,
237
+ u as ro,
238
+ a as ru,
239
+ f as sv,
240
+ i as zh_CN,
241
+ o as zh_TW
242
+ };
@@ -4,7 +4,7 @@ import type { MindElixirMethods } from './methods';
4
4
  import type { Summary, SummarySvgGroup } from './summary';
5
5
  import type { MindElixirData, MindElixirInstance, NodeObj, NodeObjExport, Options, Theme, TagObj } from './types';
6
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, TagObj, };
7
+ import type { LangPack } from './i18n';
8
+ export { methods, Theme, Options, MindElixirMethods, MindElixirInstance, MindElixirData, NodeObj, NodeObjExport, Summary, SummarySvgGroup, Arrow, MainLineParams, SubLineParams, LangPack, TagObj, };
9
9
  export type * from './types/dom';
10
10
  export type * from './utils/pubsub';
@@ -1,4 +1,4 @@
1
- type LangPack = {
1
+ export type LangPack = {
2
2
  addChild: string;
3
3
  addParent: string;
4
4
  addSibling: string;
@@ -12,9 +12,21 @@ type LangPack = {
12
12
  clickTips: string;
13
13
  summary: string;
14
14
  };
15
- /**
16
- * @public
17
- */
18
- export type Locale = 'cn' | 'zh_CN' | 'zh_TW' | 'en' | 'ru' | 'ja' | 'pt' | 'it' | 'es' | 'fr' | 'ko' | 'ro';
19
- declare const i18n: Record<Locale, LangPack>;
20
- export default i18n;
15
+ export declare const cn: LangPack;
16
+ export declare const zh_CN: LangPack;
17
+ export declare const zh_TW: LangPack;
18
+ export declare const en: LangPack;
19
+ export declare const ru: LangPack;
20
+ export declare const ja: LangPack;
21
+ export declare const pt: LangPack;
22
+ export declare const it: LangPack;
23
+ export declare const es: LangPack;
24
+ export declare const fr: LangPack;
25
+ export declare const ko: LangPack;
26
+ export declare const ro: LangPack;
27
+ export declare const da: LangPack;
28
+ export declare const fi: LangPack;
29
+ export declare const de: LangPack;
30
+ export declare const nl: LangPack;
31
+ export declare const nb: LangPack;
32
+ export declare const sv: LangPack;
@@ -3,7 +3,7 @@ import './markdown.css';
3
3
  import { LEFT, RIGHT, SIDE, DARK_THEME, THEME } from './const';
4
4
  import type { MindElixirData, MindElixirInstance, MindElixirMethods, Options } from './types/index';
5
5
  import type { Topic } from './docs';
6
- declare function MindElixir(this: MindElixirInstance, { el, direction, locale, editable, contextMenu, toolBar, keypress, mouseSelectionButton, selectionContainer, before, newTopicName, allowUndo, generateMainBranch, generateSubBranch, overflowHidden, theme, alignment, scaleSensitivity, scaleMax, scaleMin, handleWheel, markdown, imageProxy, pasteHandler, }: Options): void;
6
+ declare function MindElixir(this: MindElixirInstance, { el, direction, editable, contextMenu, toolBar, keypress, mouseSelectionButton, selectionContainer, before, newTopicName, allowUndo, generateMainBranch, generateSubBranch, overflowHidden, theme, alignment, scaleSensitivity, scaleMax, scaleMin, handleWheel, markdown, imageProxy, pasteHandler, }: Options): void;
7
7
  declare namespace MindElixir {
8
8
  export var prototype: {
9
9
  init(this: MindElixirInstance, data: MindElixirData): Error | undefined;
@@ -49,8 +49,7 @@ declare namespace MindElixir {
49
49
  getDataString: (this: MindElixirInstance) => string;
50
50
  getData: (this: MindElixirInstance) => MindElixirData;
51
51
  enableEdit: (this: MindElixirInstance) => void;
52
- disableEdit: (// main link container
53
- this: MindElixirInstance) => void;
52
+ disableEdit: (this: MindElixirInstance) => void;
54
53
  scale: (this: MindElixirInstance, scaleVal: number, offset?: {
55
54
  x: number;
56
55
  y: number;
@@ -64,7 +63,6 @@ declare namespace MindElixir {
64
63
  initLeft: (this: MindElixirInstance) => void;
65
64
  initRight: (this: MindElixirInstance) => void;
66
65
  initSide: (this: MindElixirInstance) => void;
67
- setLocale: (this: MindElixirInstance, locale: import("./i18n").Locale) => void;
68
66
  expandNode: (this: MindElixirInstance, el: Topic, isExpand?: boolean) => void;
69
67
  expandNodeAll: (this: MindElixirInstance, el: Topic, isExpand?: boolean) => void;
70
68
  refresh: (this: MindElixirInstance, data?: MindElixirData) => void;
@@ -1,4 +1,3 @@
1
- import type { Locale } from './i18n';
2
1
  import type { Topic } from './types/dom';
3
2
  import type { MindElixirData, MindElixirInstance } from './types/index';
4
3
  export declare const scrollIntoView: (this: MindElixirInstance, el: HTMLElement) => void;
@@ -116,13 +115,6 @@ export declare const initRight: (this: MindElixirInstance) => void;
116
115
  * @memberof MapInteraction
117
116
  */
118
117
  export declare const initSide: (this: MindElixirInstance) => void;
119
- /**
120
- * @function
121
- * @instance
122
- * @name setLocale
123
- * @memberof MapInteraction
124
- */
125
- export declare const setLocale: (this: MindElixirInstance, locale: Locale) => void;
126
118
  export declare const expandNode: (this: MindElixirInstance, el: Topic, isExpand?: boolean) => void;
127
119
  export declare const expandNodeAll: (this: MindElixirInstance, el: Topic, isExpand?: boolean) => void;
128
120
  /**