@commentkit/comment-kit 2.1.0 → 2.1.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 (62) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/npm/chunks/{AgentSend-pA7Ufvye.js → AgentSend-B4rxdY68.js} +3 -3
  3. package/dist/npm/chunks/{Checklist-Cn9skOYK.js → Checklist-Cy68X5qC.js} +8 -8
  4. package/dist/npm/chunks/{Composer-D7H-pzGa.js → Composer-D65l6Jg4.js} +33 -33
  5. package/dist/npm/chunks/{DatePicker-Nta5a1xD.js → DatePicker-BPzzqW3f.js} +3 -3
  6. package/dist/npm/chunks/{Guest-Bi7hlzhs.js → Guest-C-ZhARI0.js} +5 -5
  7. package/dist/npm/chunks/{MarkupEditor-WU3USeTk.js → MarkupEditor-BOb2jFTR.js} +8 -8
  8. package/dist/npm/chunks/{Panel-DhAzbUbC.js → Panel-DgdCgaC-.js} +267 -267
  9. package/dist/npm/chunks/{Settings-BmKqPX40.js → Settings-BbWu2Rd5.js} +18 -18
  10. package/dist/npm/chunks/{Shortcuts-Bl-c0Sez.js → Shortcuts-C5wEx-Mq.js} +4 -4
  11. package/dist/npm/chunks/SignInFirst-BlMbutED.js +36 -0
  12. package/dist/npm/chunks/{StyleEditor-D6fUnlwq.js → StyleEditor-BN2z7mUs.js} +4 -4
  13. package/dist/npm/chunks/{StylePanel-C-Gikxt1.js → StylePanel-BZk-r-kl.js} +3 -3
  14. package/dist/npm/chunks/{TaskFields-CaKi523b.js → TaskFields-B2-YvIwV.js} +21 -21
  15. package/dist/npm/chunks/{ThreadCard-d_3pUB5V.js → ThreadCard-xKy4JbXK.js} +46 -46
  16. package/dist/npm/chunks/{Viewer-BULQsi9-.js → Viewer-DL6M3wAT.js} +3 -3
  17. package/dist/npm/chunks/{agent-DHdhIJ3s.js → agent-D1VQvc14.js} +12 -12
  18. package/dist/npm/chunks/{ar-B5UszrQp.js → ar-DtfC6tHi.js} +2 -0
  19. package/dist/npm/chunks/{card-bits-cV8GdFWX.js → card-bits-B94SwnS9.js} +5 -5
  20. package/dist/npm/chunks/{client-Cv8ddtuM.js → client-CULjcQxz.js} +7 -7
  21. package/dist/npm/chunks/{confetti-B9zlyILU.js → confetti-K_xKxQGa.js} +1 -1
  22. package/dist/npm/chunks/{context-CsHnabaA.js → context-0MfEgoip.js} +1 -1
  23. package/dist/npm/chunks/{de-BE0Aaq8u.js → de-CSyX5Cz-.js} +2 -0
  24. package/dist/npm/chunks/{dpop-CwW9ifkq.js → dpop-DpxIN5kL.js} +1 -1
  25. package/dist/npm/chunks/{entrance-Bn_5M9uO.js → entrance-CO0AzUKy.js} +1 -1
  26. package/dist/npm/chunks/{es-BQviao4d.js → es-D7SAi7fz.js} +2 -0
  27. package/dist/npm/chunks/{extension-DXhz81XD.js → extension-DpfiPOjC.js} +1 -1
  28. package/dist/npm/chunks/{extension-CnQTDC1j.js → extension-faFfCApb.js} +2 -2
  29. package/dist/npm/chunks/{files-DLEr_wmh.js → files-BkHuRlcW.js} +2 -2
  30. package/dist/npm/chunks/{fr-C5gu6A06.js → fr-CIr2nUyu.js} +2 -0
  31. package/dist/npm/chunks/{hi-DXfQ5EvY.js → hi-BTocxOL5.js} +2 -0
  32. package/dist/npm/chunks/{i18n-Mgs9VOuk.js → i18n-CDw_D17c.js} +10 -10
  33. package/dist/npm/chunks/{icons-_C6ZWmBY.js → icons-BJLm_C0M.js} +1 -1
  34. package/dist/npm/chunks/{identify-BnQGJOa0.js → identify-963WDKul.js} +1 -1
  35. package/dist/npm/chunks/{it-BPHt13FV.js → it-DCExRo0r.js} +2 -0
  36. package/dist/npm/chunks/{ja-BkCqyKR0.js → ja-CgWpTdWi.js} +2 -0
  37. package/dist/npm/chunks/{late-words-D4Oo_yhJ.js → late-words-QnNheaDY.js} +2 -0
  38. package/dist/npm/chunks/{live-DXcxj_Af.js → live-BI72WQBA.js} +24 -22
  39. package/dist/npm/chunks/{nl-DZxdLLMU.js → nl-DhTQ8oJ_.js} +2 -0
  40. package/dist/npm/chunks/{page-key-UqAozdZi.js → page-key-CW8Mtf60.js} +1 -1
  41. package/dist/npm/chunks/{pick-C20RVUas.js → pick-BRhngGMq.js} +1 -1
  42. package/dist/npm/chunks/{pkce-BPvWoBrr.js → pkce-BEeLAZhN.js} +1 -1
  43. package/dist/npm/chunks/{pt-BR-lA9mJ05F.js → pt-BR-DrO6LV4n.js} +2 -0
  44. package/dist/npm/chunks/{report-BjUgUNnT.js → report-DAzQvgUh.js} +1 -1
  45. package/dist/npm/chunks/{show-BinoJyED.js → show-Ka3g4eCJ.js} +7 -7
  46. package/dist/npm/chunks/{signin-C2jjsxz9.js → signin-Car5vP1U.js} +3 -3
  47. package/dist/npm/chunks/{source-NuflODx3.js → source-dd_it90W.js} +1 -1
  48. package/dist/npm/chunks/{src-9o2Ocq8d.js → src-fTYV50pw.js} +7 -7
  49. package/dist/npm/chunks/{start-Cbx6rMrr.js → start-CE5eR33Z.js} +461 -449
  50. package/dist/npm/chunks/{upload-C4NpM-jE.js → upload-Dcv9CCly.js} +1 -1
  51. package/dist/npm/chunks/{uploads-CY4bDbaI.js → uploads-CmeoNVO2.js} +196 -196
  52. package/dist/npm/chunks/wrap-B0mzrRhc.js +69 -0
  53. package/dist/npm/chunks/{zh-CN-yqaDHwBx.js → zh-CN-Bb8UzT1V.js} +2 -0
  54. package/dist/npm/element.js +1 -1
  55. package/dist/npm/headless.js +2 -2
  56. package/dist/npm/index.js +2 -2
  57. package/dist/npm/react.js +1 -1
  58. package/dist/npm/svelte.js +1 -1
  59. package/dist/npm/vue.js +1 -1
  60. package/package.json +1 -1
  61. package/dist/npm/chunks/SignInFirst-CmGvSYkQ.js +0 -35
  62. package/dist/npm/chunks/wrap-D-xTKIzj.js +0 -69
