@commentkit/comment-kit 0.6.9 → 0.7.1

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 (73) hide show
  1. package/CHANGELOG.md +63 -4
  2. package/LICENSE +18 -2
  3. package/README.md +133 -88
  4. package/SECURITY.md +48 -0
  5. package/dist/THIRD_PARTY_NOTICES.txt +284 -0
  6. package/dist/angular.es.js +25 -12
  7. package/dist/comment-kit.es.js +25 -13
  8. package/dist/demo.es.js +148 -70
  9. package/dist/headless.es.js +3 -3
  10. package/dist/preact.es.js +3 -3
  11. package/dist/qwik.es.js +1 -110
  12. package/dist/qwik.qwik.mjs +114 -0
  13. package/dist/react.es.js +3 -3
  14. package/dist/shared/annotation-icons-Dh-bmNYK.js +172 -0
  15. package/dist/shared/annotation-toolbar-cGC1p-SP.js +1093 -0
  16. package/dist/shared/attachment-refresh-CzQFXHkL.js +94 -0
  17. package/dist/shared/{bridge-DRE03N9X.js → bridge-CJoGYngu.js} +6 -3
  18. package/dist/shared/{button-group-CHfMRXyA.js → button-group-CWdKaOlC.js} +14 -16
  19. package/dist/shared/capture-colors-CxSLsU5-.js +74 -0
  20. package/dist/shared/comment-drawing-canvas-DdXlMgbF.js +124 -0
  21. package/dist/shared/comment-icon-Dg9ZWpz-.js +608 -0
  22. package/dist/shared/comment-image-lightbox-B7iHjnAz.js +190 -0
  23. package/dist/shared/comment-images-content-D7YNUgo5.js +214 -0
  24. package/dist/shared/{comment-kit-core-D0kY00St.js → comment-kit-core-C862uNAm.js} +1371 -853
  25. package/dist/shared/comment-kit-ui-0vd-DY4S.js +19977 -0
  26. package/dist/shared/comment-screenshot-annotator-DcaSSuWB.js +151 -0
  27. package/dist/shared/comment-screenshot-overlay-D_nFoJmM.js +207 -0
  28. package/dist/shared/{dev-export-panel-BLngcr5q.js → dev-export-panel-pWBlhlse.js} +8 -8
  29. package/dist/shared/dev-grab-eQ9EgEGY.js +210 -0
  30. package/dist/shared/dist-De294MVF.js +623 -0
  31. package/dist/shared/{element-selector-CtFzgHvq.js → element-selector-DC-_XJ0k.js} +350 -305
  32. package/dist/shared/{icons-BSHCWYO1.js → icons-nzMOLzrm.js} +2 -3
  33. package/dist/shared/{mount-ui-CVivB_eQ.js → mount-ui-B68j8r6I.js} +4 -4
  34. package/dist/shared/{pusher-BEl7Qn-8.js → pusher-C1FHQGXV.js} +1 -1
  35. package/dist/shared/realtime-Diqz7G_y.js +317 -0
  36. package/dist/shared/realtime-recovery-DJ_adc-H.js +135 -0
  37. package/dist/shared/{separator-DusFNTs-.js → separator-XDBsaWyw.js} +891 -785
  38. package/dist/shared/{shadow-root-CmYXiSRR.js → shadow-root-CrO75sED.js} +1 -1
  39. package/dist/shared/styles-C9Jwvm0Q.js +2 -0
  40. package/dist/shared/useRender-D1z_X_BY.js +5 -0
  41. package/dist/shared/{useValueChanged-DQXLia-2.js → useValueChanged-CrzfD8l-.js} +15 -15
  42. package/dist/shared/{validation-C7QG8j7Z.js → validation-D-8u4M7I.js} +14 -1
  43. package/dist/shared/{websocket-manager-BTRqNTB7.js → websocket-manager-CFak_YHy.js} +148 -89
  44. package/dist/solid.es.js +3 -3
  45. package/dist/svelte.es.js +3 -3
  46. package/dist/types/adapters/bridge.d.ts +9 -12
  47. package/dist/types/angular/index.d.ts +15 -5
  48. package/dist/types/core/api-client.d.ts +24 -18
  49. package/dist/types/core/comment-kit-core.d.ts +28 -11
  50. package/dist/types/core/local-demo.d.ts +1 -0
  51. package/dist/types/core/types.d.ts +103 -0
  52. package/dist/types/core/websocket-manager.d.ts +12 -0
  53. package/dist/types/core/write-access.d.ts +9 -0
  54. package/dist/types/headless.d.ts +1 -1
  55. package/dist/types/index.d.ts +8 -4
  56. package/dist/types/qwik/index.d.ts +4 -1
  57. package/dist/vue.es.js +3 -3
  58. package/docs/api-reference.md +378 -0
  59. package/docs/local-demo.md +60 -0
  60. package/package.json +17 -6
  61. package/dist/shared/annotation-toolbar-pX17NLmJ.js +0 -1104
  62. package/dist/shared/clamp-CcFVX0vC.js +0 -55
  63. package/dist/shared/comment-drawing-canvas-CYu5SwRf.js +0 -126
  64. package/dist/shared/comment-image-lightbox-0VdAs2iT.js +0 -178
  65. package/dist/shared/comment-kit-ui-D2j2gvnm.js +0 -16685
  66. package/dist/shared/comment-screenshot-annotator-BuojwviY.js +0 -137
  67. package/dist/shared/comment-screenshot-overlay-BZX0Vcb8.js +0 -144
  68. package/dist/shared/dev-grab-pDAfH2lr.js +0 -203
  69. package/dist/shared/local-demo-context-BohlYbHt.js +0 -6
  70. package/dist/shared/realtime-BG_t_ze7.js +0 -281
  71. package/dist/shared/resolveAriaLabelledBy-CIKpnjNJ.js +0 -669
  72. package/dist/shared/styles-D_FEJZ9G.js +0 -2
  73. package/dist/shared/useLabelableId-DGbfdMi_.js +0 -155
