quoin-editor 1.6.0 → 1.8.0

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 (258) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +27 -11
  3. package/dist/ai-labels-BXX32H9a.d.cts +53 -0
  4. package/dist/ai-labels-BXX32H9a.d.ts +53 -0
  5. package/dist/ai.cjs +84 -86
  6. package/dist/ai.d.cts +4 -53
  7. package/dist/ai.d.ts +4 -53
  8. package/dist/ai.js +8 -10
  9. package/dist/ai.js.map +1 -1
  10. package/dist/catalogue.cjs +27 -24
  11. package/dist/catalogue.d.cts +12 -1
  12. package/dist/catalogue.d.ts +12 -1
  13. package/dist/catalogue.js +19 -16
  14. package/dist/catalogue.js.map +1 -1
  15. package/dist/{chunk-QR2NIDUK.cjs → chunk-4MCYQHFL.cjs} +2 -2
  16. package/dist/{chunk-XFR7QGSN.cjs → chunk-53CNYRVQ.cjs} +92 -94
  17. package/dist/{chunk-T7O3BROK.cjs → chunk-53FJFYBR.cjs} +115 -117
  18. package/dist/{chunk-KFYJW7W5.js → chunk-5OZX2LV4.js} +10 -12
  19. package/dist/chunk-5OZX2LV4.js.map +1 -0
  20. package/dist/{chunk-OS2O6IKX.js → chunk-5RBMZGKV.js} +4 -4
  21. package/dist/{chunk-OS2O6IKX.js.map → chunk-5RBMZGKV.js.map} +1 -1
  22. package/dist/{chunk-4T4TJ2QS.cjs → chunk-7E43TURF.cjs} +7 -7
  23. package/dist/{chunk-L6RB43YM.cjs → chunk-7X3T7VXV.cjs} +32 -34
  24. package/dist/{chunk-BJTOLCRR.js → chunk-7Y4B7NHO.js} +2 -2
  25. package/dist/chunk-7Y4B7NHO.js.map +1 -0
  26. package/dist/{chunk-LOP66FVU.cjs → chunk-B3OBM6I4.cjs} +25 -27
  27. package/dist/{chunk-UUSZGUXJ.cjs → chunk-BA5WXBGE.cjs} +291 -293
  28. package/dist/{chunk-CSKKSXCE.js → chunk-CSPCDVCT.js} +3 -3
  29. package/dist/{chunk-CSKKSXCE.js.map → chunk-CSPCDVCT.js.map} +1 -1
  30. package/dist/{chunk-R7MYG522.js → chunk-D4L5FINK.js} +3 -3
  31. package/dist/{chunk-R7MYG522.js.map → chunk-D4L5FINK.js.map} +1 -1
  32. package/dist/{chunk-GHNQKJMD.js → chunk-DBOZFNWU.js} +3 -3
  33. package/dist/{chunk-GHNQKJMD.js.map → chunk-DBOZFNWU.js.map} +1 -1
  34. package/dist/{chunk-BM2GRZNM.cjs → chunk-DJU25PFC.cjs} +11 -11
  35. package/dist/chunk-DLQCTGC3.js +10 -0
  36. package/dist/chunk-DLQCTGC3.js.map +1 -0
  37. package/dist/{chunk-B5OMWOVI.js → chunk-DXUDBPG5.js} +9 -11
  38. package/dist/chunk-DXUDBPG5.js.map +1 -0
  39. package/dist/{chunk-TKCPXUPP.cjs → chunk-EZWJRBQT.cjs} +51 -53
  40. package/dist/{chunk-N2SCDXTI.js → chunk-EZX37R5D.js} +8 -10
  41. package/dist/chunk-EZX37R5D.js.map +1 -0
  42. package/dist/{chunk-VZZPCYA3.cjs → chunk-FK7EBZPX.cjs} +226 -226
  43. package/dist/{chunk-BXSWZEA5.js → chunk-GPTJYWGS.js} +3 -3
  44. package/dist/{chunk-BXSWZEA5.js.map → chunk-GPTJYWGS.js.map} +1 -1
  45. package/dist/{chunk-H3C3MJW5.cjs → chunk-LM3DHROX.cjs} +2 -2
  46. package/dist/{chunk-AD3NY7NA.js → chunk-LSI4RMTY.js} +3 -3
  47. package/dist/{chunk-AD3NY7NA.js.map → chunk-LSI4RMTY.js.map} +1 -1
  48. package/dist/chunk-MMS4D4MK.cjs +87 -0
  49. package/dist/{chunk-HT7OF52E.js → chunk-MRHDPXQ7.js} +8 -10
  50. package/dist/chunk-MRHDPXQ7.js.map +1 -0
  51. package/dist/{chunk-XFEDJEJF.js → chunk-MSWA5ZZM.js} +4 -4
  52. package/dist/{chunk-XFEDJEJF.js.map → chunk-MSWA5ZZM.js.map} +1 -1
  53. package/dist/chunk-NCDMQCZR.js +85 -0
  54. package/dist/chunk-NCDMQCZR.js.map +1 -0
  55. package/dist/{chunk-QJ34MOFV.cjs → chunk-P6HC7RUN.cjs} +120 -120
  56. package/dist/{chunk-O7XZFXPE.js → chunk-PHQMHXNG.js} +9 -11
  57. package/dist/chunk-PHQMHXNG.js.map +1 -0
  58. package/dist/{chunk-WN7BZDNH.cjs → chunk-PURYVDC3.cjs} +13 -13
  59. package/dist/{chunk-46JH34SR.cjs → chunk-PVFSJXYQ.cjs} +28 -30
  60. package/dist/{chunk-QOIVLYMW.js → chunk-SP4F5F6V.js} +5 -5
  61. package/dist/{chunk-QOIVLYMW.js.map → chunk-SP4F5F6V.js.map} +1 -1
  62. package/dist/{chunk-JVSYEENH.cjs → chunk-TQHFGSTT.cjs} +57 -59
  63. package/dist/{chunk-G25FMFEZ.js → chunk-UDBLZILE.js} +4 -4
  64. package/dist/{chunk-G25FMFEZ.js.map → chunk-UDBLZILE.js.map} +1 -1
  65. package/dist/{chunk-2AVGGPLT.js → chunk-VM567D6O.js} +8 -10
  66. package/dist/chunk-VM567D6O.js.map +1 -0
  67. package/dist/{chunk-KF3KKN4N.js → chunk-VWYPO6SX.js} +8 -10
  68. package/dist/chunk-VWYPO6SX.js.map +1 -0
  69. package/dist/{chunk-IJKGF6SC.js → chunk-WOGCD7JN.js} +8 -10
  70. package/dist/chunk-WOGCD7JN.js.map +1 -0
  71. package/dist/{chunk-AZF7B2AE.cjs → chunk-XKYNINUX.cjs} +11 -11
  72. package/dist/{chunk-32OZ2WM2.js → chunk-Y4EJ6UBV.js} +8 -11
  73. package/dist/chunk-Y4EJ6UBV.js.map +1 -0
  74. package/dist/{chunk-XZ4NC3Q7.cjs → chunk-YEDPBYO5.cjs} +4 -4
  75. package/dist/{chunk-STKGRXSA.cjs → chunk-YVPZDTVZ.cjs} +15 -17
  76. package/dist/chunk-ZWTIRGY5.cjs +10 -0
  77. package/dist/comments-labels-DWqsSz8G.d.cts +30 -0
  78. package/dist/comments-labels-DWqsSz8G.d.ts +30 -0
  79. package/dist/comments.cjs +63 -65
  80. package/dist/comments.d.cts +4 -30
  81. package/dist/comments.d.ts +4 -30
  82. package/dist/comments.js +9 -11
  83. package/dist/comments.js.map +1 -1
  84. package/dist/diagram-extension-22x_njXB.d.ts +30 -0
  85. package/dist/diagram-extension-C_FSkoj9.d.cts +30 -0
  86. package/dist/diagram-labels-Bi_jEZ8_.d.cts +11 -0
  87. package/dist/diagram-labels-Bi_jEZ8_.d.ts +11 -0
  88. package/dist/diagram.cjs +26 -0
  89. package/dist/diagram.d.cts +9 -0
  90. package/dist/diagram.d.ts +9 -0
  91. package/dist/diagram.js +11 -0
  92. package/dist/diagram.js.map +1 -0
  93. package/dist/diff-labels-DWwg7N0n.d.cts +27 -0
  94. package/dist/diff-labels-DWwg7N0n.d.ts +27 -0
  95. package/dist/diff.cjs +27 -29
  96. package/dist/diff.d.cts +4 -27
  97. package/dist/diff.d.ts +4 -27
  98. package/dist/diff.js +5 -7
  99. package/dist/diff.js.map +1 -1
  100. package/dist/docx.cjs +30 -30
  101. package/dist/docx.js +3 -3
  102. package/dist/embed-labels-BiVa9HYl.d.cts +23 -0
  103. package/dist/embed-labels-BiVa9HYl.d.ts +23 -0
  104. package/dist/embed.cjs +10 -9
  105. package/dist/embed.d.cts +4 -23
  106. package/dist/embed.d.ts +4 -23
  107. package/dist/embed.js +8 -7
  108. package/dist/emoji-extension-C832oGeT.d.ts +16 -0
  109. package/dist/emoji-extension-Dk5IQLZf.d.cts +16 -0
  110. package/dist/{emoji-extension-gRKnbW8G.d.ts → emoji-labels-YwOms7ZJ.d.cts} +2 -15
  111. package/dist/{emoji-extension-C3o_Y5uC.d.cts → emoji-labels-YwOms7ZJ.d.ts} +2 -15
  112. package/dist/emoji.cjs +10 -9
  113. package/dist/emoji.d.cts +4 -3
  114. package/dist/emoji.d.ts +4 -3
  115. package/dist/emoji.js +7 -6
  116. package/dist/engine.cjs +58 -58
  117. package/dist/engine.d.cts +8 -7
  118. package/dist/engine.d.ts +8 -7
  119. package/dist/engine.js +3 -3
  120. package/dist/find-extension-BfruAPLi.d.cts +15 -0
  121. package/dist/find-extension-DmK9_N81.d.ts +15 -0
  122. package/dist/{find-extension-B_Ctrs6T.d.ts → find-labels-C4vs8Qe9.d.cts} +2 -14
  123. package/dist/{find-extension-BGGsJMu4.d.cts → find-labels-C4vs8Qe9.d.ts} +2 -14
  124. package/dist/find.cjs +11 -10
  125. package/dist/find.d.cts +2 -1
  126. package/dist/find.d.ts +2 -1
  127. package/dist/find.js +7 -6
  128. package/dist/headless.cjs +74 -74
  129. package/dist/headless.d.cts +38 -8
  130. package/dist/headless.d.ts +38 -8
  131. package/dist/headless.js +4 -4
  132. package/dist/highlight.cjs +7 -6
  133. package/dist/highlight.js +6 -5
  134. package/dist/highlight.js.map +1 -1
  135. package/dist/{index-CsG7OQoq.d.cts → index-3fYvwqUZ.d.cts} +1 -1
  136. package/dist/{index-h1llgZM-.d.ts → index-CgxnzCO5.d.ts} +1 -1
  137. package/dist/index.cjs +87 -86
  138. package/dist/index.d.cts +18 -185
  139. package/dist/index.d.ts +18 -185
  140. package/dist/index.js +6 -5
  141. package/dist/labels-BhRJYo46.d.ts +176 -0
  142. package/dist/labels-CiCxj2jP.d.cts +176 -0
  143. package/dist/locale-ar.cjs +565 -0
  144. package/dist/locale-ar.d.cts +63 -0
  145. package/dist/locale-ar.d.ts +63 -0
  146. package/dist/locale-ar.js +551 -0
  147. package/dist/locale-ar.js.map +1 -0
  148. package/dist/locale-de.cjs +510 -0
  149. package/dist/locale-de.d.cts +63 -0
  150. package/dist/locale-de.d.ts +63 -0
  151. package/dist/locale-de.js +496 -0
  152. package/dist/locale-de.js.map +1 -0
  153. package/dist/locale-es.cjs +510 -0
  154. package/dist/locale-es.d.cts +63 -0
  155. package/dist/locale-es.d.ts +63 -0
  156. package/dist/locale-es.js +496 -0
  157. package/dist/locale-es.js.map +1 -0
  158. package/dist/locale-fr.cjs +510 -0
  159. package/dist/locale-fr.d.cts +63 -0
  160. package/dist/locale-fr.d.ts +63 -0
  161. package/dist/locale-fr.js +496 -0
  162. package/dist/locale-fr.js.map +1 -0
  163. package/dist/locale-ja.cjs +505 -0
  164. package/dist/locale-ja.d.cts +63 -0
  165. package/dist/locale-ja.d.ts +63 -0
  166. package/dist/locale-ja.js +491 -0
  167. package/dist/locale-ja.js.map +1 -0
  168. package/dist/locale-pt.cjs +511 -0
  169. package/dist/locale-pt.d.cts +63 -0
  170. package/dist/locale-pt.d.ts +63 -0
  171. package/dist/locale-pt.js +497 -0
  172. package/dist/locale-pt.js.map +1 -0
  173. package/dist/locale-zh.cjs +505 -0
  174. package/dist/locale-zh.d.cts +63 -0
  175. package/dist/locale-zh.d.ts +63 -0
  176. package/dist/locale-zh.js +491 -0
  177. package/dist/locale-zh.js.map +1 -0
  178. package/dist/math-labels-DOf5KFxp.d.cts +24 -0
  179. package/dist/math-labels-DOf5KFxp.d.ts +24 -0
  180. package/dist/math.cjs +11 -10
  181. package/dist/math.d.cts +4 -24
  182. package/dist/math.d.ts +4 -24
  183. package/dist/math.js +9 -8
  184. package/dist/mention-labels-DIQy8LRT.d.cts +15 -0
  185. package/dist/mention-labels-DIQy8LRT.d.ts +15 -0
  186. package/dist/mention.cjs +11 -10
  187. package/dist/mention.d.cts +4 -15
  188. package/dist/mention.d.ts +4 -15
  189. package/dist/mention.js +9 -8
  190. package/dist/{view-controller-p-2x3J7Y.d.ts → node-reveal-BnFcnHhz.d.ts} +14 -14
  191. package/dist/{view-controller-BfVSNZYZ.d.cts → node-reveal-DY6bimv3.d.cts} +14 -14
  192. package/dist/palette-BrX-hEd-.d.cts +4 -0
  193. package/dist/palette-BrX-hEd-.d.ts +4 -0
  194. package/dist/presence-labels-DXVJLifl.d.cts +15 -0
  195. package/dist/presence-labels-DXVJLifl.d.ts +15 -0
  196. package/dist/presence.cjs +40 -42
  197. package/dist/presence.d.cts +4 -15
  198. package/dist/presence.d.ts +4 -15
  199. package/dist/presence.js +9 -11
  200. package/dist/presence.js.map +1 -1
  201. package/dist/source-labels-CeQDXsYZ.d.cts +9 -0
  202. package/dist/source-labels-CeQDXsYZ.d.ts +9 -0
  203. package/dist/source.cjs +11 -14
  204. package/dist/source.d.cts +5 -10
  205. package/dist/source.d.ts +5 -10
  206. package/dist/source.js +7 -10
  207. package/dist/source.js.map +1 -1
  208. package/dist/{stats-extension-oD6D1cYy.d.ts → stats-extension-D5HySF0a.d.cts} +4 -16
  209. package/dist/{stats-extension-XqOTvRaq.d.cts → stats-extension-Dmw0Ujxe.d.ts} +4 -16
  210. package/dist/stats-labels-W8gep51s.d.cts +15 -0
  211. package/dist/stats-labels-W8gep51s.d.ts +15 -0
  212. package/dist/stats.cjs +11 -10
  213. package/dist/stats.d.cts +3 -2
  214. package/dist/stats.d.ts +3 -2
  215. package/dist/stats.js +8 -7
  216. package/dist/styles.css +1 -1
  217. package/dist/table-extension-7LkLNK6Q.d.cts +15 -0
  218. package/dist/table-extension-DEpV0DnP.d.ts +15 -0
  219. package/dist/{table-extension-v6VB59bF.d.ts → table-labels-Dc-MzU3j.d.cts} +2 -14
  220. package/dist/{table-extension-BP47hHoz.d.cts → table-labels-Dc-MzU3j.d.ts} +2 -14
  221. package/dist/table.cjs +26 -25
  222. package/dist/table.d.cts +2 -1
  223. package/dist/table.d.ts +2 -1
  224. package/dist/table.js +7 -6
  225. package/dist/{to-html-1oD-CDle.d.cts → to-html-C19PbIzh.d.cts} +1 -0
  226. package/dist/{to-html-CLRBCX0I.d.ts → to-html-CogwrQer.d.ts} +1 -0
  227. package/dist/{to-markdown-CFPMbbiX.d.cts → to-markdown-C2w7Dzg8.d.cts} +1 -0
  228. package/dist/{to-markdown-BVOzhgVM.d.ts → to-markdown-DC1EUye5.d.ts} +1 -0
  229. package/dist/toc-extension-Dvh37bWQ.d.cts +15 -0
  230. package/dist/toc-extension-SVckrFmb.d.ts +15 -0
  231. package/dist/toc-labels-B2apPfXG.d.cts +14 -0
  232. package/dist/toc-labels-B2apPfXG.d.ts +14 -0
  233. package/dist/toc.cjs +10 -9
  234. package/dist/toc.d.cts +3 -2
  235. package/dist/toc.d.ts +3 -2
  236. package/dist/toc.js +7 -6
  237. package/dist/{types-DXF9p4qV.d.cts → types-Bzhq5AXj.d.cts} +1 -0
  238. package/dist/{types-BjLcmV00.d.ts → types-DMuuDBVh.d.ts} +1 -0
  239. package/dist/view.cjs +4 -4
  240. package/dist/view.js +2 -2
  241. package/dist/yjs.cjs +121 -121
  242. package/dist/yjs.d.cts +2 -2
  243. package/dist/yjs.d.ts +2 -2
  244. package/dist/yjs.js +5 -5
  245. package/package.json +81 -1
  246. package/dist/chunk-2AVGGPLT.js.map +0 -1
  247. package/dist/chunk-32OZ2WM2.js.map +0 -1
  248. package/dist/chunk-B5OMWOVI.js.map +0 -1
  249. package/dist/chunk-BJTOLCRR.js.map +0 -1
  250. package/dist/chunk-HT7OF52E.js.map +0 -1
  251. package/dist/chunk-IJKGF6SC.js.map +0 -1
  252. package/dist/chunk-KF3KKN4N.js.map +0 -1
  253. package/dist/chunk-KFYJW7W5.js.map +0 -1
  254. package/dist/chunk-N2SCDXTI.js.map +0 -1
  255. package/dist/chunk-O7XZFXPE.js.map +0 -1
  256. package/dist/toc-extension-CI6jNOYl.d.cts +0 -26
  257. package/dist/toc-extension-CTHWjNJC.d.ts +0 -26
  258. /package/dist/{chunk-WZA5S5EJ.cjs → chunk-I7X7B3WD.cjs} +0 -0
