@commentkit/comment-kit 1.5.1 → 1.6.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/npm/THIRD_PARTY_NOTICES.txt +2 -2
  3. package/dist/npm/chunks/{AgentSend-DjFZSC0S.js → AgentSend-2JPDseOo.js} +4 -5
  4. package/dist/npm/chunks/{Checklist-BEz4IZdT.js → Checklist-BpDXQebo.js} +77 -79
  5. package/dist/npm/chunks/Composer-CAyj-c8e.js +677 -0
  6. package/dist/npm/chunks/Guest-ZdFmTcXI.js +187 -0
  7. package/dist/npm/chunks/{MarkupEditor-CPH4yKx4.js → MarkupEditor-BFplZwFy.js} +3 -5
  8. package/dist/npm/chunks/{Panel-DSoUAlbQ.js → Panel-BhZ4XRDR.js} +300 -302
  9. package/dist/npm/chunks/{Settings-C_qV4n7J.js → Settings-SPG9EHUZ.js} +70 -72
  10. package/dist/npm/chunks/{Shortcuts-ChnaribX.js → Shortcuts-C28HVDw6.js} +3 -5
  11. package/dist/npm/chunks/{StyleEditor-DqZd6C5o.js → StyleEditor-ByZMtq10.js} +4 -5
  12. package/dist/npm/chunks/{StylePanel-DMC3riYK.js → StylePanel-Iwhce2tE.js} +62 -64
  13. package/dist/npm/chunks/{TaskFields-BfjjllMx.js → TaskFields-BsP_fVJg.js} +7 -6
  14. package/dist/npm/chunks/{ThreadCard-DmKAelSL.js → ThreadCard-BzVZdDCb.js} +407 -403
  15. package/dist/npm/chunks/{Viewer-mw69qSI5.js → Viewer-CqtGrdD8.js} +29 -31
  16. package/dist/npm/chunks/{agent-CqDO3JMA.js → agent-BDMQtOzH.js} +14 -15
  17. package/dist/npm/chunks/{anchor-OCQnjp_6.js → anchor-BsradQhn.js} +1 -2
  18. package/dist/npm/chunks/{ar-BQ9K9Oqf.js → ar-8tPch6W4.js} +5 -2
  19. package/dist/npm/chunks/{card-bits-C7bIk5KX.js → card-bits-Bna-g3Py.js} +24 -26
  20. package/dist/npm/chunks/{client-dZeNdizE.js → client-EFTWxHbJ.js} +76 -61
  21. package/dist/npm/chunks/{colors-CAjY4jxf.js → colors-CWAn_swA.js} +1 -2
  22. package/dist/npm/chunks/{confetti-DKeKR7-6.js → confetti-DTKpwF3O.js} +1 -2
  23. package/dist/npm/chunks/{de-CcPi8xdC.js → de-C63897uD.js} +5 -2
  24. package/dist/npm/chunks/{drafts-CpQdHhcK.js → drafts-akdBsOd0.js} +1 -2
  25. package/dist/npm/chunks/{es-DXgkjDCG.js → es-CI2bSpvB.js} +5 -2
  26. package/dist/npm/chunks/{extension-BFkXOmX5.js → extension-BST6LH1q.js} +2 -3
  27. package/dist/npm/chunks/{extension-Gvei3opb.js → extension-D-V3utTm.js} +3 -4
  28. package/dist/npm/chunks/{fr-IjJaUbWh.js → fr-rsVe-Lqk.js} +5 -2
  29. package/dist/npm/chunks/{hi-BhKQK2MU.js → hi-cvwbSaWP.js} +5 -2
  30. package/dist/npm/chunks/{html2canvas-pro.esm-lgs6tb4C.js → html2canvas-pro.esm-B7b8p5Wr.js} +608 -528
  31. package/dist/npm/chunks/{i18n-DAJGndZ2.js → i18n-C4v0M-6z.js} +254 -257
  32. package/dist/npm/chunks/{it-DKiSCkiD.js → it-C8tnV0BF.js} +5 -2
  33. package/dist/npm/chunks/{ja-BI1WagDg.js → ja-BWxDfC2f.js} +5 -2
  34. package/dist/npm/chunks/{live-MvvBdoGd.js → live-BCpJVBeN.js} +2 -3
  35. package/dist/npm/chunks/{lock-C82sC17d.js → lock-B1JLlOhz.js} +0 -1
  36. package/dist/npm/chunks/{nl-CJw3VUQ5.js → nl-DNQ6eCht.js} +5 -2
  37. package/dist/npm/chunks/{pick-dDDLxCDI.js → pick-CLyOdjnD.js} +3 -4
  38. package/dist/npm/chunks/{pt-BR-CjBolC5g.js → pt-BR-CkG7vpU2.js} +5 -2
  39. package/dist/npm/chunks/{realtime-D22tI_AS.js → realtime-DIo-Wth4.js} +2 -3
  40. package/dist/npm/chunks/{report-DoDVi1qT.js → report-BBrT3r89.js} +1 -2
  41. package/dist/npm/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
  42. package/dist/npm/chunks/{source-BQS2_xfB.js → source-CS7C6wJA.js} +2 -3
  43. package/dist/npm/chunks/{src-C_oUnL0i.js → src-C4FsVoUp.js} +22 -24
  44. package/dist/npm/chunks/{start-C5-rebEU.js → start-i9M-r3aH.js} +374 -357
  45. package/dist/npm/chunks/{upload-CzPAjktW.js → upload-DSv7EyBD.js} +2 -3
  46. package/dist/npm/chunks/uploads-I01kdqQF.js +1103 -0
  47. package/dist/npm/chunks/{zh-CN-BrZGx2S0.js → zh-CN-BKuZOLBE.js} +5 -2
  48. package/dist/npm/element.js +2 -3
  49. package/dist/npm/headless.js +2 -2
  50. package/dist/npm/index.js +2 -2
  51. package/dist/npm/react.js +2 -3
  52. package/dist/npm/svelte.js +2 -3
  53. package/dist/npm/types/core/auth.d.ts +14 -0
  54. package/dist/npm/vue.js +2 -3
  55. package/package.json +8 -8
  56. package/dist/npm/chunks/Composer-D1wbmdjF.js +0 -681
  57. package/dist/npm/chunks/Guest-CtyRy8Kz.js +0 -170
  58. package/dist/npm/chunks/uploads-tpLjiJdH.js +0 -541
