@commentkit/comment-kit 0.7.4 → 0.7.5

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 (49) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +2 -2
  3. package/SECURITY.md +1 -1
  4. package/dist/angular.es.js +2 -2
  5. package/dist/comment-kit.es.js +3 -3
  6. package/dist/demo.es.js +24 -15
  7. package/dist/headless.es.js +2 -2
  8. package/dist/preact.es.js +2 -2
  9. package/dist/qwik.qwik.mjs +2 -2
  10. package/dist/react.es.js +2 -2
  11. package/dist/shared/ShadowRootContext-DD6a0QaI.js +11 -0
  12. package/dist/shared/annotation-toolbar-DgqxkHy8.js +1085 -0
  13. package/dist/shared/{attachment-refresh-DmVkfPtl.js → attachment-refresh-DRX7dKDI.js} +3 -3
  14. package/dist/shared/{button-By0hGrJK.js → button-D4GHW6oZ.js} +133 -164
  15. package/dist/shared/{button-group-C285iSkZ.js → button-group-BVR7iT-S.js} +13 -13
  16. package/dist/shared/{comment-drawing-canvas-zIPS1dnW.js → comment-drawing-canvas-hSdcLShI.js} +2 -2
  17. package/dist/shared/{comment-icon-4SQd3nlz.js → comment-icon-D8JTCEJ7.js} +109 -110
  18. package/dist/shared/{comment-image-lightbox-CdMNf0_y.js → comment-image-lightbox-4zroOCCG.js} +7 -7
  19. package/dist/shared/{comment-images-content-DqeqmQnb.js → comment-images-content-D4hTya6e.js} +28 -28
  20. package/dist/shared/{comment-kit-core-C-0JJS2i.js → comment-kit-core-D068rcdY.js} +467 -503
  21. package/dist/shared/{comment-kit-ui-CBaz7L3u.js → comment-kit-ui-BDzNt0jv.js} +5077 -5253
  22. package/dist/shared/{comment-screenshot-annotator-CuYmKafz.js → comment-screenshot-annotator-BGnu_NgP.js} +2 -2
  23. package/dist/shared/{comment-screenshot-overlay-Dw81osel.js → comment-screenshot-overlay-BCRmojWB.js} +4 -4
  24. package/dist/shared/{dev-export-panel-D08M2LKD.js → dev-export-panel-CYmUKmIV.js} +3 -3
  25. package/dist/shared/{dev-grab-BJLZZ2xU.js → dev-grab-BYsCpsGI.js} +48 -47
  26. package/dist/shared/dist-D9A5k-N4.js +617 -0
  27. package/dist/shared/{element-selector-Biyn2cpR.js → element-selector-79Oo5pit.js} +4 -4
  28. package/dist/shared/{mount-ui-DXdL3p9b.js → mount-ui-DuHk132g.js} +4 -4
  29. package/dist/shared/{pusher-D4M5K6Dk.js → pusher-3jyUauYd.js} +1 -1
  30. package/dist/shared/{realtime-BTqYEy8s.js → realtime-DspH16g5.js} +41 -28
  31. package/dist/shared/{realtime-recovery-BSVMwsXJ.js → realtime-recovery-BjlV-ewc.js} +57 -30
  32. package/dist/shared/screenshot-BIuEaRiu.js +199 -0
  33. package/dist/shared/{separator-aphZiRoJ.js → separator-UhJb0Row.js} +1222 -1288
  34. package/dist/shared/{shadow-root-C58Ap5Nu.js → shadow-root-3-yGIhMs.js} +3 -5
  35. package/dist/shared/{token-session-D0Y_HZw0.js → token-session-_Pi4fOEi.js} +1 -1
  36. package/dist/shared/{useRender-D1z_X_BY.js → useRender-Uxk1OPK-.js} +1 -1
  37. package/dist/shared/{useValueChanged-CrzfD8l-.js → useValueChanged-DKq5cMot.js} +13 -13
  38. package/dist/shared/{websocket-manager-BFKa95TO.js → websocket-manager-CvgZSo_L.js} +2 -2
  39. package/dist/solid.es.js +2 -2
  40. package/dist/svelte.es.js +2 -2
  41. package/dist/types/core/api-client.d.ts +17 -9
  42. package/dist/types/core/comment-kit-core.d.ts +4 -2
  43. package/dist/types/core/types.d.ts +37 -4
  44. package/dist/vue.es.js +2 -2
  45. package/docs/api-reference.md +29 -17
  46. package/package.json +1 -1
  47. package/dist/shared/ShadowRootContext-CjciYxVN.js +0 -13
  48. package/dist/shared/annotation-toolbar-CpPKy0oq.js +0 -1094
  49. package/dist/shared/dist-De294MVF.js +0 -623
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.5] - 2026-10-17
4
+
5
+ - Require the enrolled second factor after SDK email sign-in, including recovery-code support.
6
+ - Patch checklist items independently so concurrent reviewers do not undo each other.
7
+ - Use compact cursor pages and server-side search; load older replies on demand.
8
+ - Reconcile delayed collaboration events using authoritative thread reads.
9
+ - Keep screenshot retries on the shared idempotent creation and notification path.
10
+ - Keep Sonner toast styles inside the widget Shadow DOM without injecting a duplicate stylesheet into the host page.
11
+ - Remove bundled development diagnostics and load screenshot code only when needed, retaining the original package-size budgets.
12
+ - The separate MCP **0.1.1** release uses server search and explicit list/reply continuation.
13
+
14
+ These versions are prepared for release. Deploy and verify the paired backend audit-hardening update before promoting either consumer to `latest`.
15
+
3
16
  All notable changes to this project will be documented in this file.
