quoin-editor 1.7.0 → 2.0.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 (260) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/MIGRATION.md +137 -23
  3. package/README.md +32 -11
  4. package/dist/ai-labels-BXX32H9a.d.cts +53 -0
  5. package/dist/ai-labels-BXX32H9a.d.ts +53 -0
  6. package/dist/ai.cjs +84 -86
  7. package/dist/ai.d.cts +4 -53
  8. package/dist/ai.d.ts +4 -53
  9. package/dist/ai.js +8 -10
  10. package/dist/ai.js.map +1 -1
  11. package/dist/catalogue.cjs +27 -26
  12. package/dist/catalogue.d.cts +10 -1
  13. package/dist/catalogue.d.ts +10 -1
  14. package/dist/catalogue.js +18 -17
  15. package/dist/catalogue.js.map +1 -1
  16. package/dist/{chunk-MNA7MBCH.js → chunk-2UKI26JA.js} +9 -11
  17. package/dist/chunk-2UKI26JA.js.map +1 -0
  18. package/dist/{chunk-MZXW2HXP.cjs → chunk-4PIJC4FD.cjs} +27 -29
  19. package/dist/{chunk-OS2O6IKX.js → chunk-5RBMZGKV.js} +4 -4
  20. package/dist/{chunk-OS2O6IKX.js.map → chunk-5RBMZGKV.js.map} +1 -1
  21. package/dist/{chunk-OJ4O6HWC.js → chunk-5X52BAZB.js} +10 -12
  22. package/dist/chunk-5X52BAZB.js.map +1 -0
  23. package/dist/{chunk-JY5VUHKN.cjs → chunk-5YAJZSTI.cjs} +28 -30
  24. package/dist/{chunk-YEFPH27F.cjs → chunk-66OPHDFA.cjs} +92 -94
  25. package/dist/{chunk-PWUFFHAQ.js → chunk-6BVE46K7.js} +8 -10
  26. package/dist/chunk-6BVE46K7.js.map +1 -0
  27. package/dist/{chunk-LKZJ2TDU.cjs → chunk-77CNOLHY.cjs} +10 -13
  28. package/dist/{chunk-4T4TJ2QS.cjs → chunk-7E43TURF.cjs} +7 -7
  29. package/dist/{chunk-BJTOLCRR.js → chunk-7Y4B7NHO.js} +2 -2
  30. package/dist/chunk-7Y4B7NHO.js.map +1 -0
  31. package/dist/{chunk-7GU25Z6L.js → chunk-B4VCDJSA.js} +9 -11
  32. package/dist/chunk-B4VCDJSA.js.map +1 -0
  33. package/dist/{chunk-QR2NIDUK.cjs → chunk-BYYCD54G.cjs} +2 -2
  34. package/dist/{chunk-6T5YGCZ5.cjs → chunk-CJVJNMOB.cjs} +302 -299
  35. package/dist/{chunk-CSKKSXCE.js → chunk-CSPCDVCT.js} +3 -3
  36. package/dist/{chunk-CSKKSXCE.js.map → chunk-CSPCDVCT.js.map} +1 -1
  37. package/dist/{chunk-BF7733XS.cjs → chunk-D6CIIWCU.cjs} +57 -59
  38. package/dist/{chunk-GHNQKJMD.js → chunk-DBOZFNWU.js} +3 -3
  39. package/dist/{chunk-GHNQKJMD.js.map → chunk-DBOZFNWU.js.map} +1 -1
  40. package/dist/{chunk-BM2GRZNM.cjs → chunk-DJU25PFC.cjs} +11 -11
  41. package/dist/chunk-DLQCTGC3.js +10 -0
  42. package/dist/chunk-DLQCTGC3.js.map +1 -0
  43. package/dist/{chunk-RQXJKJ5S.js → chunk-EU5IGKMP.js} +7 -10
  44. package/dist/chunk-EU5IGKMP.js.map +1 -0
  45. package/dist/{chunk-VZZPCYA3.cjs → chunk-FK7EBZPX.cjs} +226 -226
  46. package/dist/{chunk-BXSWZEA5.js → chunk-GPTJYWGS.js} +3 -3
  47. package/dist/{chunk-BXSWZEA5.js.map → chunk-GPTJYWGS.js.map} +1 -1
  48. package/dist/{chunk-I722LBD3.cjs → chunk-HOSDMHK6.cjs} +32 -34
  49. package/dist/{chunk-AZF7B2AE.cjs → chunk-IKZSCTRF.cjs} +11 -11
  50. package/dist/{chunk-R7MYG522.js → chunk-IW4TMECB.js} +3 -3
  51. package/dist/{chunk-R7MYG522.js.map → chunk-IW4TMECB.js.map} +1 -1
  52. package/dist/{chunk-PLUMKN4B.js → chunk-J2SVYBTC.js} +10 -12
  53. package/dist/chunk-J2SVYBTC.js.map +1 -0
  54. package/dist/{chunk-UZS3TW75.js → chunk-KQPZTSW3.js} +9 -11
  55. package/dist/chunk-KQPZTSW3.js.map +1 -0
  56. package/dist/{chunk-STKGRXSA.cjs → chunk-LEICOZYK.cjs} +15 -17
  57. package/dist/{chunk-H3C3MJW5.cjs → chunk-LM3DHROX.cjs} +2 -2
  58. package/dist/{chunk-AD3NY7NA.js → chunk-LSI4RMTY.js} +3 -3
  59. package/dist/{chunk-AD3NY7NA.js.map → chunk-LSI4RMTY.js.map} +1 -1
  60. package/dist/{chunk-QOIVLYMW.js → chunk-M77A3EGD.js} +5 -5
  61. package/dist/{chunk-QOIVLYMW.js.map → chunk-M77A3EGD.js.map} +1 -1
  62. package/dist/{chunk-5JEQZIRI.js → chunk-MAS4AEF4.js} +8 -10
  63. package/dist/chunk-MAS4AEF4.js.map +1 -0
  64. package/dist/{chunk-KDK2ATMB.cjs → chunk-NFO3W644.cjs} +51 -53
  65. package/dist/{chunk-XFEDJEJF.js → chunk-NL5J77VD.js} +204 -204
  66. package/dist/chunk-NL5J77VD.js.map +1 -0
  67. package/dist/{chunk-WN7BZDNH.cjs → chunk-PURYVDC3.cjs} +13 -13
  68. package/dist/{chunk-G25FMFEZ.js → chunk-UDBLZILE.js} +4 -4
  69. package/dist/{chunk-G25FMFEZ.js.map → chunk-UDBLZILE.js.map} +1 -1
  70. package/dist/{chunk-FNJOPGMN.cjs → chunk-V4WQG7FR.cjs} +116 -118
  71. package/dist/{chunk-IJKGF6SC.js → chunk-YABGWOAV.js} +8 -10
  72. package/dist/chunk-YABGWOAV.js.map +1 -0
  73. package/dist/{chunk-XZ4NC3Q7.cjs → chunk-YEDPBYO5.cjs} +4 -4
  74. package/dist/{chunk-QJ34MOFV.cjs → chunk-Z6LAARPB.cjs} +315 -320
  75. package/dist/{chunk-HSLOPJVT.js → chunk-ZN5DHNSL.js} +19 -16
  76. package/dist/chunk-ZN5DHNSL.js.map +1 -0
  77. package/dist/chunk-ZWTIRGY5.cjs +10 -0
  78. package/dist/comments-labels-DWqsSz8G.d.cts +30 -0
  79. package/dist/comments-labels-DWqsSz8G.d.ts +30 -0
  80. package/dist/comments.cjs +63 -65
  81. package/dist/comments.d.cts +4 -30
  82. package/dist/comments.d.ts +4 -30
  83. package/dist/comments.js +9 -11
  84. package/dist/comments.js.map +1 -1
  85. package/dist/{diagram-extension-Da7hp-tv.d.ts → diagram-extension-22x_njXB.d.ts} +4 -12
  86. package/dist/{diagram-extension-D573COJv.d.cts → diagram-extension-C_FSkoj9.d.cts} +4 -12
  87. package/dist/diagram-labels-Bi_jEZ8_.d.cts +11 -0
  88. package/dist/diagram-labels-Bi_jEZ8_.d.ts +11 -0
  89. package/dist/diagram.cjs +10 -9
  90. package/dist/diagram.d.cts +3 -2
  91. package/dist/diagram.d.ts +3 -2
  92. package/dist/diagram.js +7 -6
  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 +69 -89
  129. package/dist/headless.d.cts +21 -28
  130. package/dist/headless.d.ts +21 -28
  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 +82 -101
  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 +2 -2
  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 +71 -1
  246. package/dist/chunk-5JEQZIRI.js.map +0 -1
  247. package/dist/chunk-7GU25Z6L.js.map +0 -1
  248. package/dist/chunk-BJTOLCRR.js.map +0 -1
  249. package/dist/chunk-HSLOPJVT.js.map +0 -1
  250. package/dist/chunk-IJKGF6SC.js.map +0 -1
  251. package/dist/chunk-MNA7MBCH.js.map +0 -1
  252. package/dist/chunk-OJ4O6HWC.js.map +0 -1
  253. package/dist/chunk-PLUMKN4B.js.map +0 -1
  254. package/dist/chunk-PWUFFHAQ.js.map +0 -1
  255. package/dist/chunk-RQXJKJ5S.js.map +0 -1
  256. package/dist/chunk-UZS3TW75.js.map +0 -1
  257. package/dist/chunk-XFEDJEJF.js.map +0 -1
  258. package/dist/toc-extension-CI6jNOYl.d.cts +0 -26
  259. package/dist/toc-extension-CTHWjNJC.d.ts +0 -26
  260. /package/dist/{chunk-WZA5S5EJ.cjs → chunk-I7X7B3WD.cjs} +0 -0
