reactjs-tiptap-editor 1.0.18 → 1.0.20

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 (156) hide show
  1. package/lib/{ActionMenuButton-Df077oOH.cjs → ActionMenuButton-BPgqKDXT.cjs} +1 -1
  2. package/lib/{ActionMenuButton-BOjCHFTA.js → ActionMenuButton-CMXWxvWu.js} +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 +20 -44
  18. package/lib/CodeBlock.js +1385 -4012
  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-DwrlY_lY.cjs → Drawer-BivLAzMN.cjs} +1 -1
  26. package/lib/{Drawer-DxOoRiGQ.js → Drawer-BmVmgJsc.js} +3 -3
  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-AhNV5WH5.js → Iframe-CAUrccA0.js} +7 -7
  50. package/lib/{Iframe-C6pBw-AF.cjs → Iframe-hwg9FxhU.cjs} +1 -1
  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-DZ5PcJA4.js → Indent-3MoIatX1.js} +2 -2
  60. package/lib/{Indent-Do-X0AsY.cjs → Indent-MuSU0kXz.cjs} +1 -1
  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-BPQ7_A3w.cjs +4 -0
  66. package/lib/{Katex-bIgoenn_.js → Katex-xS-XZKQc.js} +398 -421
  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-B0ZaACZO.cjs → LinkEditBlock-DLDY-8Ax.cjs} +1 -1
  74. package/lib/{LinkEditBlock-D_cF9fnc.js → LinkEditBlock-Dhvz7DCA.js} +26 -26
  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-CavaOSwo.cjs} +1 -1
  90. package/lib/{SlashCommandNodeView-cg0x3NRF.js → SlashCommandNodeView-RnDRm4Z1.js} +6 -6
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +2 -2
  93. package/lib/{Table-KqLiT5wG.js → Table-DN4TuDz1.js} +35 -35
  94. package/lib/{Table-ddU2LSc6.cjs → Table-m32ZhtxF.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-C1Lzqc7u.js → Twitter-B2FDarxE.js} +9 -9
  106. package/lib/{Twitter-BIiR78Jh.cjs → Twitter-CJhQLKYS.cjs} +1 -1
  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/_commonjsHelpers-B4e78b8K.js +28 -0
  112. package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
  113. package/lib/bubble.cjs +6 -6
  114. package/lib/bubble.js +2136 -1822
  115. package/lib/{clsx-eGVyq7ot.js → clsx-Bg-2aTKh.js} +11 -11
  116. package/lib/{clsx-BWE7vnna.cjs → clsx-DSAWW32g.cjs} +1 -1
  117. package/lib/components/Bubble/RichTextBubbleCodeBlock.d.ts +1 -0
  118. package/lib/components/Bubble/index.d.ts +1 -0
  119. package/lib/{dropdown-menu-oSKIntXM.cjs → dropdown-menu-C0VlKIZC.cjs} +1 -1
  120. package/lib/{dropdown-menu-CexIkt_V.js → dropdown-menu-CWd8VVRO.js} +1 -1
  121. package/lib/extensions/CodeBlock/CodeBlock.d.ts +3 -18
  122. package/lib/extensions/Image/Image.d.ts +1 -0
  123. package/lib/{index-DHUN85fV.js → index-B2a7NqnN.js} +1149 -1019
  124. package/lib/{index-D0lc95kr.cjs → index-C3dgmjIF.cjs} +1 -1
  125. package/lib/{index-zig3Dj7A.cjs → index-C4WLt4NA.cjs} +9 -7
  126. package/lib/{index-RIXs7STX.js → index-CbkpBnTX.js} +1 -1
  127. package/lib/{index-BnW6t8z6.js → index-CjLxMm5d.js} +1 -1
  128. package/lib/{index-mfGK4pFo.js → index-D0EmqTpe.js} +167 -153
  129. package/lib/{index-C6xmkxrQ.js → index-DXtVL0al.js} +140 -138
  130. package/lib/{index-CJ9pyCM4.cjs → index-DlxZt4_j.cjs} +1 -1
  131. package/lib/{index-D_8P0LE5.js → index-P5_MyY0i.js} +1 -1
  132. package/lib/{index-DUpSE1Gb.cjs → index-TcJ2UKnv.cjs} +1 -1
  133. package/lib/index-czmcFIW7.cjs +1 -0
  134. package/lib/index-fbGGohBT.cjs +12 -0
  135. package/lib/index.cjs +1 -1
  136. package/lib/index.js +12 -12
  137. package/lib/{popover-BYSZ3zBi.js → popover-BrSDMb_n.js} +1 -1
  138. package/lib/{popover-BcHDZqBt.cjs → popover-UUKfPWue.cjs} +1 -1
  139. package/lib/{renderNodeView-BrM5kUj_.js → renderNodeView-CbxCTni3.js} +2 -2
  140. package/lib/{renderNodeView-D1zydtli.cjs → renderNodeView-DFVrJy0l.cjs} +1 -1
  141. package/lib/{separator-BmixLrnJ.cjs → separator-LH5EzF0T.cjs} +1 -1
  142. package/lib/{separator-CFKVxAea.js → separator-fpWkZkoh.js} +14 -14
  143. package/lib/style.css +1 -1
  144. package/lib/{updatePosition-CBRjbQMH.js → updatePosition-BGD41Hbg.js} +2 -2
  145. package/lib/{updatePosition-CfmY5Trk.cjs → updatePosition-CQE1ct18.cjs} +1 -1
  146. package/package.json +4 -2
  147. package/lib/Katex-CIC9ygbL.cjs +0 -4
  148. package/lib/delete-node-CosiBes5.cjs +0 -1
  149. package/lib/delete-node-eQHsyyhR.js +0 -24
  150. package/lib/extensions/CodeBlock/components/NodeViewCodeBlock/NodeViewCodeBlock.d.ts +0 -1
  151. package/lib/index-BUTn2LY6.cjs +0 -1
  152. package/lib/index-BtxvYLJ1.cjs +0 -12
  153. package/lib/select-C5SHDLFj.js +0 -120
  154. package/lib/select-DHjzKkcu.cjs +0 -1
  155. package/lib/textarea-CasDcv3u.cjs +0 -1
  156. 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-D0EmqTpe.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
  },
