quoin-editor 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/dist/ai.cjs +135 -94
  3. package/dist/ai.cjs.map +1 -1
  4. package/dist/ai.d.cts +1 -1
  5. package/dist/ai.d.ts +1 -1
  6. package/dist/ai.js +62 -21
  7. package/dist/ai.js.map +1 -1
  8. package/dist/catalogue.cjs +25 -25
  9. package/dist/catalogue.d.cts +6 -6
  10. package/dist/catalogue.d.ts +6 -6
  11. package/dist/catalogue.js +17 -17
  12. package/dist/{chunk-ND5XJVK2.cjs → chunk-4SLJNZSM.cjs} +27 -23
  13. package/dist/chunk-4SLJNZSM.cjs.map +1 -0
  14. package/dist/{chunk-LCQSG4M6.js → chunk-4XFXB37X.js} +22 -18
  15. package/dist/chunk-4XFXB37X.js.map +1 -0
  16. package/dist/{chunk-AEJXZBVR.cjs → chunk-5MAYUGTE.cjs} +110 -103
  17. package/dist/chunk-5MAYUGTE.cjs.map +1 -0
  18. package/dist/{chunk-JDPTZUBW.js → chunk-623AOJM2.js} +4 -4
  19. package/dist/chunk-6NULZPVC.js +374 -0
  20. package/dist/chunk-6NULZPVC.js.map +1 -0
  21. package/dist/{chunk-2QCRZ7OL.cjs → chunk-6V6GGBDK.cjs} +12 -11
  22. package/dist/{chunk-2QCRZ7OL.cjs.map → chunk-6V6GGBDK.cjs.map} +1 -1
  23. package/dist/{chunk-WXMYDXPN.cjs → chunk-73653CJ4.cjs} +4 -3
  24. package/dist/chunk-73653CJ4.cjs.map +1 -0
  25. package/dist/{chunk-47MLKSI2.js → chunk-ADSJ42DO.js} +6 -6
  26. package/dist/{chunk-PWUEPDA3.cjs → chunk-AUOEM3SF.cjs} +44 -44
  27. package/dist/{chunk-PWUEPDA3.cjs.map → chunk-AUOEM3SF.cjs.map} +1 -1
  28. package/dist/{chunk-WQHV3MRE.cjs → chunk-BQANU5BH.cjs} +12 -12
  29. package/dist/{chunk-WQHV3MRE.cjs.map → chunk-BQANU5BH.cjs.map} +1 -1
  30. package/dist/{chunk-KXOBZGQO.js → chunk-C23RQVRK.js} +21 -14
  31. package/dist/chunk-C23RQVRK.js.map +1 -0
  32. package/dist/{chunk-2VDK27IF.cjs → chunk-CW3AFJBR.cjs} +312 -342
  33. package/dist/chunk-CW3AFJBR.cjs.map +1 -0
  34. package/dist/{chunk-MQ2XQ4MX.js → chunk-DUE3HCZD.js} +6 -6
  35. package/dist/chunk-DUE3HCZD.js.map +1 -0
  36. package/dist/{chunk-OMOBMXD5.cjs → chunk-EH5KXQXY.cjs} +7 -2
  37. package/dist/chunk-EH5KXQXY.cjs.map +1 -0
  38. package/dist/{chunk-ZS2WA357.js → chunk-EPARJI4V.js} +147 -129
  39. package/dist/chunk-EPARJI4V.js.map +1 -0
  40. package/dist/{chunk-HZSSEYJS.cjs → chunk-FDRUAL3Z.cjs} +30 -30
  41. package/dist/{chunk-HZSSEYJS.cjs.map → chunk-FDRUAL3Z.cjs.map} +1 -1
  42. package/dist/{chunk-T7SW6OWV.js → chunk-IQBMAE3F.js} +5 -5
  43. package/dist/{chunk-RUDWMKYX.js → chunk-JHQUHFLX.js} +8 -8
  44. package/dist/{chunk-HELJTLNC.cjs → chunk-KUYZMSMF.cjs} +12 -12
  45. package/dist/chunk-KUYZMSMF.cjs.map +1 -0
  46. package/dist/chunk-LE5XMIFJ.cjs +14 -0
  47. package/dist/chunk-LE5XMIFJ.cjs.map +1 -0
  48. package/dist/{chunk-EL2OEJQC.cjs → chunk-LLTEGXWZ.cjs} +56 -56
  49. package/dist/{chunk-EL2OEJQC.cjs.map → chunk-LLTEGXWZ.cjs.map} +1 -1
  50. package/dist/chunk-MQUCCSWG.js +14 -0
  51. package/dist/chunk-MQUCCSWG.js.map +1 -0
  52. package/dist/{chunk-NNDYYEW5.js → chunk-N4FGA3H4.js} +5 -5
  53. package/dist/{chunk-ZHOSSWUM.js → chunk-NEZJ7ZP5.js} +4 -3
  54. package/dist/chunk-NEZJ7ZP5.js.map +1 -0
  55. package/dist/{chunk-XEBWC7ZL.js → chunk-O4Z2WMFF.js} +7 -2
  56. package/dist/chunk-O4Z2WMFF.js.map +1 -0
  57. package/dist/{chunk-HJIQT3S5.js → chunk-OBMBSU2S.js} +100 -84
  58. package/dist/chunk-OBMBSU2S.js.map +1 -0
  59. package/dist/{chunk-KAVU6T6J.js → chunk-OSHZQR3W.js} +5 -5
  60. package/dist/{chunk-GTTPVJSD.cjs → chunk-P6KYXFZC.cjs} +265 -247
  61. package/dist/chunk-P6KYXFZC.cjs.map +1 -0
  62. package/dist/{chunk-CDELOHDY.cjs → chunk-R2BLBV43.cjs} +23 -23
  63. package/dist/{chunk-CDELOHDY.cjs.map → chunk-R2BLBV43.cjs.map} +1 -1
  64. package/dist/{chunk-NOKWNK2O.js → chunk-RJRX34BZ.js} +3 -2
  65. package/dist/{chunk-ZGZEJCRV.js → chunk-T43RZTUT.js} +166 -196
  66. package/dist/chunk-T43RZTUT.js.map +1 -0
  67. package/dist/chunk-TLGX43P6.cjs +374 -0
  68. package/dist/chunk-TLGX43P6.cjs.map +1 -0
  69. package/dist/{chunk-POBM7MGR.js → chunk-U3LOLYAU.js} +2 -2
  70. package/dist/{chunk-RDG4VI6E.cjs → chunk-UEKXVCKC.cjs} +103 -93
  71. package/dist/chunk-UEKXVCKC.cjs.map +1 -0
  72. package/dist/{chunk-PMWCQSQX.js → chunk-VCLL5C7J.js} +5 -5
  73. package/dist/{chunk-SG37UBDO.js → chunk-VRS6WCEK.js} +20 -10
  74. package/dist/chunk-VRS6WCEK.js.map +1 -0
  75. package/dist/{chunk-ZC24WB7Y.cjs → chunk-WEYDDIBQ.cjs} +14 -14
  76. package/dist/{chunk-ZC24WB7Y.cjs.map → chunk-WEYDDIBQ.cjs.map} +1 -1
  77. package/dist/{chunk-5DNCCN6X.cjs → chunk-X4HDKFW5.cjs} +27 -27
  78. package/dist/{chunk-5DNCCN6X.cjs.map → chunk-X4HDKFW5.cjs.map} +1 -1
  79. package/dist/{chunk-SLVDAHHK.cjs → chunk-X4P4TQXH.cjs} +5 -5
  80. package/dist/{chunk-SLVDAHHK.cjs.map → chunk-X4P4TQXH.cjs.map} +1 -1
  81. package/dist/{chunk-GLLXHMH2.cjs → chunk-XA3UEJIW.cjs} +3 -3
  82. package/dist/{chunk-GLLXHMH2.cjs.map → chunk-XA3UEJIW.cjs.map} +1 -1
  83. package/dist/{chunk-K574XHMM.js → chunk-YBMUEEM5.js} +2 -2
  84. package/dist/{chunk-PZ4GT5JO.cjs → chunk-ZKVOS57Q.cjs} +316 -300
  85. package/dist/chunk-ZKVOS57Q.cjs.map +1 -0
  86. package/dist/comments.cjs +113 -98
  87. package/dist/comments.cjs.map +1 -1
  88. package/dist/comments.d.cts +6 -1
  89. package/dist/comments.d.ts +6 -1
  90. package/dist/comments.js +32 -17
  91. package/dist/comments.js.map +1 -1
  92. package/dist/diff.cjs +44 -40
  93. package/dist/diff.cjs.map +1 -1
  94. package/dist/diff.js +17 -13
  95. package/dist/diff.js.map +1 -1
  96. package/dist/docx.cjs +60 -40
  97. package/dist/docx.cjs.map +1 -1
  98. package/dist/docx.d.cts +6 -0
  99. package/dist/docx.d.ts +6 -0
  100. package/dist/docx.js +32 -12
  101. package/dist/docx.js.map +1 -1
  102. package/dist/embed.cjs +9 -9
  103. package/dist/embed.d.cts +1 -1
  104. package/dist/embed.d.ts +1 -1
  105. package/dist/embed.js +8 -8
  106. package/dist/{emoji-extension-DpQ43HjE.d.ts → emoji-extension-CmPlRssm.d.ts} +1 -1
  107. package/dist/{emoji-extension-C12gDPm6.d.cts → emoji-extension-zJ6F7hW8.d.cts} +1 -1
  108. package/dist/emoji.cjs +8 -8
  109. package/dist/emoji.d.cts +3 -3
  110. package/dist/emoji.d.ts +3 -3
  111. package/dist/emoji.js +7 -7
  112. package/dist/engine.cjs +4 -4
  113. package/dist/engine.d.cts +2 -2
  114. package/dist/engine.d.ts +2 -2
  115. package/dist/engine.js +3 -3
  116. package/dist/{find-extension-_sbZEt3R.d.cts → find-extension-BcRyE9K4.d.cts} +1 -1
  117. package/dist/{find-extension-DKqLLSuP.d.ts → find-extension-CmFehyul.d.ts} +1 -1
  118. package/dist/find.cjs +8 -8
  119. package/dist/find.d.cts +2 -2
  120. package/dist/find.d.ts +2 -2
  121. package/dist/find.js +7 -7
  122. package/dist/headless.cjs +5 -5
  123. package/dist/headless.d.cts +4 -4
  124. package/dist/headless.d.ts +4 -4
  125. package/dist/headless.js +4 -4
  126. package/dist/{index-CgD72kHB.d.cts → index-CFPmCee4.d.cts} +5 -2
  127. package/dist/{index-DNYbTK3w.d.ts → index-DiCGV60d.d.ts} +5 -2
  128. package/dist/index.cjs +7 -7
  129. package/dist/index.d.cts +4 -4
  130. package/dist/index.d.ts +4 -4
  131. package/dist/index.js +6 -6
  132. package/dist/math.cjs +10 -10
  133. package/dist/math.d.cts +1 -1
  134. package/dist/math.d.ts +1 -1
  135. package/dist/math.js +9 -9
  136. package/dist/mention.cjs +10 -10
  137. package/dist/mention.d.cts +1 -1
  138. package/dist/mention.d.ts +1 -1
  139. package/dist/mention.js +9 -9
  140. package/dist/presence.cjs +98 -104
  141. package/dist/presence.cjs.map +1 -1
  142. package/dist/presence.d.cts +2 -2
  143. package/dist/presence.d.ts +2 -2
  144. package/dist/presence.js +66 -72
  145. package/dist/presence.js.map +1 -1
  146. package/dist/{stats-extension-Bly88uio.d.ts → stats-extension-DisOEbbI.d.ts} +1 -1
  147. package/dist/{stats-extension-CJPijvUb.d.cts → stats-extension-Dt1lgP3m.d.cts} +1 -1
  148. package/dist/stats.cjs +9 -9
  149. package/dist/stats.d.cts +3 -3
  150. package/dist/stats.d.ts +3 -3
  151. package/dist/stats.js +8 -8
  152. package/dist/styles.css +1 -1
  153. package/dist/{table-extension-Dzf4k6hI.d.ts → table-extension-BTMJnT7J.d.ts} +1 -1
  154. package/dist/{table-extension-BTLxFy2S.d.cts → table-extension-DxZz3jqp.d.cts} +1 -1
  155. package/dist/table.cjs +8 -8
  156. package/dist/table.d.cts +2 -2
  157. package/dist/table.d.ts +2 -2
  158. package/dist/table.js +7 -7
  159. package/dist/{toc-extension-DWm5alVj.d.ts → toc-extension-CR9U-l6j.d.ts} +1 -1
  160. package/dist/{toc-extension-B3-s6h2x.d.cts → toc-extension-DGHywOBv.d.cts} +1 -1
  161. package/dist/toc.cjs +8 -8
  162. package/dist/toc.d.cts +2 -2
  163. package/dist/toc.d.ts +2 -2
  164. package/dist/toc.js +7 -7
  165. package/dist/{types-a1CRBlEh.d.ts → types-C6_QkXzy.d.ts} +1 -9
  166. package/dist/{types-Cz7XJLaK.d.cts → types-CJ7Gq3GX.d.cts} +1 -9
  167. package/dist/{view-controller-DSHw0ltQ.d.cts → view-controller-BD1KwYfE.d.cts} +6 -19
  168. package/dist/{view-controller-UbpzblGl.d.ts → view-controller-y4cb60ue.d.ts} +6 -19
  169. package/dist/view.cjs +6 -6
  170. package/dist/view.js +3 -3
  171. package/dist/yjs.cjs +302 -412
  172. package/dist/yjs.cjs.map +1 -1
  173. package/dist/yjs.d.cts +3 -3
  174. package/dist/yjs.d.ts +3 -3
  175. package/dist/yjs.js +211 -321
  176. package/dist/yjs.js.map +1 -1
  177. package/package.json +1 -1
  178. package/dist/chunk-2VDK27IF.cjs.map +0 -1
  179. package/dist/chunk-AEJXZBVR.cjs.map +0 -1
  180. package/dist/chunk-E75EHRPA.cjs +0 -175
  181. package/dist/chunk-E75EHRPA.cjs.map +0 -1
  182. package/dist/chunk-GTTPVJSD.cjs.map +0 -1
  183. package/dist/chunk-HELJTLNC.cjs.map +0 -1
  184. package/dist/chunk-HJIQT3S5.js.map +0 -1
  185. package/dist/chunk-JEIFJHEI.js +0 -14
  186. package/dist/chunk-JEIFJHEI.js.map +0 -1
  187. package/dist/chunk-KXOBZGQO.js.map +0 -1
  188. package/dist/chunk-LCQSG4M6.js.map +0 -1
  189. package/dist/chunk-MQ2XQ4MX.js.map +0 -1
  190. package/dist/chunk-ND5XJVK2.cjs.map +0 -1
  191. package/dist/chunk-OMOBMXD5.cjs.map +0 -1
  192. package/dist/chunk-PZ4GT5JO.cjs.map +0 -1
  193. package/dist/chunk-QAW5NH6S.cjs +0 -14
  194. package/dist/chunk-QAW5NH6S.cjs.map +0 -1
  195. package/dist/chunk-RDG4VI6E.cjs.map +0 -1
  196. package/dist/chunk-SG37UBDO.js.map +0 -1
  197. package/dist/chunk-TC4DARU2.js +0 -175
  198. package/dist/chunk-TC4DARU2.js.map +0 -1
  199. package/dist/chunk-WXMYDXPN.cjs.map +0 -1
  200. package/dist/chunk-XEBWC7ZL.js.map +0 -1
  201. package/dist/chunk-ZGZEJCRV.js.map +0 -1
  202. package/dist/chunk-ZHOSSWUM.js.map +0 -1
  203. package/dist/chunk-ZS2WA357.js.map +0 -1
  204. /package/dist/{chunk-JDPTZUBW.js.map → chunk-623AOJM2.js.map} +0 -0
  205. /package/dist/{chunk-47MLKSI2.js.map → chunk-ADSJ42DO.js.map} +0 -0
  206. /package/dist/{chunk-T7SW6OWV.js.map → chunk-IQBMAE3F.js.map} +0 -0
  207. /package/dist/{chunk-RUDWMKYX.js.map → chunk-JHQUHFLX.js.map} +0 -0
  208. /package/dist/{chunk-NNDYYEW5.js.map → chunk-N4FGA3H4.js.map} +0 -0
  209. /package/dist/{chunk-KAVU6T6J.js.map → chunk-OSHZQR3W.js.map} +0 -0
  210. /package/dist/{chunk-NOKWNK2O.js.map → chunk-RJRX34BZ.js.map} +0 -0
  211. /package/dist/{chunk-POBM7MGR.js.map → chunk-U3LOLYAU.js.map} +0 -0
  212. /package/dist/{chunk-PMWCQSQX.js.map → chunk-VCLL5C7J.js.map} +0 -0
  213. /package/dist/{chunk-K574XHMM.js.map → chunk-YBMUEEM5.js.map} +0 -0
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  useAutosave,
12
12
  useLabels,
