@clevertask/scribe 0.1.7 → 0.1.9

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.
Files changed (47) hide show
  1. package/README.md +5 -4
  2. package/dist/{BarMenu-DC-S5Ggq.js → BarMenu-BG_w4DVo.js} +53 -25
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.d.ts.map +1 -1
  5. package/dist/components/Menu/BarMenu.js +1 -1
  6. package/dist/components/Menu/BubbleMenu.js +2 -2
  7. package/dist/components/Menu/LinkBubbleMenu.d.ts.map +1 -1
  8. package/dist/components/Menu/LinkBubbleMenu.js +64 -50
  9. package/dist/components/Menu/LinkEditor.js +4 -4
  10. package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
  11. package/dist/components/Menu/Mobile/ListOptionBar.js +11 -5
  12. package/dist/components/Menu/linkBubbleMenuPlugin.d.ts +1 -0
  13. package/dist/components/Menu/linkBubbleMenuPlugin.d.ts.map +1 -1
  14. package/dist/components/Menu/linkBubbleMenuPlugin.js +4 -2
  15. package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -1
  16. package/dist/components/Scribe/extension/emoji/EmojiList.js +6 -2
  17. package/dist/components/Scribe/extension/emoji/suggest.js +2 -2
  18. package/dist/components/Scribe/extension/extension-link.js +1 -1
  19. package/dist/components/Scribe/extension/extension-markdown-paste.js +14 -6
  20. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  21. package/dist/components/Scribe/extension/index.js +1 -1
  22. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -1
  23. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +948 -943
  24. package/dist/components/Scribe/extension/slashCommand/index.js +1 -1
  25. package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
  26. package/dist/components/Scribe/extension/tableOfContents.js +2 -2
  27. package/dist/components/Scribe/index.d.ts +2 -0
  28. package/dist/components/Scribe/index.d.ts.map +1 -1
  29. package/dist/components/Scribe/index.js +182 -80
  30. package/dist/{dist-BQjH-i-q.js → dist-BMKyBtRa.js} +112 -105
  31. package/dist/{dist-DT3iiwSr.js → dist-BgEySLwo.js} +9 -8
  32. package/dist/{dist-CnXCIcnl.js → dist-FrapLVQu.js} +16 -9
  33. package/dist/{extension-CZOsheCI.js → extension-BVGWENts.js} +1306 -1300
  34. package/dist/{extension-link-DZID_SYl.js → extension-link-CMRfHUc5.js} +5 -5
  35. package/dist/{floating-ui.dom-rih69525.js → floating-ui.dom-CmJ6iBdh.js} +4 -5
  36. package/dist/{html-to-markdown-CrNOkSye.js → html-to-markdown-Cta7-ssO.js} +3 -2
  37. package/dist/main.js +2 -2
  38. package/dist/{markdown-to-html-DEczPfuq.js → markdown-to-html-DwSNqq2i.js} +8 -6
  39. package/dist/{menus-CrKTaPWU.js → menus-D9OsP28c.js} +8 -8
  40. package/dist/{purify.es-DF9CW1cl.js → purify.es-CFiLaBu1.js} +1 -1
  41. package/dist/{slashCommand-B7CRIaKG.js → slashCommand-B6Iz1i0d.js} +5 -8
  42. package/dist/{tables-CjOC70rm.js → tables-CXpUVKdw.js} +9 -7
  43. package/dist/{tippy.esm-D9LL2xiE.js → tippy.esm-DOXqN1Qm.js} +2 -7
  44. package/dist/utils/html-to-markdown.js +1 -1
  45. package/dist/utils/index.js +4 -4
  46. package/dist/utils/markdown-to-html.js +1 -1
  47. package/package.json +49 -34
@@ -1,6 +1,6 @@
1
- import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as s, b as c, c as l, d as u, f as d, g as f, h as p, i as m, m as h, n as g, o as _, p as ee, r as v, t as y, u as b, v as x, w as te, x as S, y as C } from "./dist-CnXCIcnl.js";
1
+ import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as s, b as c, c as l, d as u, f as d, g as f, h as p, i as m, m as h, n as g, o as _, p as ee, r as v, t as y, u as b, v as x, w as te, x as S, y as C } from "./dist-FrapLVQu.js";
2
2
  //#region node_modules/.pnpm/prosemirror-commands@1.7.1/node_modules/prosemirror-commands/dist/index.js