4
17
 
5
18
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
package/README.md CHANGED
@@ -21,7 +21,7 @@ Drop-in SDK for React, Vue, Svelte, Angular, Solid.js, Qwik, Preact, and vanilla
21
21
  | **Screenshots** | Capture annotated screenshots with one click |
22
22
  | **Real-Time Collaboration** | See live cursors, presence indicators, and instant updates |
23
23
  | **Offline Support** | Mutations queue automatically and retry when back online |
24
- | **OTP Authentication** | Built-in passwordless email authentication |
24
+ | **OTP Authentication** | Passwordless email authentication with authenticator/recovery-code support |
25
25
  | **Member Invite Links** | Invite members by email — they verify via OTP to join |
26
26
  | **Task Workflows** | Assign, prioritize, resolve, and track comments as tasks |
27
27
  | **@Mentions** | Tag team members with autocomplete from your project roster |
@@ -733,7 +733,7 @@ CommentKit is designed for production integration, but it runs with your page's
733
733
  | **No dynamic code execution** | Zero `eval()`, `new Function()`, `innerHTML`, or `document.write`. |
734
734
  | **Shadow DOM isolation** | Widget styles are scoped inside Shadow DOM. Annotation, element capture and screenshots intentionally inspect the host page to attach feedback; host permissions and browser restrictions still apply. |
735
735
  | **Source maps disabled** | No `.map` files ship. No `sourceMappingURL` in built files. |
736
- | **OTP authentication** | All commenters verify via email OTP. No passwords stored. |
736
+ | **OTP authentication** | All commenters verify via email OTP; accounts with two-factor authentication also confirm an authenticator or recovery code before a session is issued. No passwords stored. |
737
737
  | **Session persistence** | Sanctum Bearer token is kept in **sessionStorage** (tab-scoped) so in-tab refresh keeps auth and the offline queue can drain. Closing the tab clears the session; logout / auth-expiry also clear the offline queue. Prefer Bearer over `X-User-Email` (spoofable). |
738
738
  | **Origin allowlist** | Browser requests must match the project's `allowed_domains` (wildcards like `*.example.com` supported). Empty allowlists deny browser traffic unless the backend enables `COMMENTKIT_ALLOW_EMPTY_ALLOWED_DOMAINS`. Server/MCP clients may omit `Origin`. |
739
739
  | **Stored data** | Authenticated comments store author identity, feedback and submitted context. The SDK uses tab-scoped session storage and a bounded local retry queue; the private demo uses a separate expiring browser store. |
package/SECURITY.md CHANGED
@@ -12,7 +12,7 @@ Only the latest published release receives security fixes. Preparing a new versi
12
12
 
13
13
  ## Reporting a Vulnerability
14
14
 
15
- Please report security vulnerabilities privately to **<security@commentkit.dev>**. Do not open public GitHub issues for security problems.
15
+ Please report security vulnerabilities privately to **<hello@commentkit.dev>**. Do not open public GitHub issues for security problems.
16
16
 
17
17
  Include, where possible:
18
18
 