13
13
  useQuoin
14
- } from "./chunk-ZGZEJCRV.js";
14
+ } from "./chunk-T43RZTUT.js";
15
15
  import {
16
16
  BlockShell,
17
17
  EditableRegion,
@@ -28,12 +28,12 @@ import {
28
28
  useEditorState,
29
29
  useQuoinEditor,
30
30
  useViewController
31
- } from "./chunk-ZS2WA357.js";
31
+ } from "./chunk-EPARJI4V.js";
32
32
  import {
33
33
  blockByType,
34
34
  defineBlock,
35
35
  paletteBlocks
36
- } from "./chunk-XEBWC7ZL.js";
36
+ } from "./chunk-O4Z2WMFF.js";
37
37
  import {
38
38
  Transaction,
39
39
  addMarkStep,
@@ -77,11 +77,11 @@ import {
77
77
  toggleMark,
78
78
  typographyRules,
79
79
  undo
80
- } from "./chunk-HJIQT3S5.js";
80
+ } from "./chunk-OBMBSU2S.js";
81
81
  import {
82
82
  diffBlocks,
83
83
  diffInline
84
- } from "./chunk-NOKWNK2O.js";
84
+ } from "./chunk-RJRX34BZ.js";
85
85
  import {
86
86
  PALETTE,
87
87
  atom,
@@ -94,7 +94,7 @@ import {
94
94
  sanitizeHref,
95
95
  serializeInline,
96
96
  text
97
- } from "./chunk-LCQSG4M6.js";
97
+ } from "./chunk-4XFXB37X.js";
98
98
  export {
99
99
  BlockCanvas,
100
100
  BlockShell,
package/dist/math.cjs CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkEL2OEJQCcjs = require('./chunk-EL2OEJQC.cjs');
6
- require('./chunk-SLVDAHHK.cjs');
7
- require('./chunk-WQHV3MRE.cjs');
8
- require('./chunk-2VDK27IF.cjs');
9
- require('./chunk-GTTPVJSD.cjs');
10
- require('./chunk-OMOBMXD5.cjs');
11
- require('./chunk-PZ4GT5JO.cjs');
12
- require('./chunk-2QCRZ7OL.cjs');
13
- require('./chunk-ND5XJVK2.cjs');
5
+ var _chunkLLTEGXWZcjs = require('./chunk-LLTEGXWZ.cjs');
6
+ require('./chunk-X4P4TQXH.cjs');
7
+ require('./chunk-BQANU5BH.cjs');
8
+ require('./chunk-CW3AFJBR.cjs');
9
+ require('./chunk-P6KYXFZC.cjs');
10
+ require('./chunk-EH5KXQXY.cjs');
11
+ require('./chunk-ZKVOS57Q.cjs');
12
+ require('./chunk-6V6GGBDK.cjs');
13
+ require('./chunk-4SLJNZSM.cjs');
14
14
 
15
15
 
16
16
 
17
- exports.englishMathLabels = _chunkEL2OEJQCcjs.englishMathLabels; exports.mathExtension = _chunkEL2OEJQCcjs.mathExtension;
17
+ exports.englishMathLabels = _chunkLLTEGXWZcjs.englishMathLabels; exports.mathExtension = _chunkLLTEGXWZcjs.mathExtension;
18
18
  //# sourceMappingURL=math.cjs.map
package/dist/math.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as Extension } from './types-Cz7XJLaK.cjs';
1
+ import { E as Extension } from './types-CJ7Gq3GX.cjs';
2
2
  import { H as HTMLOptions } from './to-html-CNCITCln.cjs';
