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
package/dist/math.d.ts CHANGED
@@ -1,30 +1,10 @@
1
1
  import { Extension } from './engine.js';
2
2
  import { HTMLOptions } from './engine.js';
3
+ import { M as MathLabels } from './math-labels-DOf5KFxp.js';
4
+ export { e as englishMathLabels } from './math-labels-DOf5KFxp.js';
3
5
  import './types-CQ8Vw_7N.js';
4
6
  import './embed-provider-jXwlRmnp.js';
5
7
 
6
- /** Every string the math feature shows or speaks. */
7
- type MathLabels = {
8
- /** The name of a math block. */
9
- equation: string;
10
- /** What a block or an inline formula with no LaTeX shows. */
11
- emptyEquation: string;
12
- /** The popover that edits a formula. */
13
- editEquation: string;
14
- /** The field that holds a formula's LaTeX. */
15
- latex: string;
16
- /** The live preview of the formula being edited. */
17
- preview: string;
18
- save: string;
19
- /** The slash command that inserts a math block. */
20
- blockEquation: string;
21
- blockEquationDescription: string;
22
- /** The slash command that writes a formula at the caret. */
23
- inlineEquation: string;
24
- inlineEquationDescription: string;
25
- };
26
- declare const englishMathLabels: MathLabels;
27
-
28
8
  /**
29
9
  * Turns LaTeX into HTML, as KaTeX's `renderToString` does, in display mode for a block and inline for a formula in a
30
10
  * line: the same function `toHTML` takes. Its HTML is trusted: the canvas inserts it as it is.
@@ -46,5 +26,5 @@ type MathOptions = {
46
26
  */
47
27
  declare function mathExtension(options?: MathOptions): Extension;
48
28
 
49
- export { englishMathLabels, mathExtension };
50
- export type { MathLabels, MathOptions, RenderMath };
29
+ export { MathLabels, mathExtension };
30
+ export type { MathOptions, RenderMath };
package/dist/math.js CHANGED
@@ -1,12 +1,13 @@
1
1
  'use client';
2
- export { englishMathLabels, mathExtension } from './chunk-OJ4O6HWC.js';
3
- import './chunk-QOIVLYMW.js';
4
- import './chunk-AD3NY7NA.js';
5
- import './chunk-HSLOPJVT.js';
6
- import './chunk-XFEDJEJF.js';
2
+ export { englishMathLabels, mathExtension } from './chunk-5X52BAZB.js';
3
+ import './chunk-M77A3EGD.js';
4
+ import './chunk-LSI4RMTY.js';
5
+ import './chunk-ZN5DHNSL.js';
6
+ import './chunk-NL5J77VD.js';
7
+ import './chunk-DLQCTGC3.js';
7
8
  import './chunk-HDJ653LM.js';
8
- import './chunk-OS2O6IKX.js';
9
- import './chunk-CSKKSXCE.js';
10
- import './chunk-BJTOLCRR.js';
9
+ import './chunk-5RBMZGKV.js';
10
+ import './chunk-CSPCDVCT.js';
11
+ import './chunk-7Y4B7NHO.js';
11
12
  //# sourceMappingURL=math.js.map
12
13
  //# sourceMappingURL=math.js.map
@@ -0,0 +1,15 @@
1
+ /** Every string the mention feature shows or speaks. */
2
+ type MentionLabels = {
3
+ /** The name of the menu `@` opens. */
4
+ mentionMenu: string;
5
+ /** What the menu shows while the host searches. */
6
+ searching: string;
7
+ /** What the menu shows when the host finds nothing. */
8
+ noMatches: string;
9
+ /** The accessible description of a mention, which names its kind when it has one. */
10
+ mentionDescription(kind: string | undefined): string;
11
+ };
12
+ declare const englishMentionLabels: MentionLabels;
13
+
14
+ export { englishMentionLabels as e };
15
+ export type { MentionLabels as M };
@@ -0,0 +1,15 @@
1
+ /** Every string the mention feature shows or speaks. */
2
+ type MentionLabels = {
3
+ /** The name of the menu `@` opens. */
4
+ mentionMenu: string;
5
+ /** What the menu shows while the host searches. */
6
+ searching: string;
7
+ /** What the menu shows when the host finds nothing. */
8
+ noMatches: string;
9
+ /** The accessible description of a mention, which names its kind when it has one. */
10
+ mentionDescription(kind: string | undefined): string;
11
+ };
12
+ declare const englishMentionLabels: MentionLabels;
13
+
14
+ export { englishMentionLabels as e };
15
+ export type { MentionLabels as M };
package/dist/mention.cjs CHANGED
@@ -1,23 +1,24 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkJY5VUHKN_cjs = require('./chunk-JY5VUHKN.cjs');
5
- require('./chunk-H3C3MJW5.cjs');
6
- require('./chunk-AZF7B2AE.cjs');
7
- require('./chunk-6T5YGCZ5.cjs');
8
- require('./chunk-QJ34MOFV.cjs');
4
+ var chunk5YAJZSTI_cjs = require('./chunk-5YAJZSTI.cjs');
5
+ require('./chunk-IKZSCTRF.cjs');
6
+ require('./chunk-LM3DHROX.cjs');
7
+ require('./chunk-CJVJNMOB.cjs');
8
+ require('./chunk-Z6LAARPB.cjs');
9
+ require('./chunk-ZWTIRGY5.cjs');
9
10
  require('./chunk-A6PGQVTR.cjs');