@@ -1,22 +1,23 @@
1
1
  'use strict';
2
2
 
3
- var chunkH3C3MJW5_cjs = require('./chunk-H3C3MJW5.cjs');
4
- var chunkUUSZGUXJ_cjs = require('./chunk-UUSZGUXJ.cjs');
5
- var chunkQJ34MOFV_cjs = require('./chunk-QJ34MOFV.cjs');
3
+ var chunkLM3DHROX_cjs = require('./chunk-LM3DHROX.cjs');
4
+ var chunkBA5WXBGE_cjs = require('./chunk-BA5WXBGE.cjs');
5
+ var chunkP6HC7RUN_cjs = require('./chunk-P6HC7RUN.cjs');
6
+ var chunkZWTIRGY5_cjs = require('./chunk-ZWTIRGY5.cjs');
6
7
  var chunkA6PGQVTR_cjs = require('./chunk-A6PGQVTR.cjs');
7
- var chunkVZZPCYA3_cjs = require('./chunk-VZZPCYA3.cjs');
8
- var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
8
+ var chunkFK7EBZPX_cjs = require('./chunk-FK7EBZPX.cjs');
9
+ var chunkI7X7B3WD_cjs = require('./chunk-I7X7B3WD.cjs');
9
10
  var react = require('react');
