reactjs-tiptap-editor 1.0.18 → 1.0.19

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 (147) hide show
  1. package/lib/{ActionMenuButton-BOjCHFTA.js → ActionMenuButton-B1Nfn5Hm.js} +1 -1
  2. package/lib/{ActionMenuButton-Df077oOH.cjs → ActionMenuButton-D3b_bcin.cjs} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +23 -23
  5. package/lib/Blockquote.cjs +3 -3
  6. package/lib/Blockquote.js +33 -28
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +16 -10
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +2 -2
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +21 -22
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +2 -2
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +2 -2
  17. package/lib/CodeBlock.cjs +37 -37
  18. package/lib/CodeBlock.js +15 -16
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +2 -2
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +3 -3
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +2 -2
  25. package/lib/{Drawer-DxOoRiGQ.js → Drawer-B1-7Y4HB.js} +3 -3
  26. package/lib/{Drawer-DwrlY_lY.cjs → Drawer-kEO7KzzC.cjs} +1 -1
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +4 -4
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +12 -12
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +17 -17
  33. package/lib/ExportPdf.cjs +1 -1
  34. package/lib/ExportPdf.js +2 -2
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +2 -2
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +4 -4
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +4 -4
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +9 -9
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +3 -3
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +5 -3
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +2 -2
  49. package/lib/{Iframe-C6pBw-AF.cjs → Iframe-Bk5OIlvy.cjs} +1 -1
  50. package/lib/{Iframe-AhNV5WH5.js → Iframe-XlAb03_r.js} +7 -7
  51. package/lib/Iframe.cjs +1 -1
  52. package/lib/Iframe.js +3 -3
  53. package/lib/Image.cjs +1 -1
  54. package/lib/Image.js +6 -5
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +36 -36
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +13 -13
  59. package/lib/{Indent-Do-X0AsY.cjs → Indent-XaZNTsOk.cjs} +1 -1
  60. package/lib/{Indent-DZ5PcJA4.js → Indent-ruPuj5xn.js} +2 -2
  61. package/lib/Indent.cjs +1 -1
  62. package/lib/Indent.js +2 -2
  63. package/lib/Italic.cjs +1 -1
  64. package/lib/Italic.js +24 -18
  65. package/lib/Katex-BFIYLrwm.cjs +4 -0
  66. package/lib/{Katex-bIgoenn_.js → Katex-DKspCn-p.js} +5 -6
  67. package/lib/Katex.cjs +1 -1
  68. package/lib/Katex.js +3 -3
  69. package/lib/LineHeight.cjs +1 -1
  70. package/lib/LineHeight.js +3 -3
  71. package/lib/Link.cjs +1 -1
  72. package/lib/Link.js +2 -2
  73. package/lib/{LinkEditBlock-D_cF9fnc.js → LinkEditBlock-BWm2Ypt2.js} +26 -26
  74. package/lib/{LinkEditBlock-B0ZaACZO.cjs → LinkEditBlock-DhesHreq.cjs} +1 -1
  75. package/lib/MarkdownPaste.cjs +1 -1
  76. package/lib/MarkdownPaste.js +1 -1
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +4 -4
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +41 -42
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +5 -5
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +2 -2
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +8 -8
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +6 -6
  89. package/lib/{SlashCommandNodeView-Ba03hlVZ.cjs → SlashCommandNodeView-CojfS61Q.cjs} +1 -1
  90. package/lib/{SlashCommandNodeView-cg0x3NRF.js → SlashCommandNodeView-Hf2DX4km.js} +6 -6
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +2 -2
  93. package/lib/{Table-KqLiT5wG.js → Table-BTkFUATL.js} +4 -4
  94. package/lib/{Table-ddU2LSc6.cjs → Table-C1_xLqV0.cjs} +1 -1
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +2 -2
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +3 -3
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +3 -3
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +2 -2
  105. package/lib/{Twitter-BIiR78Jh.cjs → Twitter-Cj-0yyQQ.cjs} +1 -1
  106. package/lib/{Twitter-C1Lzqc7u.js → Twitter-D5mUTILj.js} +9 -9
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +3 -3
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +4 -4
  111. package/lib/bubble.cjs +6 -6
  112. package/lib/bubble.js +1835 -1634
  113. package/lib/{clsx-BWE7vnna.cjs → clsx-BSBE1eoY.cjs} +1 -1
  114. package/lib/{clsx-eGVyq7ot.js → clsx-OumA9x-8.js} +1 -1
  115. package/lib/{dropdown-menu-CexIkt_V.js → dropdown-menu-Bragdu5m.js} +1 -1
  116. package/lib/{dropdown-menu-oSKIntXM.cjs → dropdown-menu-CUeq1boX.cjs} +1 -1
  117. package/lib/extensions/Image/Image.d.ts +1 -0
  118. package/lib/{index-D_8P0LE5.js → index-B-7eHzaO.js} +1 -1
  119. package/lib/{index-RIXs7STX.js → index-BKlbc8Qo.js} +1 -1
  120. package/lib/index-BLrMslr7.cjs +1 -0
  121. package/lib/{index-mfGK4pFo.js → index-BVRHx_ha.js} +94 -90
  122. package/lib/{index-DHUN85fV.js → index-CDFAs4RT.js} +1149 -1019
  123. package/lib/{index-CJ9pyCM4.cjs → index-CMLwKzI0.cjs} +1 -1
  124. package/lib/index-COCTP78Y.cjs +12 -0
  125. package/lib/{index-BnW6t8z6.js → index-CZ1_8JQQ.js} +1 -1
  126. package/lib/{index-D0lc95kr.cjs → index-CnePcUeF.cjs} +1 -1
  127. package/lib/{index-DUpSE1Gb.cjs → index-D7wfvzJg.cjs} +1 -1
  128. package/lib/{index-zig3Dj7A.cjs → index-DwSnESy-.cjs} +7 -5
  129. package/lib/{index-C6xmkxrQ.js → index-cPEuL4Zr.js} +140 -138
  130. package/lib/index.cjs +1 -1
  131. package/lib/index.js +12 -12
  132. package/lib/{popover-BYSZ3zBi.js → popover-C2BbhsXH.js} +1 -1
  133. package/lib/{popover-BcHDZqBt.cjs → popover-DCJpsZx0.cjs} +1 -1
  134. package/lib/{renderNodeView-BrM5kUj_.js → renderNodeView-CmnUEfby.js} +2 -2
  135. package/lib/{renderNodeView-D1zydtli.cjs → renderNodeView-DQjWzXDA.cjs} +1 -1
  136. package/lib/{separator-BmixLrnJ.cjs → separator-BuG1zwKa.cjs} +1 -1
  137. package/lib/{separator-CFKVxAea.js → separator-lkMWuUvf.js} +14 -14
  138. package/lib/{updatePosition-CfmY5Trk.cjs → updatePosition-D6AScA-1.cjs} +1 -1
  139. package/lib/{updatePosition-CBRjbQMH.js → updatePosition-DYuAiqx-.js} +2 -2
  140. package/package.json +1 -1
  141. package/lib/Katex-CIC9ygbL.cjs +0 -4
  142. package/lib/index-BUTn2LY6.cjs +0 -1
  143. package/lib/index-BtxvYLJ1.cjs +0 -12
  144. package/lib/select-C5SHDLFj.js +0 -120
  145. package/lib/select-DHjzKkcu.cjs +0 -1
  146. package/lib/textarea-CasDcv3u.cjs +0 -1
  147. package/lib/textarea-DNLrJoRl.js +0 -20
