@commentkit/comment-kit 0.7.0 → 0.7.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +10 -6
  3. package/SECURITY.md +14 -6
  4. package/dist/angular.es.js +2 -2
  5. package/dist/comment-kit.es.js +5 -5
  6. package/dist/demo.es.js +36 -34
  7. package/dist/headless.es.js +3 -3
  8. package/dist/preact.es.js +2 -2
  9. package/dist/qwik.qwik.mjs +2 -2
  10. package/dist/react.es.js +2 -2
  11. package/dist/shared/{ShadowRootContext-Bv-4aElu.js → ShadowRootContext-CjciYxVN.js} +4 -4
  12. package/dist/shared/annotation-toolbar-CZI1KVdW.js +1094 -0
  13. package/dist/shared/attachment-refresh-mQw-L7hB.js +94 -0
  14. package/dist/shared/{button-group-Cl9CrvvU.js → button-group-C285iSkZ.js} +14 -16
  15. package/dist/shared/capture-colors-CxSLsU5-.js +74 -0
  16. package/dist/shared/capture-privacy-DUROnio5.js +77 -0
  17. package/dist/shared/{comment-drawing-canvas-Dzb5YoFw.js → comment-drawing-canvas-CYFFKgCm.js} +2 -2
  18. package/dist/shared/{comment-utils-BycYTSxA.js → comment-icon-4SQd3nlz.js} +30 -24
  19. package/dist/shared/comment-image-lightbox-DmTNxuqX.js +190 -0
  20. package/dist/shared/comment-images-content-BX4DQ9Ol.js +214 -0
  21. package/dist/shared/{comment-kit-core-BaSuMzp9.js → comment-kit-core-VuIidMeu.js} +1096 -793
  22. package/dist/shared/{comment-kit-ui-CzfdAZs2.js → comment-kit-ui-BjJ1ZLiv.js} +6091 -6486
  23. package/dist/shared/{comment-screenshot-annotator-C7X-_bm6.js → comment-screenshot-annotator-CMOG1md7.js} +5 -5
  24. package/dist/shared/{comment-screenshot-overlay-wIrZrcRy.js → comment-screenshot-overlay-iWW-V-Iw.js} +114 -118
  25. package/dist/shared/comment-shortcut-groups-CfEmkitU.js +153 -0
  26. package/dist/shared/{dev-export-panel-FwFVdady.js → dev-export-panel-CrRENbMn.js} +9 -10
  27. package/dist/shared/dev-grab-Ca4MlS2Y.js +196 -0
  28. package/dist/shared/{element-selector-BhJm-NSs.js → element-selector-g1bTvdEA.js} +450 -408
  29. package/dist/shared/{mount-ui--ijs8pWT.js → mount-ui-Dz5QLq4W.js} +121 -106
  30. package/dist/shared/{pusher-ipHMJnO_.js → pusher-ue0D83de.js} +1 -1
  31. package/dist/shared/realtime-CieWAnsW.js +321 -0
  32. package/dist/shared/realtime-recovery-BSVMwsXJ.js +135 -0
  33. package/dist/shared/request-activity-DQrAUwfA.js +11 -0
  34. package/dist/shared/{separator-XDBsaWyw.js → separator-aphZiRoJ.js} +1 -1
  35. package/dist/shared/{shadow-root-C5v-T8lQ.js → shadow-root-Cv1aLuFf.js} +31 -31
  36. package/dist/shared/{styles-D3yMtaec.js → styles-CnYsLS2f.js} +1 -1
  37. package/dist/shared/text-B4HHZNaa.js +23 -0
  38. package/dist/shared/token-session-CPQpt3-u.js +25 -0
  39. package/dist/shared/useRender-D1z_X_BY.js +5 -0
  40. package/dist/shared/{validation-C7QG8j7Z.js → validation-3wbbbuX0.js} +26 -1
  41. package/dist/shared/websocket-manager-BnK55c3U.js +381 -0
  42. package/dist/solid.es.js +2 -2
  43. package/dist/svelte.es.js +2 -2
  44. package/dist/types/core/api-client.d.ts +11 -2
  45. package/dist/types/core/comment-kit-core.d.ts +11 -5
  46. package/dist/types/core/types.d.ts +54 -2
  47. package/dist/types/core/websocket-manager.d.ts +13 -0
  48. package/dist/types/core/write-access.d.ts +9 -0
  49. package/dist/vue.es.js +2 -2
  50. package/docs/api-reference.md +25 -4
  51. package/package.json +3 -2
  52. package/dist/shared/annotation-toolbar-B9SxYqoF.js +0 -1093
  53. package/dist/shared/comment-image-lightbox-BPYJT1sB.js +0 -183
  54. package/dist/shared/dev-grab-DDqg0LQf.js +0 -203
  55. package/dist/shared/realtime-Dk41VwKg.js +0 -302
  56. package/dist/shared/websocket-manager-DhLWh3Jr.js +0 -302