10
- require('./chunk-VZZPCYA3.cjs');
11
- require('./chunk-BM2GRZNM.cjs');
12
- require('./chunk-WZA5S5EJ.cjs');
11
+ require('./chunk-FK7EBZPX.cjs');
12
+ require('./chunk-DJU25PFC.cjs');
13
+ require('./chunk-I7X7B3WD.cjs');
13
14
 
14
15
 
15
16
 
16
17
  Object.defineProperty(exports, "englishMentionLabels", {
17
18
  enumerable: true,
18
- get: function () { return chunkJY5VUHKN_cjs.englishMentionLabels; }
19
+ get: function () { return chunk5YAJZSTI_cjs.englishMentionLabels; }
19
20
  });
20
21
  Object.defineProperty(exports, "mentionExtension", {
21
22
  enumerable: true,
22
- get: function () { return chunkJY5VUHKN_cjs.mentionExtension; }
23
+ get: function () { return chunk5YAJZSTI_cjs.mentionExtension; }
23
24
  });
@@ -1,19 +1,8 @@
1
1
  import { Extension } from './engine.cjs';
2
+ import { M as MentionLabels } from './mention-labels-DIQy8LRT.cjs';
3
+ export { e as englishMentionLabels } from './mention-labels-DIQy8LRT.cjs';
2
4
  import './types-CQ8Vw_7N.cjs';
3
5
 
4
- /** Every string the mention feature shows or speaks. */
5
- type MentionLabels = {
6
- /** The name of the menu `@` opens. */
7
- mentionMenu: string;
8
- /** What the menu shows while the host searches. */
9
- searching: string;
10
- /** What the menu shows when the host finds nothing. */
11
- noMatches: string;
12
- /** The accessible description of a mention, which names its kind when it has one. */
13
- mentionDescription(kind: string | undefined): string;
14
- };
15
- declare const englishMentionLabels: MentionLabels;
16
-
17
6
  /** A mention as the document keeps it, and as `onOpen` receives it. */