3
3
  import './types-DULc8wwg.cjs';
4
4
  import './embed-provider-jXwlRmnp.cjs';
package/dist/math.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as Extension } from './types-a1CRBlEh.js';
1
+ import { E as Extension } from './types-C6_QkXzy.js';
2
2
  import { H as HTMLOptions } from './to-html-C5t7xyaM.js';
3
3
  import './types-DULc8wwg.js';
4
4
  import './embed-provider-jXwlRmnp.js';
package/dist/math.js CHANGED
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  englishMathLabels,
4
4
  mathExtension
5
- } from "./chunk-RUDWMKYX.js";
6
- import "./chunk-POBM7MGR.js";
7
- import "./chunk-JDPTZUBW.js";
8
- import "./chunk-ZGZEJCRV.js";
9
- import "./chunk-ZS2WA357.js";
10
- import "./chunk-XEBWC7ZL.js";
11
- import "./chunk-HJIQT3S5.js";
12
- import "./chunk-NOKWNK2O.js";
13
- import "./chunk-LCQSG4M6.js";
5
+ } from "./chunk-JHQUHFLX.js";
6
+ import "./chunk-U3LOLYAU.js";
7
+ import "./chunk-623AOJM2.js";
8
+ import "./chunk-T43RZTUT.js";
9
+ import "./chunk-EPARJI4V.js";
10
+ import "./chunk-O4Z2WMFF.js";
11
+ import "./chunk-OBMBSU2S.js";
12
+ import "./chunk-RJRX34BZ.js";
13
+ import "./chunk-4XFXB37X.js";
14
14
  export {
15
15
  englishMathLabels,
16
16
  mathExtension
package/dist/mention.cjs CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
 
4
4
 
5
- var _chunk5DNCCN6Xcjs = require('./chunk-5DNCCN6X.cjs');
6
- require('./chunk-GLLXHMH2.cjs');
7
- require('./chunk-WQHV3MRE.cjs');
8
- require('./chunk-2VDK27IF.cjs');
9
- require('./chunk-GTTPVJSD.cjs');
10
- require('./chunk-OMOBMXD5.cjs');
11
- require('./chunk-PZ4GT5JO.cjs');
12
- require('./chunk-2QCRZ7OL.cjs');
13
- require('./chunk-ND5XJVK2.cjs');
5
+ var _chunkX4HDKFW5cjs = require('./chunk-X4HDKFW5.cjs');
6
+ require('./chunk-XA3UEJIW.cjs');
7
+ require('./chunk-BQANU5BH.cjs');
8
+ require('./chunk-CW3AFJBR.cjs');
9
+ require('./chunk-P6KYXFZC.cjs');
10
+ require('./chunk-EH5KXQXY.cjs');
11
+ require('./chunk-ZKVOS57Q.cjs');
12
+ require('./chunk-6V6GGBDK.cjs');
13
+ require('./chunk-4SLJNZSM.cjs');
14
14
 
15
15
 
16
16
 
17
- exports.englishMentionLabels = _chunk5DNCCN6Xcjs.englishMentionLabels; exports.mentionExtension = _chunk5DNCCN6Xcjs.mentionExtension;
17
+ exports.englishMentionLabels = _chunkX4HDKFW5cjs.englishMentionLabels; exports.mentionExtension = _chunkX4HDKFW5cjs.mentionExtension;
18
18
  //# sourceMappingURL=mention.cjs.map
@@ -1,4 +1,4 @@
1
- import { E as Extension } from './types-Cz7XJLaK.cjs';
1
+ import { E as Extension } from './types-CJ7Gq3GX.cjs';
2
2
  import './types-DULc8wwg.cjs';
3
3
 
4
4
  /** Every string the mention feature shows or speaks. */
package/dist/mention.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as Extension } from './types-a1CRBlEh.js';
1
+ import { E as Extension } from './types-C6_QkXzy.js';
2
2
  import './types-DULc8wwg.js';