@@ -1,5 +1,5 @@
1
- import { n as e, r as t, t as n } from "./annotation-toolbar-B9SxYqoF.js";
2
- import { A as r, i, m as a, p as o, r as s } from "./comment-kit-ui-CzfdAZs2.js";
1
+ import { n as e, r as t, t as n } from "./annotation-toolbar-CZI1KVdW.js";
2
+ import { N as r, _ as i, a, g as o, i as s } from "./comment-kit-ui-BjJ1ZLiv.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) {
@@ -35,9 +35,9 @@ function f({ imageUrl: f, availableUsers: p = [], onSave: m, onCancel: h }) {
35
35
  O *= e, k *= e;
36
36
  }
37
37
  let A = b?.w ?? O, j = b?.h ?? k, M = g.paths.flatMap((e) => {
38
- let t = i(e);
38
+ let t = a(e);
39
39
  return t ? [t] : [];
40
- }), N = g.activePath ? i(g.activePath) : null, P = (e) => {
40
+ }), N = g.activePath ? a(g.activePath) : null, P = (e) => {
41
41
  let t = e.currentTarget.getBoundingClientRect();
42
42
  return !t.width || !t.height ? null : {
43
43
  x: (e.clientX - t.left) * A / t.width,
@@ -115,7 +115,7 @@ function f({ imageUrl: f, availableUsers: p = [], onSave: m, onCancel: h }) {
115
115
  })]
