@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.
Files changed (72) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +109 -13
  3. package/SECURITY.md +2 -2
  4. package/dist/node/cli/doctor.js +84 -20
  5. package/dist/node/cli/init.js +349 -35
  6. package/dist/node/cli/main.js +35 -17
  7. package/dist/node/cli/mcp.js +187 -6
  8. package/dist/node/shared/dashboard-places.js +33 -0
  9. package/dist/npm/chunks/{AgentSend-DxRJIYiz.js → AgentSend-DOy3jhyF.js} +16 -16
  10. package/dist/npm/chunks/{Checklist-CnlfeSbc.js → Checklist-CW_SwMpS.js} +70 -70
  11. package/dist/npm/chunks/{Composer-B1bBVszY.js → Composer-Bveq5QrK.js} +276 -274
  12. package/dist/npm/chunks/{Guest-vvNPz8h-.js → Guest-7hcN765o.js} +58 -55
  13. package/dist/npm/chunks/{MarkupEditor-VCOXh9d2.js → MarkupEditor-6bJGpWGO.js} +46 -39
  14. package/dist/npm/chunks/Panel-ChPUB68C.js +1211 -0
  15. package/dist/npm/chunks/{Settings-BGoZS2iV.js → Settings-CB5eEKnf.js} +77 -77
  16. package/dist/npm/chunks/{Shortcuts-B2OMvczr.js → Shortcuts-eAyjJ89P.js} +4 -4
  17. package/dist/npm/chunks/{StyleEditor-CJ_d8Huf.js → StyleEditor-CZTdAA5c.js} +10 -10
  18. package/dist/npm/chunks/{StylePanel-yQzHHlY7.js → StylePanel-B4pHQUL9.js} +61 -61
  19. package/dist/npm/chunks/{TaskFields-fmy6_HtK.js → TaskFields-C8BX0Sgg.js} +55 -55
  20. package/dist/npm/chunks/ThreadCard-B1EsX3PR.js +1160 -0
  21. package/dist/npm/chunks/Viewer-DY6zb90M.js +114 -0
  22. package/dist/npm/chunks/{agent-C1OQzBAm.js → agent-MTQHr9ei.js} +1 -1
  23. package/dist/npm/chunks/{ar-CAJ3XT8e.js → ar-L5cQ-NPe.js} +2 -0
  24. package/dist/npm/chunks/{card-bits-CAnzrqx3.js → card-bits-CTdrkYn8.js} +16 -16
  25. package/dist/npm/chunks/{client-kNAo2TTG.js → client-7eVxvg5j.js} +7 -7
  26. package/dist/npm/chunks/{confetti-CkBdSu19.js → confetti-BIs5s14P.js} +1 -1
  27. package/dist/npm/chunks/{context-B8UAzve0.js → context-Cf6khm7A.js} +1 -1
  28. package/dist/npm/chunks/{de-Dl18G48t.js → de-D0C-v6tP.js} +2 -0
  29. package/dist/npm/chunks/{dialog-GO04oC3D.js → dialog-DvdIkCW0.js} +1 -1
  30. package/dist/npm/chunks/{dpop-U48QIQd7.js → dpop-0A76OPa9.js} +1 -1
  31. package/dist/npm/chunks/{es-Dxk79lS9.js → es-Bw4Dj9tN.js} +2 -0
  32. package/dist/npm/chunks/{extension-CKFpPWmi.js → extension-DFVOvciD.js} +1 -1
  33. package/dist/npm/chunks/{extension-E81hWyiT.js → extension-SmoH5AA4.js} +2 -2
  34. package/dist/npm/chunks/{files-DyD5BZgp.js → files-4lV9YQIX.js} +2 -2
  35. package/dist/npm/chunks/{fr-8BebGKYD.js → fr-TkuQaIAa.js} +2 -0
  36. package/dist/npm/chunks/{hi-BIN6Yy_p.js → hi-DXSH2U8d.js} +2 -0
  37. package/dist/npm/chunks/{i18n-DOBt8e9U.js → i18n-aVSu9TcJ.js} +56 -47
  38. package/dist/npm/chunks/{identify-CN-3xzqL.js → identify-BGYh2dVo.js} +4 -4
  39. package/dist/npm/chunks/{it-Cr6EwpPQ.js → it-CiWA_bch.js} +2 -0
  40. package/dist/npm/chunks/{ja-Iy3s5aur.js → ja-C-QmR3yz.js} +2 -0
  41. package/dist/npm/chunks/{late-words-B2bmZceJ.js → late-words-80_VWt8S.js} +3 -1
  42. package/dist/npm/chunks/{live-CelVeZfP.js → live-BExWHzQ7.js} +1 -1
  43. package/dist/npm/chunks/{nl-B84WHqqe.js → nl-CEmZRqjX.js} +2 -0
  44. package/dist/npm/chunks/{page-key-DepmJzC1.js → page-key-HSY3Lze5.js} +1 -1
  45. package/dist/npm/chunks/{pick-yTyqtxN0.js → pick-B3sR7jtS.js} +1 -1
  46. package/dist/npm/chunks/{pkce-ChKGSW_4.js → pkce-CfZhiNBi.js} +1 -1
  47. package/dist/npm/chunks/{pt-BR-DOkdlfoe.js → pt-BR-b-a8sxO8.js} +2 -0
  48. package/dist/npm/chunks/{report-CrIqQZDI.js → report-DaVuoRYS.js} +1 -1
  49. package/dist/npm/chunks/show-BoN8AC-F.js +97 -0
  50. package/dist/npm/chunks/{signin-Dd1rb2BP.js → signin-BOWr_WCo.js} +3 -3
  51. package/dist/npm/chunks/{source-pXVve2Cx.js → source-mk3rGBBQ.js} +1 -1
  52. package/dist/npm/chunks/{src-BTMy4Gyc.js → src-C8rZFyL_.js} +77 -70
  53. package/dist/npm/chunks/start-CV4j78_q.js +1894 -0
  54. package/dist/npm/chunks/{states-sfTbjZz8.js → states-b9Bv3Ci7.js} +1 -1
  55. package/dist/npm/chunks/{upload-MgPYqPyE.js → upload-B2mkgMeJ.js} +1 -1
  56. package/dist/npm/chunks/uploads-8AxyRq7g.js +1147 -0
  57. package/dist/npm/chunks/{wrap-Bl0gbnFa.js → wrap-DW6EFbVQ.js} +1 -1
  58. package/dist/npm/chunks/{zh-CN-Z5fQCb7G.js → zh-CN-JTscW8u8.js} +2 -0
  59. package/dist/npm/element.js +1 -1
  60. package/dist/npm/headless.js +2 -2
  61. package/dist/npm/index.js +2 -2
  62. package/dist/npm/react.js +1 -1
  63. package/dist/npm/svelte.js +1 -1
  64. package/dist/npm/types/core/types.d.ts +2 -2
  65. package/dist/npm/vue.js +1 -1
  66. package/package.json +3 -1
  67. package/dist/npm/chunks/Panel-F37vIL1K.js +0 -1206
  68. package/dist/npm/chunks/ThreadCard-D51slKST.js +0 -1113
  69. package/dist/npm/chunks/Viewer-BOBadqmC.js +0 -111
  70. package/dist/npm/chunks/show-BgVC8gWY.js +0 -97
  71. package/dist/npm/chunks/start-DtVlpt7p.js +0 -1878
  72. 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-kNAo2TTG.js";
