@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
@@ -1,5 +1,5 @@
1
- import { o as e, r as t } from "./mount-ui-DXdL3p9b.js";
2
- import { i as n, n as r, t as i } from "./ShadowRootContext-CjciYxVN.js";
1
+ import { o as e, r as t } from "./mount-ui-DuHk132g.js";
2
+ import { i as n, n as r, t as i } from "./ShadowRootContext-DD6a0QaI.js";
3
3
  import * as a from "react";
4
4
  import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
5
5
  import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
@@ -10,9 +10,7 @@ var h = function(e) {
10
10
  value: r,
11
11
  children: e.children
12
12
  });
13
- };
14
- process.env.NODE_ENV !== "production" && (h.displayName = "DirectionProvider");
15
- var g = "https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap";
13
+ }, g = "https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap";
16
14
  function _() {
17
15
  /* v8 ignore stop */
18
16
  if (typeof document > "u" || document.querySelector("link[data-commentkit-font]")) return;
@@ -1,5 +1,5 @@
1
1
  import { f as e } from "./validation-3wbbbuX0.js";
2
- import { _ as t, a as n, i as r, o as i } from "./comment-kit-core-C-0JJS2i.js";
2
+ import { _ as t, a as n, i as r, o as i } from "./comment-kit-core-D068rcdY.js";
3
3
  async function a(a, o, s, c) {
4
4
  if (!s()) return !1;
5
5
  if (!e(o, 4096)) throw Error("Invalid member session token");
@@ -1,4 +1,4 @@
1
- import { u as e } from "./button-By0hGrJK.js";
1
+ import { l as e } from "./button-D4GHW6oZ.js";
2
2
  function t(t) {
3
3
  return e(t.defaultTagName ?? "div", t, t);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { L as e, R as t, V as n, h as r, m as i, z as a } from "./button-By0hGrJK.js";
1
+ import { F as e, I as t, L as n, f as r, p as i, z as a } from "./button-D4GHW6oZ.js";
2
2
  import * as o from "react";
3
3
  function s(e) {
4
4
  o.useEffect(e, t);
@@ -22,36 +22,36 @@ var c = 0, l = class e {
22
22
  disposeEffect = () => this.clear;
23
23
  };
24
24
  function u() {
25
- let e = n(l.create).current;
25
+ let e = a(l.create).current;
26
26
  return s(e.disposeEffect), e;
27
27
  }
28
- function d(e, t, n, r) {
29
- let i = !1, o = !1, s = r ?? a;
28
+ function d(e, t, r, i) {
29
+ let a = !1, o = !1, s = i ?? n;
30
30
  return {
31
31
  reason: e,
32
32
  event: t ?? new Event("base-ui"),
33
33
  cancel() {
34
- i = !0;
34
+ a = !0;
35
35
  },
36
36
  allowPropagation() {
37
37
  o = !0;
38
38
  },
39
39
  get isCanceled() {
40
- return i;
40
+ return a;
41
41
  },
42
42
  get isPropagationAllowed() {
43
43
  return o;
44
44
  },
45
- trigger: n,
45
+ trigger: r,
46
46
  ...s
47
47
  };
48
48
  }
49
- function f(e, t, n) {
50
- let r = n ?? a;
49
+ function f(e, t, r) {
50
+ let i = r ?? n;
51
51
  return {
52
52
  reason: e,
53
53
  event: t ?? new Event("base-ui"),
54
- ...r
54
+ ...i
55
55
  };
56
56
  }
57
57
  var p = "none", m = "trigger-press", h = "trigger-hover", g = "trigger-focus", _ = "outside-press", v = "item-press", y = "close-press", b = "clear-press", x = "chip-remove-press", S = "track-press", C = "input-change", w = "input-clear", T = "input-press", E = "focus-out", D = "escape-key", O = "list-navigation", k = "keyboard", A = "pointer", j = "drag", M = "cancel-open", N = "sibling-open", P = "disabled", F = "missing", I = "initial", L = "imperative-action", R = "window-resize";
@@ -72,7 +72,7 @@ function V(e, t = "mui") {
72
72
  r
73
73
  ]), i;
74
74
  }
75
- var H = r.useId;
75
+ var H = i.useId;
76
76
  function U(e, t) {
77
77
  if (H !== void 0) {
78
78
  let n = H();
@@ -84,9 +84,9 @@ function W(e) {
84
84
  return U(e, "base-ui");
85
85
  }
86
86
  function G(t, n) {
87
- let r = o.useRef(t), a = i(n);
87
+ let i = o.useRef(t), a = r(n);
88
88
  e(() => {
89
- r.current !== t && a(r.current), r.current = t;
89
+ i.current !== t && a(i.current), i.current = t;
90
90
  }, [t, a]);
91
91
  }
92
92
  export { R as A, _ as C, g as D, S as E, s as F, f as M, l as N, h as O, u as P, p as S, N as T, T as _, M as a, O as b, y as c, D as d, E as f, w as g, C as h, z as i, d as j, m as k, P as l, I as m, W as n, x as o, L as p, U as r, b as s, G as t, j as u, v, A as w, F as x, k as y };
@@ -1,5 +1,5 @@
1
1
  import { d as e, f as t, i as n, l as r, o as i, p as a } from "./validation-3wbbbuX0.js";
2
- import { s as o } from "./comment-kit-core-C-0JJS2i.js";
2
+ import { s as o } from "./comment-kit-core-D068rcdY.js";
3
3
  import { i as s } from "./text-B4HHZNaa.js";
4
4
  var c = Object.create, l = Object.defineProperty, u = Object.getOwnPropertyDescriptor, d = Object.getOwnPropertyNames, f = Object.getPrototypeOf, p = Object.prototype.hasOwnProperty, m = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), h = (e, t) => {
5
5
  let n = {};
@@ -57,7 +57,7 @@ function S(e) {
57
57
  }
58
58
  var C = null;
59
59
  function w() {
60
- return C ||= import("./pusher-D4M5K6Dk.js").then((e) => /* @__PURE__ */ _(e.default, 1)).then((e) => e.default ?? e), C;
60
+ return C ||= import("./pusher-3jyUauYd.js").then((e) => /* @__PURE__ */ _(e.default, 1)).then((e) => e.default ?? e), C;
61
61
  }
62
62
  var T = o.ID, E = o.NAME, D = o.EMAIL, O = o.PAGE, k = o.COLOR, A = o.DRAWING_PATH_DATA, j = o.DRAWING_TEXT, M = o.ONLINE_USERS, N = {
63
63
  id: "unknown",
package/dist/solid.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 { createMemo as o, createSignal as s, onCleanup as c, onMount as l } from "solid-js";
@@ -24,7 +24,7 @@ function u(u) {
24
24
  }
25
25
  }, K = async (e) => {
26
26
  try {
27
- let { mountCommentKitUI: t } = await import("./shared/mount-ui-DXdL3p9b.js").then((e) => e.n);
27
+ let { mountCommentKitUI: t } = await import("./shared/mount-ui-DuHk132g.js").then((e) => e.n);
28
28
  if (w || x !== e) return;
29
29
  let n = await t(e);
30
30
  if (w || x !== e) {
package/dist/svelte.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 { onDestroy as o } from "svelte";
@@ -23,7 +23,7 @@ function d(o) {
23
23
  } catch {}
24
24
  }, B = async (e) => {
25
25
  try {
26
- let { mountCommentKitUI: t } = await import("./shared/mount-ui-DXdL3p9b.js").then((e) => e.n);
26
+ let { mountCommentKitUI: t } = await import("./shared/mount-ui-DuHk132g.js").then((e) => e.n);
27
27
  if (I || c(d) !== e) return;
28
28
  let n = await t(e);
29
29
  if (I || c(d) !== e) {
@@ -1,4 +1,4 @@
1
- import type { AuthResponse, Comment, CommentEnvironment, CommentCreateOptions, CommentDeviceInfo, ProjectContext, ReplyOptions, DrawingData, InviteValidationResponse, Mention, OtpResponse, OtpVerifyResponse, SessionVerificationResponse, Position, ResolvedConfig, TextSelection, User } from "./types";
1
+ import type { AuthResponse, Comment, CommentQuery, PaginationInfo, CommentEnvironment, CommentCreateOptions, CommentDeviceInfo, ProjectContext, ReplyOptions, DrawingData, InviteValidationResponse, Mention, OtpResponse, OtpVerifyResponse, SessionVerificationResponse, Position, ResolvedConfig, TextSelection, User } from "./types";
2
2
  export declare class ApiClient {
3
3
  private baseUrl;
4
4
  private apiKey;
@@ -32,17 +32,20 @@ export declare class ApiClient {
32
32
  }>;
33
33
  requestOtp(email: string): Promise<OtpResponse>;
34
34
  verifyOtp(email: string, otp: string): Promise<OtpVerifyResponse>;
35
+ verifyMfa(challenge: string, code: string): Promise<OtpVerifyResponse>;
35
36
  validateInvite(token: string, email: string): Promise<InviteValidationResponse>;
36
- getComments(pagePath?: string, status?: "open" | "resolved" | "all", page?: number, limit?: number, environment?: CommentEnvironment, branch?: string | null): Promise<{
37
+ getComments(pagePath?: string, status?: "open" | "resolved" | "complete" | "all", page?: number, limit?: number, environment?: CommentEnvironment, branch?: string | null, options?: CommentQuery & {
38
+ cursor?: string | null;
39
+ view?: "summary";
40
+ pagination?: "cursor";
41
+ }): Promise<{
37
42
  comments: Comment[];
38
- pagination: {
39
- total: number;
40
- hasMore: boolean;
41
- page: number;
42
- limit: number;
43
- };
43
+ pagination: PaginationInfo;
44
44
  }>;
45
- getComment(commentId: string): Promise<Comment>;
45
+ getComment(commentId: string, options?: {
46
+ repliesLimit?: number;
47
+ repliesBefore?: string;
48
+ }): Promise<Comment>;
46
49
  /**
47
50
  * Build an Idempotency-Key header from a client-supplied key. The backend
48
51
  * dedups retried creates/replies on this key, so an offline-queue replay (or
@@ -57,6 +60,10 @@ export declare class ApiClient {
57
60
  }, priority?: "low" | "medium" | "high" | "urgent", textSelection?: TextSelection, drawingData?: DrawingData, options?: CommentCreateOptions, idempotencyKey?: string): Promise<Comment>;
58
61
  updateComment(commentId: string, updates: Partial<Pick<Comment, "content" | "status" | "priority" | "description" | "assignees" | "checklist" | "textSelection" | "drawingData" | "mentions"> & {
59
62
  attachmentIds?: Array<string | number>;
63
+ checklistPatch?: {
64
+ id: string;
65
+ done: boolean;
66
+ };
60
67
  }>): Promise<Comment>;
61
68
  deleteComment(commentId: string): Promise<void>;
62
69
  addReply(commentId: string, content: string, idempotencyKey?: string, options?: ReplyOptions): Promise<Comment["replies"][0]>;
@@ -99,6 +106,7 @@ export declare class ApiClient {
99
106
  }>;
100
107
  uploadScreenshot(file: File, metadata: {
101
108
  content: string;
109
+ idempotencyKey?: string;
102
110
  position: Position;
103
111
  page: {
104
112
  url: string;
@@ -1,7 +1,7 @@
1
1
  import { type CommentWriteAccess } from "./write-access";
2
2
  import { EventEmitter } from "../utils/event-emitter";
3
3
  import type { LocalDemoStore } from "./local-demo";
4
- import type { AgentContextExport, AgentContextOptions, Comment, CommentCreateOptions, ReplyOptions, CommentKitConfig, CommentKitState, DevGrabBundle, DevGrabOptions, DevGrabResult, DrawingData, DrawingPath, Position, ResolvedConfig, ScreenshotResult, StateSlice, TextSelection, ToolType, Unsubscribe, User } from "./types";
4
+ import type { AgentContextExport, AgentContextOptions, Comment, CommentUpdate, CommentQuery, CommentCreateOptions, ReplyOptions, CommentKitConfig, CommentKitState, DevGrabBundle, DevGrabOptions, DevGrabResult, DrawingData, DrawingPath, Position, ResolvedConfig, ScreenshotResult, StateSlice, TextSelection, ToolType, Unsubscribe, User } from "./types";
5
5
  /**
6
6
  * Current SDK version — compared against the backend's sdkLatestVersion on
7
7
  * init. Injected from package.json at build time (vite `define`) so it can't
@@ -150,6 +150,8 @@ export declare class CommentKitCore extends EventEmitter {
150
150
  * `loadMoreComments`, which paginates forward and no-ops once everything is
151
151
  * loaded, this refreshes existing data — e.g. to pick up remote edits.
152
152
  */
153
+ setCommentQuery(query: CommentQuery): Promise<void>;
154
+ loadEarlierReplies(): Promise<void>;
153
155
  reloadComments(): Promise<void>;
154
156
  /** @internal Refresh signed attachment links without discarding pagination or local edits. */
155
157
  refreshAttachmentUrl(attachmentId: string): Promise<string | null>;
@@ -159,7 +161,7 @@ export declare class CommentKitCore extends EventEmitter {
159
161
  /** Upload drafts before creating their record. Reuse successful uploads if saving is retried. */
160
162
  uploadDraftFiles(files: File[]): Promise<string[]>;
161
163
  createComment(type: "pin" | "highlight" | "drawing", content: string, position: Position, priority?: "low" | "medium" | "high" | "urgent", textSelection?: TextSelection, drawingData?: DrawingData, options?: CommentCreateOptions): Promise<void>;
162
- updateComment(commentId: string, updates: Partial<Comment>): Promise<void>;
164
+ updateComment(commentId: string, updates: CommentUpdate): Promise<void>;
163
165
  deleteComment(commentId: string): Promise<void>;
164
166
  addReply(commentId: string, content: string, options?: ReplyOptions): Promise<void>;
165
167
  updateReply(commentId: string, replyId: string, content: string, options?: ReplyOptions): Promise<void>;
@@ -99,6 +99,7 @@ export interface AgentCommentContext {
99
99
  attachments?: AgentAttachmentReference[];
100
100
  /** Credential-free screenshot URL, when one is available. */
101
101
  screenshotUrl?: string;
102
+ repliesCount?: number;
102
103
  replies: Array<{
103
104
  id: string;
104
105
  content: string;
@@ -340,10 +341,24 @@ export interface Comment {
340
341
  checklist?: TaskChecklistItem[];
341
342
  reactions?: CommentReaction[];
342
343
  replies: Reply[];
344
+ repliesCount?: number;
345
+ detailLoaded?: boolean;
346
+ repliesPagination?: {
347
+ hasMore: boolean;
348
+ nextCursor: string | null;
349
+ };
343
350
  attachments: Attachment[];
344
351
  textSelection?: TextSelection;
345
352
  drawingData?: DrawingData;
346
353
  }
354
+ export type CommentUpdate = Partial<Comment> & {
355
+ attachmentIds?: Array<string | number>;
356
+ /** Change one task without replacing another reviewer's checklist state. */
357
+ checklistPatch?: {
358
+ id: string;
359
+ done: boolean;
360
+ };
361
+ };
347
362
  export interface Reply {
348
363
  replyTo?: ReplyTarget & {
349
364
  authorName: string;
@@ -423,13 +438,24 @@ export interface ActivityItem {
423
438
  timestamp: string;
424
439
  read?: boolean;
425
440
  }
426
- export type OtpStep = "idle" | "requesting" | "verifying";
441
+ export type OtpStep = "idle" | "requesting" | "verifying" | "mfa";
427
442
  export interface Mention {
428
443
  userId: string;
429
444
  name: string;
430
445
  index?: number;
431
446
  }
447
+ export interface CommentQuery {
448
+ pagePath?: string;
449
+ status?: StatusFilter;
450
+ priority?: PriorityFilter;
451
+ user?: "me";
452
+ assignee?: string;
453
+ search?: string;
454
+ sort?: "newest" | "oldest" | "priority";
455
+ excludeComplete?: boolean;
456
+ }
432
457
  export interface PaginationInfo {
458
+ nextCursor?: string | null;
433
459
  total: number;
434
460
  hasMore: boolean;
435
461
  page: number;
@@ -558,6 +584,8 @@ export interface CommentKitState {
558
584
  projectContext?: ProjectContext | null;
559
585
  activeBranch?: string | null;
560
586
  comments: Comment[];
587
+ commentQuery?: CommentQuery;
588
+ loadingThreadId?: string | null;
561
589
  activeTool: ToolType;
562
590
  selectedComment: Comment | null;
563
591
  activeComment: Comment | null;
@@ -572,6 +600,8 @@ export interface CommentKitState {
572
600
  error: string | null;
573
601
  otpStep: OtpStep;
574
602
  otpEmail: string | null;
603
+ /** In-memory, short-lived second-factor challenge; never persisted. */
604
+ otpMfaChallenge: string | null;
575
605
  pagination: PaginationInfo | null;
576
606
  pendingMutations: QueuedMutation[];
577
607
  isOnline: boolean;
@@ -593,9 +623,12 @@ export interface OtpResponse {
593
623
  export interface OtpVerifyResponse {
594
624
  success: boolean;
595
625
  verified: boolean;
596
- token: string;
597
- user: User;
598
- project: Project;
626
+ token?: string;
627
+ user?: User;
628
+ project?: Project;
629
+ mfaRequired?: boolean;
630
+ challenge?: string;
631
+ expiresIn?: number;
599
632
  }
600
633
  export interface SessionVerificationResponse {
601
634
  success: boolean;
package/dist/vue.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 { computed as o, h as s, onMounted as c, onUnmounted as l, shallowRef as u, watch as d } from "vue";
@@ -19,7 +19,7 @@ function f(s) {
19
19
  } catch {}
20
20
  }, V = async (e) => {
21
21
  try {
22
- let { mountCommentKitUI: t } = await import("./shared/mount-ui-DXdL3p9b.js").then((e) => e.n);
22
+ let { mountCommentKitUI: t } = await import("./shared/mount-ui-DuHk132g.js").then((e) => e.n);
23
23
  if (L || _.value !== e) return;
24
24
  let n = await t(e);
25
25
  if (L || _.value !== e) {
@@ -14,14 +14,18 @@ Qwik uses `useCommentKit` from `@commentkit/comment-kit/qwik` inside `component$
14
14
 
15
15
  ### Authentication
16
16
 
17
- | Method | Returns | Description |
18
- | ----------------------- | --------------- | ------------------------------------------------------------------ |
19
- | `validateInvite(email)` | `Promise<void>` | Validate a member invite token + email, then auto-trigger OTP flow |
20
- | `login(email)` | `Promise<void>` | Request OTP code sent to the given email |
21
- | `verifyOtp(code)` | `Promise<void>` | Verify the OTP code and authenticate |
22
- | `cancelOtp()` | `void` | Cancel the OTP flow and return to email entry |
23
- | `resendOtp()` | `Promise<void>` | Resend OTP to the same email |
24
- | `logout()` | `void` | Clear authentication and disconnect real-time |
17
+ | Method | Returns | Description |
18
+ | ----------------------- | --------------- | ----------------------------------------------------------------------- |
19
+ | `validateInvite(email)` | `Promise<void>` | Validate a member invite token + email, then auto-trigger OTP flow |
20
+ | `login(email)` | `Promise<void>` | Request OTP code sent to the given email |
21
+ | `verifyOtp(code)` | `Promise<void>` | Verify the email code, then the authenticator/recovery code if required |
22
+ | `cancelOtp()` | `void` | Cancel the OTP flow and return to email entry |
23
+ | `resendOtp()` | `Promise<void>` | Resend OTP to the same email |
24
+ | `logout()` | `void` | Clear authentication and disconnect real-time |
25
+
26
+ For accounts with two-factor authentication enabled, the email code advances `otpStep` to `"mfa"`; it does **not** authenticate the user or issue a bearer token. The built-in widget asks for an authenticator or unused recovery code. Headless/custom UIs should render that second step and call `verifyOtp(code)` again. Treat only `isAuthenticated`/`auth:login` as completed sign-in. The short-lived `otpMfaChallenge` stays in memory and is cleared on cancellation, logout, or successful sign-in. Closing the login modal also cancels pending authentication responses.
27
+
28
+ The backend binds this challenge to the account, project, current email and enrolled factor, expires it after five minutes, limits guesses, and consumes successful challenges and recovery codes once. Older SDKs fail closed when the API requires MFA; upgrade the widget to complete that flow.
25
29
 
26
30
  ### UI Controls
27
31
 
@@ -53,6 +57,8 @@ Qwik uses `useCommentKit` from `@commentkit/comment-kit/qwik` inside `component$
53
57
  | `deleteReply(commentId, replyId)` | `Promise<void>` | Delete a reply |
54
58
  | `reactToComment(commentId, emoji, replyId?)` | `Promise<void>` | Toggle a parent reaction, or a specific reply reaction when `replyId` is supplied |
55
59
  | `updateCommentPosition(commentId, x, y)` | `Promise<void>` | Move a comment pin to new coordinates |
60
+ | `loadEarlierReplies()` | `Promise<void>` | Prepend the next page of replies for the selected thread |
61
+ | `setCommentQuery(query)` | `Promise<void>` | Change server search/filters and reset the list cursor |
56
62
  | `loadMoreComments()` | `Promise<void>` | Load the next page of comments (pagination) |
57
63
 
58
64
  ### Project context, branches and retrieval
@@ -63,13 +69,19 @@ Qwik uses `useCommentKit` from `@commentkit/comment-kit/qwik` inside `component$
63
69
  | `setBranch(branch)` | `Promise<void>` | Select a nonempty branch name or `null` for all branches; clear the current selection/list and load that branch’s first page. |
64
70
  | `reloadProjectContext()` | `Promise<void>` | Refresh authenticated project, organization, member, usage, branch and permission context. |
65
71
 
72
+ Use `updateComment(id, { checklistPatch: { id: taskId, done: true } })` to toggle one checklist task without replacing another reviewer’s task state. The whole `checklist` array remains available for editing labels and ordering. Never send both in one request.
73
+
66
74
  Read `getState().projectContext`, `getState().activeBranch`, `getState().comments` and `getState().pagination` for the results. Context is null until an authenticated response is available. A missing context route on an older API is tolerated; it does not enable new server features. `loadMoreComments()` appends another page and becomes a no-op when there are no more pages.
67
75
 
68
76
  Set `config.branch` to the branch actually deployed on the host, such as `main`. This controls the branch recorded on new pins, highlights, drawings and screenshots, including offline replay. `setBranch()` changes the viewing filter; selecting another branch or **All branches** does not relabel feedback created on a configured deployment. A caller can explicitly override the branch of `createComment` through `CommentCreateOptions.branch`. For older integrations without `config.branch`, creation retains the selected branch as its fallback.
69
77
 
70
- The API fetches across project pages. The built-in **Page** tab filters loaded records to the current path; **All** includes other pages. A `#comment-ID` link retrieves its authorized target even beyond the first loaded page. The engine resolves this internally after authentication; do not call a private loader. Cross-page links retain the comment’s original page URL, and markers only target the current page’s DOM.
78
+ The API fetches across project pages. The built-in **Page** tab requests the current path from the server; **All** includes other pages. A `#comment-ID` link retrieves its authorized target even beyond the first loaded page. The engine resolves this internally after authentication; do not call a private loader. Cross-page links retain the comment’s original page URL, and markers only target the current page’s DOM.
79
+
80
+ The built-in panel sends text search (up to 200 characters), status, priority, assignee, author, page and sort filters to the backend. Search covers authorized thread and reply content and author names across the project, not only loaded threads. Changing filters resets the cursor and invalidates older requests. `core.setCommentQuery({ search, status, priority, assignee, user: "me", pagePath, sort, excludeComplete })` exposes this behavior to custom UIs.
81
+
82
+ Lists use stable cursor pagination and compact thread summaries (`detailLoaded: false`, `repliesCount`, empty `replies`). Selecting a summary fetches the newest 50 replies. `core.loadEarlierReplies()` prepends the next bounded history page; the built-in panel exposes **Load earlier replies**. Replies remain chronologically ordered. Async agent copy hydrates at most 12 recent replies per selected summary, discloses omitted replies, and keeps private signed URLs out of the payload. The synchronous export describes only its loaded snapshot.
71
83
 
72
- Panel text search and its local filters apply to the comments already loaded. When more pages exist, the panel explains this scope and keeps **Load more comments** available even if the current search has no matches. They are not server-wide search endpoints.
84
+ Deploy the matching backend API before this SDK. The backend retains the full, offset-based response for older SDKs that do not request the new read contract. The separate local-browser demo continues to filter its local data.
73
85
 
74
86
  `projectContext.permissions.canWriteComments` and `writeRestriction` describe the current backend write capability. An expired paid plan keeps authenticated viewing and export, while creation, replies, edits, deletion, reactions, status changes, pin moves and uploads are disabled. A project-level disabled-comments setting is shown separately from a missing paid plan. The backend enforces these rules; hiding UI controls is not authorization. Storage or individual tool limits do not disable ordinary text feedback. The public browser-local demo is a separate sandbox and does not grant access to production projects.
75
87
 
@@ -185,12 +197,12 @@ unsub();
185
197
 
186
198
  ### Auth Events
187
199
 
188
- | Event | Payload | When |
189
- | -------------------- | ----------------------- | ------------------------------- |
190
- | `auth:login` | `User` | User authenticated successfully |
191
- | `auth:logout` | `void` | User logged out |
192
- | `auth:otp-requested` | `{ email, expiresIn? }` | OTP was sent to email |
193
- | `auth:otp-verified` | `User` | OTP was verified successfully |
200
+ | Event | Payload | When |
201
+ | -------------------- | ----------------------- | -------------------------------------------------- |
202
+ | `auth:login` | `User` | User authenticated successfully |
203
+ | `auth:logout` | `void` | User logged out |
204
+ | `auth:otp-requested` | `{ email, expiresIn? }` | OTP was sent to email |
205
+ | `auth:otp-verified` | `User` | Email and any required second factor were verified |
194
206
 
195
207
  ### UI Events
196
208
 
@@ -257,7 +269,7 @@ Available slices:
257
269
 
258
270
  | Slice | Keys |
259
271
  | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
260
- | `auth` | `isAuthenticated`, `currentUser`, `project`, `projectContext`, `isLoginModalVisible`, `otpStep`, `otpEmail` |
272
+ | `auth` | `isAuthenticated`, `currentUser`, `project`, `projectContext`, `isLoginModalVisible`, `otpStep`, `otpEmail`, `otpMfaChallenge` |
261
273
  | `ui` | `isOverlayVisible`, `isSidebarVisible`, `isShortcutsOverlayVisible`, `activeTool`, `isCommentModeActive`, `isDrawingModeActive`, `isHighlightModeActive`, `isScreenshotModeActive`, `selectedComment`, `activeComment`, `activeDrawing`, `activeScreenshot`, `panelView`, `activities`, `isLoading`, `error` |
262
274
  | `comments` | `comments`, `pagination`, `seenThreadIds`, `activeBranch` |
263
275
  | `realtime` | `onlineUsers`, `connectionStatus`, `pendingMutations`, `isOnline` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commentkit/comment-kit",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "description": "Figma-style collaborative commenting, drawing, and feedback tools for any website. Works with React, Vue, Svelte, Angular, and Vanilla JS.",
5
5
  "keywords": [
6
6
  "angular",
@@ -1,13 +0,0 @@
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
- process.env.NODE_ENV !== "production" && (r.displayName = "DirectionContext");
5
- function i() {
6
- return e.useContext(r)?.direction ?? "ltr";
7
- }
8
- var a = t(null), o = t(!1), s = !1;
9
- function c() {
10
- let e = n(a);
11
- return e === null && !s && typeof process < "u" && process.env.NODE_ENV !== "production" && (s = !0, console.warn("[CommentKit] useShadowRoot() returned null — a portal primitive (Popover/Dialog/Select/etc.) is rendering outside <ShadowRootContext.Provider>. Portalled content will fall back to document.body, where ck-* styles are not present.")), e;
12
- }
13
- export { i as a, r as i, a as n, c as r, o as t };