116
116
  }), /* @__PURE__ */ l("div", {
117
117
  className: "ck-screenshot-annotator-composer",
118
- children: /* @__PURE__ */ l(a, {
118
+ children: /* @__PURE__ */ l(i, {
119
119
  mode: "new-thread",
120
120
  placeholder: "Describe what you see...",
121
121
  availableUsers: p,
@@ -1,206 +1,202 @@
1
- import { t as e } from "./button-By0hGrJK.js";
2
- import { O as t, h as n, p as r } from "./comment-kit-ui-CzfdAZs2.js";
3
- import { d as i, i as a } from "./annotation-icons-Dh-bmNYK.js";
4
- import * as o from "react";
5
- import { useCallback as s, useEffect as c, useRef as l, useState as u } from "react";
6
- import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
7
- var m = ".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-screenshot-overlay{z-index:var(--z-ck-overlay);cursor:none;pointer-events:auto;touch-action:none;outline:none;position:fixed;inset:0}.ck-screenshot-selection{pointer-events:none;inset-inline-start:var(--ck-x);top:var(--ck-y);width:var(--ck-w);height:var(--ck-h);box-shadow:0 0 0 2px var(--primary);background:color-mix(in oklch, var(--primary) 10%, transparent);position:fixed}.ck-screenshot-overlay-bar{inset-inline-start:50%;z-index:10;background:var(--background);max-width:calc(100vw - 1.5rem);color:var(--foreground);box-shadow:var(--shadow-lg), 0 0 0 1px color-mix(in oklch, var(--foreground) 5%, transparent);cursor:auto;border-radius:2rem;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem;display:flex;position:fixed;top:1rem;transform:translate(-50%)}.ck-screenshot-overlay-bar>svg{flex-shrink:0;width:1rem;height:1rem}.ck-screenshot-overlay-bar>button{margin-inline-start:.25rem}.ck-screenshot-overlay-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;position:absolute;top:5rem;left:50%;transform:translate(-50%)}.ck-screenshot-overlay-bar>span,.ck-screenshot-overlay-bar>svg{color:var(--muted-foreground)}@media (width<=767px){.ck-screenshot-overlay-bar{width:max-content}}.ck-screenshot-annotator{z-index:var(--z-ck-overlay);pointer-events:auto;background:#0000004d;position:fixed;inset:0;overflow-y:auto}@supports ((-webkit-backdrop-filter:blur(4px)) or (backdrop-filter:blur(4px))){.ck-screenshot-annotator{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}}.ck-screenshot-annotator-layout{justify-content:center;align-items:flex-start;width:100%;min-height:100%;padding:.75rem;display:flex}.ck-screenshot-annotator-stage{flex-direction:column;align-items:stretch;gap:.75rem;width:100%;max-width:100%;display:flex}.ck-screenshot-annotator-media{flex-direction:column;align-items:center;gap:.75rem;width:100%;min-width:0;display:flex}.ck-screenshot-annotator-toolbar{width:100%;min-width:0}.ck-screenshot-annotator-canvas{width:100%;max-width:100%;max-height:var(--ck-frame);box-shadow:var(--shadow-xl), 0 0 0 1px color-mix(in oklch, var(--foreground) 5%, transparent);position:relative;overflow:auto}.ck-screenshot-annotator-image{width:var(--ck-w);height:var(--ck-h);-webkit-user-select:none;user-select:none;max-width:none;display:block}.ck-screenshot-annotator-strokes{cursor:none;touch-action:none;position:absolute;inset:0}.ck-screenshot-annotator-composer{flex-direction:column;width:100%;min-width:0;display:flex}@media (width>=1024px){.ck-screenshot-annotator-layout{align-items:center;padding:1rem}.ck-screenshot-annotator-stage{flex-direction:row;align-items:flex-start;gap:1.5rem;width:auto}.ck-screenshot-annotator-media{width:auto}.ck-screenshot-annotator-canvas{width:var(--ck-w);height:var(--ck-h);max-height:none;overflow:hidden}.ck-screenshot-annotator-composer{flex-shrink:0;width:380px}}", h = 15e3, g = 32e6;
8
- async function _(e, t, n) {
1
+ import { u as e } from "./comment-kit-core-VuIidMeu.js";
2
+ import { t } from "./capture-privacy-DUROnio5.js";
3
+ import { t as n } from "./button-By0hGrJK.js";
4
+ import { g as r, j as i, v as a } from "./comment-kit-ui-BjJ1ZLiv.js";
5
+ import { d as o, i as s } from "./annotation-icons-Dh-bmNYK.js";
6
+ import * as c from "react";
7
+ import { useCallback as l, useEffect as u, useRef as d, useState as f } from "react";
8
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
9
+ var g = ".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-screenshot-overlay{z-index:var(--z-ck-overlay);cursor:none;pointer-events:auto;touch-action:none;outline:none;position:fixed;inset:0}.ck-screenshot-selection{pointer-events:none;inset-inline-start:var(--ck-x);top:var(--ck-y);width:var(--ck-w);height:var(--ck-h);box-shadow:0 0 0 2px var(--primary);background:color-mix(in oklch, var(--primary) 10%, transparent);position:fixed}.ck-screenshot-overlay-bar{inset-inline-start:50%;z-index:10;background:var(--background);max-width:calc(100vw - 1.5rem);color:var(--foreground);box-shadow:var(--shadow-lg), 0 0 0 1px color-mix(in oklch, var(--foreground) 5%, transparent);cursor:auto;border-radius:2rem;align-items:center;gap:.5rem;padding:.5rem 1rem;font-size:.875rem;line-height:1.25rem;display:flex;position:fixed;top:1rem;transform:translate(-50%)}.ck-screenshot-overlay-bar>svg{flex-shrink:0;width:1rem;height:1rem}.ck-screenshot-overlay-bar>button{margin-inline-start:.25rem}.ck-screenshot-overlay-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;position:absolute;top:5rem;left:50%;transform:translate(-50%)}.ck-screenshot-overlay-bar>span,.ck-screenshot-overlay-bar>svg{color:var(--muted-foreground)}@media (width<=767px){.ck-screenshot-overlay-bar{width:max-content}}.ck-screenshot-annotator{z-index:var(--z-ck-overlay);pointer-events:auto;background:#0000004d;position:fixed;inset:0;overflow-y:auto}@supports ((-webkit-backdrop-filter:blur(4px)) or (backdrop-filter:blur(4px))){.ck-screenshot-annotator{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}}.ck-screenshot-annotator-layout{justify-content:center;align-items:flex-start;width:100%;min-height:100%;padding:.75rem;display:flex}.ck-screenshot-annotator-stage{flex-direction:column;align-items:stretch;gap:.75rem;width:100%;max-width:100%;display:flex}.ck-screenshot-annotator-media{flex-direction:column;align-items:center;gap:.75rem;width:100%;min-width:0;display:flex}.ck-screenshot-annotator-toolbar{width:100%;min-width:0}.ck-screenshot-annotator-canvas{width:100%;max-width:100%;max-height:var(--ck-frame);box-shadow:var(--shadow-xl), 0 0 0 1px color-mix(in oklch, var(--foreground) 5%, transparent);position:relative;overflow:auto}.ck-screenshot-annotator-image{width:var(--ck-w);height:var(--ck-h);-webkit-user-select:none;user-select:none;max-width:none;display:block}.ck-screenshot-annotator-strokes{cursor:none;touch-action:none;position:absolute;inset:0}.ck-screenshot-annotator-composer{flex-direction:column;width:100%;min-width:0;display:flex}@media (width>=1024px){.ck-screenshot-annotator-layout{align-items:center;padding:1rem}.ck-screenshot-annotator-stage{flex-direction:row;align-items:flex-start;gap:1.5rem;width:auto}.ck-screenshot-annotator-media{width:auto}.ck-screenshot-annotator-canvas{width:var(--ck-w);height:var(--ck-h);max-height:none;overflow:hidden}.ck-screenshot-annotator-composer{flex-shrink:0;width:380px}}", _ = 15e3, v = 32e6;
10
+ async function y(e, t, n) {
9
11
  let r = e.dimensions.width / n.width, i = e.dimensions.height / n.height, a = new Image(), o = new Promise((e, t) => {
10
12
  a.onload = () => e(), a.onerror = () => t(/* @__PURE__ */ Error("Could not load captured screenshot"));
11
13
  });
12
14
  a.src = e.dataUrl, await o;
13
15
  let s = document.createElement("canvas");
14
- if (s.width = Math.max(1, Math.round(t.width * r)), s.height = Math.max(1, Math.round(t.height * i)), s.width > 16384 || s.height > 16384 || s.width * s.height > g) throw Error("Selected area is too large to capture");
16
+ if (s.width = Math.max(1, Math.round(t.width * r)), s.height = Math.max(1, Math.round(t.height * i)), s.width > 16384 || s.height > 16384 || s.width * s.height > v) throw Error("Selected area is too large to capture");
15
17
  let c = s.getContext("2d");
16
18
  if (!c) throw Error("Screenshot cropping is unavailable in this browser");
17
19
  return c.drawImage(a, (t.x + n.scrollX) * r, (t.y + n.scrollY) * i, s.width, s.height, 0, 0, s.width, s.height), s.toDataURL("image/png");
18
20
  }
19
- function v(e) {
20
- try {
21
- return e.matches?.("[data-commentkit],[data-commentkit-host],[data-commentkit-ui],[data-commentkit-panel],input[type=\"password\"],[data-commentkit-redact],[data-html2canvas-ignore]") ?? !1;
22
- } catch {
23
- return !1;
24
- }
25
- }
26
- function y(e) {
27
- let [t, n] = u(null), [r, i] = u(!1), [a, o] = u(null), d = l(0), f = l(!1), p = l(void 0);
28
- return c(() => () => {
29
- d.current += 1, clearTimeout(p.current);
21
+ function b(e) {
22
+ let [n, r] = f(null), [i, a] = f(!1), [o, s] = f(null), c = d(0), p = d(!1), m = d(void 0);
23
+ return u(() => () => {
24
+ c.current += 1, clearTimeout(m.current);
30
25
  }, []), {
31
- imageUrl: t,
32
- capturing: r,
33
- error: a,
34
- capture: s(async (t) => {
35
- if (f.current) return;
36
- f.current = !0;
37
- let r = ++d.current;
38
- i(!0), o(null);
26
+ imageUrl: n,
27
+ capturing: i,
28
+ error: o,
29
+ capture: l(async (n) => {
30
+ if (p.current) return;
31
+ p.current = !0;
32
+ let i = ++c.current;
33
+ a(!0), s(null);
39
34
  try {
40
- let i = await Promise.race([(async () => {
41
- let n = {
35
+ let a = await Promise.race([(async () => {
36
+ let r = {
42
37
  width: Math.max(document.documentElement.scrollWidth, document.body?.scrollWidth ?? 0, window.innerWidth),
43
38
  height: Math.max(document.documentElement.scrollHeight, document.body?.scrollHeight ?? 0, window.innerHeight),
44
39
  scrollX: window.scrollX,
45
40
  scrollY: window.scrollY
46
41
  };
47
42
  if (e) {
48
- let r = await e();
49
- if (!r) throw Error("Screenshot provider could not capture this page");
50
- return t ? _(r, t, n) : r.dataUrl;
43
+ let t = await e();
44
+ if (!t) throw Error("Screenshot provider could not capture this page");
45
+ return n ? y(t, n, r) : t.dataUrl;
51
46
  }
52
- let i;
47
+ let a;
53
48
  try {
54
- i = (await import("html2canvas")).default;
49
+ a = (await import("html2canvas")).default;
55
50
  } catch {
56
51
  throw Error("Screenshot requires either a custom screenshotProvider in config or html2canvas installed. Install html2canvas: npm install html2canvas — or provide config.screenshotProvider.");
57
52
  }
58
- if (r !== d.current) return null;
59
- let a = n.width, o = n.height, s = t?.width ?? a, c = t?.height ?? o;
60
- if (s > 16384 || c > 16384 || s * c > g) throw Error("Selected area is too large to capture");
61
- return (await i(document.body, {
53
+ if (i !== c.current) return null;
54
+ let o = r.width, s = r.height, l = n?.width ?? o, u = n?.height ?? s;
55
+ if (l > 16384 || u > 16384 || l * u > v) throw Error("Selected area is too large to capture");
56
+ return (await a(document.body, {
62
57
  useCORS: !0,
63
58
  allowTaint: !1,
64
59
  scale: 1,
65
60
  logging: !1,
66
- ignoreElements: v,
67
- x: t ? t.x + n.scrollX : 0,
68
- y: t ? t.y + n.scrollY : 0,
69
- width: t?.width ?? a,
70
- height: t?.height ?? o,
71
- windowWidth: a,
72
- windowHeight: o,
61
+ ignoreElements: t,
62
+ onclone: (e) => import("./capture-colors-CxSLsU5-.js").then(({ normalizeCaptureColors: t }) => t(e)),
63
+ x: n ? n.x + r.scrollX : 0,
64
+ y: n ? n.y + r.scrollY : 0,
65
+ width: n?.width ?? o,
66
+ height: n?.height ?? s,
67
+ windowWidth: o,
68
+ windowHeight: s,
73
69
  scrollX: 0,
74
70
  scrollY: 0
75
71
  })).toDataURL("image/png");
76
72
  })(), new Promise((e, t) => {
77
- p.current = setTimeout(() => t(/* @__PURE__ */ Error("Screenshot timed out")), h);
73
+ m.current = setTimeout(() => t(/* @__PURE__ */ Error("Screenshot timed out")), _);
78
74
  })]);
79
- r === d.current && i && n(i);
75
+ i === c.current && a && r(a);
80
76
  } catch (e) {
81
- if (r !== d.current) return;
82
- console.error("[CommentKit] Screenshot failed:", e), n(null), o("Could not capture the page. Try again, or cancel to return to the page.");
77
+ if (i !== c.current) return;
78
+ console.error("[CommentKit] Screenshot failed:", e), r(null), s("Could not capture the page. Try again, or cancel to return to the page.");
83
79
  } finally {
84
- r === d.current && (clearTimeout(p.current), p.current = void 0, f.current = !1, i(!1));
80
+ i === c.current && (clearTimeout(m.current), m.current = void 0, p.current = !1, a(!1));
85
81
  }
86
82
  }, [e]),
87
- reset: s(() => {
88
- d.current += 1, clearTimeout(p.current), p.current = void 0, f.current = !1, i(!1), n(null), o(null);
83
+ reset: l(() => {
84
+ c.current += 1, clearTimeout(m.current), m.current = void 0, p.current = !1, a(!1), r(null), s(null);
89
85
  }, [])
90
86
  };
91
87
  }
92
- var b = () => import("./comment-screenshot-annotator-C7X-_bm6.js");
93
- function x({ capturePage: s, availableUsers: c = [], onSave: l, onCancel: u }) {
94
- let { imageUrl: d, capturing: m, error: h, capture: g, reset: _ } = y(s), v = o.useRef(null), [x, S] = o.useState(null), [C, w] = o.useState(null), T = x !== null, E = o.useMemo(() => !x || !C ? null : {
95
- x: Math.min(x.x, C.x),
96
- y: Math.min(x.y, C.y),
97
- width: Math.abs(C.x - x.x),
98
- height: Math.abs(C.y - x.y)
99
- }, [C, x]), D = o.useCallback(() => {
100
- g();
101
- }, [g]), O = (e) => {
102
- if (!(e.button !== 0 || d || m) && v.current === null) {
103
- v.current = e.pointerId;
88
+ var x = () => import("./comment-screenshot-annotator-CMOG1md7.js");
89
+ function S({ capturePage: t, availableUsers: l = [], onSave: u, onCancel: d }) {
90
+ 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 : {
91
+ x: Math.min(S.x, w.x),
92
+ y: Math.min(S.y, w.y),
93
+ width: Math.abs(w.x - S.x),
94
+ height: Math.abs(w.y - S.y)
95
+ }, [w, S]), O = c.useCallback(() => {
96
+ _();
97
+ }, [_]), k = (e) => {
98
+ if (!(e.button !== 0 || f || p) && y.current === null) {
99
+ y.current = e.pointerId;
104
100
  try {
105
101
  e.currentTarget.setPointerCapture(e.pointerId);
106
102
  } catch {}
107
- S({
103
+ C({
108
104
  x: e.clientX,
109
105
  y: e.clientY
110
- }), w({
106
+ }), T({
111
107
  x: e.clientX,
112
108
  y: e.clientY
113
109
  });
114
110
  }
115
- }, k = (e) => {
116
- T && !d && v.current === e.pointerId && w({
111
+ }, A = (e) => {
112
+ E && !f && y.current === e.pointerId && T({
117
113
  x: e.clientX,
118
114
  y: e.clientY
119
115
  });
120
- }, A = (e) => {
121
- if (v.current !== e.pointerId) return;
122
- if (v.current = null, e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), !T || !E || d) {
123
- S(null), w(null);
116
+ }, j = (e) => {
117
+ if (y.current !== e.pointerId) return;
118
+ if (y.current = null, e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture(e.pointerId), !E || !D || f) {
119
+ C(null), T(null);
124
120
  return;
125
121
  }
126
- let t = E.width >= 20 && E.height >= 20 ? E : void 0;
127
- S(null), w(null), g(t);
128
- }, j = (e) => {
129
- d || m || e.target !== e.currentTarget || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
130
- }, M = o.useCallback(() => {
131
- _(), u();
132
- }, [_, u]);
133
- return o.useEffect(() => {
134
- if (d) return;
135
- let e = (e) => {
136
- e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), M());
122
+ let t = D.width >= 20 && D.height >= 20 ? D : void 0;
123
+ C(null), T(null), _(t);
124
+ }, M = (e) => {
125
+ f || p || e.target !== e.currentTarget || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), O());
126
+ }, N = c.useCallback(() => {
127
+ v(), d();
128
+ }, [v, d]);
129
+ return c.useEffect(() => {
130
+ if (f) return;
131
+ let t = (t) => {
132
+ e() || t.key === "Escape" && !t.defaultPrevented && (t.preventDefault(), N());
137
133
  };
138
- return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
139
- }, [d, M]), d ? /* @__PURE__ */ f(t, {
140
- load: b,
134
+ return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
135
+ }, [f, N]), f ? /* @__PURE__ */ m(i, {
136
+ load: x,
141
137
  label: "screenshot editor",
142
- onCancel: M,
143
- children: ({ CommentScreenshotAnnotator: e }) => /* @__PURE__ */ f(e, {
144
- imageUrl: d,
145
- availableUsers: c,
146
- onSave: l,
147
- onCancel: M
138
+ onCancel: N,
139
+ children: ({ CommentScreenshotAnnotator: e }) => /* @__PURE__ */ m(e, {
140
+ imageUrl: f,
141
+ availableUsers: l,
142
+ onSave: u,
143
+ onCancel: N
148
144
  })
149
- }) : /* @__PURE__ */ p("div", {
145
+ }) : /* @__PURE__ */ h("div", {
150
146
  role: "button",
151
147
  tabIndex: 0,
152
148
  "data-commentkit-ui": "",
153
149
  "data-slot": "comment-screenshot-overlay",
154
150
  className: "ck-screenshot-overlay",
155
151
  "aria-label": "Drag to select a region, or press Enter for the full page",
156
- onPointerDown: O,
157
- onPointerMove: k,
158
- onPointerUp: A,
152
+ onPointerDown: k,
153
+ onPointerMove: A,
154
+ onPointerUp: j,
159
155
  onPointerCancel: () => {
160
- v.current = null, S(null), w(null);
156
+ y.current = null, C(null), T(null);
161
157
  },
162
- onKeyDown: j,
158
+ onKeyDown: M,
163
159
  children: [
164
- E && E.width > 5 && E.height > 5 ? /* @__PURE__ */ f("div", {
160
+ D && D.width > 5 && D.height > 5 ? /* @__PURE__ */ m("div", {
165
161
  className: "ck-screenshot-selection",
166
162
  style: {
167
- "--ck-x": `${E.x}px`,
168
- "--ck-y": `${E.y}px`,
169
- "--ck-w": `${E.width}px`,
170
- "--ck-h": `${E.height}px`
163
+ "--ck-x": `${D.x}px`,
164
+ "--ck-y": `${D.y}px`,
165
+ "--ck-w": `${D.width}px`,
166
+ "--ck-h": `${D.height}px`
171
167
  }
172
168
  }) : null,
173
- /* @__PURE__ */ p("div", {
169
+ /* @__PURE__ */ h("div", {
174
170
  className: "ck-screenshot-overlay-bar",
175
171
  onPointerDown: (e) => e.stopPropagation(),
176
172
  children: [
177
- f(m ? n : a, {}),
178
- /* @__PURE__ */ f("span", { children: m ? "Capturing…" : "Drag to select region, or click for full page" }),
179
- /* @__PURE__ */ f(e, {
173
+ m(p ? a : s, {}),
174
+ /* @__PURE__ */ m("span", { children: p ? "Capturing…" : "Drag to select region, or click for full page" }),
175
+ /* @__PURE__ */ m(n, {
180
176
  type: "button",
181
177
  variant: "ghost",
182
178
  size: "icon-sm",
183
179
  "aria-label": "Cancel screenshot",
184
180
  onClick: (e) => {
185
- e.stopPropagation(), M();
181
+ e.stopPropagation(), N();
186
182
  },
187
- children: /* @__PURE__ */ f(i, {})
183
+ children: /* @__PURE__ */ m(o, {})
188
184
  })
189
185
  ]
190
186
  }),
191
- h ? /* @__PURE__ */ f("p", {
187
+ g ? /* @__PURE__ */ m("p", {
192
188
  role: "alert",
193
189
  className: "ck-screenshot-overlay-error",
194
- children: h
190
+ children: g
195
191
  }) : null,
196
- /* @__PURE__ */ f(r, { mode: "screenshot" })
192
+ /* @__PURE__ */ m(r, { mode: "screenshot" })
197
193
  ]
198
194
  });
199
195
  }
200
- function S(e) {
201
- return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("style", {
196
+ function C(e) {
197
+ return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("style", {
202
198
  "data-ck-tool-styles": "screenshot",
203
- children: m
204
- }), /* @__PURE__ */ f(x, { ...e })] });
199
+ children: g
200
+ }), /* @__PURE__ */ m(S, { ...e })] });
205
201
  }
206
- export { S as CommentScreenshotOverlay };
202
+ export { C as CommentScreenshotOverlay };
@@ -0,0 +1,153 @@
1
+ import * as e from "react";
2
+ import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ var i = [
4
+ {
5
+ title: "General",
6
+ shortcuts: [
7
+ {
8
+ keys: [
9
+ "⌘",
10
+ "⇧",
11
+ "K"
12
+ ],
13
+ description: "Toggle CommentKit"
14
+ },
15
+ {
16
+ keys: ["?"],
17
+ description: "Keyboard shortcuts"
18
+ },
19
+ {
20
+ keys: ["Esc"],
21
+ description: "Close or cancel"
22
+ }
23
+ ]
24
+ },
25
+ {
26
+ title: "Tools",
27
+ shortcuts: [
28
+ {
29
+ keys: ["C"],
30
+ description: "Pin comment"
31
+ },
32
+ {
33
+ keys: ["E"],
34
+ description: "Select element"
35
+ },
36
+ {
37
+ keys: ["H"],
38
+ description: "Highlight"
39
+ },
40
+ {
41
+ keys: ["D"],
42
+ description: "Drawing"
43
+ },
44
+ {
45
+ keys: ["S"],
46
+ description: "Screenshot"
47
+ }
48
+ ]
49
+ },
50
+ {
51
+ title: "Formatting",
52
+ shortcuts: [
53
+ {
54
+ keys: ["⌘", "B"],
55
+ description: "Bold"
56
+ },
57
+ {
58
+ keys: ["⌘", "I"],
59
+ description: "Italic"
60
+ },
61
+ {
62
+ keys: ["⌘", "E"],
63
+ description: "Code"
64
+ },
65
+ {
66
+ keys: [
67
+ "⌘",
68
+ "⇧",
69
+ "X"
70
+ ],
71
+ description: "Strikethrough"
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ title: "Composer",
77
+ shortcuts: [
78
+ {
79
+ keys: ["↵"],
80
+ description: "Submit reply"
81
+ },
82
+ {
83
+ keys: ["⌘", "↵"],
84
+ description: "Submit comment"
85
+ },
86
+ {
87
+ keys: ["⇧", "↵"],
88
+ description: "New line"
89
+ },
90
+ {
91
+ keys: ["@"],
92
+ description: "Mention a user"
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ title: "Drawing",
98
+ shortcuts: [
99
+ {
100
+ keys: ["⌘", "Z"],
101
+ description: "Undo stroke"
102
+ },
103
+ {
104
+ keys: [
105
+ "⌘",
106
+ "⇧",
107
+ "Z"
108
+ ],
109
+ description: "Redo stroke"
110
+ },
111
+ {
112
+ keys: ["Esc"],
113
+ description: "Cancel drawing"
114
+ }
115
+ ]
116
+ }
117
+ ];
118
+ function a({ Kbd: a, KbdGroup: o, ScrollArea: s, Separator: c }) {
119
+ return /* @__PURE__ */ r(t, { children: [
120
+ /* @__PURE__ */ n(s, {
121
+ className: "ck-shortcuts-scroll",
122
+ children: /* @__PURE__ */ n("div", {
123
+ className: "ck-shortcuts-groups",
124
+ children: i.map((t, i) => /* @__PURE__ */ r(e.Fragment, { children: [i > 0 ? /* @__PURE__ */ n(c, {}) : null, /* @__PURE__ */ r("div", {
125
+ className: "ck-shortcuts-group",
126
+ children: [/* @__PURE__ */ n("p", {
127
+ className: "ck-shortcuts-label",
128
+ children: t.title
129
+ }), /* @__PURE__ */ n("div", {
130
+ className: "ck-shortcuts-list",
131
+ children: t.shortcuts.map((e) => /* @__PURE__ */ r("div", {
132
+ className: "ck-shortcuts-row",
133
+ children: [/* @__PURE__ */ n("span", {
134
+ className: "ck-shortcuts-description",
135
+ children: e.description
136
+ }), /* @__PURE__ */ n(o, { children: e.keys.map((t) => /* @__PURE__ */ n(a, { children: t }, `${e.description}-${t}`)) })]
137
+ }, e.description))
138
+ })]
139
+ })] }, t.title))
140
+ })
141
+ }),
142
+ /* @__PURE__ */ n(c, {}),
143
+ /* @__PURE__ */ r("p", {
144
+ className: "ck-shortcuts-footer",
145
+ children: [
146
+ "Press ",
147
+ /* @__PURE__ */ n(a, { children: "?" }),
148
+ " anytime to toggle this overlay"
149
+ ]
150
+ })
151
+ ] });
152
+ }
153
+ export { a as ShortcutContent };
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./button-By0hGrJK.js";
2
- import { i as t, o as n, r, t as i } from "./separator-XDBsaWyw.js";
2
+ import { i as t, o as n, r, t as i } from "./separator-aphZiRoJ.js";
3
3
  import { t as a } from "./createReactComponent-BZHeRbD0.js";
4
- import { B as o, V as s, b as c, s as l, z as u } from "./comment-kit-ui-CzfdAZs2.js";
4
+ import { C as o, H as s, U as c, W as l, u } from "./comment-kit-ui-BjJ1ZLiv.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", {
@@ -48,7 +48,7 @@ var y = 2500, b = ({ core: a, state: f }) => {
48
48
  className: "ck-dev-export-header",
49
49
  children: [/* @__PURE__ */ m("div", {
50
50
  className: "ck-dev-export-title",
51
- children: [/* @__PURE__ */ p(u, {
51
+ children: [/* @__PURE__ */ p(s, {
52
52
  size: 16,
53
53
  "aria-hidden": !0
54
54
  }), /* @__PURE__ */ p("strong", { children: "Dev export" })]
@@ -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(c, {
64
+ /* @__PURE__ */ p(o, {
65
65
  checked: A,
66
66
  indeterminate: j,
67
67
  onCheckedChange: () => {
@@ -113,8 +113,7 @@ var y = 2500, b = ({ core: a, state: f }) => {
113
113
  try {
114
114
  await a.copyAgentContext({
115
115
  commentIds: Array.from(g),
116
- includeResolved: !1,
117
- includeHtml: !0
116
+ includeResolved: !1
118
117
  }), w(Date.now());
119
118
  } catch {
120
119
  E("Could not copy. Allow clipboard access and try again.");
@@ -124,7 +123,7 @@ var y = 2500, b = ({ core: a, state: f }) => {
124
123
  }
125
124
  },
126
125
  disabled: M || x,
127
- children: [/* @__PURE__ */ p(o, {
126
+ children: [/* @__PURE__ */ p(c, {
128
127
  size: 14,
129
128
  "aria-hidden": !0
130
129
  }), x ? "Copying…" : `Copy ${g.size || ""} for agent`.trim()]
@@ -143,9 +142,9 @@ var y = 2500, b = ({ core: a, state: f }) => {
143
142
  " open comments."
144
143
  ]
145
144
  }),
146
- /* @__PURE__ */ p(l, {
145
+ /* @__PURE__ */ p(u, {
147
146
  className: "ck-dev-export-scroll",
148
- children: O.length === 0 ? /* @__PURE__ */ p(s, {
147
+ children: O.length === 0 ? /* @__PURE__ */ p(l, {
149
148
  className: "ck-dev-export-empty",
150
149
  children: "No open stakeholder comments on this project. Comments left in production or staging will show up here for bulk export."
151
150
  }) : /* @__PURE__ */ p("ul", {
@@ -155,7 +154,7 @@ var y = 2500, b = ({ core: a, state: f }) => {
155
154
  return /* @__PURE__ */ m("li", {
156
155
  className: "ck-dev-export-row",
157
156
  "data-checked": t,
158
- children: [/* @__PURE__ */ p(c, {
157
+ children: [/* @__PURE__ */ p(o, {
159
158
  checked: t,
160
159
  onCheckedChange: () => N(e.id),
161
160
  "aria-label": `Select ${e.title}`