@@ -0,0 +1,187 @@
1
+ import { p as e } from "./client-EFTWxHbJ.js";
2
+ import { f as t, l as n, m as r, n as i, s as a, u as o } from "./i18n-C4v0M-6z.js";
3
+ import { r as s } from "./card-bits-Bna-g3Py.js";
4
+ import { c, f as l, n as u } from "./start-i9M-r3aH.js";
5
+ // src/ui/Guest.tsx
6
+ u(".ck-verify-text{margin:0 0 12px;line-height:1.5}.ck-code{font-family:var(--ck-mono);letter-spacing:.32em;text-align:center;height:46px;font-size:20px}.ck-verify-text{text-wrap:pretty}");
7
+ async function d(t, n) {
8
+ try {
9
+ let e = await t.api.request("/guest/start", {
10
+ method: "POST",
11
+ anonymous: !0,
12
+ body: {
13
+ client_id: t.options.project,
14
+ share: n.share,
15
+ name: n.name.trim(),
16
+ email: n.email.trim()
17
+ }
18
+ }), r = Date.parse(e.pending_session.expires_at);
19
+ return t.auth.setPending({
20
+ token: e.access_token,
21
+ email: e.pending_session.email,
22
+ expiresAt: Number.isFinite(r) ? r : Date.now() + e.expires_in * 1e3
23
+ }), "started";
24
+ } catch (t) {
25
+ if (t instanceof e && t.code === "origin_not_allowed") return "popup";
26
+ throw t instanceof e && (t.code === "share_expired" || t.status === 410 || t.errors?.share) ? new e(410, "share_expired", a("shareExpired")) : t;
27
+ }
28
+ }
29
+ function f() {
30
+ let e;
31
+ try {
32
+ e = Intl.DateTimeFormat().resolvedOptions().timeZone;
33
+ } catch {
34
+ e = void 0;
35
+ }
36
+ return {
37
+ ...e && e.length <= 64 ? { timezone: e } : {},
38
+ locale: i()
39
+ };
40
+ }
41
+ function p({ client: i, email: u, onDone: d, onDifferentEmail: p, onClose: g }) {
42
+ let [_, v] = r(""), [y, b] = r(!1), [x, S] = r(null), [C, w] = r(null), T = t(null);
43
+ o(() => T.current?.focus({ preventScroll: !0 }), []);
44
+ let [E, D] = r(m);
45
+ o(() => {
46
+ if (E <= 0) return;
47
+ let e = setTimeout(() => D((e) => e - 1), 1e3);
48
+ return () => clearTimeout(e);
49
+ }, [E]);
50
+ let O = async (t = _) => {
51
+ if (/^\d{6}$/.test(t) && !y) {
52
+ b(!0), S(null);
53
+ try {
54
+ let e = {
55
+ code: t,
56
+ ...f()
57
+ }, n = await i.api.request("/guest/verify", {
58
+ method: "POST",
59
+ body: e
60
+ });
61
+ i.auth.adopt(n), await i.loadSession().catch(() => null), d(n.published_thread_ids ?? []);
62
+ } catch (t) {
63
+ if ((t instanceof e ? t.status : 0) === 422) return v(""), T.current?.focus({ preventScroll: !0 }), S({
64
+ text: a("verifyWrong"),
65
+ tone: "warning"
66
+ });
67
+ let n = h(t);
68
+ n && (i.auth.setPending(null), w(n === "expired" ? "again" : "stop")), S({
69
+ text: n ? a(n === "link" ? "verifyLinkExpired" : n === "removed" ? "verifyRemoved" : "verifyExpired") : c(t),
70
+ tone: "warning"
71
+ });
72
+ } finally {
73
+ b(!1);
74
+ }
75
+ }
76
+ }, k = async () => {
77
+ try {
78
+ await i.api.request("/guest/resend", { method: "POST" }), S({ text: a("verifyResent") }), D(m);
79
+ } catch (t) {
80
+ S({
81
+ text: t instanceof e && t.status === 429 ? a("verifyWait") : a("errorGeneric"),
82
+ tone: "warning"
83
+ });
84
+ }
85
+ };
86
+ return /* @__PURE__ */ n("div", {
87
+ class: "ck-card",
88
+ style: s({
89
+ x: innerWidth / 2 - 190,
90
+ y: 80
91
+ }),
92
+ role: "dialog",
93
+ "aria-labelledby": "ck-verify-title",
94
+ "data-commentkit-ui": !0,
95
+ onKeyDown: (e) => e.key === "Escape" && g(),
96
+ children: [
97
+ /* @__PURE__ */ n("div", {
98
+ class: "ck-card-head",
99
+ children: [/* @__PURE__ */ n("h2", {
100
+ class: "ck-card-title",
101
+ id: "ck-verify-title",
102
+ children: a("verifyTitle")
103
+ }), /* @__PURE__ */ n("button", {
104
+ class: "ck-ghost",
105
+ "aria-label": a("close"),
106
+ onClick: g,
107
+ children: /* @__PURE__ */ n(l, { name: "close" })
108
+ })]
109
+ }),
110
+ /* @__PURE__ */ n("div", {
111
+ class: "ck-card-body",
112
+ children: [
113
+ /* @__PURE__ */ n("p", {
114
+ class: "ck-verify-text",
115
+ children: a("verifyBody", { email: u })
116
+ }),
117
+ /* @__PURE__ */ n("p", {
118
+ class: "ck-verify-text",
119
+ children: a("verifyLookFor", { website: i.state.get().config?.project?.name ?? "" })
120
+ }),
121
+ /* @__PURE__ */ n("label", {
122
+ class: "ck-field",
123
+ children: [/* @__PURE__ */ n("span", { children: a("verifyCode") }), /* @__PURE__ */ n("input", {
124
+ ref: T,
125
+ class: "ck-input ck-code",
126
+ inputMode: "numeric",
127
+ autoComplete: "one-time-code",
128
+ pattern: "[0-9]*",
129
+ maxLength: 6,
130
+ value: _,
131
+ onInput: (e) => {
132
+ let t = e.target.value.replace(/\D/g, "").slice(0, 6);
133
+ v(t), x?.tone && S(null), t.length === 6 && t !== _ && O(t);
134
+ },
135
+ onKeyDown: (e) => {
136
+ e.stopPropagation(), e.key === "Enter" && O(), e.key === "Escape" && g();
137
+ }
138
+ })]
139
+ }),
140
+ x ? /* @__PURE__ */ n("div", {
141
+ class: "ck-note",
142
+ role: x.tone ? "alert" : "status",
143
+ "data-tone": x.tone,
144
+ children: x.text
145
+ }) : null,
146
+ C ? null : /* @__PURE__ */ n("div", {
147
+ class: "ck-actions",
148
+ children: [/* @__PURE__ */ n("button", {
149
+ class: "ck-chip",
150
+ disabled: E > 0,
151
+ onClick: () => void k(),
152
+ children: E > 0 ? a("verifyResendIn", { n: E }) : a("verifyResend")
153
+ }), /* @__PURE__ */ n("button", {
154
+ class: "ck-chip",
155
+ onClick: () => {
156
+ i.auth.setPending(null), p();
157
+ },
158
+ children: a("verifyDifferent")
159
+ })]
160
+ })
161
+ ]
162
+ }),
163
+ /* @__PURE__ */ n("div", {
164
+ class: "ck-card-foot",
165
+ children: [/* @__PURE__ */ n("span", { class: "ck-spacer" }), C === "again" ? /* @__PURE__ */ n("button", {
166
+ class: "ck-btn ck-primary",
167
+ onClick: p,
168
+ children: a("writeAgain")
169
+ }) : C === "stop" ? /* @__PURE__ */ n("button", {
170
+ class: "ck-btn",
171
+ onClick: g,
172
+ children: a("close")
173
+ }) : /* @__PURE__ */ n("button", {
174
+ class: "ck-btn ck-primary",
175
+ disabled: y || _.length !== 6,
176
+ onClick: () => void O(),
177
+ children: a(y ? "sending" : "verifyPublish")
178
+ })]
179
+ })
180
+ ]
181
+ });
182
+ }
183
+ var m = 60;
184
+ function h(t) {
185
+ return t instanceof e ? t.code === "share_expired" || t.status === 410 ? "link" : t.code === "guest_removed" ? "removed" : t.status === 403 ? /\blink\b/i.test(t.message) ? "link" : "removed" : t.status === 409 || t.status === 401 ? "expired" : null : null;
186
+ }
187
+ export { p as GuestVerify, d as startGuest };
@@ -1,7 +1,6 @@
1
- import { f as e, l as t, m as n, s as r, u as i } from "./i18n-DAJGndZ2.js";
2
- import { m as a, n as o } from "./start-C5-rebEU.js";
3
- //#endregion
4
- //#region src/ui/MarkupEditor.tsx
1
+ import { f as e, l as t, m as n, s as r, u as i } from "./i18n-C4v0M-6z.js";
2
+ import { _ as a, n as o } from "./start-i9M-r3aH.js";
3
+ // src/ui/MarkupEditor.tsx
5
4
  o(".ck-markup-tools{background:var(--ck-bg);max-width:100%;box-shadow:var(--ck-shadow);border-radius:999px;flex-wrap:wrap;justify-content:center;gap:4px;padding:6px;display:flex}.ck-label-box{z-index:1;background:var(--ck-bg);box-shadow:var(--ck-shadow);border:1px solid #0000;border-radius:12px;align-items:center;gap:6px;padding:6px;display:flex;position:fixed}.ck-markup-tools{align-items:center;gap:2px;padding:4px}.ck-markup-group{align-items:center;gap:2px;padding:0 4px;display:flex}.ck-markup-group+.ck-markup-group{border-inline-start:1px solid var(--ck-hairline);margin-inline-start:4px;padding-inline-start:8px}.ck-tool{width:32px;height:32px;color:var(--ck-text-muted);background:0 0;border:0;border-radius:999px;place-items:center;padding:0;transition:background-color .12s,color .12s,scale .15s ease-out;display:grid}.ck-tool[aria-pressed=true]{background:var(--ck-accent-soft);color:color-mix(in srgb, var(--ck-accent) 70%, var(--ck-text))}.ck-tool:disabled{opacity:.35;cursor:default}.ck-tool:active:not(:disabled),.ck-icon-btn:active:not(:disabled){scale:.96}.ck-tool{width:30px;height:30px}.ck-dot{border-radius:50%;width:14px;height:14px;display:block;box-shadow:0 0 0 1px #00000014}.ck-tool[aria-pressed=true] .ck-dot{box-shadow:0 0 0 2px var(--ck-bg), 0 0 0 3.5px currentColor}.ck-width{gap:8px;width:150px}.ck-width input{min-width:0;accent-color:var(--ck-accent);cursor:pointer;flex:1}.ck-width span{width:30px;color:var(--ck-text-muted);font-variant-numeric:tabular-nums;flex:none;font-size:12px}.ck-btn-group{display:inline-flex}.ck-icon-btn{border:1px solid var(--ck-border);background:var(--ck-bg);width:30px;height:30px;color:var(--ck-text);place-items:center;padding:0;transition:background-color .12s;display:grid}.ck-icon-btn+.ck-icon-btn{margin-inline-start:-1px}.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:8px;border-bottom-left-radius:8px}.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:8px;border-bottom-left-radius:8px}.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:8px;border-bottom-right-radius:8px}.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:8px;border-bottom-right-radius:8px}.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:8px;border-bottom-right-radius:8px}.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:8px;border-bottom-right-radius:8px}.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:8px;border-bottom-left-radius:8px}.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:8px;border-bottom-left-radius:8px}.ck-icon-btn:disabled,.ck-icon-btn[aria-disabled=true]{opacity:.45;cursor:default}.ck-icon-btn.ck-primary{border-color:var(--ck-accent);background:var(--ck-accent);color:var(--ck-accent-ink);position:relative}@media (hover:hover){.ck-icon-btn:hover:not(:disabled):not(.ck-primary){background:var(--ck-bg-hover)}.ck-tool:hover:not(:disabled){background:var(--ck-bg-hover);color:var(--ck-text)}}@media (pointer:coarse){.ck-tool,.ck-icon-btn{width:40px;height:40px}}@media (max-width:520px){.ck-markup-tools{border-radius:16px}}");
6
5
  var s = /* @__PURE__ */ new WeakSet(), c = [
7
6
  "pen",
@@ -330,5 +329,4 @@ function _(e, t, n) {
330
329
  }
331
330
  e.restore();
332
331
  }
333
- //#endregion
334
332
  export { m as MarkupEditor };