@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
|
@@ -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-RSrb0Nku.js";
|
|
2
|
+
import { T as r, _ as i, a, g as o, i as s } from "./comment-kit-ui-BXLJcZYQ.js";
|
|
3
3
|
import * as c from "react";
|
|
4
4
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
5
|
function d(e) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as e } from "./comment-kit-core-
|
|
1
|
+
import { u as e } from "./comment-kit-core-B0k7XsMz.js";
|
|
2
2
|
import { t } from "./capture-privacy-DUROnio5.js";
|
|
3
|
-
import { t as n } from "./button-
|
|
4
|
-
import {
|
|
3
|
+
import { t as n } from "./button-D4GHW6oZ.js";
|
|
4
|
+
import { C as r, g as i, v as a } from "./comment-kit-ui-BXLJcZYQ.js";
|
|
5
5
|
import { d as o, i as s } from "./annotation-icons-Dh-bmNYK.js";
|
|
6
6
|
import * as c from "react";
|
|
7
7
|
import { useCallback as l, useEffect as u, useRef as d, useState as f } from "react";
|
|
@@ -88,7 +88,7 @@ function b(e) {
|
|
|
88
88
|
}, [])
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
var x = () => import("./comment-screenshot-annotator-
|
|
91
|
+
var x = () => import("./comment-screenshot-annotator-ChWwYJzO.js");
|
|
92
92
|
function S({ capturePage: t, availableUsers: l = [], onSave: u, onCancel: d }) {
|
|
93
93
|
let { imageUrl: f, capturing: p, error: g, capture: _, reset: v } = b(t), y = c.useRef(null), [S, C] = c.useState(null), [w, T] = c.useState(null), E = S !== null, D = c.useMemo(() => !S || !w ? null : {
|
|
94
94
|
x: Math.min(S.x, w.x),
|
|
@@ -135,7 +135,7 @@ function S({ capturePage: t, availableUsers: l = [], onSave: u, onCancel: d }) {
|
|
|
135
135
|
e() || t.key === "Escape" && !t.defaultPrevented && (t.preventDefault(), N());
|
|
136
136
|
};
|
|
137
137
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
138
|
-
}, [f, N]), f ? /* @__PURE__ */ m(
|
|
138
|
+
}, [f, N]), f ? /* @__PURE__ */ m(r, {
|
|
139
139
|
load: x,
|
|
140
140
|
label: "screenshot editor",
|
|
141
141
|
onCancel: N,
|
|
@@ -192,7 +192,7 @@ function S({ capturePage: t, availableUsers: l = [], onSave: u, onCancel: d }) {
|
|
|
192
192
|
className: "ck-screenshot-overlay-error",
|
|
193
193
|
children: g
|
|
194
194
|
}) : null,
|
|
195
|
-
/* @__PURE__ */ m(
|
|
195
|
+
/* @__PURE__ */ m(i, { mode: "screenshot" })
|
|
196
196
|
]
|
|
197
197
|
});
|
|
198
198
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./button-
|
|
2
|
-
import { i as t, o as n, r, t as i } from "./separator-
|
|
1
|
+
import { t as e } from "./button-D4GHW6oZ.js";
|
|
2
|
+
import { i as t, o as n, r, t as i } from "./separator-UhJb0Row.js";
|
|
3
3
|
import { t as a } from "./createReactComponent-BZHeRbD0.js";
|
|
4
|
-
import {
|
|
4
|
+
import { F as o, N as s, P as c, S as l, u } from "./comment-kit-ui-BXLJcZYQ.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 = a("outline", "refresh", "Refresh", [["path", {
|
|
@@ -61,7 +61,7 @@ var y = 2500, b = ({ core: a, state: f }) => {
|
|
|
61
61
|
/* @__PURE__ */ m("div", {
|
|
62
62
|
className: "ck-dev-export-toolbar",
|
|
63
63
|
children: [
|
|
64
|
-
/* @__PURE__ */ p(
|
|
64
|
+
/* @__PURE__ */ p(l, {
|
|
65
65
|
checked: A,
|
|
66
66
|
indeterminate: j,
|
|
67
67
|
onCheckedChange: () => {
|
|
@@ -144,7 +144,7 @@ var y = 2500, b = ({ core: a, state: f }) => {
|
|
|
144
144
|
}),
|
|
145
145
|
/* @__PURE__ */ p(u, {
|
|
146
146
|
className: "ck-dev-export-scroll",
|
|
147
|
-
children: O.length === 0 ? /* @__PURE__ */ p(
|
|
147
|
+
children: O.length === 0 ? /* @__PURE__ */ p(o, {
|
|
148
148
|
className: "ck-dev-export-empty",
|
|
149
149
|
children: "No open stakeholder comments on this project. Comments left in production or staging will show up here for bulk export."
|
|
150
150
|
}) : /* @__PURE__ */ p("ul", {
|
|
@@ -154,7 +154,7 @@ var y = 2500, b = ({ core: a, state: f }) => {
|
|
|
154
154
|
return /* @__PURE__ */ m("li", {
|
|
155
155
|
className: "ck-dev-export-row",
|
|
156
156
|
"data-checked": t,
|
|
157
|
-
children: [/* @__PURE__ */ p(
|
|
157
|
+
children: [/* @__PURE__ */ p(l, {
|
|
158
158
|
checked: t,
|
|
159
159
|
onCheckedChange: () => N(e.id),
|
|
160
160
|
"aria-label": `Select ${e.title}`
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { f as e, g as t, p as n
|
|
2
|
-
import { a as
|
|
3
|
-
import { n as
|
|
4
|
-
import { a as
|
|
1
|
+
import { f as e, g as t, p as n } from "./comment-kit-core-B0k7XsMz.js";
|
|
2
|
+
import { a as r, i, o as a } from "./dom-Bhf4WFtY.js";
|
|
3
|
+
import { n as o, t as s } from "./capture-privacy-DUROnio5.js";
|
|
4
|
+
import { a as c, n as l, t as u } from "./text-B4HHZNaa.js";
|
|
5
|
+
import { captureScreenshot as d } from "./screenshot-B-ZfFItT.js";
|
|
5
6
|
var f = 4e3, p = 500, m = 2e3, h = 1e3, g = 5, _ = 25, v = 3145728;
|
|
6
7
|
function y() {
|
|
7
|
-
let { url: e, path: t, title: n } =
|
|
8
|
+
let { url: e, path: t, title: n } = a();
|
|
8
9
|
return {
|
|
9
|
-
url:
|
|
10
|
-
path:
|
|
10
|
+
url: c(e),
|
|
11
|
+
path: c(t),
|
|
11
12
|
title: n
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
function b(e) {
|
|
15
|
-
let t =
|
|
16
|
+
let t = l(e?.comment, m);
|
|
16
17
|
return t.length > 0 ? t : null;
|
|
17
18
|
}
|
|
18
19
|
function x(e) {
|
|
19
20
|
return (e?.attachments ?? []).slice(0, g).flatMap((e) => {
|
|
20
|
-
let t =
|
|
21
|
+
let t = l(e.name, h), n = l(e.path, h);
|
|
21
22
|
return !t || !n ? [] : [{
|
|
22
23
|
name: t,
|
|
23
24
|
path: n,
|
|
24
25
|
...e.pathSource ? { pathSource: e.pathSource } : {},
|
|
25
|
-
...e.type ? { type:
|
|
26
|
+
...e.type ? { type: l(e.type, h) } : {},
|
|
26
27
|
...typeof e.size == "number" ? { size: e.size } : {},
|
|
27
28
|
...typeof e.lastModified == "number" ? { lastModified: e.lastModified } : {}
|
|
28
29
|
}];
|
|
@@ -31,8 +32,8 @@ function x(e) {
|
|
|
31
32
|
function S(e) {
|
|
32
33
|
return typeof HTMLElement < "u" && e instanceof HTMLElement;
|
|
33
34
|
}
|
|
34
|
-
function C(e, t, n,
|
|
35
|
-
let
|
|
35
|
+
function C(e, t, n, a) {
|
|
36
|
+
let s = e.getBoundingClientRect(), c = i(e), u = r(e), d = e.getAttribute("class"), m = e.getAttribute("role"), h = e.getAttribute("aria-label"), g = o(e), _ = l(g.text, p), v = l(g.html, f);
|
|
36
37
|
return {
|
|
37
38
|
found: !0,
|
|
38
39
|
tagName: e.tagName.toLowerCase(),
|
|
@@ -42,19 +43,19 @@ function C(e, t, n, r) {
|
|
|
42
43
|
...h ? { ariaLabel: h } : {},
|
|
43
44
|
..._ ? { text: _ } : {},
|
|
44
45
|
rect: {
|
|
45
|
-
top:
|
|
46
|
-
left:
|
|
47
|
-
width:
|
|
48
|
-
height:
|
|
46
|
+
top: s.top,
|
|
47
|
+
left: s.left,
|
|
48
|
+
width: s.width,
|
|
49
|
+
height: s.height
|
|
49
50
|
},
|
|
50
51
|
...v ? { htmlPreview: v } : {},
|
|
51
52
|
...c ? { selector: c } : {},
|
|
52
|
-
...
|
|
53
|
+
...u ? { xpath: u } : {},
|
|
53
54
|
...t ? {
|
|
54
55
|
source: w(t),
|
|
55
56
|
stack: n.map(w)
|
|
56
57
|
} : {},
|
|
57
|
-
...
|
|
58
|
+
...a ? { componentName: a } : {}
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
function w(e) {
|
|
@@ -66,16 +67,16 @@ function w(e) {
|
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
function T(e) {
|
|
69
|
-
let t = `${
|
|
70
|
-
return e.componentName ? `${
|
|
70
|
+
let t = `${l(e.filePath, 2e3)}${e.lineNumber === null ? "" : `:${e.lineNumber}`}${e.columnNumber === null ? "" : `:${e.columnNumber}`}`;
|
|
71
|
+
return e.componentName ? `${l(e.componentName, 300)} (${t})` : t;
|
|
71
72
|
}
|
|
72
73
|
function E(e, t, n, r, i, a) {
|
|
73
74
|
let o = [
|
|
74
75
|
"# CommentKit Element Grab",
|
|
75
76
|
"",
|
|
76
|
-
|
|
77
|
+
u,
|
|
77
78
|
""
|
|
78
|
-
], s =
|
|
79
|
+
], s = l(t.tagName ?? "element", 100), c = t.id ? `#${l(t.id, 300)}` : "";
|
|
79
80
|
if (o.push(`**Tag:** \`${s}${c}\``), i && o.push(`**Comment:** ${i}`), a.length > 0) {
|
|
80
81
|
o.push("", "**Attachments:**");
|
|
81
82
|
for (let e of a) {
|
|
@@ -87,11 +88,11 @@ function E(e, t, n, r, i, a) {
|
|
|
87
88
|
o.push(`- \`${e.name}\` - path: \`${e.path}\`${t ? ` (${t})` : ""}`);
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
|
-
if (t.componentName && o.push(`**Component:** \`${
|
|
91
|
+
if (t.componentName && o.push(`**Component:** \`${l(t.componentName, 300)}\``), t.source && o.push(`**Source:** ${T(t.source)}`), t.stack && t.stack.length > 1) {
|
|
91
92
|
o.push("", "**Stack:**");
|
|
92
93
|
for (let e of t.stack) o.push(`- ${T(e)}`);
|
|
93
94
|
}
|
|
94
|
-
return t.source || (t.selector && o.push(`**Selector:** \`${
|
|
95
|
+
return t.source || (t.selector && o.push(`**Selector:** \`${l(t.selector, 2e3)}\``), t.xpath && o.push(`**XPath:** \`${l(t.xpath, 2e3)}\``)), o.push(`**Page:** ${l(e.title || "Untitled", 300)} — ${l(e.url || e.path, 4e3)}`), o.push(""), o.push("**HTML:**", "```html", n, "```", ""), r && o.push("**Screenshot:** captured. If no image accompanies this paste, attach it from the export preview.", ""), o.join("\n");
|
|
95
96
|
}
|
|
96
97
|
function D(e) {
|
|
97
98
|
let t = e.element;
|
|
@@ -119,9 +120,9 @@ function O(e) {
|
|
|
119
120
|
elements: e.map(D)
|
|
120
121
|
} }));
|
|
121
122
|
}
|
|
122
|
-
async function k(i, a, o
|
|
123
|
-
if (!
|
|
124
|
-
let
|
|
123
|
+
async function k(r, i, a, o) {
|
|
124
|
+
if (!r || typeof Element > "u" || !(r instanceof Element) || typeof r.getBoundingClientRect != "function" || s(r)) return null;
|
|
125
|
+
let c = (S(r), r), l = await t(r), u = l?.source ?? null, f = l?.stack ?? [], p = l?.componentName ?? null, m = await d(i, a, c, { reportErrors: !1 }), h = m?.dataUrl ?? null, g = m?.blob ?? null, _ = C(r, u, f, p), v = _.htmlPreview ?? "", w = y(), T = b(o), D = x(o), k = E(w, _, v, h, T, D);
|
|
125
126
|
try {
|
|
126
127
|
g ? await e(k, g) : await n(k);
|
|
127
128
|
} catch {}
|
|
@@ -141,34 +142,34 @@ function A(e, t, n, r) {
|
|
|
141
142
|
let i = [
|
|
142
143
|
"# CommentKit Element Grab",
|
|
143
144
|
"",
|
|
144
|
-
|
|
145
|
+
u,
|
|
145
146
|
"",
|
|
146
147
|
`**Elements:** ${t.length}`,
|
|
147
|
-
`**Page:** ${
|
|
148
|
+
`**Page:** ${l(e.title || "Untitled", 300)} — ${l(e.url || e.path, 4e3)}`
|
|
148
149
|
];
|
|
149
150
|
if (n && i.push(`**Comment:** ${n}`), r.length > 0) {
|
|
150
151
|
i.push("", "**Attachments:**");
|
|
151
152
|
for (let e of r) i.push(`- \`${e.name}\` - path: \`${e.path}\`${e.pathSource ? ` (path source: ${e.pathSource})` : ""}`);
|
|
152
153
|
}
|
|
153
154
|
return i.push(""), t.forEach((e, t) => {
|
|
154
|
-
let { element: n } = e, r =
|
|
155
|
-
i.push(`## [${t + 1}] \`${r}${a}\``), n.componentName && i.push(`- Component: \`${
|
|
155
|
+
let { element: n } = e, r = l(n.tagName ?? "element", 100), a = n.id ? `#${l(n.id, 300)}` : "";
|
|
156
|
+
i.push(`## [${t + 1}] \`${r}${a}\``), n.componentName && i.push(`- Component: \`${l(n.componentName, 300)}\``), n.source && i.push(`- Source: ${T(n.source)}`), n.stack && n.stack.length > 1 && i.push(`- Stack: ${n.stack.map((e) => l(e.componentName ?? e.filePath, 2e3)).join(" → ")}`), n.source || (n.selector && i.push(`- Selector: \`${l(n.selector, 2e3)}\``), n.xpath && i.push(`- XPath: \`${l(n.xpath, 2e3)}\``)), i.push("", "```html", e.html, "```", ""), e.screenshotDataUrl && i.push(``, "");
|
|
156
157
|
}), i.join("\n");
|
|
157
158
|
}
|
|
158
|
-
async function j(e, i, a
|
|
159
|
-
let
|
|
160
|
-
if (
|
|
161
|
-
let
|
|
162
|
-
|
|
163
|
-
let
|
|
164
|
-
for (let e of
|
|
165
|
-
let n = (S(e), e),
|
|
166
|
-
if (
|
|
167
|
-
let e = (await r
|
|
168
|
-
e &&
|
|
159
|
+
async function j(e, r, i, a) {
|
|
160
|
+
let o = e.filter((e) => !!e && typeof Element < "u" && e instanceof Element && typeof e.getBoundingClientRect == "function" && !s(e));
|
|
161
|
+
if (o.length === 0) return null;
|
|
162
|
+
let c = o.slice(0, _);
|
|
163
|
+
o.length > _ && typeof console < "u" && console.warn(`[CommentKit] grabElements was called with ${o.length} elements — capped to ${_} for clipboard size. Pass fewer elements to avoid truncation.`);
|
|
164
|
+
let l = [], u = 0, f = 0, p = b(a), m = x(a);
|
|
165
|
+
for (let e of c) {
|
|
166
|
+
let n = (S(e), e), a = await t(e), o = a?.source ?? null, s = a?.stack ?? [], c = a?.componentName ?? null, h = null;
|
|
167
|
+
if (u < v) {
|
|
168
|
+
let e = (await d(r, i, n, { reportErrors: !1 }))?.dataUrl ?? null;
|
|
169
|
+
e && u + e.length <= v ? (h = e, u += e.length) : e && f++;
|
|
169
170
|
} else f++;
|
|
170
|
-
let g = C(e, s, c
|
|
171
|
-
|
|
171
|
+
let g = C(e, o, s, c), _ = g.htmlPreview ?? "", b = y(), x = E(b, g, _, h, p, m);
|
|
172
|
+
l.push({
|
|
172
173
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
173
174
|
page: b,
|
|
174
175
|
element: g,
|
|
@@ -180,17 +181,17 @@ async function j(e, i, a, o) {
|
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
183
|
f > 0 && typeof console < "u" && console.warn(`[CommentKit] grabElements dropped ${f} screenshot${f === 1 ? "" : "s"} to stay under the ${Math.round(v / 1024 / 1024)}MB clipboard budget.`);
|
|
183
|
-
let h = y(), g = A(h,
|
|
184
|
+
let h = y(), g = A(h, l, p, m);
|
|
184
185
|
try {
|
|
185
186
|
await n(g);
|
|
186
187
|
} catch {}
|
|
187
188
|
let w = {
|
|
188
189
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
189
190
|
page: h,
|
|
190
|
-
results:
|
|
191
|
+
results: l,
|
|
191
192
|
attachments: m,
|
|
192
193
|
markdown: g
|
|
193
194
|
};
|
|
194
|
-
return O(
|
|
195
|
+
return O(l), w;
|
|
195
196
|
}
|
|
196
197
|
export { k as grabElement, j as grabElements };
|