quoin-editor 1.0.0 → 1.0.2

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 (213) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/ai.cjs +135 -94
  3. package/dist/ai.cjs.map +1 -1
  4. package/dist/ai.d.cts +1 -1
  5. package/dist/ai.d.ts +1 -1
  6. package/dist/ai.js +62 -21
  7. package/dist/ai.js.map +1 -1
  8. package/dist/catalogue.cjs +25 -25
  9. package/dist/catalogue.d.cts +6 -6
  10. package/dist/catalogue.d.ts +6 -6
  11. package/dist/catalogue.js +17 -17
  12. package/dist/{chunk-ND5XJVK2.cjs → chunk-4SLJNZSM.cjs} +27 -23
  13. package/dist/chunk-4SLJNZSM.cjs.map +1 -0
  14. package/dist/{chunk-LCQSG4M6.js → chunk-4XFXB37X.js} +22 -18
  15. package/dist/chunk-4XFXB37X.js.map +1 -0
  16. package/dist/{chunk-AEJXZBVR.cjs → chunk-5MAYUGTE.cjs} +110 -103
  17. package/dist/chunk-5MAYUGTE.cjs.map +1 -0
  18. package/dist/{chunk-JDPTZUBW.js → chunk-623AOJM2.js} +4 -4
  19. package/dist/chunk-6NULZPVC.js +374 -0
  20. package/dist/chunk-6NULZPVC.js.map +1 -0
  21. package/dist/{chunk-2QCRZ7OL.cjs → chunk-6V6GGBDK.cjs} +12 -11
  22. package/dist/{chunk-2QCRZ7OL.cjs.map → chunk-6V6GGBDK.cjs.map} +1 -1
  23. package/dist/{chunk-WXMYDXPN.cjs → chunk-73653CJ4.cjs} +4 -3
  24. package/dist/chunk-73653CJ4.cjs.map +1 -0
  25. package/dist/{chunk-47MLKSI2.js → chunk-ADSJ42DO.js} +6 -6
  26. package/dist/{chunk-PWUEPDA3.cjs → chunk-AUOEM3SF.cjs} +44 -44
  27. package/dist/{chunk-PWUEPDA3.cjs.map → chunk-AUOEM3SF.cjs.map} +1 -1
  28. package/dist/{chunk-WQHV3MRE.cjs → chunk-BQANU5BH.cjs} +12 -12
  29. package/dist/{chunk-WQHV3MRE.cjs.map → chunk-BQANU5BH.cjs.map} +1 -1
  30. package/dist/{chunk-KXOBZGQO.js → chunk-C23RQVRK.js} +21 -14
  31. package/dist/chunk-C23RQVRK.js.map +1 -0
  32. package/dist/{chunk-2VDK27IF.cjs → chunk-CW3AFJBR.cjs} +312 -342
  33. package/dist/chunk-CW3AFJBR.cjs.map +1 -0
  34. package/dist/{chunk-MQ2XQ4MX.js → chunk-DUE3HCZD.js} +6 -6
  35. package/dist/chunk-DUE3HCZD.js.map +1 -0
  36. package/dist/{chunk-OMOBMXD5.cjs → chunk-EH5KXQXY.cjs} +7 -2
  37. package/dist/chunk-EH5KXQXY.cjs.map +1 -0
  38. package/dist/{chunk-ZS2WA357.js → chunk-EPARJI4V.js} +147 -129
  39. package/dist/chunk-EPARJI4V.js.map +1 -0
  40. package/dist/{chunk-HZSSEYJS.cjs → chunk-FDRUAL3Z.cjs} +30 -30
  41. package/dist/{chunk-HZSSEYJS.cjs.map → chunk-FDRUAL3Z.cjs.map} +1 -1
  42. package/dist/{chunk-T7SW6OWV.js → chunk-IQBMAE3F.js} +5 -5
  43. package/dist/{chunk-RUDWMKYX.js → chunk-JHQUHFLX.js} +8 -8
  44. package/dist/{chunk-HELJTLNC.cjs → chunk-KUYZMSMF.cjs} +12 -12
  45. package/dist/chunk-KUYZMSMF.cjs.map +1 -0
  46. package/dist/chunk-LE5XMIFJ.cjs +14 -0
  47. package/dist/chunk-LE5XMIFJ.cjs.map +1 -0
  48. package/dist/{chunk-EL2OEJQC.cjs → chunk-LLTEGXWZ.cjs} +56 -56
  49. package/dist/{chunk-EL2OEJQC.cjs.map → chunk-LLTEGXWZ.cjs.map} +1 -1
  50. package/dist/chunk-MQUCCSWG.js +14 -0
  51. package/dist/chunk-MQUCCSWG.js.map +1 -0
  52. package/dist/{chunk-NNDYYEW5.js → chunk-N4FGA3H4.js} +5 -5
  53. package/dist/{chunk-ZHOSSWUM.js → chunk-NEZJ7ZP5.js} +4 -3
  54. package/dist/chunk-NEZJ7ZP5.js.map +1 -0
  55. package/dist/{chunk-XEBWC7ZL.js → chunk-O4Z2WMFF.js} +7 -2
  56. package/dist/chunk-O4Z2WMFF.js.map +1 -0
  57. package/dist/{chunk-HJIQT3S5.js → chunk-OBMBSU2S.js} +100 -84
  58. package/dist/chunk-OBMBSU2S.js.map +1 -0
  59. package/dist/{chunk-KAVU6T6J.js → chunk-OSHZQR3W.js} +5 -5
  60. package/dist/{chunk-GTTPVJSD.cjs → chunk-P6KYXFZC.cjs} +265 -247
  61. package/dist/chunk-P6KYXFZC.cjs.map +1 -0
  62. package/dist/{chunk-CDELOHDY.cjs → chunk-R2BLBV43.cjs} +23 -23
  63. package/dist/{chunk-CDELOHDY.cjs.map → chunk-R2BLBV43.cjs.map} +1 -1
  64. package/dist/{chunk-NOKWNK2O.js → chunk-RJRX34BZ.js} +3 -2
  65. package/dist/{chunk-ZGZEJCRV.js → chunk-T43RZTUT.js} +166 -196
  66. package/dist/chunk-T43RZTUT.js.map +1 -0
  67. package/dist/chunk-TLGX43P6.cjs +374 -0
  68. package/dist/chunk-TLGX43P6.cjs.map +1 -0
  69. package/dist/{chunk-POBM7MGR.js → chunk-U3LOLYAU.js} +2 -2
  70. package/dist/{chunk-RDG4VI6E.cjs → chunk-UEKXVCKC.cjs} +103 -93
  71. package/dist/chunk-UEKXVCKC.cjs.map +1 -0
  72. package/dist/{chunk-PMWCQSQX.js → chunk-VCLL5C7J.js} +5 -5
  73. package/dist/{chunk-SG37UBDO.js → chunk-VRS6WCEK.js} +20 -10
  74. package/dist/chunk-VRS6WCEK.js.map +1 -0
  75. package/dist/{chunk-ZC24WB7Y.cjs → chunk-WEYDDIBQ.cjs} +14 -14
  76. package/dist/{chunk-ZC24WB7Y.cjs.map → chunk-WEYDDIBQ.cjs.map} +1 -1
  77. package/dist/{chunk-5DNCCN6X.cjs → chunk-X4HDKFW5.cjs} +27 -27
  78. package/dist/{chunk-5DNCCN6X.cjs.map → chunk-X4HDKFW5.cjs.map} +1 -1
  79. package/dist/{chunk-SLVDAHHK.cjs → chunk-X4P4TQXH.cjs} +5 -5
  80. package/dist/{chunk-SLVDAHHK.cjs.map → chunk-X4P4TQXH.cjs.map} +1 -1
  81. package/dist/{chunk-GLLXHMH2.cjs → chunk-XA3UEJIW.cjs} +3 -3
  82. package/dist/{chunk-GLLXHMH2.cjs.map → chunk-XA3UEJIW.cjs.map} +1 -1
  83. package/dist/{chunk-K574XHMM.js → chunk-YBMUEEM5.js} +2 -2
  84. package/dist/{chunk-PZ4GT5JO.cjs → chunk-ZKVOS57Q.cjs} +316 -300
  85. package/dist/chunk-ZKVOS57Q.cjs.map +1 -0
  86. package/dist/comments.cjs +113 -98
  87. package/dist/comments.cjs.map +1 -1
  88. package/dist/comments.d.cts +6 -1
  89. package/dist/comments.d.ts +6 -1
  90. package/dist/comments.js +32 -17
  91. package/dist/comments.js.map +1 -1
  92. package/dist/diff.cjs +44 -40
  93. package/dist/diff.cjs.map +1 -1
  94. package/dist/diff.js +17 -13
  95. package/dist/diff.js.map +1 -1
  96. package/dist/docx.cjs +60 -40
  97. package/dist/docx.cjs.map +1 -1
  98. package/dist/docx.d.cts +6 -0
  99. package/dist/docx.d.ts +6 -0
  100. package/dist/docx.js +32 -12
  101. package/dist/docx.js.map +1 -1
  102. package/dist/embed.cjs +9 -9
  103. package/dist/embed.d.cts +1 -1
  104. package/dist/embed.d.ts +1 -1
  105. package/dist/embed.js +8 -8
  106. package/dist/{emoji-extension-DpQ43HjE.d.ts → emoji-extension-CmPlRssm.d.ts} +1 -1
  107. package/dist/{emoji-extension-C12gDPm6.d.cts → emoji-extension-zJ6F7hW8.d.cts} +1 -1
  108. package/dist/emoji.cjs +8 -8
  109. package/dist/emoji.d.cts +3 -3
  110. package/dist/emoji.d.ts +3 -3
  111. package/dist/emoji.js +7 -7
  112. package/dist/engine.cjs +4 -4
  113. package/dist/engine.d.cts +2 -2
  114. package/dist/engine.d.ts +2 -2
  115. package/dist/engine.js +3 -3
  116. package/dist/{find-extension-_sbZEt3R.d.cts → find-extension-BcRyE9K4.d.cts} +1 -1
  117. package/dist/{find-extension-DKqLLSuP.d.ts → find-extension-CmFehyul.d.ts} +1 -1
  118. package/dist/find.cjs +8 -8
  119. package/dist/find.d.cts +2 -2
  120. package/dist/find.d.ts +2 -2
  121. package/dist/find.js +7 -7
  122. package/dist/headless.cjs +5 -5
  123. package/dist/headless.d.cts +4 -4
  124. package/dist/headless.d.ts +4 -4
  125. package/dist/headless.js +4 -4
  126. package/dist/{index-CgD72kHB.d.cts → index-CFPmCee4.d.cts} +5 -2
  127. package/dist/{index-DNYbTK3w.d.ts → index-DiCGV60d.d.ts} +5 -2
  128. package/dist/index.cjs +7 -7
  129. package/dist/index.d.cts +4 -4
  130. package/dist/index.d.ts +4 -4
  131. package/dist/index.js +6 -6
  132. package/dist/math.cjs +10 -10
  133. package/dist/math.d.cts +1 -1
  134. package/dist/math.d.ts +1 -1
  135. package/dist/math.js +9 -9
  136. package/dist/mention.cjs +10 -10
  137. package/dist/mention.d.cts +1 -1
  138. package/dist/mention.d.ts +1 -1
  139. package/dist/mention.js +9 -9
  140. package/dist/presence.cjs +98 -104
  141. package/dist/presence.cjs.map +1 -1
  142. package/dist/presence.d.cts +2 -2
  143. package/dist/presence.d.ts +2 -2
  144. package/dist/presence.js +66 -72
  145. package/dist/presence.js.map +1 -1
  146. package/dist/{stats-extension-Bly88uio.d.ts → stats-extension-DisOEbbI.d.ts} +1 -1
  147. package/dist/{stats-extension-CJPijvUb.d.cts → stats-extension-Dt1lgP3m.d.cts} +1 -1
  148. package/dist/stats.cjs +9 -9
  149. package/dist/stats.d.cts +3 -3
  150. package/dist/stats.d.ts +3 -3
  151. package/dist/stats.js +8 -8
  152. package/dist/styles.css +1 -1
  153. package/dist/{table-extension-Dzf4k6hI.d.ts → table-extension-BTMJnT7J.d.ts} +1 -1
  154. package/dist/{table-extension-BTLxFy2S.d.cts → table-extension-DxZz3jqp.d.cts} +1 -1
  155. package/dist/table.cjs +8 -8
  156. package/dist/table.d.cts +2 -2
  157. package/dist/table.d.ts +2 -2
  158. package/dist/table.js +7 -7
  159. package/dist/{toc-extension-DWm5alVj.d.ts → toc-extension-CR9U-l6j.d.ts} +1 -1
  160. package/dist/{toc-extension-B3-s6h2x.d.cts → toc-extension-DGHywOBv.d.cts} +1 -1
  161. package/dist/toc.cjs +8 -8
  162. package/dist/toc.d.cts +2 -2
  163. package/dist/toc.d.ts +2 -2
  164. package/dist/toc.js +7 -7
  165. package/dist/{types-a1CRBlEh.d.ts → types-C6_QkXzy.d.ts} +1 -9
  166. package/dist/{types-Cz7XJLaK.d.cts → types-CJ7Gq3GX.d.cts} +1 -9
  167. package/dist/{view-controller-DSHw0ltQ.d.cts → view-controller-BD1KwYfE.d.cts} +6 -19
  168. package/dist/{view-controller-UbpzblGl.d.ts → view-controller-y4cb60ue.d.ts} +6 -19
  169. package/dist/view.cjs +6 -6
  170. package/dist/view.js +3 -3
  171. package/dist/yjs.cjs +302 -412
  172. package/dist/yjs.cjs.map +1 -1
  173. package/dist/yjs.d.cts +3 -3
  174. package/dist/yjs.d.ts +3 -3
  175. package/dist/yjs.js +211 -321
  176. package/dist/yjs.js.map +1 -1
  177. package/package.json +1 -1
  178. package/dist/chunk-2VDK27IF.cjs.map +0 -1
  179. package/dist/chunk-AEJXZBVR.cjs.map +0 -1
  180. package/dist/chunk-E75EHRPA.cjs +0 -175
  181. package/dist/chunk-E75EHRPA.cjs.map +0 -1
  182. package/dist/chunk-GTTPVJSD.cjs.map +0 -1
  183. package/dist/chunk-HELJTLNC.cjs.map +0 -1
  184. package/dist/chunk-HJIQT3S5.js.map +0 -1
  185. package/dist/chunk-JEIFJHEI.js +0 -14
  186. package/dist/chunk-JEIFJHEI.js.map +0 -1
  187. package/dist/chunk-KXOBZGQO.js.map +0 -1
  188. package/dist/chunk-LCQSG4M6.js.map +0 -1
  189. package/dist/chunk-MQ2XQ4MX.js.map +0 -1
  190. package/dist/chunk-ND5XJVK2.cjs.map +0 -1
  191. package/dist/chunk-OMOBMXD5.cjs.map +0 -1
  192. package/dist/chunk-PZ4GT5JO.cjs.map +0 -1
  193. package/dist/chunk-QAW5NH6S.cjs +0 -14
  194. package/dist/chunk-QAW5NH6S.cjs.map +0 -1
  195. package/dist/chunk-RDG4VI6E.cjs.map +0 -1
  196. package/dist/chunk-SG37UBDO.js.map +0 -1
  197. package/dist/chunk-TC4DARU2.js +0 -175
  198. package/dist/chunk-TC4DARU2.js.map +0 -1
  199. package/dist/chunk-WXMYDXPN.cjs.map +0 -1
  200. package/dist/chunk-XEBWC7ZL.js.map +0 -1
  201. package/dist/chunk-ZGZEJCRV.js.map +0 -1
  202. package/dist/chunk-ZHOSSWUM.js.map +0 -1
  203. package/dist/chunk-ZS2WA357.js.map +0 -1
  204. /package/dist/{chunk-JDPTZUBW.js.map → chunk-623AOJM2.js.map} +0 -0
  205. /package/dist/{chunk-47MLKSI2.js.map → chunk-ADSJ42DO.js.map} +0 -0
  206. /package/dist/{chunk-T7SW6OWV.js.map → chunk-IQBMAE3F.js.map} +0 -0
  207. /package/dist/{chunk-RUDWMKYX.js.map → chunk-JHQUHFLX.js.map} +0 -0
  208. /package/dist/{chunk-NNDYYEW5.js.map → chunk-N4FGA3H4.js.map} +0 -0
  209. /package/dist/{chunk-KAVU6T6J.js.map → chunk-OSHZQR3W.js.map} +0 -0
  210. /package/dist/{chunk-NOKWNK2O.js.map → chunk-RJRX34BZ.js.map} +0 -0
  211. /package/dist/{chunk-POBM7MGR.js.map → chunk-U3LOLYAU.js.map} +0 -0
  212. /package/dist/{chunk-PMWCQSQX.js.map → chunk-VCLL5C7J.js.map} +0 -0
  213. /package/dist/{chunk-K574XHMM.js.map → chunk-YBMUEEM5.js.map} +0 -0
