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