@commentkit/comment-kit 2.1.0 → 2.1.2
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 +17 -0
- package/dist/npm/chunks/{AgentSend-pA7Ufvye.js → AgentSend-DhG61w_r.js} +3 -3
- package/dist/npm/chunks/{Checklist-Cn9skOYK.js → Checklist-C2q5KzWe.js} +9 -8
- package/dist/npm/chunks/{Composer-D7H-pzGa.js → Composer-Dj0YAYOR.js} +32 -31
- package/dist/npm/chunks/{DatePicker-Nta5a1xD.js → DatePicker-TshUaQHj.js} +3 -3
- package/dist/npm/chunks/{Guest-Bi7hlzhs.js → Guest-bAxvxjbL.js} +6 -5
- package/dist/npm/chunks/{MarkupEditor-WU3USeTk.js → MarkupEditor-DnViTOOC.js} +9 -8
- package/dist/npm/chunks/{Panel-DhAzbUbC.js → Panel-C3_NURrp.js} +287 -286
- package/dist/npm/chunks/{Settings-BmKqPX40.js → Settings-BM7pWbwd.js} +19 -18
- package/dist/npm/chunks/{Shortcuts-Bl-c0Sez.js → Shortcuts-CFDTnP5H.js} +6 -6
- package/dist/npm/chunks/SignInFirst-CeiPhLx0.js +36 -0
- package/dist/npm/chunks/{StyleEditor-D6fUnlwq.js → StyleEditor-BUZrhAY6.js} +4 -4
- package/dist/npm/chunks/{StylePanel-C-Gikxt1.js → StylePanel-CFp-U7qa.js} +3 -3
- package/dist/npm/chunks/TaskFields-C4GddJTi.js +652 -0
- package/dist/npm/chunks/{ThreadCard-d_3pUB5V.js → ThreadCard-CwClbMNh.js} +48 -47
- package/dist/npm/chunks/{Viewer-BULQsi9-.js → Viewer-oM3stPeq.js} +3 -3
- package/dist/npm/chunks/{agent-DHdhIJ3s.js → agent-DfUu5BAp.js} +12 -12
- package/dist/npm/chunks/{ar-B5UszrQp.js → ar-DtfC6tHi.js} +2 -0
- package/dist/npm/chunks/{card-bits-cV8GdFWX.js → card-bits-BXOCnmcQ.js} +5 -5
- package/dist/npm/chunks/{client-Cv8ddtuM.js → client-BqcfSisZ.js} +7 -7
- package/dist/npm/chunks/{confetti-B9zlyILU.js → confetti-CM1XHlrM.js} +1 -1
- package/dist/npm/chunks/{context-CsHnabaA.js → context-0MfEgoip.js} +1 -1
- package/dist/npm/chunks/{de-BE0Aaq8u.js → de-CSyX5Cz-.js} +2 -0
- package/dist/npm/chunks/{dpop-CwW9ifkq.js → dpop-CHzhM9ud.js} +1 -1
- package/dist/npm/chunks/{entrance-Bn_5M9uO.js → entrance-D7kmBxF3.js} +29 -29
- package/dist/npm/chunks/{es-BQviao4d.js → es-D7SAi7fz.js} +2 -0
- package/dist/npm/chunks/{extension-DXhz81XD.js → extension-PWW2UQD7.js} +1 -1
- package/dist/npm/chunks/{extension-CnQTDC1j.js → extension-TF7pIF_W.js} +2 -2
- package/dist/npm/chunks/{files-DLEr_wmh.js → files-BkHuRlcW.js} +2 -2
- package/dist/npm/chunks/{fr-C5gu6A06.js → fr-CIr2nUyu.js} +2 -0
- package/dist/npm/chunks/{hi-DXfQ5EvY.js → hi-BTocxOL5.js} +2 -0
- package/dist/npm/chunks/{i18n-Mgs9VOuk.js → i18n-CDw_D17c.js} +10 -10
- package/dist/npm/chunks/{icons-_C6ZWmBY.js → icons-BJLm_C0M.js} +1 -1
- package/dist/npm/chunks/{identify-BnQGJOa0.js → identify-CoQ4rxaI.js} +1 -1
- package/dist/npm/chunks/{it-BPHt13FV.js → it-DCExRo0r.js} +2 -0
- package/dist/npm/chunks/{ja-BkCqyKR0.js → ja-CgWpTdWi.js} +2 -0
- package/dist/npm/chunks/{late-words-D4Oo_yhJ.js → late-words-QnNheaDY.js} +2 -0
- package/dist/npm/chunks/{live-DXcxj_Af.js → live-HKWO5Tsg.js} +23 -21
- package/dist/npm/chunks/{nl-DZxdLLMU.js → nl-DhTQ8oJ_.js} +2 -0
- package/dist/npm/chunks/{page-key-UqAozdZi.js → page-key-z6o1r8Uu.js} +1 -1
- package/dist/npm/chunks/{pick-C20RVUas.js → pick-Bai3lMZX.js} +1 -1
- package/dist/npm/chunks/{pkce-BPvWoBrr.js → pkce-B6VU0dtv.js} +1 -1
- package/dist/npm/chunks/{pt-BR-lA9mJ05F.js → pt-BR-DrO6LV4n.js} +2 -0
- package/dist/npm/chunks/{report-BjUgUNnT.js → report-D-yxx5uK.js} +1 -1
- package/dist/npm/chunks/sheet-77GHVTpR.js +18 -0
- package/dist/npm/chunks/{show-BinoJyED.js → show-C3bJFyaD.js} +12 -10
- package/dist/npm/chunks/{signin-C2jjsxz9.js → signin-Bq2KYFLY.js} +3 -3
- package/dist/npm/chunks/{source-NuflODx3.js → source-W_nJm3Ym.js} +1 -1
- package/dist/npm/chunks/{src-9o2Ocq8d.js → src-BFu9DgRc.js} +57 -52
- package/dist/npm/chunks/{start-Cbx6rMrr.js → start-Dgw3mSp8.js} +524 -513
- package/dist/npm/chunks/{upload-C4NpM-jE.js → upload-b0nY04eW.js} +1 -1
- package/dist/npm/chunks/{uploads-CY4bDbaI.js → uploads-Df4mLJ9O.js} +199 -198
- package/dist/npm/chunks/waiting-BRtT3ZZT.js +54 -0
- package/dist/npm/chunks/wrap-BuWw3zAq.js +69 -0
- package/dist/npm/chunks/{zh-CN-yqaDHwBx.js → zh-CN-Bb8UzT1V.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/client.d.ts +2 -0
- package/dist/npm/vue.js +1 -1
- package/package.json +1 -1
- package/dist/npm/chunks/SignInFirst-CmGvSYkQ.js +0 -35
- package/dist/npm/chunks/TaskFields-CaKi523b.js +0 -617
- package/dist/npm/chunks/wrap-D-xTKIzj.js +0 -69
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, d as t, i as n, p as r, s as i, t as a } from "./client-
|
|
1
|
+
import { a as e, d as t, i as n, p as r, s as i, t as a } from "./client-BqcfSisZ.js";
|
|
2
2
|
// src/activation.ts
|
|
3
3
|
var o = "commentkit:active", s = "data-commentkit-extension";
|
|
4
4
|
function c() {
|
|
@@ -62,7 +62,7 @@ function S(e, t, ...n) {
|
|
|
62
62
|
b[e] || (b[e] = 1, console.warn(`[CommentKit] ${t}`, ...n));
|
|
63
63
|
}
|
|
64
64
|
function C(e, ...t) {
|
|
65
|
-
b[e] || (b[e] = 1, import("./show-
|
|
65
|
+
b[e] || (b[e] = 1, import("./show-C3bJFyaD.js").then((n) => n.explain(e, ...t)).catch(E));
|
|
66
66
|
}
|
|
67
67
|
function w() {
|
|
68
68
|
let e = (e) => typeof e == "string" && e.trim() ? e.trim().slice(0, 255) : null;
|
|
@@ -83,18 +83,23 @@ function w() {
|
|
|
83
83
|
}
|
|
84
84
|
function T(e) {
|
|
85
85
|
let t = f("signin"), n = f("code", 1);
|
|
86
|
-
if (typeof window > "u") return
|
|
86
|
+
if (typeof window > "u") return N(e);
|
|
87
87
|
try {
|
|
88
88
|
let r = t ?? e?._signin;
|
|
89
|
-
if (r != null && (v = r), y = n ?? e?._finish ?? y, _) return e?.project !== _.project && C("project", e?.project, _.project), _.client.auth.takeSignInLink(v), v = null,
|
|
90
|
-
let i =
|
|
91
|
-
return typeof i == "string" ?
|
|
89
|
+
if (r != null && (v = r), y = n ?? e?._finish ?? y, _) return e?.project !== _.project && C("project", e?.project, _.project), _.client.auth.takeSignInLink(v), v = null, A(_);
|
|
90
|
+
let i = j(e);
|
|
91
|
+
return typeof i == "string" ? N(e, i) : (_ = i, A(i));
|
|
92
92
|
} catch (t) {
|
|
93
|
-
return console.warn("[CommentKit] The widget could not start because of an error inside CommentKit; your page is not affected. See https://commentkit.dev/docs/troubleshooting", t), import("./show-
|
|
93
|
+
return console.warn("[CommentKit] The widget could not start because of an error inside CommentKit; your page is not affected. See https://commentkit.dev/docs/troubleshooting", t), import("./show-C3bJFyaD.js").then((n) => n.reportStart(e, t)).catch(E), N(e);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
var E = () => void 0
|
|
97
|
-
function
|
|
96
|
+
var E = () => void 0;
|
|
97
|
+
function D(e) {
|
|
98
|
+
let t, n, r = performance.now();
|
|
99
|
+
return import("./waiting-BRtT3ZZT.js").then((i) => n || (t = i.waiting(e, r)), E), () => (n = 1, !!t?.());
|
|
100
|
+
}
|
|
101
|
+
var O = (e) => (t) => S(e, `${e}() failed.`, t), k = (e, t) => (...n) => t(...n).then(E, O(e));
|
|
102
|
+
function A(e) {
|
|
98
103
|
e.refs++;
|
|
99
104
|
let t = !0, n = /* @__PURE__ */ new Set();
|
|
100
105
|
return {
|
|
@@ -111,84 +116,84 @@ function k(e) {
|
|
|
111
116
|
_m: e.started
|
|
112
117
|
};
|
|
113
118
|
}
|
|
114
|
-
function
|
|
119
|
+
function j(e) {
|
|
115
120
|
if (!e?.project || !t.test(e.project)) return C("key", !!e?.project), "bad project key";
|
|
116
121
|
let o = document;
|
|
117
122
|
if (o[x]) return C("copy", o[x]), "second copy";
|
|
118
123
|
let s = w(), { _key: l, _signin: f, _finish: m, identity: b, ...S } = e, T = {
|
|
119
124
|
...S,
|
|
120
125
|
...r(e.branch || s.branch, e.commit || s.commit)
|
|
121
|
-
},
|
|
122
|
-
l && (
|
|
123
|
-
let
|
|
126
|
+
}, A = new a(T), j = null, M = null, N = !1, P = !1, F = !!l;
|
|
127
|
+
l && (A.entrance = "key");
|
|
128
|
+
let I = A.auth.takeSignInLink(v) || !!(A.auth.finishLink = y);
|
|
124
129
|
v = y = null;
|
|
125
|
-
let
|
|
126
|
-
let t = () => e !==
|
|
127
|
-
n.catch(E);
|
|
130
|
+
let L = 0, R, z = (e) => (e === !0 && (P = !0), P && j?.attach?.(), N || j ? Promise.resolve() : (M ?? (M = (async (e) => {
|
|
131
|
+
let t = () => e !== L, n = g(() => import("./show-C3bJFyaD.js"));
|
|
132
|
+
n.catch(E), A.entrance && (import("./start-Dgw3mSp8.js").then((e) => e.t).catch(E), import("./entrance-D7kmBxF3.js").catch(E));
|
|
128
133
|
try {
|
|
129
|
-
let e = await
|
|
134
|
+
let e = await A.loadConfig();
|
|
130
135
|
if (t()) return;
|
|
131
|
-
|
|
136
|
+
j = await (await n).mount(A, e, I, t, B, b, () => R = setTimeout(z, 6e4)), P && j?.attach?.(), j && F && d(!0);
|
|
132
137
|
} catch (e) {
|
|
133
|
-
await n.then((t) => t.failed(
|
|
138
|
+
await n.then((t) => t.failed(A, e), O("show"));
|
|
134
139
|
} finally {
|
|
135
|
-
t() || (
|
|
140
|
+
t() || (M = null), j || (A.wait = void A.wait?.());
|
|
136
141
|
}
|
|
137
|
-
})(
|
|
138
|
-
clearTimeout(
|
|
139
|
-
},
|
|
142
|
+
})(L)), M)), B = () => {
|
|
143
|
+
clearTimeout(R), L++, P = !1, M = null, j?.(), j = null, A.wait = void A.wait?.();
|
|
144
|
+
}, V = T.toggleShortcut === !1 ? E : p(() => {
|
|
140
145
|
try {
|
|
141
|
-
return
|
|
146
|
+
return j ? (A.wait || A.state.set({ request: {
|
|
142
147
|
kind: "inbox",
|
|
143
148
|
at: Date.now()
|
|
144
|
-
} }), !0) : (
|
|
149
|
+
} }), !0) : (F = !0, A.entrance = "key", A.wait ?? (A.wait = D(A.options)), z(!0), !0);
|
|
145
150
|
} catch (e) {
|
|
146
|
-
|
|
151
|
+
O("shortcut")(e);
|
|
147
152
|
}
|
|
148
153
|
});
|
|
149
|
-
c() && import("./extension-
|
|
150
|
-
let
|
|
151
|
-
|
|
152
|
-
let
|
|
153
|
-
show: () =>
|
|
154
|
-
hide:
|
|
155
|
-
open:
|
|
156
|
-
|
|
154
|
+
c() && import("./extension-TF7pIF_W.js").then((e) => e.extensionHello()).catch(() => void 0);
|
|
155
|
+
let H = I || F || u(T.project, T.hideOnProduction ?? !0) || !!b;
|
|
156
|
+
H && !I && !F && h() >= 3 && (H = !1, C("cooling")), H && !A.auth.hasSession() && A.prefetchSignIn();
|
|
157
|
+
let U = H ? z().then(() => !!j) : Promise.resolve(!1), W = {
|
|
158
|
+
show: () => z(!0),
|
|
159
|
+
hide: B,
|
|
160
|
+
open: k("open", async (e) => {
|
|
161
|
+
A.state.set({ opening: String(e).slice(0, 64) }), await z(!0);
|
|
157
162
|
}),
|
|
158
|
-
comment:
|
|
159
|
-
e && (
|
|
163
|
+
comment: k("comment", async (e = !0) => {
|
|
164
|
+
e && (F = !0), await z(e), e && j && d(!0), A.state.set({ request: {
|
|
160
165
|
kind: e ? "comment" : "stop",
|
|
161
166
|
at: Date.now()
|
|
162
167
|
} });
|
|
163
168
|
}),
|
|
164
|
-
signIn: async () => await
|
|
165
|
-
identify: (e) => import("./identify-
|
|
166
|
-
signOut:
|
|
167
|
-
session: () => i(
|
|
169
|
+
signIn: async () => await A.signIn() === "signed_in",
|
|
170
|
+
identify: (e) => import("./identify-CoQ4rxaI.js").then((t) => t.identify(A, e, z)).catch(() => !1),
|
|
171
|
+
signOut: k("signOut", () => A.signOut()),
|
|
172
|
+
session: () => i(A.state.get().session)
|
|
168
173
|
};
|
|
169
174
|
Object.defineProperty(o, x, {
|
|
170
175
|
value: n,
|
|
171
176
|
configurable: !0
|
|
172
177
|
});
|
|
173
|
-
let
|
|
178
|
+
let G = {
|
|
174
179
|
project: T.project,
|
|
175
|
-
client:
|
|
180
|
+
client: A,
|
|
176
181
|
refs: 0,
|
|
177
|
-
started:
|
|
178
|
-
api:
|
|
182
|
+
started: U,
|
|
183
|
+
api: W,
|
|
179
184
|
destroy() {
|
|
180
|
-
|
|
185
|
+
N = !0, B(), V(), v = A.auth.signInLink, y = A.auth.finishLink, delete o[x], _ === G && (_ = null);
|
|
181
186
|
try {
|
|
182
|
-
|
|
187
|
+
A.destroy();
|
|
183
188
|
} catch (e) {
|
|
184
|
-
|
|
189
|
+
O("destroy")(e);
|
|
185
190
|
}
|
|
186
191
|
}
|
|
187
192
|
};
|
|
188
|
-
return
|
|
193
|
+
return G;
|
|
189
194
|
}
|
|
190
|
-
var
|
|
191
|
-
function
|
|
195
|
+
var M = () => new Proxy(() => Promise.resolve(), { get: (e, t) => t === "then" ? void 0 : t === Symbol.toPrimitive ? () => "" : M() });
|
|
196
|
+
function N(t, n) {
|
|
192
197
|
let r = async () => void 0, i = async () => !1, a = () => E, o = e(), s = t ?? {}, c = {
|
|
193
198
|
options: s,
|
|
194
199
|
state: {
|
|
@@ -201,7 +206,7 @@ function M(t, n) {
|
|
|
201
206
|
endpoint: String(s.endpoint ?? "https://commentkit.dev").replace(/\/+$/, "")
|
|
202
207
|
};
|
|
203
208
|
return {
|
|
204
|
-
client: new Proxy(c, { get: (e, t) => t in e ? e[t] : t === "then" ? void 0 :
|
|
209
|
+
client: new Proxy(c, { get: (e, t) => t in e ? e[t] : t === "then" ? void 0 : M() }),
|
|
205
210
|
show: r,
|
|
206
211
|
hide: E,
|
|
207
212
|
open: r,
|
|
@@ -214,7 +219,7 @@ function M(t, n) {
|
|
|
214
219
|
destroy: E,
|
|
215
220
|
...n ? { _r() {
|
|
216
221
|
let e = n && /* @__PURE__ */ Error(`init() stayed off: ${n}`);
|
|
217
|
-
n = void 0, e && import("./show-
|
|
222
|
+
n = void 0, e && import("./show-C3bJFyaD.js").then((n) => n.reportStart(t, e)).catch(E);
|
|
218
223
|
} } : {}
|
|
219
224
|
};
|
|
220
225
|
}
|