2
- import { c as r, d as i, f as a, g as o, n as s, p as c, u as l } from "./i18n-DOBt8e9U.js";
3
- import { r as u } from "./card-bits-CAnzrqx3.js";
4
- import { C as d, f, s as p } from "./start-DtVlpt7p.js";
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, i) {
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: i.share,
16
- name: i.name.trim(),
17
- email: i.email.trim(),
18
- locale: s(),
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
- }), r = Date.parse(n.pending_session.expires_at);
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(r) ? r : Date.now() + n.expires_in * 1e3
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", r("shareExpired")) : e;
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: s()
41
+ locale: c()
42
42
  };
43
43
  }
44
- function g({ client: t, email: s, onDone: p, onDifferentEmail: m, onClose: g }) {
45
- let [y, b] = o(""), [x, S] = o(!1), [C, w] = o(null), [T, E] = o(null), D = c(null);
46
- a(() => D.current?.focus({ preventScroll: !0 }), []);
47
- let O = c({}), [k, A] = o(_);
48
- i(() => {
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 (i = y) => {
54
- if (/^\d{6}$/.test(i) && !x) {
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: i,
59
+ code: r,
60
60
  ...h()
61
- }, r = await t.api.request("/guest/verify", {
61
+ }, i = await t.api.request("/guest/verify", {
62
62
  method: "POST",
63
63
  body: n,
64
- idempotencyKey: (a = O.current)[i] ?? (a[i] = e(16))
64
+ idempotencyKey: (a = O.current)[r] ?? (a[r] = e(16))
65
65
  });
66
- t.auth.adopt(r), await t.loadSession().catch(() => null), p(r.published_thread_ids ?? []);
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: r("verifyWrong"),
69
+ text: i("verifyWrong"),
70
70
  tone: "warning"
71
71
  });
72
- let i = v(e);
73
- i && (t.auth.setPending(null), E(i === "expired" ? "again" : "stop")), w({
74
- text: i ? r(i === "link" ? "verifyLinkExpired" : i === "removed" ? "verifyRemoved" : "verifyExpired") : f(e),
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 i = { "Idempotency-Key": e(16) }, a = () => t.api.request("/guest/resend", {
82
+ let r = { "Idempotency-Key": e(16) }, a = () => t.api.request("/guest/resend", {
83
83
  method: "POST",
84
- headers: i
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: r("verifyResent") }), A(_);
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 ? r("guestCodesPaused") : e instanceof n && e.status === 429 ? r("verifyWait") : r("errorGeneric"),
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: r("verifyTitle")
115
+ children: i("verifyTitle")
116
116
  }), /* @__PURE__ */ l("button", {
117
117
  class: "ck-ghost",
118
- "aria-label": r("close"),
119
- title: r("close"),
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: r("verifyBody", { email: s })
129
+ children: i("verifyBody", { email: c })
130
130
  }),
131
131
  /* @__PURE__ */ l("p", {
132
132
  class: "ck-verify-text",
133
- children: r("verifyLookFor", { website: t.state.get().config?.project?.name ?? "" })
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: r("verifyCode") }), /* @__PURE__ */ l("input", {
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 ? r("verifyResendIn", { n: k }) : r("verifyResend")
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: r("verifyDifferent")
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: r("writeAgain")
185
+ children: i("writeAgain")
186
186
  }) : T === "stop" ? /* @__PURE__ */ l("button", {
187
187
  class: "ck-btn",
188
188
  onClick: () => g(),
189
- children: r("close")
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: r(x ? "sending" : "verifyPublish")
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: i, onOpen: a }) {
206
- let [s, c] = o(e.auth.finishLink), [u, d] = o(!1), [p, m] = o(null);
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), i({
225
- text: r("sentGuest"),
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] && a(t.published_thread_ids[0]);
227
+ }), t.published_thread_ids?.[0] && o(t.published_thread_ids[0]);
228
228
  } catch (t) {
229
- let i = t instanceof n ? t.code : "";
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(i === "finish_link_expired" ? r("finishExpired") : f(t)), d(!1);
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: r("finishTitle")
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: r("close")
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: r(u ? "sending" : "finishSend")
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 { c as e, d as t, f as n, g as r, p as i, u as a } from "./i18n-DOBt8e9U.js";
2
- import { O as o, m as s, s as c } from "./start-DtVlpt7p.js";
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-text);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-border);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-xs);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)}}");
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] = r(null), [C, w] = r("pen"), [T, E] = r(d[0]), [D, O] = r(3), [k, A] = r({
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] = r(null), R = i(null), z = i(null);
72
- n(() => (R.current ?? z.current)?.focus({ preventScroll: !0 }), [!!I]);
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
- t(() => {
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]), t(() => V(), [x, j]);
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": e("markup"),
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": e("markup"),
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": e("markupTools"),
165
- children: u.map((t) => /* @__PURE__ */ a("button", {
169
+ "aria-label": t("markupTools"),
170
+ children: u.map((e) => /* @__PURE__ */ a("button", {
166
171
  class: "ck-tool",
167
- "aria-pressed": C === t,
168
- "aria-label": e(`tool_${t}`),
169
- title: e(`tool_${t}`),
170
- onClick: () => w(t),
171
- children: /* @__PURE__ */ a(h, { d: p[t] })
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": e("markupColors"),
178
- children: d.map((t, n) => /* @__PURE__ */ a("button", {
182
+ "aria-label": t("markupColors"),
183
+ children: d.map((e, n) => /* @__PURE__ */ a("button", {
179
184
  class: "ck-tool",
180
- "aria-pressed": T === t,
181
- "aria-label": e(f[n]),
182
- title: e(f[n]),
183
- onClick: () => E(t),
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: t }
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": e("markupSize"),
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": e("markupHistory"),
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": e("undo"),
213
- title: `${e("undo")} (${v()} Z)`,
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": e("redo"),
222
- title: `${e("redo")} (${v()} Shift Z)`,
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": e("clearAll"),
231
- title: e("clearAll"),
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": e("cancel"),
245
- title: `${e("cancel")} (Esc)`,
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": e("markupDone"),
252
- title: !j.length && !I?.text.trim() ? e("markupEmpty") : e("markupDone"),
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: e("markupTextPrompt"),
275
- "aria-label": e("markupTextPrompt"),
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: e("markupTextAdd")
295
+ children: t("markupTextAdd")
289
296
  })]
290
297
  }) : null
291
298
  ]