@@ -11,6 +11,7 @@ import {
11
11
  drawnBlockCount,
12
12
  hostKey,
13
13
  isComposingKey,
14
+ listen,
14
15
  moveToNeighbour,
15
16
  onBlock,
16
17
  regionInline,
@@ -25,14 +26,15 @@ import {
25
26
  useToggleOpen,
26
27
  visibleBlockIndexes,
27
28
  wholeState
28
- } from "./chunk-ZS2WA357.js";
29
+ } from "./chunk-EPARJI4V.js";
29
30
  import {
30
31
  blockByType,
31
32
  defineBlock,
32
33
  devWarn,
33
34
  highlightedLines,
34
- paletteBlocks
35
- } from "./chunk-XEBWC7ZL.js";
35
+ paletteBlocks,
36
+ tokenColour
37
+ } from "./chunk-O4Z2WMFF.js";
36
38
  import {
37
39
  HISTORY_GROUP,
38
40
  LINE_JOIN,
@@ -98,10 +100,10 @@ import {
98
100
  unsetLink,
99
101
  unsetMark,
100
102
  validateSelection
101
- } from "./chunk-HJIQT3S5.js";
103
+ } from "./chunk-OBMBSU2S.js";
102
104
  import {
103
105
  sameValue
104
- } from "./chunk-NOKWNK2O.js";
106
+ } from "./chunk-RJRX34BZ.js";
105
107
  import {
106
108
  PALETTE,
107
109
  SCHEME,
@@ -127,7 +129,7 @@ import {
127
129
  specFor,
128
130
  str,
129
131
  text
130
- } from "./chunk-LCQSG4M6.js";
132
+ } from "./chunk-4XFXB37X.js";
131
133
 
132
134
  // src/canvas/BlockCanvas.tsx
133
135
  import { forwardRef as forwardRef8, useImperativeHandle as useImperativeHandle2, useMemo as useMemo17, useState as useState19 } from "react";
@@ -393,7 +395,7 @@ var captionText = (markdown) => inlineText(parseInline(markdown), () => "");
393
395
  import { Fragment, useMemo as useMemo2 } from "react";
394
396
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
395
397
  function Token({ text: text2, color, className }) {
396
- return /* @__PURE__ */ jsx2("span", { style: { color }, className, children: text2 });
398
+ return /* @__PURE__ */ jsx2("span", { style: { color: tokenColour(color) }, className, children: text2 });
397
399
  }
398
400
  function HighlightOverlay({ code, language: language2, drawnRef, ...props }) {
399
401
  const { highlight } = useQuoin();
@@ -2852,12 +2854,7 @@ function useOutsidePress(element, ownerDocument, onPress) {
2852
2854
  if (touched !== null && !inside(event.target)) latest.current(touched);
2853
2855
  touched = null;
2854
2856
  };
2855
- doc.addEventListener("pointerdown", down, true);
2856
- doc.addEventListener("click", click, true);
2857
- return () => {
2858
- doc.removeEventListener("pointerdown", down, true);
2859
- doc.removeEventListener("click", click, true);
2860
- };
2857
+ return listen(doc, { pointerdown: down, click }, true);
2861
2858
  }, [element, ownerDocument]);
2862
2859
  }
2863
2860
 
@@ -3339,37 +3336,30 @@ function ListMarker(props) {
3339
3336
  return /* @__PURE__ */ jsx36("span", { className: "quoin-marker", "aria-hidden": "true", children: text2 });
3340
3337
  }
3341
3338
 
3342
- // src/blocks/text/TaskCheckbox.tsx
3343
- import { jsx as jsx37 } from "react/jsx-runtime";
3344
- function TaskCheckbox2({ block, controller, labelledBy }) {
3345
- const labels = useLabels();
3346
- return /* @__PURE__ */ jsx37(TaskCheckbox, { block, controller, label: labels.task, labelledBy });
3347
- }
3348
-
3349
3339
  // src/blocks/text/MarkdownBlock.tsx