10
11
  var jsxRuntime = require('react/jsx-runtime');
11
12
 
12
13
  function LinkCard({ controller, blockId, url, title, description, image, readOnly, linkRef }) {
13
14
  const card = react.useRef(null);
14
15
  const [failed, setFailed] = react.useState(null);
15
- const href = chunkWZA5S5EJ_cjs.sanitizeHref(url);
16
- const domain = chunkH3C3MJW5_cjs.domainOf(url);
17
- const picture = chunkH3C3MJW5_cjs.webAddress(image);
16
+ const href = chunkI7X7B3WD_cjs.sanitizeHref(url);
17
+ const domain = chunkLM3DHROX_cjs.domainOf(url);
18
+ const picture = chunkLM3DHROX_cjs.webAddress(image);
18
19
  const name = title || url;
19
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: card, className: "quoin-link-card", ...readOnly ? void 0 : chunkUUSZGUXJ_cjs.selectHandlers(controller, blockId, card), children: [
20
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: card, className: "quoin-link-card", ...readOnly ? void 0 : chunkBA5WXBGE_cjs.selectHandlers(controller, blockId, card), children: [
20
21
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "quoin-link-card-text", children: [
21
22
  href === null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "quoin-link-card-title", children: name }) : /* @__PURE__ */ jsxRuntime.jsx(
22
23
  "a",
@@ -51,7 +52,7 @@ function useLinkCardKeys(controller, blockId, url, editable) {
51
52
  const root = react.useRef(null);
52
53
  const link = react.useRef(null);
53
54
  const keys = react.useMemo(() => ({ enter: () => link.current?.focus() }), []);
54
- chunkUUSZGUXJ_cjs.useNodeKeys(controller, blockId, editable, chunkWZA5S5EJ_cjs.sanitizeHref(url) !== null, root, keys);
55
+ chunkBA5WXBGE_cjs.useNodeKeys(controller, blockId, editable, chunkI7X7B3WD_cjs.sanitizeHref(url) !== null, root, keys);
55
56
  return { root, link };
56
57
  }
57
58
 
@@ -60,7 +61,7 @@ var filled = (value) => typeof value === "string" && value.trim() !== "" ? value
60
61
  function unfurledPatch(found) {
61
62
  if (typeof found !== "object" || found === null) return null;
62
63
  const { title, description, image } = found;
63
- const patch = { title: filled(title), description: filled(description), image: chunkH3C3MJW5_cjs.webAddress(image) ?? void 0 };
64
+ const patch = { title: filled(title), description: filled(description), image: chunkLM3DHROX_cjs.webAddress(image) ?? void 0 };
64
65
  if (patch.title === void 0) return null;
65
66
  return Object.fromEntries(Object.entries(patch).filter(([, value]) => value !== void 0));
66
67
  }
@@ -84,8 +85,8 @@ function askFirstTime(controller, blockId, url) {
84
85
  return true;
85
86
  }
86
87
  function bookmarkAt(controller, blockId, url) {
87
- const block = chunkWZA5S5EJ_cjs.blockById(controller.editor.state.doc, blockId);
88
- return block?.type === "BOOKMARK" && chunkWZA5S5EJ_cjs.str(block.attrs.url) === url ? block : void 0;
88
+ const block = chunkI7X7B3WD_cjs.blockById(controller.editor.state.doc, blockId);
89
+ return block?.type === "BOOKMARK" && chunkI7X7B3WD_cjs.str(block.attrs.url) === url ? block : void 0;
89
90
  }
90
91
  async function unfurlInto(controller, blockId, url, unfurl, onError) {
91
92
  const { asked, drawn } = asksOf(controller);
@@ -93,7 +94,7 @@ async function unfurlInto(controller, blockId, url, unfurl, onError) {
93
94
  try {
94
95
  found = await unfurl(url);
95
96
  } catch (cause) {
96
- if (bookmarkAt(controller, blockId, url) && drawn.get(blockId)) onError(chunkUUSZGUXJ_cjs.toError(cause));
97
+ if (bookmarkAt(controller, blockId, url) && drawn.get(blockId)) onError(chunkBA5WXBGE_cjs.toError(cause));
97
98
  return;
98
99
  }
99
100
  const patch = unfurledPatch(found);
@@ -103,12 +104,12 @@ async function unfurlInto(controller, blockId, url, unfurl, onError) {
103
104
  asked.delete(keyOf(blockId, url));
104
105
  return;
105
106
  }
106
- if (chunkWZA5S5EJ_cjs.str(block.attrs.title) !== "") return;
107
+ if (chunkI7X7B3WD_cjs.str(block.attrs.title) !== "") return;
107
108
  const { editor } = controller;
108
- editor.dispatch(editor.createTransaction().step(chunkVZZPCYA3_cjs.setAttrsStep(blockId, patch)).setMeta("addToHistory", false));
109
+ editor.dispatch(editor.createTransaction().step(chunkFK7EBZPX_cjs.setAttrsStep(blockId, patch)).setMeta("addToHistory", false));
109
110
  }
110
111
  function useUnfurl(controller, blockId, url, unfurl) {
111
- const { onError } = chunkUUSZGUXJ_cjs.useQuoin();
112
+ const { onError } = chunkBA5WXBGE_cjs.useQuoin();
112
113
  react.useEffect(() => {
113
114
  const { drawn } = asksOf(controller);
114
115
  drawn.set(blockId, (drawn.get(blockId) ?? 0) + 1);
@@ -124,10 +125,10 @@ function useUnfurl(controller, blockId, url, unfurl) {
124
125
  }, [controller, blockId, url, unfurl, onError]);
125
126
  }
126
127
  function BookmarkBlock({ block, controller, feature }) {
127
- const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
128
+ const readOnly = chunkP6HC7RUN_cjs.useReadOnly(controller);
128
129
  const { attrs } = block;
129
- const url = chunkWZA5S5EJ_cjs.str(attrs.url);
130
- const title = chunkWZA5S5EJ_cjs.str(attrs.title);
130
+ const url = chunkI7X7B3WD_cjs.str(attrs.url);
131
+ const title = chunkI7X7B3WD_cjs.str(attrs.title);
131
132
  const { root, link } = useLinkCardKeys(controller, block.id, url, !readOnly);
132
133
  useUnfurl(controller, block.id, url, title === "" && !readOnly ? feature.unfurl : void 0);
133
134
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -145,8 +146,8 @@ function BookmarkBlock({ block, controller, feature }) {
145
146
  blockId: block.id,
146
147
  url,
147
148
  title,
148
- description: chunkWZA5S5EJ_cjs.str(attrs.description),
149
- image: chunkWZA5S5EJ_cjs.str(attrs.image),
149
+ description: chunkI7X7B3WD_cjs.str(attrs.description),
150
+ image: chunkI7X7B3WD_cjs.str(attrs.image),
150
151
  readOnly,
151
152
  linkRef: link
152
153
  }
@@ -160,7 +161,7 @@ var PLAYER_HEIGHTS = { spotify: 352, soundcloud: 166 };
160
161
  var playerHeight = (provider) => Object.hasOwn(PLAYER_HEIGHTS, provider) ? PLAYER_HEIGHTS[provider] : void 0;
161
162
  function useCoverPress(controller) {
162
163
  const [pressing, setPressing] = react.useState(false);
163
- chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
164
+ chunkP6HC7RUN_cjs.useIsomorphicLayoutEffect(() => {
164
165
  const doc = controller.root?.ownerDocument;
165
166
  if (!pressing || doc === void 0) return;
166
167
  const release = () => setPressing(false);
@@ -181,13 +182,13 @@ function useCoverPress(controller) {
181
182
  function EmbedFrame({ blockId, controller, match, title, readOnly }) {
182
183
  const root = react.useRef(null);
183
184
  const frame = react.useRef(null);
184
- const selected = chunkQJ34MOFV_cjs.useEditorState(
185
+ const selected = chunkP6HC7RUN_cjs.useEditorState(
185
186
  controller,
186
187
  react.useCallback(({ selection }) => selection?.kind === "node" && selection.block === blockId, [blockId])
187
188
  );
188
189
  const cover = useCoverPress(controller);
189
190
  const keys = react.useMemo(() => ({ enter: () => void setTimeout(() => frame.current?.focus()) }), []);
190
- chunkUUSZGUXJ_cjs.useNodeKeys(controller, blockId, !readOnly, true, root, keys);
191
+ chunkBA5WXBGE_cjs.useNodeKeys(controller, blockId, !readOnly, true, root, keys);
191
192
  const height = playerHeight(match.provider);
192
193
  return /* @__PURE__ */ jsxRuntime.jsxs(
193
194
  "div",
@@ -202,9 +203,9 @@ function EmbedFrame({ blockId, controller, match, title, readOnly }) {
202
203
  ref: frame,
203
204
  src: match.src,
204
205
  title,
205
- sandbox: chunkWZA5S5EJ_cjs.EMBED_FRAME.sandbox,
206
- loading: chunkWZA5S5EJ_cjs.EMBED_FRAME.loading,
207
- referrerPolicy: chunkWZA5S5EJ_cjs.EMBED_FRAME.referrerpolicy,
206
+ sandbox: chunkI7X7B3WD_cjs.EMBED_FRAME.sandbox,
207
+ loading: chunkI7X7B3WD_cjs.EMBED_FRAME.loading,
208
+ referrerPolicy: chunkI7X7B3WD_cjs.EMBED_FRAME.referrerpolicy,
208
209
  tabIndex: readOnly ? void 0 : -1
209
210
  }
210
211
  ),
@@ -215,7 +216,7 @@ function EmbedFrame({ blockId, controller, match, title, readOnly }) {
215
216
  className: "quoin-embed-cover",
216
217
  onPointerDownCapture: cover.onPress,
217
218
  onMouseDown: (event) => event.preventDefault(),
218
- onClick: () => chunkUUSZGUXJ_cjs.focusNode(controller, blockId)
219
+ onClick: () => chunkBA5WXBGE_cjs.focusNode(controller, blockId)
219
220
  }
220
221
  )
221
222
  ]
@@ -226,14 +227,14 @@ function EmbedFrame({ blockId, controller, match, title, readOnly }) {
226
227
  // src/extensions/embed/providers.ts
227
228
  function frameOf(url, provider) {
228
229
  try {
229
- return chunkWZA5S5EJ_cjs.embedFrame(url, [provider])?.src ?? null;
230
+ return chunkI7X7B3WD_cjs.embedFrame(url, [provider])?.src ?? null;
230
231
  } catch {
231
232
  chunkA6PGQVTR_cjs.devWarn(`the embed provider "${provider.name}" threw, so it frames nothing.`);
232
233
  return null;
233
234
  }
234
235
  }
235
236
  function matchEmbed(url, hostProviders = []) {
236
- for (const provider of [...hostProviders, ...chunkWZA5S5EJ_cjs.coreEmbedProviders]) {
237
+ for (const provider of [...hostProviders, ...chunkI7X7B3WD_cjs.coreEmbedProviders]) {
237
238
  const src = frameOf(url, provider);
238
239
  if (src !== null) return { provider: provider.name, src };
239
240
  }
@@ -241,8 +242,8 @@ function matchEmbed(url, hostProviders = []) {
241
242
  }
242
243
  function EmbedBlock({ block, controller, feature }) {
243
244
  const { labels, providers } = feature;
244
- const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
245
- const url = chunkWZA5S5EJ_cjs.str(block.attrs.url);
245
+ const readOnly = chunkP6HC7RUN_cjs.useReadOnly(controller);
246
+ const url = chunkI7X7B3WD_cjs.str(block.attrs.url);
246
247
  const match = react.useMemo(() => matchEmbed(url, providers), [url, providers]);
247
248
  const { root, link } = useLinkCardKeys(controller, block.id, url, !readOnly && match === null);
248
249
  return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: root, role: "group", "aria-label": labels.embed, contentEditable: false, className: "quoin-embed", children: match === null ? /* @__PURE__ */ jsxRuntime.jsx(LinkCard, { controller, blockId: block.id, url, readOnly, linkRef: link }) : /* @__PURE__ */ jsxRuntime.jsx(
@@ -251,7 +252,7 @@ function EmbedBlock({ block, controller, feature }) {
251
252
  blockId: block.id,
252
253
  controller,
253
254
  match,
254
- title: chunkWZA5S5EJ_cjs.firstNamed(labels.frameTitle(match.provider), match.provider, url),
255
+ title: chunkI7X7B3WD_cjs.firstNamed(labels.frameTitle(match.provider), match.provider, url),
255
256
  readOnly
256
257
  }
257
258
  ) });
@@ -281,10 +282,7 @@ var englishEmbedLabels = {
281
282
  cannotEmbed: "This link cannot be embedded.",
282
283
  bookmarkInstead: "Bookmark instead"
283
284
  };
284
- function resolveEmbedLabels(overrides) {
285
- const given = Object.entries(overrides ?? {}).filter(([, value]) => value !== void 0);
286
- return given.length === 0 ? englishEmbedLabels : { ...englishEmbedLabels, ...Object.fromEntries(given) };
287
- }
285
+ var resolveEmbedLabels = (overrides) => chunkZWTIRGY5_cjs.mergeLabels(englishEmbedLabels, overrides);
288
286
  var stores = /* @__PURE__ */ new WeakMap();
289
287
  function storeOf(controller) {
290
288
  let store = stores.get(controller);
@@ -320,7 +318,7 @@ var embedSlashItems = (labels) => [
320
318
  title: labels.embed,
321
319
  description: labels.embedDescription,
322
320
  group: "embeds",
323
- icon: chunkUUSZGUXJ_cjs.AppWindow,
321
+ icon: chunkBA5WXBGE_cjs.AppWindow,
324
322
  keywords: ["iframe", "video", "youtube", "vimeo", "loom", "figma", "codepen", "spotify", "soundcloud"],
325
323
  run: ({ controller, range }) => requestLink(controller, { kind: "embed", at: range })
326
324
  },
@@ -329,14 +327,14 @@ var embedSlashItems = (labels) => [
329
327
  title: labels.bookmark,
330
328
  description: labels.bookmarkDescription,
331
329
  group: "embeds",
332
- icon: chunkUUSZGUXJ_cjs.Bookmark,
330
+ icon: chunkBA5WXBGE_cjs.Bookmark,
333
331
  keywords: ["link", "url", "card", "preview", "web"],
334
332
  run: ({ controller, range }) => requestLink(controller, { kind: "bookmark", at: range })
335
333
  }
336
334
  ];
337
335
 
338
336
  // src/extensions/embed/link-choice.ts
339
- var linkChoiceKey = chunkVZZPCYA3_cjs.createPluginKey("linkChoice");
337
+ var linkChoiceKey = chunkFK7EBZPX_cjs.createPluginKey("linkChoice");
340
338
  var linkChoicePlugin = {
341
339
  key: linkChoiceKey,
342
340
  init: () => null,
@@ -344,25 +342,25 @@ var linkChoicePlugin = {
344
342
  const pasted = tr.getMeta(linkChoiceKey.name);
345
343
  if (pasted !== void 0) return pasted;
346
344
  if (value === null) return null;
347
- const moved = tr.selectionSet && !chunkVZZPCYA3_cjs.sameSelection(tr.before.selection, tr.selection);
348
- const lineChanged = chunkWZA5S5EJ_cjs.blockById(before.doc, value.block) !== chunkWZA5S5EJ_cjs.blockById(after.doc, value.block);
345
+ const moved = tr.selectionSet && !chunkFK7EBZPX_cjs.sameSelection(tr.before.selection, tr.selection);
346
+ const lineChanged = chunkI7X7B3WD_cjs.blockById(before.doc, value.block) !== chunkI7X7B3WD_cjs.blockById(after.doc, value.block);
349
347
  return moved || lineChanged ? null : value;
350
348
  }
351
349
  };
352
350
  var linkChoice = (state) => state.pluginState.get(linkChoiceKey.name) ?? null;
353
351
  function onEmptyLine({ doc, schema, selection }) {
354
352
  if (doc.blocks.length === 0) return true;
355
- if (selection?.kind !== "text" || !chunkVZZPCYA3_cjs.isCollapsed(selection)) return false;
356
- const block = chunkWZA5S5EJ_cjs.blockById(doc, selection.head.block);
357
- return block !== void 0 && chunkVZZPCYA3_cjs.isParagraph(block) && chunkVZZPCYA3_cjs.regionLength(block, chunkVZZPCYA3_cjs.primaryRegion(schema, block) ?? "") === 0;
353
+ if (selection?.kind !== "text" || !chunkFK7EBZPX_cjs.isCollapsed(selection)) return false;
354
+ const block = chunkI7X7B3WD_cjs.blockById(doc, selection.head.block);
355
+ return block !== void 0 && chunkFK7EBZPX_cjs.isParagraph(block) && chunkFK7EBZPX_cjs.regionLength(block, chunkFK7EBZPX_cjs.primaryRegion(schema, block) ?? "") === 0;
358
356
  }
359
357
  var pasteLinkChoice = {
360
358
  name: "link-choice",
361
359
  match(text, state) {
362
- const link = chunkVZZPCYA3_cjs.pastedLink(text);
363
- const slice = link === null || link.rest !== "" || !onEmptyLine(state) ? null : chunkVZZPCYA3_cjs.sliceFromClipboard({ text });
360
+ const link = chunkFK7EBZPX_cjs.pastedLink(text);
361
+ const slice = link === null || link.rest !== "" || !onEmptyLine(state) ? null : chunkFK7EBZPX_cjs.sliceFromClipboard({ text });
364
362
  if (link === null || slice === null) return null;
365
- const paste = chunkVZZPCYA3_cjs.insertSlice(slice);
363
+ const paste = chunkFK7EBZPX_cjs.insertSlice(slice);
366
364
  return (before, dispatch) => paste(before, dispatch && ((tr) => dispatch(tr.setMeta(linkChoiceKey.name, choiceAfter(tr, link.href)))));
367
365
  }
368
366
  };
@@ -372,16 +370,16 @@ function choiceAfter(tr, href) {
372
370
  }
373
371
  function emptyParagraph(blockId) {
374
372
  return (state, dispatch) => {
375
- const line = chunkWZA5S5EJ_cjs.blockById(state.doc, blockId);
376
- if (line === void 0 || !chunkVZZPCYA3_cjs.isParagraph(line)) return false;
377
- const tr = new chunkVZZPCYA3_cjs.Transaction(state).step(chunkVZZPCYA3_cjs.replaceBlockStep(chunkVZZPCYA3_cjs.withContent(state.schema, line, [])));
378
- dispatch?.(tr.setSelection(chunkVZZPCYA3_cjs.startOf(tr.doc, state.schema, blockId)));
373
+ const line = chunkI7X7B3WD_cjs.blockById(state.doc, blockId);
374
+ if (line === void 0 || !chunkFK7EBZPX_cjs.isParagraph(line)) return false;
375
+ const tr = new chunkFK7EBZPX_cjs.Transaction(state).step(chunkFK7EBZPX_cjs.replaceBlockStep(chunkFK7EBZPX_cjs.withContent(state.schema, line, [])));
376
+ dispatch?.(tr.setSelection(chunkFK7EBZPX_cjs.startOf(tr.doc, state.schema, blockId)));
379
377
  return true;
380
378
  };
381
379
  }
382
380
  function replaceLink(blockId, block) {
383
381
  return (state, dispatch) => {
384
- const { ok, tr } = chunkVZZPCYA3_cjs.runCommands(state, [emptyParagraph(blockId), chunkUUSZGUXJ_cjs.insertBlocks([block], "line", blockId)]);
382
+ const { ok, tr } = chunkFK7EBZPX_cjs.runCommands(state, [emptyParagraph(blockId), chunkBA5WXBGE_cjs.insertBlocks([block], "line", blockId)]);
385
383
  if (!ok || tr === null) return false;
386
384
  dispatch?.(tr);
387
385
  return true;
@@ -395,21 +393,21 @@ function embedOf(href, providers) {
395
393
  }
396
394
  var bookmarkOf = (href) => ({ type: "BOOKMARK", attrs: { url: href } });
397
395
  function typedLink(kind, typed, providers) {
398
- const href = chunkH3C3MJW5_cjs.webAddress(chunkUUSZGUXJ_cjs.linkAddress(typed));
396
+ const href = chunkLM3DHROX_cjs.webAddress(chunkBA5WXBGE_cjs.linkAddress(typed));
399
397
  if (href === null) return { href, block: null, problem: "notALink" };
400
398
  const block = kind === "embed" ? embedOf(href, providers) : bookmarkOf(href);
401
399
  return { href, block, problem: block === null ? "cannotEmbed" : null };
402
400
  }
403
401
  var plainKey = (event) => !event.altKey && !event.ctrlKey && !event.metaKey;
404
402
  function linkEnd({ doc, schema }, blockId) {
405
- const block = chunkWZA5S5EJ_cjs.blockById(doc, blockId);
406
- const region = block && chunkVZZPCYA3_cjs.primaryRegion(schema, block);
407
- const end = block && region ? chunkVZZPCYA3_cjs.regionLength(block, region) : 0;
403
+ const block = chunkI7X7B3WD_cjs.blockById(doc, blockId);
404
+ const region = block && chunkFK7EBZPX_cjs.primaryRegion(schema, block);
405
+ const end = block && region ? chunkFK7EBZPX_cjs.regionLength(block, region) : 0;
408
406
  return block && region ? { block: blockId, region, from: end, to: end } : null;
409
407
  }
410
408
  function LinkChoicePopover({ controller, feature }) {
411
- const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
412
- const choice = chunkQJ34MOFV_cjs.useEditorState(controller, linkChoice);
409
+ const readOnly = chunkP6HC7RUN_cjs.useReadOnly(controller);
410
+ const choice = chunkP6HC7RUN_cjs.useEditorState(controller, linkChoice);
413
411
  const [dismissed, setDismissed] = react.useState(null);
414
412
  const dismiss = react.useCallback(() => setDismissed(choice), [choice]);
415
413
  if (readOnly || choice === null || choice === dismissed) return null;
@@ -423,18 +421,18 @@ function useEscapeInText(controller, onEscape) {
423
421
  onEscape();
424
422
  return true;
425
423
  };
426
- return chunkUUSZGUXJ_cjs.interceptKeys(controller, intercept);
424
+ return chunkBA5WXBGE_cjs.interceptKeys(controller, intercept);
427
425
  }, [controller, onEscape]);
428
426
  }
429
427
  function LinkChoiceToolbar({ controller, feature: { labels, providers }, choice, onDismiss }) {
430
428
  const embed = react.useMemo(() => embedOf(choice.href, providers), [choice.href, providers]);
431
429
  const range = react.useMemo(() => linkEnd(controller.editor.state, choice.block), [controller, choice.block]);
432
- const { anchor } = chunkUUSZGUXJ_cjs.useRangeAnchor(controller, range);
430
+ const { anchor } = chunkBA5WXBGE_cjs.useRangeAnchor(controller, range);
433
431
  const after = react.useMemo(() => {
434
432
  const host = range && controller.registry.get(range.block, range.region);
435
- return host && chunkUUSZGUXJ_cjs.inlineDirection(host) === "rtl" ? "left" : "right";
433
+ return host && chunkBA5WXBGE_cjs.inlineDirection(host) === "rtl" ? "left" : "right";
436
434
  }, [controller, range]);
437
- const roving = chunkUUSZGUXJ_cjs.useRovingFocus();
435
+ const roving = chunkBA5WXBGE_cjs.useRovingFocus();
438
436
  const rovingRef = roving.ref;
439
437
  const content = react.useRef(null);
440
438
  const ref = react.useCallback(
@@ -445,27 +443,27 @@ function LinkChoiceToolbar({ controller, feature: { labels, providers }, choice,
445
443
  [rovingRef]
446
444
  );
447
445
  const ownerDocument = react.useCallback(() => controller.root?.ownerDocument ?? document, [controller]);
448
- chunkUUSZGUXJ_cjs.useFocusKey(controller, roving.focusCurrent);
446
+ chunkBA5WXBGE_cjs.useFocusKey(controller, roving.focusCurrent);
449
447
  useEscapeInText(controller, onDismiss);
450
- chunkUUSZGUXJ_cjs.useOutsidePress(content, ownerDocument, onDismiss);
448
+ chunkBA5WXBGE_cjs.useOutsidePress(content, ownerDocument, onDismiss);
451
449
  const choose = (block) => {
452
450
  if (block === null) onDismiss();
453
451
  else controller.run(replaceLink(choice.block, block));
454
452
  controller.focus();
455
453
  };
456
454
  const onKeyDown = (event) => {
457
- if (!roving.owns(event.target) || chunkQJ34MOFV_cjs.isComposingKey(controller, event.nativeEvent)) return;
455
+ if (!roving.owns(event.target) || chunkP6HC7RUN_cjs.isComposingKey(controller, event.nativeEvent)) return;
458
456
  if (event.key === "Escape") onDismiss();
459
457
  if (event.key === "Escape" || event.key === "Tab" && plainKey(event)) {
460
458
  event.preventDefault();
461
459
  controller.focus();
462
460
  } else roving.onKeyDown(event);
463
461
  };
464
- const button = (label, block) => /* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.Button, { type: "button", variant: "ghost", size: "sm", onClick: () => choose(block), children: label });
465
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkUUSZGUXJ_cjs.Popover, { open: true, modal: false, children: [
466
- /* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.PopoverAnchor, { virtualRef: anchor }),
462
+ const button = (label, block) => /* @__PURE__ */ jsxRuntime.jsx(chunkBA5WXBGE_cjs.Button, { type: "button", variant: "ghost", size: "sm", onClick: () => choose(block), children: label });
463
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkBA5WXBGE_cjs.Popover, { open: true, modal: false, children: [
464
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBA5WXBGE_cjs.PopoverAnchor, { virtualRef: anchor }),
467
465
  /* @__PURE__ */ jsxRuntime.jsxs(
468
- chunkUUSZGUXJ_cjs.PopoverContent,
466
+ chunkBA5WXBGE_cjs.PopoverContent,
469
467
  {
470
468
  ref,
471
469
  role: "toolbar",
@@ -473,14 +471,14 @@ function LinkChoiceToolbar({ controller, feature: { labels, providers }, choice,
473
471
  side: after,
474
472
  align: "end",
475
473
  sideOffset: 8,
476
- className: chunkUUSZGUXJ_cjs.FLOATING_TOOLBAR,
477
- onOpenAutoFocus: chunkUUSZGUXJ_cjs.preventDefault,
478
- onCloseAutoFocus: chunkUUSZGUXJ_cjs.preventDefault,
479
- onPointerDown: chunkUUSZGUXJ_cjs.keepFocus,
480
- onMouseDown: chunkUUSZGUXJ_cjs.keepFocus,
474
+ className: chunkBA5WXBGE_cjs.FLOATING_TOOLBAR,
475
+ onOpenAutoFocus: chunkBA5WXBGE_cjs.preventDefault,
476
+ onCloseAutoFocus: chunkBA5WXBGE_cjs.preventDefault,
477
+ onPointerDown: chunkBA5WXBGE_cjs.keepFocus,
478
+ onMouseDown: chunkBA5WXBGE_cjs.keepFocus,
481
479
  onFocus: roving.onFocus,
482
480
  onKeyDown,
483
- ...chunkUUSZGUXJ_cjs.bubblePart(controller),
481
+ ...chunkBA5WXBGE_cjs.bubblePart(controller),
484
482
  children: [
485
483
  embed !== null && button(labels.embed, embed),
486
484
  button(labels.bookmark, bookmarkOf(choice.href)),
@@ -497,12 +495,12 @@ function storeAfterPress(controller, request, block) {
497
495
  if (controller.readOnly || controller.root === null) return;
498
496
  controller.readSelectionFromDom();
499
497
  const line = request.at.block;
500
- const onLine = chunkVZZPCYA3_cjs.headBlockId(editor.state.selection) === line;
501
- const place = onLine ? chunkUUSZGUXJ_cjs.insertBlockToWrite(block, false, line) : chunkUUSZGUXJ_cjs.insertBlocks([block], "stay", line);
498
+ const onLine = chunkFK7EBZPX_cjs.headBlockId(editor.state.selection) === line;
499
+ const place = onLine ? chunkBA5WXBGE_cjs.insertBlockToWrite(block, false, line) : chunkBA5WXBGE_cjs.insertBlocks([block], "stay", line);
502
500
  place(editor.state, (tr) => editor.dispatch(tr));
503
501
  }
504
502
  function LinkInputOverlay({ controller, feature }) {
505
- const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
503
+ const readOnly = chunkP6HC7RUN_cjs.useReadOnly(controller);
506
504
  const request = useLinkRequest(controller);
507
505
  const close = react.useCallback(() => requestLink(controller, null), [controller]);
508
506
  react.useEffect(() => {
@@ -516,12 +514,12 @@ function LinkInputPopover({ controller, feature: { labels, providers }, request,
516
514
  const [problem, setProblem] = react.useState(null);
517
515
  const messageId = react.useId();
518
516
  const content = react.useRef(null);
519
- const { anchor, side } = chunkUUSZGUXJ_cjs.useRangeAnchor(controller, request.at);
517
+ const { anchor, side } = chunkBA5WXBGE_cjs.useRangeAnchor(controller, request.at);
520
518
  const name = request.kind === "embed" ? labels.embedLink : labels.bookmarkLink;
521
519
  const typed = () => typedLink(request.kind, address, providers);
522
520
  const finish = (block) => {
523
521
  onClose();
524
- if (block !== null && !controller.readOnly) controller.run(chunkUUSZGUXJ_cjs.insertBlockToWrite(block, false, request.at.block));
522
+ if (block !== null && !controller.readOnly) controller.run(chunkBA5WXBGE_cjs.insertBlockToWrite(block, false, request.at.block));
525
523
  controller.focus();
526
524
  };
527
525
  const submit = (event) => {
@@ -532,39 +530,39 @@ function LinkInputPopover({ controller, feature: { labels, providers }, request,
532
530
  };
533
531
  const bookmarkInstead = () => finish(typedLink("bookmark", address, providers).block);
534
532
  const ownerDocument = react.useCallback(() => controller.root?.ownerDocument ?? document, [controller]);
535
- chunkUUSZGUXJ_cjs.useOutsidePress(content, ownerDocument, () => {
533
+ chunkBA5WXBGE_cjs.useOutsidePress(content, ownerDocument, () => {
536
534
  onClose();
537
535
  const { block } = typed();
538
536
  if (block !== null) setTimeout(() => storeAfterPress(controller, request, block));
539
537
  });
540
538
  const onKeyDown = (event) => {
541
539
  if (event.key !== "Tab" || event.altKey || event.ctrlKey || event.metaKey) return;
542
- if (chunkQJ34MOFV_cjs.isComposingKey(controller, event.nativeEvent)) return;
540
+ if (chunkP6HC7RUN_cjs.isComposingKey(controller, event.nativeEvent)) return;
543
541
  const controls = [...event.currentTarget.querySelectorAll("input, button")];
544
542
  const next = controls.indexOf(event.target) + (event.shiftKey ? -1 : 1);
545
543
  event.preventDefault();
546
544
  if (next >= 0 && next < controls.length) controls[next].focus();
547
545
  else finish(typed().block);
548
546
  };
549
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkUUSZGUXJ_cjs.Popover, { open: true, modal: false, children: [
550
- /* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.PopoverAnchor, { virtualRef: anchor }),
547
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunkBA5WXBGE_cjs.Popover, { open: true, modal: false, children: [
548
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBA5WXBGE_cjs.PopoverAnchor, { virtualRef: anchor }),
551
549
  /* @__PURE__ */ jsxRuntime.jsx(
552
- chunkUUSZGUXJ_cjs.PopoverContent,
550
+ chunkBA5WXBGE_cjs.PopoverContent,
553
551
  {
554
552
  ref: content,
555
553
  "aria-label": name,
556
554
  side,
557
555
  align: "start",
558
556
  className: "w-80 p-2 shadow-md",
559
- onCloseAutoFocus: chunkUUSZGUXJ_cjs.preventDefault,
557
+ onCloseAutoFocus: chunkBA5WXBGE_cjs.preventDefault,
560
558
  onEscapeKeyDown: (event) => {
561
559
  event.preventDefault();
562
- if (!chunkQJ34MOFV_cjs.isComposingKey(controller, event)) finish(null);
560
+ if (!chunkP6HC7RUN_cjs.isComposingKey(controller, event)) finish(null);
563
561
  },
564
- ...chunkUUSZGUXJ_cjs.bubblePart(controller),
562
+ ...chunkBA5WXBGE_cjs.bubblePart(controller),
565
563
  children: /* @__PURE__ */ jsxRuntime.jsxs("form", { noValidate: true, className: "quoin-embed-ask", onSubmit: submit, onKeyDown, children: [
566
564
  /* @__PURE__ */ jsxRuntime.jsx(
567
- chunkUUSZGUXJ_cjs.Input,
565
+ chunkBA5WXBGE_cjs.Input,
568
566
  {
569
567
  type: "url",
570
568
  className: "h-8",
@@ -578,9 +576,9 @@ function LinkInputPopover({ controller, feature: { labels, providers }, request,
578
576
  }
579
577
  }
580
578
  ),
581
- /* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.Button, { type: "submit", size: "sm", children: request.kind === "embed" ? labels.embed : labels.bookmark }),
579
+ /* @__PURE__ */ jsxRuntime.jsx(chunkBA5WXBGE_cjs.Button, { type: "submit", size: "sm", children: request.kind === "embed" ? labels.embed : labels.bookmark }),
582
580
  problem !== null && /* @__PURE__ */ jsxRuntime.jsx("p", { id: messageId, role: "alert", className: "quoin-embed-ask-message", children: labels[problem] }),
583
- problem === "cannotEmbed" && /* @__PURE__ */ jsxRuntime.jsx(chunkUUSZGUXJ_cjs.Button, { type: "button", variant: "outline", size: "sm", onClick: bookmarkInstead, children: labels.bookmarkInstead })
581
+ problem === "cannotEmbed" && /* @__PURE__ */ jsxRuntime.jsx(chunkBA5WXBGE_cjs.Button, { type: "button", variant: "outline", size: "sm", onClick: bookmarkInstead, children: labels.bookmarkInstead })
584
582
  ] })
585
583
  }
586
584
  )
@@ -602,7 +600,7 @@ function embedExtension(options = {}) {
602
600
  blockNames: { EMBED: feature.labels.embed, BOOKMARK: feature.labels.bookmark },
603
601
  overlays: [ChoiceOverlay, InputOverlay]
604
602
  };
605
- return chunkVZZPCYA3_cjs.defineExtension({ name: "embed", plugins: [linkChoicePlugin], pasteRules: [pasteLinkChoice], ui });
603
+ return chunkFK7EBZPX_cjs.defineExtension({ name: "embed", plugins: [linkChoicePlugin], pasteRules: [pasteLinkChoice], ui });
606
604
  }
607
605
 
608
606
  exports.embedExtension = embedExtension;