@@ -0,0 +1,69 @@
1
+ import { B as e, R as t, U as n, V as r } from "./start-CE5eR33Z.js";
2
+ // src/capture/wrap.ts
3
+ var i = 20, a = 200;
4
+ function o(e) {
5
+ try {
6
+ if (e instanceof Error) return `${e.name}: ${e.message}`.slice(0, 1e3);
7
+ if (typeof e == "string") return e.slice(0, 1e3);
8
+ if (!e || typeof e != "object") return String(e);
9
+ let t = Array.isArray(e), n = t ? Array.from({ length: Math.min(e.length, i) }, (e, t) => t) : Object.keys(e).slice(0, i), r = t ? [] : {};
10
+ for (let t of n) {
11
+ let n = e[t];
12
+ r[t] = typeof n == "string" ? n.slice(0, a) : typeof n == "bigint" ? String(n) : n && typeof n == "object" ? Array.isArray(n) ? "[Array]" : "[Object]" : n;
13
+ }
14
+ return JSON.stringify(r).slice(0, 500);
15
+ } catch {
16
+ return "[unreadable]";
17
+ }
18
+ }
19
+ function s(r, i) {
20
+ try {
21
+ e(t, {
22
+ level: r,
23
+ message: n(i()),
24
+ at: (/* @__PURE__ */ new Date()).toISOString()
25
+ });
26
+ } catch {}
27
+ }
28
+ function c(e) {
29
+ let t = [], n = !0, a = (e, n, r) => {
30
+ let i = e[n], a = r(i);
31
+ e[n] = a, t.push(() => {
32
+ e[n] === a && (e[n] = i);
33
+ });
34
+ };
35
+ if (e.console) {
36
+ for (let e of ["error", "warn"]) a(console, e, (t) => (...r) => {
37
+ n && s(e, () => r.slice(0, i).map(o).join(" ")), t.apply(console, r);
38
+ });
39
+ let e = (e) => s("error", () => e.message || o(e.error)), r = (e) => s("error", () => `Unhandled promise rejection: ${o(e.reason)}`);
40
+ addEventListener("error", e), addEventListener("unhandledrejection", r), t.push(() => removeEventListener("error", e), () => removeEventListener("unhandledrejection", r));
41
+ }
42
+ if (e.network && typeof fetch == "function" && a(window, "fetch", (e) => async (...t) => {
43
+ if (!n) return e(...t);
44
+ let i = performance.now(), a = (t[1]?.method ?? (t[0] instanceof Request ? t[0].method : "GET")).toUpperCase(), o = t[0] instanceof Request ? t[0].url : String(t[0]);
45
+ try {
46
+ let n = await e(...t);
47
+ return n.status >= 400 && r(a, o, n.status, i), n;
48
+ } catch (e) {
49
+ throw r(a, o, 0, i), e;
50
+ }
51
+ }), e.network && typeof XMLHttpRequest == "function") {
52
+ let e = /* @__PURE__ */ new WeakMap();
53
+ a(XMLHttpRequest.prototype, "open", (t) => function(r, i, ...a) {
54
+ return n && e.set(this, {
55
+ method: String(r).toUpperCase(),
56
+ url: String(i)
57
+ }), t.call(this, r, i, ...a);
58
+ }), a(XMLHttpRequest.prototype, "send", (t) => function(i) {
59
+ let a = e.get(this), o = performance.now();
60
+ return a && this.addEventListener("loadend", () => {
61
+ n && (this.status >= 400 || this.status === 0) && r(a.method, a.url, this.status, o);
62
+ }, { once: !0 }), t.call(this, i);
63
+ });
64
+ }
65
+ return () => {
66
+ n = !1, t.forEach((e) => e());
67
+ };
68
+ }
69
+ export { c as wrap };
@@ -442,6 +442,8 @@ var e = {
442
442
  signInToComment: "登录后评论",
443
443
  signInToCommentBody: "{website} 上的评论仅供其团队和受邀客户使用。请用你的 CommentKit 账户登录,然后点击需要修改的位置。",
444
444
  signInToCommentBodyTouch: "{website} 上的评论仅供其团队和受邀客户使用。请用你的 CommentKit 账户登录,然后轻点需要修改的位置。",
445
+ signInToSeeComments: "登录后查看评论",
446
+ signInToSeeCommentsBody: "{website} 上的评论来自其团队和受邀客户。请用你的 CommentKit 账户登录后查看。",
445
447
  signInToSend: "登录后发送",
446
448
  signInToSendTitle: "登录后发送此评论",
447
449
  signInToSendBody: "此网站上的评论来自其团队和受邀客户。登录期间,你的文字会保留在这里。"
@@ -1,4 +1,4 @@
1
- import { t as e } from "./chunks/src-9o2Ocq8d.js";
1
+ import { t as e } from "./chunks/src-fTYV50pw.js";
2
2
  // src/element.ts
3
3
  var t, n = [
4
4
  "screenshots",
@@ -1,7 +1,7 @@
1
- import { h as e, i as t, l as n, m as r, o as i, r as a, t as o, v as s } from "./chunks/client-Cv8ddtuM.js";
1
+ import { h as e, i as t, l as n, m as r, o as i, r as a, t as o, v as s } from "./chunks/client-CULjcQxz.js";
2
2
  import { i as c } from "./chunks/privacy-BWUGlHw5.js";
3
3
  import { c as l, s as u, t as d } from "./chunks/anchor-BsQNVkHj.js";
4
4
  import { n as f } from "./chunks/context-BuMl7A07.js";
5
- import { n as p, t as m } from "./chunks/page-key-UqAozdZi.js";
5
+ import { n as p, t as m } from "./chunks/page-key-CW8Mtf60.js";
6
6
  f(), n(p);
7
7
  export { e as ApiClient, r as AuthManager, o as CommentKitClient, s as CommentKitError, a as EDIT_CONFLICT, t as SDK_VERSION, c as configurePrivacy, d as createAnchor, i as currentPageUrl, m as pageKey, u as resolveAnchor, l as stableSelector };
package/dist/npm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as e } from "./chunks/src-9o2Ocq8d.js";
2
- import { i as t, v as n } from "./chunks/client-Cv8ddtuM.js";
1
+ import { t as e } from "./chunks/src-fTYV50pw.js";
2
+ import { i as t, v as n } from "./chunks/client-CULjcQxz.js";
3
3
  export { n as CommentKitError, t as SDK_VERSION, e as init };
package/dist/npm/react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as e } from "./chunks/src-9o2Ocq8d.js";
2
+ import { t as e } from "./chunks/src-fTYV50pw.js";
3
3
  import { useEffect as t, useRef as n } from "react";
