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.
- package/CHANGELOG.md +58 -0
- package/dist/ai.cjs +135 -94
- package/dist/ai.cjs.map +1 -1
- package/dist/ai.d.cts +1 -1
- package/dist/ai.d.ts +1 -1
- package/dist/ai.js +62 -21
- package/dist/ai.js.map +1 -1
- package/dist/catalogue.cjs +25 -25
- package/dist/catalogue.d.cts +6 -6
- package/dist/catalogue.d.ts +6 -6
- package/dist/catalogue.js +17 -17
- package/dist/{chunk-ND5XJVK2.cjs → chunk-4SLJNZSM.cjs} +27 -23
- package/dist/chunk-4SLJNZSM.cjs.map +1 -0
- package/dist/{chunk-LCQSG4M6.js → chunk-4XFXB37X.js} +22 -18
- package/dist/chunk-4XFXB37X.js.map +1 -0
- package/dist/{chunk-AEJXZBVR.cjs → chunk-5MAYUGTE.cjs} +110 -103
- package/dist/chunk-5MAYUGTE.cjs.map +1 -0
- package/dist/{chunk-JDPTZUBW.js → chunk-623AOJM2.js} +4 -4
- package/dist/chunk-6NULZPVC.js +374 -0
- package/dist/chunk-6NULZPVC.js.map +1 -0
- package/dist/{chunk-2QCRZ7OL.cjs → chunk-6V6GGBDK.cjs} +12 -11
- package/dist/{chunk-2QCRZ7OL.cjs.map → chunk-6V6GGBDK.cjs.map} +1 -1
- package/dist/{chunk-WXMYDXPN.cjs → chunk-73653CJ4.cjs} +4 -3
- package/dist/chunk-73653CJ4.cjs.map +1 -0
- package/dist/{chunk-47MLKSI2.js → chunk-ADSJ42DO.js} +6 -6
- package/dist/{chunk-PWUEPDA3.cjs → chunk-AUOEM3SF.cjs} +44 -44
- package/dist/{chunk-PWUEPDA3.cjs.map → chunk-AUOEM3SF.cjs.map} +1 -1
- package/dist/{chunk-WQHV3MRE.cjs → chunk-BQANU5BH.cjs} +12 -12
- package/dist/{chunk-WQHV3MRE.cjs.map → chunk-BQANU5BH.cjs.map} +1 -1
- package/dist/{chunk-KXOBZGQO.js → chunk-C23RQVRK.js} +21 -14
- package/dist/chunk-C23RQVRK.js.map +1 -0
- package/dist/{chunk-2VDK27IF.cjs → chunk-CW3AFJBR.cjs} +312 -342
- package/dist/chunk-CW3AFJBR.cjs.map +1 -0
- package/dist/{chunk-MQ2XQ4MX.js → chunk-DUE3HCZD.js} +6 -6
- package/dist/chunk-DUE3HCZD.js.map +1 -0
- package/dist/{chunk-OMOBMXD5.cjs → chunk-EH5KXQXY.cjs} +7 -2
- package/dist/chunk-EH5KXQXY.cjs.map +1 -0
- package/dist/{chunk-ZS2WA357.js → chunk-EPARJI4V.js} +147 -129
- package/dist/chunk-EPARJI4V.js.map +1 -0
- package/dist/{chunk-HZSSEYJS.cjs → chunk-FDRUAL3Z.cjs} +30 -30
- package/dist/{chunk-HZSSEYJS.cjs.map → chunk-FDRUAL3Z.cjs.map} +1 -1
- package/dist/{chunk-T7SW6OWV.js → chunk-IQBMAE3F.js} +5 -5
- package/dist/{chunk-RUDWMKYX.js → chunk-JHQUHFLX.js} +8 -8
- package/dist/{chunk-HELJTLNC.cjs → chunk-KUYZMSMF.cjs} +12 -12
- package/dist/chunk-KUYZMSMF.cjs.map +1 -0
- package/dist/chunk-LE5XMIFJ.cjs +14 -0
- package/dist/chunk-LE5XMIFJ.cjs.map +1 -0
- package/dist/{chunk-EL2OEJQC.cjs → chunk-LLTEGXWZ.cjs} +56 -56
- package/dist/{chunk-EL2OEJQC.cjs.map → chunk-LLTEGXWZ.cjs.map} +1 -1
- package/dist/chunk-MQUCCSWG.js +14 -0
- package/dist/chunk-MQUCCSWG.js.map +1 -0
- package/dist/{chunk-NNDYYEW5.js → chunk-N4FGA3H4.js} +5 -5
- package/dist/{chunk-ZHOSSWUM.js → chunk-NEZJ7ZP5.js} +4 -3
- package/dist/chunk-NEZJ7ZP5.js.map +1 -0
- package/dist/{chunk-XEBWC7ZL.js → chunk-O4Z2WMFF.js} +7 -2
- package/dist/chunk-O4Z2WMFF.js.map +1 -0
- package/dist/{chunk-HJIQT3S5.js → chunk-OBMBSU2S.js} +100 -84
- package/dist/chunk-OBMBSU2S.js.map +1 -0
- package/dist/{chunk-KAVU6T6J.js → chunk-OSHZQR3W.js} +5 -5
- package/dist/{chunk-GTTPVJSD.cjs → chunk-P6KYXFZC.cjs} +265 -247
- package/dist/chunk-P6KYXFZC.cjs.map +1 -0
- package/dist/{chunk-CDELOHDY.cjs → chunk-R2BLBV43.cjs} +23 -23
- package/dist/{chunk-CDELOHDY.cjs.map → chunk-R2BLBV43.cjs.map} +1 -1
- package/dist/{chunk-NOKWNK2O.js → chunk-RJRX34BZ.js} +3 -2
- package/dist/{chunk-ZGZEJCRV.js → chunk-T43RZTUT.js} +166 -196
- package/dist/chunk-T43RZTUT.js.map +1 -0
- package/dist/chunk-TLGX43P6.cjs +374 -0
- package/dist/chunk-TLGX43P6.cjs.map +1 -0
- package/dist/{chunk-POBM7MGR.js → chunk-U3LOLYAU.js} +2 -2
- package/dist/{chunk-RDG4VI6E.cjs → chunk-UEKXVCKC.cjs} +103 -93
- package/dist/chunk-UEKXVCKC.cjs.map +1 -0
- package/dist/{chunk-PMWCQSQX.js → chunk-VCLL5C7J.js} +5 -5
- package/dist/{chunk-SG37UBDO.js → chunk-VRS6WCEK.js} +20 -10
- package/dist/chunk-VRS6WCEK.js.map +1 -0
- package/dist/{chunk-ZC24WB7Y.cjs → chunk-WEYDDIBQ.cjs} +14 -14
- package/dist/{chunk-ZC24WB7Y.cjs.map → chunk-WEYDDIBQ.cjs.map} +1 -1
- package/dist/{chunk-5DNCCN6X.cjs → chunk-X4HDKFW5.cjs} +27 -27
- package/dist/{chunk-5DNCCN6X.cjs.map → chunk-X4HDKFW5.cjs.map} +1 -1
- package/dist/{chunk-SLVDAHHK.cjs → chunk-X4P4TQXH.cjs} +5 -5
- package/dist/{chunk-SLVDAHHK.cjs.map → chunk-X4P4TQXH.cjs.map} +1 -1
- package/dist/{chunk-GLLXHMH2.cjs → chunk-XA3UEJIW.cjs} +3 -3
- package/dist/{chunk-GLLXHMH2.cjs.map → chunk-XA3UEJIW.cjs.map} +1 -1
- package/dist/{chunk-K574XHMM.js → chunk-YBMUEEM5.js} +2 -2
- package/dist/{chunk-PZ4GT5JO.cjs → chunk-ZKVOS57Q.cjs} +316 -300
- package/dist/chunk-ZKVOS57Q.cjs.map +1 -0
- package/dist/comments.cjs +113 -98
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.d.cts +6 -1
- package/dist/comments.d.ts +6 -1
- package/dist/comments.js +32 -17
- package/dist/comments.js.map +1 -1
- package/dist/diff.cjs +44 -40
- package/dist/diff.cjs.map +1 -1
- package/dist/diff.js +17 -13
- package/dist/diff.js.map +1 -1
- package/dist/docx.cjs +60 -40
- package/dist/docx.cjs.map +1 -1
- package/dist/docx.d.cts +6 -0
- package/dist/docx.d.ts +6 -0
- package/dist/docx.js +32 -12
- package/dist/docx.js.map +1 -1
- package/dist/embed.cjs +9 -9
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.js +8 -8
- package/dist/{emoji-extension-DpQ43HjE.d.ts → emoji-extension-CmPlRssm.d.ts} +1 -1
- package/dist/{emoji-extension-C12gDPm6.d.cts → emoji-extension-zJ6F7hW8.d.cts} +1 -1
- package/dist/emoji.cjs +8 -8
- package/dist/emoji.d.cts +3 -3
- package/dist/emoji.d.ts +3 -3
- package/dist/emoji.js +7 -7
- package/dist/engine.cjs +4 -4
- package/dist/engine.d.cts +2 -2
- package/dist/engine.d.ts +2 -2
- package/dist/engine.js +3 -3
- package/dist/{find-extension-_sbZEt3R.d.cts → find-extension-BcRyE9K4.d.cts} +1 -1
- package/dist/{find-extension-DKqLLSuP.d.ts → find-extension-CmFehyul.d.ts} +1 -1
- package/dist/find.cjs +8 -8
- package/dist/find.d.cts +2 -2
- package/dist/find.d.ts +2 -2
- package/dist/find.js +7 -7
- package/dist/headless.cjs +5 -5
- package/dist/headless.d.cts +4 -4
- package/dist/headless.d.ts +4 -4
- package/dist/headless.js +4 -4
- package/dist/{index-CgD72kHB.d.cts → index-CFPmCee4.d.cts} +5 -2
- package/dist/{index-DNYbTK3w.d.ts → index-DiCGV60d.d.ts} +5 -2
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/math.cjs +10 -10
- package/dist/math.d.cts +1 -1
- package/dist/math.d.ts +1 -1
- package/dist/math.js +9 -9
- package/dist/mention.cjs +10 -10
- package/dist/mention.d.cts +1 -1
- package/dist/mention.d.ts +1 -1
- package/dist/mention.js +9 -9
- package/dist/presence.cjs +98 -104
- package/dist/presence.cjs.map +1 -1
- package/dist/presence.d.cts +2 -2
- package/dist/presence.d.ts +2 -2
- package/dist/presence.js +66 -72
- package/dist/presence.js.map +1 -1
- package/dist/{stats-extension-Bly88uio.d.ts → stats-extension-DisOEbbI.d.ts} +1 -1
- package/dist/{stats-extension-CJPijvUb.d.cts → stats-extension-Dt1lgP3m.d.cts} +1 -1
- package/dist/stats.cjs +9 -9
- package/dist/stats.d.cts +3 -3
- package/dist/stats.d.ts +3 -3
- package/dist/stats.js +8 -8
- package/dist/styles.css +1 -1
- package/dist/{table-extension-Dzf4k6hI.d.ts → table-extension-BTMJnT7J.d.ts} +1 -1
- package/dist/{table-extension-BTLxFy2S.d.cts → table-extension-DxZz3jqp.d.cts} +1 -1
- package/dist/table.cjs +8 -8
- package/dist/table.d.cts +2 -2
- package/dist/table.d.ts +2 -2
- package/dist/table.js +7 -7
- package/dist/{toc-extension-DWm5alVj.d.ts → toc-extension-CR9U-l6j.d.ts} +1 -1
- package/dist/{toc-extension-B3-s6h2x.d.cts → toc-extension-DGHywOBv.d.cts} +1 -1
- package/dist/toc.cjs +8 -8
- package/dist/toc.d.cts +2 -2
- package/dist/toc.d.ts +2 -2
- package/dist/toc.js +7 -7
- package/dist/{types-a1CRBlEh.d.ts → types-C6_QkXzy.d.ts} +1 -9
- package/dist/{types-Cz7XJLaK.d.cts → types-CJ7Gq3GX.d.cts} +1 -9
- package/dist/{view-controller-DSHw0ltQ.d.cts → view-controller-BD1KwYfE.d.cts} +6 -19
- package/dist/{view-controller-UbpzblGl.d.ts → view-controller-y4cb60ue.d.ts} +6 -19
- package/dist/view.cjs +6 -6
- package/dist/view.js +3 -3
- package/dist/yjs.cjs +302 -412
- package/dist/yjs.cjs.map +1 -1
- package/dist/yjs.d.cts +3 -3
- package/dist/yjs.d.ts +3 -3
- package/dist/yjs.js +211 -321
- package/dist/yjs.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2VDK27IF.cjs.map +0 -1
- package/dist/chunk-AEJXZBVR.cjs.map +0 -1
- package/dist/chunk-E75EHRPA.cjs +0 -175
- package/dist/chunk-E75EHRPA.cjs.map +0 -1
- package/dist/chunk-GTTPVJSD.cjs.map +0 -1
- package/dist/chunk-HELJTLNC.cjs.map +0 -1
- package/dist/chunk-HJIQT3S5.js.map +0 -1
- package/dist/chunk-JEIFJHEI.js +0 -14
- package/dist/chunk-JEIFJHEI.js.map +0 -1
- package/dist/chunk-KXOBZGQO.js.map +0 -1
- package/dist/chunk-LCQSG4M6.js.map +0 -1
- package/dist/chunk-MQ2XQ4MX.js.map +0 -1
- package/dist/chunk-ND5XJVK2.cjs.map +0 -1
- package/dist/chunk-OMOBMXD5.cjs.map +0 -1
- package/dist/chunk-PZ4GT5JO.cjs.map +0 -1
- package/dist/chunk-QAW5NH6S.cjs +0 -14
- package/dist/chunk-QAW5NH6S.cjs.map +0 -1
- package/dist/chunk-RDG4VI6E.cjs.map +0 -1
- package/dist/chunk-SG37UBDO.js.map +0 -1
- package/dist/chunk-TC4DARU2.js +0 -175
- package/dist/chunk-TC4DARU2.js.map +0 -1
- package/dist/chunk-WXMYDXPN.cjs.map +0 -1
- package/dist/chunk-XEBWC7ZL.js.map +0 -1
- package/dist/chunk-ZGZEJCRV.js.map +0 -1
- package/dist/chunk-ZHOSSWUM.js.map +0 -1
- package/dist/chunk-ZS2WA357.js.map +0 -1
- /package/dist/{chunk-JDPTZUBW.js.map → chunk-623AOJM2.js.map} +0 -0
- /package/dist/{chunk-47MLKSI2.js.map → chunk-ADSJ42DO.js.map} +0 -0
- /package/dist/{chunk-T7SW6OWV.js.map → chunk-IQBMAE3F.js.map} +0 -0
- /package/dist/{chunk-RUDWMKYX.js.map → chunk-JHQUHFLX.js.map} +0 -0
- /package/dist/{chunk-NNDYYEW5.js.map → chunk-N4FGA3H4.js.map} +0 -0
- /package/dist/{chunk-KAVU6T6J.js.map → chunk-OSHZQR3W.js.map} +0 -0
- /package/dist/{chunk-NOKWNK2O.js.map → chunk-RJRX34BZ.js.map} +0 -0
- /package/dist/{chunk-POBM7MGR.js.map → chunk-U3LOLYAU.js.map} +0 -0
- /package/dist/{chunk-PMWCQSQX.js.map → chunk-VCLL5C7J.js.map} +0 -0
- /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-
|
|
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-
|
|
31
|
+
} from "./chunk-EPARJI4V.js";
|
|
32
32
|
import {
|
|
33
33
|
blockByType,
|
|
34
34
|
defineBlock,
|
|
35
35
|
paletteBlocks
|
|
36
|
-
} from "./chunk-
|
|
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-
|
|
80
|
+
} from "./chunk-OBMBSU2S.js";
|
|
81
81
|
import {
|
|
82
82
|
diffBlocks,
|
|
83
83
|
diffInline
|
|
84
|
-
} from "./chunk-
|
|
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-
|
|
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
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
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 =
|
|
17
|
+
exports.englishMathLabels = _chunkLLTEGXWZcjs.englishMathLabels; exports.mathExtension = _chunkLLTEGXWZcjs.mathExtension;
|
|
18
18
|
//# sourceMappingURL=math.cjs.map
|
package/dist/math.d.cts
CHANGED
package/dist/math.d.ts
CHANGED
package/dist/math.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
englishMathLabels,
|
|
4
4
|
mathExtension
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
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
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
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 =
|
|
17
|
+
exports.englishMentionLabels = _chunkX4HDKFW5cjs.englishMentionLabels; exports.mentionExtension = _chunkX4HDKFW5cjs.mentionExtension;
|
|
18
18
|
//# sourceMappingURL=mention.cjs.map
|
package/dist/mention.d.cts
CHANGED
package/dist/mention.d.ts
CHANGED
package/dist/mention.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
englishMentionLabels,
|
|
4
4
|
mentionExtension
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
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
|
|
4
|
+
var _chunkLE5XMIFJcjs = require('./chunk-LE5XMIFJ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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 =
|
|
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 &&
|
|
45
|
-
var samePeers = (a, b) =>
|
|
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 &&
|
|
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
|
|
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
|
|
103
|
+
for (const { client, name, color, selection } of _chunkZKVOS57Qcjs.getPluginState.call(void 0, state, presenceKey)) {
|
|
72
104
|
if (selection === null) continue;
|
|
73
|
-
const block =
|
|
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 =
|
|
118
|
+
const groups = _chunkP6KYXFZCcjs.useEditorState.call(void 0, controller, groupsOf, _chunk6V6GGBDKcjs.sameValue);
|
|
88
119
|
const box = _react.useRef.call(void 0, null);
|
|
89
|
-
|
|
120
|
+
_chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
90
121
|
const root = controller.root;
|
|
91
|
-
|
|
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
|
-
|
|
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',
|
|
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
|
|
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',
|
|
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
|
|
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',
|
|
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(
|
|
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
|
|
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 =
|
|
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 {
|
|
213
|
-
const
|
|
214
|
-
|
|
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 ?
|
|
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 :
|
|
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 = (
|
|
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 =
|
|
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',
|
|
280
|
-
clearTimeout(_optionalChain([known, 'optionalAccess',
|
|
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
|
-
|
|
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" && !
|
|
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 =
|
|
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,
|
|
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 =
|
|
379
|
-
const head = _optionalChain([peer, 'optionalAccess',
|
|
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
|
|
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) =>
|
|
397
|
-
({ client, name, color, idle, selection }) => _optionalChain([selection, 'optionalAccess',
|
|
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 =
|
|
415
|
+
const shown = _chunkP6KYXFZCcjs.useEditorState.call(void 0, controller, shownOf, _chunk6V6GGBDKcjs.sameValue);
|
|
402
416
|
const box = _react.useRef.call(void 0, null);
|
|
403
|
-
|
|
417
|
+
_chunkP6KYXFZCcjs.useIsomorphicLayoutEffect.call(void 0, () => {
|
|
404
418
|
const root = controller.root;
|
|
405
|
-
|
|
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
|
-
|
|
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',
|
|
440
|
+
const doc = _optionalChain([controller, 'access', _17 => _17.root, 'optionalAccess', _18 => _18.ownerDocument]);
|
|
447
441
|
if (!doc) return void 0;
|
|
448
|
-
let focused =
|
|
442
|
+
let focused = _chunk73653CJ4cjs.ownsNode.call(void 0, controller, doc.activeElement);
|
|
449
443
|
const update = () => setActive(link, focused && !controller.readOnly);
|
|
450
|
-
const stopFocus =
|
|
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',
|
|
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
|
|
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 (
|
|
551
|
-
const session = startPresence(editor, collaboration, awareness, link, () =>
|
|
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();
|