@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
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { p as e } from "./client-CJ1tpI62.js";
|
|
2
|
-
import { f as t, l as n, m as r, s as i, u as a } from "./i18n-DAJGndZ2.js";
|
|
3
|
-
import { r as o } from "./card-bits-CxteYiZ9.js";
|
|
4
|
-
import { c as s, d as c, n as l } from "./start-DW9_DKmf.js";
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/ui/Guest.tsx
|
|
7
|
-
l(".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}");
|
|
8
|
-
async function u(t, n) {
|
|
9
|
-
try {
|
|
10
|
-
let e = await t.api.request("/guest/start", {
|
|
11
|
-
method: "POST",
|
|
12
|
-
anonymous: !0,
|
|
13
|
-
body: {
|
|
14
|
-
client_id: t.options.project,
|
|
15
|
-
share: n.share,
|
|
16
|
-
name: n.name.trim(),
|
|
17
|
-
email: n.email.trim()
|
|
18
|
-
}
|
|
19
|
-
}), r = Date.parse(e.pending_session.expires_at);
|
|
20
|
-
return t.auth.setPending({
|
|
21
|
-
token: e.access_token,
|
|
22
|
-
email: e.pending_session.email,
|
|
23
|
-
expiresAt: Number.isFinite(r) ? r : Date.now() + e.expires_in * 1e3
|
|
24
|
-
}), "started";
|
|
25
|
-
} catch (t) {
|
|
26
|
-
if (t instanceof e && t.code === "origin_not_allowed") return "popup";
|
|
27
|
-
throw t instanceof e && (t.code === "share_expired" || t.status === 410 || t.errors?.share) ? new e(410, "share_expired", i("shareExpired")) : t;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function d({ client: l, email: u, onDone: d, onDifferentEmail: m, onClose: h }) {
|
|
31
|
-
let [g, _] = r(""), [v, y] = r(!1), [b, x] = r(null), [S, C] = r(null), w = t(null);
|
|
32
|
-
a(() => w.current?.focus({ preventScroll: !0 }), []);
|
|
33
|
-
let [T, E] = r(f);
|
|
34
|
-
a(() => {
|
|
35
|
-
if (T <= 0) return;
|
|
36
|
-
let e = setTimeout(() => E((e) => e - 1), 1e3);
|
|
37
|
-
return () => clearTimeout(e);
|
|
38
|
-
}, [T]);
|
|
39
|
-
let D = async (t = g) => {
|
|
40
|
-
if (/^\d{6}$/.test(t) && !v) {
|
|
41
|
-
y(!0), x(null);
|
|
42
|
-
try {
|
|
43
|
-
let e = await l.api.request("/guest/verify", {
|
|
44
|
-
method: "POST",
|
|
45
|
-
body: { code: t }
|
|
46
|
-
});
|
|
47
|
-
l.auth.adopt(e), await l.loadSession().catch(() => null), d(e.published_thread_ids ?? []);
|
|
48
|
-
} catch (t) {
|
|
49
|
-
if ((t instanceof e ? t.status : 0) === 422) return _(""), w.current?.focus({ preventScroll: !0 }), x({
|
|
50
|
-
text: i("verifyWrong"),
|
|
51
|
-
tone: "warning"
|
|
52
|
-
});
|
|
53
|
-
let n = p(t);
|
|
54
|
-
n && (l.auth.setPending(null), C(n === "expired" ? "again" : "stop")), x({
|
|
55
|
-
text: n ? i(n === "link" ? "verifyLinkExpired" : n === "removed" ? "verifyRemoved" : "verifyExpired") : s(t),
|
|
56
|
-
tone: "warning"
|
|
57
|
-
});
|
|
58
|
-
} finally {
|
|
59
|
-
y(!1);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}, O = async () => {
|
|
63
|
-
try {
|
|
64
|
-
await l.api.request("/guest/resend", { method: "POST" }), x({ text: i("verifyResent") }), E(f);
|
|
65
|
-
} catch (t) {
|
|
66
|
-
x({
|
|
67
|
-
text: t instanceof e && t.status === 429 ? i("verifyWait") : i("errorGeneric"),
|
|
68
|
-
tone: "warning"
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
return /* @__PURE__ */ n("div", {
|
|
73
|
-
class: "ck-card",
|
|
74
|
-
style: o({
|
|
75
|
-
x: innerWidth / 2 - 190,
|
|
76
|
-
y: 80
|
|
77
|
-
}),
|
|
78
|
-
role: "dialog",
|
|
79
|
-
"aria-labelledby": "ck-verify-title",
|
|
80
|
-
"data-commentkit-ui": !0,
|
|
81
|
-
onKeyDown: (e) => e.key === "Escape" && h(),
|
|
82
|
-
children: [
|
|
83
|
-
/* @__PURE__ */ n("div", {
|
|
84
|
-
class: "ck-card-head",
|
|
85
|
-
children: [/* @__PURE__ */ n("h2", {
|
|
86
|
-
class: "ck-card-title",
|
|
87
|
-
id: "ck-verify-title",
|
|
88
|
-
children: i("verifyTitle")
|
|
89
|
-
}), /* @__PURE__ */ n("button", {
|
|
90
|
-
class: "ck-ghost",
|
|
91
|
-
"aria-label": i("close"),
|
|
92
|
-
onClick: h,
|
|
93
|
-
children: /* @__PURE__ */ n(c, { name: "close" })
|
|
94
|
-
})]
|
|
95
|
-
}),
|
|
96
|
-
/* @__PURE__ */ n("div", {
|
|
97
|
-
class: "ck-card-body",
|
|
98
|
-
children: [
|
|
99
|
-
/* @__PURE__ */ n("p", {
|
|
100
|
-
class: "ck-verify-text",
|
|
101
|
-
children: i("verifyBody", { email: u })
|
|
102
|
-
}),
|
|
103
|
-
/* @__PURE__ */ n("label", {
|
|
104
|
-
class: "ck-field",
|
|
105
|
-
children: [/* @__PURE__ */ n("span", { children: i("verifyCode") }), /* @__PURE__ */ n("input", {
|
|
106
|
-
ref: w,
|
|
107
|
-
class: "ck-input ck-code",
|
|
108
|
-
inputMode: "numeric",
|
|
109
|
-
autoComplete: "one-time-code",
|
|
110
|
-
pattern: "[0-9]*",
|
|
111
|
-
maxLength: 6,
|
|
112
|
-
value: g,
|
|
113
|
-
onInput: (e) => {
|
|
114
|
-
let t = e.target.value.replace(/\D/g, "").slice(0, 6);
|
|
115
|
-
_(t), b?.tone && x(null), t.length === 6 && t !== g && D(t);
|
|
116
|
-
},
|
|
117
|
-
onKeyDown: (e) => {
|
|
118
|
-
e.stopPropagation(), e.key === "Enter" && D(), e.key === "Escape" && h();
|
|
119
|
-
}
|
|
120
|
-
})]
|
|
121
|
-
}),
|
|
122
|
-
b ? /* @__PURE__ */ n("div", {
|
|
123
|
-
class: "ck-note",
|
|
124
|
-
role: b.tone ? "alert" : "status",
|
|
125
|
-
"data-tone": b.tone,
|
|
126
|
-
children: b.text
|
|
127
|
-
}) : null,
|
|
128
|
-
S ? null : /* @__PURE__ */ n("div", {
|
|
129
|
-
class: "ck-actions",
|
|
130
|
-
children: [/* @__PURE__ */ n("button", {
|
|
131
|
-
class: "ck-chip",
|
|
132
|
-
disabled: T > 0,
|
|
133
|
-
onClick: () => void O(),
|
|
134
|
-
children: T > 0 ? i("verifyResendIn", { n: T }) : i("verifyResend")
|
|
135
|
-
}), /* @__PURE__ */ n("button", {
|
|
136
|
-
class: "ck-chip",
|
|
137
|
-
onClick: () => {
|
|
138
|
-
l.auth.setPending(null), m();
|
|
139
|
-
},
|
|
140
|
-
children: i("verifyDifferent")
|
|
141
|
-
})]
|
|
142
|
-
})
|
|
143
|
-
]
|
|
144
|
-
}),
|
|
145
|
-
/* @__PURE__ */ n("div", {
|
|
146
|
-
class: "ck-card-foot",
|
|
147
|
-
children: [/* @__PURE__ */ n("span", { class: "ck-spacer" }), S === "again" ? /* @__PURE__ */ n("button", {
|
|
148
|
-
class: "ck-btn ck-primary",
|
|
149
|
-
onClick: m,
|
|
150
|
-
children: i("writeAgain")
|
|
151
|
-
}) : S === "stop" ? /* @__PURE__ */ n("button", {
|
|
152
|
-
class: "ck-btn",
|
|
153
|
-
onClick: h,
|
|
154
|
-
children: i("close")
|
|
155
|
-
}) : /* @__PURE__ */ n("button", {
|
|
156
|
-
class: "ck-btn ck-primary",
|
|
157
|
-
disabled: v || g.length !== 6,
|
|
158
|
-
onClick: () => void D(),
|
|
159
|
-
children: i(v ? "sending" : "verifyPublish")
|
|
160
|
-
})]
|
|
161
|
-
})
|
|
162
|
-
]
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
var f = 60;
|
|
166
|
-
function p(t) {
|
|
167
|
-
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;
|
|
168
|
-
}
|
|
169
|
-
//#endregion
|
|
170
|
-
export { d as GuestVerify, u as startGuest };
|