3
- var ne = (e, t) => e.selection.empty ? !1 : (t && t(e.tr.deleteSelection().scrollIntoView()), !0);
3
+ var ne = (e, t) => !e.selection.empty && (t && t(e.tr.deleteSelection().scrollIntoView()), !0);
4
4
  function re(e, t) {
5
5
  let { $cursor: n } = e.selection;
6
6
  return !n || (t ? !t.endOfTextblock("backward", e) : n.parentOffset > 0) ? null : n;
@@ -11,7 +11,7 @@ var ie = (e, t, n) => {
11
11
  let a = ue(i);
12
12
  if (!a) {
13
13
  let n = i.blockRange(), r = n && C(n);
14
- return r == null ? !1 : (t && t(e.tr.lift(n, r).scrollIntoView()), !0);
14
+ return r != null && (t && t(e.tr.lift(n, r).scrollIntoView()), !0);
15
15
  }
16
16
  let o = a.nodeBefore;
17
17
  if (Oe(e, a, t, -1)) return !0;
@@ -145,7 +145,7 @@ var he = (e, t) => {
145
145
  return t && t(e.tr.join(r).scrollIntoView()), !0;
146
146
  }, _e = (e, t) => {
147
147
  let { $from: n, $to: r } = e.selection, i = n.blockRange(r), a = i && C(i);
148
- return a == null ? !1 : (t && t(e.tr.lift(i, a).scrollIntoView()), !0);
148
+ return a != null && (t && t(e.tr.lift(i, a).scrollIntoView()), !0);
149
149
  }, ve = (e, t) => {
150
150
  let { $head: n, $anchor: r } = e.selection;
151
151
  return !n.parent.type.spec.code || !n.sameParent(r) ? !1 : (t && t(e.tr.insertText("\n").scrollIntoView()), !0);
@@ -185,7 +185,7 @@ var be = (e, t) => {
185
185
  if (p(e.doc, r)) return t && t(e.tr.split(r).scrollIntoView()), !0;
186
186
  }
187
187
  let r = n.blockRange(), i = r && C(r);
188
- return i == null ? !1 : (t && t(e.tr.lift(r, i).scrollIntoView()), !0);
188
+ return i != null && (t && t(e.tr.lift(r, i).scrollIntoView()), !0);
189
189
  };
190
190
  function Ce(e) {
191
191
  return (t, n) => {
@@ -215,7 +215,7 @@ function Ce(e) {
215
215
  }
216
216
  var we = Ce(), Te = (e, t) => {
217
217
  let { $from: n, to: r } = e.selection, i, a = n.sharedDepth(r);
218
- return a == 0 ? !1 : (i = n.before(a), t && t(e.tr.setSelection(v.create(e.doc, i))), !0);
218
+ return a != 0 && (i = n.before(a), t && t(e.tr.setSelection(v.create(e.doc, i))), !0);
219
219
  }, Ee = (e, t) => (t && t(e.tr.setSelection(new y(e.doc))), !0);
220
220
  function De(e, t, n) {
221
221
  let r = t.nodeBefore, i = t.nodeAfter, a = t.index();
@@ -979,7 +979,8 @@ var R = 0, Kt = 1, qt = 2, z = 3, Jt = class {
979
979
  node: this.contentDOM,
980
980
  offset: e ? w(e.dom) + 1 : 0
981
981
  };
982
- } else {
982
+ }
983
+ {
983
984
  let e, r = !0;
984
985
  for (; e = n < this.children.length ? this.children[n] : null, !(!e || e.dom.parentNode == this.contentDOM); n++, r = !1);
985
986
  return e && r && !e.border && !e.domAtom ? e.domFromPos(0, t) : {
@@ -1108,7 +1109,8 @@ var R = 0, Kt = 1, qt = 2, z = 3, Jt = class {
1108
1109
  if (e >= r && t <= o) {
1109
1110
  this.dirty = e == n || t == a ? qt : Kt, e == r && t == o && (i.contentLost || i.dom.parentNode != this.contentDOM) ? i.dirty = z : i.markDirty(e - r, t - r);
1110
1111
  return;
1111
- } else i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? qt : z;
1112
+ }
1113
+ i.dirty = i.dom == i.contentDOM && i.dom.parentNode == this.contentDOM && !i.children.length ? qt : z;
1112
1114
  }
1113
1115
  n = a;
1114
1116
  }
@@ -1303,7 +1305,8 @@ var R = 0, Kt = 1, qt = 2, z = 3, Jt = class {
1303
1305
  pos: a,
1304
1306
  text: e
1305
1307
  };
1306
- } else return {
1308
+ }
1309
+ return {
1307
1310
  node: i,
1308
1311
  pos: -1,
1309
1312
  text: ""
@@ -1315,7 +1318,7 @@ var R = 0, Kt = 1, qt = 2, z = 3, Jt = class {
1315
1318
  for (; i.parentNode != this.contentDOM; i = i.parentNode) {
1316
1319
  for (; i.previousSibling;) i.parentNode.removeChild(i.previousSibling);
1317
1320
  for (; i.nextSibling;) i.parentNode.removeChild(i.nextSibling);
1318
- i.pmViewDesc &&= void 0;
1321
+ i.pmViewDesc && (i.pmViewDesc = void 0);
1319
1322
  }
1320
1323
  let a = new Xt(this, i, t, r);
1321
1324
  e.input.compositionNodes.push(a), this.children = yn(this.children, n, n + r.length, e, a);
@@ -1410,8 +1413,8 @@ var en = class e extends Qt {
1410
1413
  if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
1411
1414
  let i = this.spec.update(e, t, n);
1412
1415
  return i && this.updateInner(e, t, n, r), i;
1413
- } else if (!this.contentDOM && !e.isLeaf) return !1;
1414
- else return super.update(e, t, n, r);
1416
+ }
1417
+ return !this.contentDOM && !e.isLeaf ? !1 : super.update(e, t, n, r);
1415
1418
  }
1416
1419
  selectNode() {
1417
1420
  this.spec.selectNode ? this.spec.selectNode() : super.selectNode();
@@ -1858,11 +1861,13 @@ function Fn(e, t, n) {
1858
1861
  if (!i || i.isText || !i.isLeaf) return !1;
1859
1862
  let a = e.state.doc.resolve(n.pos + i.nodeSize * (t < 0 ? -1 : 1));
1860
1863
  return V(e, new l(r.$anchor, a));
1861
- } else if (!r.empty) return !1;
1862
- else if (e.endOfTextblock(t > 0 ? "forward" : "backward")) {
1864
+ }
1865
+ if (!r.empty) return !1;
1866
+ if (e.endOfTextblock(t > 0 ? "forward" : "backward")) {
1863
1867
  let n = Pn(e.state, t);
1864
1868
  return n && n instanceof v ? V(e, n) : !1;
1865
- } else if (!(P && n.indexOf("m") > -1)) {
1869
+ }
1870
+ if (!(P && n.indexOf("m") > -1)) {
1866
1871
  let n = r.$head, i = n.textOffset ? null : t < 0 ? n.nodeBefore : n.nodeAfter, a;
1867
1872
  if (!i || i.isText) return !1;
1868
1873
  let o = t < 0 ? n.pos - i.nodeSize : n.pos;
@@ -2034,13 +2039,12 @@ function Zn(e, t) {
2034
2039
  if (n == 37 || P && n == 66 && r == "c") {
2035
2040
  let t = n == 37 ? Gn(e, e.state.selection.from) == "ltr" ? -1 : 1 : -1;
2036
2041
  return Fn(e, t, r) || Rn(e, t);
2037
- } else if (n == 39 || P && n == 70 && r == "c") {
2042
+ }
2043
+ if (n == 39 || P && n == 70 && r == "c") {
2038
2044
  let t = n == 39 ? Gn(e, e.state.selection.from) == "ltr" ? 1 : -1 : 1;
2039
2045
  return Fn(e, t, r) || Rn(e, t);
2040
- } else if (n == 38 || P && n == 80 && r == "c") return Kn(e, -1, r) || Rn(e, -1);
2041
- else if (n == 40 || P && n == 78 && r == "c") return Yn(e) || Kn(e, 1, r) || Rn(e, 1);
2042
- else if (r == (P ? "m" : "c") && (n == 66 || n == 73 || n == 89 || n == 90)) return !0;
2043
- return !1;
2046
+ }
2047
+ return n == 38 || P && n == 80 && r == "c" ? Kn(e, -1, r) || Rn(e, -1) : n == 40 || P && n == 78 && r == "c" ? Yn(e) || Kn(e, 1, r) || Rn(e, 1) : !(r != (P ? "m" : "c") || n != 66 && n != 73 && n != 89 && n != 90);
2044
2048
  }
2045
2049
  function Qn(e, t) {
2046
2050
  e.someProp("transformCopied", (n) => {
@@ -2336,7 +2340,7 @@ function Dr(e, t) {
2336
2340
  break;
2337
2341
  }
2338
2342
  }
2339
- return i == null ? !1 : (Tr(e, v.create(e.state.doc, i), "pointer"), !0);
2343
+ return i != null && (Tr(e, v.create(e.state.doc, i), "pointer"), !0);
2340
2344
  }
2341
2345
  function Or(e, t, n, r, i) {
2342
2346
  return wr(e, "handleClickOn", t, n, r) || e.someProp("handleClick", (n) => n(e, t, r)) || (i ? Dr(e, n) : Er(e, n));
@@ -2476,7 +2480,8 @@ U.compositionstart = U.compositionupdate = (e) => {
2476
2480
  let n = e.domSelection();
2477
2481
  n && n.collapse(t, t.nodeValue.length);
2478
2482
  break;
2479
- } else n = t, r = -1;
2483
+ }
2484
+ n = t, r = -1;
2480
2485
  }
2481
2486
  }
2482
2487
  e.input.composing = !0;
@@ -3002,10 +3007,9 @@ function gi(e) {
3002
3007
  if (a.from == r.from) {
3003
3008
  a.to != r.to && (t == e && (t = e.slice()), t[i] = a.copy(a.from, r.to), _i(t, i + 1, a.copy(r.to, a.to)));
3004
3009
  continue;
3005
- } else {
3006
- a.from < r.to && (t == e && (t = e.slice()), t[n] = r.copy(r.from, a.from), _i(t, i, r.copy(a.from, r.to)));
3007
- break;
3008
3010
  }
3011
+ a.from < r.to && (t == e && (t = e.slice()), t[n] = r.copy(r.from, a.from), _i(t, i, r.copy(a.from, r.to)));
3012
+ break;
3009
3013
  }
3010
3014
  }
3011
3015
  return t;
@@ -3176,15 +3180,15 @@ var yi = {
3176
3180
  from: o,
3177
3181
  to: n.localPosFromDOM(e.target, s, 1)
3178
3182
  };
3179
- } else if (e.type == "attributes") return {
3183
+ }
3184
+ return e.type == "attributes" ? {
3180
3185
  from: n.posAtStart - n.border,
3181
3186
  to: n.posAtEnd + n.border
3182
- };
3183
- else return this.lastChangedTextNode = e.target, {
3187
+ } : (this.lastChangedTextNode = e.target, {
3184
3188
  from: n.posAtStart,
3185
3189
  to: n.posAtEnd,
3186
3190
  typeOver: e.target.nodeValue == e.oldValue
3187
- };
3191
+ });
3188
3192
  }
