@commentkit/comment-kit 2.0.0 → 2.0.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.
- package/CHANGELOG.md +24 -0
- package/README.md +109 -13
- package/SECURITY.md +2 -2
- package/dist/node/cli/doctor.js +84 -20
- package/dist/node/cli/init.js +349 -35
- package/dist/node/cli/main.js +35 -17
- package/dist/node/cli/mcp.js +187 -6
- package/dist/node/shared/dashboard-places.js +33 -0
- package/dist/npm/chunks/{AgentSend-DxRJIYiz.js → AgentSend-DOy3jhyF.js} +16 -16
- package/dist/npm/chunks/{Checklist-CnlfeSbc.js → Checklist-CW_SwMpS.js} +70 -70
- package/dist/npm/chunks/{Composer-B1bBVszY.js → Composer-Bveq5QrK.js} +276 -274
- package/dist/npm/chunks/{Guest-vvNPz8h-.js → Guest-7hcN765o.js} +58 -55
- package/dist/npm/chunks/{MarkupEditor-VCOXh9d2.js → MarkupEditor-6bJGpWGO.js} +46 -39
- package/dist/npm/chunks/Panel-ChPUB68C.js +1211 -0
- package/dist/npm/chunks/{Settings-BGoZS2iV.js → Settings-CB5eEKnf.js} +77 -77
- package/dist/npm/chunks/{Shortcuts-B2OMvczr.js → Shortcuts-eAyjJ89P.js} +4 -4
- package/dist/npm/chunks/{StyleEditor-CJ_d8Huf.js → StyleEditor-CZTdAA5c.js} +10 -10
- package/dist/npm/chunks/{StylePanel-yQzHHlY7.js → StylePanel-B4pHQUL9.js} +61 -61
- package/dist/npm/chunks/{TaskFields-fmy6_HtK.js → TaskFields-C8BX0Sgg.js} +55 -55
- package/dist/npm/chunks/ThreadCard-B1EsX3PR.js +1160 -0
- package/dist/npm/chunks/Viewer-DY6zb90M.js +114 -0
- package/dist/npm/chunks/{agent-C1OQzBAm.js → agent-MTQHr9ei.js} +1 -1
- package/dist/npm/chunks/{ar-CAJ3XT8e.js → ar-L5cQ-NPe.js} +2 -0
- package/dist/npm/chunks/{card-bits-CAnzrqx3.js → card-bits-CTdrkYn8.js} +16 -16
- package/dist/npm/chunks/{client-kNAo2TTG.js → client-7eVxvg5j.js} +7 -7
- package/dist/npm/chunks/{confetti-CkBdSu19.js → confetti-BIs5s14P.js} +1 -1
- package/dist/npm/chunks/{context-B8UAzve0.js → context-Cf6khm7A.js} +1 -1
- package/dist/npm/chunks/{de-Dl18G48t.js → de-D0C-v6tP.js} +2 -0
- package/dist/npm/chunks/{dialog-GO04oC3D.js → dialog-DvdIkCW0.js} +1 -1
- package/dist/npm/chunks/{dpop-U48QIQd7.js → dpop-0A76OPa9.js} +1 -1
- package/dist/npm/chunks/{es-Dxk79lS9.js → es-Bw4Dj9tN.js} +2 -0
- package/dist/npm/chunks/{extension-CKFpPWmi.js → extension-DFVOvciD.js} +1 -1
- package/dist/npm/chunks/{extension-E81hWyiT.js → extension-SmoH5AA4.js} +2 -2
- package/dist/npm/chunks/{files-DyD5BZgp.js → files-4lV9YQIX.js} +2 -2
- package/dist/npm/chunks/{fr-8BebGKYD.js → fr-TkuQaIAa.js} +2 -0
- package/dist/npm/chunks/{hi-BIN6Yy_p.js → hi-DXSH2U8d.js} +2 -0
- package/dist/npm/chunks/{i18n-DOBt8e9U.js → i18n-aVSu9TcJ.js} +56 -47
- package/dist/npm/chunks/{identify-CN-3xzqL.js → identify-BGYh2dVo.js} +4 -4
- package/dist/npm/chunks/{it-Cr6EwpPQ.js → it-CiWA_bch.js} +2 -0
- package/dist/npm/chunks/{ja-Iy3s5aur.js → ja-C-QmR3yz.js} +2 -0
- package/dist/npm/chunks/{late-words-B2bmZceJ.js → late-words-80_VWt8S.js} +3 -1
- package/dist/npm/chunks/{live-CelVeZfP.js → live-BExWHzQ7.js} +1 -1
- package/dist/npm/chunks/{nl-B84WHqqe.js → nl-CEmZRqjX.js} +2 -0
- package/dist/npm/chunks/{page-key-DepmJzC1.js → page-key-HSY3Lze5.js} +1 -1
- package/dist/npm/chunks/{pick-yTyqtxN0.js → pick-B3sR7jtS.js} +1 -1
- package/dist/npm/chunks/{pkce-ChKGSW_4.js → pkce-CfZhiNBi.js} +1 -1
- package/dist/npm/chunks/{pt-BR-DOkdlfoe.js → pt-BR-b-a8sxO8.js} +2 -0
- package/dist/npm/chunks/{report-CrIqQZDI.js → report-DaVuoRYS.js} +1 -1
- package/dist/npm/chunks/show-BoN8AC-F.js +97 -0
- package/dist/npm/chunks/{signin-Dd1rb2BP.js → signin-BOWr_WCo.js} +3 -3
- package/dist/npm/chunks/{source-pXVve2Cx.js → source-mk3rGBBQ.js} +1 -1
- package/dist/npm/chunks/{src-BTMy4Gyc.js → src-C8rZFyL_.js} +77 -70
- package/dist/npm/chunks/start-CV4j78_q.js +1894 -0
- package/dist/npm/chunks/{states-sfTbjZz8.js → states-b9Bv3Ci7.js} +1 -1
- package/dist/npm/chunks/{upload-MgPYqPyE.js → upload-B2mkgMeJ.js} +1 -1
- package/dist/npm/chunks/uploads-8AxyRq7g.js +1147 -0
- package/dist/npm/chunks/{wrap-Bl0gbnFa.js → wrap-DW6EFbVQ.js} +1 -1
- package/dist/npm/chunks/{zh-CN-Z5fQCb7G.js → zh-CN-JTscW8u8.js} +2 -0
- package/dist/npm/element.js +1 -1
- package/dist/npm/headless.js +2 -2
- package/dist/npm/index.js +2 -2
- package/dist/npm/react.js +1 -1
- package/dist/npm/svelte.js +1 -1
- package/dist/npm/types/core/types.d.ts +2 -2
- package/dist/npm/vue.js +1 -1
- package/package.json +3 -1
- package/dist/npm/chunks/Panel-F37vIL1K.js +0 -1206
- package/dist/npm/chunks/ThreadCard-D51slKST.js +0 -1113
- package/dist/npm/chunks/Viewer-BOBadqmC.js +0 -111
- package/dist/npm/chunks/show-BgVC8gWY.js +0 -97
- package/dist/npm/chunks/start-DtVlpt7p.js +0 -1878
- package/dist/npm/chunks/uploads-D49mywwz.js +0 -1146
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { b as e, o as t, v as n } from "./client-
|
|
2
|
-
import {
|
|
3
|
-
import { r as u } from "./card-bits-
|
|
4
|
-
import { C as d, f, s as p } from "./start-
|
|
1
|
+
import { b as e, o as t, v as n } from "./client-7eVxvg5j.js";
|
|
2
|
+
import { _ as r, c as i, d as a, f as o, m as s, n as c, u as l } from "./i18n-aVSu9TcJ.js";
|
|
3
|
+
import { r as u } from "./card-bits-CTdrkYn8.js";
|
|
4
|
+
import { C as d, f, s as p } from "./start-CV4j78_q.js";
|
|
5
5
|
// src/ui/Guest.tsx
|
|
6
6
|
p(".ck-verify-text{text-wrap:pretty;overflow-wrap:anywhere;margin:0 0 12px;line-height:1.5}.ck-verify .ck-code{height:48px;font-family:var(--ck-mono);font-size:var(--ck-fs-xl);letter-spacing:.32em;text-align:center;font-variant-numeric:tabular-nums;padding-inline-start:calc(12px + .32em);padding-inline-end:12px}.ck-verify .ck-actions .ck-chip{font-variant-numeric:tabular-nums}.ck-verify .ck-chip:disabled{opacity:.5;cursor:default}.ck-verify .ck-note{margin:12px 0 0}@media (hover:hover){.ck-verify .ck-chip:disabled:hover{background:var(--ck-bg);color:var(--ck-text-muted)}}@media (pointer:coarse){.ck-verify .ck-chip{min-height:44px}}");
|
|
7
|
-
async function m(e,
|
|
7
|
+
async function m(e, r) {
|
|
8
8
|
try {
|
|
9
9
|
let n = await e.api.request("/guest/start", {
|
|
10
10
|
method: "POST",
|
|
@@ -12,21 +12,21 @@ async function m(e, i) {
|
|
|
12
12
|
proof: !0,
|
|
13
13
|
body: {
|
|
14
14
|
client_id: e.options.project,
|
|
15
|
-
share:
|
|
16
|
-
name:
|
|
17
|
-
email:
|
|
18
|
-
locale:
|
|
15
|
+
share: r.share,
|
|
16
|
+
name: r.name.trim(),
|
|
17
|
+
email: r.email.trim(),
|
|
18
|
+
locale: c(),
|
|
19
19
|
page_url: t()
|
|
20
20
|
}
|
|
21
|
-
}),
|
|
21
|
+
}), i = Date.parse(n.pending_session.expires_at);
|
|
22
22
|
return e.auth.setPending({
|
|
23
23
|
token: n.access_token,
|
|
24
24
|
email: n.pending_session.email,
|
|
25
|
-
expiresAt: Number.isFinite(
|
|
25
|
+
expiresAt: Number.isFinite(i) ? i : Date.now() + n.expires_in * 1e3
|
|
26
26
|
}), "started";
|
|
27
27
|
} catch (e) {
|
|
28
28
|
if (e instanceof n && e.code === "origin_not_allowed") return "popup";
|
|
29
|
-
throw e instanceof n && (e.code === "share_expired" || e.status === 410 || e.errors?.share) ? new n(410, "share_expired",
|
|
29
|
+
throw e instanceof n && (e.code === "share_expired" || e.status === 410 || e.errors?.share) ? new n(410, "share_expired", i("shareExpired")) : e;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
function h() {
|
|
@@ -38,40 +38,40 @@ function h() {
|
|
|
38
38
|
}
|
|
39
39
|
return {
|
|
40
40
|
...e && e.length <= 64 ? { timezone: e } : {},
|
|
41
|
-
locale:
|
|
41
|
+
locale: c()
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function g({ client: t, email:
|
|
45
|
-
let [y, b] =
|
|
46
|
-
|
|
47
|
-
let O =
|
|
48
|
-
|
|
44
|
+
function g({ client: t, email: c, onDone: p, onDifferentEmail: m, onClose: g }) {
|
|
45
|
+
let [y, b] = r(""), [x, S] = r(!1), [C, w] = r(null), [T, E] = r(null), D = s(null);
|
|
46
|
+
o(() => D.current?.focus({ preventScroll: !0 }), []);
|
|
47
|
+
let O = s({}), [k, A] = r(_);
|
|
48
|
+
a(() => {
|
|
49
49
|
if (k <= 0) return;
|
|
50
50
|
let e = setTimeout(() => A((e) => e - 1), 1e3);
|
|
51
51
|
return () => clearTimeout(e);
|
|
52
52
|
}, [k]);
|
|
53
|
-
let j = async (
|
|
54
|
-
if (/^\d{6}$/.test(
|
|
53
|
+
let j = async (r = y) => {
|
|
54
|
+
if (/^\d{6}$/.test(r) && !x) {
|
|
55
55
|
S(!0), w(null);
|
|
56
56
|
try {
|
|
57
57
|
var a;
|
|
58
58
|
let n = {
|
|
59
|
-
code:
|
|
59
|
+
code: r,
|
|
60
60
|
...h()
|
|
61
|
-
},
|
|
61
|
+
}, i = await t.api.request("/guest/verify", {
|
|
62
62
|
method: "POST",
|
|
63
63
|
body: n,
|
|
64
|
-
idempotencyKey: (a = O.current)[
|
|
64
|
+
idempotencyKey: (a = O.current)[r] ?? (a[r] = e(16))
|
|
65
65
|
});
|
|
66
|
-
t.auth.adopt(
|
|
66
|
+
t.auth.adopt(i), await t.loadSession().catch(() => null), p(i.published_thread_ids ?? []);
|
|
67
67
|
} catch (e) {
|
|
68
68
|
if ((e instanceof n ? e.status : 0) === 422) return b(""), D.current?.focus({ preventScroll: !0 }), w({
|
|
69
|
-
text:
|
|
69
|
+
text: i("verifyWrong"),
|
|
70
70
|
tone: "warning"
|
|
71
71
|
});
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
text:
|
|
72
|
+
let r = v(e);
|
|
73
|
+
r && (t.auth.setPending(null), E(r === "expired" ? "again" : "stop")), w({
|
|
74
|
+
text: r ? i(r === "link" ? "verifyLinkExpired" : r === "removed" ? "verifyRemoved" : "verifyExpired") : f(e),
|
|
75
75
|
tone: "warning"
|
|
76
76
|
});
|
|
77
77
|
} finally {
|
|
@@ -79,19 +79,19 @@ function g({ client: t, email: s, onDone: p, onDifferentEmail: m, onClose: g })
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}, M = async () => {
|
|
82
|
-
let
|
|
82
|
+
let r = { "Idempotency-Key": e(16) }, a = () => t.api.request("/guest/resend", {
|
|
83
83
|
method: "POST",
|
|
84
|
-
headers:
|
|
84
|
+
headers: r
|
|
85
85
|
});
|
|
86
86
|
try {
|
|
87
87
|
await a().catch((e) => {
|
|
88
88
|
if (e instanceof n && e.status === 0) return a();
|
|
89
89
|
throw e;
|
|
90
|
-
}), w({ text:
|
|
90
|
+
}), w({ text: i("verifyResent") }), A(_);
|
|
91
91
|
} catch (e) {
|
|
92
92
|
let t = e instanceof n && e.code === "guest_codes_paused";
|
|
93
93
|
w({
|
|
94
|
-
text: t ?
|
|
94
|
+
text: t ? i("guestCodesPaused") : e instanceof n && e.status === 429 ? i("verifyWait") : i("errorGeneric"),
|
|
95
95
|
tone: "warning"
|
|
96
96
|
});
|
|
97
97
|
}
|
|
@@ -112,11 +112,11 @@ function g({ client: t, email: s, onDone: p, onDifferentEmail: m, onClose: g })
|
|
|
112
112
|
children: [/* @__PURE__ */ l("h2", {
|
|
113
113
|
class: "ck-card-title",
|
|
114
114
|
id: "ck-verify-title",
|
|
115
|
-
children:
|
|
115
|
+
children: i("verifyTitle")
|
|
116
116
|
}), /* @__PURE__ */ l("button", {
|
|
117
117
|
class: "ck-ghost",
|
|
118
|
-
"aria-label":
|
|
119
|
-
title:
|
|
118
|
+
"aria-label": i("close"),
|
|
119
|
+
title: i("close"),
|
|
120
120
|
onClick: () => g(),
|
|
121
121
|
children: /* @__PURE__ */ l(d, { name: "close" })
|
|
122
122
|
})]
|
|
@@ -126,15 +126,15 @@ function g({ client: t, email: s, onDone: p, onDifferentEmail: m, onClose: g })
|
|
|
126
126
|
children: [
|
|
127
127
|
/* @__PURE__ */ l("p", {
|
|
128
128
|
class: "ck-verify-text",
|
|
129
|
-
children:
|
|
129
|
+
children: i("verifyBody", { email: c })
|
|
130
130
|
}),
|
|
131
131
|
/* @__PURE__ */ l("p", {
|
|
132
132
|
class: "ck-verify-text",
|
|
133
|
-
children:
|
|
133
|
+
children: i("verifyLookFor", { website: t.state.get().config?.project?.name ?? "" })
|
|
134
134
|
}),
|
|
135
135
|
/* @__PURE__ */ l("label", {
|
|
136
136
|
class: "ck-field",
|
|
137
|
-
children: [/* @__PURE__ */ l("span", { children:
|
|
137
|
+
children: [/* @__PURE__ */ l("span", { children: i("verifyCode") }), /* @__PURE__ */ l("input", {
|
|
138
138
|
ref: D,
|
|
139
139
|
class: "ck-input ck-code",
|
|
140
140
|
"aria-invalid": C?.tone === "warning" || void 0,
|
|
@@ -166,13 +166,13 @@ function g({ client: t, email: s, onDone: p, onDifferentEmail: m, onClose: g })
|
|
|
166
166
|
class: "ck-chip",
|
|
167
167
|
"aria-disabled": k > 0 || void 0,
|
|
168
168
|
onClick: () => k > 0 || void M(),
|
|
169
|
-
children: k > 0 ?
|
|
169
|
+
children: k > 0 ? i("verifyResendIn", { n: k }) : i("verifyResend")
|
|
170
170
|
}), /* @__PURE__ */ l("button", {
|
|
171
171
|
class: "ck-chip",
|
|
172
172
|
onClick: () => {
|
|
173
173
|
t.auth.setPending(null), m();
|
|
174
174
|
},
|
|
175
|
-
children:
|
|
175
|
+
children: i("verifyDifferent")
|
|
176
176
|
})]
|
|
177
177
|
})
|
|
178
178
|
]
|
|
@@ -182,17 +182,17 @@ function g({ client: t, email: s, onDone: p, onDifferentEmail: m, onClose: g })
|
|
|
182
182
|
children: [/* @__PURE__ */ l("span", { class: "ck-spacer" }), T === "again" ? /* @__PURE__ */ l("button", {
|
|
183
183
|
class: "ck-btn ck-primary",
|
|
184
184
|
onClick: m,
|
|
185
|
-
children:
|
|
185
|
+
children: i("writeAgain")
|
|
186
186
|
}) : T === "stop" ? /* @__PURE__ */ l("button", {
|
|
187
187
|
class: "ck-btn",
|
|
188
188
|
onClick: () => g(),
|
|
189
|
-
children:
|
|
189
|
+
children: i("close")
|
|
190
190
|
}) : /* @__PURE__ */ l("button", {
|
|
191
191
|
class: "ck-btn ck-primary",
|
|
192
192
|
"aria-disabled": x || y.length !== 6 || void 0,
|
|
193
193
|
"aria-busy": x || void 0,
|
|
194
194
|
onClick: () => void j(),
|
|
195
|
-
children:
|
|
195
|
+
children: i(x ? "sending" : "verifyPublish")
|
|
196
196
|
})]
|
|
197
197
|
})
|
|
198
198
|
]
|
|
@@ -202,8 +202,8 @@ var _ = 60;
|
|
|
202
202
|
function v(e) {
|
|
203
203
|
return e instanceof n ? e.code === "share_expired" || e.status === 410 ? "link" : e.code === "guest_removed" ? "removed" : e.status === 403 ? /\blink\b/i.test(e.message) ? "link" : "removed" : e.status === 409 || e.status === 401 ? "expired" : null : null;
|
|
204
204
|
}
|
|
205
|
-
function y({ client: e, position: t, notify:
|
|
206
|
-
let [s, c] =
|
|
205
|
+
function y({ client: e, position: t, notify: a, onOpen: o }) {
|
|
206
|
+
let [s, c] = r(e.auth.finishLink), [u, d] = r(!1), [p, m] = r(null);
|
|
207
207
|
if (!s) return null;
|
|
208
208
|
let g = () => {
|
|
209
209
|
e.auth.finishLink = null, c(null);
|
|
@@ -221,18 +221,18 @@ function y({ client: e, position: t, notify: i, onOpen: a }) {
|
|
|
221
221
|
...h()
|
|
222
222
|
}
|
|
223
223
|
});
|
|
224
|
-
g(), e.auth.adopt(t), await e.loadSession().catch(() => null),
|
|
225
|
-
text:
|
|
224
|
+
g(), e.auth.adopt(t), await e.loadSession().catch(() => null), a({
|
|
225
|
+
text: i("sentGuest"),
|
|
226
226
|
tone: "success"
|
|
227
|
-
}), t.published_thread_ids?.[0] &&
|
|
227
|
+
}), t.published_thread_ids?.[0] && o(t.published_thread_ids[0]);
|
|
228
228
|
} catch (t) {
|
|
229
|
-
let
|
|
229
|
+
let r = t instanceof n ? t.code : "";
|
|
230
230
|
[
|
|
231
231
|
402,
|
|
232
232
|
403,
|
|
233
233
|
410,
|
|
234
234
|
422
|
|
235
|
-
].includes(t instanceof n ? t.status : 0) && (e.auth.finishLink = null), m(
|
|
235
|
+
].includes(t instanceof n ? t.status : 0) && (e.auth.finishLink = null), m(r === "finish_link_expired" ? i("finishExpired") : f(t)), d(!1);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
};
|
|
@@ -245,23 +245,26 @@ function y({ client: e, position: t, notify: i, onOpen: a }) {
|
|
|
245
245
|
children: [
|
|
246
246
|
/* @__PURE__ */ l("h2", {
|
|
247
247
|
id: "ck-finish-title",
|
|
248
|
-
children:
|
|
248
|
+
children: i("finishTitle")
|
|
249
|
+
}),
|
|
250
|
+
/* @__PURE__ */ l("p", {
|
|
251
|
+
role: p ? "alert" : void 0,
|
|
252
|
+
children: p ?? i("finishBody")
|
|
249
253
|
}),
|
|
250
|
-
/* @__PURE__ */ l("p", { children: p ?? r("finishBody") }),
|
|
251
254
|
/* @__PURE__ */ l("div", {
|
|
252
255
|
class: "ck-actions",
|
|
253
256
|
children: p && !e.auth.finishLink ? /* @__PURE__ */ l("button", {
|
|
254
257
|
class: "ck-btn",
|
|
255
258
|
onClick: g,
|
|
256
|
-
children:
|
|
259
|
+
children: i("close")
|
|
257
260
|
}) : /* @__PURE__ */ l("button", {
|
|
258
261
|
class: "ck-btn ck-primary",
|
|
259
262
|
"aria-busy": u || void 0,
|
|
260
263
|
onClick: () => void _(),
|
|
261
|
-
children:
|
|
264
|
+
children: i(u ? "sending" : "finishSend")
|
|
262
265
|
})
|
|
263
266
|
})
|
|
264
267
|
]
|
|
265
268
|
});
|
|
266
269
|
}
|
|
267
|
-
export { y as GuestFinish, g as GuestVerify, m as startGuest };
|
|
270
|
+
export { y as GuestFinish, g as GuestVerify, h as readerSettings, m as startGuest, v as verifyOutcome };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { O as o, m as s, s as c } from "./start-
|
|
1
|
+
import { _ as e, c as t, d as n, f as r, m as i, u as a } from "./i18n-aVSu9TcJ.js";
|
|
2
|
+
import { O as o, m as s, s as c } from "./start-CV4j78_q.js";
|
|
3
3
|
// src/ui/MarkupEditor.tsx
|
|
4
|
-
c(".ck-markup{z-index:calc(var(--ck-z) + 2);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#0a0a0c4d;flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:16px;display:flex;position:fixed;top:0;bottom:0;left:0;right:0}.ck-markup canvas{border-radius:var(--ck-radius-md);cursor:crosshair;touch-action:none;background:#fff;max-width:min(100%,1100px);max-height:calc(100dvh - 110px);box-shadow:0 0 0 1px #0000000d,0 20px 50px #00000040}.ck-label-box .ck-input{width:200px;font-weight:600}.ck-markup .ck-markup-tools{background:var(--ck-bg);border-radius:var(--ck-radius-pill);max-width:100%;box-shadow:var(--ck-shadow);border:1px solid #0000;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px;padding:4px;display:flex}.ck-markup .ck-markup-group{align-items:center;gap:4px;padding:0 4px;display:flex}.ck-markup .ck-markup-group+.ck-markup-group{border-inline-start:1px solid var(--ck-hairline);margin-inline-start:4px;padding-inline-start:8px}.ck-markup .ck-tool{border-radius:var(--ck-radius-pill);width:32px;height:32px;color:var(--ck-text-muted);transition:background-color var(--ck-fast), color var(--ck-fast), scale var(--ck-fast) ease-out;background:0 0;border:0;place-items:center;padding:0;display:grid}.ck-markup .ck-tool[aria-pressed=true]{background:var(--ck-accent-soft);color:var(--ck-accent-text)}.ck-markup .ck-tool:active,.ck-markup .ck-icon-btn:active:not([aria-disabled=true]){scale:.96}.ck-markup .ck-dot{width:16px;height:16px;box-shadow:inset 0 0 0 1px var(--ck-hairline);border-radius:50%;display:block}.ck-markup .ck-tool[aria-pressed=true] .ck-dot{box-shadow:0 0 0 2px var(--ck-bg), 0 0 0 4px currentColor}.ck-markup .ck-width{gap:8px;width:152px}.ck-markup .ck-width input{min-width:0;accent-color:var(--ck-accent
|
|
4
|
+
c(".ck-markup{z-index:calc(var(--ck-z) + 2);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#0a0a0c4d;flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:16px;display:flex;position:fixed;top:0;bottom:0;left:0;right:0}.ck-markup canvas{border-radius:var(--ck-radius-md);cursor:crosshair;touch-action:none;background:#fff;max-width:min(100%,1100px);max-height:calc(100dvh - 110px);box-shadow:0 0 0 1px #0000000d,0 20px 50px #00000040}.ck-label-box .ck-input{width:200px;font-weight:600}.ck-markup .ck-markup-tools{background:var(--ck-bg);border-radius:var(--ck-radius-pill);max-width:100%;box-shadow:var(--ck-shadow);border:1px solid #0000;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px;padding:4px;display:flex}.ck-markup .ck-markup-group{align-items:center;gap:4px;padding:0 4px;display:flex}.ck-markup .ck-markup-group+.ck-markup-group{border-inline-start:1px solid var(--ck-hairline);margin-inline-start:4px;padding-inline-start:8px}.ck-markup .ck-tool{border-radius:var(--ck-radius-pill);width:32px;height:32px;color:var(--ck-text-muted);transition:background-color var(--ck-fast), color var(--ck-fast), scale var(--ck-fast) ease-out;background:0 0;border:0;place-items:center;padding:0;display:grid}.ck-markup .ck-tool[aria-pressed=true]{background:var(--ck-accent-soft);color:var(--ck-accent-text)}.ck-markup .ck-tool:active,.ck-markup .ck-icon-btn:active:not([aria-disabled=true]){scale:.96}.ck-markup .ck-dot{width:16px;height:16px;box-shadow:inset 0 0 0 1px var(--ck-hairline);border-radius:50%;display:block}.ck-markup .ck-tool[aria-pressed=true] .ck-dot{box-shadow:0 0 0 2px var(--ck-bg), 0 0 0 4px currentColor}.ck-markup .ck-width{gap:8px;width:152px}.ck-markup .ck-width input{min-width:0;accent-color:var(--ck-accent);cursor:pointer;flex:1}.ck-markup .ck-width span{width:32px;font-size:var(--ck-fs-sm);color:var(--ck-text-muted);font-variant-numeric:tabular-nums;text-align:end;flex:none}.ck-markup .ck-btn-group{display:inline-flex}.ck-markup .ck-icon-btn{border:1px solid var(--ck-control);background:var(--ck-bg);width:32px;height:32px;color:var(--ck-text);transition:background-color var(--ck-fast), scale var(--ck-fast) ease-out;place-items:center;padding:0;display:grid}.ck-markup .ck-icon-btn+.ck-icon-btn{margin-inline-start:-1px}.ck-markup .ck-icon-btn:first-child:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-top-left-radius:var(--ck-radius-sm);border-bottom-left-radius:var(--ck-radius-sm)}.ck-markup .ck-icon-btn:first-child:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-top-left-radius:var(--ck-radius-sm);border-bottom-left-radius:var(--ck-radius-sm)}.ck-markup .ck-icon-btn:first-child:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ck-radius-sm);border-bottom-right-radius:var(--ck-radius-sm)}.ck-markup .ck-icon-btn:first-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-right-radius:var(--ck-radius-sm);border-bottom-right-radius:var(--ck-radius-sm)}.ck-markup .ck-icon-btn:last-child:not(:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-top-right-radius:var(--ck-radius-sm);border-bottom-right-radius:var(--ck-radius-sm)}.ck-markup .ck-icon-btn:last-child:not(:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi))){border-top-right-radius:var(--ck-radius-sm);border-bottom-right-radius:var(--ck-radius-sm)}.ck-markup .ck-icon-btn:last-child:-webkit-any(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ck-radius-sm);border-bottom-left-radius:var(--ck-radius-sm)}.ck-markup .ck-icon-btn:last-child:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)){border-top-left-radius:var(--ck-radius-sm);border-bottom-left-radius:var(--ck-radius-sm)}.ck-markup .ck-icon-btn:focus-visible{z-index:1;position:relative}.ck-markup .ck-icon-btn[aria-disabled=true]{opacity:.5;cursor:default}.ck-markup .ck-icon-btn.ck-primary{border-color:var(--ck-accent);background:var(--ck-accent);color:var(--ck-accent-ink);position:relative}.ck-markup .ck-label-box{z-index:1;border-radius:var(--ck-radius-md);background:var(--ck-bg);box-shadow:var(--ck-shadow);border:1px solid #0000;align-items:center;gap:4px;padding:4px;display:flex;position:fixed}.ck-markup .ck-label-box .ck-input{border-radius:var(--ck-radius-sm);height:32px}.ck-markup .ck-label-box .ck-chip{flex:none;height:32px}@media (hover:hover){.ck-markup .ck-icon-btn:hover:not([aria-disabled=true]):not(.ck-primary){background:var(--ck-bg-hover)}.ck-markup .ck-tool:hover{background:var(--ck-bg-hover);color:var(--ck-text)}}@media (forced-colors:active){.ck-markup .ck-tool[aria-pressed=true]{color:highlighttext;background:highlight}}@media (pointer:coarse){.ck-markup .ck-tool,.ck-markup .ck-icon-btn{width:44px;height:44px}}@media (max-width:520px){.ck-markup .ck-markup-tools{border-radius:var(--ck-radius)}}");
|
|
5
5
|
var l = /* @__PURE__ */ new WeakSet(), u = [
|
|
6
6
|
"pen",
|
|
7
7
|
"line",
|
|
@@ -56,7 +56,7 @@ function h({ d: e }) {
|
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
function g({ image: s, onDone: c, onCancel: g }) {
|
|
59
|
-
let b = i(null), [x, S] =
|
|
59
|
+
let b = i(null), [x, S] = e(null), [C, w] = e("pen"), [T, E] = e(d[0]), [D, O] = e(3), [k, A] = e({
|
|
60
60
|
steps: [[]],
|
|
61
61
|
at: 0
|
|
62
62
|
}), j = k.steps[k.at], M = (e) => A((t) => ({
|
|
@@ -68,8 +68,13 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
68
68
|
})), P = () => A((e) => ({
|
|
69
69
|
...e,
|
|
70
70
|
at: Math.min(e.steps.length - 1, e.at + 1)
|
|
71
|
-
})), F = i(null), [I, L] =
|
|
72
|
-
|
|
71
|
+
})), F = i(null), [I, L] = e(null), R = i(null), z = i(null);
|
|
72
|
+
r(() => {
|
|
73
|
+
let e = z.current?.getRootNode()?.activeElement ?? document.activeElement;
|
|
74
|
+
return () => {
|
|
75
|
+
e instanceof HTMLElement && e.isConnected && e.focus({ preventScroll: !0 });
|
|
76
|
+
};
|
|
77
|
+
}, []), r(() => (R.current ?? z.current)?.focus({ preventScroll: !0 }), [!!I]);
|
|
73
78
|
let B = () => {
|
|
74
79
|
let e = I?.text.trim().slice(0, 500);
|
|
75
80
|
I && e && M([...j, {
|
|
@@ -80,7 +85,7 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
80
85
|
width: _(b.current, D)
|
|
81
86
|
}]), z.current?.focus({ preventScroll: !0 }), L(null);
|
|
82
87
|
};
|
|
83
|
-
|
|
88
|
+
n(() => {
|
|
84
89
|
let e = !0, t = null;
|
|
85
90
|
return createImageBitmap(s).then((n) => e ? S(t = n) : n.close()), () => {
|
|
86
91
|
if (e = !1, t) {
|
|
@@ -88,7 +93,7 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
88
93
|
S((t) => t === e ? null : t), l.add(e), e.close();
|
|
89
94
|
}
|
|
90
95
|
};
|
|
91
|
-
}, [s]),
|
|
96
|
+
}, [s]), n(() => V(), [x, j]);
|
|
92
97
|
let V = (e) => {
|
|
93
98
|
let t = b.current;
|
|
94
99
|
if (!t || !x || l.has(x)) return;
|
|
@@ -141,7 +146,7 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
141
146
|
tabIndex: -1,
|
|
142
147
|
role: "dialog",
|
|
143
148
|
"aria-modal": "true",
|
|
144
|
-
"aria-label":
|
|
149
|
+
"aria-label": t("markup"),
|
|
145
150
|
"data-commentkit-ui": !0,
|
|
146
151
|
onKeyDown: (e) => {
|
|
147
152
|
if (e.key === "Tab") {
|
|
@@ -156,34 +161,34 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
156
161
|
/* @__PURE__ */ a("div", {
|
|
157
162
|
class: "ck-markup-tools",
|
|
158
163
|
role: "group",
|
|
159
|
-
"aria-label":
|
|
164
|
+
"aria-label": t("markup"),
|
|
160
165
|
children: [
|
|
161
166
|
/* @__PURE__ */ a("div", {
|
|
162
167
|
class: "ck-markup-group",
|
|
163
168
|
role: "group",
|
|
164
|
-
"aria-label":
|
|
165
|
-
children: u.map((
|
|
169
|
+
"aria-label": t("markupTools"),
|
|
170
|
+
children: u.map((e) => /* @__PURE__ */ a("button", {
|
|
166
171
|
class: "ck-tool",
|
|
167
|
-
"aria-pressed": C ===
|
|
168
|
-
"aria-label":
|
|
169
|
-
title:
|
|
170
|
-
onClick: () => w(
|
|
171
|
-
children: /* @__PURE__ */ a(h, { d: p[
|
|
172
|
+
"aria-pressed": C === e,
|
|
173
|
+
"aria-label": t(`tool_${e}`),
|
|
174
|
+
title: t(`tool_${e}`),
|
|
175
|
+
onClick: () => w(e),
|
|
176
|
+
children: /* @__PURE__ */ a(h, { d: p[e] })
|
|
172
177
|
}))
|
|
173
178
|
}),
|
|
174
179
|
/* @__PURE__ */ a("div", {
|
|
175
180
|
class: "ck-markup-group",
|
|
176
181
|
role: "group",
|
|
177
|
-
"aria-label":
|
|
178
|
-
children: d.map((
|
|
182
|
+
"aria-label": t("markupColors"),
|
|
183
|
+
children: d.map((e, n) => /* @__PURE__ */ a("button", {
|
|
179
184
|
class: "ck-tool",
|
|
180
|
-
"aria-pressed": T ===
|
|
181
|
-
"aria-label":
|
|
182
|
-
title:
|
|
183
|
-
onClick: () => E(
|
|
185
|
+
"aria-pressed": T === e,
|
|
186
|
+
"aria-label": t(f[n]),
|
|
187
|
+
title: t(f[n]),
|
|
188
|
+
onClick: () => E(e),
|
|
184
189
|
children: /* @__PURE__ */ a("span", {
|
|
185
190
|
class: "ck-dot",
|
|
186
|
-
style: { background:
|
|
191
|
+
style: { background: e }
|
|
187
192
|
})
|
|
188
193
|
}))
|
|
189
194
|
}),
|
|
@@ -195,22 +200,22 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
195
200
|
max: 12,
|
|
196
201
|
step: 1,
|
|
197
202
|
value: D,
|
|
198
|
-
"aria-label":
|
|
203
|
+
"aria-label": t("markupSize"),
|
|
199
204
|
onInput: (e) => O(Number(e.target.value))
|
|
200
205
|
}), /* @__PURE__ */ a("span", { children: [D, "px"] })]
|
|
201
206
|
}),
|
|
202
207
|
/* @__PURE__ */ a("div", {
|
|
203
208
|
class: "ck-markup-group",
|
|
204
209
|
role: "group",
|
|
205
|
-
"aria-label":
|
|
210
|
+
"aria-label": t("markupHistory"),
|
|
206
211
|
children: /* @__PURE__ */ a("span", {
|
|
207
212
|
class: "ck-btn-group",
|
|
208
213
|
children: [
|
|
209
214
|
/* @__PURE__ */ a("button", {
|
|
210
215
|
class: "ck-icon-btn",
|
|
211
216
|
"aria-disabled": k.at === 0 || void 0,
|
|
212
|
-
"aria-label":
|
|
213
|
-
title: `${
|
|
217
|
+
"aria-label": t("undo"),
|
|
218
|
+
title: `${t("undo")} (${v()} Z)`,
|
|
214
219
|
"aria-keyshortcuts": "Meta+Z",
|
|
215
220
|
onClick: N,
|
|
216
221
|
children: /* @__PURE__ */ a(h, { d: m.undo })
|
|
@@ -218,8 +223,8 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
218
223
|
/* @__PURE__ */ a("button", {
|
|
219
224
|
class: "ck-icon-btn",
|
|
220
225
|
"aria-disabled": k.at === k.steps.length - 1 || void 0,
|
|
221
|
-
"aria-label":
|
|
222
|
-
title: `${
|
|
226
|
+
"aria-label": t("redo"),
|
|
227
|
+
title: `${t("redo")} (${v()} Shift Z)`,
|
|
223
228
|
"aria-keyshortcuts": "Meta+Shift+Z",
|
|
224
229
|
onClick: P,
|
|
225
230
|
children: /* @__PURE__ */ a(h, { d: m.redo })
|
|
@@ -227,8 +232,8 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
227
232
|
/* @__PURE__ */ a("button", {
|
|
228
233
|
class: "ck-icon-btn",
|
|
229
234
|
"aria-disabled": !j.length || void 0,
|
|
230
|
-
"aria-label":
|
|
231
|
-
title:
|
|
235
|
+
"aria-label": t("clearAll"),
|
|
236
|
+
title: t("clearAll"),
|
|
232
237
|
onClick: () => j.length && M([]),
|
|
233
238
|
children: /* @__PURE__ */ a(h, { d: m.clear })
|
|
234
239
|
})
|
|
@@ -241,15 +246,15 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
241
246
|
class: "ck-btn-group",
|
|
242
247
|
children: [/* @__PURE__ */ a("button", {
|
|
243
248
|
class: "ck-icon-btn",
|
|
244
|
-
"aria-label":
|
|
245
|
-
title: `${
|
|
249
|
+
"aria-label": t("cancel"),
|
|
250
|
+
title: `${t("cancel")} (Esc)`,
|
|
246
251
|
onClick: g,
|
|
247
252
|
children: /* @__PURE__ */ a(h, { d: m.cancel })
|
|
248
253
|
}), /* @__PURE__ */ a("button", {
|
|
249
254
|
class: "ck-icon-btn ck-primary",
|
|
250
255
|
"aria-disabled": !j.length && !I?.text.trim() || void 0,
|
|
251
|
-
"aria-label":
|
|
252
|
-
title: !j.length && !I?.text.trim() ?
|
|
256
|
+
"aria-label": t("markupDone"),
|
|
257
|
+
title: !j.length && !I?.text.trim() ? t("markupEmpty") : t("markupDone"),
|
|
253
258
|
onClick: () => (j.length || I?.text.trim()) && K(),
|
|
254
259
|
children: /* @__PURE__ */ a(h, { d: m.save })
|
|
255
260
|
})]
|
|
@@ -259,6 +264,8 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
259
264
|
}),
|
|
260
265
|
/* @__PURE__ */ a("canvas", {
|
|
261
266
|
ref: b,
|
|
267
|
+
role: "img",
|
|
268
|
+
"aria-label": t("markup"),
|
|
262
269
|
onPointerDown: U,
|
|
263
270
|
onPointerMove: W,
|
|
264
271
|
onPointerUp: G
|
|
@@ -271,8 +278,8 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
271
278
|
class: "ck-input",
|
|
272
279
|
maxLength: 500,
|
|
273
280
|
value: I.text,
|
|
274
|
-
placeholder:
|
|
275
|
-
"aria-label":
|
|
281
|
+
placeholder: t("markupTextPrompt"),
|
|
282
|
+
"aria-label": t("markupTextPrompt"),
|
|
276
283
|
style: { color: T },
|
|
277
284
|
onInput: (e) => L({
|
|
278
285
|
...I,
|
|
@@ -285,7 +292,7 @@ function g({ image: s, onDone: c, onCancel: g }) {
|
|
|
285
292
|
class: "ck-chip ck-primary",
|
|
286
293
|
onMouseDown: (e) => e.preventDefault(),
|
|
287
294
|
onClick: B,
|
|
288
|
-
children:
|
|
295
|
+
children: t("markupTextAdd")
|
|
289
296
|
})]
|
|
290
297
|
}) : null
|
|
291
298
|
]
|