3350
- import { jsx as jsx38, jsxs as jsxs22 } from "react/jsx-runtime";
3340
+ import { jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
3351
3341
  var REGION = "text";
3352
3342
  var HEADING_LEVELS = ["mt-6 text-3xl", "mt-5 text-2xl", "mt-4 text-xl", "mt-3 text-lg", "mt-3 text-base", "mt-3 text-sm"];
3353
3343
  var headingStyles = (level) => `quoin-heading mb-1 font-semibold leading-tight in-[[data-quoin-block]:first-child]:mt-0 ${HEADING_LEVELS[level - 1]}`;
3354
3344
  function Heading({ block }) {
3355
3345
  const labels = useLabels();
3356
3346
  const level = headingLevel(block.attrs.level);
3357
- return /* @__PURE__ */ jsx38("div", { role: "heading", "aria-level": level, className: headingStyles(level), children: /* @__PURE__ */ jsx38(EditableRegion, { block: block.id, region: REGION, label: labels.heading(level) }) });
3347
+ return /* @__PURE__ */ jsx37("div", { role: "heading", "aria-level": level, className: headingStyles(level), children: /* @__PURE__ */ jsx37(EditableRegion, { block: block.id, region: REGION, label: labels.heading(level) }) });
3358
3348
  }
3359
3349
  function NumberedItem({ block, controller }) {
3360
3350
  const labels = useLabels();
3361
3351
  const number = useOrderedNumber(controller, block.id);
3362
3352
  return /* @__PURE__ */ jsxs22("div", { className: "quoin-list-item", "data-list": "ordered", children: [
3363
- /* @__PURE__ */ jsx38(ListMarker, { list: "ordered", number, depth: block.indent }),
3364
- /* @__PURE__ */ jsx38(EditableRegion, { block: block.id, region: REGION, label: labels.numberedItem(number) })
3353
+ /* @__PURE__ */ jsx37(ListMarker, { list: "ordered", number, depth: block.indent }),
3354
+ /* @__PURE__ */ jsx37(EditableRegion, { block: block.id, region: REGION, label: labels.numberedItem(number) })
3365
3355
  ] });
3366
3356
  }
3367
3357
  function TaskItem({ block, controller }) {
3368
3358
  const labels = useLabels();
3369
3359
  const hostId = useRegionDomId(block.id, REGION);
3370
3360
  return /* @__PURE__ */ jsxs22("div", { className: "quoin-task", "data-checked": block.attrs.checked === true, children: [
3371
- /* @__PURE__ */ jsx38(TaskCheckbox2, { block, controller, labelledBy: hostId }),
3372
- /* @__PURE__ */ jsx38(EditableRegion, { id: hostId, block: block.id, region: REGION, label: labels.task })
3361
+ /* @__PURE__ */ jsx37(TaskCheckbox, { block, controller, label: labels.task, labelledBy: hostId }),
3362
+ /* @__PURE__ */ jsx37(EditableRegion, { id: hostId, block: block.id, region: REGION, label: labels.task })
3373
3363
  ] });
3374
3364
  }
3375
3365
  var MarkdownBlock = (props) => {
@@ -3377,20 +3367,20 @@ var MarkdownBlock = (props) => {
3377
3367
  const labels = useLabels();
3378
3368
  switch (block.attrs.kind) {
3379
3369
  case "heading":
3380
- return /* @__PURE__ */ jsx38(Heading, { block });
3370
+ return /* @__PURE__ */ jsx37(Heading, { block });
3381
3371
  case "bullet":
3382
3372
  return /* @__PURE__ */ jsxs22("div", { className: "quoin-list-item", "data-list": "bullet", children: [
3383
- /* @__PURE__ */ jsx38(ListMarker, { list: "bullet", depth: block.indent }),
3384
- /* @__PURE__ */ jsx38(EditableRegion, { block: block.id, region: REGION, label: labels.bulletItem })
3373
+ /* @__PURE__ */ jsx37(ListMarker, { list: "bullet", depth: block.indent }),
3374
+ /* @__PURE__ */ jsx37(EditableRegion, { block: block.id, region: REGION, label: labels.bulletItem })
3385
3375
  ] });
3386
3376
  case "ordered":
3387
- return /* @__PURE__ */ jsx38(NumberedItem, { ...props });
3377
+ return /* @__PURE__ */ jsx37(NumberedItem, { ...props });
3388
3378
  case "task":
3389
- return /* @__PURE__ */ jsx38(TaskItem, { ...props });
3379
+ return /* @__PURE__ */ jsx37(TaskItem, { ...props });
3390
3380
  case "quote":
3391
- return /* @__PURE__ */ jsx38("div", { className: "quoin-quote", children: /* @__PURE__ */ jsx38(EditableRegion, { block: block.id, region: REGION, label: labels.quote }) });
3381
+ return /* @__PURE__ */ jsx37("div", { className: "quoin-quote", children: /* @__PURE__ */ jsx37(EditableRegion, { block: block.id, region: REGION, label: labels.quote }) });
3392
3382
  default:
3393
- return /* @__PURE__ */ jsx38(EditableRegion, { block: block.id, region: REGION, label: labels.paragraph });
3383
+ return /* @__PURE__ */ jsx37(EditableRegion, { block: block.id, region: REGION, label: labels.paragraph });
3394
3384
  }
3395
3385
  };
3396
3386
 
@@ -3405,14 +3395,14 @@ function useNestedBlocks(controller, blockId) {
3405
3395
  }
3406
3396
 
3407
3397
  // src/blocks/text/ToggleBlock.tsx
3408
- import { jsx as jsx39, jsxs as jsxs23 } from "react/jsx-runtime";
3398
+ import { jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
3409
3399
  var ToggleBlock = ({ block, controller }) => {
3410
3400
  const labels = useLabels();
3411
3401
  const domId = useBlockDomId();
3412
3402
  const nested = useNestedBlocks(controller, block.id);
3413
3403
  const open = useToggleOpen(controller, block);
3414
3404
  return /* @__PURE__ */ jsxs23("div", { className: "quoin-toggle", "data-open": open, children: [
3415
- /* @__PURE__ */ jsx39(
3405
+ /* @__PURE__ */ jsx38(
3416
3406
  ToggleChevron,
3417
3407
  {
3418
3408
  block,
@@ -3421,7 +3411,7 @@ var ToggleBlock = ({ block, controller }) => {
3421
3411
  controls: nested.length === 0 ? void 0 : nested.map(domId).join(" ")
3422
3412
  }
3423
3413
  ),
3424
- /* @__PURE__ */ jsx39(EditableRegion, { block: block.id, region: "text", label: labels.toggle })
3414
+ /* @__PURE__ */ jsx38(EditableRegion, { block: block.id, region: "text", label: labels.toggle })
3425
3415
  ] });
3426
3416
  };
3427
3417
 
@@ -3494,12 +3484,12 @@ function turnIntoTargets(labels) {
3494
3484
  }
3495
3485
 
3496
3486
  // src/gutter/TurnIntoMenu.tsx
3497
- import { jsx as jsx40, jsxs as jsxs24 } from "react/jsx-runtime";
3487
+ import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
3498
3488
  function TurnIntoItems({ kit, controller, blockIds }) {
3499
3489
  const { blockTypes, labels } = useQuoin();
3500
3490
  const targets = turnIntoTargets(labels).filter((target) => drawsType(blockTypes, target.type));
3501
3491
  return targets.map((target) => /* @__PURE__ */ jsxs24(kit.Item, { onSelect: () => runOnBlocks(controller, blockIds, setBlockType(target.type, target.attrs)), children: [
3502
- /* @__PURE__ */ jsx40(MenuIcon, { icon: target.icon }),
3492
+ /* @__PURE__ */ jsx39(MenuIcon, { icon: target.icon }),
3503
3493
  target.label
3504
3494
  ] }, target.id));
3505
3495
  }
@@ -3508,15 +3498,15 @@ function TurnIntoMenu(props) {
3508
3498
  const labels = useLabels();
3509
3499
  return /* @__PURE__ */ jsxs24(kit.Sub, { children: [
3510
3500
  /* @__PURE__ */ jsxs24(kit.SubTrigger, { children: [
3511
- /* @__PURE__ */ jsx40(MenuIcon, { icon: Repeat2 }),
3501
+ /* @__PURE__ */ jsx39(MenuIcon, { icon: Repeat2 }),
3512
3502
  labels.turnInto
3513
3503
  ] }),
3514
- /* @__PURE__ */ jsx40(kit.SubContent, { children: /* @__PURE__ */ jsx40(TurnIntoItems, { ...props }) })
3504
+ /* @__PURE__ */ jsx39(kit.SubContent, { children: /* @__PURE__ */ jsx39(TurnIntoItems, { ...props }) })
3515
3505
  ] });
3516
3506
  }
3517
3507
 
3518
3508
  // src/gutter/BlockMenuItems.tsx
3519
- import { Fragment as Fragment7, jsx as jsx41, jsxs as jsxs25 } from "react/jsx-runtime";
3509
+ import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs25 } from "react/jsx-runtime";
3520
3510
  var DESTRUCTIVE = "text-destructive focus:text-destructive";
3521
3511
  function ActionItem({ kit, controller, action, blockIds }) {
3522
3512
  const labels = useLabels();
@@ -3528,9 +3518,9 @@ function ActionItem({ kit, controller, action, blockIds }) {
3528
3518
  "aria-keyshortcuts": hint?.aria,
3529
3519
  onSelect: () => action.run(controller, blockIds),
3530
3520
  children: [
3531
- /* @__PURE__ */ jsx41(MenuIcon, { icon: action.icon }),
3521
+ /* @__PURE__ */ jsx40(MenuIcon, { icon: action.icon }),
3532
3522
  action.label,
3533
- hint !== null && /* @__PURE__ */ jsx41(kit.Shortcut, { "aria-hidden": "true", children: hint.text })
3523
+ hint !== null && /* @__PURE__ */ jsx40(kit.Shortcut, { "aria-hidden": "true", children: hint.text })
3534
3524
  ]
3535
3525
  }
3536
3526
  );
@@ -3543,14 +3533,14 @@ function BlockMenuItems({ kit, controller, blocks, styled, title, actions }) {
3543
3533
  const anyMarkdown = styled.some((block) => block.type === "MARKDOWN");
3544
3534
  const allCallouts = styled.length > 0 && styled.every((block) => block.type === "CALLOUT");
3545
3535
  return /* @__PURE__ */ jsxs25(Fragment7, { children: [
3546
- /* @__PURE__ */ jsx41(kit.Label, { className: "text-muted-foreground text-xs", children: title }),
3547
- anyText && /* @__PURE__ */ jsx41(TurnIntoMenu, { kit, controller, blockIds: styled.map((block) => block.id) }),
3548
- anyMarkdown && /* @__PURE__ */ jsx41(ColorMenu, { kit, controller, blocks: styled }),
3549
- allCallouts && /* @__PURE__ */ jsx41(CalloutMenus, { kit, controller, blocks: styled }),
3550
- (anyText || anyMarkdown || allCallouts) && /* @__PURE__ */ jsx41(kit.Separator, {}),
3536
+ /* @__PURE__ */ jsx40(kit.Label, { className: "text-muted-foreground text-xs", children: title }),
3537
+ anyText && /* @__PURE__ */ jsx40(TurnIntoMenu, { kit, controller, blockIds: styled.map((block) => block.id) }),
3538
+ anyMarkdown && /* @__PURE__ */ jsx40(ColorMenu, { kit, controller, blocks: styled }),
3539
+ allCallouts && /* @__PURE__ */ jsx40(CalloutMenus, { kit, controller, blocks: styled }),
3540
+ (anyText || anyMarkdown || allCallouts) && /* @__PURE__ */ jsx40(kit.Separator, {}),
3551
3541
  shown.map((action) => /* @__PURE__ */ jsxs25(Fragment6, { children: [
3552
- action.destructive && /* @__PURE__ */ jsx41(kit.Separator, {}),
3553
- /* @__PURE__ */ jsx41(ActionItem, { kit, controller, action, blockIds })
3542
+ action.destructive && /* @__PURE__ */ jsx40(kit.Separator, {}),
3543
+ /* @__PURE__ */ jsx40(ActionItem, { kit, controller, action, blockIds })
3554
3544
  ] }, action.id))
3555
3545
  ] });
3556
3546
  }
@@ -3613,12 +3603,7 @@ function useContextMenuOpener(controller, store, trigger) {
3613
3603
  openBlockMenuAt(store, controller.editor.state, block, clientX, clientY);
3614
3604
  hidden.dispatchEvent(new MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX, clientY }));
3615
3605
  };
3616
- root.addEventListener("mousedown", onMouseDown);
3617
- root.addEventListener("contextmenu", onContextMenu);
3618
- return () => {
3619
- root.removeEventListener("mousedown", onMouseDown);
3620
- root.removeEventListener("contextmenu", onContextMenu);
3621
- };
3606
+ return listen(root, { mousedown: onMouseDown, contextmenu: onContextMenu });
3622
3607
  }, [controller, store, trigger]);
3623
3608
  }
3624
3609
 
@@ -3676,12 +3661,12 @@ function useMenuBlocks(controller, store, menu) {
3676
3661
  }
3677
3662
 
3678
3663
  // src/gutter/BlockContextMenu.tsx