3
3
 
4
4
  /** Every string the mention feature shows or speaks. */
package/dist/mention.js CHANGED
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  englishMentionLabels,
4
4
  mentionExtension
5
- } from "./chunk-47MLKSI2.js";
6
- import "./chunk-K574XHMM.js";
7
- import "./chunk-JDPTZUBW.js";
8
- import "./chunk-ZGZEJCRV.js";
9
- import "./chunk-ZS2WA357.js";
10
- import "./chunk-XEBWC7ZL.js";
11
- import "./chunk-HJIQT3S5.js";
12
- import "./chunk-NOKWNK2O.js";
13
- import "./chunk-LCQSG4M6.js";
5
+ } from "./chunk-ADSJ42DO.js";
6
+ import "./chunk-YBMUEEM5.js";
7
+ import "./chunk-623AOJM2.js";
8
+ import "./chunk-T43RZTUT.js";
9
+ import "./chunk-EPARJI4V.js";
10
+ import "./chunk-O4Z2WMFF.js";
11
+ import "./chunk-OBMBSU2S.js";
12
+ import "./chunk-RJRX34BZ.js";
13
+ import "./chunk-4XFXB37X.js";
14
14
  export {
15
15
  englishMentionLabels,
16
16
  mentionExtension
package/dist/presence.cjs CHANGED
@@ -1,27 +1,27 @@
1
1
  'use client';"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
2
 
3
3
 
4
- var _chunkQAW5NH6Scjs = require('./chunk-QAW5NH6S.cjs');
4
+ var _chunkLE5XMIFJcjs = require('./chunk-LE5XMIFJ.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunkWXMYDXPNcjs = require('./chunk-WXMYDXPN.cjs');
9
- require('./chunk-2VDK27IF.cjs');
8
+ var _chunk73653CJ4cjs = require('./chunk-73653CJ4.cjs');
9
+ require('./chunk-CW3AFJBR.cjs');
10
10
 
11
11
 
12
12
 
13
13
 
14
- var _chunkGTTPVJSDcjs = require('./chunk-GTTPVJSD.cjs');
15
14
 
15
+ var _chunkP6KYXFZCcjs = require('./chunk-P6KYXFZC.cjs');
16
16
 
17
- var _chunkOMOBMXD5cjs = require('./chunk-OMOBMXD5.cjs');
18
17
 
18
+ var _chunkEH5KXQXYcjs = require('./chunk-EH5KXQXY.cjs');
19
19
 
20
20
 
21
21
 
22
- var _chunkE75EHRPAcjs = require('./chunk-E75EHRPA.cjs');
23
22
 
24
23
 
24
+ var _chunkTLGX43P6cjs = require('./chunk-TLGX43P6.cjs');
25
25
 
26
26
 
27
27
 
@@ -31,18 +31,51 @@ var _chunkE75EHRPAcjs = require('./chunk-E75EHRPA.cjs');
31
31
 
32
32
 
33
33
 
34
- var _chunkPZ4GT5JOcjs = require('./chunk-PZ4GT5JO.cjs');
35
- require('./chunk-2QCRZ7OL.cjs');
36
- require('./chunk-ND5XJVK2.cjs');
34
+
35
+
36
+
37
+ var _chunkZKVOS57Qcjs = require('./chunk-ZKVOS57Q.cjs');
38
+
39
+
40
+ var _chunk6V6GGBDKcjs = require('./chunk-6V6GGBDK.cjs');
41
+
42
+
43
+
44
+ var _chunk4SLJNZSMcjs = require('./chunk-4SLJNZSM.cjs');
37
45
 
38
46
  // src/extensions/presence/PresenceAvatars.tsx
39
47
  var _react = require('react');
40
48
 
49
+ // src/extensions/presence/follow-layout.ts
50
+ function followLayout(controller, root, place2) {
51
+ const view = root.ownerDocument.defaultView;
52
+ let frame = 0;
53
+ const update = () => place2(observer);
54
+ const later = () => {
55
+ view.cancelAnimationFrame(frame);
56
+ frame = view.requestAnimationFrame(update);
57
+ };
58
+ const observer = new ResizeObserver(later);
59
+ update();
60
+ observer.observe(root);
61
+ const unsubscribe = controller.editor.subscribe(later);
62
+ const fonts = root.ownerDocument.fonts;
63
+ const unlistenScroll = _chunkP6KYXFZCcjs.listen.call(void 0, root, { scroll: update }, { capture: true, passive: true });
64
+ const unlistenFonts = fonts && _chunkP6KYXFZCcjs.listen.call(void 0, fonts, { loadingdone: later });
65
+ return () => {
66
+ view.cancelAnimationFrame(frame);
67
+ unsubscribe();
68
+ observer.disconnect();
69
+ unlistenScroll();
70
+ _optionalChain([unlistenFonts, 'optionalCall', _ => _()]);
71
+ };
72
+ }
73
+
41
74
  // src/extensions/presence/presence-plugin.ts
42
- var presenceKey = _chunkPZ4GT5JOcjs.createPluginKey.call(void 0, "presence");
75
+ var presenceKey = _chunkZKVOS57Qcjs.createPluginKey.call(void 0, "presence");
43
76
  var PRESENCE = "presence";
44
- var samePeer = (a, b) => a.client === b.client && a.name === b.name && a.color === b.color && a.idle === b.idle && _chunkPZ4GT5JOcjs.sameSelection.call(void 0, a.selection, b.selection);
45
- var samePeers = (a, b) => a.length === b.length && a.every((peer, i) => samePeer(peer, b[i]));
77
+ var samePeer = (a, b) => a.client === b.client && a.name === b.name && a.color === b.color && a.idle === b.idle && _chunkZKVOS57Qcjs.sameSelection.call(void 0, a.selection, b.selection);
78
+ var samePeers = (a, b) => _chunk4SLJNZSMcjs.sameItems.call(void 0, a, b, samePeer);
46
79
  var NO_PEERS = [];
47
80
  var presencePlugin = {
48
81
  key: presenceKey,
@@ -53,7 +86,7 @@ var presencePlugin = {
53
86
  if (!tr.docChanged) return peers;
54
87
  let moved = false;
55
88
  const next = peers.map((peer) => {
56
- const selection = peer.selection && _chunkPZ4GT5JOcjs.mapSelection.call(void 0, peer.selection, (pos) => tr.mapPos(pos, -1), tr.before.doc);
89
+ const selection = peer.selection && _chunkZKVOS57Qcjs.mapSelection.call(void 0, peer.selection, (pos) => tr.mapPos(pos, -1), tr.before.doc);
57
90
  if (selection === peer.selection) return peer;
58
91
  moved = true;
59
92
  return { ...peer, selection };
@@ -64,18 +97,16 @@ var presencePlugin = {
64
97
 
65
98
  // src/extensions/presence/PresenceAvatars.tsx
66
99
  var _jsxruntime = require('react/jsx-runtime');
67
- var headBlock = (selection) => selection.kind === "node" ? selection.block : selection.kind === "blocks" ? selection.head : selection.head.block;
68
- var initials = (name) => name.trim().split(/\s+/).slice(0, 2).map((word) => _nullishCoalesce(_optionalChain([Array, 'access', _ => _.from, 'call', _2 => _2(word), 'access', _3 => _3[0], 'optionalAccess', _4 => _4.toUpperCase, 'call', _5 => _5()]), () => ( ""))).join("");
100
+ var initials = (name) => name.trim().split(/\s+/).slice(0, 2).map((word) => _nullishCoalesce(_optionalChain([Array, 'access', _2 => _2.from, 'call', _3 => _3(word), 'access', _4 => _4[0], 'optionalAccess', _5 => _5.toUpperCase, 'call', _6 => _6()]), () => ( ""))).join("");
69
101
  function groupsOf(state) {
70
102
  const byBlock = /* @__PURE__ */ new Map();
71
- for (const { client, name, color, selection } of _chunkPZ4GT5JOcjs.getPluginState.call(void 0, state, presenceKey)) {
103
+ for (const { client, name, color, selection } of _chunkZKVOS57Qcjs.getPluginState.call(void 0, state, presenceKey)) {
72
104
  if (selection === null) continue;
73
- const block = headBlock(selection);
105
+ const block = _chunkZKVOS57Qcjs.headBlockId.call(void 0, selection);
74
106
  byBlock.set(block, [..._nullishCoalesce(byBlock.get(block), () => ( [])), { client, name, color }]);
75
107
  }
76
108
  return [...byBlock];
77
109
  }
78
- var sameGroups = (a, b) => JSON.stringify(a) === JSON.stringify(b);
79
110
  function place(controller, root, group) {
80
111
  const shell = controller.blockElement(_nullishCoalesce(group.dataset.block, () => ( "")));
81
112
  group.style.visibility = shell === void 0 ? "hidden" : "";
@@ -84,28 +115,13 @@ function place(controller, root, group) {
84
115
  group.style.transform = `translateY(${top}px)`;
85
116
  }
86
117
  function PresenceAvatars({ controller, labels }) {
87
- const groups = _chunkGTTPVJSDcjs.useEditorState.call(void 0, controller, groupsOf, sameGroups);
118
+ const groups = _chunkP6KYXFZCcjs.useEditorState.call(void 0, controller, groupsOf, _chunk6V6GGBDKcjs.sameValue);
88
119
  const box = _react.useRef.call(void 0, null);
89
- _chunkGTTPVJSDcjs.useIsomorphicLayoutEffect.call(void 0, () => {
120
+ _chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
90
121
  const root = controller.root;
91
- const view = _optionalChain([root, 'optionalAccess', _6 => _6.ownerDocument, 'access', _7 => _7.defaultView]);
92
- if (!root || !view || box.current === null) return void 0;
122
+ if (!root || box.current === null) return void 0;
93
123
  const children = Array.from(box.current.children);
94
- const update = () => children.forEach((group) => place(controller, root, group));
95
- update();
96
- let frame = 0;
97
- const later = () => {
98
- view.cancelAnimationFrame(frame);
99
- frame = view.requestAnimationFrame(update);
100
- };
101
- const unsubscribe = controller.editor.subscribe(later);
102
- const observer = new ResizeObserver(later);
103
- observer.observe(root);
104
- return () => {
105
- view.cancelAnimationFrame(frame);
106
- unsubscribe();
107
- observer.disconnect();
108
- };
124
+ return followLayout(controller, root, () => children.forEach((group) => place(controller, root, group)));
109
125
  }, [controller, groups]);
110
126
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: box, className: "quoin-presence-avatars", children: groups.map(([block, people]) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
111
127
  "div",
@@ -130,22 +146,22 @@ function PresenceAvatars({ controller, labels }) {
130
146
 
131
147
  // src/extensions/presence/presence-decorations.ts
132
148
  function tintOf(state, { color, selection }) {
133
- if (_optionalChain([selection, 'optionalAccess', _8 => _8.kind]) !== "text") return [];
149
+ if (_optionalChain([selection, 'optionalAccess', _7 => _7.kind]) !== "text") return [];
134
150
  if (![selection.anchor, selection.head].every(({ block }) => state.doc.index.has(block))) return [];
135
151
  const attrs = { class: "quoin-presence-selection" };
136
152
  if (color !== void 0) attrs.style = `--quoin-presence:${color}`;
137
- return _chunkPZ4GT5JOcjs.markRanges.call(void 0, { ...state, selection }).map((range) => ({ kind: "inline", ...range, attrs }));
153
+ return _chunkZKVOS57Qcjs.markRanges.call(void 0, { ...state, selection }).map((range) => ({ kind: "inline", ...range, attrs }));
138
154
  }
139
155
  var drawn = /* @__PURE__ */ new WeakMap();
140
156
  function peerDecorations(state, peer) {
141
157
  const last = drawn.get(peer);
142
- if (_optionalChain([last, 'optionalAccess', _9 => _9.doc]) === state.doc) return last.decorations;
158
+ if (_optionalChain([last, 'optionalAccess', _8 => _8.doc]) === state.doc) return last.decorations;
143
159
  const decorations = tintOf(state, peer);
144
160
  drawn.set(peer, { doc: state.doc, decorations });
145
161
  return decorations;
146
162
  }
147
163
  function presenceDecorations(state) {
148
- return _chunkPZ4GT5JOcjs.getPluginState.call(void 0, state, presenceKey).flatMap((peer) => peerDecorations(state, peer));
164
+ return _chunkZKVOS57Qcjs.getPluginState.call(void 0, state, presenceKey).flatMap((peer) => peerDecorations(state, peer));
149
165
  }
150
166
 
151
167
  // src/extensions/presence/presence-labels.ts
@@ -174,7 +190,7 @@ function linkOf(editor) {
174
190
  function setActive(link, active) {
175
191
  if (link.active === active) return;
176
192
  link.active = active;
177
- _optionalChain([link, 'access', _10 => _10.session, 'optionalAccess', _11 => _11.activeChanged, 'call', _12 => _12()]);
193
+ _optionalChain([link, 'access', _9 => _9.session, 'optionalAccess', _10 => _10.activeChanged, 'call', _11 => _11()]);
178
194
  }
179
195
 
180
196
  // src/yjs/awareness.ts
@@ -183,7 +199,7 @@ function awarePos(shared, pos) {
183
199
  try {
184
200
  return {
185
201
  ...pos,
186
- rel: Y.relativePositionToJSON(_chunkE75EHRPAcjs.relative.call(void 0, shared.text, shared.layout, pos))
202
+ rel: Y.relativePositionToJSON(_chunkTLGX43P6cjs.relative.call(void 0, shared.text, shared.layout, pos))
187
203
  };
188
204
  } catch (e) {
189
205
  return pos;
@@ -200,30 +216,30 @@ function toAware(shared, selection) {
200
216
  const [anchor, head] = selection.kind === "node" ? [selection.block, selection.block] : [selection.anchor, selection.head];
201
217
  return { anchor: { block: anchor }, head: { block: head } };
202
218
  }
203
- var isRecord = (value) => typeof value === "object" && value !== null;
219
+ var blockOf = (doc, value) => typeof value.block === "string" && doc.index.has(value.block) ? value.block : null;
204
220
  function textPos(shared, doc, value) {
205
221
  if (shared !== null && value.rel !== void 0) {
206
222
  try {
207
- const found = _chunkE75EHRPAcjs.absolute.call(void 0, shared.text, shared.layout, Y.createRelativePositionFromJSON(value.rel));
223
+ const found = _chunkTLGX43P6cjs.absolute.call(void 0, shared.text, shared.layout, Y.createRelativePositionFromJSON(value.rel));
208
224
  if (found !== null) return found;
209
225
  } catch (e2) {
210
226
  }
211
227
  }
212
- const { block, region, offset } = value;
213
- const placed = typeof region === "string" && typeof offset === "number" && Number.isInteger(offset) && offset >= 0;
214
- return placed && typeof block === "string" && doc.index.has(block) ? { block, region, offset } : null;
228
+ const { region, offset } = value;
229
+ const block = blockOf(doc, value);
230
+ const placed = typeof region === "string" && Number.isInteger(offset) && offset >= 0;
231
+ return placed && block !== null ? { block, region, offset } : null;
215
232
  }
216
- var blockOf = (doc, value) => typeof value.block === "string" && doc.index.has(value.block) ? value.block : null;
217
233
  function fromAware(shared, doc, schema, value) {
218
- if (!isRecord(value) || !isRecord(value.anchor) || !isRecord(value.head)) return null;
234
+ if (!_chunk4SLJNZSMcjs.isRecord.call(void 0, value) || !_chunk4SLJNZSMcjs.isRecord.call(void 0, value.anchor) || !_chunk4SLJNZSMcjs.isRecord.call(void 0, value.head)) return null;
219
235
  const { anchor, head } = value;
220
236
  if (anchor.region === void 0 && head.region === void 0) {
221
237
  const [from2, to2] = [blockOf(doc, anchor), blockOf(doc, head)];
222
238
  if (from2 === null || to2 === null) return null;
223
- return from2 === to2 ? _chunkPZ4GT5JOcjs.nodeSelection.call(void 0, from2) : _chunkPZ4GT5JOcjs.blockRangeSelection.call(void 0, from2, to2);
239
+ return from2 === to2 ? _chunkZKVOS57Qcjs.nodeSelection.call(void 0, from2) : _chunkZKVOS57Qcjs.blockRangeSelection.call(void 0, from2, to2);
224
240
  }
225
241
  const [from, to] = [textPos(shared, doc, anchor), textPos(shared, doc, head)];
226
- return from === null || to === null ? null : _chunkPZ4GT5JOcjs.validateSelection.call(void 0, doc, schema, _chunkPZ4GT5JOcjs.textSelection.call(void 0, from, to));
242
+ return from === null || to === null ? null : _chunkZKVOS57Qcjs.validateSelection.call(void 0, doc, schema, _chunkZKVOS57Qcjs.textSelection.call(void 0, from, to));
227
243
  }
228
244
 
229
245
  // src/extensions/presence/presence-session.ts
@@ -231,10 +247,7 @@ var THROTTLE_MS = 50;
231
247
  var IDLE_MS = 2e3;
232
248
  var COLOR = /^(#[\da-f]{3,8}|[a-z]+|(rgba?|hsla?|hwb|lab|lch|oklab|oklch)\([\d\s.,%/+-]*\))$/i;
233
249
  var safeColor = (value) => typeof value === "string" && COLOR.test(value) ? value : void 0;
234
- var userOf = (state) => {
235
- const { user } = state;
236
- return typeof user === "object" && user !== null && typeof user.name === "string" ? user : null;
237
- };
250
+ var userOf = ({ user }) => _chunk4SLJNZSMcjs.isRecord.call(void 0, user) && typeof user.name === "string" ? user : null;
238
251
  var namedBy = /* @__PURE__ */ new WeakMap();
239
252
  function startPresence(editor, collaboration, awareness, link, sharedOf2) {
240
253
  const { doc, user } = collaboration;
@@ -243,7 +256,9 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
243
256
  let writing = false;
244
257
  let timer;
245
258
  let dirty = false;
259
+ const bound = sharedOf2() !== null;
246
260
  const put = (field, value) => {
261
+ if (!bound) return;
247
262
  writing = true;
248
263
  try {
249
264
  awareness.setLocalStateField(field, value);
@@ -265,7 +280,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
265
280
  timer ??= setTimeout(tick, 0);
266
281
  };
267
282
  const refresh = () => {
268
- const before = _chunkPZ4GT5JOcjs.getPluginState.call(void 0, editor.state, presenceKey);
283
+ const before = _chunkZKVOS57Qcjs.getPluginState.call(void 0, editor.state, presenceKey);
269
284
  const peers = [];
270
285
  const joined = [];
271
286
  const gone = new Set(seen.keys());
@@ -276,8 +291,8 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
276
291
  const key = JSON.stringify(_nullishCoalesce(state.selection, () => ( null)));
277
292
  let known = seen.get(client);
278
293
  if (known === void 0 && heard) joined.push({ client, name: found.name });
279
- if (_optionalChain([known, 'optionalAccess', _13 => _13.key]) !== key) {
280
- clearTimeout(_optionalChain([known, 'optionalAccess', _14 => _14.timer]));
294
+ if (_optionalChain([known, 'optionalAccess', _12 => _12.key]) !== key) {
295
+ clearTimeout(_optionalChain([known, 'optionalAccess', _13 => _13.timer]));
281
296
  const fresh = { name: found.name, key, idle: false };
282
297
  fresh.timer = setTimeout(() => {
283
298
  fresh.idle = true;
@@ -299,8 +314,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
299
314
  for (const listener of [...link.listeners]) listener({ joined, left });
300
315
  heard = true;
301
316
  if (samePeers(peers, before)) return;
302
- const tr = editor.createTransaction().setOrigin("remote").setMeta("addToHistory", false);
303
- editor.dispatch(tr.setMeta(PRESENCE, peers));
317
+ editor.dispatch(_chunkTLGX43P6cjs.sharedChange.call(void 0, editor, []).setMeta(PRESENCE, peers));
304
318
  };
305
319
  const changed = () => {
306
320
  if (!writing) refresh();
@@ -309,7 +323,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
309
323
  if (!transaction.local && seen.size > 0) refresh();
310
324
  };
311
325
  const stopEditor = editor.subscribe((state, tr) => {
312
- if (tr !== null && tr.origin !== "remote" && !_chunkPZ4GT5JOcjs.sameSelection.call(void 0, tr.before.selection, state.selection)) schedule();
326
+ if (tr !== null && tr.origin !== "remote" && !_chunkZKVOS57Qcjs.sameSelection.call(void 0, tr.before.selection, state.selection)) schedule();
313
327
  });
314
328
  put("user", { name: user.name, color: user.color });
315
329
  write(null);
@@ -336,7 +350,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
336
350
  });
337
351
  }
338
352
  };
339
- namedBy.set(awareness, session);
353
+ if (bound) namedBy.set(awareness, session);
340
354
  return session;
341
355
  }
342
356
 
@@ -345,7 +359,7 @@ function startPresence(editor, collaboration, awareness, link, sharedOf2) {
345
359
 
346
360
  // src/extensions/presence/place-caret.ts
347
361
  function caretBox(host, offset) {
348
- const map = _chunkGTTPVJSDcjs.domMapOf.call(void 0, host);
362
+ const map = _chunkP6KYXFZCcjs.domMapOf.call(void 0, host);
349
363
  if (!map || !host.isConnected) return null;
350
364
  const doc = host.ownerDocument;
351
365
  const spans = [
@@ -368,18 +382,17 @@ function caretBox(host, offset) {
368
382
  const box = host.getBoundingClientRect();
369
383
  return new DOMRect(box.left, box.top, 0, box.height);
370
384
  }
371
- function inside(box, clip) {
372
- if (clip === null) return true;
373
- const area = clip.getBoundingClientRect();
385
+ function inside(box, area) {
374
386
  return box.left >= area.left && box.left <= area.right && box.bottom > area.top && box.top < area.bottom;
375
387
  }
376
388
  function placeCaret(controller, root, caret, observer) {
377
389
  const client = Number(caret.dataset.client);
378
- const peer = _chunkPZ4GT5JOcjs.getPluginState.call(void 0, controller.editor.state, presenceKey).find((one) => one.client === client);
379
- const head = _optionalChain([peer, 'optionalAccess', _15 => _15.selection, 'optionalAccess', _16 => _16.kind]) === "text" ? peer.selection.head : null;
390
+ const peer = _chunkZKVOS57Qcjs.getPluginState.call(void 0, controller.editor.state, presenceKey).find((one) => one.client === client);
391
+ const head = _optionalChain([peer, 'optionalAccess', _14 => _14.selection, 'optionalAccess', _15 => _15.kind]) === "text" ? peer.selection.head : null;
380
392
  const host = head && controller.registry.get(head.block, head.region);
381
393
  const box = host ? caretBox(host, head.offset) : null;
382
- const shown = box !== null && inside(box, _chunkQAW5NH6Scjs.clipOf.call(void 0, host, root));
394
+ const areas = host ? _chunkLE5XMIFJcjs.clipBoxes.call(void 0, host, root) : [];
395
+ const shown = box !== null && areas.every((area) => inside(box, area));
383
396
  caret.style.visibility = shown ? "" : "hidden";
384
397
  if (!shown) return;
385
398
  observer.observe(host);
@@ -389,42 +402,23 @@ function placeCaret(controller, root, caret, observer) {
389
402
  const top = (box.top - origin.top) / scale - root.clientTop + root.scrollTop;
390
403
  caret.style.transform = `translate(${left}px, ${top}px)`;
391
404
  caret.style.height = `${box.height / scale}px`;
405
+ const cut = (past) => `${Math.max(...areas.map(past)) / scale + 1}px`;
406
+ caret.style.clipPath = areas[0] ? `inset(-99px ${cut((a) => box.left - a.right)} -99px ${cut((a) => a.left - box.left)})` : "";
392
407
  }
393
408
 
394
409
  // src/extensions/presence/RemoteCarets.tsx
395
410
 
396
- var shownOf = (state) => _chunkPZ4GT5JOcjs.getPluginState.call(void 0, state, presenceKey).flatMap(
397
- ({ client, name, color, idle, selection }) => _optionalChain([selection, 'optionalAccess', _17 => _17.kind]) === "text" ? [{ client, name, color, idle }] : []
411
+ var shownOf = (state) => _chunkZKVOS57Qcjs.getPluginState.call(void 0, state, presenceKey).flatMap(
412
+ ({ client, name, color, idle, selection }) => _optionalChain([selection, 'optionalAccess', _16 => _16.kind]) === "text" ? [{ client, name, color, idle }] : []
398
413
  );
399
- var sameShown = (a, b) => JSON.stringify(a) === JSON.stringify(b);
400
414
  function RemoteCarets({ controller, labels }) {
401
- const shown = _chunkGTTPVJSDcjs.useEditorState.call(void 0, controller, shownOf, sameShown);
415
+ const shown = _chunkP6KYXFZCcjs.useEditorState.call(void 0, controller, shownOf, _chunk6V6GGBDKcjs.sameValue);
402
416
  const box = _react.useRef.call(void 0, null);
403
- _chunkGTTPVJSDcjs.useIsomorphicLayoutEffect.call(void 0, () => {
417
+ _chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
404
418
  const root = controller.root;
405
- const view = _optionalChain([root, 'optionalAccess', _18 => _18.ownerDocument, 'access', _19 => _19.defaultView]);
406
- if (!root || !view || box.current === null) return void 0;
419
+ if (!root || box.current === null) return void 0;
407
420
  const carets = Array.from(box.current.children);
408
- let frame = 0;
409
- const later = () => {
410
- view.cancelAnimationFrame(frame);
411
- frame = view.requestAnimationFrame(update);
412
- };
413
- const observer = new ResizeObserver(later);
414
- const update = () => carets.forEach((caret) => placeCaret(controller, root, caret, observer));
415
- update();
416
- observer.observe(root);
417
- const unsubscribe = controller.editor.subscribe(later);
418
- const fonts = root.ownerDocument.fonts;
419
- root.addEventListener("scroll", later, { capture: true, passive: true });
420
- _optionalChain([fonts, 'optionalAccess', _20 => _20.addEventListener, 'call', _21 => _21("loadingdone", later)]);
421
- return () => {
422
- view.cancelAnimationFrame(frame);
423
- unsubscribe();
424
- observer.disconnect();
425
- root.removeEventListener("scroll", later, { capture: true });
426
- _optionalChain([fonts, 'optionalAccess', _22 => _22.removeEventListener, 'call', _23 => _23("loadingdone", later)]);
427
- };
421
+ return followLayout(controller, root, (observer) => carets.forEach((caret) => placeCaret(controller, root, caret, observer)));
428
422
  }, [controller, shown]);
429
423
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: box, className: "quoin-presence-carets", "aria-hidden": "true", children: shown.map(({ client, name, color, idle }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
430
424
  "div",
@@ -443,11 +437,11 @@ function RemoteCarets({ controller, labels }) {
443
437
 
444
438
  function usePresenceActivity(controller, link) {
445
439
  _react.useEffect.call(void 0, () => {
446
- const doc = _optionalChain([controller, 'access', _24 => _24.root, 'optionalAccess', _25 => _25.ownerDocument]);
440
+ const doc = _optionalChain([controller, 'access', _17 => _17.root, 'optionalAccess', _18 => _18.ownerDocument]);
447
441
  if (!doc) return void 0;
448
- let focused = _chunkWXMYDXPNcjs.ownsNode.call(void 0, controller, doc.activeElement);
442
+ let focused = _chunk73653CJ4cjs.ownsNode.call(void 0, controller, doc.activeElement);
449
443
  const update = () => setActive(link, focused && !controller.readOnly);
450
- const stopFocus = _chunkWXMYDXPNcjs.watchCanvasFocus.call(void 0, controller, doc, (inside2) => {
444
+ const stopFocus = _chunk73653CJ4cjs.watchCanvasFocus.call(void 0, controller, doc, (inside2) => {
451
445
  focused = inside2;
452
446
  update();
453
447
  });
@@ -489,7 +483,7 @@ function createPresenceAnnouncer(announce, labels) {
489
483
  const known = people.get(client);
490
484
  const wait = known === void 0 ? 0 : known.at + PRESENCE_ANNOUNCEMENT_MS - Date.now();
491
485
  if (known === void 0 || wait <= 0) {
492
- clearTimeout(_optionalChain([known, 'optionalAccess', _26 => _26.later]));
486
+ clearTimeout(_optionalChain([known, 'optionalAccess', _19 => _19.later]));
493
487
  const fresh = _nullishCoalesce(known, () => ( { name, said: kind, at: 0 }));
494
488
  people.set(client, fresh);
495
489
  return say(fresh, kind);
@@ -539,7 +533,7 @@ function presenceExtension(collaboration, options = {}) {
539
533
  ] });
540
534
  }
541
535
  const ui = { overlays: [Overlay] };
542
- return _chunkPZ4GT5JOcjs.defineExtension.call(void 0, {
536
+ return _chunkZKVOS57Qcjs.defineExtension.call(void 0, {
543
537
  name: "presence",
544
538
  // Below the default, so the collaboration it reads has connected before it starts.
545
539
  priority: 99,
@@ -547,8 +541,8 @@ function presenceExtension(collaboration, options = {}) {
547
541
  decorations: presenceDecorations,
548
542
  onMount(editor) {
549
543
  const link = linkOf(editor);
550
- if (_chunkE75EHRPAcjs.sharedOf.call(void 0, collaboration, editor) === null) _chunkOMOBMXD5cjs.devWarn.call(void 0, UNBOUND);
551
- const session = startPresence(editor, collaboration, awareness, link, () => _chunkE75EHRPAcjs.sharedOf.call(void 0, collaboration, editor));
544
+ if (_chunkTLGX43P6cjs.sharedOf.call(void 0, collaboration, editor) === null) _chunkEH5KXQXYcjs.devWarn.call(void 0, UNBOUND);
545
+ const session = startPresence(editor, collaboration, awareness, link, () => _chunkTLGX43P6cjs.sharedOf.call(void 0, collaboration, editor));
552
546
  link.session = session;
553
547
  return () => {
554
548
  session.stop();