@@ -1,1104 +0,0 @@
1
- import { D as e, I as t, L as n, T as r, c as i, d as a, f as o, g as s, m as c, p as l, s as u, t as d, u as f } from "./button-By0hGrJK.js";
2
- import { Dt as p, Qt as m, St as h, Tt as g, Yt as ee, Zt as te, bt as _, i as v, jt as y, o as b, r as x, t as S, wt as C, x as w } from "./separator-DusFNTs-.js";
3
- import { D as ne, O as re, S as ie, c as ae, h as T, n as oe, p as se, t as ce, v as le } from "./useValueChanged-DQXLia-2.js";
4
- import { i as ue } from "./ShadowRootContext-Bv-4aElu.js";
5
- import { t as E } from "./createReactComponent-BZHeRbD0.js";
6
- import { _ as de, a as fe, b as pe, c as D, i as me, l as O, m as k, n as he, r as ge, t as A, v as j, x as M } from "./resolveAriaLabelledBy-CIKpnjNJ.js";
7
- import { a as _e, c as ve, d as ye, i as be, o as N, r as xe, s as Se, t as P, u as Ce } from "./button-group-CHfMRXyA.js";
8
- import { n as F, r as we, t as I } from "./clamp-CcFVX0vC.js";
9
- import { a as L, i as Te, n as Ee, o as De, r as R, s as z, t as Oe } from "./useLabelableId-DGbfdMi_.js";
10
- import { _ as B, h as V } from "./comment-kit-ui-D2j2gvnm.js";
11
- import * as H from "react";
12
- import { jsx as U, jsxs as W } from "react/jsx-runtime";
13
- var ke = E("outline", "arrow-back-up", "ArrowBackUp", [["path", {
14
- d: "M9 14l-4 -4l4 -4",
15
- key: "svg-0"
16
- }], ["path", {
17
- d: "M5 10h11a4 4 0 1 1 0 8h-1",
18
- key: "svg-1"
19
- }]]), Ae = E("outline", "arrow-forward-up", "ArrowForwardUp", [["path", {
20
- d: "M15 14l4 -4l-4 -4",
21
- key: "svg-0"
22
- }], ["path", {
23
- d: "M19 10h-11a4 4 0 1 0 0 8h1",
24
- key: "svg-1"
25
- }]]), G = E("outline", "circle", "Circle", [["path", {
26
- d: "M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",
27
- key: "svg-0"
28
- }]]), je = E("outline", "minus", "Minus", [["path", {
29
- d: "M5 12l14 0",
30
- key: "svg-0"
31
- }]]), K = E("outline", "pencil", "Pencil", [["path", {
32
- d: "M4 20h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4",
33
- key: "svg-0"
34
- }], ["path", {
35
- d: "M13.5 6.5l4 4",
36
- key: "svg-1"
37
- }]]), Me = E("outline", "rectangle", "Rectangle", [["path", {
38
- d: "M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10",
39
- key: "svg-0"
40
- }]]), q = E("outline", "trash", "Trash", [
41
- ["path", {
42
- d: "M4 7l16 0",
43
- key: "svg-0"
44
- }],
45
- ["path", {
46
- d: "M10 11l0 6",
47
- key: "svg-1"
48
- }],
49
- ["path", {
50
- d: "M14 11l0 6",
51
- key: "svg-2"
52
- }],
53
- ["path", {
54
- d: "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",
55
- key: "svg-3"
56
- }],
57
- ["path", {
58
- d: "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",
59
- key: "svg-4"
60
- }]
61
- ]), Ne = () => () => {}, Pe = () => !0, Fe = () => !1;
62
- function Ie() {
63
- return w(Ne, Pe, Fe);
64
- }
65
- function Le() {
66
- let [e, t] = H.useState(!1);
67
- return H.useEffect(() => {
68
- t(!0);
69
- }, []), e;
70
- }
71
- var Re = l(18) ? Ie : Le;
72
- function ze() {
73
- return !Re();
74
- }
75
- function Be(e) {
76
- let { script: t } = e, { nonce: n } = F();
77
- return ze() ? /*#__PURE__*/ U("script", {
78
- nonce: n,
79
- dangerouslySetInnerHTML: { __html: t },
80
- suppressHydrationWarning: !0
81
- }) : null;
82
- }
83
- function J() {
84
- let e = H.useRef(0), [t, n] = H.useState({
85
- paths: [],
86
- undone: [],
87
- activePath: null,
88
- tool: "pen",
89
- color: V,
90
- strokeWidth: 3
91
- }), r = H.useCallback((e) => {
92
- n((t) => ({
93
- ...t,
94
- tool: e
95
- }));
96
- }, []), i = H.useCallback((e) => {
97
- n((t) => ({
98
- ...t,
99
- color: e
100
- }));
101
- }, []), a = H.useCallback((e) => {
102
- n((t) => ({
103
- ...t,
104
- strokeWidth: e
105
- }));
106
- }, []), o = H.useCallback((t, r) => {
107
- let i = `path-${String(++e.current)}`;
108
- n((e) => ({
109
- ...e,
110
- activePath: {
111
- id: i,
112
- tool: e.tool,
113
- points: [{
114
- x: t,
115
- y: r
116
- }],
117
- color: e.color,
118
- strokeWidth: e.strokeWidth
119
- }
120
- }));
121
- }, []), s = H.useCallback((e, t) => {
122
- n((n) => {
123
- if (!n.activePath) return n;
124
- if (n.tool === "pen") return {
125
- ...n,
126
- activePath: {
127
- ...n.activePath,
128
- points: [...n.activePath.points, {
129
- x: e,
130
- y: t
131
- }]
132
- }
133
- };
134
- let r = n.activePath.points[0] ?? {
135
- x: 0,
136
- y: 0
137
- };
138
- return {
139
- ...n,
140
- activePath: {
141
- ...n.activePath,
142
- points: [r, {
143
- x: e,
144
- y: t
145
- }]
146
- }
147
- };
148
- });
149
- }, []), c = H.useCallback(() => {
150
- n((e) => !e.activePath || e.activePath.points.length < 2 ? {
151
- ...e,
152
- activePath: null
153
- } : {
154
- ...e,
155
- paths: [...e.paths, e.activePath],
156
- undone: [],
157
- activePath: null
158
- });
159
- }, []), l = H.useCallback(() => {
160
- n((e) => e.paths.length === 0 ? e : {
161
- ...e,
162
- paths: e.paths.slice(0, -1),
163
- undone: [...e.undone, ...e.paths.slice(-1)]
164
- });
165
- }, []), u = H.useCallback(() => {
166
- n((e) => e.undone.length === 0 ? e : {
167
- ...e,
168
- paths: [...e.paths, ...e.undone.slice(-1)],
169
- undone: e.undone.slice(0, -1)
170
- });
171
- }, []), d = H.useCallback(() => {
172
- n((e) => ({
173
- ...e,
174
- paths: [],
175
- undone: [],
176
- activePath: null
177
- }));
178
- }, []);
179
- return {
180
- ...t,
181
- setTool: r,
182
- setColor: i,
183
- setStrokeWidth: a,
184
- startPath: o,
185
- addPoint: s,
186
- endPath: c,
187
- undo: l,
188
- redo: u,
189
- clear: d,
190
- canUndo: t.paths.length > 0,
191
- canRedo: t.undone.length > 0
192
- };
193
- }
194
- function Ve(e, t) {
195
- return e - t;
196
- }
197
- function He(e, t, n, r, i, a) {
198
- let o = I(e, n, r);
199
- if (!i) return o;
200
- let s = a.slice();
201
- return s[t] = I(o, a[t - 1] ?? -Infinity, a[t + 1] ?? Infinity), s.sort(Ve);
202
- }
203
- function Ue(e, t, n) {
204
- if (!Array.isArray(e)) return !0;
205
- let r = t * n;
206
- for (let t = 0; t < e.length - 1; t += 1) if (!(Math.abs(e[t] - e[t + 1]) >= r)) return !1;
207
- return !0;
208
- }
209
- var Y = () => null, We = {
210
- activeThumbIndex: Y,
211
- max: Y,
212
- min: Y,
213
- minStepsBetweenValues: Y,
214
- step: Y,
215
- values: Y,
216
- ...z
217
- }, Ge = /*#__PURE__*/ H.createContext(void 0);
218
- process.env.NODE_ENV !== "production" && (Ge.displayName = "SliderRootContext");
219
- function X() {
220
- let e = H.useContext(Ge);
221
- if (e === void 0) throw Error(process.env.NODE_ENV === "production" ? t(62) : "Base UI: SliderRootContext is missing. Slider parts must be placed within <Slider.Root>.");
222
- return e;
223
- }
224
- function Ke(e, t) {
225
- return e === t || Array.isArray(e) && Array.isArray(t) && ge(e, t);
226
- }
227
- var Z = /*#__PURE__*/ H.forwardRef(function(e, t) {
228
- let { "aria-labelledby": r, className: i, defaultValue: a, disabled: s = !1, id: l, format: u, largeStep: d = 10, locale: p, render: m, max: g = 100, min: _ = 0, minStepsBetweenValues: v = 0, form: y, name: b, onValueChange: x, onValueCommitted: S, orientation: C = "horizontal", step: w = 1, thumbCollisionBehavior: ie = "push", thumbAlignment: ae = "center", value: ue, style: E, ...de } = e, fe = oe(l), pe = A(fe), D = c(x), me = c(S), { clearErrors: O } = R(), { state: j, disabled: M, name: _e, setTouched: ve, setDirty: ye, validityData: be, validation: N } = De(), { labelId: xe } = Ee(), [Se, P] = H.useState(), Ce = r ?? he(xe, Se), F = M || s, L = _e ?? b, [z, Oe] = we({
229
- controlled: ue,
230
- default: a ?? _,
231
- name: "Slider"
232
- }), B = H.useRef(null), V = H.useRef(null), W = H.useRef([]), ke = H.useRef(null), Ae = H.useRef(-1), G = H.useRef(null), je = H.useRef(le), [K, Me] = H.useState(-1), [q, Ne] = H.useState(-1), [Pe, Fe] = H.useState(!1), [Ie, Le] = H.useState(() => /* @__PURE__ */ new Map()), [Re, ze] = H.useState([void 0, void 0]), Be = c((e) => {
233
- Me(e), e !== -1 && Ne(e);
234
- }), J = c((e) => {
235
- e && (V.current = e);
236
- }), Y = Array.isArray(z), X = H.useMemo(() => Y ? z.map((e) => I(e, _, g)).sort(Ve) : [I(z, _, g)], [
237
- g,
238
- _,
239
- Y,
240
- z
241
- ]), Z = Y ? X : X[0];
242
- Te(N.inputRef, fe, Z, void 0, !F, b), ce(Z, () => {
243
- O(L), N.change(Z);
244
- let e = be.initialValue, t;
245
- t = Array.isArray(Z) && Array.isArray(e) ? !ge(Z, e) : Z !== e, ye(t);
246
- });
247
- let qe = c((e, t) => {
248
- if (Number.isNaN(e) || Ke(e, z)) return !1;
249
- let n = t.event, r = n.constructor, i = new r(n.type, n);
250
- return Object.defineProperty(i, "target", {
251
- writable: !0,
252
- value: {
253
- value: e,
254
- name: L
255
- }
256
- }), t.event = i, D(e, t), !t.isCanceled && (je.current = t.reason, Oe(e), !0);
257
- }), Je = c((e, t, n) => {
258
- let r = He(e, t, _, g, Y, X);
259
- if (Ue(r, w, v)) {
260
- let e = "key" in n ? T : se, i = qe(r, ne(e, n.nativeEvent, void 0, { activeThumbIndex: t }));
261
- ve(!0), i && me(r, re(e, n.nativeEvent));
262
- }
263
- });
264
- process.env.NODE_ENV !== "production" && _ >= g && o("Slider `max` must be greater than `min`."), n(() => {
265
- if (!F) return;
266
- let e = ee(h(B.current));
267
- te(B.current, e) && e.blur(), K !== -1 && Be(-1);
268
- }, [
269
- K,
270
- F,
271
- Be
272
- ]);
273
- let Q = H.useMemo(() => ({
274
- ...j,
275
- activeThumbIndex: K,
276
- disabled: F,
277
- dragging: Pe,
278
- orientation: C,
279
- max: g,
280
- min: _,
281
- minStepsBetweenValues: v,
282
- step: w,
283
- values: X
284
- }), [
285
- j,
286
- K,
287
- F,
288
- Pe,
289
- g,
290
- _,
291
- v,
292
- C,
293
- w,
294
- X
295
- ]), Ye = H.useMemo(() => ({
296
- active: K,
297
- controlRef: V,
298
- disabled: F,
299
- dragging: Pe,
300
- validation: N,
301
- format: u,
302
- handleInputChange: Je,
303
- indicatorPosition: Re,
304
- inset: ae !== "center",
305
- isArrayValue: Y,
306
- labelId: Ce,
307
- rootLabelId: pe,
308
- largeStep: d,
309
- lastUsedThumbIndex: q,
310
- lastChangeReasonRef: je,
311
- form: y,
312
- locale: p,
313
- max: g,
314
- min: _,
315
- minStepsBetweenValues: v,
316
- name: L,
317
- onValueCommitted: me,
318
- orientation: C,
319
- pressedThumbCenterOffsetRef: ke,
320
- pressedThumbIndexRef: Ae,
321
- pressedValuesRef: G,
322
- registerFieldControlRef: J,
323
- renderBeforeHydration: ae === "edge",
324
- setActive: Be,
325
- setDragging: Fe,
326
- setIndicatorPosition: ze,
327
- setLabelId: P,
328
- setValue: qe,
329
- state: Q,
330
- step: w,
331
- thumbCollisionBehavior: ie,
332
- thumbMap: Ie,
333
- thumbRefs: W,
334
- values: X
335
- }), [
336
- K,
337
- Ce,
338
- pe,
339
- F,
340
- Pe,
341
- N,
342
- u,
343
- Je,
344
- Re,
345
- d,
346
- q,
347
- y,
348
- p,
349
- g,
350
- _,
351
- v,
352
- L,
353
- me,
354
- C,
355
- Y,
356
- J,
357
- Be,
358
- qe,
359
- Q,
360
- w,
361
- ie,
362
- ae,
363
- Ie,
364
- X
365
- ]), $ = f("div", e, {
366
- state: Q,
367
- ref: [t, B],
368
- props: [
369
- {
370
- "aria-labelledby": Ce,
371
- id: fe,
372
- role: "group"
373
- },
374
- de,
375
- (e) => N.getValidationProps(F, e)
376
- ],
377
- stateAttributesMapping: We
378
- });
379
- return /*#__PURE__*/ U(Ge.Provider, {
380
- value: Ye,
381
- children: /*#__PURE__*/ U(k, {
382
- elementsRef: W,
383
- onMapChange: Le,
384
- children: $
385
- })
386
- });
387
- });
388
- process.env.NODE_ENV !== "production" && (Z.displayName = "SliderRoot");
389
- function qe(e) {
390
- return e === "touch" || e === "pen";
391
- }
392
- function Je(e, t) {
393
- let n = e.getBoundingClientRect();
394
- return t ? (n.top + n.bottom) / 2 : (n.left + n.right) / 2;
395
- }
396
- function Q(e) {
397
- if (e === 0) return 0;
398
- if (Math.abs(e) < 1) {
399
- let t = e.toExponential().split("e-"), n = t[0].split(".")[1];
400
- return (n ? n.length : 0) + parseInt(t[1], 10);
401
- }
402
- let t = e.toString().split(".")[1];
403
- return t ? t.length : 0;
404
- }
405
- function Ye(e, t, n) {
406
- let r = Math.round((e - n) / t) * t + n;
407
- return Number(r.toFixed(Math.max(Q(t), Q(n))));
408
- }
409
- function $(e, t, n, r, i, a, o, s) {
410
- let c = e.slice(), l = a * o, u = c.length - 1, d = s ?? e, f = r + t * l, p = i - (u - t) * l;
411
- c[t] = I(n, f, p);
412
- for (let e = t + 1; e <= u; e += 1) {
413
- let t = c[e - 1] + l, n = i - (u - e) * l, r = d[e], a = Math.max(c[e], t);
414
- r < a && (a = Math.max(r, t)), c[e] = I(a, t, n);
415
- }
416
- for (let e = t - 1; e >= 0; --e) {
417
- let t = c[e + 1] - l, n = r + e * l, i = d[e], a = Math.min(c[e], t);
418
- i > a && (a = Math.min(i, t)), c[e] = I(a, n, t);
419
- }
420
- for (let e = 0; e <= u; e += 1) c[e] = Number(c[e].toFixed(12));
421
- return c;
422
- }
423
- function Xe(e, t, n, r, i, a, o, s, c, l) {
424
- let u = n ?? t, d = r ?? t;
425
- if (!(u.length > 1)) return {
426
- value: a,
427
- thumbIndex: 0,
428
- didSwap: !1
429
- };
430
- let f = c * l;
431
- if (e === "push") return {
432
- value: $(u, i, a, o, s, c, l),
433
- thumbIndex: i,
434
- didSwap: !1
435
- };
436
- let p = u.slice(), m = p[i - 1], h = p[i + 1], g = m == null ? o : m + f, ee = h == null ? s : h - f, te = Number(I(a, g, ee).toFixed(12));
437
- switch (p[i] = te, e) {
438
- case "swap": {
439
- let e = u[i], t = 1e-7, n = a > e, r = a < e, g = n && h != null && a >= h - t, ee = r && m != null && a <= m + t;
440
- if (!g && !ee) return {
441
- value: p,
442
- thumbIndex: i,
443
- didSwap: !1
444
- };
445
- let _ = g ? i + 1 : i - 1, v = p.map((e, t) => t === i ? te : d[t] ?? u[t]), y = a;
446
- y = g ? Math.max(a, p[_]) : Math.min(a, p[_]);
447
- let b = $(p, _, y, o, s, c, l, v), x = g ? _ - 1 : _ + 1, S = b[x - 1], C = b[x + 1], w = S == null ? o : S + f;
448
- w = Math.max(w, o + x * f);
449
- let ne = C == null ? s : C - f;
450
- ne = Math.min(ne, s - (b.length - 1 - x) * f);
451
- let re = I(te, w, ne);
452
- return b[x] = Number(re.toFixed(12)), {
453
- value: b,
454
- thumbIndex: _,
455
- didSwap: !0
456
- };
457
- }
458
- default: return {
459
- value: p,
460
- thumbIndex: i,
461
- didSwap: !1
462
- };
463
- }
464
- }
465
- var Ze = 2;
466
- function Qe(e, t) {
467
- if (!e) return {
468
- start: 0,
469
- end: 0
470
- };
471
- function n(e) {
472
- let t = e == null ? 0 : parseFloat(e);
473
- return Number.isNaN(t) ? 0 : t;
474
- }
475
- let r = t ? "Top" : "InlineStart", i = t ? "Bottom" : "InlineEnd";
476
- return {
477
- start: n(e[`border${r}Width`]) + n(e[`padding${r}`]),
478
- end: n(e[`border${i}Width`]) + n(e[`padding${i}`])
479
- };
480
- }
481
- function $e(e, t) {
482
- if (t.current != null && e.changedTouches) {
483
- let n = e;
484
- for (let e = 0; e < n.changedTouches.length; e += 1) {
485
- let r = n.changedTouches[e];
486
- if (r.identifier === t.current) return {
487
- x: r.clientX,
488
- y: r.clientY
489
- };
490
- }
491
- return null;
492
- }
493
- return {
494
- x: e.clientX,
495
- y: e.clientY
496
- };
497
- }
498
- var et = /*#__PURE__*/ H.forwardRef(function(t, n) {
499
- let { render: i, className: a, style: o, ...s } = t, { disabled: l, dragging: u, inset: d, isArrayValue: _, lastChangeReasonRef: v, max: y, min: b, minStepsBetweenValues: x, onValueCommitted: S, orientation: w, pressedThumbCenterOffsetRef: T, pressedThumbIndexRef: oe, pressedValuesRef: se, registerFieldControlRef: ce, renderBeforeHydration: le, setActive: E, setDragging: de, setValue: fe, state: pe, step: D, thumbCollisionBehavior: me, thumbRefs: O, values: k } = X(), he = ue(), ge = k.length > 1, A = w === "vertical", j = H.useRef(null), M = H.useRef(null), _e = c((e) => {
500
- e && M.current == null && (M.current = r(e).getComputedStyle(e));
501
- }), ve = H.useRef(null), ye = H.useRef(0), be = H.useRef(0), N = H.useRef(null), xe = H.useRef(!1), Se = g(k);
502
- function P(e) {
503
- return e?.querySelector("input[type=\"range\"]");
504
- }
505
- function Ce(e) {
506
- oe.current = e, O.current[e] || (T.current = null);
507
- }
508
- function F() {
509
- oe.current = -1, T.current = null;
510
- }
511
- function we(t) {
512
- return e(t) ? O.current.some((n) => !e(n) || !te(n, t) ? !1 : P(n)?.disabled === !0) : !1;
513
- }
514
- function L(e) {
515
- let t = j.current, n = oe.current;
516
- if (!t || n < 0 || n >= k.length) return n >= k.length && (N.current = null), null;
517
- let { width: r, height: i, bottom: a, left: o, right: s } = t.getBoundingClientRect(), c = Qe(M.current, A), l = be.current, u = (A ? i : r) - c.start - c.end - l * 2, d = T.current ?? 0, f = e.x - d, p = e.y - d, m = A ? a - p - c.end : (he === "rtl" ? s - f : f - o) - c.start, h = I((m - l) / u, 0, 1), g = (y - b) * h + b;
518
- return g = Ye(g, D, b), g = I(g, b, y), ge ? Xe(me, k, Se.current, se.current, n, g, b, y, D, x) : {
519
- value: _ ? [g] : g,
520
- thumbIndex: n,
521
- didSwap: !1
522
- };
523
- }
524
- function Te(t) {
525
- se.current = ge ? k.slice() : null, N.current = null, Se.current = k;
526
- let n = oe.current, r = n;
527
- if (n > -1 && n < k.length) {
528
- if (k[n] === y) {
529
- let e = n;
530
- for (; e > 0 && k[e - 1] === y;) --e;
531
- r = e;
532
- }
533
- } else {
534
- let n = A ? "y" : "x", i;
535
- r = -1;
536
- for (let a = 0; a < O.current.length; a += 1) {
537
- let o = O.current[a];
538
- if (e(o) && !P(o)?.disabled) {
539
- let e = Je(o, A), s = Math.abs(t[n] - e);
540
- (i === void 0 || s <= i) && (r = a, i = s);
541
- }
542
- }
543
- }
544
- if (r > -1 && r !== n && Ce(r), d) {
545
- let t = O.current[r];
546
- if (e(t)) {
547
- let e = t.getBoundingClientRect();
548
- be.current = e[A ? "height" : "width"] / 2;
549
- }
550
- }
551
- }
552
- function Ee(e) {
553
- let t = P(O.current?.[e]);
554
- t && t.focus({
555
- preventScroll: !0,
556
- focusVisible: !1
557
- });
558
- }
559
- function De(e, t, n) {
560
- let r = fe(e.value, ne(t, n, void 0, { activeThumbIndex: e.thumbIndex }));
561
- return r && (N.current = e.value, Se.current = Array.isArray(e.value) ? e.value : [e.value], e.didSwap && (Ce(e.thumbIndex), Ee(e.thumbIndex))), r;
562
- }
563
- let R = c((e) => {
564
- let t = $e(e, ve);
565
- if (t == null) return;
566
- if (ye.current += 1, e.type === "pointermove" && e.buttons === 0) {
567
- z(e);
568
- return;
569
- }
570
- let n = L(t);
571
- n != null && Ue(n.value, D, x) && (!u && ye.current > Ze && de(!0), De(n, ae, e));
572
- }), z = c((e) => {
573
- if ($e(e, ve) == null) return;
574
- E(-1), de(!1), T.current = null;
575
- let t = N.current;
576
- if (Array.isArray(t) && t.length !== k.length && (N.current = null), N.current != null) {
577
- let t = v.current;
578
- S(N.current, re(t, e));
579
- }
580
- "pointerType" in e && j.current?.hasPointerCapture(e.pointerId) && j.current?.releasePointerCapture(e.pointerId), oe.current = -1, V();
581
- }), Oe = c((e) => {
582
- ve.current ?? z(e);
583
- }), B = c((e) => {
584
- let t = xe.current;
585
- if (xe.current = !1, l) return;
586
- if (we(m(e))) {
587
- F();
588
- return;
589
- }
590
- let n = e.changedTouches[0];
591
- if (n == null) return;
592
- if (ve.current = n.identifier, !t) {
593
- let t = {
594
- x: n.clientX,
595
- y: n.clientY
596
- };
597
- Te(t);
598
- let r = L(t);
599
- if (r == null) return;
600
- Ee(r.thumbIndex), De(r, ie, e), ye.current = 0;
601
- }
602
- let r = h(j.current);
603
- r.addEventListener("touchmove", R, { passive: !0 }), r.addEventListener("touchend", z, { passive: !0 }), r.addEventListener("touchcancel", z, { passive: !0 });
604
- }), V = c(() => {
605
- let e = h(j.current);
606
- e.removeEventListener("pointermove", R), e.removeEventListener("pointerup", z), e.removeEventListener("pointercancel", Oe), e.removeEventListener("touchmove", R), e.removeEventListener("touchend", z), e.removeEventListener("touchcancel", z), ve.current = null, se.current = null, N.current = null, xe.current = !1;
607
- }), U = C();
608
- return H.useEffect(() => {
609
- let e = j.current;
610
- if (!e) return () => V();
611
- let t = p(e, "touchstart", B, { passive: !0 });
612
- return () => {
613
- t(), U.cancel(), V();
614
- };
615
- }, [
616
- V,
617
- B,
618
- j,
619
- U
620
- ]), H.useEffect(() => {
621
- l && V();
622
- }, [l, V]), f("div", t, {
623
- state: pe,
624
- ref: [
625
- n,
626
- ce,
627
- j,
628
- _e
629
- ],
630
- props: [{
631
- "data-base-ui-slider-control": le ? "" : void 0,
632
- onPointerDown(t) {
633
- xe.current = !1;
634
- let n = j.current, r = m(t.nativeEvent);
635
- if (!n || l || t.defaultPrevented || !e(r) || t.button !== 0) return;
636
- if (we(r)) {
637
- F();
638
- return;
639
- }
640
- let i = {
641
- x: t.clientX,
642
- y: t.clientY
643
- };
644
- Te(i);
645
- let a = L(i);
646
- if (a == null) return;
647
- te(O.current[a.thumbIndex], ee(h(n))) ? t.preventDefault() : U.request(() => {
648
- Ee(a.thumbIndex);
649
- }), de(!0), T.current ?? De(a, ie, t.nativeEvent), t.nativeEvent.pointerId && n.setPointerCapture(t.nativeEvent.pointerId), ye.current = 0, xe.current = qe(t.pointerType);
650
- let o = h(n);
651
- o.addEventListener("pointermove", R, { passive: !0 }), o.addEventListener("pointerup", z, { once: !0 }), o.addEventListener("pointercancel", Oe, { once: !0 });
652
- }
653
- }, s],
654
- stateAttributesMapping: We
655
- });
656
- });
657
- process.env.NODE_ENV !== "production" && (et.displayName = "SliderControl");
658
- var tt = /*#__PURE__*/ H.forwardRef(function(e, t) {
659
- let { render: n, className: r, style: i, ...a } = e, { state: o } = X();
660
- return f("div", e, {
661
- state: o,
662
- ref: t,
663
- props: [{ style: { position: "relative" } }, a],
664
- stateAttributesMapping: We
665
- });
666
- });
667
- process.env.NODE_ENV !== "production" && (tt.displayName = "SliderTrack");
668
- var nt = "data-index", rt, it = /* @__PURE__ */ new Set([
669
- ...Se,
670
- ye,
671
- Ce
672
- ]);
673
- function at(e, t, n, r) {
674
- if (!(t < 0)) return e.length === 2 ? `${fe(e[t], r, n)} ${t === 0 ? "start" : "end"} range` : n ? fe(e[t], r, n) : void 0;
675
- }
676
- function ot(e, t, n, r, i) {
677
- let a = e + t * n, o = Number(a.toFixed(Math.max(Q(e), Q(t), Q(r))));
678
- return I(o, r, i);
679
- }
680
- var st = /*#__PURE__*/ H.forwardRef(function(e, t) {
681
- let { render: i, children: o, className: l, "aria-describedby": u, "aria-label": d, "aria-labelledby": p, "aria-valuetext": m, disabled: h = !1, getAriaLabel: g, getAriaValueText: ee, id: v, index: b, inputRef: x, onBlur: S, onFocus: C, onKeyDown: w, tabIndex: ne, style: re, ...ie } = e, ae = oe(v), { active: T, lastUsedThumbIndex: se, controlRef: ce, disabled: le, validation: E, format: pe, handleInputChange: D, inset: O, isArrayValue: k, labelId: he, largeStep: ge, locale: A, max: j, min: M, minStepsBetweenValues: P, form: F, name: we, orientation: I, pressedThumbCenterOffsetRef: Te, pressedThumbIndexRef: Ee, renderBeforeHydration: R, setActive: z, setIndicatorPosition: B, state: V, step: ke, thumbRefs: Ae, values: G } = X(), je = ue(), K = h || le, Me = G.length > 1, q = I === "vertical", Ne = je === "rtl", { setTouched: Pe, validationMode: Fe } = De(), Ie = H.useRef(null), Le = H.useRef(null), Re = L(K, Le), J = H.useRef(!1), Ve = c((e) => {
682
- J.current || C?.(e);
683
- }), Ue = c((e) => {
684
- J.current || S?.(e);
685
- }), Y = oe(), Ge = Oe(), Ke = Me ? Y : Ge, Z = H.useMemo(() => ({ inputId: Ke }), [Ke]), { ref: qe, index: Q } = de({ metadata: Z }), $ = Me ? b ?? Q : 0, Xe = $ === G.length - 1, Ze = G[$], Qe = me(Ze, M, j), [$e, et] = H.useState(), tt = ze(), st = se >= 0 && se < G.length ? se : -1, ct = c(() => {
686
- let e = ce.current, t = Ie.current;
687
- if (!e || !t) return;
688
- let n = t.getBoundingClientRect(), r = e.getBoundingClientRect(), i = q ? "height" : "width", a = r[i] - n[i], o = (n[i] / 2 + a * Qe / 100) / r[i] * 100, s = Number.isFinite(o) ? o : void 0;
689
- et(s), $ === 0 ? B((e) => [s, e[1]]) : Xe && B((e) => [e[0], s]);
690
- });
691
- n(() => {
692
- O && queueMicrotask(ct);
693
- }, [ct, O]), n(() => {
694
- O && ct();
695
- }, [
696
- ct,
697
- O,
698
- Qe
699
- ]), n(() => {
700
- if (!O) return;
701
- let e = ce.current, t = Ie.current;
702
- if (!e || !t) return;
703
- let n = r(e).ResizeObserver;
704
- if (typeof n != "function") return;
705
- let i = new n(ct);
706
- return i.observe(e), i.observe(t), () => {
707
- i.disconnect();
708
- };
709
- }, [
710
- ce,
711
- ct,
712
- O
713
- ]);
714
- let lt = q ? "bottom" : "insetInlineStart", ut = q ? "left" : "top", dt;
715
- Me ? T === $ ? dt = 2 : st === $ && (dt = 1) : T === $ && (dt = 1);
716
- let ft;
717
- ft = !O && !Number.isFinite(Qe) ? _ : {
718
- position: "absolute",
719
- [lt]: O ? "var(--position)" : `${Qe}%`,
720
- [ut]: "50%",
721
- translate: `${(q || !Ne ? -1 : 1) * 50}% ${(q ? 1 : -1) * 50}%`,
722
- zIndex: dt,
723
- ...O && {
724
- "--position": `${$e ?? 0}%`,
725
- visibility: R && tt || $e === void 0 ? "hidden" : void 0
726
- }
727
- };
728
- let pt;
729
- q && (pt = Ne ? "vertical-rl" : "vertical-lr");
730
- let mt = typeof g == "function" ? g($) : d, ht = a({
731
- "aria-label": mt,
732
- "aria-labelledby": p ?? (mt == null ? he : void 0),
733
- "aria-describedby": u,
734
- "aria-orientation": I,
735
- "aria-valuenow": Ze,
736
- "aria-valuetext": typeof ee == "function" ? ee(fe(Ze, A, pe), Ze, $) : m ?? at(G, $, pe, A),
737
- disabled: K,
738
- form: F,
739
- id: Ke,
740
- max: j,
741
- min: M,
742
- name: we,
743
- onChange(e) {
744
- D(e.currentTarget.valueAsNumber, $, e);
745
- },
746
- onFocus(e) {
747
- let t = J.current;
748
- J.current = !1, z($), Re(!0), t && e.stopPropagation();
749
- },
750
- onBlur(e) {
751
- J.current ? e.stopPropagation() : (z(-1), !Ae.current.some((t) => te(t, e.relatedTarget)) && (Pe(!0), Re(!1), Fe === "onBlur" && E.commit(He(Ze, $, M, j, k, G))));
752
- },
753
- onKeyDown(e) {
754
- if (e.defaultPrevented || !it.has(e.key)) return;
755
- Se.has(e.key) && e.stopPropagation();
756
- let t = null, n = 0, r = e.shiftKey ? ge : ke, i = Ye(Ze, ke, M);
757
- switch (e.key) {
758
- case N:
759
- n = 1;
760
- break;
761
- case _e:
762
- n = Ne ? -1 : 1;
763
- break;
764
- case xe:
765
- n = -1;
766
- break;
767
- case be:
768
- n = Ne ? 1 : -1;
769
- break;
770
- case ye:
771
- r = ge, n = 1;
772
- break;
773
- case Ce:
774
- r = ge, n = -1;
775
- break;
776
- case "End":
777
- t = Me && Number.isFinite(G[$ + 1]) ? G[$ + 1] - ke * P : j;
778
- break;
779
- case ve: t = Me && Number.isFinite(G[$ - 1]) ? G[$ - 1] + ke * P : M;
780
- }
781
- if (n !== 0 && (t = ot(i, r, n, M, j)), t !== null) {
782
- let n = e.currentTarget;
783
- y(n) || (J.current = !0, n.blur(), n.focus({
784
- preventScroll: !0,
785
- focusVisible: !0
786
- })), D(t, $, e), e.preventDefault();
787
- }
788
- },
789
- step: ke,
790
- style: {
791
- ..._,
792
- width: "100%",
793
- height: "100%",
794
- writingMode: pt
795
- },
796
- tabIndex: ne,
797
- type: "range",
798
- value: Ze ?? ""
799
- }, (e) => E.getValidationProps(K, e), {
800
- onFocus: Ve,
801
- onBlur: Ue,
802
- onKeyDown: w
803
- }), gt = s(Le, E.inputRef, x);
804
- return f("div", e, {
805
- state: V,
806
- ref: [
807
- t,
808
- qe,
809
- Ie
810
- ],
811
- props: [{
812
- [nt]: $,
813
- children: /*#__PURE__*/ W(H.Fragment, { children: [
814
- o,
815
- /*#__PURE__*/ U("input", {
816
- ref: gt,
817
- ...ht,
818
- suppressHydrationWarning: !0
819
- }),
820
- O && Xe && R && (rt ||= /*#__PURE__*/ U(Be, { script: "" }))
821
- ] }),
822
- id: ae,
823
- onPointerDown(e) {
824
- if (K) return;
825
- Ee.current = $;
826
- let t = Je(e.currentTarget, q);
827
- Te.current = (q ? e.clientY : e.clientX) - t;
828
- },
829
- style: ft,
830
- suppressHydrationWarning: R || void 0
831
- }, ie],
832
- stateAttributesMapping: We
833
- });
834
- });
835
- process.env.NODE_ENV !== "production" && (st.displayName = "SliderThumb");
836
- function ct(e, t, n, r, i, a) {
837
- let o = {
838
- visibility: a || n && (r === void 0 || t && i === void 0) ? "hidden" : void 0,
839
- position: e ? "absolute" : "relative",
840
- [e ? "width" : "height"]: "inherit"
841
- }, s = `${r ?? 0}%`, c = `${(i ?? 0) - (r ?? 0)}%`;
842
- return n && (o["--start-position"] = s, s = "var(--start-position)", t && (o["--relative-size"] = c, c = "var(--relative-size)")), o[e ? "bottom" : "insetInlineStart"] = t ? s : 0, o[e ? "height" : "width"] = t ? c : s, o;
843
- }
844
- var lt = /*#__PURE__*/ H.forwardRef(function(e, t) {
845
- let { render: n, className: r, style: i, ...a } = e, { indicatorPosition: o, inset: s, max: c, min: l, orientation: u, renderBeforeHydration: d, state: p, values: m } = X(), h = ze(), g = ct(u === "vertical", m.length > 1, s, s ? o[0] : me(m[0], l, c), s ? o[1] : me(m[m.length - 1], l, c), s && d && h);
846
- return f("div", e, {
847
- state: p,
848
- ref: t,
849
- props: [{
850
- "data-base-ui-slider-indicator": d ? "" : void 0,
851
- style: g,
852
- suppressHydrationWarning: d || void 0
853
- }, a],
854
- stateAttributesMapping: We
855
- });
856
- });
857
- process.env.NODE_ENV !== "production" && (lt.displayName = "SliderIndicator");
858
- var ut = H.forwardRef(function({ className: e, defaultValue: t, value: n, min: r = 0, max: a = 100, thumbAriaLabels: o, ...s }, c) {
859
- let l = H.useMemo(() => Array.isArray(n) ? n : Array.isArray(t) ? t : [r], [
860
- n,
861
- t,
862
- r
863
- ]);
864
- return /* @__PURE__ */ U(Z, {
865
- ref: c,
866
- className: i("ck-slider", e),
867
- "data-slot": "slider",
868
- defaultValue: t,
869
- value: n,
870
- min: r,
871
- max: a,
872
- thumbAlignment: "edge",
873
- ...s,
874
- children: /* @__PURE__ */ W(et, {
875
- className: "ck-slider-control",
876
- children: [/* @__PURE__ */ U(tt, {
877
- "data-slot": "slider-track",
878
- className: "ck-slider-track",
879
- children: /* @__PURE__ */ U(lt, {
880
- "data-slot": "slider-range",
881
- className: "ck-slider-range"
882
- })
883
- }), Array.from({ length: l.length }, (e, t) => /* @__PURE__ */ U(st, {
884
- "data-slot": "slider-thumb",
885
- className: "ck-slider-thumb",
886
- "aria-label": o?.[t] ?? (l.length > 1 ? `Value ${t + 1} of ${l.length}` : "Value")
887
- }, t))]
888
- })
889
- });
890
- });
891
- ut.displayName = "Slider";
892
- var dt = [
893
- "pen",
894
- "line",
895
- "rect",
896
- "circle",
897
- "arrow"
898
- ];
899
- function ft(e) {
900
- return e != null && dt.includes(e);
901
- }
902
- var pt = [
903
- {
904
- value: "pen",
905
- label: "Pen",
906
- icon: K
907
- },
908
- {
909
- value: "line",
910
- label: "Line",
911
- icon: je
912
- },
913
- {
914
- value: "rect",
915
- label: "Rectangle",
916
- icon: Me
917
- },
918
- {
919
- value: "circle",
920
- label: "Circle",
921
- icon: G
922
- },
923
- {
924
- value: "arrow",
925
- label: "Arrow",
926
- icon: M
927
- }
928
- ], mt = H.memo(function({ tools: e, colors: t, drawing: n, onSave: r, saveDisabled: i, onCancel: a }) {
929
- let o = e ? pt.filter((t) => e.includes(t.value)) : pt;
930
- function s(e) {
931
- let t = e[0];
932
- ft(t) && n.setTool(t);
933
- }
934
- function c(e) {
935
- let t = e[0];
936
- t && n.setColor(t);
937
- }
938
- return /* @__PURE__ */ W("div", {
939
- className: "ck-annotation-toolbar",
940
- role: "toolbar",
941
- "aria-label": "Annotation tools",
942
- children: [
943
- /* @__PURE__ */ U(D, {
944
- value: [n.tool],
945
- onValueChange: s,
946
- size: "sm",
947
- spacing: 1,
948
- "aria-label": "Drawing tool",
949
- children: o.map(({ value: e, label: t, icon: n }) => /* @__PURE__ */ W(x, { children: [/* @__PURE__ */ U(b, {
950
- render: /* @__PURE__ */ U(O, {
951
- value: e,
952
- "aria-label": t
953
- }),
954
- children: /* @__PURE__ */ U(n, {
955
- size: 16,
956
- stroke: 2
957
- })
958
- }), /* @__PURE__ */ U(v, { children: t })] }, e))
959
- }),
960
- /* @__PURE__ */ U(S, {
961
- orientation: "vertical",
962
- className: "ck-annotation-separator"
963
- }),
964
- /* @__PURE__ */ U(D, {
965
- value: [n.color],
966
- onValueChange: c,
967
- size: "sm",
968
- spacing: 1,
969
- "aria-label": "Stroke color",
970
- children: t.map((e) => /* @__PURE__ */ W(x, { children: [/* @__PURE__ */ U(b, {
971
- render: /* @__PURE__ */ U(O, {
972
- value: e.value,
973
- "aria-label": e.label
974
- }),
975
- children: /* @__PURE__ */ U("span", {
976
- className: "ck-annotation-swatch",
977
- style: { "--ck-bg": e.value }
978
- })
979
- }), /* @__PURE__ */ U(v, { children: e.label })] }, e.value))
980
- }),
981
- /* @__PURE__ */ U(S, {
982
- orientation: "vertical",
983
- className: "ck-annotation-separator"
984
- }),
985
- /* @__PURE__ */ W("div", {
986
- className: "ck-annotation-stroke",
987
- children: [/* @__PURE__ */ U(ut, {
988
- className: "ck-annotation-slider",
989
- value: [n.strokeWidth],
990
- onValueChange: (e) => {
991
- let t = Array.isArray(e) ? e[0] : e;
992
- t != null && Number.isFinite(t) && n.setStrokeWidth(t);
993
- },
994
- min: 1,
995
- max: 12,
996
- step: 1,
997
- "aria-label": "Stroke width"
998
- }), /* @__PURE__ */ W("span", {
999
- className: "ck-annotation-stroke-label",
1000
- children: [n.strokeWidth, "px"]
1001
- })]
1002
- }),
1003
- /* @__PURE__ */ U(S, {
1004
- orientation: "vertical",
1005
- className: "ck-annotation-separator"
1006
- }),
1007
- /* @__PURE__ */ W(P, { children: [
1008
- /* @__PURE__ */ W(x, { children: [/* @__PURE__ */ U(b, {
1009
- render: /* @__PURE__ */ U(d, {
1010
- variant: "outline",
1011
- size: "icon-sm",
1012
- "aria-label": "Undo",
1013
- onClick: () => n.undo(),
1014
- disabled: !n.canUndo
1015
- }),
1016
- children: /* @__PURE__ */ U(ke, {
1017
- size: 16,
1018
- stroke: 2
1019
- })
1020
- }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ W("span", {
1021
- className: "ck-annotation-tooltip",
1022
- children: ["Undo ", /* @__PURE__ */ U(j, { children: "⌘Z" })]
1023
- }) })] }),
1024
- /* @__PURE__ */ W(x, { children: [/* @__PURE__ */ U(b, {
1025
- render: /* @__PURE__ */ U(d, {
1026
- variant: "outline",
1027
- size: "icon-sm",
1028
- "aria-label": "Redo",
1029
- onClick: () => n.redo(),
1030
- disabled: !n.canRedo
1031
- }),
1032
- children: /* @__PURE__ */ U(Ae, {
1033
- size: 16,
1034
- stroke: 2
1035
- })
1036
- }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ W("span", {
1037
- className: "ck-annotation-tooltip",
1038
- children: ["Redo ", /* @__PURE__ */ U(j, { children: "⌘⇧Z" })]
1039
- }) })] }),
1040
- /* @__PURE__ */ W(x, { children: [/* @__PURE__ */ U(b, {
1041
- render: /* @__PURE__ */ U(d, {
1042
- variant: "outline",
1043
- size: "icon-sm",
1044
- "aria-label": "Clear all",
1045
- onClick: () => n.clear(),
1046
- disabled: n.paths.length === 0
1047
- }),
1048
- children: /* @__PURE__ */ U(q, {
1049
- size: 16,
1050
- stroke: 2
1051
- })
1052
- }), /* @__PURE__ */ U(v, { children: "Clear all" })] })
1053
- ] }),
1054
- /* @__PURE__ */ U(S, {
1055
- orientation: "vertical",
1056
- className: "ck-annotation-separator"
1057
- }),
1058
- r ? /* @__PURE__ */ W(P, { children: [/* @__PURE__ */ W(x, { children: [/* @__PURE__ */ U(b, {
1059
- render: /* @__PURE__ */ U(d, {
1060
- variant: "outline",
1061
- size: "icon-sm",
1062
- "aria-label": "Cancel",
1063
- onClick: a
1064
- }),
1065
- children: /* @__PURE__ */ U(B, {
1066
- size: 16,
1067
- stroke: 2
1068
- })
1069
- }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ W("span", {
1070
- className: "ck-annotation-tooltip",
1071
- children: ["Cancel ", /* @__PURE__ */ U(j, { children: "Esc" })]
1072
- }) })] }), /* @__PURE__ */ W(x, { children: [/* @__PURE__ */ U(b, {
1073
- render: /* @__PURE__ */ U(d, {
1074
- size: "icon-sm",
1075
- "aria-label": "Save drawing",
1076
- "aria-disabled": i || void 0,
1077
- className: u(i && "ck-annotation-save--disabled"),
1078
- onClick: () => {
1079
- i || r();
1080
- }
1081
- }),
1082
- children: /* @__PURE__ */ U(pe, {
1083
- size: 16,
1084
- stroke: 2
1085
- })
1086
- }), /* @__PURE__ */ U(v, { children: i ? "Draw something first" : "Save drawing" })] })] }) : /* @__PURE__ */ W(x, { children: [/* @__PURE__ */ U(b, {
1087
- render: /* @__PURE__ */ U(d, {
1088
- variant: "outline",
1089
- size: "icon-sm",
1090
- "aria-label": "Cancel",
1091
- onClick: a
1092
- }),
1093
- children: /* @__PURE__ */ U(B, {
1094
- size: 16,
1095
- stroke: 2
1096
- })
1097
- }), /* @__PURE__ */ U(v, { children: /* @__PURE__ */ W("span", {
1098
- className: "ck-annotation-tooltip",
1099
- children: ["Cancel ", /* @__PURE__ */ U(j, { children: "Esc" })]
1100
- }) })] })
1101
- ]
1102
- });
1103
- });
1104
- export { J as n, mt as t };