@commentkit/comment-kit 0.7.4 → 0.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +3 -3
- package/SECURITY.md +1 -1
- package/dist/angular.es.js +2 -2
- package/dist/comment-kit.es.js +3 -3
- package/dist/demo.es.js +24 -15
- package/dist/headless.es.js +2 -2
- package/dist/preact.es.js +2 -2
- package/dist/qwik.qwik.mjs +2 -2
- package/dist/react.es.js +2 -2
- package/dist/shared/ShadowRootContext-DD6a0QaI.js +11 -0
- package/dist/shared/annotation-toolbar-RSrb0Nku.js +1086 -0
- package/dist/shared/{attachment-refresh-DmVkfPtl.js → attachment-refresh-CSTYwRW-.js} +3 -3
- package/dist/shared/{button-By0hGrJK.js → button-D4GHW6oZ.js} +133 -164
- package/dist/shared/{button-group-C285iSkZ.js → button-group-BVR7iT-S.js} +13 -13
- package/dist/shared/{comment-drawing-canvas-zIPS1dnW.js → comment-drawing-canvas-DbuXP54N.js} +2 -2
- package/dist/shared/{comment-icon-4SQd3nlz.js → comment-icon-D8JTCEJ7.js} +109 -110
- package/dist/shared/{comment-image-lightbox-CdMNf0_y.js → comment-image-lightbox-zlIGEVA-.js} +7 -7
- package/dist/shared/{comment-images-content-DqeqmQnb.js → comment-images-content-aYbJb79_.js} +38 -38
- package/dist/shared/{comment-kit-core-C-0JJS2i.js → comment-kit-core-B0k7XsMz.js} +742 -746
- package/dist/shared/{comment-kit-ui-CBaz7L3u.js → comment-kit-ui-BXLJcZYQ.js} +5310 -5718
- package/dist/shared/{comment-screenshot-annotator-CuYmKafz.js → comment-screenshot-annotator-ChWwYJzO.js} +2 -2
- package/dist/shared/{comment-screenshot-overlay-Dw81osel.js → comment-screenshot-overlay-Bufg3rHz.js} +6 -6
- package/dist/shared/{dev-export-panel-D08M2LKD.js → dev-export-panel-DAZenvgD.js} +6 -6
- package/dist/shared/{dev-grab-BJLZZ2xU.js → dev-grab-O8q25zar.js} +48 -47
- package/dist/shared/dist-D9A5k-N4.js +617 -0
- package/dist/shared/{element-selector-Biyn2cpR.js → element-selector-CYkwzfEr.js} +349 -347
- package/dist/shared/input-UPtAj0M6.js +111 -0
- package/dist/shared/{mount-ui-DXdL3p9b.js → mount-ui-BKaWBhKq.js} +4 -4
- package/dist/shared/{pusher-D4M5K6Dk.js → pusher-BUaiCkDJ.js} +1 -1
- package/dist/shared/{realtime-BTqYEy8s.js → realtime-C0Z8dXXH.js} +41 -28
- package/dist/shared/{realtime-recovery-BSVMwsXJ.js → realtime-recovery-BjlV-ewc.js} +57 -30
- package/dist/shared/screenshot-B-ZfFItT.js +199 -0
- package/dist/shared/{separator-aphZiRoJ.js → separator-UhJb0Row.js} +1222 -1288
- package/dist/shared/{shadow-root-C58Ap5Nu.js → shadow-root-Cd3SLHyj.js} +3 -5
- package/dist/shared/{token-session-D0Y_HZw0.js → token-session-DplW5QDx.js} +2 -2
- package/dist/shared/useLabelableId-8n0QmH8N.js +154 -0
- package/dist/shared/{useRender-D1z_X_BY.js → useRender-Uxk1OPK-.js} +1 -1
- package/dist/shared/{useValueChanged-CrzfD8l-.js → useValueChanged-DKq5cMot.js} +13 -13
- package/dist/shared/{websocket-manager-BFKa95TO.js → websocket-manager-798cRDyL.js} +2 -2
- package/dist/solid.es.js +2 -2
- package/dist/svelte.es.js +2 -2
- package/dist/types/core/api-client.d.ts +19 -9
- package/dist/types/core/comment-kit-core.d.ts +8 -4
- package/dist/types/core/types.d.ts +49 -9
- package/dist/types/core/write-access.d.ts +2 -0
- package/dist/vue.es.js +2 -2
- package/docs/api-reference.md +30 -18
- package/package.json +1 -1
- package/dist/shared/ShadowRootContext-CjciYxVN.js +0 -13
- package/dist/shared/annotation-toolbar-CpPKy0oq.js +0 -1094
- package/dist/shared/dist-De294MVF.js +0 -623
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as e } from "./validation-3wbbbuX0.js";
|
|
2
|
-
import { n as t } from "./dist-
|
|
3
|
-
import { t as n } from "./button-
|
|
4
|
-
import {
|
|
2
|
+
import { n as t } from "./dist-D9A5k-N4.js";
|
|
3
|
+
import { t as n } from "./button-D4GHW6oZ.js";
|
|
4
|
+
import { L as r } from "./comment-kit-ui-BXLJcZYQ.js";
|
|
5
5
|
import * as i from "react";
|
|
6
6
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
7
|
function s(e) {
|
|
@@ -41,7 +41,7 @@ function v(e) {
|
|
|
41
41
|
return !d() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof p(e).ShadowRoot;
|
|
42
42
|
}
|
|
43
43
|
function y(e) {
|
|
44
|
-
let { overflow: t, overflowX: n, overflowY: r, display: i } =
|
|
44
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = E(e);
|
|
45
45
|
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
46
46
|
}
|
|
47
47
|
function ee(e) {
|
|
@@ -57,30 +57,30 @@ function b(e) {
|
|
|
57
57
|
return !1;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
var te = /transform|translate|scale|rotate|perspective|filter/, ne = /paint|layout|strict|content/, x = (e) => !!e && e !== "none",
|
|
61
|
-
function
|
|
62
|
-
let t = g(e) ?
|
|
63
|
-
return x(t.transform) || x(t.translate) || x(t.scale) || x(t.rotate) || x(t.perspective) || !
|
|
60
|
+
var te = /transform|translate|scale|rotate|perspective|filter/, ne = /paint|layout|strict|content/, x = (e) => !!e && e !== "none", S;
|
|
61
|
+
function C(e) {
|
|
62
|
+
let t = g(e) ? E(e) : e;
|
|
63
|
+
return x(t.transform) || x(t.translate) || x(t.scale) || x(t.rotate) || x(t.perspective) || !w() && (x(t.backdropFilter) || x(t.filter)) || te.test(t.willChange || "") || ne.test(t.contain || "");
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
let t =
|
|
67
|
-
for (; _(t) && !
|
|
68
|
-
if (
|
|
65
|
+
function re(e) {
|
|
66
|
+
let t = D(e);
|
|
67
|
+
for (; _(t) && !T(t);) {
|
|
68
|
+
if (C(t)) return t;
|
|
69
69
|
if (b(t)) return null;
|
|
70
|
-
t =
|
|
70
|
+
t = D(t);
|
|
71
71
|
}
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
return
|
|
74
|
+
function w() {
|
|
75
|
+
return S ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), S;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function T(e) {
|
|
78
78
|
return /^(html|body|#document)$/.test(f(e));
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function E(e) {
|
|
81
81
|
return p(e).getComputedStyle(e);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function ie(e) {
|
|
84
84
|
return g(e) ? {
|
|
85
85
|
scrollLeft: e.scrollLeft,
|
|
86
86
|
scrollTop: e.scrollTop
|
|
@@ -89,54 +89,54 @@ function se(e) {
|
|
|
89
89
|
scrollTop: e.scrollY
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function D(e) {
|
|
93
93
|
if (f(e) === "html") return e;
|
|
94
94
|
let t = e.assignedSlot || e.parentNode || v(e) && e.host || m(e);
|
|
95
95
|
return v(t) ? t.host : t;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
let t =
|
|
99
|
-
return
|
|
97
|
+
function O(e) {
|
|
98
|
+
let t = D(e);
|
|
99
|
+
return T(t) ? (e.ownerDocument || e).body : _(t) && y(t) ? t : O(t);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function k(e, t, n) {
|
|
102
102
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
103
|
-
let r =
|
|
103
|
+
let r = O(e), i = r === e.ownerDocument?.body, a = p(r);
|
|
104
104
|
if (i) {
|
|
105
|
-
let e =
|
|
106
|
-
return t.concat(a, a.visualViewport || [], y(r) ? r : [], e && n ?
|
|
105
|
+
let e = A(a);
|
|
106
|
+
return t.concat(a, a.visualViewport || [], y(r) ? r : [], e && n ? k(e) : []);
|
|
107
107
|
}
|
|
108
|
-
return t.concat(r,
|
|
108
|
+
return t.concat(r, k(r, [], n));
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function A(e) {
|
|
111
111
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
let a = i(
|
|
115
|
-
return
|
|
113
|
+
function j(e, t, n, r) {
|
|
114
|
+
let a = i(M).current;
|
|
115
|
+
return oe(a, e, t, n, r) && N(a, [
|
|
116
116
|
e,
|
|
117
117
|
t,
|
|
118
118
|
n,
|
|
119
119
|
r
|
|
120
120
|
]), a.callback;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
let t = i(
|
|
124
|
-
return
|
|
122
|
+
function ae(e) {
|
|
123
|
+
let t = i(M).current;
|
|
124
|
+
return se(t, e) && N(t, e), t.callback;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function M() {
|
|
127
127
|
return {
|
|
128
128
|
callback: null,
|
|
129
129
|
cleanup: null,
|
|
130
130
|
refs: []
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function oe(e, t, n, r, i) {
|
|
134
134
|
return e.refs[0] !== t || e.refs[1] !== n || e.refs[2] !== r || e.refs[3] !== i;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function se(e, t) {
|
|
137
137
|
return e.refs.length !== t.length || e.refs.some((e, n) => e !== t[n]);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function N(e, t) {
|
|
140
140
|
e.refs = t, e.callback = t.every((e) => e == null) ? null : (n) => {
|
|
141
141
|
if (e.cleanup &&= (e.cleanup(), null), n != null) {
|
|
142
142
|
let r = Array(t.length).fill(null);
|
|
@@ -167,15 +167,15 @@ function k(e, t) {
|
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
var
|
|
171
|
-
function
|
|
172
|
-
let t = i(
|
|
173
|
-
return t.next = e,
|
|
170
|
+
var P = { ...e }, F = P.useInsertionEffect, ce = F && F !== P.useLayoutEffect ? F : (e) => e();
|
|
171
|
+
function le(e) {
|
|
172
|
+
let t = i(ue).current;
|
|
173
|
+
return t.next = e, ce(t.effect), t.trampoline;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function ue() {
|
|
176
176
|
let e = {
|
|
177
177
|
next: void 0,
|
|
178
|
-
callback:
|
|
178
|
+
callback: de,
|
|
179
179
|
trampoline: (...t) => e.callback?.(...t),
|
|
180
180
|
effect: () => {
|
|
181
181
|
e.callback = e.next;
|
|
@@ -183,19 +183,17 @@ function me() {
|
|
|
183
183
|
};
|
|
184
184
|
return e;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
function _e(e) {
|
|
191
|
-
return ge >= e;
|
|
186
|
+
function de() {}
|
|
187
|
+
var fe = parseInt(e.version, 10);
|
|
188
|
+
function pe(e) {
|
|
189
|
+
return fe >= e;
|
|
192
190
|
}
|
|
193
|
-
function
|
|
191
|
+
function I(t) {
|
|
194
192
|
if (!/*#__PURE__*/ e.isValidElement(t)) return null;
|
|
195
193
|
let n = t, r = n.props;
|
|
196
|
-
return (
|
|
194
|
+
return (pe(19) ? r?.ref : n.ref) ?? null;
|
|
197
195
|
}
|
|
198
|
-
function
|
|
196
|
+
function L(e, t) {
|
|
199
197
|
if (e && !t) return e;
|
|
200
198
|
if (!e && t) return t;
|
|
201
199
|
if (e || t) return {
|
|
@@ -203,18 +201,7 @@ function M(e, t) {
|
|
|
203
201
|
...t
|
|
204
202
|
};
|
|
205
203
|
}
|
|
206
|
-
|
|
207
|
-
process.env.NODE_ENV !== "production" && (N = /* @__PURE__ */ new Set());
|
|
208
|
-
function P(e, t) {
|
|
209
|
-
return function(...n) {
|
|
210
|
-
if (process.env.NODE_ENV !== "production") {
|
|
211
|
-
let r = n.join(" "), i = t ? `${t}: ${r}` : r, a = `${e}:${i}`;
|
|
212
|
-
N.has(a) || (N.add(a), e === "warn" ? console.warn(i) : console.error(i));
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
var F = P("warn", "Base UI");
|
|
217
|
-
function ye(e, t) {
|
|
204
|
+
function me(e, t) {
|
|
218
205
|
let n = {};
|
|
219
206
|
for (let r in e) {
|
|
220
207
|
let i = e[r];
|
|
@@ -225,135 +212,126 @@ function ye(e, t) {
|
|
|
225
212
|
}
|
|
226
213
|
return n;
|
|
227
214
|
}
|
|
228
|
-
function
|
|
215
|
+
function he(e, t) {
|
|
229
216
|
return typeof e == "function" ? e(t) : e;
|
|
230
217
|
}
|
|
231
|
-
function
|
|
218
|
+
function ge(e, t) {
|
|
232
219
|
return typeof e == "function" ? e(t) : e;
|
|
233
220
|
}
|
|
234
|
-
var
|
|
235
|
-
function
|
|
236
|
-
if (!n && !r && !i && !e) return
|
|
237
|
-
let a =
|
|
238
|
-
return t && (a =
|
|
221
|
+
var R = {};
|
|
222
|
+
function z(e, t, n, r, i) {
|
|
223
|
+
if (!n && !r && !i && !e) return B(t);
|
|
224
|
+
let a = B(e);
|
|
225
|
+
return t && (a = V(a, t)), n && (a = V(a, n)), r && (a = V(a, r)), i && (a = V(a, i)), a;
|
|
239
226
|
}
|
|
240
|
-
function
|
|
241
|
-
if (e.length === 0) return
|
|
242
|
-
if (e.length === 1) return
|
|
243
|
-
let t =
|
|
244
|
-
for (let n = 1; n < e.length; n += 1) t =
|
|
227
|
+
function _e(e) {
|
|
228
|
+
if (e.length === 0) return R;
|
|
229
|
+
if (e.length === 1) return B(e[0]);
|
|
230
|
+
let t = B(e[0]);
|
|
231
|
+
for (let n = 1; n < e.length; n += 1) t = V(t, e[n]);
|
|
245
232
|
return t;
|
|
246
233
|
}
|
|
247
|
-
function
|
|
248
|
-
return
|
|
234
|
+
function B(e) {
|
|
235
|
+
return U(e) ? { ...e(R) } : ve(e);
|
|
249
236
|
}
|
|
250
|
-
function
|
|
251
|
-
return
|
|
237
|
+
function V(e, t) {
|
|
238
|
+
return U(t) ? t(e) : ye(e, t);
|
|
252
239
|
}
|
|
253
|
-
function
|
|
240
|
+
function ve(e) {
|
|
254
241
|
let t = { ...e };
|
|
255
242
|
for (let e in t) {
|
|
256
243
|
let n = t[e];
|
|
257
|
-
|
|
244
|
+
H(e, n) && (t[e] = W(n));
|
|
258
245
|
}
|
|
259
246
|
return t;
|
|
260
247
|
}
|
|
261
|
-
function
|
|
248
|
+
function ye(e, t) {
|
|
262
249
|
if (!t) return e;
|
|
263
250
|
for (let n in t) {
|
|
264
251
|
let r = t[n];
|
|
265
252
|
switch (n) {
|
|
266
253
|
case "style":
|
|
267
|
-
e[n] =
|
|
254
|
+
e[n] = L(e.style, r);
|
|
268
255
|
break;
|
|
269
256
|
case "className":
|
|
270
|
-
e[n] =
|
|
257
|
+
e[n] = K(e.className, r);
|
|
271
258
|
break;
|
|
272
|
-
default: e[n] =
|
|
259
|
+
default: e[n] = H(n, r) ? be(e[n], r) : r;
|
|
273
260
|
}
|
|
274
261
|
}
|
|
275
262
|
return e;
|
|
276
263
|
}
|
|
277
|
-
function
|
|
264
|
+
function H(e, t) {
|
|
278
265
|
let n = e.charCodeAt(0), r = e.charCodeAt(1), i = e.charCodeAt(2);
|
|
279
266
|
return n === 111 && r === 110 && i >= 65 && i <= 90 && (typeof t == "function" || t === void 0);
|
|
280
267
|
}
|
|
281
|
-
function
|
|
268
|
+
function U(e) {
|
|
282
269
|
return typeof e == "function";
|
|
283
270
|
}
|
|
284
|
-
function
|
|
271
|
+
function be(e, t) {
|
|
285
272
|
return t ? e ? (...n) => {
|
|
286
273
|
let r = n[0];
|
|
287
|
-
if (
|
|
274
|
+
if (q(r)) {
|
|
288
275
|
let i = r;
|
|
289
|
-
|
|
276
|
+
G(i);
|
|
290
277
|
let a = t(...n);
|
|
291
278
|
return i.baseUIHandlerPrevented || e?.(...n), a;
|
|
292
279
|
}
|
|
293
280
|
let i = t(...n);
|
|
294
281
|
return e?.(...n), i;
|
|
295
|
-
} :
|
|
282
|
+
} : W(t) : e;
|
|
296
283
|
}
|
|
297
|
-
function
|
|
284
|
+
function W(e) {
|
|
298
285
|
return e && ((...t) => {
|
|
299
286
|
let n = t[0];
|
|
300
|
-
return
|
|
287
|
+
return q(n) && G(n), e(...t);
|
|
301
288
|
});
|
|
302
289
|
}
|
|
303
|
-
function
|
|
290
|
+
function G(e) {
|
|
304
291
|
return e.preventBaseUIHandler = () => {
|
|
305
292
|
e.baseUIHandlerPrevented = !0;
|
|
306
293
|
}, e;
|
|
307
294
|
}
|
|
308
|
-
function
|
|
295
|
+
function K(e, t) {
|
|
309
296
|
return t ? e ? t + " " + e : t : e;
|
|
310
297
|
}
|
|
311
|
-
function
|
|
298
|
+
function q(e) {
|
|
312
299
|
return typeof e == "object" && !!e && "nativeEvent" in e;
|
|
313
300
|
}
|
|
314
|
-
function
|
|
301
|
+
function J(e, t, n = {}) {
|
|
315
302
|
let r = t.render;
|
|
316
|
-
n.enabled !== !1 && (r =
|
|
317
|
-
let i =
|
|
303
|
+
n.enabled !== !1 && (r = Y(r));
|
|
304
|
+
let i = xe(t, n, r);
|
|
318
305
|
if (n.enabled === !1) return null;
|
|
319
306
|
let a = n.state ?? s;
|
|
320
|
-
return
|
|
307
|
+
return we(e, r, i, a);
|
|
321
308
|
}
|
|
322
|
-
function
|
|
323
|
-
let { className: r, style: i } = e, { state: a = s, ref: o, props: c, stateAttributesMapping: l, enabled: u = !0 } = t, d = u ?
|
|
324
|
-
return typeof document < "u" && (u ? h.ref = Array.isArray(o) ?
|
|
309
|
+
function xe(e, t, n) {
|
|
310
|
+
let { className: r, style: i } = e, { state: a = s, ref: o, props: c, stateAttributesMapping: l, enabled: u = !0 } = t, d = u ? he(r, a) : void 0, f = u ? ge(i, a) : void 0, p = u ? me(a, l) : s, m = u && c ? Se(c) : void 0, h = u ? L(p, m) ?? {} : s;
|
|
311
|
+
return typeof document < "u" && (u ? h.ref = Array.isArray(o) ? ae([
|
|
325
312
|
h.ref,
|
|
326
|
-
|
|
313
|
+
I(n),
|
|
327
314
|
...o
|
|
328
|
-
]) :
|
|
315
|
+
]) : j(h.ref, I(n), o) : j(null, null)), u ? (d !== void 0 && (h.className = K(h.className, d)), f !== void 0 && (h.style = L(h.style, f)), h) : s;
|
|
329
316
|
}
|
|
330
|
-
function
|
|
331
|
-
return Array.isArray(e) ?
|
|
317
|
+
function Se(e) {
|
|
318
|
+
return Array.isArray(e) ? _e(e) : z(void 0, e);
|
|
332
319
|
}
|
|
333
|
-
var
|
|
334
|
-
function
|
|
335
|
-
if (t?.$$typeof !==
|
|
320
|
+
var Ce = Symbol.for("react.lazy");
|
|
321
|
+
function Y(t) {
|
|
322
|
+
if (t?.$$typeof !== Ce) return t;
|
|
336
323
|
let n = e.Children.toArray(t)[0];
|
|
337
324
|
return /*#__PURE__*/ e.isValidElement(n) ? n : t;
|
|
338
325
|
}
|
|
339
|
-
function
|
|
326
|
+
function we(t, n, r, i) {
|
|
340
327
|
if (n) {
|
|
341
|
-
if (typeof n == "function") return
|
|
342
|
-
let t =
|
|
343
|
-
|
|
344
|
-
"Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.",
|
|
345
|
-
"A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.",
|
|
346
|
-
"https://base-ui.com/r/invalid-render-prop"
|
|
347
|
-
].join("\n"));
|
|
348
|
-
return /*#__PURE__*/ e.cloneElement(n, t);
|
|
328
|
+
if (typeof n == "function") return n(r, i);
|
|
329
|
+
let t = z(r, n.props);
|
|
330
|
+
return t.ref = r.ref, /*#__PURE__*/ e.cloneElement(n, t);
|
|
349
331
|
}
|
|
350
|
-
return
|
|
332
|
+
return Te(t, r);
|
|
351
333
|
}
|
|
352
|
-
function
|
|
353
|
-
let t = e.name;
|
|
354
|
-
t.length !== 0 && ke.test(t) && Ae.test(t) && F(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
|
|
355
|
-
}
|
|
356
|
-
function Ne(n, r) {
|
|
334
|
+
function Te(n, r) {
|
|
357
335
|
return n === "button" ? /*#__PURE__*/ t("button", {
|
|
358
336
|
type: "button",
|
|
359
337
|
...r,
|
|
@@ -364,28 +342,27 @@ function Ne(n, r) {
|
|
|
364
342
|
key: r.key
|
|
365
343
|
}) : /*#__PURE__*/ e.createElement(n, r);
|
|
366
344
|
}
|
|
367
|
-
function
|
|
345
|
+
function X(...e) {
|
|
368
346
|
let t = [];
|
|
369
347
|
for (let n of e) if (n) {
|
|
370
348
|
if (typeof n == "string") t.push(n);
|
|
371
349
|
else if (Array.isArray(n)) {
|
|
372
|
-
let e =
|
|
350
|
+
let e = X(...n);
|
|
373
351
|
e && t.push(e);
|
|
374
352
|
}
|
|
375
353
|
}
|
|
376
354
|
return t.join(" ");
|
|
377
355
|
}
|
|
378
|
-
function
|
|
379
|
-
return typeof t == "function" ? (n) =>
|
|
356
|
+
function Z(e, t) {
|
|
357
|
+
return typeof t == "function" ? (n) => X(e, t(n)) : X(e, t);
|
|
380
358
|
}
|
|
381
|
-
var
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
if (n === void 0 && !t) throw Error(process.env.NODE_ENV === "production" ? u(16) : "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");
|
|
359
|
+
var Ee = /*#__PURE__*/ e.createContext(void 0);
|
|
360
|
+
function De(t = !1) {
|
|
361
|
+
let n = e.useContext(Ee);
|
|
362
|
+
if (n === void 0 && !t) throw Error(u(16));
|
|
386
363
|
return n;
|
|
387
364
|
}
|
|
388
|
-
function
|
|
365
|
+
function Oe(t) {
|
|
389
366
|
let { focusableWhenDisabled: n, disabled: r, composite: i = !1, tabIndex: a = 0, isNativeButton: o } = t, s = i && n !== !1, c = i && n === !1;
|
|
390
367
|
return { props: e.useMemo(() => {
|
|
391
368
|
let e = { onKeyDown(e) {
|
|
@@ -402,7 +379,7 @@ function Ie(t) {
|
|
|
402
379
|
a
|
|
403
380
|
]) };
|
|
404
381
|
}
|
|
405
|
-
function
|
|
382
|
+
function Q(e, t, { detail: n = 0, pointerType: r = "" } = {}) {
|
|
406
383
|
e.dispatchEvent(new (p(e)).PointerEvent("click", {
|
|
407
384
|
bubbles: !0,
|
|
408
385
|
cancelable: !0,
|
|
@@ -415,22 +392,16 @@ function Z(e, t, { detail: n = 0, pointerType: r = "" } = {}) {
|
|
|
415
392
|
metaKey: t.metaKey
|
|
416
393
|
}));
|
|
417
394
|
}
|
|
418
|
-
function
|
|
419
|
-
let { disabled: n = !1, focusableWhenDisabled: r, tabIndex: i = 0, native: a = !0, composite: o } = t, s = e.useRef(null), l =
|
|
395
|
+
function ke(t = {}) {
|
|
396
|
+
let { disabled: n = !1, focusableWhenDisabled: r, tabIndex: i = 0, native: a = !0, composite: o } = t, s = e.useRef(null), l = De(!0), u = o ?? l !== void 0, { props: d } = Oe({
|
|
420
397
|
focusableWhenDisabled: r,
|
|
421
398
|
disabled: n,
|
|
422
399
|
composite: u,
|
|
423
400
|
tabIndex: i,
|
|
424
401
|
isNativeButton: a
|
|
425
|
-
})
|
|
426
|
-
process.env.NODE_ENV !== "production" && e.useEffect(() => {
|
|
427
|
-
if (!s.current) return;
|
|
428
|
-
let e = Q(s.current);
|
|
429
|
-
a ? e || Y(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${A.captureOwnerStack?.() || ""}`) : e && Y(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${A.captureOwnerStack?.() || ""}`);
|
|
430
|
-
}, [a]);
|
|
431
|
-
let f = e.useCallback(() => {
|
|
402
|
+
}), f = e.useCallback(() => {
|
|
432
403
|
let e = s.current;
|
|
433
|
-
|
|
404
|
+
$(e) && u && n && d.disabled === void 0 && e.disabled && (e.disabled = !1);
|
|
434
405
|
}, [
|
|
435
406
|
n,
|
|
436
407
|
d.disabled,
|
|
@@ -439,7 +410,7 @@ function Le(t = {}) {
|
|
|
439
410
|
return c(f, [f]), {
|
|
440
411
|
getButtonProps: e.useCallback((e = {}) => {
|
|
441
412
|
let { onClick: t, onMouseDown: r, onKeyUp: i, onKeyDown: o, onPointerDown: s, ...c } = e;
|
|
442
|
-
return
|
|
413
|
+
return z({
|
|
443
414
|
onClick(e) {
|
|
444
415
|
n ? e.preventDefault() : t?.(e);
|
|
445
416
|
},
|
|
@@ -447,15 +418,15 @@ function Le(t = {}) {
|
|
|
447
418
|
n || r?.(e);
|
|
448
419
|
},
|
|
449
420
|
onKeyDown(e) {
|
|
450
|
-
if (n || (
|
|
451
|
-
let t = e.target === e.currentTarget, r = e.currentTarget, i =
|
|
421
|
+
if (n || (G(e), o?.(e), e.baseUIHandlerPrevented)) return;
|
|
422
|
+
let t = e.target === e.currentTarget, r = e.currentTarget, i = $(r), s = !a && Ae(r), c = t && (a ? i : !s), l = e.key === "Enter", d = e.key === " ", f = r.getAttribute("role"), p = f?.startsWith("menuitem") || f === "option" || f === "gridcell";
|
|
452
423
|
if (t && u && d) {
|
|
453
424
|
if (e.defaultPrevented && p) return;
|
|
454
|
-
e.preventDefault(), (!a || i) && (e.preventBaseUIHandler(),
|
|
455
|
-
} else !c || a || !d && !l ? t && s && d && e.preventDefault() : e.defaultPrevented || (e.preventDefault(), l && (e.preventBaseUIHandler(),
|
|
425
|
+
e.preventDefault(), (!a || i) && (e.preventBaseUIHandler(), Q(r, e));
|
|
426
|
+
} else !c || a || !d && !l ? t && s && d && e.preventDefault() : e.defaultPrevented || (e.preventDefault(), l && (e.preventBaseUIHandler(), Q(r, e)));
|
|
456
427
|
},
|
|
457
428
|
onKeyUp(e) {
|
|
458
|
-
n || (
|
|
429
|
+
n || (G(e), i?.(e), e.target === e.currentTarget && a && u && $(e.currentTarget) && e.key === " " ? e.preventDefault() : e.baseUIHandlerPrevented || e.target === e.currentTarget && !a && !u && !e.defaultPrevented && e.key === " " && (e.preventBaseUIHandler(), Q(e.currentTarget, e)));
|
|
459
430
|
},
|
|
460
431
|
onPointerDown(e) {
|
|
461
432
|
n ? e.preventDefault() : s?.(e);
|
|
@@ -467,39 +438,37 @@ function Le(t = {}) {
|
|
|
467
438
|
u,
|
|
468
439
|
a
|
|
469
440
|
]),
|
|
470
|
-
buttonRef:
|
|
441
|
+
buttonRef: le((e) => {
|
|
471
442
|
s.current = e, f();
|
|
472
443
|
})
|
|
473
444
|
};
|
|
474
445
|
}
|
|
475
|
-
function
|
|
446
|
+
function $(e) {
|
|
476
447
|
return _(e) && e.tagName === "BUTTON";
|
|
477
448
|
}
|
|
478
|
-
function
|
|
449
|
+
function Ae(e) {
|
|
479
450
|
return _(e) && e.tagName === "A" && !!e.href;
|
|
480
451
|
}
|
|
481
|
-
var
|
|
482
|
-
let { render: n, className: r, disabled: i = !1, focusableWhenDisabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { getButtonProps: l, buttonRef: u } =
|
|
452
|
+
var je = /*#__PURE__*/ e.forwardRef(function(e, t) {
|
|
453
|
+
let { render: n, className: r, disabled: i = !1, focusableWhenDisabled: a = !1, nativeButton: o = !0, style: s, ...c } = e, { getButtonProps: l, buttonRef: u } = ke({
|
|
483
454
|
disabled: i,
|
|
484
455
|
focusableWhenDisabled: a,
|
|
485
456
|
native: o
|
|
486
457
|
});
|
|
487
|
-
return
|
|
458
|
+
return J("button", e, {
|
|
488
459
|
state: { disabled: i },
|
|
489
460
|
ref: [t, u],
|
|
490
461
|
props: [c, l]
|
|
491
462
|
});
|
|
492
|
-
})
|
|
493
|
-
|
|
494
|
-
var ze = e.forwardRef(function({ className: e, variant: t = "default", size: r = "default", ...i }, a) {
|
|
495
|
-
return /* @__PURE__ */ n($, {
|
|
463
|
+
}), Me = e.forwardRef(function({ className: e, variant: t = "default", size: r = "default", ...i }, a) {
|
|
464
|
+
return /* @__PURE__ */ n(je, {
|
|
496
465
|
ref: a,
|
|
497
466
|
"data-slot": "button",
|
|
498
467
|
"data-variant": t,
|
|
499
468
|
"data-size": r,
|
|
500
|
-
className:
|
|
469
|
+
className: Z("ck-button", e),
|
|
501
470
|
...i
|
|
502
471
|
});
|
|
503
472
|
});
|
|
504
|
-
|
|
505
|
-
export {
|
|
473
|
+
Me.displayName = "Button";
|
|
474
|
+
export { v as A, p as C, T as D, _ as E, c as F, o as I, s as L, b as M, w as N, h as O, u as P, a as R, D as S, g as T, m as _, De as a, ie as b, Y as c, pe as d, le as f, re as g, E as h, Ee as i, ee as j, y as k, J as l, j as m, ke as n, X as o, P as p, Q as r, Z as s, Me as t, z as u, A as v, C as w, k as x, f as y, i as z };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as i } from "./separator-
|
|
3
|
-
import { t as a } from "./useRender-
|
|
1
|
+
import { E as e, o as t, s as n, u as r } from "./button-D4GHW6oZ.js";
|
|
2
|
+
import { t as i } from "./separator-UhJb0Row.js";
|
|
3
|
+
import { t as a } from "./useRender-Uxk1OPK-.js";
|
|
4
4
|
import * as o from "react";
|
|
5
5
|
import { jsx as s } from "react/jsx-runtime";
|
|
6
6
|
var c = "ArrowUp", l = "ArrowDown", u = "ArrowLeft", d = "ArrowRight", f = "Home", p = "PageUp", m = "PageDown", h = /* @__PURE__ */ new Set([
|
|
@@ -57,33 +57,33 @@ function x(e) {
|
|
|
57
57
|
scrollPaddingLeft: parseFloat(t.scrollPaddingLeft) || 0
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
var S = o.forwardRef(function({ className: e, orientation:
|
|
60
|
+
var S = o.forwardRef(function({ className: e, orientation: n = "horizontal", ...r }, i) {
|
|
61
61
|
return /* @__PURE__ */ s("div", {
|
|
62
62
|
ref: i,
|
|
63
63
|
role: "group",
|
|
64
64
|
"data-slot": "button-group",
|
|
65
|
-
"data-orientation":
|
|
66
|
-
className:
|
|
67
|
-
...
|
|
65
|
+
"data-orientation": n,
|
|
66
|
+
className: t("ck-button-group", e),
|
|
67
|
+
...r
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
70
|
S.displayName = "ButtonGroup";
|
|
71
|
-
var C = o.forwardRef(function({ className: e, render:
|
|
71
|
+
var C = o.forwardRef(function({ className: e, render: n, ...i }, o) {
|
|
72
72
|
return a({
|
|
73
73
|
defaultTagName: "div",
|
|
74
74
|
ref: o,
|
|
75
|
-
props:
|
|
76
|
-
render:
|
|
75
|
+
props: r({ className: t("ck-button-group-text", e) }, i),
|
|
76
|
+
render: n,
|
|
77
77
|
state: { slot: "button-group-text" }
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
C.displayName = "ButtonGroupText";
|
|
81
|
-
var w = o.forwardRef(function({ className: e, orientation:
|
|
81
|
+
var w = o.forwardRef(function({ className: e, orientation: t = "vertical", ...r }, a) {
|
|
82
82
|
return /* @__PURE__ */ s(i, {
|
|
83
83
|
ref: a,
|
|
84
84
|
"data-slot": "button-group-separator",
|
|
85
|
-
orientation:
|
|
86
|
-
className:
|
|
85
|
+
orientation: t,
|
|
86
|
+
className: n("ck-button-group-separator", e),
|
|
87
87
|
...r
|
|
88
88
|
});
|
|
89
89
|
});
|
package/dist/shared/{comment-drawing-canvas-zIPS1dnW.js → comment-drawing-canvas-DbuXP54N.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "./annotation-toolbar-
|
|
2
|
-
import {
|
|
1
|
+
import { n as e, r as t, t as n } from "./annotation-toolbar-RSrb0Nku.js";
|
|
2
|
+
import { T as r, a as i, g as a, i as o } from "./comment-kit-ui-BXLJcZYQ.js";
|
|
3
3
|
import * as s from "react";
|
|
4
4
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
5
|
var d = ".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-drawing-canvas{z-index:var(--z-ck-marker-layer);cursor:none;pointer-events:auto;flex-direction:column;padding-top:1rem;display:flex;position:fixed;inset:0}.ck-drawing-canvas-scrim{pointer-events:none;background-color:#0000004d;position:absolute;inset:0}@supports ((-webkit-backdrop-filter:blur(4px)) or (backdrop-filter:blur(4px))){.ck-drawing-canvas-scrim{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}}.ck-drawing-canvas-toolbar{z-index:1;cursor:auto;width:100%;min-width:0;margin-inline:auto;padding-inline:.75rem;position:relative}.ck-drawing-canvas-surface{z-index:0;touch-action:none;flex:auto;min-height:0;position:relative}.ck-drawing-canvas-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}";
|