@commentkit/comment-kit 0.7.4 → 0.7.5

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 (49) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +2 -2
  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-DgqxkHy8.js +1085 -0
  13. package/dist/shared/{attachment-refresh-DmVkfPtl.js → attachment-refresh-DRX7dKDI.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-hSdcLShI.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-4zroOCCG.js} +7 -7
  19. package/dist/shared/{comment-images-content-DqeqmQnb.js → comment-images-content-D4hTya6e.js} +28 -28
  20. package/dist/shared/{comment-kit-core-C-0JJS2i.js → comment-kit-core-D068rcdY.js} +467 -503
  21. package/dist/shared/{comment-kit-ui-CBaz7L3u.js → comment-kit-ui-BDzNt0jv.js} +5077 -5253
  22. package/dist/shared/{comment-screenshot-annotator-CuYmKafz.js → comment-screenshot-annotator-BGnu_NgP.js} +2 -2
  23. package/dist/shared/{comment-screenshot-overlay-Dw81osel.js → comment-screenshot-overlay-BCRmojWB.js} +4 -4
  24. package/dist/shared/{dev-export-panel-D08M2LKD.js → dev-export-panel-CYmUKmIV.js} +3 -3
  25. package/dist/shared/{dev-grab-BJLZZ2xU.js → dev-grab-BYsCpsGI.js} +48 -47
  26. package/dist/shared/dist-D9A5k-N4.js +617 -0
  27. package/dist/shared/{element-selector-Biyn2cpR.js → element-selector-79Oo5pit.js} +4 -4
  28. package/dist/shared/{mount-ui-DXdL3p9b.js → mount-ui-DuHk132g.js} +4 -4
  29. package/dist/shared/{pusher-D4M5K6Dk.js → pusher-3jyUauYd.js} +1 -1
  30. package/dist/shared/{realtime-BTqYEy8s.js → realtime-DspH16g5.js} +41 -28
  31. package/dist/shared/{realtime-recovery-BSVMwsXJ.js → realtime-recovery-BjlV-ewc.js} +57 -30
  32. package/dist/shared/screenshot-BIuEaRiu.js +199 -0
  33. package/dist/shared/{separator-aphZiRoJ.js → separator-UhJb0Row.js} +1222 -1288
  34. package/dist/shared/{shadow-root-C58Ap5Nu.js → shadow-root-3-yGIhMs.js} +3 -5
  35. package/dist/shared/{token-session-D0Y_HZw0.js → token-session-_Pi4fOEi.js} +1 -1
  36. package/dist/shared/{useRender-D1z_X_BY.js → useRender-Uxk1OPK-.js} +1 -1
  37. package/dist/shared/{useValueChanged-CrzfD8l-.js → useValueChanged-DKq5cMot.js} +13 -13
  38. package/dist/shared/{websocket-manager-BFKa95TO.js → websocket-manager-CvgZSo_L.js} +2 -2
  39. package/dist/solid.es.js +2 -2
  40. package/dist/svelte.es.js +2 -2
  41. package/dist/types/core/api-client.d.ts +17 -9
  42. package/dist/types/core/comment-kit-core.d.ts +4 -2
  43. package/dist/types/core/types.d.ts +37 -4
  44. package/dist/vue.es.js +2 -2
  45. package/docs/api-reference.md +29 -17
  46. package/package.json +1 -1
  47. package/dist/shared/ShadowRootContext-CjciYxVN.js +0 -13
  48. package/dist/shared/annotation-toolbar-CpPKy0oq.js +0 -1094
  49. package/dist/shared/dist-De294MVF.js +0 -623
@@ -1,24 +1,24 @@
1
- import { B as e, L as t, M as n, O as r, T as i, g as a, j as o, m as s, p as c, x as l, z as u } from "./button-By0hGrJK.js";
2
- import { $t as d, Ct as f, Dt as p, Et as m, J as ee, Mt as h, Ot as g, Qt as te, Tt as ne, U as _, Z as re, Zt as v, at as ie, bt as ae, cn as oe, ct as se, en as y, gt as ce, in as le, it as ue, jt as de, kt as fe, lt as pe, nn as me, nt as he, ot as ge, rn as _e, rt as ve, tn as b, tt as ye, un as x, ut as be, wt as S } from "./separator-aphZiRoJ.js";
3
- import { N as xe, P as Se, f as Ce, j as we, k as C, t as w } from "./useValueChanged-CrzfD8l-.js";
1
+ import { A as e, C as t, E as n, F as r, L as i, R as a, d as o, f as s, k as c, m as l, y as u } from "./button-D4GHW6oZ.js";
2
+ import { $t as d, Ct as f, Dt as p, Et as m, J as ee, Mt as h, Ot as g, Qt as te, Tt as ne, U as _, Z as re, Zt as v, at as ie, bt as ae, cn as oe, ct as se, en as y, gt as ce, in as le, it as ue, jt as de, kt as fe, lt as pe, nn as me, nt as he, ot as ge, rn as _e, rt as ve, tn as b, tt as ye, un as x, ut as be, wt as S } from "./separator-UhJb0Row.js";
3
+ import { N as xe, P as Se, f as Ce, j as we, k as C, t as w } from "./useValueChanged-DKq5cMot.js";
4
4
  import * as T from "react";
