@commentkit/comment-kit 0.7.4 → 0.7.6
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 +26 -0
- package/README.md +3 -3
- package/SECURITY.md +1 -1
- package/dist/angular.es.js +2 -2
- package/dist/comment-kit.es.js +3 -3
- package/dist/demo.es.js +24 -15
- package/dist/headless.es.js +2 -2
- package/dist/preact.es.js +2 -2
- package/dist/qwik.qwik.mjs +2 -2
- package/dist/react.es.js +2 -2
- package/dist/shared/ShadowRootContext-DD6a0QaI.js +11 -0
- package/dist/shared/annotation-toolbar-RSrb0Nku.js +1086 -0
- package/dist/shared/{attachment-refresh-DmVkfPtl.js → attachment-refresh-CSTYwRW-.js} +3 -3
- package/dist/shared/{button-By0hGrJK.js → button-D4GHW6oZ.js} +133 -164
- package/dist/shared/{button-group-C285iSkZ.js → button-group-BVR7iT-S.js} +13 -13
- package/dist/shared/{comment-drawing-canvas-zIPS1dnW.js → comment-drawing-canvas-DbuXP54N.js} +2 -2
- package/dist/shared/{comment-icon-4SQd3nlz.js → comment-icon-D8JTCEJ7.js} +109 -110
- package/dist/shared/{comment-image-lightbox-CdMNf0_y.js → comment-image-lightbox-zlIGEVA-.js} +7 -7
- package/dist/shared/{comment-images-content-DqeqmQnb.js → comment-images-content-aYbJb79_.js} +38 -38
- package/dist/shared/{comment-kit-core-C-0JJS2i.js → comment-kit-core-B0k7XsMz.js} +742 -746
- package/dist/shared/{comment-kit-ui-CBaz7L3u.js → comment-kit-ui-BXLJcZYQ.js} +5310 -5718
- package/dist/shared/{comment-screenshot-annotator-CuYmKafz.js → comment-screenshot-annotator-ChWwYJzO.js} +2 -2
- package/dist/shared/{comment-screenshot-overlay-Dw81osel.js → comment-screenshot-overlay-Bufg3rHz.js} +6 -6
- package/dist/shared/{dev-export-panel-D08M2LKD.js → dev-export-panel-DAZenvgD.js} +6 -6
- package/dist/shared/{dev-grab-BJLZZ2xU.js → dev-grab-O8q25zar.js} +48 -47
- package/dist/shared/dist-D9A5k-N4.js +617 -0
- package/dist/shared/{element-selector-Biyn2cpR.js → element-selector-CYkwzfEr.js} +349 -347
- package/dist/shared/input-UPtAj0M6.js +111 -0
- package/dist/shared/{mount-ui-DXdL3p9b.js → mount-ui-BKaWBhKq.js} +4 -4
- package/dist/shared/{pusher-D4M5K6Dk.js → pusher-BUaiCkDJ.js} +1 -1
- package/dist/shared/{realtime-BTqYEy8s.js → realtime-C0Z8dXXH.js} +41 -28
- package/dist/shared/{realtime-recovery-BSVMwsXJ.js → realtime-recovery-BjlV-ewc.js} +57 -30
- package/dist/shared/screenshot-B-ZfFItT.js +199 -0
- package/dist/shared/{separator-aphZiRoJ.js → separator-UhJb0Row.js} +1222 -1288
- package/dist/shared/{shadow-root-C58Ap5Nu.js → shadow-root-Cd3SLHyj.js} +3 -5
- package/dist/shared/{token-session-D0Y_HZw0.js → token-session-DplW5QDx.js} +2 -2
- package/dist/shared/useLabelableId-8n0QmH8N.js +154 -0
- package/dist/shared/{useRender-D1z_X_BY.js → useRender-Uxk1OPK-.js} +1 -1
- package/dist/shared/{useValueChanged-CrzfD8l-.js → useValueChanged-DKq5cMot.js} +13 -13
- package/dist/shared/{websocket-manager-BFKa95TO.js → websocket-manager-798cRDyL.js} +2 -2
- package/dist/solid.es.js +2 -2
- package/dist/svelte.es.js +2 -2
- package/dist/types/core/api-client.d.ts +19 -9
- package/dist/types/core/comment-kit-core.d.ts +8 -4
- package/dist/types/core/types.d.ts +49 -9
- package/dist/types/core/write-access.d.ts +2 -0
- package/dist/vue.es.js +2 -2
- package/docs/api-reference.md +30 -18
- package/package.json +1 -1
- package/dist/shared/ShadowRootContext-CjciYxVN.js +0 -13
- package/dist/shared/annotation-toolbar-CpPKy0oq.js +0 -1094
- package/dist/shared/dist-De294MVF.js +0 -623
package/dist/shared/{comment-images-content-DqeqmQnb.js → comment-images-content-aYbJb79_.js}
RENAMED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as r } from "./useRender-
|
|
3
|
-
import {
|
|
4
|
-
import { n as c, r as l, t as u } from "./attachment-refresh-
|
|
1
|
+
import { o as e, t, u as n } from "./button-D4GHW6oZ.js";
|
|
2
|
+
import { t as r } from "./useRender-Uxk1OPK-.js";
|
|
3
|
+
import { C as i, c as a, l as o, r as s } from "./comment-kit-ui-BXLJcZYQ.js";
|
|
4
|
+
import { n as c, r as l, t as u } from "./attachment-refresh-CSTYwRW-.js";
|
|
5
5
|
import * as d from "react";
|
|
6
6
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
7
|
-
var h = d.forwardRef(function({ ratio:
|
|
7
|
+
var h = d.forwardRef(function({ ratio: t, className: n, style: r, ...i }, a) {
|
|
8
8
|
return /* @__PURE__ */ p("div", {
|
|
9
9
|
ref: a,
|
|
10
10
|
"data-slot": "aspect-ratio",
|
|
11
|
-
className:
|
|
11
|
+
className: e("ck-aspect-ratio", n),
|
|
12
12
|
style: {
|
|
13
|
-
"--ratio":
|
|
13
|
+
"--ratio": t,
|
|
14
14
|
...r
|
|
15
15
|
},
|
|
16
16
|
...i
|
|
17
17
|
});
|
|
18
|
-
}), g = d.forwardRef(function({ className:
|
|
18
|
+
}), g = d.forwardRef(function({ className: t, state: n = "done", size: r = "default", orientation: i = "horizontal", ...a }, o) {
|
|
19
19
|
return /* @__PURE__ */ p("div", {
|
|
20
20
|
ref: o,
|
|
21
21
|
"data-slot": "attachment",
|
|
22
22
|
"data-state": n,
|
|
23
23
|
"data-size": r,
|
|
24
24
|
"data-orientation": i,
|
|
25
|
-
className:
|
|
25
|
+
className: e("ck-attachment", t),
|
|
26
26
|
...a
|
|
27
27
|
});
|
|
28
|
-
}), _ = d.forwardRef(function({ className:
|
|
28
|
+
}), _ = d.forwardRef(function({ className: t, variant: n = "icon", ...r }, i) {
|
|
29
29
|
return /* @__PURE__ */ p("div", {
|
|
30
30
|
ref: i,
|
|
31
31
|
"data-slot": "attachment-media",
|
|
32
32
|
"data-variant": n,
|
|
33
|
-
className:
|
|
33
|
+
className: e("ck-attachment-media", t),
|
|
34
34
|
...r
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
|
-
d.forwardRef(function({ className:
|
|
37
|
+
d.forwardRef(function({ className: t, ...n }, r) {
|
|
38
38
|
return s("attachment"), /* @__PURE__ */ p("div", {
|
|
39
39
|
ref: r,
|
|
40
40
|
"data-slot": "attachment-group",
|
|
41
|
-
className:
|
|
41
|
+
className: e("ck-attachment-group", t),
|
|
42
42
|
...n
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
-
var v = d.forwardRef(function({ className:
|
|
45
|
+
var v = d.forwardRef(function({ className: t, ...n }, r) {
|
|
46
46
|
return /* @__PURE__ */ p("div", {
|
|
47
47
|
ref: r,
|
|
48
48
|
"data-slot": "attachment-content",
|
|
49
|
-
className:
|
|
49
|
+
className: e("ck-attachment-content", t),
|
|
50
50
|
...n
|
|
51
51
|
});
|
|
52
|
-
}), y = d.forwardRef(function({ className:
|
|
52
|
+
}), y = d.forwardRef(function({ className: t, ...n }, r) {
|
|
53
53
|
return /* @__PURE__ */ p("span", {
|
|
54
54
|
ref: r,
|
|
55
55
|
"data-slot": "attachment-title",
|
|
56
|
-
className:
|
|
56
|
+
className: e("ck-attachment-title", t),
|
|
57
57
|
...n
|
|
58
58
|
});
|
|
59
|
-
}), b = d.forwardRef(function({ className:
|
|
59
|
+
}), b = d.forwardRef(function({ className: t, ...n }, r) {
|
|
60
60
|
return /* @__PURE__ */ p("span", {
|
|
61
61
|
ref: r,
|
|
62
62
|
"data-slot": "attachment-description",
|
|
63
|
-
className:
|
|
63
|
+
className: e("ck-attachment-description", t),
|
|
64
64
|
...n
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
|
-
d.forwardRef(function({ className:
|
|
67
|
+
d.forwardRef(function({ className: t, ...n }, r) {
|
|
68
68
|
return /* @__PURE__ */ p("div", {
|
|
69
69
|
ref: r,
|
|
70
70
|
"data-slot": "attachment-actions",
|
|
71
|
-
className:
|
|
71
|
+
className: e("ck-attachment-actions", t),
|
|
72
72
|
...n
|
|
73
73
|
});
|
|
74
|
-
}), d.forwardRef(function({ className: e, variant:
|
|
75
|
-
return /* @__PURE__ */ p(
|
|
74
|
+
}), d.forwardRef(function({ className: e, variant: n = "ghost", size: r = "icon-xs", ...i }, a) {
|
|
75
|
+
return /* @__PURE__ */ p(t, {
|
|
76
76
|
ref: a,
|
|
77
77
|
"data-slot": "attachment-action",
|
|
78
|
-
variant:
|
|
78
|
+
variant: n,
|
|
79
79
|
size: r,
|
|
80
80
|
className: e,
|
|
81
81
|
...i
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
|
-
var x = d.forwardRef(function({ className:
|
|
84
|
+
var x = d.forwardRef(function({ className: t, render: i, type: a, ...o }, s) {
|
|
85
85
|
return r({
|
|
86
86
|
defaultTagName: "button",
|
|
87
|
-
props:
|
|
87
|
+
props: n({
|
|
88
88
|
ref: s,
|
|
89
89
|
type: i ? a : a ?? "button",
|
|
90
|
-
className:
|
|
90
|
+
className: e("ck-attachment-trigger", t)
|
|
91
91
|
}, o),
|
|
92
92
|
render: i,
|
|
93
93
|
state: { slot: "attachment-trigger" }
|
|
94
94
|
});
|
|
95
|
-
}), S = () => import("./comment-image-lightbox-
|
|
95
|
+
}), S = () => import("./comment-image-lightbox-zlIGEVA-.js"), C = 3;
|
|
96
96
|
function w(e) {
|
|
97
97
|
return e.mimeType ? e.mimeType.startsWith("image/") : e.type === "screenshot" || e.type === "drawing" || e.thumbnail ? !0 : /^data:image\//i.test(e.url) || /\.(png|jpe?g|webp|gif|avif|svg)(?:[?#]|$)/i.test(e.filename ?? e.url);
|
|
98
98
|
}
|
|
@@ -109,8 +109,8 @@ function T(e) {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
var E = d.memo(function({ images: e }) {
|
|
112
|
-
let [t, n] = d.useState(!1), [r,
|
|
113
|
-
|
|
112
|
+
let [t, n] = d.useState(!1), [r, a] = d.useState(0), o = d.useRef(null), s = e.filter(w), c = e.filter((e) => !w(e)), l = s.length > C ? s.length - C : 0, u = s.slice(0, C), h = d.useCallback((e) => {
|
|
113
|
+
a(e), n(!0);
|
|
114
114
|
}, []);
|
|
115
115
|
return e.length === 0 ? null : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ m("div", {
|
|
116
116
|
className: "ck-comment-images",
|
|
@@ -125,7 +125,7 @@ var E = d.memo(function({ images: e }) {
|
|
|
125
125
|
o.current = e, h(t);
|
|
126
126
|
}
|
|
127
127
|
}, e.id)), c.map((e) => /* @__PURE__ */ p(O, { file: e }, e.id))]
|
|
128
|
-
}), /* @__PURE__ */ p(
|
|
128
|
+
}), /* @__PURE__ */ p(i, {
|
|
129
129
|
load: S,
|
|
130
130
|
label: "image viewer",
|
|
131
131
|
needed: t,
|
|
@@ -142,7 +142,7 @@ var E = d.memo(function({ images: e }) {
|
|
|
142
142
|
})] });
|
|
143
143
|
});
|
|
144
144
|
function D({ image: e, index: t, more: n, onOpen: r }) {
|
|
145
|
-
let
|
|
145
|
+
let i = l(e), s = e.filename ?? e.alt ?? `Image ${String(t + 1)}`;
|
|
146
146
|
return /* @__PURE__ */ m(g, {
|
|
147
147
|
orientation: "vertical",
|
|
148
148
|
children: [
|
|
@@ -151,15 +151,15 @@ function D({ image: e, index: t, more: n, onOpen: r }) {
|
|
|
151
151
|
children: /* @__PURE__ */ p(h, {
|
|
152
152
|
ratio: 1,
|
|
153
153
|
className: "ck-comment-image-ratio",
|
|
154
|
-
children:
|
|
155
|
-
link:
|
|
154
|
+
children: i.failed ? /* @__PURE__ */ p(u, {
|
|
155
|
+
link: i,
|
|
156
156
|
compact: !0
|
|
157
157
|
}) : /* @__PURE__ */ p("img", {
|
|
158
158
|
src: e.url,
|
|
159
159
|
alt: s,
|
|
160
160
|
className: "ck-comment-image",
|
|
161
|
-
onError:
|
|
162
|
-
}, `${e.url}:${
|
|
161
|
+
onError: i.onError
|
|
162
|
+
}, `${e.url}:${i.attempt}`)
|
|
163
163
|
})
|
|
164
164
|
}),
|
|
165
165
|
n > 0 ? /* @__PURE__ */ m(o, {
|
|
@@ -172,7 +172,7 @@ function D({ image: e, index: t, more: n, onOpen: r }) {
|
|
|
172
172
|
title: [
|
|
173
173
|
e.type,
|
|
174
174
|
e.filename,
|
|
175
|
-
|
|
175
|
+
a(e.size)
|
|
176
176
|
].filter(Boolean).join(" • ") || void 0,
|
|
177
177
|
onClick: (e) => {
|
|
178
178
|
e.stopPropagation(), r(e.currentTarget);
|
|
@@ -194,7 +194,7 @@ function O({ file: e }) {
|
|
|
194
194
|
"aria-hidden": "true",
|
|
195
195
|
children: [/* @__PURE__ */ p("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6Z" }), /* @__PURE__ */ p("path", { d: "M14 2v6h6M8 13h8M8 17h5" })]
|
|
196
196
|
}) }),
|
|
197
|
-
/* @__PURE__ */ m(v, { children: [/* @__PURE__ */ p(y, { children: n }), /* @__PURE__ */ p(b, { children: t.refreshFailed ? "Could not refresh. Try again." : t.loading ? "Refreshing link…" :
|
|
197
|
+
/* @__PURE__ */ m(v, { children: [/* @__PURE__ */ p(y, { children: n }), /* @__PURE__ */ p(b, { children: t.refreshFailed ? "Could not refresh. Try again." : t.loading ? "Refreshing link…" : a(e.size) ?? "File" })] }),
|
|
198
198
|
r ? /* @__PURE__ */ p(x, {
|
|
199
199
|
render: /* @__PURE__ */ p("a", {
|
|
200
200
|
href: r,
|