@commentkit/comment-kit 1.5.0 → 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.
- package/CHANGELOG.md +20 -2
- package/dist/npm/THIRD_PARTY_NOTICES.txt +2 -2
- package/dist/npm/chunks/{AgentSend-DyWxNQ0p.js → AgentSend-2JPDseOo.js} +4 -5
- package/dist/npm/chunks/{Checklist-VYkSl6Q9.js → Checklist-BpDXQebo.js} +77 -79
- package/dist/npm/chunks/Composer-CAyj-c8e.js +677 -0
- package/dist/npm/chunks/Guest-ZdFmTcXI.js +187 -0
- package/dist/npm/chunks/{MarkupEditor-DxTI9nJH.js → MarkupEditor-BFplZwFy.js} +3 -5
- package/dist/npm/chunks/{Panel-riaMYxt-.js → Panel-BhZ4XRDR.js} +300 -302
- package/dist/npm/chunks/{Settings-CB4zxQAL.js → Settings-SPG9EHUZ.js} +70 -72
- package/dist/npm/chunks/{Shortcuts-D1cbajg_.js → Shortcuts-C28HVDw6.js} +3 -5
- package/dist/npm/chunks/{StyleEditor-BtTv3I8_.js → StyleEditor-ByZMtq10.js} +4 -5
- package/dist/npm/chunks/{StylePanel-BI-n5Me1.js → StylePanel-Iwhce2tE.js} +62 -64
- package/dist/npm/chunks/{TaskFields-HwrD0FrH.js → TaskFields-BsP_fVJg.js} +7 -6
- package/dist/npm/chunks/{ThreadCard-CjaC8BTa.js → ThreadCard-BzVZdDCb.js} +407 -403
- package/dist/npm/chunks/{Viewer-BnWshSXb.js → Viewer-CqtGrdD8.js} +29 -31
- package/dist/npm/chunks/{agent-Cr6NB6We.js → agent-BDMQtOzH.js} +14 -15
- package/dist/npm/chunks/{anchor-OCQnjp_6.js → anchor-BsradQhn.js} +1 -2
- package/dist/npm/chunks/{ar-BQ9K9Oqf.js → ar-8tPch6W4.js} +5 -2
- package/dist/npm/chunks/{card-bits-CxteYiZ9.js → card-bits-Bna-g3Py.js} +24 -26
- package/dist/npm/chunks/{client-CJ1tpI62.js → client-EFTWxHbJ.js} +76 -61
- package/dist/npm/chunks/{colors-0Ied7PE2.js → colors-CWAn_swA.js} +39 -4
- package/dist/npm/chunks/{confetti-DKeKR7-6.js → confetti-DTKpwF3O.js} +1 -2
- package/dist/npm/chunks/{de-CcPi8xdC.js → de-C63897uD.js} +5 -2
- package/dist/npm/chunks/{drafts-CpQdHhcK.js → drafts-akdBsOd0.js} +1 -2
- package/dist/npm/chunks/{es-DXgkjDCG.js → es-CI2bSpvB.js} +5 -2
- package/dist/npm/chunks/{extension-BIGfr4Gh.js → extension-BST6LH1q.js} +2 -3
- package/dist/npm/chunks/{extension-DkDSW4qw.js → extension-D-V3utTm.js} +3 -4
- package/dist/npm/chunks/{fr-IjJaUbWh.js → fr-rsVe-Lqk.js} +5 -2
- package/dist/npm/chunks/{hi-BhKQK2MU.js → hi-cvwbSaWP.js} +5 -2
- package/dist/npm/chunks/{html2canvas-pro.esm-lgs6tb4C.js → html2canvas-pro.esm-B7b8p5Wr.js} +608 -528
- package/dist/npm/chunks/{i18n-DAJGndZ2.js → i18n-C4v0M-6z.js} +254 -257
- package/dist/npm/chunks/{it-DKiSCkiD.js → it-C8tnV0BF.js} +5 -2
- package/dist/npm/chunks/{ja-BI1WagDg.js → ja-BWxDfC2f.js} +5 -2
- package/dist/npm/chunks/{live-B-mo27Qq.js → live-BCpJVBeN.js} +2 -3
- package/dist/npm/chunks/{lock-C82sC17d.js → lock-B1JLlOhz.js} +0 -1
- package/dist/npm/chunks/{nl-CJw3VUQ5.js → nl-DNQ6eCht.js} +5 -2
- package/dist/npm/chunks/{pick-CYPkLLFJ.js → pick-CLyOdjnD.js} +3 -4
- package/dist/npm/chunks/{pt-BR-CjBolC5g.js → pt-BR-CkG7vpU2.js} +5 -2
- package/dist/npm/chunks/{realtime-D22tI_AS.js → realtime-DIo-Wth4.js} +2 -3
- package/dist/npm/chunks/{report-DoDVi1qT.js → report-BBrT3r89.js} +1 -2
- package/dist/npm/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
- package/dist/npm/chunks/{source-CTQmAh0Y.js → source-CS7C6wJA.js} +2 -3
- package/dist/npm/chunks/{src-CgBEoWl0.js → src-C4FsVoUp.js} +22 -24
- package/dist/npm/chunks/{start-DW9_DKmf.js → start-i9M-r3aH.js} +375 -358
- package/dist/npm/chunks/{upload-BmrpZE5G.js → upload-DSv7EyBD.js} +2 -3
- package/dist/npm/chunks/uploads-I01kdqQF.js +1103 -0
- package/dist/npm/chunks/{zh-CN-BrZGx2S0.js → zh-CN-BKuZOLBE.js} +5 -2
- package/dist/npm/element.js +2 -3
- package/dist/npm/headless.js +2 -2
- package/dist/npm/index.js +2 -2
- package/dist/npm/react.js +2 -3
- package/dist/npm/svelte.js +2 -3
- package/dist/npm/types/core/auth.d.ts +14 -0
- package/dist/npm/vue.js +2 -3
- package/package.json +8 -8
- package/dist/npm/chunks/Composer-CnsGQirF.js +0 -679
- package/dist/npm/chunks/Guest-DkIvY5zt.js +0 -170
- package/dist/npm/chunks/uploads-CipONvCy.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-
|
|
2
|
-
import {
|
|
3
|
-
|
|
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 };
|