4
4
  // src/adapters/react.tsx
5
5
  function r(r) {
@@ -1,4 +1,4 @@
1
- import { t as e } from "./chunks/src-9o2Ocq8d.js";
1
+ import { t as e } from "./chunks/src-fTYV50pw.js";
2
2
  // src/adapters/svelte.ts
3
3
  var t = (e) => JSON.stringify([
4
4
  e?.project,
package/dist/npm/vue.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./chunks/src-9o2Ocq8d.js";
1
+ import { t as e } from "./chunks/src-fTYV50pw.js";
2
2
  import { defineComponent as t, onBeforeUnmount as n, onMounted as r, watch as i } from "vue";
3
3
  // src/adapters/vue.ts
4
4
  function a(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commentkit/comment-kit",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Figma-style comments for any website. Clients pin feedback with an automatic screenshot; developers see it on localhost and hand it to their AI agent.",
5
5
  "keywords": [
6
6
  "comments",
@@ -1,35 +0,0 @@
1
- import { b as e, c as t, f as n, m as r, r as i, u as a } from "./i18n-Mgs9VOuk.js";
2
- import { t as o } from "./late-words-D4Oo_yhJ.js";
3
- import { i as s } from "./drafts-B0ctr1g9.js";
4
- import { n as c, u as l } from "./start-Cbx6rMrr.js";
5
- // src/ui/SignInFirst.tsx
6
- Object.assign(i, o);
7
- function u({ position: i, website: o, signIn: u, onSignedIn: d, onDismiss: f }) {
8
- let p = r(null), m = r(null), h = () => p.current?.nextElementSibling?.querySelector(".ck-primary");
9
- n(() => {
10
- let e = p.current?.getRootNode();
11
- m.current = e?.activeElement ?? null, h()?.focus({ preventScroll: !0 });
12
- }, []);
13
- let g = async () => {
14
- s(l, String(Date.now()));
15
- let e = await u();
16
- if (e !== "redirecting" && s(l, null), e === "signed_in") return d();
17
- h()?.focus({ preventScroll: !0 });
18
- };
19
- return /* @__PURE__ */ a(e, { children: [/* @__PURE__ */ a("span", {
20
- ref: p,
21
- hidden: !0
22
- }), /* @__PURE__ */ a(c, {
23
- id: "ck-signin-first-title",
24
- position: i,
25
- title: t("signInToComment"),
26
- body: t(matchMedia("(pointer: coarse)").matches ? "signInToCommentBodyTouch" : "signInToCommentBody", { website: o }),
27
- primary: t("signInMember"),
28
- secondary: t("notNow"),
29
- onPrimary: () => void g(),
30
- onSecondary: () => {
31
- m.current?.isConnected && m.current.focus({ preventScroll: !0 }), f();
32
- }
33
- })] });
34
- }
35
- export { u as SignInFirst };
@@ -1,69 +0,0 @@
1
- import { B as e, H as t, L as n, z as r } from "./start-Cbx6rMrr.js";
2
- // src/capture/wrap.ts
3
- var i = 20, a = 200;
4
- function o(e) {
5
- try {
6
- if (e instanceof Error) return `${e.name}: ${e.message}`.slice(0, 1e3);
7
- if (typeof e == "string") return e.slice(0, 1e3);
8
- if (!e || typeof e != "object") return String(e);
9
- let t = Array.isArray(e), n = t ? Array.from({ length: Math.min(e.length, i) }, (e, t) => t) : Object.keys(e).slice(0, i), r = t ? [] : {};
10
- for (let t of n) {
11
- let n = e[t];
12
- r[t] = typeof n == "string" ? n.slice(0, a) : typeof n == "bigint" ? String(n) : n && typeof n == "object" ? Array.isArray(n) ? "[Array]" : "[Object]" : n;
13
- }
14
- return JSON.stringify(r).slice(0, 500);
15
- } catch {
16
- return "[unreadable]";
17
- }
18
- }
19
- function s(e, i) {
20
- try {
21
- r(n, {
22
- level: e,
23
- message: t(i()),
24
- at: (/* @__PURE__ */ new Date()).toISOString()
25
- });
26
- } catch {}
27
- }
28
- function c(t) {
29
- let n = [], r = !0, a = (e, t, r) => {
30
- let i = e[t], a = r(i);
31
- e[t] = a, n.push(() => {
32
- e[t] === a && (e[t] = i);
33
- });
34
- };
35
- if (t.console) {
36
- for (let e of ["error", "warn"]) a(console, e, (t) => (...n) => {
37
- r && s(e, () => n.slice(0, i).map(o).join(" ")), t.apply(console, n);
38
- });
39
- let e = (e) => s("error", () => e.message || o(e.error)), t = (e) => s("error", () => `Unhandled promise rejection: ${o(e.reason)}`);
40
- addEventListener("error", e), addEventListener("unhandledrejection", t), n.push(() => removeEventListener("error", e), () => removeEventListener("unhandledrejection", t));
41
- }
42
- if (t.network && typeof fetch == "function" && a(window, "fetch", (t) => async (...n) => {
43
- if (!r) return t(...n);
44
- let i = performance.now(), a = (n[1]?.method ?? (n[0] instanceof Request ? n[0].method : "GET")).toUpperCase(), o = n[0] instanceof Request ? n[0].url : String(n[0]);
45
- try {
46
- let r = await t(...n);
47
- return r.status >= 400 && e(a, o, r.status, i), r;
48
- } catch (t) {
49
- throw e(a, o, 0, i), t;
50
- }
51
- }), t.network && typeof XMLHttpRequest == "function") {
52
- let t = /* @__PURE__ */ new WeakMap();
53
- a(XMLHttpRequest.prototype, "open", (e) => function(n, i, ...a) {
54
- return r && t.set(this, {
55
- method: String(n).toUpperCase(),
56
- url: String(i)
57
- }), e.call(this, n, i, ...a);
58
- }), a(XMLHttpRequest.prototype, "send", (n) => function(i) {
59
- let a = t.get(this), o = performance.now();
60
- return a && this.addEventListener("loadend", () => {
61
- r && (this.status >= 400 || this.status === 0) && e(a.method, a.url, this.status, o);
62
- }, { once: !0 }), n.call(this, i);
63
- });
64
- }
65
- return () => {
66
- r = !1, n.forEach((e) => e());
67
- };
68
- }
69
- export { c as wrap };