@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.
Files changed (66) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/npm/chunks/{AgentSend-pA7Ufvye.js → AgentSend-DhG61w_r.js} +3 -3
  3. package/dist/npm/chunks/{Checklist-Cn9skOYK.js → Checklist-C2q5KzWe.js} +9 -8
  4. package/dist/npm/chunks/{Composer-D7H-pzGa.js → Composer-Dj0YAYOR.js} +32 -31
  5. package/dist/npm/chunks/{DatePicker-Nta5a1xD.js → DatePicker-TshUaQHj.js} +3 -3
  6. package/dist/npm/chunks/{Guest-Bi7hlzhs.js → Guest-bAxvxjbL.js} +6 -5
  7. package/dist/npm/chunks/{MarkupEditor-WU3USeTk.js → MarkupEditor-DnViTOOC.js} +9 -8
  8. package/dist/npm/chunks/{Panel-DhAzbUbC.js → Panel-C3_NURrp.js} +287 -286
  9. package/dist/npm/chunks/{Settings-BmKqPX40.js → Settings-BM7pWbwd.js} +19 -18
  10. package/dist/npm/chunks/{Shortcuts-Bl-c0Sez.js → Shortcuts-CFDTnP5H.js} +6 -6
  11. package/dist/npm/chunks/SignInFirst-CeiPhLx0.js +36 -0
  12. package/dist/npm/chunks/{StyleEditor-D6fUnlwq.js → StyleEditor-BUZrhAY6.js} +4 -4
  13. package/dist/npm/chunks/{StylePanel-C-Gikxt1.js → StylePanel-CFp-U7qa.js} +3 -3
  14. package/dist/npm/chunks/TaskFields-C4GddJTi.js +652 -0
  15. package/dist/npm/chunks/{ThreadCard-d_3pUB5V.js → ThreadCard-CwClbMNh.js} +48 -47
  16. package/dist/npm/chunks/{Viewer-BULQsi9-.js → Viewer-oM3stPeq.js} +3 -3
  17. package/dist/npm/chunks/{agent-DHdhIJ3s.js → agent-DfUu5BAp.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-BXOCnmcQ.js} +5 -5
  20. package/dist/npm/chunks/{client-Cv8ddtuM.js → client-BqcfSisZ.js} +7 -7
  21. package/dist/npm/chunks/{confetti-B9zlyILU.js → confetti-CM1XHlrM.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-CHzhM9ud.js} +1 -1
  25. package/dist/npm/chunks/{entrance-Bn_5M9uO.js → entrance-D7kmBxF3.js} +29 -29
  26. package/dist/npm/chunks/{es-BQviao4d.js → es-D7SAi7fz.js} +2 -0
  27. package/dist/npm/chunks/{extension-DXhz81XD.js → extension-PWW2UQD7.js} +1 -1
  28. package/dist/npm/chunks/{extension-CnQTDC1j.js → extension-TF7pIF_W.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-CoQ4rxaI.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-HKWO5Tsg.js} +23 -21
  39. package/dist/npm/chunks/{nl-DZxdLLMU.js → nl-DhTQ8oJ_.js} +2 -0
  40. package/dist/npm/chunks/{page-key-UqAozdZi.js → page-key-z6o1r8Uu.js} +1 -1
  41. package/dist/npm/chunks/{pick-C20RVUas.js → pick-Bai3lMZX.js} +1 -1
  42. package/dist/npm/chunks/{pkce-BPvWoBrr.js → pkce-B6VU0dtv.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-D-yxx5uK.js} +1 -1
  45. package/dist/npm/chunks/sheet-77GHVTpR.js +18 -0
  46. package/dist/npm/chunks/{show-BinoJyED.js → show-C3bJFyaD.js} +12 -10
  47. package/dist/npm/chunks/{signin-C2jjsxz9.js → signin-Bq2KYFLY.js} +3 -3
  48. package/dist/npm/chunks/{source-NuflODx3.js → source-W_nJm3Ym.js} +1 -1
  49. package/dist/npm/chunks/{src-9o2Ocq8d.js → src-BFu9DgRc.js} +57 -52
  50. package/dist/npm/chunks/{start-Cbx6rMrr.js → start-Dgw3mSp8.js} +524 -513
  51. package/dist/npm/chunks/{upload-C4NpM-jE.js → upload-b0nY04eW.js} +1 -1
  52. package/dist/npm/chunks/{uploads-CY4bDbaI.js → uploads-Df4mLJ9O.js} +199 -198
  53. package/dist/npm/chunks/waiting-BRtT3ZZT.js +54 -0
  54. package/dist/npm/chunks/wrap-BuWw3zAq.js +69 -0
  55. package/dist/npm/chunks/{zh-CN-yqaDHwBx.js → zh-CN-Bb8UzT1V.js} +2 -0
  56. package/dist/npm/element.js +1 -1
  57. package/dist/npm/headless.js +2 -2
  58. package/dist/npm/index.js +2 -2
  59. package/dist/npm/react.js +1 -1
  60. package/dist/npm/svelte.js +1 -1
  61. package/dist/npm/types/core/client.d.ts +2 -0
  62. package/dist/npm/vue.js +1 -1
  63. package/package.json +1 -1
  64. package/dist/npm/chunks/SignInFirst-CmGvSYkQ.js +0 -35
  65. package/dist/npm/chunks/TaskFields-CaKi523b.js +0 -617
  66. package/dist/npm/chunks/wrap-D-xTKIzj.js +0 -69