18
7
  type Mention = {
19
8
  id: string;
@@ -47,5 +36,5 @@ type MentionOptions = {
47
36
  */
48
37
  declare function mentionExtension(options?: MentionOptions): Extension;
49
38
 
50
- export { englishMentionLabels, mentionExtension };
51
- export type { Mention, MentionLabels, MentionOptions, MentionResult, MentionSearch };
39
+ export { MentionLabels, mentionExtension };
40
+ export type { Mention, MentionOptions, MentionResult, MentionSearch };
package/dist/mention.d.ts CHANGED
@@ -1,19 +1,8 @@
1
1
  import { Extension } from './engine.js';
2
+ import { M as MentionLabels } from './mention-labels-DIQy8LRT.js';
3
+ export { e as englishMentionLabels } from './mention-labels-DIQy8LRT.js';
2
4
  import './types-CQ8Vw_7N.js';
3
5
 
4
- /** Every string the mention feature shows or speaks. */
5
- type MentionLabels = {
6
- /** The name of the menu `@` opens. */
7
- mentionMenu: string;
8
- /** What the menu shows while the host searches. */
9
- searching: string;
10
- /** What the menu shows when the host finds nothing. */
11
- noMatches: string;
12
- /** The accessible description of a mention, which names its kind when it has one. */
13
- mentionDescription(kind: string | undefined): string;
14
- };
15
- declare const englishMentionLabels: MentionLabels;
16
-
17
6
  /** A mention as the document keeps it, and as `onOpen` receives it. */
18
7
  type Mention = {
19
8
  id: string;
@@ -47,5 +36,5 @@ type MentionOptions = {
47
36
  */
48
37
  declare function mentionExtension(options?: MentionOptions): Extension;
49
38
 
50
- export { englishMentionLabels, mentionExtension };
51
- export type { Mention, MentionLabels, MentionOptions, MentionResult, MentionSearch };
39
+ export { MentionLabels, mentionExtension };
40
+ export type { Mention, MentionOptions, MentionResult, MentionSearch };
package/dist/mention.js CHANGED
@@ -1,12 +1,13 @@
1
1
  'use client';
2
- export { englishMentionLabels, mentionExtension } from './chunk-7GU25Z6L.js';
3
- import './chunk-GHNQKJMD.js';
4
- import './chunk-QOIVLYMW.js';
5
- import './chunk-HSLOPJVT.js';
6
- import './chunk-XFEDJEJF.js';
2
+ export { englishMentionLabels, mentionExtension } from './chunk-B4VCDJSA.js';
3
+ import './chunk-M77A3EGD.js';
4
+ import './chunk-DBOZFNWU.js';
5
+ import './chunk-ZN5DHNSL.js';
6
+ import './chunk-NL5J77VD.js';
7
+ import './chunk-DLQCTGC3.js';
7
8
  import './chunk-HDJ653LM.js';
8
- import './chunk-OS2O6IKX.js';
9
- import './chunk-CSKKSXCE.js';
10
- import './chunk-BJTOLCRR.js';
9
+ import './chunk-5RBMZGKV.js';
10
+ import './chunk-CSPCDVCT.js';
11
+ import './chunk-7Y4B7NHO.js';
11
12
  //# sourceMappingURL=mention.js.map
12
13
  //# sourceMappingURL=mention.js.map
@@ -1,5 +1,5 @@
1
- import { c as EditorState, D as Decoration, a as Editor, T as Transaction, b as Command } from './types-BjLcmV00.js';
2
- import { b as Selection, c as AtomNode, P as Pos } from './types-CQ8Vw_7N.js';
1
+ import { c as EditorState, D as Decoration, a as Editor, T as Transaction, b as Command } from './types-DMuuDBVh.js';
2
+ import { c as AtomNode, P as Pos, b as Selection } from './types-CQ8Vw_7N.js';
3
3
 
4
4
  type Spoken = {
5
5
  readonly message: string;
@@ -13,17 +13,6 @@ type Announcer = {
13
13
  subscribe(listener: () => void): () => void;
14
14
  };
15
15
 
16
- type NodeReveal = {
17
- /** Marks a block a press is selecting, which is under the pointer already. */
18
- pressed(block: string): void;
19
- /** Forgets the block shown once the selection leaves it, however it leaves, so coming back brings it into view. */
20
- follow(selection: Selection | null): void;
21
- /** Brings the block into view once; a change made here also brings in the block a settle left where it was. */
22
- show(selection: Selection | null, local?: boolean): void;
23
- /** Counts the block a selection holds as shown, and as owed to the next change made here if it was not shown yet. */
24
- settle(selection: Selection | null): void;
25
- };
26
-
27
16
  type AtomRenderer = (node: AtomNode, doc: Document) => HTMLElement;
28
17
  type WidgetRenderer = (decoration: Extract<Decoration, {
29
18
  kind: 'widget';
@@ -109,5 +98,16 @@ declare class ViewController {
109
98
  destroy(): void;
110
99
  }
111
100
 
101
+ type NodeReveal = {
102
+ /** Marks a block a press is selecting, which is under the pointer already. */
103
+ pressed(block: string): void;
104
+ /** Forgets the block shown once the selection leaves it, however it leaves, so coming back brings it into view. */
105
+ follow(selection: Selection | null): void;
106
+ /** Brings the block into view once; a change made here also brings in the block a settle left where it was. */
107
+ show(selection: Selection | null, local?: boolean): void;
108
+ /** Counts the block a selection holds as shown, and as owed to the next change made here if it was not shown yet. */
109
+ settle(selection: Selection | null): void;
110
+ };
111
+
112
112
  export { ViewController as V, hostKey as h };
113
- export type { AtomRenderer as A, KeyInterceptor as K, RenderOptions as R, WidgetRenderer as W, ViewControllerOptions as a };
113
+ export type { Announcer as A, Engagement as E, FocusTarget as F, HostEntry as H, KeyInterceptor as K, NodeReveal as N, RenderOptions as R, Spoken as S, WidgetRenderer as W, AtomRenderer as a, HostRegistry as b, ViewControllerOptions as c };
@@ -1,5 +1,5 @@
1
- import { c as EditorState, D as Decoration, a as Editor, T as Transaction, b as Command } from './types-DXF9p4qV.cjs';
2
- import { b as Selection, c as AtomNode, P as Pos } from './types-CQ8Vw_7N.cjs';
1
+ import { c as EditorState, D as Decoration, a as Editor, T as Transaction, b as Command } from './types-Bzhq5AXj.cjs';
2
+ import { c as AtomNode, P as Pos, b as Selection } from './types-CQ8Vw_7N.cjs';
3
3
 
4
4
  type Spoken = {
5
5
  readonly message: string;
@@ -13,17 +13,6 @@ type Announcer = {
13
13
  subscribe(listener: () => void): () => void;
14
14
  };
15
15
 
16
- type NodeReveal = {
17
- /** Marks a block a press is selecting, which is under the pointer already. */
18
- pressed(block: string): void;
19
- /** Forgets the block shown once the selection leaves it, however it leaves, so coming back brings it into view. */
20
- follow(selection: Selection | null): void;
21
- /** Brings the block into view once; a change made here also brings in the block a settle left where it was. */
22
- show(selection: Selection | null, local?: boolean): void;
23
- /** Counts the block a selection holds as shown, and as owed to the next change made here if it was not shown yet. */
24
- settle(selection: Selection | null): void;
25
- };
26
-
27
16
  type AtomRenderer = (node: AtomNode, doc: Document) => HTMLElement;
28
17
  type WidgetRenderer = (decoration: Extract<Decoration, {
29
18
  kind: 'widget';
@@ -109,5 +98,16 @@ declare class ViewController {
109
98
  destroy(): void;
110
99
  }
111
100
 
101
+ type NodeReveal = {
102
+ /** Marks a block a press is selecting, which is under the pointer already. */
103
+ pressed(block: string): void;
104
+ /** Forgets the block shown once the selection leaves it, however it leaves, so coming back brings it into view. */
105
+ follow(selection: Selection | null): void;
106
+ /** Brings the block into view once; a change made here also brings in the block a settle left where it was. */
107
+ show(selection: Selection | null, local?: boolean): void;
108
+ /** Counts the block a selection holds as shown, and as owed to the next change made here if it was not shown yet. */
109
+ settle(selection: Selection | null): void;
110
+ };
111
+
112
112
  export { ViewController as V, hostKey as h };
113
- export type { AtomRenderer as A, KeyInterceptor as K, RenderOptions as R, WidgetRenderer as W, ViewControllerOptions as a };
113
+ export type { Announcer as A, Engagement as E, FocusTarget as F, HostEntry as H, KeyInterceptor as K, NodeReveal as N, RenderOptions as R, Spoken as S, WidgetRenderer as W, AtomRenderer as a, HostRegistry as b, ViewControllerOptions as c };
@@ -0,0 +1,4 @@
1
+ /** The colour names a writer can pick for text and for a background, each a `--quoin-color-*` token. */
2
+ declare const PALETTE: readonly ["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red"];
3
+
4
+ export { PALETTE as P };
@@ -0,0 +1,4 @@
1
+ /** The colour names a writer can pick for text and for a background, each a `--quoin-color-*` token. */
2
+ declare const PALETTE: readonly ["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red"];
3
+
4
+ export { PALETTE as P };
@@ -0,0 +1,15 @@
1
+ /** Every string presence shows or speaks. Names come as a list of the people meant, in the order they came. */
2
+ type PresenceLabels = {
3
+ /** Said through the live region when people open the document. */
4
+ joined(names: readonly string[]): string;
5
+ /** Said when people close it. */
6
+ left(names: readonly string[]): string;
7
+ /** The accessible name of the avatars beside a block, naming the people whose selection is in it. */
8
+ here(names: readonly string[]): string;
9
+ /** The text a collaborator's caret shows, given the name the collaborator gave. */
10
+ caret(name: string): string;
11
+ };
12
+ declare const englishPresenceLabels: PresenceLabels;
13
+
14
+ export { englishPresenceLabels as e };
15
+ export type { PresenceLabels as P };
@@ -0,0 +1,15 @@
1
+ /** Every string presence shows or speaks. Names come as a list of the people meant, in the order they came. */
2
+ type PresenceLabels = {
3
+ /** Said through the live region when people open the document. */
4
+ joined(names: readonly string[]): string;
5
+ /** Said when people close it. */
6
+ left(names: readonly string[]): string;
7
+ /** The accessible name of the avatars beside a block, naming the people whose selection is in it. */
8
+ here(names: readonly string[]): string;
9
+ /** The text a collaborator's caret shows, given the name the collaborator gave. */
10
+ caret(name: string): string;
11
+ };
12
+ declare const englishPresenceLabels: PresenceLabels;
13
+
14
+ export { englishPresenceLabels as e };
15
+ export type { PresenceLabels as P };
package/dist/presence.cjs CHANGED
@@ -2,14 +2,15 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkLE5XMIFJ_cjs = require('./chunk-LE5XMIFJ.cjs');
5
- var chunkQR2NIDUK_cjs = require('./chunk-QR2NIDUK.cjs');
6
- require('./chunk-6T5YGCZ5.cjs');
7
- var chunkQJ34MOFV_cjs = require('./chunk-QJ34MOFV.cjs');
5
+ var chunkPURYVDC3_cjs = require('./chunk-PURYVDC3.cjs');
6
+ var chunkBYYCD54G_cjs = require('./chunk-BYYCD54G.cjs');
7
+ require('./chunk-CJVJNMOB.cjs');
8
+ var chunkZ6LAARPB_cjs = require('./chunk-Z6LAARPB.cjs');
9
+ var chunkZWTIRGY5_cjs = require('./chunk-ZWTIRGY5.cjs');
8
10
  var chunkA6PGQVTR_cjs = require('./chunk-A6PGQVTR.cjs');
9
- var chunkWN7BZDNH_cjs = require('./chunk-WN7BZDNH.cjs');
10
- var chunkVZZPCYA3_cjs = require('./chunk-VZZPCYA3.cjs');
11
- require('./chunk-BM2GRZNM.cjs');
12
- var chunkWZA5S5EJ_cjs = require('./chunk-WZA5S5EJ.cjs');
11
+ var chunkFK7EBZPX_cjs = require('./chunk-FK7EBZPX.cjs');
12
+ require('./chunk-DJU25PFC.cjs');
13
+ var chunkI7X7B3WD_cjs = require('./chunk-I7X7B3WD.cjs');
13
14
  var react = require('react');
14
15
  var jsxRuntime = require('react/jsx-runtime');
15
16
  var Y = require('yjs');
@@ -48,8 +49,8 @@ function followLayout(controller, root, place2) {
48
49
  observer.observe(root);
49
50
  const unsubscribe = controller.editor.subscribe(later);
50
51
  const fonts = root.ownerDocument.fonts;
51
- const unlistenScroll = chunkQJ34MOFV_cjs.listen(root, { scroll: update }, { capture: true, passive: true });
52
- const unlistenFonts = fonts && chunkQJ34MOFV_cjs.listen(fonts, { loadingdone: later });
52
+ const unlistenScroll = chunkZ6LAARPB_cjs.listen(root, { scroll: update }, { capture: true, passive: true });
53
+ const unlistenFonts = fonts && chunkZ6LAARPB_cjs.listen(fonts, { loadingdone: later });
53
54
  return () => {
54
55
  view.cancelAnimationFrame(frame);
55
56
  unsubscribe();
@@ -60,10 +61,10 @@ function followLayout(controller, root, place2) {
60
61
  }
61
62
 
62
63
  // src/extensions/presence/presence-plugin.ts
63
- var presenceKey = chunkVZZPCYA3_cjs.createPluginKey("presence");
64
+ var presenceKey = chunkFK7EBZPX_cjs.createPluginKey("presence");
64
65
  var PRESENCE = "presence";
65
- var samePeer = (a, b) => a.client === b.client && a.name === b.name && a.color === b.color && a.idle === b.idle && chunkVZZPCYA3_cjs.sameSelection(a.selection, b.selection);
66
- var samePeers = (a, b) => chunkWZA5S5EJ_cjs.sameItems(a, b, samePeer);
66
+ var samePeer = (a, b) => a.client === b.client && a.name === b.name && a.color === b.color && a.idle === b.idle && chunkFK7EBZPX_cjs.sameSelection(a.selection, b.selection);
67
+ var samePeers = (a, b) => chunkI7X7B3WD_cjs.sameItems(a, b, samePeer);
67
68
  var NO_PEERS = [];
68
69
  var presencePlugin = {
69
70
  key: presenceKey,
@@ -74,7 +75,7 @@ var presencePlugin = {
74
75
  if (!tr.docChanged) return peers;
75
76
  let moved = false;
76
77
  const next = peers.map((peer) => {
77
- const selection = peer.selection && chunkVZZPCYA3_cjs.mapSelection(peer.selection, (pos) => tr.mapPos(pos, -1), tr.before.doc);
78
+ const selection = peer.selection && chunkFK7EBZPX_cjs.mapSelection(peer.selection, (pos) => tr.mapPos(pos, -1), tr.before.doc);
78
79
  if (selection === peer.selection) return peer;
79
80
  moved = true;
80
81
  return { ...peer, selection };
@@ -85,9 +86,9 @@ var presencePlugin = {
85
86
  var initials = (name) => name.trim().split(/\s+/).slice(0, 2).map((word) => Array.from(word)[0]?.toUpperCase() ?? "").join("");
86
87
  function groupsOf(state) {
87
88
  const byBlock = /* @__PURE__ */ new Map();
88
- for (const { client, name, color, selection } of chunkVZZPCYA3_cjs.getPluginState(state, presenceKey)) {
89
+ for (const { client, name, color, selection } of chunkFK7EBZPX_cjs.getPluginState(state, presenceKey)) {
89
90
  if (selection === null) continue;
90
- const block = chunkVZZPCYA3_cjs.headBlockId(selection);
91
+ const block = chunkFK7EBZPX_cjs.headBlockId(selection);
91
92
  byBlock.set(block, [...byBlock.get(block) ?? [], { client, name, color }]);
92
93
  }
93
94
  return [...byBlock];
@@ -100,9 +101,9 @@ function place(controller, root, group) {
100
101
  group.style.transform = `translateY(${top}px)`;
101
102
  }
102
103
  function PresenceAvatars({ controller, labels }) {
103
- const groups = chunkQJ34MOFV_cjs.useEditorState(controller, groupsOf, chunkWZA5S5EJ_cjs.sameValue);
104
+ const groups = chunkZ6LAARPB_cjs.useEditorState(controller, groupsOf, chunkI7X7B3WD_cjs.sameValue);
104
105
  const box = react.useRef(null);
105
- chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
106
+ chunkZ6LAARPB_cjs.useIsomorphicLayoutEffect(() => {
106
107
  const root = controller.root;
107
108
  if (!root || box.current === null) return void 0;
108
109
  const children = Array.from(box.current.children);
@@ -135,7 +136,7 @@ function tintOf(state, { color, selection }) {
135
136
  if (![selection.anchor, selection.head].every(({ block }) => state.doc.index.has(block))) return [];
136
137
  const attrs = { class: "quoin-presence-selection" };
137
138
  if (color !== void 0) attrs.style = `--quoin-presence:${color}`;
138
- return chunkVZZPCYA3_cjs.markRanges({ ...state, selection }).map((range) => ({ kind: "inline", ...range, attrs }));
139
+ return chunkFK7EBZPX_cjs.markRanges({ ...state, selection }).map((range) => ({ kind: "inline", ...range, attrs }));
139
140
  }
140
141
  var drawn = /* @__PURE__ */ new WeakMap();
141
142
  function peerDecorations(state, peer) {
@@ -146,7 +147,7 @@ function peerDecorations(state, peer) {
146
147
  return decorations;
147
148
  }
148
149
  function presenceDecorations(state) {
149
- return chunkVZZPCYA3_cjs.getPluginState(state, presenceKey).flatMap((peer) => peerDecorations(state, peer));
150
+ return chunkFK7EBZPX_cjs.getPluginState(state, presenceKey).flatMap((peer) => peerDecorations(state, peer));
150
151
  }
151
152
 
152
153
  // src/extensions/presence/presence-labels.ts
@@ -157,10 +158,7 @@ var englishPresenceLabels = {
157
158
  here: (names) => `${list(names)} ${names.length === 1 ? "is" : "are"} here`,
158
159
  caret: (name) => name
159
160
  };
160
- function resolvePresenceLabels(overrides) {
161
- const given = Object.entries(overrides ?? {}).filter(([, value]) => value !== void 0);
162
- return given.length === 0 ? englishPresenceLabels : { ...englishPresenceLabels, ...Object.fromEntries(given) };
163
- }
161
+ var resolvePresenceLabels = (overrides) => chunkZWTIRGY5_cjs.mergeLabels(englishPresenceLabels, overrides);
164
162
 
165
163
  // src/extensions/presence/presence-link.ts
166
164
  var links = /* @__PURE__ */ new WeakMap();
@@ -181,7 +179,7 @@ function awarePos(shared, pos) {
181
179
  try {
182
180
  return {
183
181
  ...pos,
184
- rel: Y__namespace.relativePositionToJSON(chunkWN7BZDNH_cjs.relative(shared.text, shared.layout, pos))
182
+ rel: Y__namespace.relativePositionToJSON(chunkPURYVDC3_cjs.relative(shared.text, shared.layout, pos))
185
183
  };
186
184
  } catch {
187
185
  return pos;
@@ -202,7 +200,7 @@ var blockOf = (doc, value) => typeof value.block === "string" && doc.index.has(v
202
200
  function textPos(shared, doc, value) {
203
201
  if (shared !== null && value.rel !== void 0) {
204
202
  try {
205
- const found = chunkWN7BZDNH_cjs.absolute(shared.text, shared.layout, Y__namespace.createRelativePositionFromJSON(value.rel));
203
+ const found = chunkPURYVDC3_cjs.absolute(shared.text, shared.layout, Y__namespace.createRelativePositionFromJSON(value.rel));
206
204
  if (found !== null) return found;
207
205
  } catch {
208
206
  }
@@ -213,15 +211,15 @@ function textPos(shared, doc, value) {
213
211
  return placed && block !== null ? { block, region, offset } : null;
214
212
  }
215
213
  function fromAware(shared, doc, schema, value) {
216
- if (!chunkWZA5S5EJ_cjs.isRecord(value) || !chunkWZA5S5EJ_cjs.isRecord(value.anchor) || !chunkWZA5S5EJ_cjs.isRecord(value.head)) return null;
214
+ if (!chunkI7X7B3WD_cjs.isRecord(value) || !chunkI7X7B3WD_cjs.isRecord(value.anchor) || !chunkI7X7B3WD_cjs.isRecord(value.head)) return null;
217
215
  const { anchor, head } = value;
218
216
  if (anchor.region === void 0 && head.region === void 0) {
219
217
  const [from2, to2] = [blockOf(doc, anchor), blockOf(doc, head)];
220
218
  if (from2 === null || to2 === null) return null;
221
- return from2 === to2 ? chunkVZZPCYA3_cjs.nodeSelection(from2) : chunkVZZPCYA3_cjs.blockRangeSelection(from2, to2);
219
+ return from2 === to2 ? chunkFK7EBZPX_cjs.nodeSelection(from2) : chunkFK7EBZPX_cjs.blockRangeSelection(from2, to2);
222
220
  }
223
221
  const [from, to] = [textPos(shared, doc, anchor), textPos(shared, doc, head)];
224
- return from === null || to === null ? null : chunkVZZPCYA3_cjs.validateSelection(doc, schema, chunkVZZPCYA3_cjs.textSelection(from, to));
222
+ return from === null || to === null ? null : chunkFK7EBZPX_cjs.validateSelection(doc, schema, chunkFK7EBZPX_cjs.textSelection(from, to));
225
223
  }
226
224
 
227
225
  // src/extensions/presence/presence-session.ts
@@ -229,7 +227,7 @@ var THROTTLE_MS = 50;
229
227
  var IDLE_MS = 2e3;
230
228
  var COLOR = /^(#[\da-f]{3,8}|[a-z]+|(rgba?|hsla?|hwb|lab|lch|oklab|oklch)\([\d\s.,%/+-]*\))$/i;
231
229
  var safeColor = (value) => typeof value === "string" && COLOR.test(value) ? value : void 0;
232
- var userOf = ({ user }) => chunkWZA5S5EJ_cjs.isRecord(user) && typeof user.name === "string" ? user : null;
230
+ var userOf = ({ user }) => chunkI7X7B3WD_cjs.isRecord(user) && typeof user.name === "string" ? user : null;
233
231
  var namedBy = /* @__PURE__ */ new WeakMap();
234
232
  function startPresence(editor, collaboration, awareness, link, sharedOf2) {
235
233
  const { doc, user } = collaboration;
@@ -262,7 +260,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
262
260
  timer ??= setTimeout(tick, 0);
263
261
  };
264
262
  const refresh = () => {
265
- const before = chunkVZZPCYA3_cjs.getPluginState(editor.state, presenceKey);
263
+ const before = chunkFK7EBZPX_cjs.getPluginState(editor.state, presenceKey);
266
264
  const peers = [];
267
265
  const joined = [];
268
266
  const gone = new Set(seen.keys());
@@ -296,7 +294,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
296
294
  for (const listener of [...link.listeners]) listener({ joined, left });
297
295
  heard = true;
298
296
  if (samePeers(peers, before)) return;
299
- editor.dispatch(chunkWN7BZDNH_cjs.sharedChange(editor, []).setMeta(PRESENCE, peers));
297
+ editor.dispatch(chunkPURYVDC3_cjs.sharedChange(editor, []).setMeta(PRESENCE, peers));
300
298
  };
301
299
  const changed = () => {
302
300
  if (!writing) refresh();
@@ -305,7 +303,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
305
303
  if (!transaction.local && seen.size > 0) refresh();
306
304
  };
307
305
  const stopEditor = editor.subscribe((state, tr) => {
308
- if (tr !== null && tr.origin !== "remote" && !chunkVZZPCYA3_cjs.sameSelection(tr.before.selection, state.selection)) schedule();
306
+ if (tr !== null && tr.origin !== "remote" && !chunkFK7EBZPX_cjs.sameSelection(tr.before.selection, state.selection)) schedule();
309
307
  });
310
308
  put("user", { name: user.name, color: user.color });
311
309
  write(null);
@@ -338,7 +336,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
338
336
 
339
337
  // src/extensions/presence/place-caret.ts
340
338
  function caretBox(host, offset) {
341
- const map = chunkQJ34MOFV_cjs.domMapOf(host);
339
+ const map = chunkZ6LAARPB_cjs.domMapOf(host);
342
340
  if (!map || !host.isConnected) return null;
343
341
  const doc = host.ownerDocument;
344
342
  const spans = [
@@ -366,7 +364,7 @@ function inside(box, area) {
366
364
  }
367
365
  function placeCaret(controller, root, caret, observer) {
368
366
  const client = Number(caret.dataset.client);
369
- const peer = chunkVZZPCYA3_cjs.getPluginState(controller.editor.state, presenceKey).find((one) => one.client === client);
367
+ const peer = chunkFK7EBZPX_cjs.getPluginState(controller.editor.state, presenceKey).find((one) => one.client === client);
370
368
  const head = peer?.selection?.kind === "text" ? peer.selection.head : null;
371
369
  const host = head && controller.registry.get(head.block, head.region);
372
370
  const box = host ? caretBox(host, head.offset) : null;
@@ -384,13 +382,13 @@ function placeCaret(controller, root, caret, observer) {
384
382
  const cut = (past) => `${Math.max(...areas.map(past)) / scale + 1}px`;
385
383
  caret.style.clipPath = areas[0] ? `inset(-99px ${cut((a) => box.left - a.right)} -99px ${cut((a) => a.left - box.left)})` : "";
386
384
  }
387
- var shownOf = (state) => chunkVZZPCYA3_cjs.getPluginState(state, presenceKey).flatMap(
385
+ var shownOf = (state) => chunkFK7EBZPX_cjs.getPluginState(state, presenceKey).flatMap(
388
386
  ({ client, name, color, idle, selection }) => selection?.kind === "text" ? [{ client, name, color, idle }] : []
389
387
  );
390
388
  function RemoteCarets({ controller, labels }) {
391
- const shown = chunkQJ34MOFV_cjs.useEditorState(controller, shownOf, chunkWZA5S5EJ_cjs.sameValue);
389
+ const shown = chunkZ6LAARPB_cjs.useEditorState(controller, shownOf, chunkI7X7B3WD_cjs.sameValue);
392
390
  const box = react.useRef(null);
393
- chunkQJ34MOFV_cjs.useIsomorphicLayoutEffect(() => {
391
+ chunkZ6LAARPB_cjs.useIsomorphicLayoutEffect(() => {
394
392
  const root = controller.root;
395
393
  if (!root || box.current === null) return void 0;
396
394
  const carets = Array.from(box.current.children);
@@ -412,9 +410,9 @@ function usePresenceActivity(controller, link) {
412
410
  react.useEffect(() => {
413
411
  const doc = controller.root?.ownerDocument;
414
412
  if (!doc) return void 0;
415
- let focused = chunkQR2NIDUK_cjs.ownsNode(controller, doc.activeElement);
413
+ let focused = chunkBYYCD54G_cjs.ownsNode(controller, doc.activeElement);
416
414
  const update = () => setActive(link, focused && !controller.readOnly);
417
- const stopFocus = chunkQR2NIDUK_cjs.watchCanvasFocus(controller, doc, (inside2) => {
415
+ const stopFocus = chunkBYYCD54G_cjs.watchCanvasFocus(controller, doc, (inside2) => {
418
416
  focused = inside2;
419
417
  update();
420
418
  });
@@ -500,7 +498,7 @@ function presenceExtension(collaboration, options = {}) {
500
498
  ] });
501
499
  }
502
500
  const ui = { overlays: [Overlay] };
503
- return chunkVZZPCYA3_cjs.defineExtension({
501
+ return chunkFK7EBZPX_cjs.defineExtension({
504
502
  name: "presence",
505
503
  // Below the default, so the collaboration it reads has connected before it starts.
506
504
  priority: 99,
@@ -508,8 +506,8 @@ function presenceExtension(collaboration, options = {}) {
508
506
  decorations: presenceDecorations,
509
507
  onMount(editor) {
510
508
  const link = linkOf(editor);
511
- if (chunkWN7BZDNH_cjs.sharedOf(collaboration, editor) === null) chunkA6PGQVTR_cjs.devWarn(UNBOUND);
512
- const session = startPresence(editor, collaboration, awareness, link, () => chunkWN7BZDNH_cjs.sharedOf(collaboration, editor));
509
+ if (chunkPURYVDC3_cjs.sharedOf(collaboration, editor) === null) chunkA6PGQVTR_cjs.devWarn(UNBOUND);
510
+ const session = startPresence(editor, collaboration, awareness, link, () => chunkPURYVDC3_cjs.sharedOf(collaboration, editor));
513
511
  link.session = session;
514
512
  return () => {
515
513
  session.stop();
@@ -1,21 +1,10 @@
1
1
  import { Extension } from './engine.cjs';
2
2
  import { YjsCollaboration } from './yjs.cjs';
3
+ import { P as PresenceLabels } from './presence-labels-DXVJLifl.cjs';
4
+ export { e as englishPresenceLabels } from './presence-labels-DXVJLifl.cjs';
3
5
  import './types-CQ8Vw_7N.cjs';
4
6
  import 'yjs';
5
7
 
6
- /** Every string presence shows or speaks. Names come as a list of the people meant, in the order they came. */
7
- type PresenceLabels = {
8
- /** Said through the live region when people open the document. */
9
- joined(names: readonly string[]): string;
10
- /** Said when people close it. */
11
- left(names: readonly string[]): string;
12
- /** The accessible name of the avatars beside a block, naming the people whose selection is in it. */
13
- here(names: readonly string[]): string;
14
- /** The text a collaborator's caret shows, given the name the collaborator gave. */
15
- caret(name: string): string;
16
- };
17
- declare const englishPresenceLabels: PresenceLabels;
18
-
19
8
  type PresenceOptions = {
20
9
  /** Every string presence shows or speaks, English by default. A key left out stays English. */
21
10
  labels?: Partial<PresenceLabels>;
@@ -27,5 +16,5 @@ type PresenceOptions = {
27
16
  */
28
17
  declare function presenceExtension(collaboration: YjsCollaboration, options?: PresenceOptions): Extension;
29
18
 
30
- export { englishPresenceLabels, presenceExtension };
31
- export type { PresenceLabels, PresenceOptions };
19
+ export { PresenceLabels, presenceExtension };
20
+ export type { PresenceOptions };