@etrepum/lexical-builder-markdown 0.0.28-nightly.20240708.0 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -5,39 +5,39 @@ import { $createCodeNode as xe, $isCodeNode as Te } from "@lexical/code";
5
5
  import { $isListNode as L, $isListItemNode as Se } from "@lexical/list";
6
6
  import { $isQuoteNode as Ce } from "@lexical/rich-text";
7
7
  import { $findMatchingParent as Ne, IS_SAFARI as O, IS_IOS as A, IS_APPLE_WEBKIT as B } from "@lexical/utils";
8
- function y(e, t) {
9
- const n = {};
8
+ function y(e, n) {
9
+ const o = {};
10
10
  for (const r of e) {
11
- const i = t(r);
12
- n[i] ? n[i].push(r) : n[i] = [r];
11
+ const i = n(r), t = o[i];
12
+ t ? t.push(r) : o[i] = [r];
13
13
  }
14
- return n;
14
+ return o;
15
15
  }
16
16
  const $ = /[!-/:-@[-`{-~\s]/, Ee = /^\s{0,3}$/;
17
17
  function _(e) {
18
18
  if (!V(e))
19
19
  return !1;
20
- const t = e.getFirstChild();
21
- return t == null || e.getChildrenSize() === 1 && x(t) && Ee.test(t.getTextContent());
20
+ const n = e.getFirstChild();
21
+ return n == null || e.getChildrenSize() === 1 && x(n) && Ee.test(n.getTextContent());
22
22
  }
23
23
  function $e(e) {
24
- return function(...n) {
25
- const r = C(), i = r ? r.clone() : null, o = e(...n), c = C(), s = i && i.is(r) && !Object.isFrozen(r) ? r : i;
26
- return c !== s && Q(s), o;
24
+ return function(...o) {
25
+ const r = C(), i = r ? r.clone() : null, t = e(...o), c = C(), s = i && i.is(r) && !Object.isFrozen(r) ? r : i;
26
+ return c !== s && Q(s), t;
27
27
  };
28
28
  }
29
- function T(e, t, ...n) {
29
+ function T(e, n, ...o) {
30
30
  if (!e)
31
31
  throw new Error(
32
- n.reduce((r, i) => r.replace("%s", String(i)), t || "")
32
+ o.reduce((r, i) => r.replace("%s", String(i)), n || "")
33
33
  );
34
34
  }
35
35
  const D = /^[ \t]*```(\w{1,10})?\s?$/;
36
- function we(e, t) {
37
- const n = _e(
36
+ function we(e, n) {
37
+ const o = _e(
38
38
  e.textFormat
39
39
  );
40
- return function(i, { shouldPreserveNewlines: o } = t) {
40
+ return function(i, { shouldPreserveNewlines: t } = n) {
41
41
  const c = i.split(`
42
42
  `), s = c.length, l = Y();
43
43
  for (let f = 0; f < s; f++) {
@@ -50,7 +50,7 @@ function we(e, t) {
50
50
  m,
51
51
  l,
52
52
  e.element,
53
- n,
53
+ o,
54
54
  e.textMatch
55
55
  );
56
56
  }
@@ -60,14 +60,14 @@ function we(e, t) {
60
60
  N(f),
61
61
  "markdownImport: Expected child of type %s to be an ElementNode",
62
62
  f.getType()
63
- ), (o || !_(f)) && a.push(f);
63
+ ), (t || !_(f)) && a.push(f);
64
64
  return l.clear(), a;
65
65
  };
66
66
  }
67
- function Re(e, t, n, r, i) {
68
- const o = e.trim(), c = J(o), s = Y();
69
- s.append(c), t.append(s);
70
- for (const { regExp: l, replace: a } of n) {
67
+ function Re(e, n, o, r, i) {
68
+ const t = e.trim(), c = J(t), s = Y();
69
+ s.append(c), n.append(s);
70
+ for (const { regExp: l, replace: a } of o) {
71
71
  const f = e.match(l);
72
72
  if (f) {
73
73
  c.setTextContent(e.slice(f[0].length)), a(s, [c], f, !0);
@@ -78,7 +78,7 @@ function Re(e, t, n, r, i) {
78
78
  c,
79
79
  r,
80
80
  i
81
- ), s.isAttached() && o.length > 0) {
81
+ ), s.isAttached() && t.length > 0) {
82
82
  const l = s.getPreviousSibling();
83
83
  if (V(l) || Ce(l) || L(l)) {
84
84
  let a = l;
@@ -93,85 +93,85 @@ function Re(e, t, n, r, i) {
93
93
  }
94
94
  }
95
95
  }
96
- function Me(e, t, n) {
97
- const r = D.exec(e[t]);
96
+ function Me(e, n, o) {
97
+ const r = D.exec(e[n]);
98
98
  if (r) {
99
- let i = t;
100
- const o = e.length;
101
- for (; ++i < o; )
99
+ let i = n;
100
+ const t = e.length;
101
+ for (; ++i < t; )
102
102
  if (D.exec(e[i])) {
103
103
  const s = xe(r[1]), l = J(
104
- e.slice(t + 1, i).join(`
104
+ e.slice(n + 1, i).join(`
105
105
  `)
106
106
  );
107
- return s.append(l), n.append(s), [s, i];
107
+ return s.append(l), o.append(s), [s, i];
108
108
  }
109
109
  }
110
- return [null, t];
110
+ return [null, n];
111
111
  }
112
- function E(e, t, n) {
113
- const r = e.getTextContent(), i = Pe(r, t);
112
+ function E(e, n, o) {
113
+ const r = e.getTextContent(), i = Pe(r, n);
114
114
  if (!i) {
115
- ne(e, n);
115
+ ne(e, o);
116
116
  return;
117
117
  }
118
118
  T(
119
119
  i[1] !== void 0 && i[2] !== void 0,
120
120
  "importTextMatchTransformers: expecting match with two groups"
121
121
  );
122
- let o, c, s;
122
+ let t, c, s;
123
123
  if (i[0] === r)
124
- o = e;
124
+ t = e;
125
125
  else {
126
126
  const a = i.index || 0, f = a + i[0].length;
127
- a === 0 ? [o, c] = e.splitText(f) : [s, o, c] = e.splitText(
127
+ a === 0 ? [t, c] = e.splitText(f) : [s, t, c] = e.splitText(
128
128
  a,
129
129
  f
130
130
  );
131
131
  }
132
132
  T(
133
- o !== void 0,
133
+ t !== void 0,
134
134
  "importTextMatchTransformers: currentNode must be defined"
135
- ), o.setTextContent(i[2]);
136
- const l = t.transformersByTag[i[1]];
135
+ ), t.setTextContent(i[2]);
136
+ const l = n.transformersByTag[i[1]];
137
137
  if (l)
138
138
  for (const a of l.format)
139
- o.hasFormat(a) || o.toggleFormat(a);
140
- o.hasFormat("code") || E(
141
- o,
139
+ t.hasFormat(a) || t.toggleFormat(a);
140
+ t.hasFormat("code") || E(
142
141
  t,
143
- n
142
+ n,
143
+ o
144
144
  ), s && E(
145
145
  s,
146
- t,
147
- n
146
+ n,
147
+ o
148
148
  ), c && E(
149
149
  c,
150
- t,
151
- n
150
+ n,
151
+ o
152
152
  );
153
153
  }
154
- function ne(e, t) {
155
- let n = e;
156
- e: for (; n; ) {
157
- for (const r of t) {
158
- const i = n.getTextContent().match(r.importRegExp);
154
+ function ne(e, n) {
155
+ let o = e;
156
+ e: for (; o; ) {
157
+ for (const r of n) {
158
+ const i = o.getTextContent().match(r.importRegExp);
159
159
  if (!i)
160
160
  continue;
161
- const o = i.index || 0, c = o + i[0].length;
161
+ const t = i.index || 0, c = t + i[0].length;
162
162
  let s, l;
163
- if (o === 0) {
164
- const a = n.splitText(c);
163
+ if (t === 0) {
164
+ const a = o.splitText(c);
165
165
  T(
166
166
  a[0] !== void 0,
167
167
  "importTextMatchTransformers: splitText expected at least one node"
168
- ), [s, n] = a;
168
+ ), [s, o] = a;
169
169
  } else {
170
- const a = n.splitText(o, c);
170
+ const a = o.splitText(t, c);
171
171
  T(
172
172
  a[1] !== void 0,
173
173
  "importTextMatchTransformers: splitText expected at least two nodes"
174
- ), [, s, l] = a, l && ne(l, t);
174
+ ), [, s, l] = a, l && ne(l, n);
175
175
  }
176
176
  r.replace(s, i);
177
177
  continue e;
@@ -179,15 +179,15 @@ function ne(e, t) {
179
179
  break;
180
180
  }
181
181
  }
182
- function Pe(e, t) {
183
- const n = e.match(t.openTagsRegExp);
184
- if (n == null)
182
+ function Pe(e, n) {
183
+ const o = e.match(n.openTagsRegExp);
184
+ if (o == null)
185
185
  return null;
186
- for (const r of n) {
187
- const i = r.replace(/^\s/, ""), o = t.fullMatchRegExpByTag[i];
188
- if (o == null)
186
+ for (const r of o) {
187
+ const i = r.replace(/^\s/, ""), t = n.fullMatchRegExpByTag[i];
188
+ if (t == null)
189
189
  continue;
190
- const c = e.match(o), s = t.transformersByTag[i];
190
+ const c = e.match(t), s = n.transformersByTag[i];
191
191
  if (c != null && s != null) {
192
192
  if (s.intraword !== !1)
193
193
  return c;
@@ -199,34 +199,34 @@ function Pe(e, t) {
199
199
  return null;
200
200
  }
201
201
  function _e(e) {
202
- const t = {}, n = {}, r = [], i = "(?<![\\\\])";
203
- for (const o of e) {
204
- const { tag: c } = o;
205
- t[c] = o;
202
+ const n = {}, o = {}, r = [], i = "(?<![\\\\])";
203
+ for (const t of e) {
204
+ const { tag: c } = t;
205
+ n[c] = t;
206
206
  const s = c.replace(/(\*|\^|\+)/g, "\\$1");
207
- r.push(s), O || A || B ? n[c] = new RegExp(
207
+ r.push(s), O || A || B ? o[c] = new RegExp(
208
208
  `(${s})(?![${s}\\s])(.*?[^${s}\\s])${s}(?!${s})`
209
- ) : n[c] = new RegExp(
209
+ ) : o[c] = new RegExp(
210
210
  `(?<![\\\\${s}])(${s})((\\\\${s})?.*?[^${s}\\s](\\\\${s})?)((?<!\\\\)|(?<=\\\\\\\\))(${s})(?![\\\\${s}])`
211
211
  );
212
212
  }
213
213
  return {
214
214
  // Reg exp to find open tag + content + close tag
215
- fullMatchRegExpByTag: n,
215
+ fullMatchRegExpByTag: o,
216
216
  // Reg exp to find opening tags
217
217
  openTagsRegExp: new RegExp(
218
218
  `${O || A || B ? "" : i}(${r.join("|")})`,
219
219
  "g"
220
220
  ),
221
- transformersByTag: t
221
+ transformersByTag: n
222
222
  };
223
223
  }
224
- function ke(e, { shouldPreserveNewlines: t }) {
225
- const n = !t, r = e.textFormat.filter(
224
+ function ke(e, { shouldPreserveNewlines: n }) {
225
+ const o = !n, r = e.textFormat.filter(
226
226
  (i) => i.format.length === 1
227
227
  );
228
- return function(o = me()) {
229
- const c = [], s = Z(o) ? o.getChildren() : [o];
228
+ return function(t = me()) {
229
+ const c = [], s = Z(t) ? t.getChildren() : [t];
230
230
  for (let l = 0; l < s.length; l++) {
231
231
  const a = s[l], f = Fe(
232
232
  a,
@@ -236,7 +236,7 @@ function ke(e, { shouldPreserveNewlines: t }) {
236
236
  );
237
237
  f != null && c.push(
238
238
  // separate consecutive group of texts with a line break: eg. ["hello", "world"] -> ["hello", "\nworld"]
239
- n && l > 0 && !_(a) && !_(s[l - 1]) ? `
239
+ o && l > 0 && !_(a) && !_(s[l - 1]) ? `
240
240
  `.concat(f) : f
241
241
  );
242
242
  }
@@ -244,92 +244,92 @@ function ke(e, { shouldPreserveNewlines: t }) {
244
244
  `);
245
245
  };
246
246
  }
247
- function Fe(e, t, n, r) {
248
- for (const i of t) {
249
- const o = i.export(
247
+ function Fe(e, n, o, r) {
248
+ for (const i of n) {
249
+ const t = i.export(
250
250
  e,
251
- (c) => w(c, n, r)
251
+ (c) => w(c, o, r)
252
252
  );
253
- if (o != null)
254
- return o;
253
+ if (t != null)
254
+ return t;
255
255
  }
256
- return N(e) ? w(e, n, r) : ee(e) ? e.getTextContent() : null;
256
+ return N(e) ? w(e, o, r) : ee(e) ? e.getTextContent() : null;
257
257
  }
258
- function w(e, t, n) {
258
+ function w(e, n, o) {
259
259
  const r = [], i = e.getChildren();
260
- e: for (const o of i) {
261
- for (const c of n) {
260
+ e: for (const t of i) {
261
+ for (const c of o) {
262
262
  const s = c.export(
263
- o,
263
+ t,
264
264
  (l) => w(
265
265
  l,
266
- t,
267
- n
266
+ n,
267
+ o
268
268
  ),
269
- (l, a) => K(l, a, t)
269
+ (l, a) => K(l, a, n)
270
270
  );
271
271
  if (s != null) {
272
272
  r.push(s);
273
273
  continue e;
274
274
  }
275
275
  }
276
- te(o) ? r.push(`
277
- `) : x(o) ? r.push(
278
- K(o, o.getTextContent(), t)
279
- ) : N(o) ? r.push(
280
- w(o, t, n)
281
- ) : ee(o) && r.push(o.getTextContent());
276
+ te(t) ? r.push(`
277
+ `) : x(t) ? r.push(
278
+ K(t, t.getTextContent(), n)
279
+ ) : N(t) ? r.push(
280
+ w(t, n, o)
281
+ ) : ee(t) && r.push(t.getTextContent());
282
282
  }
283
283
  return r.join("");
284
284
  }
285
- function K(e, t, n) {
286
- const r = t.trim();
285
+ function K(e, n, o) {
286
+ const r = n.trim();
287
287
  let i = r;
288
- const o = /* @__PURE__ */ new Set();
289
- for (const c of n) {
288
+ const t = /* @__PURE__ */ new Set();
289
+ for (const c of o) {
290
290
  const s = c.format[0], l = c.tag;
291
291
  if (T(
292
292
  s !== void 0,
293
293
  "TextFormatTransformer for tag %s has empty format array",
294
294
  l
295
- ), M(e, s) && !o.has(s)) {
296
- o.add(s);
295
+ ), M(e, s) && !t.has(s)) {
296
+ t.add(s);
297
297
  const a = j(e, !0);
298
298
  M(a, s) || (i = l + i);
299
299
  const f = j(e, !1);
300
300
  M(f, s) || (i += l);
301
301
  }
302
302
  }
303
- return t.replace(r, () => i);
303
+ return n.replace(r, () => i);
304
304
  }
305
- function j(e, t) {
306
- let n = t ? e.getPreviousSibling() : e.getNextSibling();
307
- if (!n) {
305
+ function j(e, n) {
306
+ let o = n ? e.getPreviousSibling() : e.getNextSibling();
307
+ if (!o) {
308
308
  const r = e.getParentOrThrow();
309
- r.isInline() && (n = t ? r.getPreviousSibling() : r.getNextSibling());
309
+ r.isInline() && (o = n ? r.getPreviousSibling() : r.getNextSibling());
310
310
  }
311
- for (; n; ) {
312
- if (N(n)) {
313
- if (!n.isInline())
311
+ for (; o; ) {
312
+ if (N(o)) {
313
+ if (!o.isInline())
314
314
  break;
315
- const r = t ? n.getLastDescendant() : n.getFirstDescendant();
315
+ const r = n ? o.getLastDescendant() : o.getFirstDescendant();
316
316
  if (x(r))
317
317
  return r;
318
- n = t ? n.getPreviousSibling() : n.getNextSibling();
318
+ o = n ? o.getPreviousSibling() : o.getNextSibling();
319
319
  }
320
- if (x(n))
321
- return n;
322
- if (!N(n))
320
+ if (x(o))
321
+ return o;
322
+ if (!N(o))
323
323
  return null;
324
324
  }
325
325
  return null;
326
326
  }
327
- function M(e, t) {
328
- return x(e) && e.hasFormat(t);
327
+ function M(e, n) {
328
+ return x(e) && e.hasFormat(n);
329
329
  }
330
- function z({ nodes: e }, t) {
331
- const n = e.has.bind(e);
332
- return t.filter((r) => r.dependencies.every(n));
330
+ function z({ nodes: e }, n) {
331
+ const o = e.has.bind(e);
332
+ return n.filter((r) => r.dependencies.every(o));
333
333
  }
334
334
  const U = "@etrepum/lexical-builder-list/CheckList", W = G({
335
335
  name: "@etrepum/lexical-builder-markdown/MarkdownTransformers",
@@ -345,22 +345,22 @@ const U = "@etrepum/lexical-builder-list/CheckList", W = G({
345
345
  }),
346
346
  // For now we replace the transformer arrays with the default
347
347
  // shallowMergeConfig. I think ideally these should be additive
348
- init(e, t, n) {
348
+ init(e, n, o) {
349
349
  const r = ce(e), i = {
350
- shouldPreserveNewlines: t.shouldPreserveNewlines
351
- }, o = z(
350
+ shouldPreserveNewlines: n.shouldPreserveNewlines
351
+ }, t = z(
352
352
  r,
353
- t.elementTransformers
353
+ n.elementTransformers
354
354
  );
355
- if (n.getPeer(U)) {
356
- const a = o.indexOf(ge);
357
- a >= 0 && o.splice(a, 0, de);
355
+ if (o.getPeer(U)) {
356
+ const a = t.indexOf(ge);
357
+ a >= 0 && t.splice(a, 0, de);
358
358
  }
359
359
  const c = {
360
360
  // Only register transforms for nodes that are configured
361
- element: o,
362
- textMatch: z(r, t.textMatchTransformers),
363
- textFormat: t.textFormatTransformers
361
+ element: t,
362
+ textMatch: z(r, n.textMatchTransformers),
363
+ textFormat: n.textFormatTransformers
364
364
  }, s = $e(
365
365
  we(c, i)
366
366
  ), l = ke(
@@ -374,19 +374,19 @@ const U = "@etrepum/lexical-builder-list/CheckList", W = G({
374
374
  $markdownImport: s
375
375
  };
376
376
  },
377
- register: (e, t, n) => q(n.getInitResult())
377
+ register: (e, n, o) => q(o.getInitResult())
378
378
  });
379
- function ve(e, t, n, r) {
379
+ function ve(e, n, o, r) {
380
380
  const i = e.getParent();
381
- if (!Z(i) || e.getFirstChild() !== t)
381
+ if (!Z(i) || e.getFirstChild() !== n)
382
382
  return !1;
383
- const o = t.getTextContent();
384
- if (o[n - 1] !== " ")
383
+ const t = n.getTextContent();
384
+ if (t[o - 1] !== " ")
385
385
  return !1;
386
386
  for (const { regExp: c, replace: s } of r) {
387
- const l = o.match(c);
388
- if (l && l[0].length === n) {
389
- const a = t.getNextSiblings(), [f, m] = t.splitText(n);
387
+ const l = t.match(c);
388
+ if (l && l[0].length === o) {
389
+ const a = n.getNextSiblings(), [f, m] = n.splitText(o);
390
390
  f.remove();
391
391
  const g = m ? [m, ...a] : a;
392
392
  return s(e, g, l, !1), !0;
@@ -394,13 +394,13 @@ function ve(e, t, n, r) {
394
394
  }
395
395
  return !1;
396
396
  }
397
- function be(e, t, n) {
397
+ function be(e, n, o) {
398
398
  let r = e.getTextContent();
399
- const i = r[t - 1], o = n[i];
400
- if (o == null)
399
+ const i = r[n - 1], t = o[i];
400
+ if (t == null)
401
401
  return !1;
402
- t < r.length && (r = r.slice(0, t));
403
- for (const c of o) {
402
+ n < r.length && (r = r.slice(0, n));
403
+ for (const c of t) {
404
404
  const s = r.match(c.regExp);
405
405
  if (s === null)
406
406
  continue;
@@ -416,8 +416,8 @@ function be(e, t, n) {
416
416
  }
417
417
  return !1;
418
418
  }
419
- function Ie(e, t, n) {
420
- const r = e.getTextContent(), i = t - 1, o = r[i], c = n[o];
419
+ function Ie(e, n, o) {
420
+ const r = e.getTextContent(), i = n - 1, t = r[i], c = o[t];
421
421
  if (!c)
422
422
  return !1;
423
423
  for (const s of c) {
@@ -445,7 +445,7 @@ function Ie(e, t, n) {
445
445
  if (d < 0 || u === g && d + a === f)
446
446
  continue;
447
447
  const R = u.getTextContent();
448
- if (d > 0 && R[d - 1] === o)
448
+ if (d > 0 && R[d - 1] === t)
449
449
  continue;
450
450
  const k = R[d - 1];
451
451
  if (s.intraword === !1 && k && !$.test(k))
@@ -473,35 +473,35 @@ function Ie(e, t, n) {
473
473
  }
474
474
  return !1;
475
475
  }
476
- function X(e, t, n) {
477
- const r = n.length;
478
- for (let i = t; i >= r; i--) {
479
- const o = i - r;
480
- if (oe(e, o, n, 0, r) && // Space after opening tag cancels transformation
481
- e[o + r] !== " ")
482
- return o;
476
+ function X(e, n, o) {
477
+ const r = o.length;
478
+ for (let i = n; i >= r; i--) {
479
+ const t = i - r;
480
+ if (oe(e, t, o, 0, r) && // Space after opening tag cancels transformation
481
+ e[t + r] !== " ")
482
+ return t;
483
483
  }
484
484
  return -1;
485
485
  }
486
- function oe(e, t, n, r, i) {
487
- for (let o = 0; o < i; o++)
488
- if (e[t + o] !== n[r + o])
486
+ function oe(e, n, o, r, i) {
487
+ for (let t = 0; t < i; t++)
488
+ if (e[n + t] !== o[r + t])
489
489
  return !1;
490
490
  return !0;
491
491
  }
492
- function Le(e, t) {
493
- const n = y(
494
- t.textFormat,
495
- ({ tag: o }) => o[o.length - 1]
492
+ function Le(e, n) {
493
+ const o = y(
494
+ n.textFormat,
495
+ ({ tag: t }) => t[t.length - 1]
496
496
  ), r = y(
497
- t.textMatch,
498
- ({ trigger: o }) => o
499
- ), i = (o, c, s) => {
497
+ n.textMatch,
498
+ ({ trigger: t }) => t
499
+ ), i = (t, c, s) => {
500
500
  ve(
501
- o,
501
+ t,
502
502
  c,
503
503
  s,
504
- t.element
504
+ n.element
505
505
  ) || be(
506
506
  c,
507
507
  s,
@@ -509,12 +509,12 @@ function Le(e, t) {
509
509
  ) || Ie(
510
510
  c,
511
511
  s,
512
- n
512
+ o
513
513
  );
514
514
  };
515
515
  return e.registerUpdateListener(
516
- ({ tags: o, dirtyLeaves: c, editorState: s, prevEditorState: l }) => {
517
- if (o.has("collaboration") || o.has("historic") || e.isComposing())
516
+ ({ tags: t, dirtyLeaves: c, editorState: s, prevEditorState: l }) => {
517
+ if (t.has("collaboration") || t.has("historic") || e.isComposing())
518
518
  return;
519
519
  const a = s.read(C), f = l.read(C);
520
520
  if (!P(f) || !P(a) || !a.isCollapsed())
@@ -535,18 +535,18 @@ const ze = G({
535
535
  config: H({
536
536
  disabled: !1
537
537
  }),
538
- register(e, t, n) {
538
+ register(e, n, o) {
539
539
  return q(
540
540
  ...le({
541
- disabled: t.disabled,
541
+ disabled: n.disabled,
542
542
  register: () => Le(
543
543
  e,
544
- n.getDependency(W).output.transformersByType
544
+ o.getDependency(W).output.transformersByType
545
545
  )
546
546
  })
547
547
  );
548
548
  }
549
- }), Ue = "0.0.28-nightly.20240708.0";
549
+ }), Ue = "0.0.28";
550
550
  export {
551
551
  ze as MarkdownShortcutsPlan,
552
552
  W as MarkdownTransformersPlan,
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ParagraphNode, Spread, LexicalNode } from 'lexical';
2
2
 
3
- export declare function indexBy<T>(list: Array<T>, callback: (arg0: T) => string): Readonly<Record<string, Array<T>>>;
3
+ export declare function indexBy<T>(list: T[], callback: (arg0: T) => string): Readonly<Record<string, T[]>>;
4
4
  export declare const PUNCTUATION_OR_SPACE: RegExp;
5
5
  declare const EmptyParagraphNodeBrand: unique symbol;
6
6
  export declare function $isEmptyParagraph(node: LexicalNode | undefined | null): node is Spread<{
@@ -13,7 +13,7 @@ export declare function $isEmptyParagraph(node: LexicalNode | undefined | null):
13
13
  * update you're running includes selection modifications that you do not
14
14
  * want.
15
15
  *
16
- * This is useful because the existing @lexical/markdown importers
16
+ * This is useful because the existing \@lexical/markdown importers
17
17
  * mangle the selection because of legacy mistakes.
18
18
  */
19
19
  export declare function $wrapWithIgnoreSelection<Parameters extends any[], Returns>($update: (...args: Parameters) => Returns): (...args: Parameters) => Returns;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,WAAW,EAGjB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EACd,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAC5B,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAcpC;AAED,eAAO,MAAM,oBAAoB,QAAqB,CAAC;AAIvD,QAAA,MAAM,uBAAuB,EAAE,OAAO,MAErC,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,GACnC,IAAI,IAAI,MAAM,CAAC;IAAE,CAAC,uBAAuB,CAAC,EAAE,KAAK,CAAA;CAAE,EAAE,aAAa,CAAC,CAYrE;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,SAAS,GAAG,EAAE,EAAE,OAAO,EACxE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,KAAK,OAAO,GACxC,CAAC,GAAG,IAAI,EAAE,UAAU,KAAK,OAAO,CAqBlC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,WAAW,EAGjB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,OAAO,CAAC,CAAC,EACvB,IAAI,EAAE,CAAC,EAAE,EACT,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAC5B,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAc/B;AAED,eAAO,MAAM,oBAAoB,QAAqB,CAAC;AAIvD,QAAA,MAAM,uBAAuB,EAAE,OAAO,MAErC,CAAC;AAEF,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI,GACnC,IAAI,IAAI,MAAM,CAAC;IAAE,CAAC,uBAAuB,CAAC,EAAE,KAAK,CAAA;CAAE,EAAE,aAAa,CAAC,CAYrE;AAED;;;;;;;;;GASG;AAEH,wBAAgB,wBAAwB,CAAC,UAAU,SAAS,GAAG,EAAE,EAAE,OAAO,EACxE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,KAAK,OAAO,GACxC,CAAC,GAAG,IAAI,EAAE,UAAU,KAAK,OAAO,CAqBlC"}
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "test": "vitest run",
17
17
  "test:watch": "vitest"
18
18
  },
19
- "version": "0.0.28-nightly.20240708.0",
19
+ "version": "0.0.28",
20
20
  "license": "MIT",
21
21
  "repository": {
22
22
  "type": "git",