@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
|
@@ -81,6 +81,9 @@ function n(t, n) {
|
|
|
81
81
|
toggleShortcutsOverlay: () => u((e) => e.toggleShortcutsOverlay()),
|
|
82
82
|
setPanelView: (e) => u((t) => t.setPanelView(e)),
|
|
83
83
|
loadMoreComments: () => c((e) => e.loadMoreComments()),
|
|
84
|
+
reloadComments: () => c((e) => e.reloadComments()),
|
|
85
|
+
setBranch: (e) => c((t) => t.setBranch(e)),
|
|
86
|
+
reloadProjectContext: () => c((e) => e.reloadProjectContext()),
|
|
84
87
|
getProjectMembers: () => l((e) => e.getProjectMembers(), []),
|
|
85
88
|
createComment: (e, t, n, r, i, a, o) => c((s) => s.createComment(e, t, n, r, i, a, o)),
|
|
86
89
|
updateComment: (e, t) => c((n) => n.updateComment(e, t)),
|
|
@@ -89,10 +92,10 @@ function n(t, n) {
|
|
|
89
92
|
unresolveComment: (e) => c((t) => t.unresolveComment(e)),
|
|
90
93
|
completeComment: (e) => c((t) => t.completeComment(e)),
|
|
91
94
|
selectComment: (e) => u((t) => t.selectComment(e)),
|
|
92
|
-
addReply: (e, t) => c((
|
|
93
|
-
updateReply: (e, t, n) => c((
|
|
95
|
+
addReply: (e, t, n) => c((r) => r.addReply(e, t, ...n ? [n] : [])),
|
|
96
|
+
updateReply: (e, t, n, r) => c((i) => i.updateReply(e, t, n, ...r ? [r] : [])),
|
|
94
97
|
deleteReply: (e, t) => c((n) => n.deleteReply(e, t)),
|
|
95
|
-
reactToComment: (e, t) => c((
|
|
98
|
+
reactToComment: (e, t, n) => c((r) => r.reactToComment(e, t, ...n ? [n] : [])),
|
|
96
99
|
updateCommentPosition: (e, t, n) => c((r) => r.updateCommentPosition(e, t, n)),
|
|
97
100
|
createHighlight: (e, t) => c((n) => n.createHighlight(e, t)),
|
|
98
101
|
createDrawing: (e, t, n) => c((r) => r.createDrawing(e, t, n)),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { O as e, c as t, d as n, s as r, u as i } from "./button-By0hGrJK.js";
|
|
2
|
-
import { t as a } from "./separator-
|
|
2
|
+
import { t as a } from "./separator-XDBsaWyw.js";
|
|
3
3
|
import * as o from "react";
|
|
4
4
|
import { jsx as s } from "react/jsx-runtime";
|
|
5
5
|
var c = "ArrowUp", l = "ArrowDown", u = "ArrowLeft", d = "ArrowRight", f = "Home", p = "PageUp", m = "PageDown", h = /* @__PURE__ */ new Set([
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { n as e, r as t, t as n } from "./annotation-toolbar-B9SxYqoF.js";
|
|
2
|
+
import { A as r, i, p as a, r as o } from "./comment-kit-ui-CzfdAZs2.js";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
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}";
|
|
6
|
+
function f(e) {
|
|
7
|
+
let t = e.currentTarget;
|
|
8
|
+
typeof t.hasPointerCapture == "function" && t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId);
|
|
9
|
+
}
|
|
10
|
+
var p = s.memo(function({ onSave: c, onCancel: d, remoteStrokes: p }) {
|
|
11
|
+
let m = t(), h = s.useRef(null), g = s.useRef(null), [_, v] = s.useState(!1), [y, b] = s.useState(null), x = s.useRef(!1), S = s.useCallback((e) => {
|
|
12
|
+
let t = h.current;
|
|
13
|
+
if (!t) return {
|
|
14
|
+
x: 0,
|
|
15
|
+
y: 0
|
|
16
|
+
};
|
|
17
|
+
let n = t.getBoundingClientRect();
|
|
18
|
+
if ("touches" in e && e.touches) {
|
|
19
|
+
let t = e.touches[0];
|
|
20
|
+
return t ? {
|
|
21
|
+
x: t.clientX - n.left,
|
|
22
|
+
y: t.clientY - n.top
|
|
23
|
+
} : {
|
|
24
|
+
x: 0,
|
|
25
|
+
y: 0
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
let r = e;
|
|
29
|
+
return {
|
|
30
|
+
x: r.clientX - n.left,
|
|
31
|
+
y: r.clientY - n.top
|
|
32
|
+
};
|
|
33
|
+
}, []), C = s.useCallback((e) => {
|
|
34
|
+
if (e.button !== 0 || g.current !== null || x.current) return;
|
|
35
|
+
g.current = e.pointerId;
|
|
36
|
+
try {
|
|
37
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
38
|
+
} catch {}
|
|
39
|
+
let t = S(e);
|
|
40
|
+
m.startPath(t.x, t.y);
|
|
41
|
+
}, [S, m]), w = s.useCallback((e) => {
|
|
42
|
+
if (!m.activePath || g.current !== e.pointerId) return;
|
|
43
|
+
let t = S(e);
|
|
44
|
+
m.addPoint(t.x, t.y);
|
|
45
|
+
}, [S, m]), T = s.useCallback((e) => {
|
|
46
|
+
g.current === e.pointerId && (g.current = null, f(e), m.endPath());
|
|
47
|
+
}, [m]), E = s.useCallback(() => {
|
|
48
|
+
if (m.paths.length === 0 || x.current) return;
|
|
49
|
+
let e = h.current, t = m.paths.flatMap((e) => {
|
|
50
|
+
let t = i(e);
|
|
51
|
+
return t ? [t] : [];
|
|
52
|
+
});
|
|
53
|
+
t.length !== 0 && (x.current = !0, v(!0), b(null), Promise.resolve().then(() => c({
|
|
54
|
+
type: "svg",
|
|
55
|
+
paths: t,
|
|
56
|
+
viewport: {
|
|
57
|
+
width: e?.clientWidth || window.innerWidth,
|
|
58
|
+
height: e?.clientHeight || window.innerHeight
|
|
59
|
+
}
|
|
60
|
+
})).catch(() => {
|
|
61
|
+
b("Could not save drawing. Your strokes are still here. Try again.");
|
|
62
|
+
}).finally(() => {
|
|
63
|
+
x.current = !1, v(!1);
|
|
64
|
+
}));
|
|
65
|
+
}, [m.paths, c]);
|
|
66
|
+
e(m.undo, m.redo, d);
|
|
67
|
+
let D = m.paths.flatMap((e) => {
|
|
68
|
+
let t = i(e);
|
|
69
|
+
return t ? [t] : [];
|
|
70
|
+
}), O = m.activePath ? i(m.activePath) : null, k = !!(p && p.length > 0);
|
|
71
|
+
return /* @__PURE__ */ u("div", {
|
|
72
|
+
"data-commentkit-ui": !0,
|
|
73
|
+
"data-slot": "comment-drawing-canvas",
|
|
74
|
+
className: "ck-drawing-canvas",
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ l("div", {
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
className: "ck-drawing-canvas-scrim"
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ u("div", {
|
|
81
|
+
className: "ck-drawing-canvas-toolbar",
|
|
82
|
+
children: [/* @__PURE__ */ l(n, {
|
|
83
|
+
colors: r,
|
|
84
|
+
drawing: m,
|
|
85
|
+
onSave: E,
|
|
86
|
+
saveDisabled: m.paths.length === 0 || _,
|
|
87
|
+
onCancel: d
|
|
88
|
+
}), y ? /* @__PURE__ */ l("p", {
|
|
89
|
+
role: "alert",
|
|
90
|
+
className: "ck-drawing-canvas-error",
|
|
91
|
+
children: y
|
|
92
|
+
}) : null]
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ u("svg", {
|
|
95
|
+
ref: h,
|
|
96
|
+
role: "application",
|
|
97
|
+
"aria-label": "Drawing canvas",
|
|
98
|
+
className: "ck-drawing-canvas-surface",
|
|
99
|
+
onPointerDown: C,
|
|
100
|
+
onPointerMove: w,
|
|
101
|
+
onPointerUp: T,
|
|
102
|
+
onPointerCancel: (e) => {
|
|
103
|
+
g.current === e.pointerId && (g.current = null, f(e), m.cancelPath());
|
|
104
|
+
},
|
|
105
|
+
children: [
|
|
106
|
+
k && p ? p.map((e, t) => /* @__PURE__ */ l("g", {
|
|
107
|
+
opacity: .5,
|
|
108
|
+
children: /* @__PURE__ */ l(o, { path: e })
|
|
109
|
+
}, `remote-${String(t)}`)) : null,
|
|
110
|
+
D.map((e, t) => /* @__PURE__ */ l(o, { path: e }, `local-${String(t)}`)),
|
|
111
|
+
O ? /* @__PURE__ */ l(o, { path: O }) : null
|
|
112
|
+
]
|
|
113
|
+
}),
|
|
114
|
+
/* @__PURE__ */ l(a, { mode: "draw" })
|
|
115
|
+
]
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
function m(e) {
|
|
119
|
+
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("style", {
|
|
120
|
+
"data-ck-tool-styles": "drawing",
|
|
121
|
+
children: d
|
|
122
|
+
}), /* @__PURE__ */ l(p, { ...e })] });
|
|
123
|
+
}
|
|
124
|
+
export { m as CommentDrawingCanvas };
|
package/dist/shared/{comment-image-lightbox-0VdAs2iT.js → comment-image-lightbox-BPYJT1sB.js}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { n as e } from "./dist-De294MVF.js";
|
|
2
|
+
import { s as t, t as n } from "./button-By0hGrJK.js";
|
|
3
|
+
import { i as r, o as i, r as a } from "./separator-XDBsaWyw.js";
|
|
4
|
+
import { r as o } from "./comment-utils-BycYTSxA.js";
|
|
5
|
+
import { t as s } from "./button-group-Cl9CrvvU.js";
|
|
6
|
+
import { d as c, f as l, u } from "./comment-kit-ui-CzfdAZs2.js";
|
|
5
7
|
import * as d from "react";
|
|
6
8
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
7
9
|
var h = ".ck-dialog-content.ck-image-lightbox{width:100vw;max-width:none;height:100dvh;max-height:none;box-shadow:none;background-color:#0000;border:0;border-radius:0;justify-content:center;align-items:center;gap:0;padding:0;display:flex;inset:0;translate:none}@media (width>=640px){.ck-dialog-content.ck-image-lightbox{max-width:none}}.ck-root[data-theme=dark] .ck-dialog-content.ck-image-lightbox{box-shadow:none}.ck-image-lightbox-prev,.ck-image-lightbox-next{position:absolute}.ck-image-lightbox-prev{inset-inline-start:1rem}.ck-image-lightbox-next{inset-inline-end:1rem}.ck-image-lightbox-photo{object-fit:contain;width:auto;max-width:90vw;height:auto;max-height:90vh}.ck-image-lightbox-meta{border-radius:var(--radius-xl);background-color:var(--muted);text-align:center;max-width:90vw;color:var(--muted-foreground);padding:.25rem .625rem;font-size:.75rem;line-height:1rem;position:absolute;bottom:3.5rem;left:50%;transform:translate(-50%)}.ck-image-lightbox-actions{top:1rem;position:absolute;inset-inline-end:1rem}.ck-image-lightbox-dots{gap:.5rem;display:flex;position:absolute;bottom:1.5rem}.ck-image-lightbox-dot{cursor:pointer;background-color:color-mix(in oklch, var(--foreground) 40%, transparent);border:0;border-radius:999px;width:.625rem;height:.625rem;padding:0;transition:background-color .15s cubic-bezier(.4,0,.2,1)}.ck-image-lightbox-dot:hover{background-color:color-mix(in oklch, var(--foreground) 60%, transparent)}.ck-image-lightbox-dot--active,.ck-image-lightbox-dot--active:hover{background-color:var(--foreground)}";
|
|
@@ -34,136 +36,139 @@ function b() {
|
|
|
34
36
|
function x() {
|
|
35
37
|
return /* @__PURE__ */ p(g, { children: /* @__PURE__ */ p("path", { d: "M18 6L6.00081 17.9992M17.9992 18L6 6.00085" }) });
|
|
36
38
|
}
|
|
37
|
-
var S = d.memo(function({ images: h, initialIndex: g, open: S, onClose: C }) {
|
|
38
|
-
let [
|
|
39
|
+
var S = d.memo(function({ images: h, initialIndex: g, open: S, onClose: C, returnFocusRef: w }) {
|
|
40
|
+
let [T, E] = d.useState(g);
|
|
39
41
|
d.useEffect(() => {
|
|
40
|
-
|
|
41
|
-
}, [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
let t = await fetch(e.href);
|
|
55
|
-
if (!t.ok) throw Error(`Failed to fetch image (${String(t.status)})`);
|
|
56
|
-
let n = await t.blob();
|
|
57
|
-
await navigator.clipboard.write([new ClipboardItem({ [n.type]: n })]), o.success("Image copied");
|
|
42
|
+
S && E(Math.max(0, Math.min(g, h.length - 1)));
|
|
43
|
+
}, [
|
|
44
|
+
g,
|
|
45
|
+
S,
|
|
46
|
+
h.length
|
|
47
|
+
]);
|
|
48
|
+
let D = h[T], O = !!(D && (D.type ?? D.filename ?? D.size != null)), k = async (t) => {
|
|
49
|
+
if (t.stopPropagation(), D) try {
|
|
50
|
+
let t = new URL(D.url, window.location.href);
|
|
51
|
+
if (t.protocol !== "http:" && t.protocol !== "https:" && t.protocol !== "data:" && t.protocol !== "blob:") throw Error("Invalid image URL protocol");
|
|
52
|
+
let n = await fetch(t.href);
|
|
53
|
+
if (!n.ok) throw Error(`Failed to fetch image (${String(n.status)})`);
|
|
54
|
+
let r = await n.blob();
|
|
55
|
+
await navigator.clipboard.write([new ClipboardItem({ [r.type]: r })]), e.success("Image copied");
|
|
58
56
|
} catch {
|
|
59
|
-
|
|
57
|
+
e.error("Failed to copy image");
|
|
60
58
|
}
|
|
61
59
|
};
|
|
62
|
-
return /* @__PURE__ */ p(
|
|
60
|
+
return /* @__PURE__ */ p(u, {
|
|
63
61
|
open: S && h.length > 0,
|
|
64
62
|
onOpenChange: (e) => {
|
|
65
63
|
e || C();
|
|
66
64
|
},
|
|
67
|
-
children: /* @__PURE__ */ m(
|
|
65
|
+
children: /* @__PURE__ */ m(c, {
|
|
68
66
|
showCloseButton: !1,
|
|
67
|
+
finalFocus: w,
|
|
69
68
|
"aria-describedby": void 0,
|
|
70
69
|
className: "ck-image-lightbox",
|
|
71
70
|
onClick: C,
|
|
72
|
-
|
|
71
|
+
onKeyDownCapture: (e) => {
|
|
72
|
+
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
73
|
+
e.preventDefault(), e.stopPropagation();
|
|
74
|
+
let t = e.key === "ArrowLeft" ? -1 : 1;
|
|
75
|
+
E((e) => Math.max(0, Math.min(h.length - 1, e + t)));
|
|
76
|
+
},
|
|
77
|
+
children: [/* @__PURE__ */ p(l, {
|
|
73
78
|
className: "ck-sr-only",
|
|
74
79
|
children: "Image lightbox"
|
|
75
|
-
}),
|
|
76
|
-
h.length > 1 &&
|
|
80
|
+
}), D ? /* @__PURE__ */ m(f, { children: [
|
|
81
|
+
h.length > 1 && T > 0 ? /* @__PURE__ */ p(n, {
|
|
77
82
|
variant: "outline",
|
|
78
83
|
size: "icon",
|
|
79
84
|
"aria-label": "Previous image",
|
|
80
85
|
className: "ck-image-lightbox-prev",
|
|
81
86
|
onClick: (e) => {
|
|
82
|
-
e.stopPropagation(),
|
|
87
|
+
e.stopPropagation(), E((e) => e - 1);
|
|
83
88
|
},
|
|
84
89
|
children: /* @__PURE__ */ p(_, {})
|
|
85
90
|
}) : null,
|
|
86
|
-
h.length > 1 &&
|
|
91
|
+
h.length > 1 && T < h.length - 1 ? /* @__PURE__ */ p(n, {
|
|
87
92
|
variant: "outline",
|
|
88
93
|
size: "icon",
|
|
89
94
|
"aria-label": "Next image",
|
|
90
95
|
className: "ck-image-lightbox-next",
|
|
91
96
|
onClick: (e) => {
|
|
92
|
-
e.stopPropagation(),
|
|
97
|
+
e.stopPropagation(), E((e) => e + 1);
|
|
93
98
|
},
|
|
94
99
|
children: /* @__PURE__ */ p(v, {})
|
|
95
100
|
}) : null,
|
|
96
101
|
/* @__PURE__ */ p("img", {
|
|
97
|
-
src:
|
|
98
|
-
alt:
|
|
102
|
+
src: D.url,
|
|
103
|
+
alt: D.alt ?? D.filename ?? `Image ${String(T + 1)}`,
|
|
99
104
|
className: "ck-image-lightbox-photo",
|
|
100
105
|
onClick: (e) => {
|
|
101
106
|
e.stopPropagation();
|
|
102
107
|
}
|
|
103
108
|
}),
|
|
104
|
-
|
|
109
|
+
O ? /* @__PURE__ */ p("div", {
|
|
105
110
|
className: "ck-image-lightbox-meta",
|
|
106
111
|
onClick: (e) => {
|
|
107
112
|
e.stopPropagation();
|
|
108
113
|
},
|
|
109
114
|
children: [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
D.type,
|
|
116
|
+
D.filename,
|
|
117
|
+
o(D.size)
|
|
113
118
|
].filter(Boolean).join(" • ")
|
|
114
119
|
}) : null,
|
|
115
|
-
/* @__PURE__ */ m(
|
|
120
|
+
/* @__PURE__ */ m(s, {
|
|
116
121
|
className: "ck-image-lightbox-actions",
|
|
117
122
|
onClick: (e) => {
|
|
118
123
|
e.stopPropagation();
|
|
119
124
|
},
|
|
120
125
|
children: [
|
|
121
|
-
/* @__PURE__ */ m(
|
|
122
|
-
render: /* @__PURE__ */ p(
|
|
126
|
+
/* @__PURE__ */ m(a, { children: [/* @__PURE__ */ p(i, {
|
|
127
|
+
render: /* @__PURE__ */ p(n, {
|
|
123
128
|
variant: "outline",
|
|
124
129
|
size: "icon",
|
|
125
130
|
"aria-label": "Copy image",
|
|
126
131
|
onClick: (e) => {
|
|
127
|
-
|
|
132
|
+
k(e);
|
|
128
133
|
}
|
|
129
134
|
}),
|
|
130
135
|
children: /* @__PURE__ */ p(y, {})
|
|
131
|
-
}), /* @__PURE__ */ p(
|
|
132
|
-
/* @__PURE__ */ m(
|
|
133
|
-
render: /* @__PURE__ */ p(
|
|
136
|
+
}), /* @__PURE__ */ p(r, { children: "Copy image" })] }),
|
|
137
|
+
/* @__PURE__ */ m(a, { children: [/* @__PURE__ */ p(i, {
|
|
138
|
+
render: /* @__PURE__ */ p(n, {
|
|
134
139
|
variant: "outline",
|
|
135
140
|
size: "icon",
|
|
136
141
|
"aria-label": "Download",
|
|
137
142
|
onClick: (e) => {
|
|
138
|
-
if (e.stopPropagation(), !
|
|
143
|
+
if (e.stopPropagation(), !D) return;
|
|
139
144
|
let t = document.createElement("a");
|
|
140
|
-
t.href =
|
|
145
|
+
t.href = D.url, t.download = D.alt ?? `image-${String(T + 1)}`, t.target = "_blank", t.click();
|
|
141
146
|
}
|
|
142
147
|
}),
|
|
143
148
|
children: /* @__PURE__ */ p(b, {})
|
|
144
|
-
}), /* @__PURE__ */ p(
|
|
145
|
-
/* @__PURE__ */ m(
|
|
146
|
-
render: /* @__PURE__ */ p(
|
|
149
|
+
}), /* @__PURE__ */ p(r, { children: "Download" })] }),
|
|
150
|
+
/* @__PURE__ */ m(a, { children: [/* @__PURE__ */ p(i, {
|
|
151
|
+
render: /* @__PURE__ */ p(n, {
|
|
147
152
|
variant: "outline",
|
|
148
153
|
size: "icon",
|
|
149
154
|
"aria-label": "Close",
|
|
150
155
|
onClick: C
|
|
151
156
|
}),
|
|
152
157
|
children: /* @__PURE__ */ p(x, {})
|
|
153
|
-
}), /* @__PURE__ */ p(
|
|
158
|
+
}), /* @__PURE__ */ p(r, { children: "Close" })] })
|
|
154
159
|
]
|
|
155
160
|
}),
|
|
156
161
|
h.length > 1 ? /* @__PURE__ */ p("div", {
|
|
157
162
|
className: "ck-image-lightbox-dots",
|
|
158
|
-
children: h.map((
|
|
163
|
+
children: h.map((e, n) => /* @__PURE__ */ p("button", {
|
|
159
164
|
type: "button",
|
|
160
165
|
"aria-label": `Go to image ${String(n + 1)}`,
|
|
161
|
-
"aria-current": n ===
|
|
162
|
-
className:
|
|
166
|
+
"aria-current": n === T ? "true" : void 0,
|
|
167
|
+
className: t("ck-image-lightbox-dot", n === T && "ck-image-lightbox-dot--active"),
|
|
163
168
|
onClick: (e) => {
|
|
164
|
-
e.stopPropagation(),
|
|
169
|
+
e.stopPropagation(), E(n);
|
|
165
170
|
}
|
|
166
|
-
},
|
|
171
|
+
}, e.id))
|
|
167
172
|
}) : null
|
|
168
173
|
] }) : null]
|
|
169
174
|
})
|