@commentkit/comment-kit 0.7.5 → 0.7.7
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 +20 -1
- package/README.md +2 -2
- package/dist/angular.es.js +2 -2
- package/dist/comment-kit.es.js +3 -3
- package/dist/demo.es.js +2 -2
- 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/{annotation-toolbar-DgqxkHy8.js → annotation-toolbar-zeiCmKIr.js} +110 -109
- package/dist/shared/{attachment-refresh-DRX7dKDI.js → attachment-refresh-DAacLaRu.js} +1 -1
- package/dist/shared/{capture-privacy-DUROnio5.js → capture-privacy-CiOrcAlt.js} +38 -14
- package/dist/shared/{comment-drawing-canvas-hSdcLShI.js → comment-drawing-canvas-Btc12IsS.js} +2 -2
- package/dist/shared/{comment-image-lightbox-4zroOCCG.js → comment-image-lightbox--QpbcAtH.js} +2 -2
- package/dist/shared/{comment-images-content-D4hTya6e.js → comment-images-content-C_r4SHM-.js} +13 -13
- package/dist/shared/{comment-kit-core-D068rcdY.js → comment-kit-core-CmLUFujd.js} +382 -348
- package/dist/shared/{comment-kit-ui-BDzNt0jv.js → comment-kit-ui-BHwYuSIi.js} +5255 -5487
- package/dist/shared/{comment-screenshot-annotator-BGnu_NgP.js → comment-screenshot-annotator-zJZyO-XM.js} +2 -2
- package/dist/shared/{comment-screenshot-overlay-BCRmojWB.js → comment-screenshot-overlay-CoKTYB0J.js} +6 -6
- package/dist/shared/{dev-export-panel-CYmUKmIV.js → dev-export-panel-Cnt6oCZU.js} +4 -4
- package/dist/shared/{dev-grab-BYsCpsGI.js → dev-grab-B85jo9AS.js} +3 -3
- package/dist/shared/{element-selector-79Oo5pit.js → element-selector-Cng84xC7.js} +349 -347
- package/dist/shared/input-UPtAj0M6.js +111 -0
- package/dist/shared/{mount-ui-DuHk132g.js → mount-ui-Dz7FB_Ak.js} +4 -4
- package/dist/shared/{pusher-3jyUauYd.js → pusher-CnhQgAvF.js} +1 -1
- package/dist/shared/{realtime-DspH16g5.js → realtime-yGLX4wMK.js} +2 -2
- package/dist/shared/{screenshot-BIuEaRiu.js → screenshot-B5-hwpmt.js} +2 -2
- package/dist/shared/{shadow-root-3-yGIhMs.js → shadow-root-B58ZI2yz.js} +1 -1
- package/dist/shared/{token-session-_Pi4fOEi.js → token-session-D92MYbNu.js} +2 -2
- package/dist/shared/useLabelableId-8n0QmH8N.js +154 -0
- package/dist/shared/{websocket-manager-CvgZSo_L.js → websocket-manager-KhH4hL0Q.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 +2 -0
- package/dist/types/core/comment-kit-core.d.ts +4 -2
- package/dist/types/core/types.d.ts +12 -5
- package/dist/types/core/write-access.d.ts +2 -0
- package/dist/vue.es.js +2 -2
- package/docs/api-reference.md +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e = "[data-commentkit],[data-commentkit-host],[data-commentkit-ui],[data-commentkit-panel],[data-commentkit-redact],[data-html2canvas-ignore],input[type=\"password\"],input[type=\"hidden\"]," + [
|
|
1
|
+
var e = "iframe,[data-commentkit],[data-commentkit-host],[data-commentkit-ui],[data-commentkit-panel],[data-commentkit-redact],[data-html2canvas-ignore],input[type=\"password\"],input[type=\"hidden\"]," + [
|
|
2
2
|
"current-password",
|
|
3
3
|
"new-password",
|
|
4
4
|
"one-time-code",
|
|
@@ -48,30 +48,54 @@ var n = /* @__PURE__ */ new Set([
|
|
|
48
48
|
"name"
|
|
49
49
|
]), a = 2e3, o = 100, s = 16e3;
|
|
50
50
|
function c(e) {
|
|
51
|
-
return
|
|
51
|
+
return r.has(e.tagName.toLowerCase()) || e.hasAttribute("contenteditable");
|
|
52
52
|
}
|
|
53
53
|
function l(e) {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
try {
|
|
55
|
+
let t = e;
|
|
56
|
+
for (;;) {
|
|
57
|
+
let e = t.parentElement;
|
|
58
|
+
if (e) t = e;
|
|
59
|
+
else {
|
|
60
|
+
let e = t.getRootNode();
|
|
61
|
+
if (!(e instanceof ShadowRoot)) return !1;
|
|
62
|
+
t = e.host;
|
|
63
|
+
}
|
|
64
|
+
if (c(t)) return !0;
|
|
65
|
+
}
|
|
66
|
+
} catch {
|
|
67
|
+
return !0;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function u(e) {
|
|
71
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
72
|
+
}
|
|
73
|
+
function d(e) {
|
|
74
|
+
if (l(e)) return {
|
|
75
|
+
text: "",
|
|
76
|
+
html: ""
|
|
77
|
+
};
|
|
78
|
+
let r = 0, d = 0, f = [], p = (e, l) => {
|
|
79
|
+
if (++r > a || l > o || d >= s) return "";
|
|
56
80
|
if (e.nodeType === 3) {
|
|
57
|
-
let t = (e.textContent ?? "").slice(0, s -
|
|
58
|
-
return
|
|
81
|
+
let t = (e.textContent ?? "").slice(0, s - d);
|
|
82
|
+
return d += t.length, f.push(t), u(t);
|
|
59
83
|
}
|
|
60
84
|
if (e.nodeType !== 1) return "";
|
|
61
85
|
let m = e, h = m.tagName.toLowerCase();
|
|
62
86
|
if (n.has(h) || t(m)) return "";
|
|
63
87
|
let g = Array.from(m.attributes).filter((e) => i.has(e.name)).map((e) => {
|
|
64
|
-
let t = e.value.slice(0, Math.max(0, s -
|
|
65
|
-
return
|
|
66
|
-
}).join(""), _ =
|
|
88
|
+
let t = e.value.slice(0, Math.max(0, s - d));
|
|
89
|
+
return d += t.length, ` ${e.name}="${u(t)}"`;
|
|
90
|
+
}).join(""), _ = c(m), v = "";
|
|
67
91
|
if (!_) {
|
|
68
|
-
for (let e of m.childNodes) if (v +=
|
|
92
|
+
for (let e of m.childNodes) if (v += p(e, l + 1), r >= a || d >= s) break;
|
|
69
93
|
}
|
|
70
94
|
return `<${h}${g}>${v}</${h}>`;
|
|
71
|
-
},
|
|
95
|
+
}, m = p(e, 0);
|
|
72
96
|
return {
|
|
73
|
-
text:
|
|
74
|
-
html:
|
|
97
|
+
text: f.join(""),
|
|
98
|
+
html: m
|
|
75
99
|
};
|
|
76
100
|
}
|
|
77
|
-
export {
|
|
101
|
+
export { d as n, t };
|
package/dist/shared/{comment-drawing-canvas-hSdcLShI.js → comment-drawing-canvas-Btc12IsS.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./annotation-toolbar-
|
|
2
|
-
import {
|
|
1
|
+
import { n as e, r as t, t as n } from "./annotation-toolbar-zeiCmKIr.js";
|
|
2
|
+
import { T as r, a as i, g as a, i as o } from "./comment-kit-ui-BHwYuSIi.js";
|
|
3
3
|
import * as s from "react";
|
|
4
4
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
5
|
var d = ".ck-annotation-toolbar{background-color:var(--background);width:100%;max-width:100%;box-shadow:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a, 0 0 0 1px color-mix(in oklch, var(--foreground) 5%, transparent);border-radius:2rem;flex-wrap:wrap;justify-content:center;align-items:center;gap:.375rem .5rem;margin-inline:auto;padding:.375rem;display:flex}@media (width>=1024px){.ck-annotation-toolbar{width:fit-content}}.ck-annotation-separator.ck-separator[data-orientation=vertical]{height:1rem;display:none}@media (width>=1024px){.ck-annotation-separator.ck-separator[data-orientation=vertical]{display:block}}.ck-annotation-stroke{align-items:center;gap:.5rem;width:7rem;padding-inline:.25rem;display:flex}@media (width>=1024px){.ck-annotation-stroke{width:12rem}}.ck-annotation-slider{flex:auto;min-width:0}.ck-annotation-stroke-label{color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex-shrink:0;font-size:.75rem;line-height:1rem}.ck-annotation-swatch{background-color:var(--ck-bg);width:.875rem;height:.875rem;box-shadow:0 0 0 1px color-mix(in oklch, var(--foreground) 5%, transparent);border-radius:999px}.ck-annotation-tooltip{align-items:center;gap:.375rem;display:inline-flex}.ck-annotation-save--disabled{opacity:.5}.ck-drawing-canvas{z-index:var(--z-ck-marker-layer);cursor:none;pointer-events:auto;flex-direction:column;padding-top:1rem;display:flex;position:fixed;inset:0}.ck-drawing-canvas-scrim{pointer-events:none;background-color:#0000004d;position:absolute;inset:0}@supports ((-webkit-backdrop-filter:blur(4px)) or (backdrop-filter:blur(4px))){.ck-drawing-canvas-scrim{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}}.ck-drawing-canvas-toolbar{z-index:1;cursor:auto;width:100%;min-width:0;margin-inline:auto;padding-inline:.75rem;position:relative}.ck-drawing-canvas-surface{z-index:0;touch-action:none;flex:auto;min-height:0;position:relative}.ck-drawing-canvas-error{border-radius:var(--radius-md);background:var(--background);width:max-content;max-width:calc(100vw - 1.5rem);color:var(--destructive);margin:.75rem auto;padding:.75rem;font-size:.875rem}";
|
package/dist/shared/{comment-image-lightbox-4zroOCCG.js → comment-image-lightbox--QpbcAtH.js}
RENAMED
|
@@ -3,8 +3,8 @@ import { o as t, t as n } from "./button-D4GHW6oZ.js";
|
|
|
3
3
|
import { i as r, o as i, r as a } from "./separator-UhJb0Row.js";
|
|
4
4
|
import { t as o } from "./comment-icon-D8JTCEJ7.js";
|
|
5
5
|
import { t as s } from "./button-group-BVR7iT-S.js";
|
|
6
|
-
import { c, h as l, m as u, p as d } from "./comment-kit-ui-
|
|
7
|
-
import { r as f, t as p } from "./attachment-refresh-
|
|
6
|
+
import { c, h as l, m as u, p as d } from "./comment-kit-ui-BHwYuSIi.js";
|
|
7
|
+
import { r as f, t as p } from "./attachment-refresh-DAacLaRu.js";
|
|
8
8
|
import * as m from "react";
|
|
9
9
|
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
10
10
|
var v = ".ck-dialog-content.ck-image-lightbox{width:100vw;max-width:none;height:100dvh;max-height:none;box-shadow:none;background-color:#0000;border:0;border-radius:0;justify-content:center;align-items:center;gap:0;padding:0;display:flex;inset:0;translate:none}@media (width>=640px){.ck-dialog-content.ck-image-lightbox{max-width:none}}.ck-root[data-theme=dark] .ck-dialog-content.ck-image-lightbox{box-shadow:none}.ck-image-lightbox-prev,.ck-image-lightbox-next{position:absolute}.ck-image-lightbox-prev{inset-inline-start:1rem}.ck-image-lightbox-next{inset-inline-end:1rem}.ck-image-lightbox-photo{object-fit:contain;width:auto;max-width:90vw;height:auto;max-height:90vh}.ck-image-lightbox-meta{border-radius:var(--radius-xl);background-color:var(--muted);text-align:center;max-width:90vw;color:var(--muted-foreground);padding:.25rem .625rem;font-size:.75rem;line-height:1rem;position:absolute;bottom:3.5rem;left:50%;transform:translate(-50%)}.ck-image-lightbox-actions{top:1rem;position:absolute;inset-inline-end:1rem}.ck-image-lightbox-dots{gap:.5rem;display:flex;position:absolute;bottom:1.5rem}.ck-image-lightbox-dot{cursor:pointer;background-color:color-mix(in oklch, var(--foreground) 40%, transparent);border:0;border-radius:999px;width:.625rem;height:.625rem;padding:0;transition:background-color .15s cubic-bezier(.4,0,.2,1)}.ck-image-lightbox-dot:hover{background-color:color-mix(in oklch, var(--foreground) 60%, transparent)}.ck-image-lightbox-dot--active,.ck-image-lightbox-dot--active:hover{background-color:var(--foreground)}";
|
package/dist/shared/{comment-images-content-D4hTya6e.js → comment-images-content-C_r4SHM-.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as e, t, u as n } from "./button-D4GHW6oZ.js";
|
|
2
2
|
import { t as r } from "./useRender-Uxk1OPK-.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as c, r as l, t as u } from "./attachment-refresh-
|
|
3
|
+
import { C as i, c as a, l as o, r as s } from "./comment-kit-ui-BHwYuSIi.js";
|
|
4
|
+
import { n as c, r as l, t as u } from "./attachment-refresh-DAacLaRu.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
7
|
var h = d.forwardRef(function({ ratio: t, className: n, style: r, ...i }, a) {
|
|
@@ -92,7 +92,7 @@ var x = d.forwardRef(function({ className: t, render: i, type: a, ...o }, s) {
|
|
|
92
92
|
render: i,
|
|
93
93
|
state: { slot: "attachment-trigger" }
|
|
94
94
|
});
|
|
95
|
-
}), S = () => import("./comment-image-lightbox
|
|
95
|
+
}), S = () => import("./comment-image-lightbox--QpbcAtH.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,
|