@@ -1,4 +1,4 @@
1
- import { t as e } from "./shared/comment-kit-core-C-0JJS2i.js";
1
+ import { t as e } from "./shared/comment-kit-core-D068rcdY.js";
2
2
  import { n as t, r as n, t as r } from "./shared/bridge-CJoGYngu.js";
3
3
  import { n as i, t as a } from "./shared/errors-Bu5ajEmB.js";
4
4
  import { Inject as o, Injectable as s, InjectionToken as c, Optional as l } from "@angular/core";
@@ -247,7 +247,7 @@ var v = class {
247
247
  }
248
248
  async mountSharedUI(e, t, n) {
249
249
  try {
250
- let { mountCommentKitUI: n } = await import("./shared/mount-ui-DXdL3p9b.js").then((e) => e.n);
250
+ let { mountCommentKitUI: n } = await import("./shared/mount-ui-DuHk132g.js").then((e) => e.n);
251
251
  if (this.core !== e || this.lifecycleId !== t) return;
252
252
  let r = await n(e);
253
253
  if (this.core !== e || this.lifecycleId !== t) {
@@ -1,5 +1,5 @@
1
- import { t as e } from "./shared/websocket-manager-BFKa95TO.js";
2
- import { _ as t, b as n, h as r, l as i, m as a, n as o, t as s, x as c, y as l } from "./shared/comment-kit-core-C-0JJS2i.js";
1
+ import { t as e } from "./shared/websocket-manager-CvgZSo_L.js";
2
+ import { _ as t, b as n, h as r, l as i, m as a, n as o, t as s, x as c, y as l } from "./shared/comment-kit-core-D068rcdY.js";
3
3
  import { a as u, c as d, d as f, f as p, i as m, l as h, m as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C } from "./shared/dom-Bhf4WFtY.js";
4
4
  import "./headless.es.js";
5
5
  async function w(e) {
@@ -14,7 +14,7 @@ var T = typeof window < "u", E = class {
14
14
  async mount() {
15
15
  let e = this.core;
16
16
  try {
17
- let { mountCommentKitUI: t } = await import("./shared/mount-ui-DXdL3p9b.js").then((e) => e.n);
17
+ let { mountCommentKitUI: t } = await import("./shared/mount-ui-DuHk132g.js").then((e) => e.n);
18
18
  if (this.destroyed) return;
19
19
  let n = await t(e);
20
20
  if (this.destroyed) {
package/dist/demo.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { o as e, r as t } from "./shared/validation-3wbbbuX0.js";
2
- import { t as n, v as r } from "./shared/comment-kit-core-C-0JJS2i.js";
2
+ import { t as n, v as r } from "./shared/comment-kit-core-D068rcdY.js";
3
3
  var i = 864e5, a = 512e3, o = 50, s = 20, c = "commentkit:demo:", l = {
4
4
  id: "local-demo-you",
5
5
  name: "You",
@@ -103,7 +103,7 @@ function b(t) {
103
103
  return null;
104
104
  }
105
105
  let r = t.replies.map(y);
106
- if (r.some((e) => !e) || r.some((e) => e?.replyTo?.type === "comment" && e.replyTo.id !== t.id) || new Set(r.map((e) => e.id)).size !== r.length) return null;
106
+ if (r.some((e) => !e) || r.some((e) => e?.replyTo?.type === "comment" && e.replyTo.id !== t.id) || new Set(r.map((e) => e?.id)).size !== r.length) return null;
107
107
  let i = [];
108
108
  if (t.checklist !== void 0) {
109
109
  if (!Array.isArray(t.checklist) || t.checklist.length > 25) return null;
@@ -178,6 +178,7 @@ var S = class {
178
178
  authorizeChannel: async () => this.unavailable(),
179
179
  requestOtp: async () => this.unavailable(),
180
180
  verifyOtp: async () => this.unavailable(),
181
+ verifyMfa: async () => this.unavailable(),
181
182
  validateInvite: async () => this.unavailable(),
182
183
  getComments: async (e, t = "all", n = 1, r = o, i, a) => {
183
184
  this.sync();
@@ -215,10 +216,14 @@ var S = class {
215
216
  mentions: s?.mentions,
216
217
  branch: s?.branch,
217
218
  deviceInfo: s?.deviceInfo
218
- })), this.getComments().find((e) => e.id === u);
219
+ })), this.find(this.getComments(), u);
219
220
  },
220
221
  updateComment: async (e, t) => t.attachmentIds?.length || t.drawingData || t.textSelection ? this.unavailable() : this.modify(e, (e) => {
221
- Object.assign(e, t, {
222
+ let { checklistPatch: n, ...r } = t;
223
+ n && (e.checklist = e.checklist?.map((e) => e.id === n.id ? {
224
+ ...e,
225
+ done: n.done
226
+ } : e)), Object.assign(e, r, {
222
227
  isEdited: !0,
223
228
  status: e.status,
224
229
  resolvedAt: e.resolvedAt,
@@ -239,16 +244,20 @@ var S = class {
239
244
  author: { ...l },
240
245
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
241
246
  mentions: r?.mentions
242
- };
243
- return this.modify(e, (e) => {
247
+ }, a = this.modify(e, (e) => {
244
248
  r?.replyTo && (i.replyTo = this.quote(e, r.replyTo)), e.replies.push(i), p(e, "open");
245
- }).replies.find((e) => e.id === i.id);
249
+ });
250
+ return this.find(a.replies, i.id);
251
+ },
252
+ updateReply: async (e, t, n, i) => {
253
+ if (i?.attachmentIds?.length) return this.unavailable();
254
+ let a = this.modify(e, (e) => {
255
+ let a = e.replies.find((e) => e.id === t);
256
+ if (!a) throw new r("not_found", "This demo reply no longer exists.", 404);
257
+ a.content = n, a.isEdited = !0, i?.mentions !== void 0 && (a.mentions = i.mentions), i?.replyTo && (a.replyTo = this.quote(e, i.replyTo));
258
+ });
259
+ return this.find(a.replies, t);
246
260
  },
247
- updateReply: async (e, t, n, i) => i?.attachmentIds?.length ? this.unavailable() : this.modify(e, (e) => {
248
- let a = e.replies.find((e) => e.id === t);
249
- if (!a) throw new r("not_found", "This demo reply no longer exists.", 404);
250
- a.content = n, a.isEdited = !0, i?.mentions !== void 0 && (a.mentions = i.mentions), i?.replyTo && (a.replyTo = this.quote(e, i.replyTo));
251
- }).replies.find((e) => e.id === t),
252
261
  deleteReply: async (e, t) => {
253
262
  this.modify(e, (e) => {
254
263
  e.replies = e.replies.filter((e) => e.id !== t);
@@ -308,7 +317,7 @@ var S = class {
308
317
  let r = JSON.parse(t);
309
318
  if (!e(r) || r.version !== 1 || typeof r.createdAt != "number" || !Number.isSafeInteger(r.createdAt) || r.createdAt > Date.now() || r.expiresAt !== r.createdAt + 864e5 || !Array.isArray(r.comments) || r.comments.length > o) throw Error("Invalid demo");
310
319
  let i = r.comments.map(b);
311
- if (i.some((e) => !e) || new Set(i.map((e) => e.id)).size !== i.length) throw Error("Invalid comments");
320
+ if (i.some((e) => !e) || new Set(i.map((e) => e?.id)).size !== i.length) throw Error("Invalid comments");
312
321
  this.data = {
313
322
  version: 1,
314
323
  createdAt: r.createdAt,
@@ -412,7 +421,7 @@ var S = class {
412
421
  return this.write((n) => {
413
422
  let r = this.find(n, e);
414
423
  t(r), r.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
415
- }), this.getComments().find((t) => t.id === e);
424
+ }), this.find(this.getComments(), e);
416
425
  }
417
426
  quote(e, t) {
418
427
  let n = t.type === "comment" && t.id === e.id ? e : t.type === "reply" ? e.replies.find((e) => e.id === t.id) : void 0;
@@ -444,7 +453,7 @@ async function w(e = {}) {
444
453
  }
445
454
  }, t), i;
446
455
  try {
447
- let { mountCommentKitUI: e } = await import("./shared/mount-ui-DXdL3p9b.js").then((e) => e.n);
456
+ let { mountCommentKitUI: e } = await import("./shared/mount-ui-DuHk132g.js").then((e) => e.n);
448
457
  i = await e(r);
449
458
  } catch (e) {
450
459
  throw r.destroy(), C = !1, e;
@@ -1,4 +1,4 @@
1
- import { t as e } from "./shared/websocket-manager-BFKa95TO.js";
2
- import { _ as t, b as n, h as r, l as i, m as a, n as o, t as s, x as c, y as l } from "./shared/comment-kit-core-C-0JJS2i.js";
1
+ import { t as e } from "./shared/websocket-manager-CvgZSo_L.js";
2
+ import { _ as t, b as n, h as r, l as i, m as a, n as o, t as s, x as c, y as l } from "./shared/comment-kit-core-D068rcdY.js";
3
3
  import { a as u, c as d, d as f, f as p, i as m, l as h, m as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C } from "./shared/dom-Bhf4WFtY.js";
4
4
  export { t as ApiClient, s as CommentKitCore, i as EventEmitter, o as SDK_VERSION, e as WebSocketManager, a as createAgentContext, S as debounce, _ as findElement, r as formatAgentContext, l as formatMention, b as generateId, m as generateSelector, u as generateXPath, v as getCurrentPage, x as getElementBounds, d as getSelectionRange, h as getSelectionText, C as isElementVisible, f as isInteractiveElement, n as parseMentions, p as percentageToViewport, c as stripMentionMarkup, y as throttle, g as viewportToPercentage };
package/dist/preact.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as e } from "./shared/comment-kit-core-C-0JJS2i.js";
1
+ import { t as e } from "./shared/comment-kit-core-D068rcdY.js";
2
2
  import { n as t, r as n, t as r } from "./shared/bridge-CJoGYngu.js";
3
3
  import { n as i, t as a } from "./shared/errors-Bu5ajEmB.js";
4
4
  import { useEffect as o, useMemo as s, useRef as c, useState as l } from "preact/hooks";
@@ -34,7 +34,7 @@ function u(u) {
34
34
  }
35
35
  }, l = async (e) => {
36
36
  try {
37
- let { mountCommentKitUI: t } = await import("./shared/mount-ui-DXdL3p9b.js").then((e) => e.n);
37
+ let { mountCommentKitUI: t } = await import("./shared/mount-ui-DuHk132g.js").then((e) => e.n);
38
38
  if (r || d.current !== e) return;
39
39
  let n = await t(e);
40
40
  if (r || d.current !== e) {
@@ -1,4 +1,4 @@
1
- import { t as e } from "./shared/comment-kit-core-C-0JJS2i.js";
1
+ import { t as e } from "./shared/comment-kit-core-D068rcdY.js";
2
2
  import { n as t, r as n, t as r } from "./shared/bridge-CJoGYngu.js";
3
3
  import { n as i, t as a } from "./shared/errors-Bu5ajEmB.js";
4
4
  import { noSerialize as o, useComputed$ as s, useSignal as c, useStore as l, useVisibleTask$ as u } from "@builder.io/qwik";
@@ -42,7 +42,7 @@ function d(d) {
42
42
  }
43
43
  }, b = async (e) => {
44
44
  try {
45
- let { mountCommentKitUI: t } = await import("./shared/mount-ui-DXdL3p9b.js").then((e) => e.n);
45
+ let { mountCommentKitUI: t } = await import("./shared/mount-ui-DuHk132g.js").then((e) => e.n);
46
46
  if (u || g.value !== e) return;
47
47
  let n = await t(e);
48
48
  if (u || g.value !== e) {
package/dist/react.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  "use client";
3
- import { t as e } from "./shared/comment-kit-core-C-0JJS2i.js";
3
+ import { t as e } from "./shared/comment-kit-core-D068rcdY.js";
4
4
  import { n as t, r as n, t as r } from "./shared/bridge-CJoGYngu.js";
5
5
  import { n as i, t as a } from "./shared/errors-Bu5ajEmB.js";
6
- import { t as o } from "./shared/mount-ui-DXdL3p9b.js";
6
+ import { t as o } from "./shared/mount-ui-DuHk132g.js";
7
7
  import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as f } from "react";
8
8
  import { Fragment as p, jsx as m } from "react/jsx-runtime";
9
9
  function h(i, o = {}) {
@@ -0,0 +1,11 @@
1
+ import * as e from "react";
2
+ import { createContext as t, useContext as n } from "react";
3
+ var r = /*#__PURE__*/ e.createContext(void 0);
4
+ function i() {
5
+ return e.useContext(r)?.direction ?? "ltr";
6
+ }
7
+ var a = t(null), o = t(!1);
8
+ function s() {
9
+ return n(a);
10
+ }
11
+ export { i as a, r as i, a as n, s as r, o as t };