@commentkit/comment-kit 0.6.9 → 0.7.0
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 +36 -4
- package/LICENSE +18 -2
- package/README.md +133 -88
- package/SECURITY.md +48 -0
- package/dist/THIRD_PARTY_NOTICES.txt +284 -0
- package/dist/angular.es.js +25 -12
- package/dist/comment-kit.es.js +23 -11
- package/dist/demo.es.js +146 -69
- package/dist/headless.es.js +2 -2
- package/dist/preact.es.js +3 -3
- package/dist/qwik.es.js +1 -110
- package/dist/qwik.qwik.mjs +114 -0
- package/dist/react.es.js +3 -3
- package/dist/shared/annotation-icons-Dh-bmNYK.js +172 -0
- package/dist/shared/annotation-toolbar-B9SxYqoF.js +1093 -0
- package/dist/shared/{bridge-DRE03N9X.js → bridge-CJoGYngu.js} +6 -3
- package/dist/shared/{button-group-CHfMRXyA.js → button-group-Cl9CrvvU.js} +1 -1
- package/dist/shared/comment-drawing-canvas-Dzb5YoFw.js +124 -0
- package/dist/shared/{comment-image-lightbox-0VdAs2iT.js → comment-image-lightbox-BPYJT1sB.js} +62 -57
- package/dist/shared/{comment-kit-core-D0kY00St.js → comment-kit-core-BaSuMzp9.js} +1027 -729
- package/dist/shared/comment-kit-ui-CzfdAZs2.js +20181 -0
- package/dist/shared/comment-screenshot-annotator-C7X-_bm6.js +151 -0
- package/dist/shared/comment-screenshot-overlay-wIrZrcRy.js +206 -0
- package/dist/shared/comment-utils-BycYTSxA.js +602 -0
- package/dist/shared/{dev-export-panel-BLngcr5q.js → dev-export-panel-FwFVdady.js} +8 -8
- package/dist/shared/{dev-grab-pDAfH2lr.js → dev-grab-DDqg0LQf.js} +1 -1
- package/dist/shared/dist-De294MVF.js +623 -0
- package/dist/shared/{element-selector-CtFzgHvq.js → element-selector-BhJm-NSs.js} +294 -288
- package/dist/shared/{icons-BSHCWYO1.js → icons-nzMOLzrm.js} +2 -3
- package/dist/shared/{mount-ui-CVivB_eQ.js → mount-ui--ijs8pWT.js} +4 -4
- package/dist/shared/{pusher-BEl7Qn-8.js → pusher-ipHMJnO_.js} +1 -1
- package/dist/shared/{realtime-BG_t_ze7.js → realtime-Dk41VwKg.js} +71 -50
- package/dist/shared/{separator-DusFNTs-.js → separator-XDBsaWyw.js} +891 -785
- package/dist/shared/{shadow-root-CmYXiSRR.js → shadow-root-C5v-T8lQ.js} +1 -1
- package/dist/shared/styles-D3yMtaec.js +2 -0
- package/dist/shared/{useValueChanged-DQXLia-2.js → useValueChanged-CrzfD8l-.js} +15 -15
- package/dist/shared/{websocket-manager-BTRqNTB7.js → websocket-manager-DhLWh3Jr.js} +2 -2
- package/dist/solid.es.js +3 -3
- package/dist/svelte.es.js +3 -3
- package/dist/types/adapters/bridge.d.ts +9 -12
- package/dist/types/angular/index.d.ts +15 -5
- package/dist/types/core/api-client.d.ts +16 -17
- package/dist/types/core/comment-kit-core.d.ts +19 -11
- package/dist/types/core/local-demo.d.ts +1 -0
- package/dist/types/core/types.d.ts +68 -0
- package/dist/types/headless.d.ts +1 -1
- package/dist/types/index.d.ts +8 -4
- package/dist/types/qwik/index.d.ts +4 -1
- package/dist/vue.es.js +3 -3
- package/docs/api-reference.md +372 -0
- package/docs/local-demo.md +60 -0
- package/package.json +16 -6
- package/dist/shared/annotation-toolbar-pX17NLmJ.js +0 -1104
- package/dist/shared/clamp-CcFVX0vC.js +0 -55
- package/dist/shared/comment-drawing-canvas-CYu5SwRf.js +0 -126
- package/dist/shared/comment-kit-ui-D2j2gvnm.js +0 -16685
- package/dist/shared/comment-screenshot-annotator-BuojwviY.js +0 -137
- package/dist/shared/comment-screenshot-overlay-BZX0Vcb8.js +0 -144
- package/dist/shared/local-demo-context-BohlYbHt.js +0 -6
- package/dist/shared/resolveAriaLabelledBy-CIKpnjNJ.js +0 -669
- package/dist/shared/styles-D_FEJZ9G.js +0 -2
- package/dist/shared/useLabelableId-DGbfdMi_.js +0 -155
|
@@ -0,0 +1,602 @@
|
|
|
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-XDBsaWyw.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";
|
|
4
|
+
import * as T from "react";
|
|
5
|
+
import { jsx as E, jsxs as Te } from "react/jsx-runtime";
|
|
6
|
+
var D = 0;
|
|
7
|
+
function O(t, n = {}) {
|
|
8
|
+
let { preventScroll: r = !1, sync: i = !1, shouldFocus: a } = n;
|
|
9
|
+
cancelAnimationFrame(D);
|
|
10
|
+
function o() {
|
|
11
|
+
(!a || a()) && t?.focus({ preventScroll: r });
|
|
12
|
+
}
|
|
13
|
+
if (i) return o(), e;
|
|
14
|
+
let s = requestAnimationFrame(o);
|
|
15
|
+
return D = s, () => {
|
|
16
|
+
D === s && (cancelAnimationFrame(s), D = 0);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
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;
|
|
22
|
+
}
|
|
23
|
+
var P = (e, t) => t.map((t) => {
|
|
24
|
+
if (e.contains(t)) return t;
|
|
25
|
+
let n = N(t);
|
|
26
|
+
return e.contains(n) ? n : null;
|
|
27
|
+
}).filter((e) => e != null), F = (e) => {
|
|
28
|
+
let t = /* @__PURE__ */ new Set();
|
|
29
|
+
return e.forEach((e) => {
|
|
30
|
+
let n = e;
|
|
31
|
+
for (; n && !t.has(n);) t.add(n), n = n.parentNode;
|
|
32
|
+
}), t;
|
|
33
|
+
}, De = (e, t, n) => {
|
|
34
|
+
let r = [], i = (e) => {
|
|
35
|
+
e && !n.has(e) && Array.from(e.children).forEach((e) => {
|
|
36
|
+
l(e) !== "script" && (t.has(e) ? i(e) : r.push(e));
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return i(e), r;
|
|
40
|
+
};
|
|
41
|
+
function I(e, t, n, { mark: r = !0 }) {
|
|
42
|
+
let i = P(t, e), a = r ? De(t, F(i), new Set(i)) : [], o = [], s = [];
|
|
43
|
+
if (n) {
|
|
44
|
+
let e = P(t, Array.from(t.querySelectorAll("[aria-live]"))), n = i.concat(e);
|
|
45
|
+
De(t, F(n), new Set(n)).forEach((e) => {
|
|
46
|
+
let t = e.getAttribute("aria-hidden"), n = t !== null && t !== "false", r = (k.get(e) || 0) + 1;
|
|
47
|
+
k.set(e, r), o.push(e), r === 1 && n && A.add(e), n || e.setAttribute("aria-hidden", "true");
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return r && a.forEach((e) => {
|
|
51
|
+
let t = (j.get(e) || 0) + 1;
|
|
52
|
+
j.set(e, t), s.push(e), t === 1 && e.setAttribute(Ee, "");
|
|
53
|
+
}), M += 1, () => {
|
|
54
|
+
o.forEach((e) => {
|
|
55
|
+
let t = (k.get(e) || 0) - 1;
|
|
56
|
+
k.set(e, t), t || (A.has(e) || e.removeAttribute("aria-hidden"), A.delete(e));
|
|
57
|
+
}), r && s.forEach((e) => {
|
|
58
|
+
let t = (j.get(e) || 0) - 1;
|
|
59
|
+
j.set(e, t), t || e.removeAttribute(Ee);
|
|
60
|
+
}), --M, M || (k = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakSet(), j = /* @__PURE__ */ new WeakMap());
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function Oe(e, t = {}) {
|
|
64
|
+
let { ariaHidden: n = !1, mark: r = !0 } = t, i = f(e[0]).body;
|
|
65
|
+
return I(e, i, n, { mark: r });
|
|
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") : "";
|
|
70
|
+
}
|
|
71
|
+
var Ae = 20, L = [];
|
|
72
|
+
function je() {
|
|
73
|
+
L = L.filter((e) => e.deref()?.isConnected);
|
|
74
|
+
}
|
|
75
|
+
function Me(e) {
|
|
76
|
+
je(), e && l(e) !== "body" && (L.push(new WeakRef(e)), L.length > Ae && (L = L.slice(-20)));
|
|
77
|
+
}
|
|
78
|
+
function Ne() {
|
|
79
|
+
return je(), L[L.length - 1]?.deref();
|
|
80
|
+
}
|
|
81
|
+
function Pe(e) {
|
|
82
|
+
return e ? pe(e) ? e : be(e)[0] || e : null;
|
|
83
|
+
}
|
|
84
|
+
function Fe(e) {
|
|
85
|
+
if (e.hasAttribute("tabindex") && !e.hasAttribute("data-tabindex") || !e.getAttribute("role")?.includes("dialog")) return;
|
|
86
|
+
let t = ue(e).filter((e) => {
|
|
87
|
+
let t = e.getAttribute("data-tabindex") || "";
|
|
88
|
+
return pe(e) || e.hasAttribute("data-tabindex") && !t.startsWith("-");
|
|
89
|
+
}), n = e.getAttribute("tabindex");
|
|
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
|
+
}
|
|
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(), Y = ne(), He = B != null, X = fe(M), Z = s((e = X) => e ? be(e) : []), Q = s(() => k?.().filter((e) => e != null) ?? []);
|
|
94
|
+
T.useEffect(() => {
|
|
95
|
+
if (o || !x) return;
|
|
96
|
+
function e(e) {
|
|
97
|
+
e.key === "Tab" && d(X, v(f(X))) && Z().length === 0 && !I && le(e);
|
|
98
|
+
}
|
|
99
|
+
let t = f(X);
|
|
100
|
+
return g(t, "keydown", e);
|
|
101
|
+
}, [
|
|
102
|
+
o,
|
|
103
|
+
X,
|
|
104
|
+
x,
|
|
105
|
+
I,
|
|
106
|
+
Z
|
|
107
|
+
]), T.useEffect(() => {
|
|
108
|
+
if (o || !A) return;
|
|
109
|
+
let e = f(X);
|
|
110
|
+
function t() {
|
|
111
|
+
U.current = !1;
|
|
112
|
+
}
|
|
113
|
+
function n(e) {
|
|
114
|
+
let t = y(e), n = Q(), r = d(M, t) || d(j, t) || d(B?.portalNode, t) || n.some((e) => e === t || d(e, t));
|
|
115
|
+
U.current = !r, G.current = e.pointerType || "keyboard", te(t, "[data-base-ui-click-trigger]") && (H.current = !0, J.start(0, () => {
|
|
116
|
+
H.current = !1;
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
function r() {
|
|
120
|
+
G.current = "keyboard";
|
|
121
|
+
}
|
|
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
|
+
}, [
|
|
124
|
+
o,
|
|
125
|
+
M,
|
|
126
|
+
j,
|
|
127
|
+
X,
|
|
128
|
+
A,
|
|
129
|
+
B,
|
|
130
|
+
J,
|
|
131
|
+
Q
|
|
132
|
+
]), T.useEffect(() => {
|
|
133
|
+
if (o || !S) return;
|
|
134
|
+
let e = f(X);
|
|
135
|
+
function t() {
|
|
136
|
+
H.current = !0, J.start(0, () => {
|
|
137
|
+
H.current = !1;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function i(e) {
|
|
141
|
+
let t = y(e);
|
|
142
|
+
pe(t) && (Re.current = t);
|
|
143
|
+
}
|
|
144
|
+
function a(t) {
|
|
145
|
+
let i = t.relatedTarget, a = t.currentTarget, o = y(t);
|
|
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")) && [
|
|
148
|
+
K.current,
|
|
149
|
+
q.current,
|
|
150
|
+
B?.beforeInsideRef.current,
|
|
151
|
+
B?.afterInsideRef.current,
|
|
152
|
+
B?.beforeOutsideRef.current,
|
|
153
|
+
B?.afterOutsideRef.current,
|
|
154
|
+
_(w),
|
|
155
|
+
_(C)
|
|
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
|
+
if (a === j && X && Fe(X), b && a !== j && !ce(o) && v(e) === e.body) {
|
|
158
|
+
if (r(X) && (X.focus(), b === "popup")) {
|
|
159
|
+
Y.request(() => {
|
|
160
|
+
X.focus();
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
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();
|
|
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)));
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function s() {
|
|
171
|
+
U.current || (P.current.insideReactTree = !0, Ve.start(0, () => {
|
|
172
|
+
P.current.insideReactTree = !1;
|
|
173
|
+
}));
|
|
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));
|
|
177
|
+
}, [
|
|
178
|
+
o,
|
|
179
|
+
j,
|
|
180
|
+
M,
|
|
181
|
+
X,
|
|
182
|
+
x,
|
|
183
|
+
z,
|
|
184
|
+
B,
|
|
185
|
+
n,
|
|
186
|
+
S,
|
|
187
|
+
b,
|
|
188
|
+
Z,
|
|
189
|
+
I,
|
|
190
|
+
F,
|
|
191
|
+
P,
|
|
192
|
+
Ve,
|
|
193
|
+
J,
|
|
194
|
+
Y,
|
|
195
|
+
C,
|
|
196
|
+
w,
|
|
197
|
+
Q
|
|
198
|
+
]), T.useEffect(() => {
|
|
199
|
+
if (o || !M || !A) return;
|
|
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
|
+
M,
|
|
202
|
+
...e,
|
|
203
|
+
K.current,
|
|
204
|
+
q.current,
|
|
205
|
+
B?.beforeOutsideRef.current,
|
|
206
|
+
B?.afterOutsideRef.current,
|
|
207
|
+
...Q(),
|
|
208
|
+
t,
|
|
209
|
+
_(w),
|
|
210
|
+
_(C),
|
|
211
|
+
I ? j : null
|
|
212
|
+
].filter((e) => e != null), {
|
|
213
|
+
ariaHidden: x || I,
|
|
214
|
+
mark: !1
|
|
215
|
+
}), r = Oe([M, ...e].filter((e) => e != null));
|
|
216
|
+
return () => {
|
|
217
|
+
r(), n();
|
|
218
|
+
};
|
|
219
|
+
}, [
|
|
220
|
+
A,
|
|
221
|
+
o,
|
|
222
|
+
j,
|
|
223
|
+
M,
|
|
224
|
+
x,
|
|
225
|
+
B,
|
|
226
|
+
I,
|
|
227
|
+
z,
|
|
228
|
+
F,
|
|
229
|
+
C,
|
|
230
|
+
w,
|
|
231
|
+
Q
|
|
232
|
+
]), t(() => {
|
|
233
|
+
if (!A || o || !r(X)) return;
|
|
234
|
+
W.current = "", G.current = "";
|
|
235
|
+
let e = f(X), t = v(e);
|
|
236
|
+
queueMicrotask(() => {
|
|
237
|
+
let n = Ae.current, r = typeof n == "function" ? n(R.current || "") : n;
|
|
238
|
+
if (r === void 0 || r === !1 || d(X, t)) return;
|
|
239
|
+
let i = null, a = () => (i ??= Z(X), i[0] || X), o;
|
|
240
|
+
o = r === !0 || r === null ? a() : _(r), o ||= a();
|
|
241
|
+
let s = d(X, v(e)), c = P.current.openEvent, l = c?.type === "mousedown" && me(c);
|
|
242
|
+
O(o, {
|
|
243
|
+
sync: l,
|
|
244
|
+
preventScroll: o === X,
|
|
245
|
+
shouldFocus() {
|
|
246
|
+
if (!Le.current) return !1;
|
|
247
|
+
if (s) return !0;
|
|
248
|
+
let t = v(e);
|
|
249
|
+
return !(t !== o && d(X, t));
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
}, [
|
|
254
|
+
o,
|
|
255
|
+
A,
|
|
256
|
+
X,
|
|
257
|
+
Z,
|
|
258
|
+
Ae,
|
|
259
|
+
R,
|
|
260
|
+
Le,
|
|
261
|
+
P
|
|
262
|
+
]);
|
|
263
|
+
let $ = T.useRef(null);
|
|
264
|
+
t(() => {
|
|
265
|
+
if (o || !X) {
|
|
266
|
+
$.current = null;
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
$.current &&= ($.current.cancelled = !0, null);
|
|
270
|
+
let e = f(X), t = v(e), n = R.current == null;
|
|
271
|
+
Me(t);
|
|
272
|
+
function i(e) {
|
|
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") {
|
|
274
|
+
if (e.nested) V.current = !1;
|
|
275
|
+
else if (me(e.nativeEvent) || _e(e.nativeEvent)) V.current = !1;
|
|
276
|
+
else {
|
|
277
|
+
let e = !1;
|
|
278
|
+
f(X).createElement("div").focus({ get preventScroll() {
|
|
279
|
+
return e = !0, !1;
|
|
280
|
+
} }), e ? V.current = !1 : V.current = !0;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
N.on("openchange", i);
|
|
285
|
+
function a(e) {
|
|
286
|
+
let r = L.current, i = typeof r == "function" ? r(e) : r;
|
|
287
|
+
if (i === void 0 || i === !1) return null;
|
|
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;
|
|
290
|
+
return s ||= Ne() || null, typeof i == "boolean" ? s : _(i) || s || null;
|
|
291
|
+
}
|
|
292
|
+
return () => {
|
|
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 };
|
|
295
|
+
$.current = u, queueMicrotask(() => {
|
|
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)) {
|
|
299
|
+
let e = { preventScroll: !0 };
|
|
300
|
+
c === "keyboard" && (e.focusVisible = !0), n.focus(e);
|
|
301
|
+
}
|
|
302
|
+
V.current = !1;
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
}, [
|
|
306
|
+
o,
|
|
307
|
+
M,
|
|
308
|
+
X,
|
|
309
|
+
L,
|
|
310
|
+
Ie,
|
|
311
|
+
R,
|
|
312
|
+
N,
|
|
313
|
+
z,
|
|
314
|
+
j,
|
|
315
|
+
F,
|
|
316
|
+
Q
|
|
317
|
+
]), t(() => {
|
|
318
|
+
if (!oe || A || !M) return;
|
|
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({
|
|
323
|
+
modal: x,
|
|
324
|
+
closeOnFocusOut: S,
|
|
325
|
+
open: A,
|
|
326
|
+
onOpenChange: n.setOpen,
|
|
327
|
+
domReference: j
|
|
328
|
+
}), () => {
|
|
329
|
+
B.setFocusManagerState(null);
|
|
330
|
+
};
|
|
331
|
+
}, [
|
|
332
|
+
o,
|
|
333
|
+
B,
|
|
334
|
+
x,
|
|
335
|
+
A,
|
|
336
|
+
n,
|
|
337
|
+
S,
|
|
338
|
+
j
|
|
339
|
+
]), t(() => {
|
|
340
|
+
if (!o && X) return Fe(X), () => {
|
|
341
|
+
queueMicrotask(je);
|
|
342
|
+
};
|
|
343
|
+
}, [o, X]);
|
|
344
|
+
let Ue = !o && (!x || !I) && (He || x);
|
|
345
|
+
return /*#__PURE__*/ Te(T.Fragment, { children: [
|
|
346
|
+
Ue && /*#__PURE__*/ E(ae, {
|
|
347
|
+
"data-type": "inside",
|
|
348
|
+
ref: ze,
|
|
349
|
+
onFocus: (e) => {
|
|
350
|
+
if (x) {
|
|
351
|
+
let e = Z();
|
|
352
|
+
O(e[e.length - 1]);
|
|
353
|
+
} else B?.portalNode && (V.current = !1, se(e, B.portalNode) ? ie(j)?.focus() : _(w ?? B.beforeOutsideRef)?.focus());
|
|
354
|
+
}
|
|
355
|
+
}),
|
|
356
|
+
i,
|
|
357
|
+
Ue && /*#__PURE__*/ E(ae, {
|
|
358
|
+
"data-type": "inside",
|
|
359
|
+
ref: Be,
|
|
360
|
+
onFocus: (e) => {
|
|
361
|
+
x ? O(Z()[0]) : B?.portalNode && (S && (V.current = !0), se(e, B.portalNode) ? ge(j)?.focus() : _(C ?? B.afterOutsideRef)?.focus());
|
|
362
|
+
}
|
|
363
|
+
})
|
|
364
|
+
] });
|
|
365
|
+
}
|
|
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(() => {
|
|
368
|
+
function t(t, n, r, i) {
|
|
369
|
+
let a = we(c, n, r);
|
|
370
|
+
t && i === "touch" && s > 0 ? p.start(s, () => {
|
|
371
|
+
e.setOpen(!0, a);
|
|
372
|
+
}) : e.setOpen(t, a);
|
|
373
|
+
}
|
|
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;
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
onPointerDown(e) {
|
|
380
|
+
d.current = b(e.pointerType, !0) && _e(e.nativeEvent) ? "virtual" : e.pointerType;
|
|
381
|
+
},
|
|
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;
|
|
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);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
let m = i.currentTarget;
|
|
391
|
+
f.request(() => {
|
|
392
|
+
t(l, s, m, o);
|
|
393
|
+
});
|
|
394
|
+
},
|
|
395
|
+
onClick(i) {
|
|
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);
|
|
399
|
+
},
|
|
400
|
+
onKeyDown() {
|
|
401
|
+
d.current = void 0;
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
}, [
|
|
405
|
+
l,
|
|
406
|
+
r,
|
|
407
|
+
a,
|
|
408
|
+
c,
|
|
409
|
+
e,
|
|
410
|
+
o,
|
|
411
|
+
i,
|
|
412
|
+
f,
|
|
413
|
+
p,
|
|
414
|
+
s
|
|
415
|
+
]);
|
|
416
|
+
return T.useMemo(() => n ? { reference: m } : u, [n, m]);
|
|
417
|
+
}
|
|
418
|
+
function Le(e) {
|
|
419
|
+
return c(19) ? e : e ? "true" : void 0;
|
|
420
|
+
}
|
|
421
|
+
var z = {}, B = {}, V = "";
|
|
422
|
+
function H(e, t) {
|
|
423
|
+
return o(e) ? e : t;
|
|
424
|
+
}
|
|
425
|
+
function U(e, t, n) {
|
|
426
|
+
return /hidden|clip/.test(e.getComputedStyle(H(t, n)).overflowY);
|
|
427
|
+
}
|
|
428
|
+
function Re(e) {
|
|
429
|
+
if (typeof document > "u") return !1;
|
|
430
|
+
let t = f(e);
|
|
431
|
+
return i(t).innerWidth - t.documentElement.clientWidth > 0;
|
|
432
|
+
}
|
|
433
|
+
function W(e) {
|
|
434
|
+
if (!(typeof CSS < "u" && CSS.supports && CSS.supports("scrollbar-gutter", "stable")) || typeof document > "u") return !1;
|
|
435
|
+
let t = f(e), n = t.documentElement, r = t.body, i = H(n, r), a = i.style.overflowY, o = n.style.scrollbarGutter;
|
|
436
|
+
n.style.scrollbarGutter = "stable", i.style.overflowY = "scroll";
|
|
437
|
+
let s = i.offsetWidth;
|
|
438
|
+
i.style.overflowY = "hidden";
|
|
439
|
+
let c = i.offsetWidth;
|
|
440
|
+
return i.style.overflowY = a, n.style.scrollbarGutter = o, s === c;
|
|
441
|
+
}
|
|
442
|
+
function G(e) {
|
|
443
|
+
let t = f(e), n = t.documentElement, r = t.body, i = H(n, r), a = {
|
|
444
|
+
overflowY: i.style.overflowY,
|
|
445
|
+
overflowX: i.style.overflowX
|
|
446
|
+
};
|
|
447
|
+
return Object.assign(i.style, {
|
|
448
|
+
overflowY: "hidden",
|
|
449
|
+
overflowX: "hidden"
|
|
450
|
+
}), () => {
|
|
451
|
+
Object.assign(i.style, a);
|
|
452
|
+
};
|
|
453
|
+
}
|
|
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();
|
|
456
|
+
if (oe && (a.visualViewport?.scale ?? 1) !== 1) return () => {};
|
|
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,
|
|
468
|
+
overflowY: r.style.overflowY,
|
|
469
|
+
overflowX: r.style.overflowX,
|
|
470
|
+
scrollBehavior: r.style.scrollBehavior
|
|
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, {
|
|
474
|
+
scrollbarGutter: l,
|
|
475
|
+
overflowY: "hidden",
|
|
476
|
+
overflowX: "hidden"
|
|
477
|
+
}), (u || f) && (n.style.overflowY = "scroll"), (d || p) && (n.style.overflowX = "scroll"), Object.assign(r.style, {
|
|
478
|
+
position: "relative",
|
|
479
|
+
height: h || ee ? `calc(100dvh - ${h + ee}px)` : "100dvh",
|
|
480
|
+
width: g || m ? `calc(100vw - ${g + m}px)` : "100vw",
|
|
481
|
+
boxSizing: "border-box",
|
|
482
|
+
overflowY: "hidden",
|
|
483
|
+
overflowX: "hidden",
|
|
484
|
+
scrollBehavior: "unset"
|
|
485
|
+
}), r.scrollTop = o, r.scrollLeft = s, n.setAttribute("data-base-ui-scroll-locked", ""), n.style.scrollBehavior = "unset");
|
|
486
|
+
}
|
|
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);
|
|
489
|
+
}
|
|
490
|
+
function p() {
|
|
491
|
+
d(), l.request(u);
|
|
492
|
+
}
|
|
493
|
+
u();
|
|
494
|
+
let m = g(a, "resize", p);
|
|
495
|
+
return () => {
|
|
496
|
+
l.cancel(), d(), typeof a.removeEventListener == "function" && m();
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
var q = new class {
|
|
500
|
+
lockCount = 0;
|
|
501
|
+
restore = null;
|
|
502
|
+
timeoutLock = xe.create();
|
|
503
|
+
timeoutUnlock = xe.create();
|
|
504
|
+
acquire(e) {
|
|
505
|
+
return this.lockCount += 1, this.lockCount === 1 && this.restore === null && this.timeoutLock.start(0, () => this.lock(e)), this.release;
|
|
506
|
+
}
|
|
507
|
+
release = () => {
|
|
508
|
+
--this.lockCount, this.lockCount === 0 && this.restore && this.timeoutUnlock.start(0, this.unlock);
|
|
509
|
+
};
|
|
510
|
+
unlock = () => {
|
|
511
|
+
this.lockCount === 0 && this.restore && (this.restore?.(), this.restore = null);
|
|
512
|
+
};
|
|
513
|
+
lock(e) {
|
|
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)) {
|
|
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();
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
let o = x || !Re(e);
|
|
524
|
+
this.restore = o ? G(e) : K(e);
|
|
525
|
+
}
|
|
526
|
+
}();
|
|
527
|
+
function ze(e = !0, n = null) {
|
|
528
|
+
t(() => {
|
|
529
|
+
if (e) return q.acquire(n);
|
|
530
|
+
}, [e, n]);
|
|
531
|
+
}
|
|
532
|
+
var Be = /*#__PURE__*/ T.forwardRef(function(e, t) {
|
|
533
|
+
let { cutout: n, ...r } = e, i;
|
|
534
|
+
if (n) {
|
|
535
|
+
let e = n.getBoundingClientRect();
|
|
536
|
+
i = `polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`;
|
|
537
|
+
}
|
|
538
|
+
return /*#__PURE__*/ E("div", {
|
|
539
|
+
ref: t,
|
|
540
|
+
role: "presentation",
|
|
541
|
+
"data-base-ui-inert": "",
|
|
542
|
+
...r,
|
|
543
|
+
style: {
|
|
544
|
+
position: "fixed",
|
|
545
|
+
inset: 0,
|
|
546
|
+
userSelect: "none",
|
|
547
|
+
WebkitUserSelect: "none",
|
|
548
|
+
clipPath: i
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
process.env.NODE_ENV !== "production" && (Be.displayName = "InternalBackdrop");
|
|
553
|
+
function Ve(e) {
|
|
554
|
+
let t = T.useRef(""), n = T.useCallback((n) => {
|
|
555
|
+
n.defaultPrevented || (t.current = n.pointerType, e(n, n.pointerType));
|
|
556
|
+
}, [e]);
|
|
557
|
+
return {
|
|
558
|
+
onClick: T.useCallback((n) => {
|
|
559
|
+
n.detail === 0 ? e(n, "keyboard") : ("pointerType" in n ? e(n, n.pointerType) : e(n, t.current), t.current = "");
|
|
560
|
+
}, [e]),
|
|
561
|
+
onPointerDown: n
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
function J(e, t) {
|
|
565
|
+
let { onClick: n, onPointerDown: r } = Ve(s((n, r) => {
|
|
566
|
+
(typeof e == "function" ? e() : e) || t(r || (x ? "touch" : ""));
|
|
567
|
+
}));
|
|
568
|
+
return T.useMemo(() => ({
|
|
569
|
+
onClick: n,
|
|
570
|
+
onPointerDown: r
|
|
571
|
+
}), [n, r]);
|
|
572
|
+
}
|
|
573
|
+
function Y(e) {
|
|
574
|
+
let [t, n] = T.useState(null), r = J(e, n);
|
|
575
|
+
return w(e, (t) => {
|
|
576
|
+
t && !e && n(null);
|
|
577
|
+
}), T.useMemo(() => ({
|
|
578
|
+
openMethod: t,
|
|
579
|
+
triggerProps: r
|
|
580
|
+
}), [t, r]);
|
|
581
|
+
}
|
|
582
|
+
var He = {
|
|
583
|
+
urgent: 0,
|
|
584
|
+
high: 1,
|
|
585
|
+
medium: 2,
|
|
586
|
+
low: 3
|
|
587
|
+
};
|
|
588
|
+
function X(e) {
|
|
589
|
+
return e.status ? e.status : e.isResolved ? "resolved" : "open";
|
|
590
|
+
}
|
|
591
|
+
var Z = {
|
|
592
|
+
pin: "Pin",
|
|
593
|
+
highlight: "Highlight",
|
|
594
|
+
drawing: "Drawing"
|
|
595
|
+
};
|
|
596
|
+
function Q(e) {
|
|
597
|
+
return e.status === "resolved" || e.status === "complete" || e.isResolved === !0;
|
|
598
|
+
}
|
|
599
|
+
function $(e) {
|
|
600
|
+
return e == null ? null : e < 1024 ? `${String(e)} B` : e < 1048576 ? `${(e / 1024).toFixed(1)} KB` : `${(e / 1048576).toFixed(1)} MB`;
|
|
601
|
+
}
|
|
602
|
+
export { X as a, Be as c, R as d, Ie as f, Q as i, ze as l, Z as n, Y as o, O as p, $ as r, J as s, He as t, Le as u };
|
|
@@ -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-
|
|
2
|
+
import { i as t, o as n, r, t as i } from "./separator-XDBsaWyw.js";
|
|
3
3
|
import { t as a } from "./createReactComponent-BZHeRbD0.js";
|
|
4
|
-
import {
|
|
4
|
+
import { B as o, V as s, b as c, s as l, z as u } from "./comment-kit-ui-CzfdAZs2.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(
|
|
51
|
+
children: [/* @__PURE__ */ p(u, {
|
|
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(
|
|
64
|
+
/* @__PURE__ */ p(c, {
|
|
65
65
|
checked: A,
|
|
66
66
|
indeterminate: j,
|
|
67
67
|
onCheckedChange: () => {
|
|
@@ -124,7 +124,7 @@ var y = 2500, b = ({ core: a, state: f }) => {
|
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
disabled: M || x,
|
|
127
|
-
children: [/* @__PURE__ */ p(
|
|
127
|
+
children: [/* @__PURE__ */ p(o, {
|
|
128
128
|
size: 14,
|
|
129
129
|
"aria-hidden": !0
|
|
130
130
|
}), x ? "Copying…" : `Copy ${g.size || ""} for agent`.trim()]
|
|
@@ -143,9 +143,9 @@ var y = 2500, b = ({ core: a, state: f }) => {
|
|
|
143
143
|
" open comments."
|
|
144
144
|
]
|
|
145
145
|
}),
|
|
146
|
-
/* @__PURE__ */ p(
|
|
146
|
+
/* @__PURE__ */ p(l, {
|
|
147
147
|
className: "ck-dev-export-scroll",
|
|
148
|
-
children: O.length === 0 ? /* @__PURE__ */ p(
|
|
148
|
+
children: O.length === 0 ? /* @__PURE__ */ p(s, {
|
|
149
149
|
className: "ck-dev-export-empty",
|
|
150
150
|
children: "No open stakeholder comments on this project. Comments left in production or staging will show up here for bulk export."
|
|
151
151
|
}) : /* @__PURE__ */ p("ul", {
|
|
@@ -155,7 +155,7 @@ var y = 2500, b = ({ core: a, state: f }) => {
|
|
|
155
155
|
return /* @__PURE__ */ m("li", {
|
|
156
156
|
className: "ck-dev-export-row",
|
|
157
157
|
"data-checked": t,
|
|
158
|
-
children: [/* @__PURE__ */ p(
|
|
158
|
+
children: [/* @__PURE__ */ p(c, {
|
|
159
159
|
checked: t,
|
|
160
160
|
onCheckedChange: () => N(e.id),
|
|
161
161
|
"aria-label": `Select ${e.title}`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as e, o as t, r as n, s as r, u as i } from "./comment-kit-core-
|
|
1
|
+
import { d as e, o as t, r as n, s as r, u as i } from "./comment-kit-core-BaSuMzp9.js";
|
|
2
2
|
import { a, i as o, o as s } from "./dom-Bhf4WFtY.js";
|
|
3
3
|
var c = 4e3, l = 500, u = 2e3, d = 1e3, f = 5, p = 25, m = 3145728;
|
|
4
4
|
function h(t) {
|