@@ -0,0 +1,30 @@
1
+ /** Every string comments show or speak. */
2
+ type CommentsLabels = {
3
+ /** The toolbar button that comments on the selected text. */
4
+ comment: string;
5
+ /** The name of the list of threads beside the document, and of the sheet that holds it on a narrow canvas. */
6
+ comments: string;
7
+ /** The button that opens the sheet of threads on a narrow canvas, given how many threads are open. */
8
+ showComments(count: number): string;
9
+ /** The name of a thread, given the text it is anchored to. */
10
+ thread(anchorText: string): string;
11
+ /** The name of the list to choose from when several threads are anchored to the text clicked. */
12
+ threadsHere: string;
13
+ /** Shown for a thread whose text has all been deleted. */
14
+ textRemoved: string;
15
+ /** The field for the first comment of a thread with none. */
16
+ addComment: string;
17
+ /** The field for a reply. */
18
+ reply: string;
19
+ send: string;
20
+ resolve: string;
21
+ delete: string;
22
+ close: string;
23
+ commentCount(count: number): string;
24
+ /** When a comment was made, given its `createdAt`. */
25
+ postedAt(createdAt: string): string;
26
+ };
27
+ declare const englishCommentsLabels: CommentsLabels;
28
+
29
+ export { englishCommentsLabels as e };
30
+ export type { CommentsLabels as C };
package/dist/comments.cjs CHANGED
@@ -1,14 +1,15 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkH3C3MJW5_cjs = require('./chunk-H3C3MJW5.cjs');
5
- var chunkQR2NIDUK_cjs = require('./chunk-QR2NIDUK.cjs');
6
- var chunk6T5YGCZ5_cjs = require('./chunk-6T5YGCZ5.cjs');
7
- var chunkQJ34MOFV_cjs = require('./chunk-QJ34MOFV.cjs');
4
+ var chunkLM3DHROX_cjs = require('./chunk-LM3DHROX.cjs');
5
+ var chunkBYYCD54G_cjs = require('./chunk-BYYCD54G.cjs');
6
+ var chunkCJVJNMOB_cjs = require('./chunk-CJVJNMOB.cjs');
7
+ var chunkZ6LAARPB_cjs = require('./chunk-Z6LAARPB.cjs');
8
+ var chunkZWTIRGY5_cjs = require('./chunk-ZWTIRGY5.cjs');
8
9
  require('./chunk-A6PGQVTR.cjs');