@@ -1 +1 @@
1
- "use strict";const i=require("./index-zig3Dj7A.cjs");var c=20,u=(t,e=0)=>{const r=[];return!t.children.length||e>c||Array.from(t.children).forEach(o=>{o.tagName==="SPAN"?r.push(o):o.children.length&&r.push(...u(o,e+1))}),r},f=t=>{if(!t.children.length)return;const e=u(t);e&&e.forEach(r=>{var o,n;const s=r.getAttribute("style"),l=(n=(o=r.parentElement)==null?void 0:o.closest("span"))==null?void 0:n.getAttribute("style");r.setAttribute("style",`${l};${s}`)})},m=i.Mark.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&f(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",i.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(r,o)=>{if(r.isTextblock)return!0;r.marks.filter(n=>n.type===this.type).some(n=>Object.values(n.attrs).some(s=>!!s))||t.removeMark(o,o+r.nodeSize,this.type)}),!0}}}}),g=i.Extension.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const r=t.getAttribute("style");if(r){const o=r.split(";").map(n=>n.trim()).filter(Boolean);for(let n=o.length-1;n>=0;n-=1){const s=o[n].split(":");if(s.length>=2){const l=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(l==="background-color")return a.replace(/['"]+/g,"")}}}return(e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),y=i.Extension.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const r=t.getAttribute("style");if(r){const o=r.split(";").map(n=>n.trim()).filter(Boolean);for(let n=o.length-1;n>=0;n-=1){const s=o[n].split(":");if(s.length>=2){const l=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(l==="color")return a.replace(/['"]+/g,"")}}}return(e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),p=i.Extension.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),h=i.Extension.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),d=i.Extension.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});i.Extension.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(g.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(y.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(p.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(h.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(d.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(m.configure(this.options.textStyle)),t}});exports.Color=y;exports.FontFamily=p;exports.LineHeight=d;
1
+ "use strict";const i=require("./index-C4WLt4NA.cjs");var c=20,u=(t,e=0)=>{const r=[];return!t.children.length||e>c||Array.from(t.children).forEach(o=>{o.tagName==="SPAN"?r.push(o):o.children.length&&r.push(...u(o,e+1))}),r},f=t=>{if(!t.children.length)return;const e=u(t);e&&e.forEach(r=>{var o,n;const s=r.getAttribute("style"),l=(n=(o=r.parentElement)==null?void 0:o.closest("span"))==null?void 0:n.getAttribute("style");r.setAttribute("style",`${l};${s}`)})},m=i.Mark.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&f(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",i.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(r,o)=>{if(r.isTextblock)return!0;r.marks.filter(n=>n.type===this.type).some(n=>Object.values(n.attrs).some(s=>!!s))||t.removeMark(o,o+r.nodeSize,this.type)}),!0}}}}),g=i.Extension.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const r=t.getAttribute("style");if(r){const o=r.split(";").map(n=>n.trim()).filter(Boolean);for(let n=o.length-1;n>=0;n-=1){const s=o[n].split(":");if(s.length>=2){const l=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(l==="background-color")return a.replace(/['"]+/g,"")}}}return(e=t.style.backgroundColor)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),y=i.Extension.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const r=t.getAttribute("style");if(r){const o=r.split(";").map(n=>n.trim()).filter(Boolean);for(let n=o.length-1;n>=0;n-=1){const s=o[n].split(":");if(s.length>=2){const l=s[0].trim().toLowerCase(),a=s.slice(1).join(":").trim();if(l==="color")return a.replace(/['"]+/g,"")}}}return(e=t.style.color)==null?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),p=i.Extension.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),h=i.Extension.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize,renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),d=i.Extension.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight,renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});i.Extension.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(g.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(y.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(p.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(h.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(d.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(m.configure(this.options.textStyle)),t}});exports.Color=y;exports.FontFamily=p;exports.LineHeight=d;
@@ -1,6 +1,6 @@
1
1
  import { PluginKey as Gt, Plugin as Jt } from "@tiptap/pm/state";
2
2
  import { DecorationSet as Qt, Decoration as Zt } from "@tiptap/pm/view";
3
- import { I as te } from "./index-mfGK4pFo.js";
3
+ import { I as te } from "./index-D0EmqTpe.js";
4
4
  const kt = ["top", "right", "bottom", "left"], At = ["start", "end"], Ct = /* @__PURE__ */ kt.reduce((t, e) => t.concat(e, e + "-" + At[0], e + "-" + At[1]), []), X = Math.min, M = Math.max, ct = Math.round, V = (t) => ({
5
5
  x: t,
6
6
  y: t