@@ -1,4 +1,4 @@
1
- import { N as g, w as b, m as L, r as $, E as O, g as K, p as x, i as I, a as V, b as X, c as S, d as z } from "./index-mfGK4pFo.js";
1
+ import { N as g, w as b, m as L, r as $, E as O, g as K, p as x, i as I, a as V, b as X, c as S, d as z } from "./index-BVRHx_ha.js";
2
2
  var F = Object.defineProperty, G = (t, e) => {
3
3
  for (var s in e)
4
4
  F(t, s, { get: e[s], enumerable: !0 });
@@ -79,43 +79,45 @@ var F = Object.defineProperty, G = (t, e) => {
79
79
  },
80
80
  markdownTokenName: "list_item",
81
81
  parseMarkdown: (t, e) => {
82
+ var s;
82
83
  if (t.type !== "list_item")
83
84
  return [];
84
- let s = [];
85
+ const n = (s = e.parseBlockChildren) != null ? s : e.parseChildren;
86
+ let r = [];
85
87
  if (t.tokens && t.tokens.length > 0)
86
- if (t.tokens.some((n) => n.type === "paragraph"))
87
- s = e.parseChildren(t.tokens);
88
+ if (t.tokens.some((c) => c.type === "paragraph"))
89
+ r = n(t.tokens);
88
90
  else {
89
- const n = t.tokens[0];
90
- if (n && n.type === "text" && n.tokens && n.tokens.length > 0) {
91
- if (s = [
91
+ const c = t.tokens[0];
92
+ if (c && c.type === "text" && c.tokens && c.tokens.length > 0) {
93
+ if (r = [
92
94
  {
93
95
  type: "paragraph",
94
- content: e.parseInline(n.tokens)
96
+ content: e.parseInline(c.tokens)
95
97
  }
96
98
  ], t.tokens.length > 1) {
97
- const d = t.tokens.slice(1), a = e.parseChildren(d);
98
- s.push(...a);
99
+ const u = t.tokens.slice(1), p = n(u);
100
+ r.push(...p);
99
101
  }
100
102
  } else
101
- s = e.parseChildren(t.tokens);
103
+ r = n(t.tokens);
102
104
  }
103
- return s.length === 0 && (s = [
105
+ return r.length === 0 && (r = [
104
106
  {
105
107
  type: "paragraph",
106
108
  content: []
107
109
  }
108
110
  ]), {
109
111
  type: "listItem",
110
- content: s
112
+ content: r
111
113
  };
112
114
  },
113
115
  renderMarkdown: (t, e, s) => $(
114
116
  t,
115
117
  e,
116
- (r) => {
117
- var n, i;
118
- return r.parentType === "bulletList" ? "- " : r.parentType === "orderedList" ? `${(((i = (n = r.meta) == null ? void 0 : n.parentAttrs) == null ? void 0 : i.start) || 1) + r.index}. ` : "- ";
118
+ (n) => {
119
+ var r, i;
120
+ return n.parentType === "bulletList" ? "- " : n.parentType === "orderedList" ? `${(((i = (r = n.meta) == null ? void 0 : r.parentAttrs) == null ? void 0 : i.start) || 1) + n.index}. ` : "- ";
119
121
  },
120
122
  s
121
123
  ),
@@ -137,35 +139,35 @@ G(J, {
137
139
  hasListItemBefore: () => P,
138
140
  listItemHasSubList: () => D,
139
141
  nextListIsDeeper: () => R,
140
- nextListIsHigher: () => j
142
+ nextListIsHigher: () => B
141
143
  });
142
144
  var y = (t, e) => {
143
- const { $from: s } = e.selection, r = S(t, e.schema);
144
- let n = null, i = s.depth, d = s.pos, a = null;
145
+ const { $from: s } = e.selection, n = S(t, e.schema);
146
+ let r = null, i = s.depth, c = s.pos, a = null;
145
147
  for (; i > 0 && a === null; )
146
- n = s.node(i), n.type === r ? a = i : (i -= 1, d -= 1);
147
- return a === null ? null : { $pos: e.doc.resolve(d), depth: a };
148
+ r = s.node(i), r.type === n ? a = i : (i -= 1, c -= 1);
149
+ return a === null ? null : { $pos: e.doc.resolve(c), depth: a };
148
150
  }, A = (t, e) => {
149
151
  const s = y(t, e);
150
152
  if (!s)
151
153
  return !1;
152
- const [, r] = z(e, t, s.$pos.pos + 4);
153
- return r;
154
+ const [, n] = z(e, t, s.$pos.pos + 4);
155
+ return n;
154
156
  }, _ = (t, e, s) => {
155
- const { $anchor: r } = t.selection, n = Math.max(0, r.pos - 2), i = t.doc.resolve(n).node();
157
+ const { $anchor: n } = t.selection, r = Math.max(0, n.pos - 2), i = t.doc.resolve(r).node();
156
158
  return !(!i || !s.includes(i.type.name));
157
159
  }, P = (t, e) => {
158
160
  var s;
159
- const { $anchor: r } = e.selection, n = e.doc.resolve(r.pos - 2);
160
- return !(n.index() === 0 || ((s = n.nodeBefore) == null ? void 0 : s.type.name) !== t);
161
+ const { $anchor: n } = e.selection, r = e.doc.resolve(n.pos - 2);
162
+ return !(r.index() === 0 || ((s = r.nodeBefore) == null ? void 0 : s.type.name) !== t);
161
163
  }, D = (t, e, s) => {
162
164
  if (!s)
163
165
  return !1;
164
- const r = S(t, e.schema);
165
- let n = !1;
166
+ const n = S(t, e.schema);
167
+ let r = !1;
166
168
  return s.descendants((i) => {
167
- i.type === r && (n = !0);
168
- }), n;
169
+ i.type === n && (r = !0);
170
+ }), r;
169
171
  }, T = (t, e, s) => {
170
172
  if (t.commands.undoInputRule())
171
173
  return !0;
@@ -173,8 +175,8 @@ var y = (t, e) => {
173
175
  return !1;
174
176
  if (!I(t.state, e) && _(t.state, e, s)) {
175
177
  const { $anchor: a } = t.state.selection, u = t.state.doc.resolve(a.before() - 1), p = [];
176
- u.node().descendants((c, l) => {
177
- c.type.name === e && p.push({ node: c, pos: l });
178
+ u.node().descendants((l, d) => {
179
+ l.type.name === e && p.push({ node: l, pos: d });
178
180
  });
179
181
  const h = p.at(-1);
180
182
  if (!h)
@@ -184,26 +186,26 @@ var y = (t, e) => {
184
186
  }
185
187
  if (!I(t.state, e) || !V(t.state))
186
188
  return !1;
187
- const r = y(e, t.state);
188
- if (!r)
189
+ const n = y(e, t.state);
190
+ if (!n)
189
191
  return !1;
190
- const i = t.state.doc.resolve(r.$pos.pos - 2).node(r.depth), d = D(e, t.state, i);
191
- return P(e, t.state) && !d ? t.commands.joinItemBackward() : t.chain().liftListItem(e).run();
192
+ const i = t.state.doc.resolve(n.$pos.pos - 2).node(n.depth), c = D(e, t.state, i);
193
+ return P(e, t.state) && !c ? t.commands.joinItemBackward() : t.chain().liftListItem(e).run();
192
194
  }, R = (t, e) => {
193
- const s = A(t, e), r = y(t, e);
194
- return !r || !s ? !1 : s > r.depth;
195
- }, j = (t, e) => {
196
- const s = A(t, e), r = y(t, e);
197
- return !r || !s ? !1 : s < r.depth;
195
+ const s = A(t, e), n = y(t, e);
196
+ return !n || !s ? !1 : s > n.depth;
197
+ }, B = (t, e) => {
198
+ const s = A(t, e), n = y(t, e);
199
+ return !n || !s ? !1 : s < n.depth;
198
200
  }, M = (t, e) => {
199
201
  if (!I(t.state, e) || !X(t.state, e))
200
202
  return !1;
201
- const { selection: s } = t.state, { $from: r, $to: n } = s;
202
- return !s.empty && r.sameParent(n) ? !1 : R(e, t.state) ? t.chain().focus(t.state.selection.from + 4).lift(e).joinBackward().run() : j(e, t.state) ? t.chain().joinForward().joinBackward().run() : t.commands.joinItemForward();
203
+ const { selection: s } = t.state, { $from: n, $to: r } = s;
204
+ return !s.empty && n.sameParent(r) ? !1 : R(e, t.state) ? t.chain().focus(t.state.selection.from + 4).lift(e).joinBackward().run() : B(e, t.state) ? t.chain().joinForward().joinBackward().run() : t.commands.joinItemForward();
203
205
  }, Q = (t, e) => {
204
206
  var s;
205
- const { $anchor: r } = e.selection, n = e.doc.resolve(r.pos - r.parentOffset - 2);
206
- return !(n.index() === n.parent.childCount - 1 || ((s = n.nodeAfter) == null ? void 0 : s.type.name) !== t);
207
+ const { $anchor: n } = e.selection, r = e.doc.resolve(n.pos - n.parentOffset - 2);
208
+ return !(r.index() === r.parent.childCount - 1 || ((s = r.nodeAfter) == null ? void 0 : s.type.name) !== t);
207
209
  }, U = O.create({
208
210
  name: "listKeymap",
209
211
  addOptions() {
@@ -236,14 +238,14 @@ var y = (t, e) => {
236
238
  },
237
239
  Backspace: ({ editor: t }) => {
238
240
  let e = !1;
239
- return this.options.listTypes.forEach(({ itemName: s, wrapperNames: r }) => {
240
- t.state.schema.nodes[s] !== void 0 && T(t, s, r) && (e = !0);
241
+ return this.options.listTypes.forEach(({ itemName: s, wrapperNames: n }) => {
242
+ t.state.schema.nodes[s] !== void 0 && T(t, s, n) && (e = !0);
241
243
  }), e;
242
244
  },
243
245
  "Mod-Backspace": ({ editor: t }) => {
244
246
  let e = !1;
245
- return this.options.listTypes.forEach(({ itemName: s, wrapperNames: r }) => {
246
- t.state.schema.nodes[s] !== void 0 && T(t, s, r) && (e = !0);
247
+ return this.options.listTypes.forEach(({ itemName: s, wrapperNames: n }) => {
248
+ t.state.schema.nodes[s] !== void 0 && T(t, s, n) && (e = !0);
247
249
  }), e;
248
250
  }
249
251
  };
@@ -251,24 +253,24 @@ var y = (t, e) => {
251
253
  }), N = /^(\s*)(\d+)\.\s+(.*)$/, Z = /^\s/;
252
254
  function tt(t) {
253
255
  const e = [];
254
- let s = 0, r = 0;
256
+ let s = 0, n = 0;
255
257
  for (; s < t.length; ) {
256
- const n = t[s], i = n.match(N);
258
+ const r = t[s], i = r.match(N);
257
259
  if (!i)
258
260
  break;
259
- const [, d, a, u] = i, p = d.length;
261
+ const [, c, a, u] = i, p = c.length;
260
262
  let h = u, o = s + 1;
261
- const c = [n];
263
+ const l = [r];
262
264
  for (; o < t.length; ) {
263
- const l = t[o];
264
- if (l.match(N))
265
+ const d = t[o];
266
+ if (d.match(N))
265
267
  break;
266
- if (l.trim() === "")
267
- c.push(l), h += `
268
+ if (d.trim() === "")
269
+ l.push(d), h += `
268
270
  `, o += 1;
269
- else if (l.match(Z))
270
- c.push(l), h += `
271
- ${l.slice(p + 2)}`, o += 1;
271
+ else if (d.match(Z))
272
+ l.push(d), h += `
273
+ ${d.slice(p + 2)}`, o += 1;
272
274
  else
273
275
  break;
274
276
  }
@@ -276,21 +278,21 @@ ${l.slice(p + 2)}`, o += 1;
276
278
  indent: p,
277
279
  number: parseInt(a, 10),
278
280
  content: h.trim(),
279
- raw: c.join(`
281
+ raw: l.join(`
280
282
  `)
281
- }), r = o, s = o;
283
+ }), n = o, s = o;
282
284
  }
283
- return [e, r];
285
+ return [e, n];
284
286
  }
285
- function B(t, e, s) {
286
- var r;
287
- const n = [];
287
+ function j(t, e, s) {
288
+ var n;
289
+ const r = [];
288
290
  let i = 0;
289
291
  for (; i < t.length; ) {
290
- const d = t[i];
291
- if (d.indent === e) {
292
- const a = d.content.split(`
293
- `), u = ((r = a[0]) == null ? void 0 : r.trim()) || "", p = [];
292
+ const c = t[i];
293
+ if (c.indent === e) {
294
+ const a = c.content.split(`
295
+ `), u = ((n = a[0]) == null ? void 0 : n.trim()) || "", p = [];
294
296
  u && p.push({
295
297
  type: "paragraph",
296
298
  raw: u,
@@ -299,55 +301,55 @@ function B(t, e, s) {
299
301
  const h = a.slice(1).join(`
300
302
  `).trim();
301
303
  if (h) {
302
- const l = s.blockTokens(h);
303
- p.push(...l);
304
+ const d = s.blockTokens(h);
305
+ p.push(...d);
304
306
  }
305
307
  let o = i + 1;
306
- const c = [];
308
+ const l = [];
307
309
  for (; o < t.length && t[o].indent > e; )
308
- c.push(t[o]), o += 1;
309
- if (c.length > 0) {
310
- const l = Math.min(...c.map((m) => m.indent)), k = B(c, l, s);
310
+ l.push(t[o]), o += 1;
311
+ if (l.length > 0) {
312
+ const d = Math.min(...l.map((m) => m.indent)), k = j(l, d, s);
311
313
  p.push({
312
314
  type: "list",
313
315
  ordered: !0,
314
- start: c[0].number,
316
+ start: l[0].number,
315
317
  items: k,
316
- raw: c.map((m) => m.raw).join(`
318
+ raw: l.map((m) => m.raw).join(`
317
319
  `)
318
320
  });
319
321
  }
320
- n.push({
322
+ r.push({
321
323
  type: "list_item",
322
- raw: d.raw,
324
+ raw: c.raw,
323
325
  tokens: p
324
326
  }), i = o;
325
327
  } else
326
328
  i += 1;
327
329
  }
328
- return n;
330
+ return r;
329
331
  }
330
332
  function et(t, e) {
331
333
  return t.map((s) => {
332
334
  if (s.type !== "list_item")
333
335
  return e.parseChildren([s])[0];
334
- const r = [];
335
- return s.tokens && s.tokens.length > 0 && s.tokens.forEach((n) => {
336
- if (n.type === "paragraph" || n.type === "list" || n.type === "blockquote" || n.type === "code")
337
- r.push(...e.parseChildren([n]));
338
- else if (n.type === "text" && n.tokens) {
339
- const i = e.parseChildren([n]);
340
- r.push({
336
+ const n = [];
337
+ return s.tokens && s.tokens.length > 0 && s.tokens.forEach((r) => {
338
+ if (r.type === "paragraph" || r.type === "list" || r.type === "blockquote" || r.type === "code")
339
+ n.push(...e.parseChildren([r]));
340
+ else if (r.type === "text" && r.tokens) {
341
+ const i = e.parseChildren([r]);
342
+ n.push({
341
343
  type: "paragraph",
342
344
  content: i
343
345
  });
344
346
  } else {
345
- const i = e.parseChildren([n]);
346
- i.length > 0 && r.push(...i);
347
+ const i = e.parseChildren([r]);
348
+ i.length > 0 && n.push(...i);
347
349
  }
348
350
  }), {
349
351
  type: "listItem",
350
- content: r
352
+ content: n
351
353
  };
352
354
  });
353
355
  }
@@ -392,14 +394,14 @@ var st = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, nt = g.create({
392
394
  parseMarkdown: (t, e) => {
393
395
  if (t.type !== "list" || !t.ordered)
394
396
  return [];
395
- const s = t.start || 1, r = t.items ? et(t.items, e) : [];
397
+ const s = t.start || 1, n = t.items ? et(t.items, e) : [];
396
398
  return s !== 1 ? {
397
399
  type: "orderedList",
398
400
  attrs: { start: s },
399
- content: r
401
+ content: n
400
402
  } : {
401
403
  type: "orderedList",
402
- content: r
404
+ content: n
403
405
  };
404
406
  },
405
407
  renderMarkdown: (t, e) => t.content ? e.renderChildren(t.content, `
@@ -412,18 +414,18 @@ var st = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, nt = g.create({
412
414
  return s !== void 0 ? s : -1;
413
415
  },
414
416
  tokenize: (t, e, s) => {
415
- var r;
416
- const n = t.split(`
417
- `), [i, d] = tt(n);
417
+ var n;
418
+ const r = t.split(`
419
+ `), [i, c] = tt(r);
418
420
  if (i.length === 0)
419
421
  return;
420
- const a = B(i, 0, s);
422
+ const a = j(i, 0, s);
421
423
  return a.length === 0 ? void 0 : {
422
424
  type: "list",
423
425
  ordered: !0,
424
- start: ((r = i[0]) == null ? void 0 : r.number) || 1,
426
+ start: ((n = i[0]) == null ? void 0 : n.number) || 1,
425
427
  items: a,
426
- raw: n.slice(0, d).join(`
428
+ raw: r.slice(0, c).join(`
427
429
  `)
428
430
  };
429
431
  }
@@ -518,15 +520,15 @@ var st = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, nt = g.create({
518
520
  parseMarkdown: (t, e) => {
519
521
  const s = [];
520
522
  if (t.tokens && t.tokens.length > 0 ? s.push(e.createNode("paragraph", {}, e.parseInline(t.tokens))) : t.text ? s.push(e.createNode("paragraph", {}, [e.createNode("text", { text: t.text })])) : s.push(e.createNode("paragraph", {}, [])), t.nestedTokens && t.nestedTokens.length > 0) {
521
- const r = e.parseChildren(t.nestedTokens);
522
- s.push(...r);
523
+ const n = e.parseChildren(t.nestedTokens);
524
+ s.push(...n);
523
525
  }
524
526
  return e.createNode("taskItem", { checked: t.checked || !1 }, s);
525
527
  },
526
528
  renderMarkdown: (t, e) => {
527
529
  var s;
528
- const n = `- [${(s = t.attrs) != null && s.checked ? "x" : " "}] `;
529
- return $(t, e, n);
530
+ const r = `- [${(s = t.attrs) != null && s.checked ? "x" : " "}] `;
531
+ return $(t, e, r);
530
532
  },
531
533
  addKeyboardShortcuts() {
532
534
  const t = {
@@ -539,45 +541,45 @@ var st = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, nt = g.create({
539
541
  } : t;
540
542
  },
541
543
  addNodeView() {
542
- return ({ node: t, HTMLAttributes: e, getPos: s, editor: r }) => {
543
- const n = document.createElement("li"), i = document.createElement("label"), d = document.createElement("span"), a = document.createElement("input"), u = document.createElement("div"), p = (o) => {
544
- var c, l;
545
- a.ariaLabel = ((l = (c = this.options.a11y) == null ? void 0 : c.checkboxLabel) == null ? void 0 : l.call(c, o, a.checked)) || `Task item checkbox for ${o.textContent || "empty task item"}`;
544
+ return ({ node: t, HTMLAttributes: e, getPos: s, editor: n }) => {
545
+ const r = document.createElement("li"), i = document.createElement("label"), c = document.createElement("span"), a = document.createElement("input"), u = document.createElement("div"), p = (o) => {
546
+ var l, d;
547
+ a.ariaLabel = ((d = (l = this.options.a11y) == null ? void 0 : l.checkboxLabel) == null ? void 0 : d.call(l, o, a.checked)) || `Task item checkbox for ${o.textContent || "empty task item"}`;
546
548
  };
547
549
  p(t), i.contentEditable = "false", a.type = "checkbox", a.addEventListener("mousedown", (o) => o.preventDefault()), a.addEventListener("change", (o) => {
548
- if (!r.isEditable && !this.options.onReadOnlyChecked) {
550
+ if (!n.isEditable && !this.options.onReadOnlyChecked) {
549
551
  a.checked = !a.checked;
550
552
  return;
551
553
  }
552
- const { checked: c } = o.target;
553
- r.isEditable && typeof s == "function" && r.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: l }) => {
554
+ const { checked: l } = o.target;
555
+ n.isEditable && typeof s == "function" && n.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: d }) => {
554
556
  const k = s();
555
557
  if (typeof k != "number")
556
558
  return !1;
557
- const m = l.doc.nodeAt(k);
558
- return l.setNodeMarkup(k, void 0, {
559
+ const m = d.doc.nodeAt(k);
560
+ return d.setNodeMarkup(k, void 0, {
559
561
  ...m == null ? void 0 : m.attrs,
560
- checked: c
562
+ checked: l
561
563
  }), !0;
562
- }).run(), !r.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(t, c) || (a.checked = !a.checked));
563
- }), Object.entries(this.options.HTMLAttributes).forEach(([o, c]) => {
564
- n.setAttribute(o, c);
565
- }), n.dataset.checked = t.attrs.checked, a.checked = t.attrs.checked, i.append(a, d), n.append(i, u), Object.entries(e).forEach(([o, c]) => {
566
- n.setAttribute(o, c);
564
+ }).run(), !n.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(t, l) || (a.checked = !a.checked));
565
+ }), Object.entries(this.options.HTMLAttributes).forEach(([o, l]) => {
566
+ r.setAttribute(o, l);
567
+ }), r.dataset.checked = t.attrs.checked, a.checked = t.attrs.checked, i.append(a, c), r.append(i, u), Object.entries(e).forEach(([o, l]) => {
568
+ r.setAttribute(o, l);
567
569
  });
568
570
  let h = new Set(Object.keys(e));
569
571
  return {
570
- dom: n,
572
+ dom: r,
571
573
  contentDOM: u,
572
574
  update: (o) => {
573
575
  if (o.type !== this.type)
574
576
  return !1;
575
- n.dataset.checked = o.attrs.checked, a.checked = o.attrs.checked, p(o);
576
- const c = r.extensionManager.attributes, l = K(o, c), k = new Set(Object.keys(l)), m = this.options.HTMLAttributes;
577
+ r.dataset.checked = o.attrs.checked, a.checked = o.attrs.checked, p(o);
578
+ const l = n.extensionManager.attributes, d = K(o, l), k = new Set(Object.keys(d)), m = this.options.HTMLAttributes;
577
579
  return h.forEach((f) => {
578
- k.has(f) || (f in m ? n.setAttribute(f, m[f]) : n.removeAttribute(f));
579
- }), Object.entries(l).forEach(([f, v]) => {
580
- v == null ? f in m ? n.setAttribute(f, m[f]) : n.removeAttribute(f) : n.setAttribute(f, v);
580
+ k.has(f) || (f in m ? r.setAttribute(f, m[f]) : r.removeAttribute(f));
581
+ }), Object.entries(d).forEach(([f, v]) => {
582
+ v == null ? f in m ? r.setAttribute(f, m[f]) : r.removeAttribute(f) : r.setAttribute(f, v);
581
583
  }), h = k, !0;
582
584
  }
583
585
  };
@@ -629,8 +631,8 @@ var st = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, nt = g.create({
629
631
  return s !== void 0 ? s : -1;
630
632
  },
631
633
  tokenize(t, e, s) {
632
- const r = (i) => {
633
- const d = x(
634
+ const n = (i) => {
635
+ const c = x(
634
636
  i,
635
637
  {
636
638
  itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
@@ -650,18 +652,18 @@ var st = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, nt = g.create({
650
652
  nestedTokens: u
651
653
  }),
652
654
  // Allow recursive nesting
653
- customNestedParser: r
655
+ customNestedParser: n
654
656
  },
655
657
  s
656
658
  );
657
- return d ? [
659
+ return c ? [
658
660
  {
659
661
  type: "taskList",
660
- raw: d.raw,
661
- items: d.items
662
+ raw: c.raw,
663
+ items: c.items
662
664
  }
663
665
  ] : s.blockTokens(i);
664
- }, n = x(
666
+ }, r = x(
665
667
  t,
666
668
  {
667
669
  itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
@@ -670,7 +672,7 @@ var st = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, nt = g.create({
670
672
  mainContent: i[4],
671
673
  checked: i[3].toLowerCase() === "x"
672
674
  }),
673
- createToken: (i, d) => ({
675
+ createToken: (i, c) => ({
674
676
  type: "taskItem",
675
677
  raw: "",
676
678
  mainContent: i.mainContent,
@@ -678,18 +680,18 @@ var st = "listItem", E = "textStyle", H = /^(\d+)\.\s$/, nt = g.create({
678
680
  checked: i.checked,
679
681
  text: i.mainContent,
680
682
  tokens: s.inlineTokens(i.mainContent),
681
- nestedTokens: d
683
+ nestedTokens: c
682
684
  }),
683
685
  // Use the recursive parser for nested content
684
- customNestedParser: r
686
+ customNestedParser: n
685
687
  },
686
688
  s
687
689
  );
688
- if (n)
690
+ if (r)
689
691
  return {
690
692
  type: "taskList",
691
- raw: n.raw,
692
- items: n.items
693
+ raw: r.raw,
694
+ items: r.items
693
695
  };
694
696
  }
695
697
  },
package/lib/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),C=require("./clsx-BWE7vnna.cjs"),l=require("react"),d=require("./index-BUTn2LY6.cjs"),f=require("./theme.cjs"),M=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),C=require("./clsx-BSBE1eoY.cjs"),l=require("react"),d=require("./index-BLrMslr7.cjs"),f=require("./theme.cjs"),M=`
2
2
  .reactjs-tiptap-editor {
3
3
  button,
4
4
  input:where([type=button]),
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx as s, Fragment as f, jsxs as T } from "react/jsx-runtime";
2
- import { E as j } from "./clsx-eGVyq7ot.js";
1
+ import { jsx as s, Fragment as f, jsxs as j } from "react/jsx-runtime";
2
+ import { E as N } from "./clsx-OumA9x-8.js";
3
3
  import { useEffect as l, useId as M } from "react";
4
- import { N as P, R as A, O, S as $ } from "./index-DHUN85fV.js";
4
+ import { U as P, V as A, W as $, X as O } from "./index-CDFAs4RT.js";
5
5
  import { useTheme as D, THEME as m } from "./theme.js";
6
6
  const H = `
7
7
  .reactjs-tiptap-editor {
@@ -160,8 +160,8 @@ function y(e, n = {}) {
160
160
  const p = x(u).filter((b) => {
161
161
  if (!["prepend", "prependQueue"].includes(b.getAttribute(g)))
162
162
  return !1;
163
- const N = Number(b.getAttribute(E) || 0);
164
- return r >= N;
163
+ const T = Number(b.getAttribute(E) || 0);
164
+ return r >= T;
165
165
  });
166
166
  if (p.length > 0)
167
167
  return u.insertBefore(i, p.at(-1).nextSibling), i;
@@ -196,7 +196,7 @@ function C(e, n, t = {}) {
196
196
  const a = y(e, t);
197
197
  return a.setAttribute(v(t), n), a;
198
198
  }
199
- function Y() {
199
+ function V() {
200
200
  const { theme: e, color: n, borderRadius: t } = D();
201
201
  return l(() => {
202
202
  const o = e || "light", r = n || "default";
@@ -223,19 +223,19 @@ function Y() {
223
223
  };
224
224
  }, [e, n, t]), /* @__PURE__ */ s(f, {});
225
225
  }
226
- function k({ editor: e, children: n }) {
226
+ function W({ editor: e, children: n }) {
227
227
  const t = M();
228
228
  return l(() => (C(H, "react-tiptap-reset"), () => {
229
229
  w("react-tiptap-reset");
230
230
  }), []), l(() => {
231
231
  e && (e.id = t);
232
- }, [t, e]), e ? /* @__PURE__ */ s("div", { className: "reactjs-tiptap-editor", children: /* @__PURE__ */ s(A, { children: /* @__PURE__ */ T(j.Provider, { value: { editor: e }, children: [
233
- /* @__PURE__ */ s(O, { delayDuration: 0, disableHoverableContent: !0, children: n }),
232
+ }, [t, e]), e ? /* @__PURE__ */ s("div", { className: "reactjs-tiptap-editor", children: /* @__PURE__ */ s(A, { children: /* @__PURE__ */ j(N.Provider, { value: { editor: e }, children: [
233
+ /* @__PURE__ */ s($, { delayDuration: 0, disableHoverableContent: !0, children: n }),
234
234
  /* @__PURE__ */ s(L, { editor: e }),
235
- /* @__PURE__ */ s($, {}),
236
- /* @__PURE__ */ s(Y, {})
235
+ /* @__PURE__ */ s(O, {}),
236
+ /* @__PURE__ */ s(V, {})
237
237
  ] }) }) }) : /* @__PURE__ */ s(f, {});
238
238
  }
239
239
  export {
240
- k as RichTextProvider
240
+ W as RichTextProvider
241
241
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-popover";
3
3
  import * as c from "react";
4
- import { c as s } from "./index-DHUN85fV.js";
4
+ import { c as s } from "./index-CDFAs4RT.js";
5
5
  const x = t.Root, p = t.Trigger, n = c.forwardRef(({ className: o, align: r = "center", sideOffset: i = 4, ...a }, d) => /* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(
6
6
  t.Content,
7
7
  {
@@ -1 +1 @@
1
- "use strict";const a=require("react/jsx-runtime"),d=require("@radix-ui/react-popover"),p=require("react"),h=require("./index-BUTn2LY6.cjs");function n(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const o=n(d),l=n(p),x=o.Root,m=o.Trigger,c=l.forwardRef(({className:t,align:r="center",sideOffset:e=4,...i},s)=>a.jsx(o.Portal,{children:a.jsx(o.Content,{align:r,"data-richtext-portal":!0,ref:s,sideOffset:e,className:h.cn("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border !richtext-border-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...i})}));c.displayName=o.Content.displayName;exports.Popover=x;exports.PopoverContent=c;exports.PopoverTrigger=m;
1
+ "use strict";const a=require("react/jsx-runtime"),d=require("@radix-ui/react-popover"),p=require("react"),h=require("./index-BLrMslr7.cjs");function n(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const o=n(d),l=n(p),x=o.Root,m=o.Trigger,c=l.forwardRef(({className:t,align:r="center",sideOffset:e=4,...i},s)=>a.jsx(o.Portal,{children:a.jsx(o.Content,{align:r,"data-richtext-portal":!0,ref:s,sideOffset:e,className:h.cn("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border !richtext-border-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",t),...i})}));c.displayName=o.Content.displayName;exports.Popover=x;exports.PopoverContent=c;exports.PopoverTrigger=m;
@@ -1,5 +1,5 @@
1
- import { R as i } from "./clsx-eGVyq7ot.js";
2
- import { u as r } from "./updatePosition-CBRjbQMH.js";
1
+ import { R as i } from "./clsx-OumA9x-8.js";
2
+ import { u as r } from "./updatePosition-DYuAiqx-.js";
3
3
  function l(o) {
4
4
  return () => {
5
5
  let e;
@@ -1 +1 @@
1
- "use strict";const i=require("./clsx-BWE7vnna.cjs"),r=require("./updatePosition-CfmY5Trk.cjs");function d(o){return()=>{let e;return{onStart:t=>{t.clientRect&&(e=new i.ReactRenderer(o,{props:t,editor:t.editor}),e.element.style.position="absolute",document.body.appendChild(e.element),r.updatePosition(t.editor,e.element))},onUpdate(t){e.updateProps(t),t.clientRect&&r.updatePosition(t.editor,e.element)},onKeyDown(t){var n;return t.event.key==="Escape"?(e.destroy(),e.element.remove(),!0):(n=e.ref)==null?void 0:n.onKeyDown(t)},onExit(){e.destroy(),e.element.remove()}}}}exports.renderNodeViewClosure=d;
1
+ "use strict";const i=require("./clsx-BSBE1eoY.cjs"),r=require("./updatePosition-D6AScA-1.cjs");function d(o){return()=>{let e;return{onStart:t=>{t.clientRect&&(e=new i.ReactRenderer(o,{props:t,editor:t.editor}),e.element.style.position="absolute",document.body.appendChild(e.element),r.updatePosition(t.editor,e.element))},onUpdate(t){e.updateProps(t),t.clientRect&&r.updatePosition(t.editor,e.element)},onKeyDown(t){var n;return t.event.key==="Escape"?(e.destroy(),e.element.remove(),!0):(n=e.ref)==null?void 0:n.onKeyDown(t)},onExit(){e.destroy(),e.element.remove()}}}}exports.renderNodeViewClosure=d;