@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.
Files changed (52) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +3 -3
  3. package/SECURITY.md +1 -1
  4. package/dist/angular.es.js +2 -2
  5. package/dist/comment-kit.es.js +3 -3
  6. package/dist/demo.es.js +24 -15
  7. package/dist/headless.es.js +2 -2
  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-DD6a0QaI.js +11 -0
  12. package/dist/shared/annotation-toolbar-RSrb0Nku.js +1086 -0
  13. package/dist/shared/{attachment-refresh-DmVkfPtl.js → attachment-refresh-CSTYwRW-.js} +3 -3
  14. package/dist/shared/{button-By0hGrJK.js → button-D4GHW6oZ.js} +133 -164
  15. package/dist/shared/{button-group-C285iSkZ.js → button-group-BVR7iT-S.js} +13 -13
  16. package/dist/shared/{comment-drawing-canvas-zIPS1dnW.js → comment-drawing-canvas-DbuXP54N.js} +2 -2
  17. package/dist/shared/{comment-icon-4SQd3nlz.js → comment-icon-D8JTCEJ7.js} +109 -110
  18. package/dist/shared/{comment-image-lightbox-CdMNf0_y.js → comment-image-lightbox-zlIGEVA-.js} +7 -7
  19. package/dist/shared/{comment-images-content-DqeqmQnb.js → comment-images-content-aYbJb79_.js} +38 -38
  20. package/dist/shared/{comment-kit-core-C-0JJS2i.js → comment-kit-core-B0k7XsMz.js} +742 -746
  21. package/dist/shared/{comment-kit-ui-CBaz7L3u.js → comment-kit-ui-BXLJcZYQ.js} +5310 -5718
  22. package/dist/shared/{comment-screenshot-annotator-CuYmKafz.js → comment-screenshot-annotator-ChWwYJzO.js} +2 -2
  23. package/dist/shared/{comment-screenshot-overlay-Dw81osel.js → comment-screenshot-overlay-Bufg3rHz.js} +6 -6
  24. package/dist/shared/{dev-export-panel-D08M2LKD.js → dev-export-panel-DAZenvgD.js} +6 -6
  25. package/dist/shared/{dev-grab-BJLZZ2xU.js → dev-grab-O8q25zar.js} +48 -47
  26. package/dist/shared/dist-D9A5k-N4.js +617 -0
  27. package/dist/shared/{element-selector-Biyn2cpR.js → element-selector-CYkwzfEr.js} +349 -347
  28. package/dist/shared/input-UPtAj0M6.js +111 -0
  29. package/dist/shared/{mount-ui-DXdL3p9b.js → mount-ui-BKaWBhKq.js} +4 -4
  30. package/dist/shared/{pusher-D4M5K6Dk.js → pusher-BUaiCkDJ.js} +1 -1
  31. package/dist/shared/{realtime-BTqYEy8s.js → realtime-C0Z8dXXH.js} +41 -28
  32. package/dist/shared/{realtime-recovery-BSVMwsXJ.js → realtime-recovery-BjlV-ewc.js} +57 -30
  33. package/dist/shared/screenshot-B-ZfFItT.js +199 -0
  34. package/dist/shared/{separator-aphZiRoJ.js → separator-UhJb0Row.js} +1222 -1288
  35. package/dist/shared/{shadow-root-C58Ap5Nu.js → shadow-root-Cd3SLHyj.js} +3 -5
  36. package/dist/shared/{token-session-D0Y_HZw0.js → token-session-DplW5QDx.js} +2 -2
  37. package/dist/shared/useLabelableId-8n0QmH8N.js +154 -0
  38. package/dist/shared/{useRender-D1z_X_BY.js → useRender-Uxk1OPK-.js} +1 -1
  39. package/dist/shared/{useValueChanged-CrzfD8l-.js → useValueChanged-DKq5cMot.js} +13 -13
  40. package/dist/shared/{websocket-manager-BFKa95TO.js → websocket-manager-798cRDyL.js} +2 -2
  41. package/dist/solid.es.js +2 -2
  42. package/dist/svelte.es.js +2 -2
  43. package/dist/types/core/api-client.d.ts +19 -9
  44. package/dist/types/core/comment-kit-core.d.ts +8 -4
  45. package/dist/types/core/types.d.ts +49 -9
  46. package/dist/types/core/write-access.d.ts +2 -0
  47. package/dist/vue.es.js +2 -2
  48. package/docs/api-reference.md +30 -18
  49. package/package.json +1 -1
  50. package/dist/shared/ShadowRootContext-CjciYxVN.js +0 -13
  51. package/dist/shared/annotation-toolbar-CpPKy0oq.js +0 -1094
  52. package/dist/shared/dist-De294MVF.js +0 -623