3679
- import { jsx as jsx42, jsxs as jsxs26 } from "react/jsx-runtime";
3664
+ import { jsx as jsx41, jsxs as jsxs26 } from "react/jsx-runtime";
3680
3665
  function BlockContextMenuContent({ controller, store, actions, menu }) {
3681
3666
  const labels = useLabels();
3682
3667
  const { blocks, styled, title } = useMenuBlocks(controller, store, menu);
3683
3668
  if (blocks.length === 0) return null;
3684
- return /* @__PURE__ */ jsx42(ContextMenuContent, { "aria-label": labels.blockMenu(title), onCloseAutoFocus: returnFocusToText(controller), children: /* @__PURE__ */ jsx42(
3669
+ return /* @__PURE__ */ jsx41(ContextMenuContent, { "aria-label": labels.blockMenu(title), onCloseAutoFocus: returnFocusToText(controller), children: /* @__PURE__ */ jsx41(
3685
3670
  BlockMenuItems,
3686
3671
  {
3687
3672
  kit: CONTEXT_KIT,
@@ -3706,8 +3691,8 @@ function BlockContextMenu({ controller, store, actions }) {
3706
3691
  if (!next) closeBlockMenu(store);
3707
3692
  },
3708
3693
  children: [
3709
- /* @__PURE__ */ jsx42(ContextMenuTrigger, { ref: trigger, hidden: true }),
3710
- open && /* @__PURE__ */ jsx42(BlockContextMenuContent, { controller, store, actions, menu })
3694
+ /* @__PURE__ */ jsx41(ContextMenuTrigger, { ref: trigger, hidden: true }),
3695
+ open && /* @__PURE__ */ jsx41(BlockContextMenuContent, { controller, store, actions, menu })
3711
3696
  ]
3712
3697
  }
3713
3698
  );
@@ -3730,7 +3715,7 @@ import { GripVertical, Plus } from "lucide-react";
3730
3715
 
3731
3716
  // src/drag/DragOverlay.tsx
3732
3717
  import { forwardRef as forwardRef6, useImperativeHandle, useRef as useRef18 } from "react";
3733
- import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs27 } from "react/jsx-runtime";
3718
+ import { Fragment as Fragment8, jsx as jsx42, jsxs as jsxs27 } from "react/jsx-runtime";
3734
3719
  var UNIQUE_OR_FOCUSABLE = ["id", "data-block-id", "contenteditable", "tabindex"];
3735
3720
  function copyOf(shell) {
3736
3721
  const copy = shell.cloneNode(true);
@@ -3771,7 +3756,7 @@ var DragOverlay = forwardRef6(function DragOverlay2(_props, ref) {
3771
3756
  }
3772
3757
  }));
3773
3758
  return /* @__PURE__ */ jsxs27(Fragment8, { children: [
3774
- /* @__PURE__ */ jsx43(
3759
+ /* @__PURE__ */ jsx42(
3775
3760
  "div",
3776
3761
  {
3777
3762
  ref: ghost,
@@ -3781,7 +3766,7 @@ var DragOverlay = forwardRef6(function DragOverlay2(_props, ref) {
3781
3766
  className: "pointer-events-none fixed z-20 opacity-50"
3782
3767
  }
3783
3768
  ),
3784
- /* @__PURE__ */ jsx43(
3769
+ /* @__PURE__ */ jsx42(
3785
3770
  "div",
3786
3771
  {
3787
3772
  ref: line,
@@ -3971,11 +3956,9 @@ function followPress(press, root, view) {
3971
3956
  function finish() {
3972
3957
  if (done) return;
3973
3958
  done = true;
3974
- doc.removeEventListener("pointermove", onPointerMove);
3975
- doc.removeEventListener("pointerup", onPointerUp);
3976
- doc.removeEventListener("pointercancel", finish);
3977
- view.removeEventListener("blur", finish);
3978
- view.removeEventListener("keydown", onKeyDown, true);
3959
+ unlistenDocument();
3960
+ unlistenBlur();
3961
+ unlistenKeys();
3979
3962
  scroll.stop();
3980
3963
  unsubscribe();
3981
3964
  if (active === null) return;
@@ -4011,11 +3994,9 @@ function followPress(press, root, view) {
4011
3994
  event.stopPropagation();
4012
3995
  finish();
4013
3996
  }
4014
- doc.addEventListener("pointermove", onPointerMove);
4015
- doc.addEventListener("pointerup", onPointerUp);
4016
- doc.addEventListener("pointercancel", finish);
4017
- view.addEventListener("blur", finish);
4018
- view.addEventListener("keydown", onKeyDown, true);
3997
+ const unlistenDocument = listen(doc, { pointermove: onPointerMove, pointerup: onPointerUp, pointercancel: finish });
3998
+ const unlistenBlur = listen(view, { blur: finish });
3999
+ const unlistenKeys = listen(view, { keydown: onKeyDown }, true);
4019
4000
  return finish;
4020
4001
  }
4021
4002
  function pressDragHandle(press) {
@@ -4079,19 +4060,19 @@ function addBlockBelow(controller, blockId) {
4079
4060
  }
4080
4061
 
4081
4062
  // src/gutter/BlockMenu.tsx
4082
- import { jsx as jsx44, jsxs as jsxs28 } from "react/jsx-runtime";
4063
+ import { jsx as jsx43, jsxs as jsxs28 } from "react/jsx-runtime";
4083
4064
  function BlockMenuContent({ controller, store, actions, menu }) {
4084
4065
  const labels = useLabels();
4085
4066
  const { blocks, styled, title } = useMenuBlocks(controller, store, menu);
4086
4067
  if (blocks.length === 0) return null;
4087
- return /* @__PURE__ */ jsx44(
4068
+ return /* @__PURE__ */ jsx43(
4088
4069
  DropdownMenuContent,
4089
4070
  {
4090
4071
  align: "start",
4091
4072
  "aria-label": labels.blockMenu(title),
4092
4073
  "aria-labelledby": void 0,
4093
4074
  onCloseAutoFocus: returnFocusToText(controller),
4094
- children: /* @__PURE__ */ jsx44(
4075
+ children: /* @__PURE__ */ jsx43(
4095
4076
  BlockMenuItems,
4096
4077
  {
4097
4078
  kit: DROPDOWN_KIT,
@@ -4117,8 +4098,8 @@ function BlockMenu({ controller, store, actions, onOpen, children }) {
4117
4098
  else closeBlockMenu(store);
4118
4099
  },
4119
4100
  children: [
4120
- /* @__PURE__ */ jsx44(DropdownMenuTrigger, { asChild: true, children }),
4121
- open && /* @__PURE__ */ jsx44(BlockMenuContent, { controller, store, actions, menu })
4101
+ /* @__PURE__ */ jsx43(DropdownMenuTrigger, { asChild: true, children }),
4102
+ open && /* @__PURE__ */ jsx43(BlockMenuContent, { controller, store, actions, menu })
4122
4103
  ]
4123
4104
  }
4124
4105
  );
@@ -4206,16 +4187,7 @@ function useGutterTarget(controller, store, gutter) {
4206
4187
  const onFocusIn = () => setFocusWithin(true);
4207
4188
  const onFocusOut = (event) => setFocusWithin(root.contains(event.relatedTarget));
4208
4189
  setFocusWithin(root.contains(root.ownerDocument.activeElement));
4209
- root.addEventListener("pointermove", onPointerMove);
4210
- root.addEventListener("pointerleave", onPointerLeave);
4211
- root.addEventListener("focusin", onFocusIn);
4212
- root.addEventListener("focusout", onFocusOut);
4213
- return () => {
4214
- root.removeEventListener("pointermove", onPointerMove);
4215
- root.removeEventListener("pointerleave", onPointerLeave);
4216
- root.removeEventListener("focusin", onFocusIn);
4217
- root.removeEventListener("focusout", onFocusOut);
4218
- };
4190
+ return listen(root, { pointermove: onPointerMove, pointerleave: onPointerLeave, focusin: onFocusIn, focusout: onFocusOut });
4219
4191
  }, [controller, store, gutter]);
4220
4192
  const fallback = focusWithin ? head : null;
4221
4193
  const target = hovered ?? fallback;
@@ -4223,7 +4195,7 @@ function useGutterTarget(controller, store, gutter) {
4223
4195
  }
4224
4196
 
4225
4197
  // src/gutter/Gutter.tsx
4226
- import { Fragment as Fragment9, jsx as jsx45, jsxs as jsxs29 } from "react/jsx-runtime";
4198
+ import { Fragment as Fragment9, jsx as jsx44, jsxs as jsxs29 } from "react/jsx-runtime";
4227
4199
  var GUTTER = "absolute top-0 left-0 z-10 flex items-center gap-0.5 pointer-coarse:not-data-current:hidden";
4228
4200
  var ADD_BELOW = "text-muted-foreground pointer-coarse:hidden";
4229
4201
  function Gutter({ controller, store, actions }) {
@@ -4252,7 +4224,7 @@ function Gutter({ controller, store, actions }) {
4252
4224
  "data-current": focused || menuOpen ? "" : void 0,
4253
4225
  ...{ [GUTTER_BLOCK]: target ?? void 0 },
4254
4226
  children: [
4255
- /* @__PURE__ */ jsx45(
4227
+ /* @__PURE__ */ jsx44(
4256
4228
  Button,
4257
4229
  {
4258
4230
  type: "button",
@@ -4263,10 +4235,10 @@ function Gutter({ controller, store, actions }) {
4263
4235
  className: ADD_BELOW,
4264
4236
  onPointerDown: keepFocus,
4265
4237
  onClick: addBelow,
4266
- children: /* @__PURE__ */ jsx45(Plus, {})
4238
+ children: /* @__PURE__ */ jsx44(Plus, {})
4267
4239
  }
4268
4240
  ),
4269
- /* @__PURE__ */ jsx45(BlockMenu, { controller, store, actions, onOpen: openMenu, children: /* @__PURE__ */ jsx45(
4241
+ /* @__PURE__ */ jsx44(BlockMenu, { controller, store, actions, onOpen: openMenu, children: /* @__PURE__ */ jsx44(
4270
4242
  Button,
4271
4243
  {
4272
4244
  type: "button",
@@ -4285,13 +4257,13 @@ function Gutter({ controller, store, actions }) {
4285
4257
  menuOpenAtPress.current = false;
4286
4258
  if (!drag.takeClick(event) && !closing) openMenu();
4287
4259
  },
4288
- children: /* @__PURE__ */ jsx45(GripVertical, {})
4260
+ children: /* @__PURE__ */ jsx44(GripVertical, {})
4289
4261
  }
4290
4262
  ) })
4291
4263
  ]
4292
4264
  }
4293
4265
  ),
4294
- /* @__PURE__ */ jsx45(DragOverlay, { ref: overlay })
4266
+ /* @__PURE__ */ jsx44(DragOverlay, { ref: overlay })
4295
4267
  ] });
4296
4268
  }
4297
4269
 
@@ -4390,7 +4362,7 @@ import { AlignCenter as AlignCenter2, AlignJustify, AlignLeft as AlignLeft2, Ali
4390
4362
 
4391
4363
  // src/menus/bubble/ToolbarMenu.tsx
4392
4364
  import { useRef as useRef21 } from "react";
4393
- import { jsx as jsx46, jsxs as jsxs30 } from "react/jsx-runtime";
4365
+ import { jsx as jsx45, jsxs as jsxs30 } from "react/jsx-runtime";
4394
4366
  function ToolbarMenu({ controller, trigger, children }) {
4395
4367
  const fromToolbar = useRef21(false);
4396
4368
  return /* @__PURE__ */ jsxs30(
@@ -4400,8 +4372,8 @@ function ToolbarMenu({ controller, trigger, children }) {
4400
4372
  if (open) fromToolbar.current = isBubblePart(document.activeElement, controller);
4401
4373
  },
4402
4374
  children: [
4403
- /* @__PURE__ */ jsx46(DropdownMenuTrigger, { asChild: true, children: trigger }),
4404
- /* @__PURE__ */ jsx46(
4375
+ /* @__PURE__ */ jsx45(DropdownMenuTrigger, { asChild: true, children: trigger }),
4376
+ /* @__PURE__ */ jsx45(
4405
4377
  DropdownMenuContent,
4406
4378
  {
4407
4379
  align: "start",
@@ -4418,7 +4390,7 @@ function ToolbarMenu({ controller, trigger, children }) {
4418
4390
  }
4419
4391
 
4420
4392
  // src/menus/bubble/AlignDropdown.tsx
4421
- import { jsx as jsx47, jsxs as jsxs31 } from "react/jsx-runtime";
4393
+ import { jsx as jsx46, jsxs as jsxs31 } from "react/jsx-runtime";
4422
4394
  var ICONS = { left: AlignLeft2, center: AlignCenter2, right: AlignRight2, justify: AlignJustify };
4423
4395
  var ALIGNS2 = Object.keys(ICONS);
4424
4396
  var LABEL_KEYS = { left: "alignLeft", center: "alignCenter", right: "alignRight", justify: "alignJustify" };
@@ -4433,16 +4405,16 @@ function AlignDropdown({ controller, state }) {
4433
4405
  const value = sharedAlign(state);
4434
4406
  if (value === null) return null;
4435
4407
  const Icon = value === "" ? AlignLeft2 : ICONS[value];
4436
- const trigger = /* @__PURE__ */ jsx47(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.align, children: /* @__PURE__ */ jsx47(Icon, {}) });
4437
- return /* @__PURE__ */ jsx47(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsx47(DropdownMenuRadioGroup, { value, onValueChange: (align) => controller.run(setTextAlign(align)), children: ALIGNS2.map((align) => /* @__PURE__ */ jsxs31(DropdownMenuRadioItem, { value: align, indicator: /* @__PURE__ */ jsx47(CheckIcon5, { className: "size-4" }), children: [
4438
- /* @__PURE__ */ jsx47(MenuIcon, { icon: ICONS[align] }),
4408
+ const trigger = /* @__PURE__ */ jsx46(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.align, children: /* @__PURE__ */ jsx46(Icon, {}) });
4409
+ return /* @__PURE__ */ jsx46(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsx46(DropdownMenuRadioGroup, { value, onValueChange: (align) => controller.run(setTextAlign(align)), children: ALIGNS2.map((align) => /* @__PURE__ */ jsxs31(DropdownMenuRadioItem, { value: align, indicator: /* @__PURE__ */ jsx46(CheckIcon5, { className: "size-4" }), children: [
4410
+ /* @__PURE__ */ jsx46(MenuIcon, { icon: ICONS[align] }),
4439
4411
  labels[LABEL_KEYS[align]]
4440
4412
  ] }, align)) }) });
4441
4413
  }
4442
4414
 
4443
4415
  // src/menus/bubble/ColorPopover.tsx
4444
4416
  import { Baseline } from "lucide-react";
4445
- import { jsx as jsx48 } from "react/jsx-runtime";
4417
+ import { jsx as jsx47 } from "react/jsx-runtime";
4446
4418
  var MARKS = { color: "color", background: "highlight" };
4447
4419
  function selectionColor(state, mark) {
4448
4420
  const names = /* @__PURE__ */ new Set();
@@ -4461,24 +4433,24 @@ function colorCommand(key, name) {
4461
4433
  function ColorPopover({ controller, state }) {
4462
4434
  const labels = useLabels();
4463
4435
  const value = { color: selectionColor(state, MARKS.color), background: selectionColor(state, MARKS.background) };
4464
- const trigger = /* @__PURE__ */ jsx48(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.color, children: /* @__PURE__ */ jsx48(Baseline, {}) });
4465
- return /* @__PURE__ */ jsx48(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsx48(ColorGroups, { kit: DROPDOWN_KIT, value, onPick: (key, name) => controller.run(colorCommand(key, name)) }) });
4436
+ const trigger = /* @__PURE__ */ jsx47(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.color, children: /* @__PURE__ */ jsx47(Baseline, {}) });
4437
+ return /* @__PURE__ */ jsx47(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsx47(ColorGroups, { kit: DROPDOWN_KIT, value, onPick: (key, name) => controller.run(colorCommand(key, name)) }) });
4466
4438
  }
4467
4439
 
4468
4440
  // src/menus/bubble/TurnIntoDropdown.tsx
4469
4441
  import { ChevronDown } from "lucide-react";
4470
- import { jsx as jsx49, jsxs as jsxs32 } from "react/jsx-runtime";
4442
+ import { jsx as jsx48, jsxs as jsxs32 } from "react/jsx-runtime";
4471
4443
  function TurnIntoDropdown({ controller, state }) {
4472
4444
  const labels = useLabels();
4473
4445
  const trigger = /* @__PURE__ */ jsxs32(Button, { type: "button", variant: "ghost", size: "sm", className: "gap-1 px-2 has-[>svg]:px-2", children: [
4474
4446
  labels.turnInto,
4475
- /* @__PURE__ */ jsx49(ChevronDown, {})
4447
+ /* @__PURE__ */ jsx48(ChevronDown, {})
4476
4448
  ] });
4477
- return /* @__PURE__ */ jsx49(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsx49(TurnIntoItems, { kit: DROPDOWN_KIT, controller, blockIds: selectedBlockIds(state.doc, state.selection) }) });
4449
+ return /* @__PURE__ */ jsx48(ToolbarMenu, { controller, trigger, children: /* @__PURE__ */ jsx48(TurnIntoItems, { kit: DROPDOWN_KIT, controller, blockIds: selectedBlockIds(state.doc, state.selection) }) });
4478
4450
  }
4479
4451
 
4480
4452
  // src/menus/bubble/BubbleToolbar.tsx
4481
- import { jsx as jsx50, jsxs as jsxs33 } from "react/jsx-runtime";
4453
+ import { jsx as jsx49, jsxs as jsxs33 } from "react/jsx-runtime";
4482
4454
  var DIVIDER = "mx-0.5 h-5 w-px shrink-0 bg-border";
4483
4455
  function BubbleToolbar({ controller, labels, store, extraItems }) {
4484
4456
  const state = useEditorState(controller, wholeState);
@@ -4493,9 +4465,9 @@ function BubbleToolbar({ controller, labels, store, extraItems }) {
4493
4465
  controller.focus();
4494
4466
  } else roving.onKeyDown(event);
4495
4467
  };
4496
- const button = (item) => /* @__PURE__ */ jsx50(ToolbarButton, { item, state, controller }, item.id);
4468
+ const button = (item) => /* @__PURE__ */ jsx49(ToolbarButton, { item, state, controller }, item.id);
4497
4469
  return /* @__PURE__ */ jsxs33(Popover, { open: true, modal: false, children: [
4498
- /* @__PURE__ */ jsx50(PopoverAnchor, { virtualRef: anchor }),
4470
+ /* @__PURE__ */ jsx49(PopoverAnchor, { virtualRef: anchor }),
4499
4471
  /* @__PURE__ */ jsxs33(
4500
4472
  PopoverContent,
4501
4473
  {
@@ -4512,11 +4484,11 @@ function BubbleToolbar({ controller, labels, store, extraItems }) {
4512
4484
  onKeyDown,
4513
4485
  ...bubblePart(controller),
4514
4486
  children: [
4515
- /* @__PURE__ */ jsx50(TurnIntoDropdown, { controller, state }),
4516
- /* @__PURE__ */ jsx50("span", { "aria-hidden": "true", className: DIVIDER }),
4487
+ /* @__PURE__ */ jsx49(TurnIntoDropdown, { controller, state }),
4488
+ /* @__PURE__ */ jsx49("span", { "aria-hidden": "true", className: DIVIDER }),
4517
4489
  items.inline.map(button),
4518
- /* @__PURE__ */ jsx50(ColorPopover, { controller, state }),
4519
- /* @__PURE__ */ jsx50(AlignDropdown, { controller, state }),
4490
+ /* @__PURE__ */ jsx49(ColorPopover, { controller, state }),
4491
+ /* @__PURE__ */ jsx49(AlignDropdown, { controller, state }),
4520
4492
  items.scripts.map(button),
4521
4493
  extraItems.map(button)
4522
4494
  ]
@@ -4556,7 +4528,7 @@ function useBubbleVisibility(controller) {
4556
4528
  }
4557
4529
 
4558
4530
  // src/menus/bubble/bubble-extension.tsx
4559
- import { jsx as jsx51 } from "react/jsx-runtime";
4531
+ import { jsx as jsx50 } from "react/jsx-runtime";
4560
4532
  var NO_ITEMS = [];
4561
4533
  var BubbleItemsContext = createContext5(NO_ITEMS);
4562
4534
  var BubbleItemsProvider = BubbleItemsContext.Provider;
@@ -4566,7 +4538,7 @@ function BubbleOverlay({ controller }) {
4566
4538
  const store = useCanvasUiStore();
4567
4539
  const extraItems = useContext5(BubbleItemsContext);
4568
4540
  if (!visible) return null;
4569
- return /* @__PURE__ */ jsx51(BubbleToolbar, { controller, labels, store, extraItems });
4541
+ return /* @__PURE__ */ jsx50(BubbleToolbar, { controller, labels, store, extraItems });
4570
4542
  }
4571
4543
  function bubbleExtension() {
4572
4544
  return defineExtension({ name: "bubble", ui: { overlays: [BubbleOverlay] } });
@@ -4695,7 +4667,7 @@ function usePointerLink(controller, card, delay) {
4695
4667
  }
4696
4668
 
4697
4669
  // src/menus/link/LinkHoverCard.tsx
4698
- import { jsx as jsx52, jsxs as jsxs34 } from "react/jsx-runtime";
4670
+ import { jsx as jsx51, jsxs as jsxs34 } from "react/jsx-runtime";
4699
4671
  var REST_MS = 300;
4700
4672
  var URL_LENGTH = 48;
4701
4673
  var CARD = "flex w-auto items-center gap-0.5 py-1 ps-3 pe-1 shadow-md";
@@ -4728,7 +4700,7 @@ function LinkCard({ controller, labels, store, cardRef, element, onUnlinked }) {
4728
4700
  onUnlinked();
4729
4701
  };
4730
4702
  return /* @__PURE__ */ jsxs34(Popover, { open: true, modal: false, children: [
4731
- /* @__PURE__ */ jsx52(PopoverAnchor, { virtualRef: anchor }),
4703
+ /* @__PURE__ */ jsx51(PopoverAnchor, { virtualRef: anchor }),
4732
4704
  /* @__PURE__ */ jsxs34(
4733
4705
  PopoverContent,
4734
4706
  {
@@ -4742,10 +4714,10 @@ function LinkCard({ controller, labels, store, cardRef, element, onUnlinked }) {
4742
4714
  onPointerDown: keepFocus,
4743
4715
  onMouseDown: keepFocus,
4744
4716
  children: [
4745
- /* @__PURE__ */ jsx52("span", { className: ADDRESS, title: address === link.href ? void 0 : link.href, children: address }),
4746
- href !== null && /* @__PURE__ */ jsx52(Button, { asChild: true, variant: "ghost", size: "icon-sm", children: /* @__PURE__ */ jsx52("a", { href, target: "_blank", rel: "noopener noreferrer", "aria-label": labels.linkOpen, children: /* @__PURE__ */ jsx52(ExternalLink, {}) }) }),
4747
- /* @__PURE__ */ jsx52(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkEdit, onClick: edit2, children: /* @__PURE__ */ jsx52(Pencil2, {}) }),
4748
- /* @__PURE__ */ jsx52(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkRemove, onClick: unlink, children: /* @__PURE__ */ jsx52(Unlink, {}) })
4717
+ /* @__PURE__ */ jsx51("span", { className: ADDRESS, title: address === link.href ? void 0 : link.href, children: address }),
4718
+ href !== null && /* @__PURE__ */ jsx51(Button, { asChild: true, variant: "ghost", size: "icon-sm", children: /* @__PURE__ */ jsx51("a", { href, target: "_blank", rel: "noopener noreferrer", "aria-label": labels.linkOpen, children: /* @__PURE__ */ jsx51(ExternalLink, {}) }) }),
4719
+ /* @__PURE__ */ jsx51(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkEdit, onClick: edit2, children: /* @__PURE__ */ jsx51(Pencil2, {}) }),
4720
+ /* @__PURE__ */ jsx51(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkRemove, onClick: unlink, children: /* @__PURE__ */ jsx51(Unlink, {}) })
4749
4721
  ]
4750
4722
  }
4751
4723
  )
@@ -4756,7 +4728,7 @@ function LinkHoverCard(props) {
4756
4728
  const pointer = usePointerLink(props.controller, cardRef, REST_MS);
4757
4729
  const caretInLink = useCaretInLink(props.controller, REST_MS);
4758
4730
  if (pointer.element === null && !caretInLink) return null;
4759
- return /* @__PURE__ */ jsx52(LinkCard, { ...props, cardRef, element: pointer.element, onUnlinked: pointer.dismiss });
4731
+ return /* @__PURE__ */ jsx51(LinkCard, { ...props, cardRef, element: pointer.element, onUnlinked: pointer.dismiss });
4760
4732
  }
4761
4733
 
4762
4734
  // src/menus/link/LinkPopover.tsx
@@ -4787,7 +4759,7 @@ function applyLink(href, value) {
4787
4759
  }
4788
4760
 
4789
4761
  // src/menus/link/LinkPopover.tsx
4790
- import { jsx as jsx53, jsxs as jsxs35 } from "react/jsx-runtime";
4762
+ import { jsx as jsx52, jsxs as jsxs35 } from "react/jsx-runtime";
4791
4763
  var CONTENT2 = "w-80 p-2 shadow-md";
4792
4764
  var FIELD2 = "h-8";
4793
4765
  var MESSAGE = "mt-1.5 px-1 text-sm text-destructive";
@@ -4837,7 +4809,7 @@ function LinkPopover({ controller, labels, onClose }) {
4837
4809
  if (!open) onClose();
4838
4810
  },
4839
4811
  children: [
4840
- /* @__PURE__ */ jsx53(PopoverAnchor, { virtualRef: anchor }),
4812
+ /* @__PURE__ */ jsx52(PopoverAnchor, { virtualRef: anchor }),
4841
4813
  /* @__PURE__ */ jsxs35(
4842
4814
  PopoverContent,
4843
4815
  {
@@ -4852,7 +4824,7 @@ function LinkPopover({ controller, labels, onClose }) {
4852
4824
  },
4853
4825
  children: [
4854
4826
  /* @__PURE__ */ jsxs35("form", { noValidate: true, className: "flex items-center gap-0.5", onSubmit: apply, children: [
4855
- /* @__PURE__ */ jsx53(
4827
+ /* @__PURE__ */ jsx52(
4856
4828
  Input,
4857
4829
  {
4858
4830
  type: "url",
@@ -4864,11 +4836,11 @@ function LinkPopover({ controller, labels, onClose }) {
4864
4836
  onChange
4865
4837
  }
4866
4838
  ),
4867
- /* @__PURE__ */ jsx53(Button, { type: "submit", variant: "ghost", size: "icon-sm", "aria-label": labels.linkApply, children: /* @__PURE__ */ jsx53(Check3, {}) }),
4868
- openHref && /* @__PURE__ */ jsx53(Button, { asChild: true, variant: "ghost", size: "icon-sm", children: /* @__PURE__ */ jsx53("a", { href: openHref, target: "_blank", rel: "noopener noreferrer", "aria-label": labels.linkOpen, children: /* @__PURE__ */ jsx53(ExternalLink2, {}) }) }),
4869
- link !== null && /* @__PURE__ */ jsx53(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkRemove, onClick: remove, children: /* @__PURE__ */ jsx53(Unlink2, {}) })
4839
+ /* @__PURE__ */ jsx52(Button, { type: "submit", variant: "ghost", size: "icon-sm", "aria-label": labels.linkApply, children: /* @__PURE__ */ jsx52(Check3, {}) }),
4840
+ openHref && /* @__PURE__ */ jsx52(Button, { asChild: true, variant: "ghost", size: "icon-sm", children: /* @__PURE__ */ jsx52("a", { href: openHref, target: "_blank", rel: "noopener noreferrer", "aria-label": labels.linkOpen, children: /* @__PURE__ */ jsx52(ExternalLink2, {}) }) }),
4841
+ link !== null && /* @__PURE__ */ jsx52(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.linkRemove, onClick: remove, children: /* @__PURE__ */ jsx52(Unlink2, {}) })
4870
4842
  ] }),
4871
- invalid && /* @__PURE__ */ jsx53("p", { id: messageId, role: "alert", className: MESSAGE, children: labels.invalidLink })
4843
+ invalid && /* @__PURE__ */ jsx52("p", { id: messageId, role: "alert", className: MESSAGE, children: labels.invalidLink })
4872
4844
  ]
4873
4845
  }
4874
4846
  )
@@ -4893,7 +4865,7 @@ function useLinkClicks(controller) {
4893
4865
  }
4894
4866
 
4895
4867
  // src/menus/link/link-extension.tsx
4896
- import { jsx as jsx54 } from "react/jsx-runtime";
4868
+ import { jsx as jsx53 } from "react/jsx-runtime";
4897
4869
  var isPopoverOpen = (state) => state.linkPopover.open;
4898
4870
  function LinkOverlay({ controller }) {
4899
4871
  const labels = useLabels();
@@ -4905,8 +4877,8 @@ function LinkOverlay({ controller }) {
4905
4877
  if (readOnly && store.get().linkPopover.open) store.set({ linkPopover: { open: false } });
4906
4878
  }, [readOnly, store]);
4907
4879
  if (readOnly) return null;
4908
- if (!popoverOpen) return /* @__PURE__ */ jsx54(LinkHoverCard, { controller, labels, store });
4909
- return /* @__PURE__ */ jsx54(LinkPopover, { controller, labels, onClose: () => store.set({ linkPopover: { open: false } }) });
4880
+ if (!popoverOpen) return /* @__PURE__ */ jsx53(LinkHoverCard, { controller, labels, store });
4881
+ return /* @__PURE__ */ jsx53(LinkPopover, { controller, labels, onClose: () => store.set({ linkPopover: { open: false } }) });
4910
4882
  }
4911
4883
  function linkExtension(store) {
4912
4884
  const openPopover = (state, dispatch) => {
@@ -5292,7 +5264,7 @@ function useSuggestion({
5292
5264
  }
5293
5265
 
5294
5266
  // src/menus/suggestion/SuggestionMenu.tsx
5295
- import { Fragment as Fragment10, jsx as jsx55, jsxs as jsxs36 } from "react/jsx-runtime";
5267
+ import { Fragment as Fragment10, jsx as jsx54, jsxs as jsxs36 } from "react/jsx-runtime";
5296
5268
  var CONTENT3 = cn(
5297
5269
  MENU_CONTENT,
5298
5270
  "flex w-72 max-h-[min(22rem,var(--radix-popper-available-height))] flex-col overflow-y-hidden"
@@ -5300,7 +5272,7 @@ var CONTENT3 = cn(
5300
5272
  var LISTBOX = "min-h-0 overflow-y-auto";
5301
5273
  var GROUP_LABEL = "px-2 pt-2 pb-1 text-xs font-medium text-muted-foreground";
5302
5274
  function SuggestionGroup({ section, labelId, activeIndex, optionId, renderItem, highlight, select }) {
5303
- const options = section.entries.map(({ item, index }) => /* @__PURE__ */ jsx55(
5275
+ const options = section.entries.map(({ item, index }) => /* @__PURE__ */ jsx54(
5304
5276
  SuggestionOption,
5305
5277
  {
5306
5278
  id: optionId(item),
@@ -5311,9 +5283,9 @@ function SuggestionGroup({ section, labelId, activeIndex, optionId, renderItem,
5311
5283
  },
5312
5284
  optionId(item)
5313
5285
  ));
5314
- if (section.label === null) return /* @__PURE__ */ jsx55(Fragment10, { children: options });
5286
+ if (section.label === null) return /* @__PURE__ */ jsx54(Fragment10, { children: options });
5315
5287
  return /* @__PURE__ */ jsxs36("div", { role: "group", "aria-labelledby": labelId, children: [
5316
- /* @__PURE__ */ jsx55("div", { role: "presentation", id: labelId, className: GROUP_LABEL, children: section.label }),
5288
+ /* @__PURE__ */ jsx54("div", { role: "presentation", id: labelId, className: GROUP_LABEL, children: section.label }),
5317
5289
  options
5318
5290
  ] });
5319
5291
  }
@@ -5343,7 +5315,7 @@ function SuggestionMenu(props) {
5343
5315
  if (!open) queueMicrotask(suggestion.dismiss);
5344
5316
  },
5345
5317
  children: [
5346
- /* @__PURE__ */ jsx55(PopoverAnchor, { virtualRef: anchor }),
5318
+ /* @__PURE__ */ jsx54(PopoverAnchor, { virtualRef: anchor }),
5347
5319
  /* @__PURE__ */ jsxs36(
5348
5320
  PopoverContent,
5349
5321
  {
@@ -5357,7 +5329,7 @@ function SuggestionMenu(props) {
5357
5329
  onPointerDownOutside: insideEditor,
5358
5330
  onFocusOutside: insideEditor,
5359
5331
  children: [
5360
- /* @__PURE__ */ jsx55("div", { ref: listbox, role: "listbox", id: listboxId, "aria-label": label, className: LISTBOX, children: sections.map((section, index) => /* @__PURE__ */ jsx55(
5332
+ /* @__PURE__ */ jsx54("div", { ref: listbox, role: "listbox", id: listboxId, "aria-label": label, className: LISTBOX, children: sections.map((section, index) => /* @__PURE__ */ jsx54(
5361
5333
  SuggestionGroup,
5362
5334
  {
5363
5335
  section,
@@ -5370,7 +5342,7 @@ function SuggestionMenu(props) {
5370
5342
  },
5371
5343
  section.label ?? ""
5372
5344
  )) }),
5373
- status && /* @__PURE__ */ jsx55("p", { className: "px-2 py-1.5 text-sm text-muted-foreground", children: status })
5345
+ status && /* @__PURE__ */ jsx54("p", { className: "px-2 py-1.5 text-sm text-muted-foreground", children: status })
5374
5346
  ]
5375
5347
  }
5376
5348
  )
@@ -5450,17 +5422,17 @@ function fuzzyFilter(items, query) {
5450
5422
  }
5451
5423
 
5452
5424
  // src/menus/slash/SlashMenu.tsx
5453
- import { Fragment as Fragment11, jsx as jsx56, jsxs as jsxs37 } from "react/jsx-runtime";
5425
+ import { Fragment as Fragment11, jsx as jsx55, jsxs as jsxs37 } from "react/jsx-runtime";
5454
5426
  var itemKey = (item) => item.id;
5455
5427
  function SlashRow({ item, isMac, labels }) {
5456
5428
  const hint = item.shortcut === void 0 ? null : shortcutHint(item.shortcut, isMac, labels);
5457
5429
  return /* @__PURE__ */ jsxs37(Fragment11, { children: [
5458
- item.icon !== void 0 && /* @__PURE__ */ jsx56(MenuIcon, { icon: item.icon }),
5430
+ item.icon !== void 0 && /* @__PURE__ */ jsx55(MenuIcon, { icon: item.icon }),
5459
5431
  /* @__PURE__ */ jsxs37("span", { className: "flex min-w-0 flex-col", children: [
5460
- /* @__PURE__ */ jsx56("span", { className: "truncate", children: item.title }),
5461
- item.description !== void 0 && /* @__PURE__ */ jsx56("span", { className: "truncate text-xs text-muted-foreground", children: item.description })
5432
+ /* @__PURE__ */ jsx55("span", { className: "truncate", children: item.title }),
5433
+ item.description !== void 0 && /* @__PURE__ */ jsx55("span", { className: "truncate text-xs text-muted-foreground", children: item.description })
5462
5434
  ] }),
5463
- hint !== null && /* @__PURE__ */ jsx56("kbd", { "aria-hidden": "true", className: "ml-auto font-sans text-xs tracking-widest text-muted-foreground pointer-coarse:hidden", children: hint.text })
5435
+ hint !== null && /* @__PURE__ */ jsx55("kbd", { "aria-hidden": "true", className: "ml-auto font-sans text-xs tracking-widest text-muted-foreground pointer-coarse:hidden", children: hint.text })
5464
5436
  ] });
5465
5437
  }
5466
5438
  function SlashMenu({ controller, labels, items }) {
@@ -5476,14 +5448,14 @@ function SlashMenu({ controller, labels, items }) {
5476
5448
  );
5477
5449
  const groupOf2 = useCallback10((item) => labels.groups[item.group], [labels]);
5478
5450
  const renderItem = useCallback10(
5479
- (item) => /* @__PURE__ */ jsx56(SlashRow, { item, isMac: controller.isMac, labels }),
5451
+ (item) => /* @__PURE__ */ jsx55(SlashRow, { item, isMac: controller.isMac, labels }),
5480
5452
  [controller, labels]
5481
5453
  );
5482
5454
  const choose = useCallback10(
5483
5455
  (item, range) => chooseSlashItem(controller, item, range),
5484
5456
  [controller]
5485
5457
  );
5486
- return /* @__PURE__ */ jsx56(
5458
+ return /* @__PURE__ */ jsx55(
5487
5459
  SuggestionMenu,
5488
5460
  {
5489
5461
  controller,
@@ -5500,7 +5472,7 @@ function SlashMenu({ controller, labels, items }) {
5500
5472
  }
5501
5473
 
5502
5474
  // src/menus/slash/slash-extension.tsx
5503
- import { jsx as jsx57 } from "react/jsx-runtime";
5475
+ import { jsx as jsx56 } from "react/jsx-runtime";
5504
5476
  var NO_ITEMS2 = [];
5505
5477
  var SlashItemsContext = createContext6(NO_ITEMS2);
5506
5478
  var SlashItemsProvider = SlashItemsContext.Provider;
@@ -5512,7 +5484,7 @@ function SlashOverlay({ controller }) {
5512
5484
  () => [...builtInSlashItems(labels, blockTypes), ...extraItems],
5513
5485
  [labels, blockTypes, extraItems]
5514
5486
  );
5515
- return /* @__PURE__ */ jsx57(SlashMenu, { controller, labels, items });
5487
+ return /* @__PURE__ */ jsx56(SlashMenu, { controller, labels, items });
5516
5488
  }
5517
5489
  function slashExtension() {
5518
5490
  return defineExtension({
@@ -5608,7 +5580,7 @@ function useVisualViewport() {
5608
5580
  }
5609
5581
 
5610
5582
  // src/mobile/MobileToolbar.tsx
5611
- import { jsx as jsx58, jsxs as jsxs38 } from "react/jsx-runtime";
5583
+ import { jsx as jsx57, jsxs as jsxs38 } from "react/jsx-runtime";
5612
5584
  var TOOLBAR = [
5613
5585
  "quoin bg-popover text-popover-foreground fixed inset-x-0 z-40 flex items-center gap-0.5 overflow-x-auto",
5614
5586
  "border-t p-1 shadow-md"
@@ -5630,7 +5602,7 @@ function EditingTools({ controller }) {
5630
5602
  controller.focus();
5631
5603
  } else roving.onKeyDown(event);
5632
5604
  };
5633
- const button = (item) => /* @__PURE__ */ jsx58(ToolbarButton, { item, state, controller }, item.id);
5605
+ const button = (item) => /* @__PURE__ */ jsx57(ToolbarButton, { item, state, controller }, item.id);
5634
5606
  return createPortal(
5635
5607
  /* @__PURE__ */ jsxs38(
5636
5608
  "div",
@@ -5647,7 +5619,7 @@ function EditingTools({ controller }) {
5647
5619
  ...bubblePart(controller),
5648
5620
  children: [
5649
5621
  button(items.addBlock),
5650
- /* @__PURE__ */ jsx58(TurnIntoDropdown, { controller, state }),
5622
+ /* @__PURE__ */ jsx57(TurnIntoDropdown, { controller, state }),
5651
5623
  items.editing.map(button)
5652
5624
  ]
5653
5625
  }
@@ -5659,7 +5631,7 @@ function MobileToolbar({ controller }) {
5659
5631
  const coarse = useCoarsePointer();
5660
5632
  const focused = useEditorFocus(controller);
5661
5633
  if (!coarse || !focused) return null;
5662
- return /* @__PURE__ */ jsx58(EditingTools, { controller });
5634
+ return /* @__PURE__ */ jsx57(EditingTools, { controller });
5663
5635
  }
5664
5636
 
5665
5637
  // src/shortcuts/shortcuts-extension.tsx
@@ -5672,15 +5644,15 @@ import { useId as useId7, useMemo as useMemo15 } from "react";
5672
5644
  import * as React8 from "react";
5673
5645
  import * as DialogPrimitive from "@radix-ui/react-dialog";
5674
5646
  import { XIcon } from "lucide-react";
5675
- import { jsx as jsx59, jsxs as jsxs39 } from "react/jsx-runtime";
5647
+ import { jsx as jsx58, jsxs as jsxs39 } from "react/jsx-runtime";
5676
5648
  function Dialog(props) {
5677
- return /* @__PURE__ */ jsx59(DialogPrimitive.Root, { ...props });
5649
+ return /* @__PURE__ */ jsx58(DialogPrimitive.Root, { ...props });
5678
5650
  }
5679
5651
  function DialogPortal(props) {
5680
- return /* @__PURE__ */ jsx59(DialogPrimitive.Portal, { ...props });
5652
+ return /* @__PURE__ */ jsx58(DialogPrimitive.Portal, { ...props });
5681
5653
  }
5682
5654
  var DialogOverlay = /* @__PURE__ */ React8.forwardRef(function DialogOverlay2({ className, ...props }, ref) {
5683
- return /* @__PURE__ */ jsx59(
5655
+ return /* @__PURE__ */ jsx58(
5684
5656
  DialogPrimitive.Overlay,
5685
5657
  {
5686
5658
  ref,
@@ -5695,7 +5667,7 @@ var DialogOverlay = /* @__PURE__ */ React8.forwardRef(function DialogOverlay2({
5695
5667
  });
5696
5668
  var DialogContent = /* @__PURE__ */ React8.forwardRef(function DialogContent2({ className, children, closeLabel = "Close", ...props }, ref) {
5697
5669
  return /* @__PURE__ */ jsxs39(DialogPortal, { children: [
5698
- /* @__PURE__ */ jsx59(DialogOverlay, {}),
5670
+ /* @__PURE__ */ jsx58(DialogOverlay, {}),
5699
5671
  /* @__PURE__ */ jsxs39(
5700
5672
  DialogPrimitive.Content,
5701
5673
  {
@@ -5717,8 +5689,8 @@ var DialogContent = /* @__PURE__ */ React8.forwardRef(function DialogContent2({
5717
5689
  ICON_TAP_TARGET_FLOOR
5718
5690
  ),
5719
5691
  children: [
5720
- /* @__PURE__ */ jsx59(XIcon, {}),
5721
- /* @__PURE__ */ jsx59("span", { className: "sr-only", children: closeLabel })
5692
+ /* @__PURE__ */ jsx58(XIcon, {}),
5693
+ /* @__PURE__ */ jsx58("span", { className: "sr-only", children: closeLabel })
5722
5694
  ]
5723
5695
  }
5724
5696
  )
@@ -5728,7 +5700,7 @@ var DialogContent = /* @__PURE__ */ React8.forwardRef(function DialogContent2({
5728
5700
  ] });
5729
5701
  });
5730
5702
  var DialogHeader = /* @__PURE__ */ React8.forwardRef(function DialogHeader2({ className, ...props }, ref) {
5731
- return /* @__PURE__ */ jsx59(
5703
+ return /* @__PURE__ */ jsx58(
5732
5704
  "div",
5733
5705
  {
5734
5706
  ref,
@@ -5739,7 +5711,7 @@ var DialogHeader = /* @__PURE__ */ React8.forwardRef(function DialogHeader2({ cl
5739
5711
  );
5740
5712
  });
5741
5713
  var DialogTitle = /* @__PURE__ */ React8.forwardRef(function DialogTitle2({ className, ...props }, ref) {
5742
- return /* @__PURE__ */ jsx59(
5714
+ return /* @__PURE__ */ jsx58(
5743
5715
  DialogPrimitive.Title,
5744
5716
  {
5745
5717
  ref,
@@ -5831,21 +5803,21 @@ function shortcutGroups(labels, isMac) {
5831
5803
  }
5832
5804
 
5833
5805
  // src/shortcuts/ShortcutsDialog.tsx
5834
- import { jsx as jsx60, jsxs as jsxs40 } from "react/jsx-runtime";
5806
+ import { jsx as jsx59, jsxs as jsxs40 } from "react/jsx-runtime";
5835
5807
  var KEYS3 = "rounded border bg-muted px-1.5 py-0.5 font-sans text-xs whitespace-nowrap";
5836
5808
  function ShortcutSection({ group }) {
5837
5809
  const titleId = useId7();
5838
5810
  return /* @__PURE__ */ jsxs40("section", { "aria-labelledby": titleId, children: [
5839
- /* @__PURE__ */ jsx60("h3", { id: titleId, className: "mb-2 text-sm font-semibold", children: group.title }),
5840
- /* @__PURE__ */ jsx60("dl", { className: "grid gap-1.5 text-sm", children: group.items.map(({ label, keys }) => /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between gap-4", children: [
5841
- /* @__PURE__ */ jsx60("dt", { children: label }),
5842
- /* @__PURE__ */ jsx60("dd", { children: /* @__PURE__ */ jsx60("kbd", { className: KEYS3, children: keys }) })
5811
+ /* @__PURE__ */ jsx59("h3", { id: titleId, className: "mb-2 text-sm font-semibold", children: group.title }),
5812
+ /* @__PURE__ */ jsx59("dl", { className: "grid gap-1.5 text-sm", children: group.items.map(({ label, keys }) => /* @__PURE__ */ jsxs40("div", { className: "flex items-center justify-between gap-4", children: [
5813
+ /* @__PURE__ */ jsx59("dt", { children: label }),
5814
+ /* @__PURE__ */ jsx59("dd", { children: /* @__PURE__ */ jsx59("kbd", { className: KEYS3, children: keys }) })
5843
5815
  ] }, `${label} ${keys}`)) })
5844
5816
  ] });
5845
5817
  }
5846
5818
  function ShortcutsDialog({ open, onOpenChange, labels, isMac, onCloseAutoFocus }) {
5847
5819
  const groups = useMemo15(() => shortcutGroups(labels, isMac), [labels, isMac]);
5848
- return /* @__PURE__ */ jsx60(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs40(
5820
+ return /* @__PURE__ */ jsx59(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs40(
5849
5821
  DialogContent,
5850
5822
  {
5851
5823
  closeLabel: labels.close,
@@ -5853,22 +5825,22 @@ function ShortcutsDialog({ open, onOpenChange, labels, isMac, onCloseAutoFocus }
5853
5825
  onCloseAutoFocus,
5854
5826
  className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl",
5855
5827
  children: [
5856
- /* @__PURE__ */ jsx60(DialogHeader, { children: /* @__PURE__ */ jsx60(DialogTitle, { children: labels.shortcuts }) }),
5857
- /* @__PURE__ */ jsx60("div", { className: "grid gap-6 sm:grid-cols-2", children: groups.map((group) => /* @__PURE__ */ jsx60(ShortcutSection, { group }, group.name)) })
5828
+ /* @__PURE__ */ jsx59(DialogHeader, { children: /* @__PURE__ */ jsx59(DialogTitle, { children: labels.shortcuts }) }),
5829
+ /* @__PURE__ */ jsx59("div", { className: "grid gap-6 sm:grid-cols-2", children: groups.map((group) => /* @__PURE__ */ jsx59(ShortcutSection, { group }, group.name)) })
5858
5830
  ]
5859
5831
  }
5860
5832
  ) });
5861
5833
  }
5862
5834
 
5863
5835
  // src/shortcuts/shortcuts-extension.tsx
5864
- import { jsx as jsx61 } from "react/jsx-runtime";
5836
+ import { jsx as jsx60 } from "react/jsx-runtime";
5865
5837
  var SHORTCUT = "Mod-Shift-/";
5866
5838
  var isOpen = (state) => state.shortcutsOpen;
5867
5839
  function ShortcutsOverlay({ controller }) {
5868
5840
  const labels = useLabels();
5869
5841
  const store = useCanvasUiStore();
5870
5842
  const open = useCanvasUi(store, isOpen);
5871
- return /* @__PURE__ */ jsx61(
5843
+ return /* @__PURE__ */ jsx60(
5872
5844
  ShortcutsDialog,
5873
5845
  {
5874
5846
  open,
@@ -5975,13 +5947,11 @@ function useEditingFocus(root, editing, stop) {
5975
5947
  const leaveUnlessInside = (event) => {
5976
5948
  if (!inside.current.has(event)) stop();
5977
5949
  };
5978
- doc.addEventListener("pointerdown", leaveForCanvas, true);
5979
- doc.addEventListener("pointerdown", leaveUnlessInside);
5980
- doc.addEventListener("focusin", leaveUnlessInside);
5950
+ const unlistenCapture = listen(doc, { pointerdown: leaveForCanvas }, true);
5951
+ const unlisten = listen(doc, { pointerdown: leaveUnlessInside, focusin: leaveUnlessInside });
5981
5952
  return () => {
5982
- doc.removeEventListener("pointerdown", leaveForCanvas, true);
5983
- doc.removeEventListener("pointerdown", leaveUnlessInside);
5984
- doc.removeEventListener("focusin", leaveUnlessInside);
5953
+ unlistenCapture();
5954
+ unlisten();
5985
5955
  };
5986
5956
  }, [root, editing, stop]);
5987
5957
  return useMemo16(() => {
@@ -5991,7 +5961,7 @@ function useEditingFocus(root, editing, stop) {
5991
5961
  }
5992
5962
 
5993
5963
  // src/blocks/void/VoidBlock.tsx
5994
- import { jsx as jsx62, jsxs as jsxs41 } from "react/jsx-runtime";
5964
+ import { jsx as jsx61, jsxs as jsxs41 } from "react/jsx-runtime";
5995
5965
  function useMissingPreviewWarning(readOnly, { type, preview }) {
5996
5966
  useEffect22(() => {
5997
5967
  if (!readOnly || preview !== void 0) return;
@@ -6001,8 +5971,8 @@ function useMissingPreviewWarning(readOnly, { type, preview }) {
6001
5971
  }, [readOnly, type, preview]);
6002
5972
  }
6003
5973
  function VoidPreview({ definition: { preview: Preview }, name, ...props }) {
6004
- if (Preview === void 0) return /* @__PURE__ */ jsx62("p", { className: "py-1 text-sm text-muted-foreground", children: name });
6005
- return /* @__PURE__ */ jsx62(Preview, { ...props });
5974
+ if (Preview === void 0) return /* @__PURE__ */ jsx61("p", { className: "py-1 text-sm text-muted-foreground", children: name });
5975
+ return /* @__PURE__ */ jsx61(Preview, { ...props });
6006
5976
  }
6007
5977
  function VoidBlock({ block, controller, definition }) {
6008
5978
  const { blockTypes, labels } = useQuoin();
@@ -6060,8 +6030,8 @@ function VoidBlock({ block, controller, definition }) {
6060
6030
  onClick,
6061
6031
  onDoubleClick,
6062
6032
  children: [
6063
- editorShown && Editor ? /* @__PURE__ */ jsx62(Editor, { data, onChange, onInsertBlock, onDone: leave }) : /* @__PURE__ */ jsx62(VoidPreview, { definition, name, data, blockId }),
6064
- editable && !editorShown && /* @__PURE__ */ jsx62(
6033
+ editorShown && Editor ? /* @__PURE__ */ jsx61(Editor, { data, onChange, onInsertBlock, onDone: leave }) : /* @__PURE__ */ jsx61(VoidPreview, { definition, name, data, blockId }),
6034
+ editable && !editorShown && /* @__PURE__ */ jsx61(
6065
6035
  Button,
6066
6036
  {
6067
6037
  type: "button",
@@ -6071,7 +6041,7 @@ function VoidBlock({ block, controller, definition }) {
6071
6041
  "aria-label": labels.editBlock(name),
6072
6042
  onClick: () => start(),
6073
6043
  className: "absolute right-0 top-0 bg-background/90 opacity-0 group-hover/void:opacity-100 in-data-[selected=true]:opacity-100 pointer-coarse:opacity-100 focus-visible:opacity-100",
6074
- children: /* @__PURE__ */ jsx62(Pencil3, { "aria-hidden": "true" })
6044
+ children: /* @__PURE__ */ jsx61(Pencil3, { "aria-hidden": "true" })
6075
6045
  }
6076
6046
  )
6077
6047
  ]
@@ -6297,7 +6267,7 @@ function useTypedInPlaceWarning(definitions, readOnly) {
6297
6267
  }
6298
6268
 
6299
6269
  // src/canvas/BlockCanvas.tsx
6300
- import { jsx as jsx63, jsxs as jsxs42 } from "react/jsx-runtime";
6270
+ import { jsx as jsx62, jsxs as jsxs42 } from "react/jsx-runtime";
6301
6271
  var GUTTER_ROOM = "ps-12";
6302
6272
  var BlockCanvas = forwardRef8(function BlockCanvas2({
6303
6273
  blocks,
@@ -6377,7 +6347,7 @@ var BlockCanvas = forwardRef8(function BlockCanvas2({
6377
6347
  }),
6378
6348
  [controller, resolveAssetUrl]
6379
6349
  );
6380
- return /* @__PURE__ */ jsx63(QuoinProvider, { value: { blockTypes, upload, resolveAssetUrl, onError, highlight, controller, labels }, children: /* @__PURE__ */ jsx63(VoidEditingContext.Provider, { value: voidEditing, children: /* @__PURE__ */ jsx63(SlashItemsProvider, { value: slashItems, children: /* @__PURE__ */ jsx63(BubbleItemsProvider, { value: ui.bubbleItems, children: /* @__PURE__ */ jsx63(CanvasUiProvider, { value: uiStore, children: /* @__PURE__ */ jsxs42(
6350
+ return /* @__PURE__ */ jsx62(QuoinProvider, { value: { blockTypes, upload, resolveAssetUrl, onError, highlight, controller, labels }, children: /* @__PURE__ */ jsx62(VoidEditingContext.Provider, { value: voidEditing, children: /* @__PURE__ */ jsx62(SlashItemsProvider, { value: slashItems, children: /* @__PURE__ */ jsx62(BubbleItemsProvider, { value: ui.bubbleItems, children: /* @__PURE__ */ jsx62(CanvasUiProvider, { value: uiStore, children: /* @__PURE__ */ jsxs42(
6381
6351
  EditorView,
6382
6352
  {
6383
6353
  controller,
@@ -6395,11 +6365,11 @@ var BlockCanvas = forwardRef8(function BlockCanvas2({
6395
6365
  blocksSelectedLabel: labels.blocksSelected,
6396
6366
  children: [
6397
6367
  !readOnly && /* @__PURE__ */ jsxs42(ExtensionBlockNames.Provider, { value: ui.blockNames, children: [
6398
- /* @__PURE__ */ jsx63(Gutter, { controller, store: uiStore, actions }),
6399
- /* @__PURE__ */ jsx63(BlockContextMenu, { controller, store: uiStore, actions }),
6400
- /* @__PURE__ */ jsx63(MobileToolbar, { controller })
6368
+ /* @__PURE__ */ jsx62(Gutter, { controller, store: uiStore, actions }),
6369
+ /* @__PURE__ */ jsx62(BlockContextMenu, { controller, store: uiStore, actions }),
6370
+ /* @__PURE__ */ jsx62(MobileToolbar, { controller })
6401
6371
  ] }),
6402
- ui.overlays.map((Overlay2, index) => /* @__PURE__ */ jsx63(Overlay2, { controller }, index))
6372
+ ui.overlays.map((Overlay2, index) => /* @__PURE__ */ jsx62(Overlay2, { controller }, index))
6403
6373
  ]
6404
6374
  }
6405
6375
  ) }) }) }) }) });
@@ -6407,7 +6377,7 @@ var BlockCanvas = forwardRef8(function BlockCanvas2({
6407
6377
 
6408
6378
  // src/upload/UploadField.tsx
6409
6379
  import * as React9 from "react";
6410
- import { jsx as jsx64, jsxs as jsxs43 } from "react/jsx-runtime";
6380
+ import { jsx as jsx63, jsxs as jsxs43 } from "react/jsx-runtime";
6411
6381
  function progressText(state, labels) {
6412
6382
  if (state.phase === "busy") return labels.uploading;
6413
6383
  if (state.phase === "uploaded") return labels.uploaded(state.name);
@@ -6437,7 +6407,7 @@ function UploadField({ category, label, accept, onUploaded }) {
6437
6407
  }
6438
6408
  const progress = progressText(state, labels);
6439
6409
  return /* @__PURE__ */ jsxs43("div", { className: "flex flex-col items-start gap-1.5", children: [
6440
- /* @__PURE__ */ jsx64(
6410
+ /* @__PURE__ */ jsx63(
6441
6411
  FilePickerButton,
6442
6412
  {
6443
6413
  label,
@@ -6447,9 +6417,9 @@ function UploadField({ category, label, accept, onUploaded }) {
6447
6417
  onPick: (file) => void run(file)
6448
6418
  }
6449
6419
  ),
6450
- !upload && /* @__PURE__ */ jsx64("span", { role: "note", className: "text-xs text-muted-foreground", children: labels.uploadsUnavailable }),
6451
- /* @__PURE__ */ jsx64("span", { role: "status", className: progress === "" ? "sr-only" : "text-xs text-muted-foreground", children: progress }),
6452
- state.phase === "failed" && /* @__PURE__ */ jsx64("span", { role: "alert", className: "text-xs text-destructive", children: state.message })
6420
+ !upload && /* @__PURE__ */ jsx63("span", { role: "note", className: "text-xs text-muted-foreground", children: labels.uploadsUnavailable }),
6421
+ /* @__PURE__ */ jsx63("span", { role: "status", className: progress === "" ? "sr-only" : "text-xs text-muted-foreground", children: progress }),
6422
+ state.phase === "failed" && /* @__PURE__ */ jsx63("span", { role: "alert", className: "text-xs text-destructive", children: state.message })
6453
6423
  ] });
6454
6424
  }
6455
6425
 
@@ -6663,4 +6633,4 @@ export {
6663
6633
  UploadField,
6664
6634
  useAutosave
6665
6635
  };
6666
- //# sourceMappingURL=chunk-ZGZEJCRV.js.map
6636
+ //# sourceMappingURL=chunk-T43RZTUT.js.map