3189
3193
  }, Ci = /* @__PURE__ */ new WeakMap(), wi = !1;
3190
3194
  function Ti(e) {
@@ -3293,7 +3297,8 @@ var ji = (e) => (t) => {
3293
3297
  if (N && /^(ul|ol)$/i.test(t.parentNode.nodeName)) {
3294
3298
  let e = document.createElement("div");
3295
3299
  return e.appendChild(document.createElement("li")), { skip: e };
3296
- } else if (t.parentNode.lastChild == t || N && /^(tr|table)$/i.test(t.parentNode.nodeName)) return { ignore: !0 };
3300
+ }
3301
+ if (t.parentNode.lastChild == t || N && /^(tr|table)$/i.test(t.parentNode.nodeName)) return { ignore: !0 };
3297
3302
  } else if (t.nodeName == "IMG" && t.getAttribute("mark-placeholder")) return { ignore: !0 };
3298
3303
  return null;
3299
3304
  }, Mi = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
@@ -3790,7 +3795,7 @@ function aa(e) {
3790
3795
  };
3791
3796
  }
3792
3797
  //#endregion
3793
- //#region node_modules/.pnpm/@tiptap+core@3.29.0_@tiptap+pm@3.29.0/node_modules/@tiptap/core/dist/index.js
3798
+ //#region node_modules/.pnpm/@tiptap+core@3.29.2_@tiptap+pm@3.29.2/node_modules/@tiptap/core/dist/index.js
3794
3799
  var oa = Object.defineProperty, sa = (e, t) => {
3795
3800
  for (var n in t) oa(e, n, {
3796
3801
  get: t[n],
@@ -4282,14 +4287,14 @@ var Ja = (e = {}) => ({ tr: t, dispatch: n, editor: r }) => {
4282
4287
  }, Ya = () => ({ state: e, dispatch: t }) => he(e, t), Xa = () => ({ state: e, dispatch: t }) => ge(e, t), Za = () => ({ state: e, dispatch: t }) => ie(e, t), Qa = () => ({ state: e, dispatch: t }) => fe(e, t), $a = () => ({ state: e, dispatch: t, tr: n }) => {
4283
4288
  try {
4284
4289
  let r = x(e.doc, e.selection.$from.pos, -1);
4285
- return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
4290
+ return r != null && (n.join(r, 2), t && t(n), !0);
4286
4291
  } catch {
4287
4292
  return !1;
4288
4293
  }
4289
4294
  }, eo = () => ({ state: e, dispatch: t, tr: n }) => {
4290
4295
  try {
4291
4296
  let r = x(e.doc, e.selection.$from.pos, 1);
4292
- return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
4297
+ return r != null && (n.join(r, 2), t && t(n), !0);
4293
4298
  } catch {
4294
4299
  return !1;
4295
4300
  }
@@ -4616,74 +4621,74 @@ function Ho(e) {
4616
4621
  return !e?.attribute?.isRequired && "default" in (e?.attribute || {}) && (t.default = e.attribute.default), e?.attribute?.validate !== void 0 && (t.validate = e.attribute.validate), [e.name, t];
4617
4622
  }
4618
4623
  function Uo(e, n) {
4619
- let r = Po(e), { nodeExtensions: i, markExtensions: a } = No(e);
4624
+ let r = Po(e), { nodeExtensions: i, markExtensions: a } = No(e), o = i.find((e) => Z(e, "topNode"))?.name, s = Object.fromEntries(i.map((t) => {
4625
+ let i = r.filter((e) => e.type === t.name), a = {
4626
+ name: t.name,
4627
+ options: t.options,
4628
+ storage: t.storage,
4629
+ editor: n
4630
+ }, o = Vo({
4631
+ ...e.reduce((e, n) => {
4632
+ let r = Z(n, "extendNodeSchema", a);
4633
+ return {
4634
+ ...e,
4635
+ ...r ? r(t) : {}
4636
+ };
4637
+ }, {}),
4638
+ content: Q(Z(t, "content", a)),
4639
+ marks: Q(Z(t, "marks", a)),
4640
+ group: Q(Z(t, "group", a)),
4641
+ inline: Q(Z(t, "inline", a)),
4642
+ atom: Q(Z(t, "atom", a)),
4643
+ selectable: Q(Z(t, "selectable", a)),
4644
+ draggable: Q(Z(t, "draggable", a)),
4645
+ code: Q(Z(t, "code", a)),
4646
+ whitespace: Q(Z(t, "whitespace", a)),
4647
+ linebreakReplacement: Q(Z(t, "linebreakReplacement", a)),
4648
+ defining: Q(Z(t, "defining", a)),
4649
+ isolating: Q(Z(t, "isolating", a)),
4650
+ attrs: Object.fromEntries(i.map(Ho))
4651
+ }), s = Q(Z(t, "parseHTML", a));
4652
+ s && (o.parseDOM = s.map((e) => Bo(e, i)));
4653
+ let c = Z(t, "renderHTML", a);
4654
+ c && (o.toDOM = (e) => c({
4655
+ node: e,
4656
+ HTMLAttributes: Ro(e, i)
4657
+ }));
4658
+ let l = Z(t, "renderText", a);
4659
+ return l && (o.toText = l), [t.name, o];
4660
+ })), c = Object.fromEntries(a.map((t) => {
4661
+ let i = r.filter((e) => e.type === t.name), a = {
4662
+ name: t.name,
4663
+ options: t.options,
4664
+ storage: t.storage,
4665
+ editor: n
4666
+ }, o = Vo({
4667
+ ...e.reduce((e, n) => {
4668
+ let r = Z(n, "extendMarkSchema", a);
4669
+ return {
4670
+ ...e,
4671
+ ...r ? r(t) : {}
4672
+ };
4673
+ }, {}),
4674
+ inclusive: Q(Z(t, "inclusive", a)),
4675
+ excludes: Q(Z(t, "excludes", a)),
4676
+ group: Q(Z(t, "group", a)),
4677
+ spanning: Q(Z(t, "spanning", a)),
4678
+ code: Q(Z(t, "code", a)),
4679
+ attrs: Object.fromEntries(i.map(Ho))
4680
+ }), s = Q(Z(t, "parseHTML", a));
4681
+ s && (o.parseDOM = s.map((e) => Bo(e, i)));
4682
+ let c = Z(t, "renderHTML", a);
4683
+ return c && (o.toDOM = (e) => c({
4684
+ mark: e,
4685
+ HTMLAttributes: Ro(e, i)
4686
+ })), [t.name, o];
4687
+ }));
4620
4688
  return new t({
4621
- topNode: i.find((e) => Z(e, "topNode"))?.name,
4622
- nodes: Object.fromEntries(i.map((t) => {
4623
- let i = r.filter((e) => e.type === t.name), a = {
4624
- name: t.name,
4625
- options: t.options,
4626
- storage: t.storage,
4627
- editor: n
4628
- }, o = Vo({
4629
- ...e.reduce((e, n) => {
4630
- let r = Z(n, "extendNodeSchema", a);
4631
- return {
4632
- ...e,
4633
- ...r ? r(t) : {}
4634
- };
4635
- }, {}),
4636
- content: Q(Z(t, "content", a)),
4637
- marks: Q(Z(t, "marks", a)),
4638
- group: Q(Z(t, "group", a)),
4639
- inline: Q(Z(t, "inline", a)),
4640
- atom: Q(Z(t, "atom", a)),
4641
- selectable: Q(Z(t, "selectable", a)),
4642
- draggable: Q(Z(t, "draggable", a)),
4643
- code: Q(Z(t, "code", a)),
4644
- whitespace: Q(Z(t, "whitespace", a)),
4645
- linebreakReplacement: Q(Z(t, "linebreakReplacement", a)),
4646
- defining: Q(Z(t, "defining", a)),
4647
- isolating: Q(Z(t, "isolating", a)),
4648
- attrs: Object.fromEntries(i.map(Ho))
4649
- }), s = Q(Z(t, "parseHTML", a));
4650
- s && (o.parseDOM = s.map((e) => Bo(e, i)));
4651
- let c = Z(t, "renderHTML", a);
4652
- c && (o.toDOM = (e) => c({
4653
- node: e,
4654
- HTMLAttributes: Ro(e, i)
4655
- }));
4656
- let l = Z(t, "renderText", a);
4657
- return l && (o.toText = l), [t.name, o];
4658
- })),
4659
- marks: Object.fromEntries(a.map((t) => {
4660
- let i = r.filter((e) => e.type === t.name), a = {
4661
- name: t.name,
4662
- options: t.options,
4663
- storage: t.storage,
4664
- editor: n
4665
- }, o = Vo({
4666
- ...e.reduce((e, n) => {
4667
- let r = Z(n, "extendMarkSchema", a);
4668
- return {
4669
- ...e,
4670
- ...r ? r(t) : {}
4671
- };
4672
- }, {}),
4673
- inclusive: Q(Z(t, "inclusive", a)),
4674
- excludes: Q(Z(t, "excludes", a)),
4675
- group: Q(Z(t, "group", a)),
4676
- spanning: Q(Z(t, "spanning", a)),
4677
- code: Q(Z(t, "code", a)),
4678
- attrs: Object.fromEntries(i.map(Ho))
4679
- }), s = Q(Z(t, "parseHTML", a));
4680
- s && (o.parseDOM = s.map((e) => Bo(e, i)));
4681
- let c = Z(t, "renderHTML", a);
4682
- return c && (o.toDOM = (e) => c({
4683
- mark: e,
4684
- HTMLAttributes: Ro(e, i)
4685
- })), [t.name, o];
4686
- }))
4689
+ topNode: o,
4690
+ nodes: s,
4691
+ marks: c
4687
4692
  });
4688
4693
  }
4689
4694
  function Wo(e) {
@@ -5320,7 +5325,7 @@ function nc(e) {
5320
5325
  if (!e || Object.keys(e).length === 0) return "";
5321
5326
  let t = [];
5322
5327
  return e.class && String(e.class).split(/\s+/).filter(Boolean).forEach((e) => t.push(`.${e}`)), e.id && t.push(`#${e.id}`), Object.entries(e).forEach(([e, n]) => {
5323
- e === "class" || e === "id" || (n === !0 ? t.push(e) : n !== !1 && n != null && t.push(`${e}="${String(n)}"`));
5328
+ e !== "class" && e !== "id" && (n === !0 ? t.push(e) : n !== !1 && n != null && t.push(`${e}="${String(n)}"`));
5324
5329
  }), t.join(" ");
5325
5330
  }
5326
5331
  function rc(e) {
@@ -5518,7 +5523,8 @@ function cc(e, t, n) {
5518
5523
  o += 1, a = `${a}${e}
5519
5524
  `;
5520
5525
  continue;
5521
- } else return;
5526
+ }
5527
+ return;
5522
5528
  }
5523
5529
  let l = t.extractItemData(c), { indentLevel: u, mainContent: d } = l;
5524
5530
  a = `${a}${e}
@@ -5533,7 +5539,8 @@ function cc(e, t, n) {
5533
5539
  f.push(e), a = `${a}${e}
5534
5540
  `, o += 1;
5535
5541
  continue;
5536
- } else break;
5542
+ }
5543
+ break;
5537
5544
  }
5538
5545
  if ((e.match(/^(\s*)/)?.[1]?.length || 0) > u) f.push(e), a = `${a}${e}
5539
5546
  `, o += 1;
@@ -6278,7 +6285,7 @@ var $ = class e extends gc {
6278
6285
  let r = e.some((e) => e.docChanged) && !t.doc.eq(n.doc), i = e.some((e) => e.getMeta("preventClearDocument"));
6279
6286
  if (!r || i) return;
6280
6287
  let { empty: a, from: o, to: s } = t.selection, c = _.atStart(t.doc).from, l = _.atEnd(t.doc).to;
6281
- if (a || !(o === c && s === l) || !ps(n.doc)) return;
6288
+ if (a || o !== c || s !== l || !ps(n.doc)) return;
6282
6289
  let u = n.tr, d = ca({
6283
6290
  state: n,
6284
6291
  transaction: u
@@ -6906,7 +6913,7 @@ var Wc = (e) => "touches" in e, Gc = class {
6906
6913
  e !== this.lastEditableState && (this.lastEditableState = e, e ? e && this.handleMap.size === 0 && this.attachHandles() : this.removeHandles());
6907
6914
  }
6908
6915
  update(e, t, n) {
6909
- return e.type === this.node.type ? (this.node = e, !this.onUpdate || this.onUpdate(e, t, n)) : !1;
6916
+ return e.type === this.node.type && (this.node = e, !this.onUpdate || this.onUpdate(e, t, n));
6910
6917
  }
6911
6918
  destroy() {
6912
6919
  this.isResizing && (this.container.dataset.resizeState = "false", this.classNames.resizing && this.container.classList.remove(this.classNames.resizing), document.removeEventListener("mousemove", this.handleMouseMove), document.removeEventListener("mouseup", this.handleMouseUp), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("keyup", this.handleKeyUp), this.isResizing = !1, this.activeHandle = null), this.editor.off("update", this.handleEditorUpdate.bind(this)), this.container.remove();
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./rolldown-runtime-CtkjhSXr.js";
2
- import { t } from "./dist-BQjH-i-q.js";
2
+ import { t } from "./dist-BMKyBtRa.js";
3
3
  import * as n from "react";
4
4
  import r, { createContext as i, forwardRef as a, useContext as o, useDebugValue as s, useEffect as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f, version as p } from "react";
5
5
  import m, { flushSync as h } from "react-dom";
@@ -92,7 +92,7 @@ var y = /* @__PURE__ */ e(((e, t) => {
92
92
  e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
93
93
  })();
94
94
  })), x = /* @__PURE__ */ e(((e, t) => {
95
- process.env.NODE_ENV === "production" ? t.exports = b() : t.exports = ee();
95
+ t.exports = process.env.NODE_ENV === "production" ? b() : ee();
96
96
  })), S = x(), { getOwnPropertyNames: te, getOwnPropertySymbols: C } = Object, { hasOwnProperty: w } = Object.prototype;
97
97
  function T(e, t) {
98
98
  return function(n, r, i) {
@@ -450,7 +450,7 @@ var Me = /* @__PURE__ */ e(((e) => {
450
450
  }, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
451
451
  })();
452
452
  })), Pe = (/* @__PURE__ */ e(((e, t) => {
453
- process.env.NODE_ENV === "production" ? t.exports = Me() : t.exports = Ne();
453
+ t.exports = process.env.NODE_ENV === "production" ? Me() : Ne();
454
454
  })))(), Fe = (...e) => (t) => {
455
455
  e.forEach((e) => {
456
456
  typeof e == "function" ? e(t) : e && (e.current = t);
@@ -559,7 +559,7 @@ var Re = class extends r.Component {
559
559
  watch(e) {
560
560
  if (this.editor = e, this.editor) {
561
561
  let e, t = (t) => {
562
- t?.transaction !== void 0 && t.transaction === e || (e = t?.transaction, this.transactionNumber += 1, this.subscribers.forEach((e) => e()));
562
+ (t?.transaction === void 0 || t.transaction !== e) && (e = t?.transaction, this.transactionNumber += 1, this.subscribers.forEach((e) => e()));
563
563
  }, n = this.editor;
564
564
  return n.on("transaction", t), n.on("update", t), () => {
565
565
  n.off("transaction", t), n.off("update", t);
@@ -583,7 +583,7 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", He = K |
583
583
  return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : He && e === void 0 && (t = !1, G && console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")), t ? this.createEditor() : null;
584
584
  }
585
585
  createEditor() {
586
- return new t({
586
+ let e = {
587
587
  ...this.options.current,
588
588
  onBeforeCreate: (...e) => {
589
589
  var t;
@@ -641,7 +641,8 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", He = K |
641
641
  var t;
642
642
  return (t = this.options.current).onUnmount?.call(t, ...e);
643
643
  }
644
- });
644
+ };
645
+ return new t(e);
645
646
  }
646
647
  getEditor() {
647
648
  return this.editor;
@@ -715,8 +716,8 @@ var Ge = () => o(q), Ke = i({
715
716
  nodeViewContentRef: () => {}
716
717
  }), J = () => o(Ke);
717
718
  r.forwardRef((e, t) => {
718
- let { onDragStart: n } = J();
719
- return /* @__PURE__ */ _(e.as || "div", {
719
+ let { onDragStart: n } = J(), r = e.as || "div";
720
+ return /* @__PURE__ */ _(r, {
720
721
  ...e,
721
722
  ref: t,
722
723
  "data-node-view-wrapper": "",
@@ -393,11 +393,13 @@ function h(e, t, n, r) {
393
393
  if (i == t.index(r) && r < e.depth - n.openStart) {
394
394
  let o = h(e, t, n, r + 1);
395
395
  return a.copy(a.content.replaceChild(i, o));
396
- } else if (!n.content.size) return y(a, b(e, t, r));
397
- else if (!n.openStart && !n.openEnd && e.depth == r && t.depth == r) {
396
+ }
397
+ if (!n.content.size) return y(a, b(e, t, r));
398
+ if (!n.openStart && !n.openEnd && e.depth == r && t.depth == r) {
398
399
  let r = e.parent, i = r.content;
399
400
  return y(r, i.cut(0, e.parentOffset).append(n.content).append(i.cut(t.parentOffset)));
400
- } else {
401
+ }
402
+ {
401
403
  let { start: i, end: o } = ne(n, e);
402
404
  return y(a, te(e, i, o, t, r));
403
405
  }
@@ -990,7 +992,8 @@ function ve(e) {
990
992
  if (e.eat("(")) {
991
993
  let t = fe(e);
992
994
  return e.eat(")") || e.err("Missing closing paren"), t;
993
- } else if (/\W/.test(e.next)) e.err("Unexpected token '" + e.next + "'");
995
+ }
996
+ if (/\W/.test(e.next)) e.err("Unexpected token '" + e.next + "'");
994
997
  else {
995
998
  let t = _e(e, e.next).map((t) => (e.inline == null ? e.inline = t.isInline : e.inline != t.isInline && e.err("Mixing inline and block content"), {
996
999
  type: "name",
@@ -1611,7 +1614,7 @@ var T = class {
1611
1614
  let o = Ve(e, i, a.options);
1612
1615
  a.options & w && a.content.length == 0 && (o |= w);
1613
1616
  let s = l.none;
1614
- return n = n.filter((t) => (a.type ? a.type.allowsMarkType(t.type) : Ke(t.type, e)) ? (s = t.addToSet(s), !1) : !0), this.nodes.push(new T(e, t, s, r, null, o)), this.open++, n;
1617
+ return n = n.filter((t) => !(a.type ? a.type.allowsMarkType(t.type) : Ke(t.type, e)) || (s = t.addToSet(s), !1)), this.nodes.push(new T(e, t, s, r, null, o)), this.open++, n;
1615
1618
  }
1616
1619
  closeExtra(e = !1) {
1617
1620
  let t = this.nodes.length - 1;
@@ -1659,7 +1662,8 @@ var T = class {
1659
1662
  if (e == t.length - 1 || e == 0) continue;
1660
1663
  for (; o >= i; o--) if (a(e - 1, o)) return !0;
1661
1664
  return !1;
1662
- } else {
1665
+ }
1666
+ {
1663
1667
  let e = o > 0 || o == 0 && r ? this.nodes[o].type : n && o >= i ? n.node(o - i).type : null;
1664
1668
  if (!e || e.name != s && !e.isInGroup(s)) return !1;
1665
1669
  o--;
@@ -1822,7 +1826,8 @@ function D(e, t, n, r) {
1822
1826
  dom: c,
1823
1827
  contentDOM: c
1824
1828
  };
1825
- } else if (typeof a == "string") c.appendChild(e.createTextNode(a));
1829
+ }
1830
+ if (typeof a == "string") c.appendChild(e.createTextNode(a));
1826
1831
  else {
1827
1832
  let { dom: t, contentDOM: i } = D(e, a, n, r);
1828
1833
  if (c.appendChild(t), i) {
@@ -2195,10 +2200,12 @@ var R = class e extends j {
2195
2200
  if (this.from + this.slice.size == t.from && !this.slice.openEnd && !t.slice.openStart) {
2196
2201
  let n = this.slice.size + t.slice.size == 0 ? d.empty : new d(this.slice.content.append(t.slice.content), this.slice.openStart, t.slice.openEnd);
2197
2202
  return new e(this.from, this.to + (t.to - t.from), n, this.structure);
2198
- } else if (t.to == this.from && !this.slice.openStart && !t.slice.openEnd) {
2203
+ }
2204
+ if (t.to == this.from && !this.slice.openStart && !t.slice.openEnd) {
2199
2205
  let n = this.slice.size + t.slice.size == 0 ? d.empty : new d(t.slice.content.append(this.slice.content), t.slice.openStart, this.slice.openEnd);
2200
2206
  return new e(t.from, this.to, n, this.structure);
2201
- } else return null;
2207
+ }
2208
+ return null;
2202
2209
  }
2203
2210
  toJSON() {
2204
2211
  let e = {