@@ -0,0 +1,54 @@
1
+ var e = {
2
+ ar: "جارٍ التحميل…",
3
+ de: "Wird geladen…",
4
+ es: "Cargando…",
5
+ fr: "Chargement…",
6
+ hi: "लोड हो रहा है…",
7
+ it: "Caricamento…",
8
+ ja: "読み込み中…",
9
+ nl: "Laden…",
10
+ pt: "Carregando…",
11
+ zh: "加载中…"
12
+ };
13
+ function t(e) {
14
+ try {
15
+ return localStorage.getItem("commentkit:theme") || e.theme;
16
+ } catch {
17
+ return e.theme;
18
+ }
19
+ }
20
+ function n(n, r = performance.now()) {
21
+ let i, a = setTimeout(() => {
22
+ try {
23
+ let r = n.position;
24
+ try {
25
+ r = localStorage.getItem("commentkit:dock") || r;
26
+ } catch {}
27
+ let [, a = "bottom", o = "right"] = /^(top|bottom)-(left|center|right)$/.exec(r) ?? [], s = e[(n.locale || document.documentElement.lang || navigator.language).slice(0, 2)], c = (e, t = "") => `calc(20px + var(--commentkit-inset-${e},${Number(n.inset?.[e]) || 0}px)${t})`, l = t(n), u = "p{display:flex;align-items:center;gap:8px;margin:0;padding:15px 16px;border-radius:99px;font:600 13px/16px system-ui,sans-serif;background:#fff;color:#121316;box-shadow:0 0 0 1px #8884,0 8px 24px #0002}i{width:8px;height:8px;border-radius:50%;background:currentColor;animation:p .8s infinite alternate}@keyframes p{to{opacity:.3}}" + (l == "light" ? "" : `@media ${l == "dark" ? "all" : "(prefers-color-scheme:dark)"}{p{background:#212126;color:#fff}}`) + "@media(prefers-reduced-motion){i{display:none}}";
28
+ i = document.createElement("div"), i.setAttribute("data-commentkit-wait", "");
29
+ let d = [
30
+ ["all", "initial"],
31
+ ["position", "fixed"],
32
+ ["z-index", "2147483000"],
33
+ [a, c("y", a > "c" ? " + env(safe-area-inset-bottom,0px)" : "")]
34
+ ];
35
+ d.push(o > "l" ? [o, c("x")] : ["left", "50%"], ["translate", o > "l" ? "none" : "-50%"]);
36
+ for (let [e, t] of d) i.style.setProperty(e, t, "important");
37
+ let f = i.attachShadow({ mode: "open" });
38
+ if ("adoptedStyleSheets" in f && "replaceSync" in CSSStyleSheet.prototype) {
39
+ let e = new CSSStyleSheet();
40
+ e.replaceSync(u), f.adoptedStyleSheets = [e];
41
+ } else f.appendChild(document.createElement("style")).textContent = u;
42
+ let p = f.appendChild(document.createElement("p"));
43
+ p.setAttribute("role", "status"), p.dir = "auto", p.append(document.createElement("i"), s || "Loading…"), document.documentElement.append(i);
44
+ } catch {
45
+ i = void 0;
46
+ }
47
+ }, 120 - (performance.now() - r));
48
+ return () => {
49
+ clearTimeout(a);
50
+ let e = !!i?.isConnected;
51
+ return i?.remove(), i = void 0, e;
52
+ };
53
+ }
54
+ export { n as waiting };
@@ -0,0 +1,69 @@
1
+ import { B as e, R as t, U as n, V as r } from "./start-Dgw3mSp8.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-BFu9DgRc.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-BqcfSisZ.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-z6o1r8Uu.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-BFu9DgRc.js";
2
+ import { i as t, v as n } from "./chunks/client-BqcfSisZ.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-BFu9DgRc.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-BFu9DgRc.js";
2
2
  // src/adapters/svelte.ts
3
3
  var t = (e) => JSON.stringify([
4
4
  e?.project,
@@ -86,6 +86,8 @@ export declare class CommentKitClient {
86
86
  readonly endpoint: string;
87
87
  /** Shown by Cmd/Ctrl+Shift+K (index.ts): the widget's entrance leads the eye to it (ui/entrance.ts). Read once by the UI. */
88
88
  entrance?: "key";
89
+ /** Removes the "Loading…" of a key press (waiting.ts) and says whether it was on screen; set until the toolbar shows. */
90
+ wait?: () => boolean;
89
91
  private configTag;
90
92
  /** Last known ETag per thread and per message, sent as If-Match with edits. */
91
93
  private tags;
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-BFu9DgRc.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.2",
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 };