@@ -1,98 +1,98 @@
1
- import { d as e, s as t, t as n } from "./button-By0hGrJK.js";
2
- import { t as r } from "./useRender-D1z_X_BY.js";
3
- import { c as i, j as a, l as o, r as s } from "./comment-kit-ui-CBaz7L3u.js";
4
- import { n as c, r as l, t as u } from "./attachment-refresh-DmVkfPtl.js";
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: e, className: n, style: r, ...i }, a) {
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: t("ck-aspect-ratio", n),
11
+ className: e("ck-aspect-ratio", n),
12
12
  style: {
13
- "--ratio": e,
13
+ "--ratio": t,
14
14
  ...r
15
15
  },
16
16
  ...i
17
17
  });
18
- }), g = d.forwardRef(function({ className: e, state: n = "done", size: r = "default", orientation: i = "horizontal", ...a }, o) {
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: t("ck-attachment", e),
25
+ className: e("ck-attachment", t),
26
26
  ...a
27
27
  });
28
- }), _ = d.forwardRef(function({ className: e, variant: n = "icon", ...r }, i) {
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: t("ck-attachment-media", e),
33
+ className: e("ck-attachment-media", t),
34
34
  ...r
35
35
  });
36
36
  });
37
- d.forwardRef(function({ className: e, ...n }, r) {
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: t("ck-attachment-group", e),
41
+ className: e("ck-attachment-group", t),
42
42
  ...n
43
43
  });
44
44
  });
45
- var v = d.forwardRef(function({ className: e, ...n }, r) {
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: t("ck-attachment-content", e),
49
+ className: e("ck-attachment-content", t),
50
50
  ...n
51
51
  });
52
- }), y = d.forwardRef(function({ className: e, ...n }, r) {
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: t("ck-attachment-title", e),
56
+ className: e("ck-attachment-title", t),
57
57
  ...n
58
58
  });
59
- }), b = d.forwardRef(function({ className: e, ...n }, r) {
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: t("ck-attachment-description", e),
63
+ className: e("ck-attachment-description", t),
64
64
  ...n
65
65
  });
66
66
  });
67
- d.forwardRef(function({ className: e, ...n }, r) {
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: t("ck-attachment-actions", e),
71
+ className: e("ck-attachment-actions", t),
72
72
  ...n
73
73
  });
74
- }), d.forwardRef(function({ className: e, variant: t = "ghost", size: r = "icon-xs", ...i }, a) {
75
- return /* @__PURE__ */ p(n, {
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: t,
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: n, render: i, type: a, ...o }, s) {
84
+ var x = d.forwardRef(function({ className: t, render: i, type: a, ...o }, s) {
85
85
  return r({
86
86
  defaultTagName: "button",
87
- props: e({
87
+ props: n({
88
88
  ref: s,
89
89
  type: i ? a : a ?? "button",
90
- className: t("ck-attachment-trigger", n)
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-CdMNf0_y.js"), C = 3;
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, i] = 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
- i(e), n(!0);
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(a, {
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 a = l(e), s = e.filename ?? e.alt ?? `Image ${String(t + 1)}`;
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: a.failed ? /* @__PURE__ */ p(u, {
155
- link: a,
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: a.onError
162
- }, `${e.url}:${a.attempt}`)
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
- i(e.size)
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…" : i(e.size) ?? "File" })] }),
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,