5
5
  import { jsx as E, jsxs as Te } from "react/jsx-runtime";
6
6
  var D = 0;
7
- function O(t, n = {}) {
8
- let { preventScroll: r = !1, sync: i = !1, shouldFocus: a } = n;
7
+ function O(e, t = {}) {
8
+ let { preventScroll: n = !1, sync: r = !1, shouldFocus: i } = t;
9
9
  cancelAnimationFrame(D);
10
10
  function o() {
11
- (!a || a()) && t?.focus({ preventScroll: r });
11
+ (!i || i()) && e?.focus({ preventScroll: n });
12
12
  }
13
- if (i) return o(), e;
13
+ if (r) return o(), a;
14
14
  let s = requestAnimationFrame(o);
15
15
  return D = s, () => {
16
16
  D === s && (cancelAnimationFrame(s), D = 0);
17
17
  };
18
18
  }
19
19
  var Ee = "data-base-ui-inert", k = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakSet(), j = /* @__PURE__ */ new WeakMap(), M = 0;
20
- function N(e) {
21
- return e ? n(e) ? e.host : N(e.parentNode) : null;
20
+ function N(t) {
21
+ return t ? e(t) ? t.host : N(t.parentNode) : null;
22
22
  }
23
23
  var P = (e, t) => t.map((t) => {
24
24
  if (e.contains(t)) return t;
@@ -33,7 +33,7 @@ var P = (e, t) => t.map((t) => {
33
33
  }, De = (e, t, n) => {
34
34
  let r = [], i = (e) => {
35
35
  e && !n.has(e) && Array.from(e.children).forEach((e) => {
36
- l(e) !== "script" && (t.has(e) ? i(e) : r.push(e));
36
+ u(e) !== "script" && (t.has(e) ? i(e) : r.push(e));
37
37
  });
38
38
  };
39
39
  return i(e), r;
@@ -64,16 +64,16 @@ function Oe(e, t = {}) {
64
64
  let { ariaHidden: n = !1, mark: r = !0 } = t, i = f(e[0]).body;
65
65
  return I(e, i, n, { mark: r });
66
66
  }
67
- function ke(e, t) {
68
- let n = i(y(e));
69
- return e instanceof n.KeyboardEvent ? "keyboard" : e instanceof n.FocusEvent ? t || "keyboard" : "pointerType" in e ? e.pointerType || (me(e) ? "keyboard" : t || "mouse") : "touches" in e ? "touch" : e instanceof n.MouseEvent ? t || (e.detail === 0 ? "keyboard" : "mouse") : "";
67
+ function ke(e, n) {
68
+ let r = t(y(e));
69
+ return e instanceof r.KeyboardEvent ? "keyboard" : e instanceof r.FocusEvent ? n || "keyboard" : "pointerType" in e ? e.pointerType || (me(e) ? "keyboard" : n || "mouse") : "touches" in e ? "touch" : e instanceof r.MouseEvent ? n || (e.detail === 0 ? "keyboard" : "mouse") : "";
70
70
  }
71
71
  var Ae = 20, L = [];
72
72
  function je() {
73
73
  L = L.filter((e) => e.deref()?.isConnected);
74
74
  }
75
75
  function Me(e) {
76
- je(), e && l(e) !== "body" && (L.push(new WeakRef(e)), L.length > Ae && (L = L.slice(-20)));
76
+ je(), e && u(e) !== "body" && (L.push(new WeakRef(e)), L.length > Ae && (L = L.slice(-20)));
77
77
  }
78
78
  function Ne() {
79
79
  return je(), L[L.length - 1]?.deref();
@@ -90,22 +90,22 @@ function Fe(e) {
90
90
  t.length === 0 ? n !== "0" && (e.setAttribute("tabindex", "0"), e.setAttribute("data-tabindex", "0")) : (n !== "-1" || e.hasAttribute("data-tabindex") && e.getAttribute("data-tabindex") !== "-1") && (e.setAttribute("tabindex", "-1"), e.setAttribute("data-tabindex", "-1"));
91
91
  }
92
92
  function Ie(e) {
93
- let { context: n, children: i, disabled: o = !1, initialFocus: c = !0, returnFocus: u = !0, explicitReturnFocus: ue, restoreFocus: b = !1, modal: x = !0, closeOnFocusOut: S = !0, openInteractionType: xe = "", nextFocusableElement: C, previousFocusableElement: w, beforeContentFocusGuardRef: D, externalTree: Ee, getInsideElements: k } = e, A = n.useState("open"), j = n.useState("domReferenceElement"), M = n.useState("floatingElement"), { events: N, dataRef: P } = n.context, F = s(() => P.current.floatingContext?.nodeId), De = c === !1, I = de(j) && De, Ae = m(c), L = m(u), Ie = m(ue), R = m(xe), Le = m(A), z = ee(Ee), B = re(), V = T.useRef(!1), H = T.useRef(!1), U = T.useRef(!1), Re = T.useRef(null), W = T.useRef(""), G = T.useRef(""), K = T.useRef(null), q = T.useRef(null), ze = a(K, D, B?.beforeInsideRef), Be = a(q, B?.afterInsideRef), Ve = Se(), J = Se(), He = ne(), Y = B != null, X = fe(M), Z = s((e = X) => e ? be(e) : []), Q = s(() => k?.().filter((e) => e != null) ?? []);
93
+ let { context: t, children: i, disabled: a = !1, initialFocus: o = !0, returnFocus: c = !0, explicitReturnFocus: ue, restoreFocus: b = !1, modal: x = !0, closeOnFocusOut: S = !0, openInteractionType: xe = "", nextFocusableElement: C, previousFocusableElement: w, beforeContentFocusGuardRef: D, externalTree: Ee, getInsideElements: k } = e, A = t.useState("open"), j = t.useState("domReferenceElement"), M = t.useState("floatingElement"), { events: N, dataRef: P } = t.context, F = s(() => P.current.floatingContext?.nodeId), De = o === !1, I = de(j) && De, Ae = m(o), L = m(c), Ie = m(ue), R = m(xe), Le = m(A), z = ee(Ee), B = re(), V = T.useRef(!1), H = T.useRef(!1), U = T.useRef(!1), Re = T.useRef(null), W = T.useRef(""), G = T.useRef(""), K = T.useRef(null), q = T.useRef(null), ze = l(K, D, B?.beforeInsideRef), Be = l(q, B?.afterInsideRef), Ve = Se(), J = Se(), He = ne(), Y = B != null, X = fe(M), Z = s((e = X) => e ? be(e) : []), Q = s(() => k?.().filter((e) => e != null) ?? []);
94
94
  T.useEffect(() => {
95
- if (o || !x) return;
95
+ if (a || !x) return;
96
96
  function e(e) {
97
97
  e.key === "Tab" && d(X, v(f(X))) && Z().length === 0 && !I && le(e);
98
98
  }
99
99
  let t = f(X);
100
100
  return g(t, "keydown", e);
101
101
  }, [
102
- o,
102
+ a,
103
103
  X,
104
104
  x,
105
105
  I,
106
106
  Z
107
107
  ]), T.useEffect(() => {
108
- if (o || !A) return;
108
+ if (a || !A) return;
109
109
  let e = f(X);
110
110
  function t() {
111
111
  U.current = !1;
@@ -121,7 +121,7 @@ function Ie(e) {
121
121
  }
122
122
  return p(g(e, "pointerdown", n, !0), g(e, "pointerup", t, !0), g(e, "pointercancel", t, !0), g(e, "keydown", r, !0), t);
123
123
  }, [
124
- o,
124
+ a,
125
125
  M,
126
126
  j,
127
127
  X,
@@ -130,9 +130,9 @@ function Ie(e) {
130
130
  J,
131
131
  Q
132
132
  ]), T.useEffect(() => {
133
- if (o || !S) return;
133
+ if (a || !S) return;
134
134
  let e = f(X);
135
- function t() {
135
+ function r() {
136
136
  H.current = !0, J.start(0, () => {
137
137
  H.current = !1;
138
138
  });
@@ -141,10 +141,10 @@ function Ie(e) {
141
141
  let t = y(e);
142
142
  pe(t) && (Re.current = t);
143
143
  }
144
- function a(t) {
145
- let i = t.relatedTarget, a = t.currentTarget, o = y(t);
144
+ function o(r) {
145
+ let i = r.relatedTarget, a = r.currentTarget, o = y(r);
146
146
  x && i == null && o != null && d(M, o) && Me(o), queueMicrotask(() => {
147
- let s = F(), c = n.context.triggerElements, l = Q(), u = i?.hasAttribute(ye("focus-guard")) && [
147
+ let s = F(), c = t.context.triggerElements, l = Q(), u = i?.hasAttribute(ye("focus-guard")) && [
148
148
  K.current,
149
149
  q.current,
150
150
  B?.beforeInsideRef.current,
@@ -155,16 +155,16 @@ function Ie(e) {
155
155
  _(C)
156
156
  ].includes(i), f = !(d(j, i) || d(M, i) || d(i, M) || d(B?.portalNode, i) || l.some((e) => e === i || d(e, i)) || c.hasMatchingElement((e) => d(e, i)) || u || z && (ve(z.nodesRef.current, s).find((e) => d(e.context?.elements.floating, i) || d(e.context?.elements.domReference, i)) || he(z.nodesRef.current, s).find((e) => [e.context?.elements.floating, fe(e.context?.elements.floating)].includes(i) || e.context?.elements.domReference === i)));
157
157
  if (a === j && X && Fe(X), b && a !== j && !ce(o) && v(e) === e.body) {
158
- if (r(X) && (X.focus(), b === "popup")) {
158
+ if (n(X) && (X.focus(), b === "popup")) {
159
159
  He.request(() => {
160
160
  X.focus();
161
161
  });
162
162
  return;
163
163
  }
164
- let e = Z(), t = Re.current, n = (t && e.includes(t) ? t : null) || e[e.length - 1] || X;
165
- r(n) && n.focus();
164
+ let e = Z(), t = Re.current, r = (t && e.includes(t) ? t : null) || e[e.length - 1] || X;
165
+ n(r) && r.focus();
166
166
  }
167
- P.current.insideReactTree ? P.current.insideReactTree = !1 : (I || !x) && i && f && !H.current && (I || i !== Ne()) && (V.current = !0, n.setOpen(!1, we(Ce, t)));
167
+ P.current.insideReactTree ? P.current.insideReactTree = !1 : (I || !x) && i && f && !H.current && (I || i !== Ne()) && (V.current = !0, t.setOpen(!1, we(Ce, r)));
168
168
  });
169
169
  }
170
170
  function s() {
@@ -172,17 +172,17 @@ function Ie(e) {
172
172
  P.current.insideReactTree = !1;
173
173
  }));
174
174
  }
175
- let c = r(j) ? j : null;
176
- if (M || c) return p(c && g(c, "focusout", a), c && g(c, "pointerdown", t), M && g(M, "focusin", i), M && g(M, "focusout", a), M && B && g(M, "focusout", s, !0));
175
+ let c = n(j) ? j : null;
176
+ if (M || c) return p(c && g(c, "focusout", o), c && g(c, "pointerdown", r), M && g(M, "focusin", i), M && g(M, "focusout", o), M && B && g(M, "focusout", s, !0));
177
177
  }, [
178
- o,
178
+ a,
179
179
  j,
180
180
  M,
181
181
  X,
182
182
  x,
183
183
  z,
184
184
  B,
185
- n,
185
+ t,
186
186
  S,
187
187
  b,
188
188
  Z,
@@ -196,7 +196,7 @@ function Ie(e) {
196
196
  w,
197
197
  Q
198
198
  ]), T.useEffect(() => {
199
- if (o || !M || !A) return;
199
+ if (a || !M || !A) return;
200
200
  let e = Array.from(B?.portalNode?.querySelectorAll(`[${ye("portal")}]`) || []), t = (z ? he(z.nodesRef.current, F()) : []).find((e) => de(e.context?.elements.domReference || null))?.context?.elements.domReference, n = Oe([
201
201
  M,
202
202
  ...e,
@@ -218,7 +218,7 @@ function Ie(e) {
218
218
  };
219
219
  }, [
220
220
  A,
221
- o,
221
+ a,
222
222
  j,
223
223
  M,
224
224
  x,
@@ -229,8 +229,8 @@ function Ie(e) {
229
229
  C,
230
230
  w,
231
231
  Q
232
- ]), t(() => {
233
- if (!A || o || !r(X)) return;
232
+ ]), r(() => {
233
+ if (!A || a || !n(X)) return;
234
234
  W.current = "", G.current = "";
235
235
  let e = f(X), t = v(e);
236
236
  queueMicrotask(() => {
@@ -251,7 +251,7 @@ function Ie(e) {
251
251
  });
252
252
  });
253
253
  }, [
254
- o,
254
+ a,
255
255
  A,
256
256
  X,
257
257
  Z,
@@ -261,13 +261,13 @@ function Ie(e) {
261
261
  P
262
262
  ]);
263
263
  let $ = T.useRef(null);
264
- t(() => {
265
- if (o || !X) {
264
+ r(() => {
265
+ if (a || !X) {
266
266
  $.current = null;
267
267
  return;
268
268
  }
269
269
  $.current &&= ($.current.cancelled = !0, null);
270
- let e = f(X), t = v(e), n = R.current == null;
270
+ let e = f(X), t = v(e), r = R.current == null;
271
271
  Me(t);
272
272
  function i(e) {
273
273
  if (e.open || (W.current = ke(e.nativeEvent, G.current)), (e.reason === "focus-out" && e.triggerElement?.hasAttribute(ye("focus-guard")) || e.reason === "trigger-hover" && e.nativeEvent.type === "mouseleave") && (V.current = !0), e.reason === "outside-press") {
@@ -282,28 +282,28 @@ function Ie(e) {
282
282
  }
283
283
  }
284
284
  N.on("openchange", i);
285
- function a(e) {
286
- let r = L.current, i = typeof r == "function" ? r(e) : r;
285
+ function o(e) {
286
+ let n = L.current, i = typeof n == "function" ? n(e) : n;
287
287
  if (i === void 0 || i === !1) return null;
288
288
  i === null && (i = !0);
289
- let a = j?.isConnected ? j : null, o = t?.isConnected && l(t) !== "body" ? t : null, s = n ? o || a : a || o;
289
+ let a = j?.isConnected ? j : null, o = t?.isConnected && u(t) !== "body" ? t : null, s = r ? o || a : a || o;
290
290
  return s ||= Ne() || null, typeof i == "boolean" ? s : _(i) || s || null;
291
291
  }
292
292
  return () => {
293
293
  N.off("openchange", i);
294
- let t = v(e), n = Q(), o = d(M, t) || n.some((e) => e === t || d(e, t)) || z && ve(z.nodesRef.current, F(), !1).some((e) => d(e.context?.elements.floating, t)), s = L.current, c = W.current, l = a(c), u = { cancelled: !1 };
294
+ let t = v(e), r = Q(), a = d(M, t) || r.some((e) => e === t || d(e, t)) || z && ve(z.nodesRef.current, F(), !1).some((e) => d(e.context?.elements.floating, t)), s = L.current, c = W.current, l = o(c), u = { cancelled: !1 };
295
295
  $.current = u, queueMicrotask(() => {
296
296
  $.current === u && ($.current = null);
297
- let n = Pe(l), i = Ie.current ?? typeof s != "boolean";
298
- if (!u.cancelled && s && !V.current && r(n) && (i || n === t || t === e.body || o)) {
297
+ let r = Pe(l), i = Ie.current ?? typeof s != "boolean";
298
+ if (!u.cancelled && s && !V.current && n(r) && (i || r === t || t === e.body || a)) {
299
299
  let e = { preventScroll: !0 };
300
- c === "keyboard" && (e.focusVisible = !0), n.focus(e);
300
+ c === "keyboard" && (e.focusVisible = !0), r.focus(e);
301
301
  }
302
302
  V.current = !1;
303
303
  });
304
304
  };
305
305
  }, [
306
- o,
306
+ a,
307
307
  M,
308
308
  X,
309
309
  L,
@@ -314,34 +314,34 @@ function Ie(e) {
314
314
  j,
315
315
  F,
316
316
  Q
317
- ]), t(() => {
317
+ ]), r(() => {
318
318
  if (!oe || A || !M) return;
319
319
  let e = v(f(M));
320
- r(e) && h(e) && d(M, e) && e.blur();
321
- }, [A, M]), t(() => {
322
- if (!o && B) return B.setFocusManagerState({
320
+ n(e) && h(e) && d(M, e) && e.blur();
321
+ }, [A, M]), r(() => {
322
+ if (!a && B) return B.setFocusManagerState({
323
323
  modal: x,
324
324
  closeOnFocusOut: S,
325
325
  open: A,
326
- onOpenChange: n.setOpen,
326
+ onOpenChange: t.setOpen,
327
327
  domReference: j
328
328
  }), () => {
329
329
  B.setFocusManagerState(null);
330
330
  };
331
331
  }, [
332
- o,
332
+ a,
333
333
  B,
334
334
  x,
335
335
  A,
336
- n,
336
+ t,
337
337
  S,
338
338
  j
339
- ]), t(() => {
340
- if (!o && X) return Fe(X), () => {
339
+ ]), r(() => {
340
+ if (!a && X) return Fe(X), () => {
341
341
  queueMicrotask(je);
342
342
  };
343
- }, [o, X]);
344
- let Ue = !o && (!x || !I) && (Y || x);
343
+ }, [a, X]);
344
+ let Ue = !a && (!x || !I) && (Y || x);
345
345
  return /*#__PURE__*/ Te(T.Fragment, { children: [
346
346
  Ue && /*#__PURE__*/ E(ae, {
347
347
  "data-type": "inside",
@@ -364,71 +364,71 @@ function Ie(e) {
364
364
  ] });
365
365
  }
366
366
  function R(e, t = {}) {
367
- let { enabled: n = !0, event: r = "click", toggle: i = !0, ignoreMouse: a = !1, stickIfOpen: o = !0, touchOpenDelay: s = 0, reason: c = C } = t, l = e.context.dataRef, d = T.useRef(void 0), f = ne(), p = Se(), m = T.useMemo(() => {
367
+ let { enabled: n = !0, event: r = "click", toggle: a = !0, ignoreMouse: o = !1, stickIfOpen: s = !0, touchOpenDelay: c = 0, reason: l = C } = t, u = e.context.dataRef, d = T.useRef(void 0), f = ne(), p = Se(), m = T.useMemo(() => {
368
368
  function t(t, n, r, i) {
369
- let a = we(c, n, r);
370
- t && i === "touch" && s > 0 ? p.start(s, () => {
369
+ let a = we(l, n, r);
370
+ t && i === "touch" && c > 0 ? p.start(c, () => {
371
371
  e.setOpen(!0, a);
372
372
  }) : e.setOpen(t, a);
373
373
  }
374
374
  function n(t, n, r) {
375
- let a = l.current.openEvent, s = e.select("domReferenceElement") !== n;
376
- return t && s || !t || !i ? !0 : a && (typeof o == "function" ? o() : o) ? !r(a.type) : !1;
375
+ let i = u.current.openEvent, o = e.select("domReferenceElement") !== n;
376
+ return t && o || !t || !a ? !0 : i && (typeof s == "function" ? s() : s) ? !r(i.type) : !1;
377
377
  }
378
378
  return {
379
379
  onPointerDown(e) {
380
380
  d.current = b(e.pointerType, !0) && _e(e.nativeEvent) ? "virtual" : e.pointerType;
381
381
  },
382
382
  onMouseDown(i) {
383
- let o = d.current, s = i.nativeEvent, c = e.select("open");
384
- if (i.button !== 0 || r === "click" || b(o, !0) && a) return;
383
+ let a = d.current, s = i.nativeEvent, c = e.select("open");
384
+ if (i.button !== 0 || r === "click" || b(a, !0) && o) return;
385
385
  let l = n(c, i.currentTarget, (e) => e === "click" || e === "mousedown"), u = y(s), p = h(u);
386
- if (p || o === "virtual") {
387
- t(l, s, p ? u : i.currentTarget, o);
386
+ if (p || a === "virtual") {
387
+ t(l, s, p ? u : i.currentTarget, a);
388
388
  return;
389
389
  }
390
390
  let m = i.currentTarget;
391
391
  f.request(() => {
392
- t(l, s, m, o);
392
+ t(l, s, m, a);
393
393
  });
394
394
  },
395
395
  onClick(i) {
396
396
  if (r === "mousedown-only") return;
397
- let o = d.current;
398
- r === "mousedown" && o ? d.current = void 0 : b(o, !0) && a || t(n(e.select("open"), i.currentTarget, (e) => e === "click" || e === "mousedown" || e === "keydown" || e === "keyup"), i.nativeEvent, i.currentTarget, o);
397
+ let a = d.current;
398
+ r === "mousedown" && a ? d.current = void 0 : b(a, !0) && o || t(n(e.select("open"), i.currentTarget, (e) => e === "click" || e === "mousedown" || e === "keydown" || e === "keyup"), i.nativeEvent, i.currentTarget, a);
399
399
  },
400
400
  onKeyDown() {
401
401
  d.current = void 0;
402
402
  }
403
403
  };
404
404
  }, [
405
- l,
405
+ u,
406
406
  r,
407
- a,
408
- c,
409
- e,
410
407
  o,
411
- i,
408
+ l,
409
+ e,
410
+ s,
411
+ a,
412
412
  f,
413
413
  p,
414
- s
414
+ c
415
415
  ]);
416
- return T.useMemo(() => n ? { reference: m } : u, [n, m]);
416
+ return T.useMemo(() => n ? { reference: m } : i, [n, m]);
417
417
  }
418
418
  function Le(e) {
419
- return c(19) ? e : e ? "true" : void 0;
419
+ return o(19) ? e : e ? "true" : void 0;
420
420
  }
421
421
  var z = {}, B = {}, V = "";
422
422
  function H(e, t) {
423
- return o(e) ? e : t;
423
+ return c(e) ? e : t;
424
424
  }
425
425
  function U(e, t, n) {
426
426
  return /hidden|clip/.test(e.getComputedStyle(H(t, n)).overflowY);
427
427
  }
428
428
  function Re(e) {
429
429
  if (typeof document > "u") return !1;
430
- let t = f(e);
431
- return i(t).innerWidth - t.documentElement.clientWidth > 0;
430
+ let n = f(e);
431
+ return t(n).innerWidth - n.documentElement.clientWidth > 0;
432
432
  }
433
433
  function W(e) {
434
434
  if (!(typeof CSS < "u" && CSS.supports && CSS.supports("scrollbar-gutter", "stable")) || typeof document > "u") return !1;
@@ -452,29 +452,29 @@ function G(e) {
452
452
  };
453
453
  }
454
454
  function K(e) {
455
- let t = f(e), n = t.documentElement, r = t.body, a = i(n), o = 0, s = 0, c = !1, l = S.create();
455
+ let n = f(e), r = n.documentElement, i = n.body, a = t(r), o = 0, s = 0, c = !1, l = S.create();
456
456
  if (oe && (a.visualViewport?.scale ?? 1) !== 1) return () => {};
457
457
  function u() {
458
- let t = a.getComputedStyle(n), i = a.getComputedStyle(r), l = (t.scrollbarGutter || "").includes("both-edges") ? "stable both-edges" : "stable";
459
- o = n.scrollTop, s = n.scrollLeft, z = {
460
- scrollbarGutter: n.style.scrollbarGutter,
461
- overflowY: n.style.overflowY,
462
- overflowX: n.style.overflowX
463
- }, V = n.style.scrollBehavior, B = {
464
- position: r.style.position,
465
- height: r.style.height,
466
- width: r.style.width,
467
- boxSizing: r.style.boxSizing,
458
+ let t = a.getComputedStyle(r), n = a.getComputedStyle(i), l = (t.scrollbarGutter || "").includes("both-edges") ? "stable both-edges" : "stable";
459
+ o = r.scrollTop, s = r.scrollLeft, z = {
460
+ scrollbarGutter: r.style.scrollbarGutter,
468
461
  overflowY: r.style.overflowY,
469
- overflowX: r.style.overflowX,
470
- scrollBehavior: r.style.scrollBehavior
462
+ overflowX: r.style.overflowX
463
+ }, V = r.style.scrollBehavior, B = {
464
+ position: i.style.position,
465
+ height: i.style.height,
466
+ width: i.style.width,
467
+ boxSizing: i.style.boxSizing,
468
+ overflowY: i.style.overflowY,
469
+ overflowX: i.style.overflowX,
470
+ scrollBehavior: i.style.scrollBehavior
471
471
  };
472
- let u = n.scrollHeight > n.clientHeight, d = n.scrollWidth > n.clientWidth, f = t.overflowY === "scroll" || i.overflowY === "scroll", p = t.overflowX === "scroll" || i.overflowX === "scroll", m = Math.max(0, a.innerWidth - r.clientWidth), ee = Math.max(0, a.innerHeight - r.clientHeight), h = parseFloat(i.marginTop) + parseFloat(i.marginBottom), g = parseFloat(i.marginLeft) + parseFloat(i.marginRight), te = H(n, r);
473
- c = W(e), c ? (n.style.scrollbarGutter = l, te.style.overflowY = "hidden", te.style.overflowX = "hidden") : (Object.assign(n.style, {
472
+ let u = r.scrollHeight > r.clientHeight, d = r.scrollWidth > r.clientWidth, f = t.overflowY === "scroll" || n.overflowY === "scroll", p = t.overflowX === "scroll" || n.overflowX === "scroll", m = Math.max(0, a.innerWidth - i.clientWidth), ee = Math.max(0, a.innerHeight - i.clientHeight), h = parseFloat(n.marginTop) + parseFloat(n.marginBottom), g = parseFloat(n.marginLeft) + parseFloat(n.marginRight), te = H(r, i);
473
+ c = W(e), c ? (r.style.scrollbarGutter = l, te.style.overflowY = "hidden", te.style.overflowX = "hidden") : (Object.assign(r.style, {
474
474
  scrollbarGutter: l,
475
475
  overflowY: "hidden",
476
476
  overflowX: "hidden"
477
- }), (u || f) && (n.style.overflowY = "scroll"), (d || p) && (n.style.overflowX = "scroll"), Object.assign(r.style, {
477
+ }), (u || f) && (r.style.overflowY = "scroll"), (d || p) && (r.style.overflowX = "scroll"), Object.assign(i.style, {
478
478
  position: "relative",
479
479
  height: h || ee ? `calc(100dvh - ${h + ee}px)` : "100dvh",
480
480
  width: g || m ? `calc(100vw - ${g + m}px)` : "100vw",
@@ -482,10 +482,10 @@ function K(e) {
482
482
  overflowY: "hidden",
483
483
  overflowX: "hidden",
484
484
  scrollBehavior: "unset"
485
- }), r.scrollTop = o, r.scrollLeft = s, n.setAttribute("data-base-ui-scroll-locked", ""), n.style.scrollBehavior = "unset");
485
+ }), i.scrollTop = o, i.scrollLeft = s, r.setAttribute("data-base-ui-scroll-locked", ""), r.style.scrollBehavior = "unset");
486
486
  }
487
487
  function d() {
488
- Object.assign(n.style, z), Object.assign(r.style, B), c || (n.scrollTop = o, n.scrollLeft = s, n.removeAttribute("data-base-ui-scroll-locked"), n.style.scrollBehavior = V);
488
+ Object.assign(r.style, z), Object.assign(i.style, B), c || (r.scrollTop = o, r.scrollLeft = s, r.removeAttribute("data-base-ui-scroll-locked"), r.style.scrollBehavior = V);
489
489
  }
490
490
  function p() {
491
491
  d(), l.request(u);
@@ -512,22 +512,22 @@ var q = new class {
512
512
  };
513
513
  lock(e) {
514
514
  if (this.lockCount === 0 || this.restore !== null) return;
515
- let t = f(e), n = t.documentElement, r = t.body, a = i(n);
516
- if (U(a, n, r)) {
515
+ let n = f(e), r = n.documentElement, i = n.body, a = t(r);
516
+ if (U(a, r, i)) {
517
517
  let t = new a.MutationObserver(() => {
518
- U(a, n, r) || (t.disconnect(), this.restore = null, this.lock(e));
519
- }), i = { attributes: !0 };
520
- t.observe(n, i), t.observe(r, i), this.restore = () => t.disconnect();
518
+ U(a, r, i) || (t.disconnect(), this.restore = null, this.lock(e));
519
+ }), n = { attributes: !0 };
520
+ t.observe(r, n), t.observe(i, n), this.restore = () => t.disconnect();
521
521
  return;
522
522
  }
523
523
  let o = x || !Re(e);
524
524
  this.restore = o ? G(e) : K(e);
525
525
  }
526
526
  }();
527
- function ze(e = !0, n = null) {
528
- t(() => {
529
- if (e) return q.acquire(n);
530
- }, [e, n]);
527
+ function ze(e = !0, t = null) {
528
+ r(() => {
529
+ if (e) return q.acquire(t);
530
+ }, [e, t]);
531
531
  }
532
532
  var Be = /*#__PURE__*/ T.forwardRef(function(e, t) {
533
533
  let { cutout: n, ...r } = e, i;
@@ -549,7 +549,6 @@ var Be = /*#__PURE__*/ T.forwardRef(function(e, t) {
549
549
  }
550
550
  });
551
551
  });
552
- process.env.NODE_ENV !== "production" && (Be.displayName = "InternalBackdrop");
553
552
  function Ve(e) {
554
553
  let t = T.useRef(""), n = T.useCallback((n) => {
555
554
  n.defaultPrevented || (t.current = n.pointerType, e(n, n.pointerType));
@@ -1,10 +1,10 @@
1
- import { n as e } from "./dist-De294MVF.js";
2
- import { s as t, t as n } from "./button-By0hGrJK.js";
3
- import { i as r, o as i, r as a } from "./separator-aphZiRoJ.js";
4
- import { t as o } from "./comment-icon-4SQd3nlz.js";
5
- import { t as s } from "./button-group-C285iSkZ.js";
6
- import { c, h as l, m as u, p as d } from "./comment-kit-ui-CBaz7L3u.js";
7
- import { r as f, t as p } from "./attachment-refresh-DmVkfPtl.js";
1
+ import { n as e } from "./dist-D9A5k-N4.js";
2
+ import { o as t, t as n } from "./button-D4GHW6oZ.js";
3
+ import { i as r, o as i, r as a } from "./separator-UhJb0Row.js";
4
+ import { t as o } from "./comment-icon-D8JTCEJ7.js";
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-BDzNt0jv.js";
7
+ import { r as f, t as p } from "./attachment-refresh-DRX7dKDI.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)}";
@@ -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, j as a, l as o, r as s } from "./comment-kit-ui-BDzNt0jv.js";
4
+ import { n as c, r as l, t as u } from "./attachment-refresh-DRX7dKDI.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-4zroOCCG.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
  }