9
- var chunkVZZPCYA3_cjs = require('./chunk-VZZPCYA3.cjs');
10
- require('./chunk-BM2GRZNM.cjs');
11
- var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
10
+ var chunkFK7EBZPX_cjs = require('./chunk-FK7EBZPX.cjs');
11
+ require('./chunk-DJU25PFC.cjs');
12
+ var chunkI7X7B3WD_cjs = require('./chunk-I7X7B3WD.cjs');
12
13
  var react = require('react');
13
14
  var jsxRuntime = require('react/jsx-runtime');
14
15
  var DialogPrimitive = require('@radix-ui/react-dialog');
@@ -39,7 +40,7 @@ function addRegion(anchors, block, region, inline2) {
39
40
  let position = 0;
40
41
  for (const node of inline2) {
41
42
  const from = position;
42
- position += chunkWZA5S5EJ_cjs.nodeLength(node);
43
+ position += chunkI7X7B3WD_cjs.nodeLength(node);
43
44
  for (const id of idsOf(node)) {
44
45
  const ranges = anchors.get(id) ?? [];
45
46
  const last = ranges[ranges.length - 1];
@@ -66,25 +67,25 @@ function commentAnchors(doc) {
66
67
  var atomLabel = (node) => node.kind === "atom" ? node.attrs.label ?? "" : "";
67
68
  function anchorText(doc, ranges) {
68
69
  return ranges.map(({ block, region, from, to }) => {
69
- const inline2 = chunkWZA5S5EJ_cjs.blockById(doc, block)?.regions[region] ?? [];
70
- return chunkWZA5S5EJ_cjs.inlineText(chunkWZA5S5EJ_cjs.sliceInline(inline2, from, to), atomLabel);
70
+ const inline2 = chunkI7X7B3WD_cjs.blockById(doc, block)?.regions[region] ?? [];
71
+ return chunkI7X7B3WD_cjs.inlineText(chunkI7X7B3WD_cjs.sliceInline(inline2, from, to), atomLabel);
71
72
  }).join(" ");
72
73
  }
73
74
  function commentIdsAt(doc, { block, region, offset }) {
74
- const inline2 = chunkWZA5S5EJ_cjs.blockById(doc, block)?.regions[region] ?? [];
75
+ const inline2 = chunkI7X7B3WD_cjs.blockById(doc, block)?.regions[region] ?? [];
75
76
  const ids = /* @__PURE__ */ new Set();
76
77
  let position = 0;
77
78
  for (const node of inline2) {
78
- const end = position + chunkWZA5S5EJ_cjs.nodeLength(node);
79
+ const end = position + chunkI7X7B3WD_cjs.nodeLength(node);
79
80
  if (position <= offset && offset <= end && end > position) idsOf(node).forEach((id) => ids.add(id));
80
81
  position = end;
81
82
  }
82
83
  return [...ids].sort();
83
84
  }
84
85
  function threadRemoval(state, id) {
85
- const tr = new chunkVZZPCYA3_cjs.Transaction(state).setOrigin("command");
86
+ const tr = new chunkFK7EBZPX_cjs.Transaction(state).setOrigin("command");
86
87
  for (const { block, region, from, to } of commentAnchors(state.doc).get(id) ?? []) {
87
- tr.step(chunkVZZPCYA3_cjs.removeMarkStep(block, region, from, to, { type: "comment", attrs: { id } }));
88
+ tr.step(chunkFK7EBZPX_cjs.removeMarkStep(block, region, from, to, { type: "comment", attrs: { id } }));
88
89
  }
89
90
  return tr;
90
91
  }
@@ -95,14 +96,14 @@ function mapPendingRanges(tr, ranges, state) {
95
96
  const from = tr.mapPos({ block: range.block, region: range.region, offset: range.from }, 1);
96
97
  const to = tr.mapPos({ block: range.block, region: range.region, offset: range.to }, -1);
97
98
  const { index } = state.doc;
98
- if (!index.has(from.block) || !index.has(to.block) || chunkVZZPCYA3_cjs.comparePos(state.doc, from, to) >= 0) return [];
99
- return chunkVZZPCYA3_cjs.markRanges({ ...state, selection: chunkVZZPCYA3_cjs.textSelection(from, to) });
99
+ if (!index.has(from.block) || !index.has(to.block) || chunkFK7EBZPX_cjs.comparePos(state.doc, from, to) >= 0) return [];
100
+ return chunkFK7EBZPX_cjs.markRanges({ ...state, selection: chunkFK7EBZPX_cjs.textSelection(from, to) });
100
101
  });
101
102
  }
102
103
 
103
104
  // src/extensions/comments/comments-plugin.ts
104
105
  var isEnded = (ended, id, current) => ended.some((thread) => thread.id === id && thread.seen?.resolved === current?.resolved);
105
- var commentsKey = chunkVZZPCYA3_cjs.createPluginKey("comments");
106
+ var commentsKey = chunkFK7EBZPX_cjs.createPluginKey("comments");
106
107
  var COMMENTS = "comments";
107
108
  var IDLE = { pending: [], active: null, open: null, ended: [] };
108
109
  function act(value, action) {
@@ -155,26 +156,26 @@ var commentsPlugin = {
155
156
 
156
157
  // src/extensions/comments/comment-create.ts
157
158
  var nextKey = 0;
158
- var hasCommentableText = (state) => state.selection?.kind === "text" && chunkVZZPCYA3_cjs.markRanges(state).length > 0;
159
+ var hasCommentableText = (state) => state.selection?.kind === "text" && chunkFK7EBZPX_cjs.markRanges(state).length > 0;
159
160
  var requestComment = (state, dispatch) => {
160
161
  const { selection } = state;
161
- if (selection?.kind !== "text" || chunkVZZPCYA3_cjs.getPluginState(state, commentsKey).pending.length > 0) return false;
162
- const ranges = chunkVZZPCYA3_cjs.markRanges(state);
162
+ if (selection?.kind !== "text" || chunkFK7EBZPX_cjs.getPluginState(state, commentsKey).pending.length > 0) return false;
163
+ const ranges = chunkFK7EBZPX_cjs.markRanges(state);
163
164
  if (ranges.length === 0) return false;
164
165
  if (dispatch === void 0) return true;
165
166
  const pending = { key: ++nextKey, ranges, selection };
166
167
  const action = { type: "pending", pending };
167
- dispatch(new chunkVZZPCYA3_cjs.Transaction(state).setMeta(COMMENTS, action).setMeta("addToHistory", false));
168
+ dispatch(new chunkFK7EBZPX_cjs.Transaction(state).setMeta(COMMENTS, action).setMeta("addToHistory", false));
168
169
  return true;
169
170
  };
170
171
  function settledTransaction(editor, key, id) {
171
- const pending = chunkVZZPCYA3_cjs.getPluginState(editor.state, commentsKey).pending.find((anchor) => anchor.key === key);
172
+ const pending = chunkFK7EBZPX_cjs.getPluginState(editor.state, commentsKey).pending.find((anchor) => anchor.key === key);
172
173
  const tr = editor.createTransaction().setOrigin("command");
173
174
  const ranges = id === null ? [] : pending?.ranges ?? [];
174
175
  for (const { block, region, from, to } of ranges) {
175
- tr.step(chunkVZZPCYA3_cjs.addMarkStep(block, region, from, to, { type: "comment", attrs: { id } }));
176
+ tr.step(chunkFK7EBZPX_cjs.addMarkStep(block, region, from, to, { type: "comment", attrs: { id } }));
176
177
  }
177
- const untouched = pending !== void 0 && chunkVZZPCYA3_cjs.sameSelection(editor.state.selection, pending.selection);
178
+ const untouched = pending !== void 0 && chunkFK7EBZPX_cjs.sameSelection(editor.state.selection, pending.selection);
178
179
  const open = id !== null && ranges.length > 0 && untouched ? { ids: [id], focus: true } : void 0;
179
180
  const action = { type: "settled", key, open };
180
181
  return tr.setMeta(COMMENTS, action);
@@ -185,7 +186,7 @@ function create(editor, pending, onCreate, link) {
185
186
  if (link.mounts === 0) return;
186
187
  const tr = settledTransaction(editor, pending.key, id);
187
188
  editor.dispatch(tr);
188
- if (id === null) link.report(chunk6T5YGCZ5_cjs.toError(error));
189
+ if (id === null) link.report(chunkCJVJNMOB_cjs.toError(error));
189
190
  else if (!tr.docChanged) link.report(new Error(`Comment thread ${id} has no text: it was deleted meanwhile`));
190
191
  };
191
192
  new Promise((resolve) => resolve(onCreate(input))).then(
@@ -202,20 +203,20 @@ function watchCreates(editor, onCreate, link) {
202
203
 
203
204
  // src/extensions/comments/comment-open.ts
204
205
  function openIds(state, threads, ids) {
205
- const { ended } = chunkVZZPCYA3_cjs.getPluginState(state, commentsKey);
206
+ const { ended } = chunkFK7EBZPX_cjs.getPluginState(state, commentsKey);
206
207
  return ids.filter((id) => {
207
208
  const thread = threads.find(id);
208
209
  return thread?.resolved === false && !isEnded(ended, id, thread);
209
210
  });
210
211
  }
211
212
  function commentsTransaction(state, action) {
212
- return new chunkVZZPCYA3_cjs.Transaction(state).setMeta(COMMENTS, action).setMeta("addToHistory", false);
213
+ return new chunkFK7EBZPX_cjs.Transaction(state).setMeta(COMMENTS, action).setMeta("addToHistory", false);
213
214
  }
214
215
  function commentCommand(threads) {
215
216
  return (state, dispatch) => {
216
217
  if (requestComment(state, dispatch)) return true;
217
218
  const { selection } = state;
218
- if (selection?.kind !== "text" || !chunkVZZPCYA3_cjs.isCollapsed(selection)) return false;
219
+ if (selection?.kind !== "text" || !chunkFK7EBZPX_cjs.isCollapsed(selection)) return false;
219
220
  const ids = openIds(state, threads, commentIdsAt(state.doc, selection.head));
220
221
  if (ids.length === 0) return false;
221
222
  dispatch?.(commentsTransaction(state, { type: "open", open: { ids, focus: true } }));
@@ -246,10 +247,7 @@ var englishCommentsLabels = {
246
247
  commentCount: counted,
247
248
  postedAt: englishDate
248
249
  };
249
- function resolveCommentsLabels(overrides) {
250
- const given = Object.entries(overrides ?? {}).filter(([, value]) => value !== void 0);
251
- return given.length === 0 ? englishCommentsLabels : { ...englishCommentsLabels, ...Object.fromEntries(given) };
252
- }
250
+ var resolveCommentsLabels = (overrides) => chunkZWTIRGY5_cjs.mergeLabels(englishCommentsLabels, overrides);
253
251
 
254
252
  // src/extensions/comments/comments-link.ts
255
253
  var links = /* @__PURE__ */ new WeakMap();
@@ -292,7 +290,7 @@ function place(controller, box, gap) {
292
290
  root.style.setProperty(HEIGHT, `${bottom}px`);
293
291
  }
294
292
  function useBlockAligned(controller, box, gap, key) {
295
- chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
293
+ chunkZ6LAARPB_cjs.useIsomorphicLayoutEffect(() => {
296
294
  const element = box.current;
297
295
  const view = element?.ownerDocument.defaultView;
298
296
  if (!element || !view) return void 0;
@@ -336,10 +334,10 @@ function CommentMarkers({ env, box, entries, onOpen }) {
336
334
  "data-rail-item": "",
337
335
  "data-block": block,
338
336
  "aria-label": env.labels.showComments(ids.length),
339
- className: chunk6T5YGCZ5_cjs.cn("quoin-comments-marker", chunk6T5YGCZ5_cjs.FOCUS_RING),
337
+ className: chunkCJVJNMOB_cjs.cn("quoin-comments-marker", chunkCJVJNMOB_cjs.FOCUS_RING),
340
338
  onClick: (event) => onOpen(ids[0], event.currentTarget),
341
339
  children: [
342
- /* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.MessageSquare, { "aria-hidden": "true" }),
340
+ /* @__PURE__ */ jsxRuntime.jsx(chunkCJVJNMOB_cjs.MessageSquare, { "aria-hidden": "true" }),
343
341
  ids.length
344
342
  ]
345
343
  },
@@ -353,7 +351,7 @@ async function called(link, call) {
353
351
  await call();
354
352
  return true;
355
353
  } catch (error) {
356
- link.report(chunk6T5YGCZ5_cjs.toError(error));
354
+ link.report(chunkCJVJNMOB_cjs.toError(error));
357
355
  return false;
358
356
  }
359
357
  }
@@ -368,7 +366,7 @@ function sendReply(link, call, id, body) {
368
366
  }
369
367
  var initials = (name) => name.trim().split(/\s+/).slice(0, 2).map((word) => Array.from(word)[0]?.toUpperCase() ?? "").join("");
370
368
  function CommentAvatar({ author }) {
371
- const picture = chunkH3C3MJW5_cjs.webAddress(author.avatarUrl);
369
+ const picture = chunkLM3DHROX_cjs.webAddress(author.avatarUrl);
372
370
  const [failed, setFailed] = react.useState(null);
373
371
  if (picture !== null && picture !== failed) {
374
372
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -446,21 +444,21 @@ function ReplyBox({ env, threadId, first }) {
446
444
  }
447
445
  ),
448
446
  /* @__PURE__ */ jsxRuntime.jsx(
449
- chunk6T5YGCZ5_cjs.Button,
447
+ chunkCJVJNMOB_cjs.Button,
450
448
  {
451
449
  type: "submit",
452
450
  variant: "ghost",
453
451
  size: "icon-sm",
454
452
  "aria-label": labels.send,
455
453
  "aria-disabled": text === "" || sending || void 0,
456
- children: /* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.SendHorizontal, {})
454
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkCJVJNMOB_cjs.SendHorizontal, {})
457
455
  }
458
456
  )
459
457
  ] });
460
458
  }
461
459
  function ThreadView({ env, id, thread, onEnded }) {
462
460
  const { controller, host, labels, link } = env;
463
- const readOnly = chunkQJ34MOFV_cjs.useReadOnly(controller);
461
+ const readOnly = chunkZ6LAARPB_cjs.useReadOnly(controller);
464
462
  const [busy, setBusy] = react.useState(false);
465
463
  const alive = react.useRef(true);
466
464
  const root = react.useRef(null);
@@ -485,7 +483,7 @@ function ThreadView({ env, id, thread, onEnded }) {
485
483
  /* @__PURE__ */ jsxRuntime.jsx(ReplyBox, { env, threadId: id, first: comments.length === 0 }),
486
484
  !readOnly && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-1", children: [
487
485
  /* @__PURE__ */ jsxRuntime.jsx(
488
- chunk6T5YGCZ5_cjs.Button,
486
+ chunkCJVJNMOB_cjs.Button,
489
487
  {
490
488
  type: "button",
491
489
  variant: "ghost",
@@ -496,7 +494,7 @@ function ThreadView({ env, id, thread, onEnded }) {
496
494
  }
497
495
  ),
498
496
  /* @__PURE__ */ jsxRuntime.jsx(
499
- chunk6T5YGCZ5_cjs.Button,
497
+ chunkCJVJNMOB_cjs.Button,
500
498
  {
501
499
  type: "button",
502
500
  variant: "ghost",
@@ -533,7 +531,7 @@ function ThreadCard({ env, entry, active, expanded, onToggle }) {
533
531
  ref: header,
534
532
  type: "button",
535
533
  "aria-expanded": expanded,
536
- className: chunk6T5YGCZ5_cjs.cn("flex w-full flex-col items-start gap-1 rounded-sm text-start", chunk6T5YGCZ5_cjs.FOCUS_RING),
534
+ className: chunkCJVJNMOB_cjs.cn("flex w-full flex-col items-start gap-1 rounded-sm text-start", chunkCJVJNMOB_cjs.FOCUS_RING),
537
535
  onClick: () => onToggle(expanded ? null : thread.id),
538
536
  children: [
539
537
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: removed ? "text-xs text-muted-foreground italic" : "quoin-comments-quote", children: removed ? labels.textRemoved : anchorText2 }),
@@ -599,7 +597,7 @@ function CommentsSheet({ env, entries, value, onToggle, onClose, returnFocus })
599
597
  children: [
600
598
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
601
599
  /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Title, { className: "text-sm font-semibold", children: labels.comments }),
602
- /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.close, children: /* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.X, {}) }) })
600
+ /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(chunkCJVJNMOB_cjs.Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": labels.close, children: /* @__PURE__ */ jsxRuntime.jsx(chunkCJVJNMOB_cjs.X, {}) }) })
603
601
  ] }),
604
602
  /* @__PURE__ */ jsxRuntime.jsx("ul", { "aria-label": labels.comments, className: "flex flex-col gap-2", children: entries.map((entry) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
605
603
  ThreadCard,
@@ -626,7 +624,7 @@ function railEntries(doc, threads, ended = []) {
626
624
  const ranges = anchors.get(thread.id) ?? NONE;
627
625
  return { thread, ranges, anchorText: anchorText(doc, ranges) };
628
626
  });
629
- const place2 = ({ ranges: [first] }) => first === void 0 ? [Infinity, 0] : [chunkWZA5S5EJ_cjs.indexOfBlock(doc, first.block), first.from];
627
+ const place2 = ({ ranges: [first] }) => first === void 0 ? [Infinity, 0] : [chunkI7X7B3WD_cjs.indexOfBlock(doc, first.block), first.from];
630
628
  return entries.map((entry, order) => ({ entry, order, at: place2(entry) })).sort((a, b) => a.at[0] - b.at[0] || a.at[1] - b.at[1] || a.order - b.order).map(({ entry }) => entry);
631
629
  }
632
630
  function ThreadChooser({ env, choices, onChoose }) {
@@ -646,22 +644,22 @@ function ThreadChooser({ env, choices, onChoose }) {
646
644
  var docOf = (state) => state.doc;
647
645
  function focusIsOurs(controller, content) {
648
646
  const active = content?.ownerDocument.activeElement ?? null;
649
- return active === null || active === active.ownerDocument.body || chunkQR2NIDUK_cjs.ownsNode(controller, active);
647
+ return active === null || active === active.ownerDocument.body || chunkBYYCD54G_cjs.ownsNode(controller, active);
650
648
  }
651
649
  function ThreadPopover({ env, open, threads, onChoose, onClose }) {
652
650
  const { controller, labels } = env;
653
- const doc = chunkQJ34MOFV_cjs.useEditorState(controller, docOf);
651
+ const doc = chunkZ6LAARPB_cjs.useEditorState(controller, docOf);
654
652
  const anchors = commentAnchors(doc);
655
653
  const { ids } = open;
656
654
  const first = ids.map((id) => anchors.get(id)?.[0]).find(Boolean);
657
655
  const latest = react.useRef(first);
658
- chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
656
+ chunkZ6LAARPB_cjs.useIsomorphicLayoutEffect(() => {
659
657
  if (first) latest.current = first;
660
658
  });
661
659
  const anchor = react.useMemo(
662
660
  () => ({
663
- current: chunk6T5YGCZ5_cjs.virtualAnchor(
664
- () => latest.current ? chunk6T5YGCZ5_cjs.rangeRect(controller, latest.current) : null,
661
+ current: chunkCJVJNMOB_cjs.virtualAnchor(
662
+ () => latest.current ? chunkCJVJNMOB_cjs.rangeRect(controller, latest.current) : null,
665
663
  () => latest.current && controller.registry.get(latest.current.block, latest.current.region)
666
664
  )
667
665
  }),
@@ -674,7 +672,7 @@ function ThreadPopover({ env, open, threads, onChoose, onClose }) {
674
672
  target?.focus();
675
673
  }
676
674
  };
677
- chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
675
+ chunkZ6LAARPB_cjs.useIsomorphicLayoutEffect(() => {
678
676
  if (open.focus) focusField();
679
677
  }, [open]);
680
678
  if (first === void 0 && latest.current === void 0) return null;
@@ -695,7 +693,7 @@ function ThreadPopover({ env, open, threads, onChoose, onClose }) {
695
693
  };
696
694
  const choices = ids.map((id) => ({ id, anchorText: textOf(id), preview: threads.find(id)?.comments[0]?.body ?? "" }));
697
695
  return /* @__PURE__ */ jsxRuntime.jsxs(
698
- chunk6T5YGCZ5_cjs.Popover,
696
+ chunkCJVJNMOB_cjs.Popover,
699
697
  {
700
698
  open: true,
701
699
  modal: false,
@@ -703,9 +701,9 @@ function ThreadPopover({ env, open, threads, onChoose, onClose }) {
703
701
  if (!next) onClose();
704
702
  },
705
703
  children: [
706
- /* @__PURE__ */ jsxRuntime.jsx(chunk6T5YGCZ5_cjs.PopoverAnchor, { virtualRef: anchor }),
704
+ /* @__PURE__ */ jsxRuntime.jsx(chunkCJVJNMOB_cjs.PopoverAnchor, { virtualRef: anchor }),
707
705
  /* @__PURE__ */ jsxRuntime.jsxs(
708
- chunk6T5YGCZ5_cjs.PopoverContent,
706
+ chunkCJVJNMOB_cjs.PopoverContent,
709
707
  {
710
708
  ref: content,
711
709
  "aria-label": gone ? labels.textRemoved : single ? labels.thread(textOf(ids[0])) : labels.threadsHere,
@@ -753,7 +751,7 @@ function useAnchorClicks(controller, threads) {
753
751
  var WIDE_CANVAS = 800;
754
752
  function useCanvasWide(box, initial) {
755
753
  const [wide, setWide] = react.useState(initial);
756
- chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
754
+ chunkZ6LAARPB_cjs.useIsomorphicLayoutEffect(() => {
757
755
  const canvas = box.current?.parentElement;
758
756
  if (!canvas) return void 0;
759
757
  const measure = () => setWide(canvas.offsetWidth >= WIDE_CANVAS);
@@ -767,18 +765,18 @@ function useCanvasWide(box, initial) {
767
765
  function useThreads(threads) {
768
766
  return react.useSyncExternalStore(threads.subscribe, threads.get, threads.get);
769
767
  }
770
- var commentsOf = (state) => chunkVZZPCYA3_cjs.getPluginState(state, commentsKey);
768
+ var commentsOf = (state) => chunkFK7EBZPX_cjs.getPluginState(state, commentsKey);
771
769
  var docOf2 = (state) => state.doc;
772
770
  function CommentsOverlay({ controller, host, labels }) {
773
- const { onError } = chunk6T5YGCZ5_cjs.useQuoin();
771
+ const { onError } = chunkCJVJNMOB_cjs.useQuoin();
774
772
  const link = linkOf(controller.editor);
775
- chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
773
+ chunkZ6LAARPB_cjs.useIsomorphicLayoutEffect(() => {
776
774
  link.report = onError;
777
775
  }, [link, onError]);
778
776
  useAnchorClicks(controller, host.threads);
779
777
  const threads = useThreads(host.threads);
780
- const value = chunkQJ34MOFV_cjs.useEditorState(controller, commentsOf);
781
- const doc = chunkQJ34MOFV_cjs.useEditorState(controller, docOf2);
778
+ const value = chunkZ6LAARPB_cjs.useEditorState(controller, commentsOf);
779
+ const doc = chunkZ6LAARPB_cjs.useEditorState(controller, docOf2);
782
780
  const entries = react.useMemo(() => railEntries(doc, threads, value.ended), [doc, threads, value.ended]);
783
781
  const box = react.useRef(null);
784
782
  const wide = useCanvasWide(box, host.initialLayout === "wide");
@@ -838,7 +836,7 @@ var ACTIVE = { class: "quoin-comment-active" };
838
836
  var inline = (ranges, attrs) => ranges.map((range) => ({ kind: "inline", ...range, attrs }));
839
837
  var drawn = /* @__PURE__ */ new WeakMap();
840
838
  function commentsDecorations(state) {
841
- const value = chunkVZZPCYA3_cjs.getPluginState(state, commentsKey);
839
+ const value = chunkFK7EBZPX_cjs.getPluginState(state, commentsKey);
842
840
  const last = drawn.get(value);
843
841
  if (last?.doc === state.doc) return last.decorations;
844
842
  const active = value.active === null ? [] : commentAnchors(state.doc).get(value.active) ?? [];
@@ -850,7 +848,7 @@ function commentsDecorations(state) {
850
848
  // src/extensions/comments/watch-ended.ts
851
849
  function watchEnded(editor, threads) {
852
850
  return threads.subscribe(() => {
853
- const { ended } = chunkVZZPCYA3_cjs.getPluginState(editor.state, commentsKey);
851
+ const { ended } = chunkFK7EBZPX_cjs.getPluginState(editor.state, commentsKey);
854
852
  const kept = ended.filter(({ id }) => isEnded(ended, id, threads.find(id)));
855
853
  if (kept.length < ended.length) editor.dispatch(commentsTransaction(editor.state, { type: "caught", kept }));
856
854
  });
@@ -858,9 +856,9 @@ function watchEnded(editor, threads) {
858
856
  var commentItem = (labels) => ({
859
857
  id: "comment",
860
858
  title: labels.comment,
861
- icon: chunk6T5YGCZ5_cjs.MessageSquarePlus,
859
+ icon: chunkCJVJNMOB_cjs.MessageSquarePlus,
862
860
  shortcut: "Mod-Alt-m",
863
- available: (state) => hasCommentableText(state) && chunkVZZPCYA3_cjs.getPluginState(state, commentsKey).pending.length === 0,
861
+ available: (state) => hasCommentableText(state) && chunkFK7EBZPX_cjs.getPluginState(state, commentsKey).pending.length === 0,
864
862
  // Focus goes back to the text first: the button leaves the toolbar while the thread is being asked for.
865
863
  run: (controller) => {
866
864
  controller.focus();
@@ -874,7 +872,7 @@ function commentsExtension(options) {
874
872
  return /* @__PURE__ */ jsxRuntime.jsx(CommentsOverlay, { controller, host, labels });
875
873
  }
876
874
  const ui = { bubbleItems: [commentItem(labels)], overlays: [Overlay] };
877
- return chunkVZZPCYA3_cjs.defineExtension({
875
+ return chunkFK7EBZPX_cjs.defineExtension({
878
876
  name: "comments",
879
877
  plugins: [commentsPlugin],
880
878
  decorations: commentsDecorations,
@@ -1,4 +1,6 @@
1
1
  import { Extension } from './engine.cjs';
2
+ import { C as CommentsLabels } from './comments-labels-DWqsSz8G.cjs';
3
+ export { e as englishCommentsLabels } from './comments-labels-DWqsSz8G.cjs';
2
4
  import './types-CQ8Vw_7N.cjs';
3
5
 
4
6
  type CreateThread = (input: {
@@ -37,34 +39,6 @@ type CommentThreads = {
37
39
  };
38
40
  declare function createCommentThreads(initial?: readonly CommentThread[]): CommentThreads;
39
41
 
40
- /** Every string comments show or speak. */
41
- type CommentsLabels = {
42
- /** The toolbar button that comments on the selected text. */
43
- comment: string;
44
- /** The name of the list of threads beside the document, and of the sheet that holds it on a narrow canvas. */
45
- comments: string;
46
- /** The button that opens the sheet of threads on a narrow canvas, given how many threads are open. */
47
- showComments(count: number): string;
48
- /** The name of a thread, given the text it is anchored to. */
49
- thread(anchorText: string): string;
50
- /** The name of the list to choose from when several threads are anchored to the text clicked. */
51
- threadsHere: string;
52
- /** Shown for a thread whose text has all been deleted. */
53
- textRemoved: string;
54
- /** The field for the first comment of a thread with none. */
55
- addComment: string;
56
- /** The field for a reply. */
57
- reply: string;
58
- send: string;
59
- resolve: string;
60
- delete: string;
61
- close: string;
62
- commentCount(count: number): string;
63
- /** When a comment was made, given its `createdAt`. */
64
- postedAt(createdAt: string): string;
65
- };
66
- declare const englishCommentsLabels: CommentsLabels;
67
-
68
42
  type CommentsOptions = {
69
43
  /** The host's threads, from `createCommentThreads`, which the host sets again as they change. */
70
44
  threads: CommentThreads;
@@ -90,5 +64,5 @@ type CommentsOptions = {
90
64
  */
91
65
  declare function commentsExtension(options: CommentsOptions): Extension;
92
66
 
93
- export { commentsExtension, createCommentThreads, englishCommentsLabels };
94
- export type { CommentAuthor, CommentThread, CommentThreads, CommentUser, CommentsLabels, CommentsOptions, ThreadComment };
67
+ export { CommentsLabels, commentsExtension, createCommentThreads };
68
+ export type { CommentAuthor, CommentThread, CommentThreads, CommentUser, CommentsOptions, ThreadComment };
@@ -1,4 +1,6 @@
1
1
  import { Extension } from './engine.js';
2
+ import { C as CommentsLabels } from './comments-labels-DWqsSz8G.js';
3
+ export { e as englishCommentsLabels } from './comments-labels-DWqsSz8G.js';
2
4
  import './types-CQ8Vw_7N.js';
3
5
 
4
6
  type CreateThread = (input: {
@@ -37,34 +39,6 @@ type CommentThreads = {
37
39
  };
38
40
  declare function createCommentThreads(initial?: readonly CommentThread[]): CommentThreads;
39
41
 
40
- /** Every string comments show or speak. */
41
- type CommentsLabels = {
42
- /** The toolbar button that comments on the selected text. */
43
- comment: string;
44
- /** The name of the list of threads beside the document, and of the sheet that holds it on a narrow canvas. */
45
- comments: string;
46
- /** The button that opens the sheet of threads on a narrow canvas, given how many threads are open. */
47
- showComments(count: number): string;
48
- /** The name of a thread, given the text it is anchored to. */
49
- thread(anchorText: string): string;
50
- /** The name of the list to choose from when several threads are anchored to the text clicked. */
51
- threadsHere: string;
52
- /** Shown for a thread whose text has all been deleted. */
53
- textRemoved: string;
54
- /** The field for the first comment of a thread with none. */
55
- addComment: string;
56
- /** The field for a reply. */
57
- reply: string;
58
- send: string;
59
- resolve: string;
60
- delete: string;
61
- close: string;
62
- commentCount(count: number): string;
63
- /** When a comment was made, given its `createdAt`. */
64
- postedAt(createdAt: string): string;
65
- };
66
- declare const englishCommentsLabels: CommentsLabels;
67
-
68
42
  type CommentsOptions = {
69
43
  /** The host's threads, from `createCommentThreads`, which the host sets again as they change. */
70
44
  threads: CommentThreads;
@@ -90,5 +64,5 @@ type CommentsOptions = {
90
64
  */
91
65
  declare function commentsExtension(options: CommentsOptions): Extension;
92
66
 
93
- export { commentsExtension, createCommentThreads, englishCommentsLabels };
94
- export type { CommentAuthor, CommentThread, CommentThreads, CommentUser, CommentsLabels, CommentsOptions, ThreadComment };
67
+ export { CommentsLabels, commentsExtension, createCommentThreads };
68
+ export type { CommentAuthor, CommentThread, CommentThreads, CommentUser, CommentsOptions, ThreadComment };
package/dist/comments.js CHANGED
@@ -1,12 +1,13 @@
1
1
  'use client';
2
- import { webAddress } from './chunk-GHNQKJMD.js';
3
- import { ownsNode } from './chunk-R7MYG522.js';
4
- import { MessageSquarePlus, useQuoin, MessageSquare, cn, FOCUS_RING, Button, X, virtualAnchor, rangeRect, Popover, PopoverAnchor, PopoverContent, toError, SendHorizontal } from './chunk-HSLOPJVT.js';
5
- import { useIsomorphicLayoutEffect, useEditorState, useReadOnly } from './chunk-XFEDJEJF.js';
2
+ import { webAddress } from './chunk-DBOZFNWU.js';
3
+ import { ownsNode } from './chunk-IW4TMECB.js';
4
+ import { MessageSquarePlus, useQuoin, MessageSquare, cn, FOCUS_RING, Button, X, virtualAnchor, rangeRect, Popover, PopoverAnchor, PopoverContent, toError, SendHorizontal } from './chunk-ZN5DHNSL.js';
5
+ import { useIsomorphicLayoutEffect, useEditorState, useReadOnly } from './chunk-NL5J77VD.js';
6
+ import { mergeLabels } from './chunk-DLQCTGC3.js';
6
7
  import './chunk-HDJ653LM.js';
7
- import { createPluginKey, defineExtension, getPluginState, isCollapsed, markRanges, Transaction, comparePos, textSelection, addMarkStep, sameSelection, removeMarkStep } from './chunk-OS2O6IKX.js';
8
- import './chunk-CSKKSXCE.js';
9
- import { blockById, nodeLength, inlineText, sliceInline, indexOfBlock } from './chunk-BJTOLCRR.js';
8
+ import { createPluginKey, defineExtension, getPluginState, isCollapsed, markRanges, Transaction, comparePos, textSelection, addMarkStep, sameSelection, removeMarkStep } from './chunk-5RBMZGKV.js';
9
+ import './chunk-CSPCDVCT.js';
10
+ import { blockById, nodeLength, inlineText, sliceInline, indexOfBlock } from './chunk-7Y4B7NHO.js';
10
11
  import { useMemo, useRef, useState, useEffect, useCallback, useSyncExternalStore } from 'react';
11
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
12
13
  import * as DialogPrimitive from '@radix-ui/react-dialog';
@@ -224,10 +225,7 @@ var englishCommentsLabels = {
224
225
  commentCount: counted,
225
226
  postedAt: englishDate
226
227
  };
227
- function resolveCommentsLabels(overrides) {
228
- const given = Object.entries(overrides ?? {}).filter(([, value]) => value !== void 0);
229
- return given.length === 0 ? englishCommentsLabels : { ...englishCommentsLabels, ...Object.fromEntries(given) };
230
- }
228
+ var resolveCommentsLabels = (overrides) => mergeLabels(englishCommentsLabels, overrides);
231
229
 
232
230
  // src/extensions/comments/comments-link.ts
233
231
  var links = /* @__PURE__ */ new WeakMap();