@commentkit/comment-kit 0.7.6 → 1.0.0-beta.0
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 +30 -0
- package/README.md +108 -762
- package/SECURITY.md +19 -14
- package/dist/npm/THIRD_PARTY_NOTICES.txt +73 -0
- package/dist/npm/chunks/anchor-DT-Ynhh1.js +270 -0
- package/dist/npm/chunks/client-D1vrh_5G.js +590 -0
- package/dist/{shared/capture-colors-D0uLr-vZ.js → npm/chunks/colors-CX-IPjvb.js} +2 -0
- package/dist/npm/chunks/html2canvas-_mjSRP3G.js +4011 -0
- package/dist/npm/chunks/mount-Ce1MZrcm.js +2485 -0
- package/dist/{shared/pusher-BUaiCkDJ.js → npm/chunks/pusher-DRKlokR8.js} +224 -222
- package/dist/npm/chunks/realtime-5SvAvTUU.js +23 -0
- package/dist/npm/chunks/rolldown-runtime-VHNaYcLd.js +13 -0
- package/dist/npm/chunks/src-DJjfvVsa.js +330 -0
- package/dist/npm/element.js +24 -0
- package/dist/npm/headless.js +3 -0
- package/dist/npm/index.js +3 -0
- package/dist/npm/react.js +17 -0
- package/dist/npm/svelte.js +8 -0
- package/dist/npm/types/adapters/react.d.ts +9 -0
- package/dist/npm/types/adapters/svelte.d.ts +9 -0
- package/dist/npm/types/adapters/vue.d.ts +46 -0
- package/dist/npm/types/anchor/index.d.ts +49 -0
- package/dist/npm/types/core/api.d.ts +29 -0
- package/dist/npm/types/core/auth.d.ts +48 -0
- package/dist/npm/types/core/client.d.ts +100 -0
- package/dist/npm/types/core/store.d.ts +7 -0
- package/dist/npm/types/core/types.d.ts +278 -0
- package/dist/npm/types/element.d.ts +10 -0
- package/dist/npm/types/headless.d.ts +7 -0
- package/dist/npm/types/index.d.ts +30 -0
- package/dist/npm/vue.js +32 -0
- package/package.json +65 -173
- package/dist/THIRD_PARTY_NOTICES.txt +0 -284
- package/dist/angular.es.js +0 -321
- package/dist/comment-kit.es.js +0 -218
- package/dist/demo.es.js +0 -483
- package/dist/headless.es.js +0 -4
- package/dist/preact.es.js +0 -117
- package/dist/qwik.es.js +0 -1
- package/dist/qwik.qwik.mjs +0 -114
- package/dist/react.es.js +0 -98
- package/dist/shared/ShadowRootContext-DD6a0QaI.js +0 -11
- package/dist/shared/annotation-icons-Dh-bmNYK.js +0 -172
- package/dist/shared/annotation-toolbar-RSrb0Nku.js +0 -1086
- package/dist/shared/attachment-refresh-CSTYwRW-.js +0 -94
- package/dist/shared/bridge-CJoGYngu.js +0 -177
- package/dist/shared/button-D4GHW6oZ.js +0 -474
- package/dist/shared/button-group-BVR7iT-S.js +0 -91
- package/dist/shared/capture-privacy-DUROnio5.js +0 -77
- package/dist/shared/comment-drawing-canvas-DbuXP54N.js +0 -124
- package/dist/shared/comment-icon-D8JTCEJ7.js +0 -607
- package/dist/shared/comment-image-lightbox-zlIGEVA-.js +0 -190
- package/dist/shared/comment-images-content-aYbJb79_.js +0 -214
- package/dist/shared/comment-kit-core-B0k7XsMz.js +0 -3680
- package/dist/shared/comment-kit-ui-BXLJcZYQ.js +0 -19391
- package/dist/shared/comment-screenshot-annotator-ChWwYJzO.js +0 -151
- package/dist/shared/comment-screenshot-overlay-Bufg3rHz.js +0 -205
- package/dist/shared/comment-shortcut-groups-CfEmkitU.js +0 -153
- package/dist/shared/createReactComponent-BZHeRbD0.js +0 -45
- package/dist/shared/dev-export-panel-DAZenvgD.js +0 -207
- package/dist/shared/dev-grab-O8q25zar.js +0 -197
- package/dist/shared/dist-D9A5k-N4.js +0 -617
- package/dist/shared/dom-Bhf4WFtY.js +0 -223
- package/dist/shared/element-selector-CYkwzfEr.js +0 -902
- package/dist/shared/error-boundary-D3PD74vI.js +0 -21
- package/dist/shared/errors-Bu5ajEmB.js +0 -22
- package/dist/shared/icons-nzMOLzrm.js +0 -266
- package/dist/shared/input-UPtAj0M6.js +0 -111
- package/dist/shared/mount-ui-BKaWBhKq.js +0 -208
- package/dist/shared/realtime-C0Z8dXXH.js +0 -334
- package/dist/shared/realtime-recovery-BjlV-ewc.js +0 -162
- package/dist/shared/request-activity-DQrAUwfA.js +0 -11
- package/dist/shared/screenshot-B-ZfFItT.js +0 -199
- package/dist/shared/separator-UhJb0Row.js +0 -3955
- package/dist/shared/shadow-root-Cd3SLHyj.js +0 -133
- package/dist/shared/styles-CnYsLS2f.js +0 -2
- package/dist/shared/text-B4HHZNaa.js +0 -23
- package/dist/shared/token-session-DplW5QDx.js +0 -25
- package/dist/shared/useLabelableId-8n0QmH8N.js +0 -154
- package/dist/shared/useRender-Uxk1OPK-.js +0 -5
- package/dist/shared/useValueChanged-DKq5cMot.js +0 -92
- package/dist/shared/validation-3wbbbuX0.js +0 -70
- package/dist/shared/websocket-manager-798cRDyL.js +0 -381
- package/dist/solid.es.js +0 -98
- package/dist/svelte.es.js +0 -130
- package/dist/types/adapters/bridge.d.ts +0 -122
- package/dist/types/angular/index.d.ts +0 -145
- package/dist/types/core/agent-context.d.ts +0 -17
- package/dist/types/core/api-client.d.ts +0 -155
- package/dist/types/core/comment-kit-core.d.ts +0 -254
- package/dist/types/core/local-demo.d.ts +0 -60
- package/dist/types/core/types.d.ts +0 -770
- package/dist/types/core/websocket-manager.d.ts +0 -125
- package/dist/types/core/write-access.d.ts +0 -11
- package/dist/types/demo.d.ts +0 -17
- package/dist/types/headless.d.ts +0 -8
- package/dist/types/index.d.ts +0 -87
- package/dist/types/preact/index.d.ts +0 -25
- package/dist/types/qwik/index.d.ts +0 -73
- package/dist/types/react/client.d.ts +0 -31
- package/dist/types/react/index.d.ts +0 -4
- package/dist/types/solid/index.d.ts +0 -37
- package/dist/types/svelte/index.d.ts +0 -55
- package/dist/types/utils/dom.d.ts +0 -59
- package/dist/types/utils/event-emitter.d.ts +0 -11
- package/dist/types/vue/index.d.ts +0 -87
- package/dist/vue.es.js +0 -148
- package/docs/api-reference.md +0 -405
- package/docs/local-demo.md +0 -60
|
@@ -1,770 +0,0 @@
|
|
|
1
|
-
export interface Position {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
element?: string;
|
|
5
|
-
xpath?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface AgentContextOptions {
|
|
8
|
-
/** Include resolved and completed comments. Default: false */
|
|
9
|
-
includeResolved?: boolean;
|
|
10
|
-
/** Include comments only for the current page. Default: false */
|
|
11
|
-
currentPageOnly?: boolean;
|
|
12
|
-
/** Include a clipped outerHTML preview. Default: false */
|
|
13
|
-
includeHtml?: boolean;
|
|
14
|
-
/** Limit export to specific comment IDs. */
|
|
15
|
-
commentIds?: string[];
|
|
16
|
-
/** Maximum number of comments to export. Default: 200 */
|
|
17
|
-
maxComments?: number;
|
|
18
|
-
/** Optional instruction block placed at the top of the agent prompt. */
|
|
19
|
-
instructions?: string;
|
|
20
|
-
}
|
|
21
|
-
export interface AgentSourceFrame {
|
|
22
|
-
filePath: string;
|
|
23
|
-
lineNumber: number | null;
|
|
24
|
-
columnNumber: number | null;
|
|
25
|
-
componentName: string | null;
|
|
26
|
-
}
|
|
27
|
-
export interface AgentElementContext {
|
|
28
|
-
selector?: string;
|
|
29
|
-
xpath?: string;
|
|
30
|
-
found: boolean;
|
|
31
|
-
tagName?: string;
|
|
32
|
-
id?: string;
|
|
33
|
-
className?: string;
|
|
34
|
-
role?: string;
|
|
35
|
-
ariaLabel?: string;
|
|
36
|
-
text?: string;
|
|
37
|
-
rect?: {
|
|
38
|
-
top: number;
|
|
39
|
-
left: number;
|
|
40
|
-
width: number;
|
|
41
|
-
height: number;
|
|
42
|
-
};
|
|
43
|
-
htmlPreview?: string;
|
|
44
|
-
/** Resolved source file location (requires the optional source-resolver peer dep + dev source maps). */
|
|
45
|
-
source?: AgentSourceFrame;
|
|
46
|
-
/** Component stack from the element to the root, populated alongside `source`. */
|
|
47
|
-
stack?: AgentSourceFrame[];
|
|
48
|
-
/** Nearest user-defined component name. */
|
|
49
|
-
componentName?: string;
|
|
50
|
-
}
|
|
51
|
-
export type DevGrabAttachmentPathSource = "native" | "relative" | "browser-fallback";
|
|
52
|
-
export interface DevGrabAttachment {
|
|
53
|
-
name: string;
|
|
54
|
-
/** Best available local reference. Absolute only when the runtime exposes one. */
|
|
55
|
-
path: string;
|
|
56
|
-
/** Describes whether `path` came from a native runtime, browser-relative metadata, or filename fallback. */
|
|
57
|
-
pathSource?: DevGrabAttachmentPathSource;
|
|
58
|
-
type?: string;
|
|
59
|
-
size?: number;
|
|
60
|
-
lastModified?: number;
|
|
61
|
-
}
|
|
62
|
-
export interface DevGrabOptions {
|
|
63
|
-
/** Optional user-entered comment or instruction to include in the agent payload. */
|
|
64
|
-
comment?: string;
|
|
65
|
-
/** Optional local file references to include in the agent payload. */
|
|
66
|
-
attachments?: DevGrabAttachment[];
|
|
67
|
-
}
|
|
68
|
-
/** Attachment metadata safe to export to agents; signed URLs are omitted. */
|
|
69
|
-
export type AgentAttachmentReference = Pick<Attachment, "id" | "type" | "filename" | "mimeType" | "size"> & {
|
|
70
|
-
url?: string;
|
|
71
|
-
inlineContentOmitted?: true;
|
|
72
|
-
};
|
|
73
|
-
export interface AgentCommentContext {
|
|
74
|
-
id: string;
|
|
75
|
-
type: Comment["type"];
|
|
76
|
-
status: Comment["status"];
|
|
77
|
-
priority: Comment["priority"];
|
|
78
|
-
content: string;
|
|
79
|
-
author: Pick<User, "id" | "name" | "email">;
|
|
80
|
-
createdAt: string;
|
|
81
|
-
updatedAt: string;
|
|
82
|
-
environment?: CommentEnvironment;
|
|
83
|
-
branch?: string;
|
|
84
|
-
deviceInfo?: CommentDeviceInfo;
|
|
85
|
-
description?: string;
|
|
86
|
-
assignees?: Array<Pick<User, "id" | "name" | "email">>;
|
|
87
|
-
mentions?: Mention[];
|
|
88
|
-
checklist?: TaskChecklistItem[];
|
|
89
|
-
reactions?: CommentReaction[];
|
|
90
|
-
isEdited?: boolean;
|
|
91
|
-
resolvedAt?: string;
|
|
92
|
-
completedAt?: string;
|
|
93
|
-
page: Comment["page"];
|
|
94
|
-
position: Position;
|
|
95
|
-
textSelection?: TextSelection;
|
|
96
|
-
drawingData?: DrawingData;
|
|
97
|
-
element: AgentElementContext;
|
|
98
|
-
/** All attachment IDs and metadata, with only credential-free public URLs. */
|
|
99
|
-
attachments?: AgentAttachmentReference[];
|
|
100
|
-
/** Credential-free screenshot URL, when one is available. */
|
|
101
|
-
screenshotUrl?: string;
|
|
102
|
-
repliesCount?: number;
|
|
103
|
-
replies: Array<{
|
|
104
|
-
id: string;
|
|
105
|
-
content: string;
|
|
106
|
-
author: Pick<User, "id" | "name" | "email">;
|
|
107
|
-
createdAt: string;
|
|
108
|
-
isEdited?: boolean;
|
|
109
|
-
replyTo?: Reply["replyTo"];
|
|
110
|
-
mentions?: Mention[];
|
|
111
|
-
reactions?: CommentReaction[];
|
|
112
|
-
attachments?: AgentAttachmentReference[];
|
|
113
|
-
}>;
|
|
114
|
-
}
|
|
115
|
-
export interface AgentContextExport {
|
|
116
|
-
version: 1;
|
|
117
|
-
generatedAt: string;
|
|
118
|
-
instructions: string;
|
|
119
|
-
page: {
|
|
120
|
-
url: string;
|
|
121
|
-
path: string;
|
|
122
|
-
title: string;
|
|
123
|
-
};
|
|
124
|
-
comments: AgentCommentContext[];
|
|
125
|
-
/** Identifiers only: API keys, auth tokens and project settings are never exported. */
|
|
126
|
-
project?: Pick<Project, "id" | "name" | "slug">;
|
|
127
|
-
/** Export scope describes the loaded snapshot; it does not fetch additional pages. */
|
|
128
|
-
scope?: {
|
|
129
|
-
activeBranch: string | null;
|
|
130
|
-
currentPageOnly: boolean;
|
|
131
|
-
includeResolved: boolean;
|
|
132
|
-
loadedCommentCount: number;
|
|
133
|
-
matchingCommentCount: number;
|
|
134
|
-
exportedCommentCount: number;
|
|
135
|
-
hasMoreOnServer: boolean;
|
|
136
|
-
truncated: boolean;
|
|
137
|
-
};
|
|
138
|
-
/** True when source resolution succeeded for at least one comment. */
|
|
139
|
-
sourceResolved: boolean;
|
|
140
|
-
}
|
|
141
|
-
/** Single-element grab result (developer's local dev-mode element-tool). */
|
|
142
|
-
export interface DevGrabResult {
|
|
143
|
-
generatedAt: string;
|
|
144
|
-
page: {
|
|
145
|
-
url: string;
|
|
146
|
-
path: string;
|
|
147
|
-
title: string;
|
|
148
|
-
};
|
|
149
|
-
element: AgentElementContext;
|
|
150
|
-
/** User-entered draft comment included with the agent payload, when provided. */
|
|
151
|
-
comment: string | null;
|
|
152
|
-
/** Local file references included with the agent payload. */
|
|
153
|
-
attachments: DevGrabAttachment[];
|
|
154
|
-
/** Element HTML (clipped). */
|
|
155
|
-
html: string;
|
|
156
|
-
/** Data URL of the element screenshot (PNG). */
|
|
157
|
-
screenshotDataUrl: string | null;
|
|
158
|
-
/** Formatted Markdown payload (single-element). For bundles see DevGrabBundle. */
|
|
159
|
-
markdown: string;
|
|
160
|
-
}
|
|
161
|
-
/** Multi-element grab result (shift+click, drag-rect, ⌘C-across-selections). */
|
|
162
|
-
export interface DevGrabBundle {
|
|
163
|
-
generatedAt: string;
|
|
164
|
-
page: {
|
|
165
|
-
url: string;
|
|
166
|
-
path: string;
|
|
167
|
-
title: string;
|
|
168
|
-
};
|
|
169
|
-
results: DevGrabResult[];
|
|
170
|
-
/** Local file references included with the bundled agent payload. */
|
|
171
|
-
attachments: DevGrabAttachment[];
|
|
172
|
-
/** The bundled Markdown payload that was copied to the clipboard. */
|
|
173
|
-
markdown: string;
|
|
174
|
-
}
|
|
175
|
-
export interface Viewport {
|
|
176
|
-
width: number;
|
|
177
|
-
height: number;
|
|
178
|
-
}
|
|
179
|
-
export interface User {
|
|
180
|
-
id: string;
|
|
181
|
-
name: string;
|
|
182
|
-
email: string;
|
|
183
|
-
avatar?: string;
|
|
184
|
-
organizationId?: string;
|
|
185
|
-
}
|
|
186
|
-
/** @deprecated Not used by any SDK runtime path; retained for API consumers. */
|
|
187
|
-
export interface Organization {
|
|
188
|
-
id: string;
|
|
189
|
-
name: string;
|
|
190
|
-
slug: string;
|
|
191
|
-
owner: User;
|
|
192
|
-
members: OrganizationMember[];
|
|
193
|
-
plan: "none" | "pro" | "ltd" | null;
|
|
194
|
-
createdAt: string;
|
|
195
|
-
updatedAt: string;
|
|
196
|
-
}
|
|
197
|
-
/** @deprecated Not used by any SDK runtime path; retained for API consumers. */
|
|
198
|
-
export interface OrganizationMember {
|
|
199
|
-
id: string;
|
|
200
|
-
user: User;
|
|
201
|
-
role: "owner" | "admin" | "member" | "reviewer";
|
|
202
|
-
joinedAt: string;
|
|
203
|
-
}
|
|
204
|
-
export interface Project {
|
|
205
|
-
id: string;
|
|
206
|
-
name: string;
|
|
207
|
-
slug: string;
|
|
208
|
-
url: string;
|
|
209
|
-
/** Owning team id (backend `formatProject.teamId`). */
|
|
210
|
-
teamId?: string;
|
|
211
|
-
/** @deprecated Legacy field — the backend now returns `teamId`. */
|
|
212
|
-
organizationId?: string;
|
|
213
|
-
/** Not returned by the SDK auth endpoints (the key is config-supplied). */
|
|
214
|
-
apiKey?: string;
|
|
215
|
-
features: {
|
|
216
|
-
comments: boolean;
|
|
217
|
-
drawing: boolean;
|
|
218
|
-
highlighting: boolean;
|
|
219
|
-
screenshots: boolean;
|
|
220
|
-
realtime: boolean;
|
|
221
|
-
};
|
|
222
|
-
limits: {
|
|
223
|
-
maxMembers: number;
|
|
224
|
-
retentionDays: number;
|
|
225
|
-
};
|
|
226
|
-
/** Reverb WebSocket config returned by backend when features.realtime is true. */
|
|
227
|
-
reverb?: {
|
|
228
|
-
key: string;
|
|
229
|
-
host: string;
|
|
230
|
-
port: number;
|
|
231
|
-
scheme: "ws" | "wss";
|
|
232
|
-
};
|
|
233
|
-
/** Latest published SDK version, returned by backend for update checks. */
|
|
234
|
-
sdkLatestVersion?: string;
|
|
235
|
-
/** Not returned by the SDK auth endpoints (`formatProject` omits them). */
|
|
236
|
-
createdAt?: string;
|
|
237
|
-
updatedAt?: string;
|
|
238
|
-
}
|
|
239
|
-
/** Authenticated project data used by the embedded member and settings views. */
|
|
240
|
-
export interface ProjectContext {
|
|
241
|
-
project: Pick<Project, "id" | "name" | "slug"> & {
|
|
242
|
-
isPlayground?: boolean;
|
|
243
|
-
};
|
|
244
|
-
organization: {
|
|
245
|
-
id: string;
|
|
246
|
-
name: string;
|
|
247
|
-
plan: "none" | "pro" | "ltd" | null;
|
|
248
|
-
};
|
|
249
|
-
members: Array<User & {
|
|
250
|
-
role: "owner" | "admin" | "member" | "reviewer";
|
|
251
|
-
}>;
|
|
252
|
-
usage: {
|
|
253
|
-
used: number;
|
|
254
|
-
limit: number | null;
|
|
255
|
-
label: string;
|
|
256
|
-
} | null;
|
|
257
|
-
branches: Array<{
|
|
258
|
-
name: string;
|
|
259
|
-
}>;
|
|
260
|
-
permissions: {
|
|
261
|
-
canManageComments: boolean;
|
|
262
|
-
canInvite: boolean;
|
|
263
|
-
canWriteComments?: boolean;
|
|
264
|
-
canTriage?: boolean;
|
|
265
|
-
canComplete?: boolean;
|
|
266
|
-
canExportAgentContext?: boolean;
|
|
267
|
-
canUseMcp?: boolean;
|
|
268
|
-
accessScope?: "workspace" | "project";
|
|
269
|
-
writeRestriction?: "plan_required" | "feature_disabled" | null;
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
export interface CommentDeviceInfo {
|
|
273
|
-
browser: string;
|
|
274
|
-
os: string;
|
|
275
|
-
windowSize: string;
|
|
276
|
-
devicePixelRatio: number;
|
|
277
|
-
deployment?: string;
|
|
278
|
-
type: "desktop" | "mobile";
|
|
279
|
-
}
|
|
280
|
-
export interface ReplyTarget {
|
|
281
|
-
id: string;
|
|
282
|
-
type: "comment" | "reply";
|
|
283
|
-
}
|
|
284
|
-
export interface ReplyOptions {
|
|
285
|
-
attachmentIds?: Array<string | number>;
|
|
286
|
-
mentions?: Mention[];
|
|
287
|
-
replyTo?: ReplyTarget;
|
|
288
|
-
}
|
|
289
|
-
export interface CommentCreateOptions {
|
|
290
|
-
description?: string;
|
|
291
|
-
assignees?: User[];
|
|
292
|
-
checklist?: TaskChecklistItem[];
|
|
293
|
-
mentions?: Mention[];
|
|
294
|
-
files?: File[];
|
|
295
|
-
attachmentIds?: Array<string | number>;
|
|
296
|
-
branch?: string;
|
|
297
|
-
deviceInfo?: CommentDeviceInfo;
|
|
298
|
-
}
|
|
299
|
-
export type TaskStatus = "open" | "resolved" | "complete";
|
|
300
|
-
export interface TaskChecklistItem {
|
|
301
|
-
id: string;
|
|
302
|
-
label: string;
|
|
303
|
-
done: boolean;
|
|
304
|
-
sortOrder?: number;
|
|
305
|
-
}
|
|
306
|
-
export interface CommentReaction {
|
|
307
|
-
/** Participant IDs let realtime consumers derive their own reacted state. */
|
|
308
|
-
userIds?: string[];
|
|
309
|
-
emoji: string;
|
|
310
|
-
count: number;
|
|
311
|
-
reacted: boolean;
|
|
312
|
-
}
|
|
313
|
-
/** @deprecated Not used by any SDK runtime path; retained for API consumers. */
|
|
314
|
-
export interface DeviceInfo {
|
|
315
|
-
userAgent: string;
|
|
316
|
-
viewport: Viewport;
|
|
317
|
-
pixelRatio: number;
|
|
318
|
-
platform: string;
|
|
319
|
-
}
|
|
320
|
-
export type CommentEnvironment = "production" | "staging" | "preview" | "development";
|
|
321
|
-
export interface Comment {
|
|
322
|
-
id: string;
|
|
323
|
-
type: "pin" | "highlight" | "drawing";
|
|
324
|
-
content: string;
|
|
325
|
-
position: Position;
|
|
326
|
-
status: TaskStatus;
|
|
327
|
-
priority: "low" | "medium" | "high" | "urgent";
|
|
328
|
-
environment?: CommentEnvironment;
|
|
329
|
-
branch?: string;
|
|
330
|
-
deviceInfo?: CommentDeviceInfo;
|
|
331
|
-
author: User;
|
|
332
|
-
userId: string;
|
|
333
|
-
createdAt: string;
|
|
334
|
-
updatedAt: string;
|
|
335
|
-
isEdited?: boolean;
|
|
336
|
-
resolvedAt?: string;
|
|
337
|
-
completedAt?: string;
|
|
338
|
-
page: {
|
|
339
|
-
url: string;
|
|
340
|
-
path: string;
|
|
341
|
-
title: string;
|
|
342
|
-
};
|
|
343
|
-
description?: string;
|
|
344
|
-
assignees?: User[];
|
|
345
|
-
mentions?: Mention[];
|
|
346
|
-
checklist?: TaskChecklistItem[];
|
|
347
|
-
reactions?: CommentReaction[];
|
|
348
|
-
replies: Reply[];
|
|
349
|
-
repliesCount?: number;
|
|
350
|
-
detailLoaded?: boolean;
|
|
351
|
-
repliesPagination?: {
|
|
352
|
-
hasMore: boolean;
|
|
353
|
-
nextCursor: string | null;
|
|
354
|
-
};
|
|
355
|
-
attachments: Attachment[];
|
|
356
|
-
textSelection?: TextSelection;
|
|
357
|
-
drawingData?: DrawingData;
|
|
358
|
-
}
|
|
359
|
-
export type CommentUpdate = Partial<Comment> & {
|
|
360
|
-
attachmentIds?: Array<string | number>;
|
|
361
|
-
/** Change one task without replacing another reviewer's checklist state. */
|
|
362
|
-
checklistPatch?: {
|
|
363
|
-
id: string;
|
|
364
|
-
done: boolean;
|
|
365
|
-
};
|
|
366
|
-
};
|
|
367
|
-
export interface Reply {
|
|
368
|
-
replyTo?: ReplyTarget & {
|
|
369
|
-
authorName: string;
|
|
370
|
-
body: string;
|
|
371
|
-
};
|
|
372
|
-
id: string;
|
|
373
|
-
content: string;
|
|
374
|
-
author: User;
|
|
375
|
-
createdAt: string;
|
|
376
|
-
isEdited?: boolean;
|
|
377
|
-
mentions?: Mention[];
|
|
378
|
-
reactions?: CommentReaction[];
|
|
379
|
-
attachments?: Attachment[];
|
|
380
|
-
}
|
|
381
|
-
export interface Attachment {
|
|
382
|
-
mimeType?: string;
|
|
383
|
-
id: string;
|
|
384
|
-
type: "screenshot" | "file" | "drawing";
|
|
385
|
-
url: string;
|
|
386
|
-
thumbnail?: string;
|
|
387
|
-
filename?: string;
|
|
388
|
-
size?: number;
|
|
389
|
-
}
|
|
390
|
-
export interface TextSelection {
|
|
391
|
-
text: string;
|
|
392
|
-
startOffset: number;
|
|
393
|
-
endOffset: number;
|
|
394
|
-
element: string;
|
|
395
|
-
xpath: string;
|
|
396
|
-
}
|
|
397
|
-
export interface DrawingData {
|
|
398
|
-
type: "svg";
|
|
399
|
-
paths: DrawingPath[];
|
|
400
|
-
viewport: Viewport;
|
|
401
|
-
}
|
|
402
|
-
export interface DrawingPath {
|
|
403
|
-
type: "path" | "line" | "rectangle" | "circle" | "text";
|
|
404
|
-
d?: string;
|
|
405
|
-
stroke: string;
|
|
406
|
-
strokeWidth: number;
|
|
407
|
-
fill: string;
|
|
408
|
-
x?: number;
|
|
409
|
-
y?: number;
|
|
410
|
-
width?: number;
|
|
411
|
-
height?: number;
|
|
412
|
-
text?: string;
|
|
413
|
-
}
|
|
414
|
-
export type ConnectionStatus = "connected" | "connecting" | "disconnected" | "error";
|
|
415
|
-
export type CommentMode = "comment" | "draw" | "highlight" | "screenshot" | "select";
|
|
416
|
-
export type PageFilter = "all" | "current";
|
|
417
|
-
export type StatusFilter = "all" | "open" | "resolved" | "complete";
|
|
418
|
-
export type SortOrder = "newest" | "oldest" | "priority" | "most-replies";
|
|
419
|
-
export type PriorityFilter = "all" | "low" | "medium" | "high" | "urgent";
|
|
420
|
-
export type UserFilter = "all" | "mine";
|
|
421
|
-
export type AssigneeFilter = "all" | "unassigned" | string;
|
|
422
|
-
export interface CommentFilter {
|
|
423
|
-
status: StatusFilter;
|
|
424
|
-
priority: PriorityFilter;
|
|
425
|
-
user: UserFilter;
|
|
426
|
-
assignee?: AssigneeFilter;
|
|
427
|
-
page?: PageFilter;
|
|
428
|
-
sortOrder?: SortOrder;
|
|
429
|
-
searchQuery?: string;
|
|
430
|
-
}
|
|
431
|
-
export type ToolType = CommentMode | null;
|
|
432
|
-
export type PanelView = "list" | "detail" | "settings" | "activity" | "dev-export";
|
|
433
|
-
export interface ActivityItem {
|
|
434
|
-
id: string;
|
|
435
|
-
type: "comment_created" | "comment_updated" | "comment_deleted" | "comment_resolved" | "comment_completed" | "reply_added" | "user_joined" | "user_left";
|
|
436
|
-
user: {
|
|
437
|
-
id: string;
|
|
438
|
-
name: string;
|
|
439
|
-
avatarUrl?: string;
|
|
440
|
-
};
|
|
441
|
-
threadId?: string;
|
|
442
|
-
message: string;
|
|
443
|
-
timestamp: string;
|
|
444
|
-
read?: boolean;
|
|
445
|
-
}
|
|
446
|
-
export type OtpStep = "idle" | "requesting" | "verifying" | "mfa";
|
|
447
|
-
export interface Mention {
|
|
448
|
-
userId: string;
|
|
449
|
-
name: string;
|
|
450
|
-
index?: number;
|
|
451
|
-
}
|
|
452
|
-
export interface CommentQuery {
|
|
453
|
-
pagePath?: string;
|
|
454
|
-
status?: StatusFilter;
|
|
455
|
-
priority?: PriorityFilter;
|
|
456
|
-
user?: "me";
|
|
457
|
-
assignee?: string;
|
|
458
|
-
search?: string;
|
|
459
|
-
sort?: "newest" | "oldest" | "priority";
|
|
460
|
-
excludeComplete?: boolean;
|
|
461
|
-
}
|
|
462
|
-
export interface PaginationInfo {
|
|
463
|
-
nextCursor?: string | null;
|
|
464
|
-
total: number;
|
|
465
|
-
hasMore: boolean;
|
|
466
|
-
page: number;
|
|
467
|
-
limit: number;
|
|
468
|
-
}
|
|
469
|
-
export interface QueuedMutation {
|
|
470
|
-
id: string;
|
|
471
|
-
/** Authenticated author captured at enqueue time. Legacy entries without an owner cannot replay. */
|
|
472
|
-
ownerId?: string;
|
|
473
|
-
type: "createComment" | "createHighlight" | "createDrawing" | "updateComment" | "deleteComment" | "resolveComment" | "unresolveComment" | "completeComment" | "addReply" | "reactToComment" | "updatePosition";
|
|
474
|
-
args: any[];
|
|
475
|
-
timestamp: number;
|
|
476
|
-
retries: number;
|
|
477
|
-
/**
|
|
478
|
-
* Id of the optimistic (temp_*) entity this mutation created, when any.
|
|
479
|
-
* Used to reconcile the optimistic record with the server response on replay
|
|
480
|
-
* so temp ids don't survive (and realtime echoes don't duplicate them).
|
|
481
|
-
*/
|
|
482
|
-
tempId?: string;
|
|
483
|
-
}
|
|
484
|
-
export type StateSlice = "auth" | "ui" | "comments" | "realtime";
|
|
485
|
-
export type ScreenshotProvider = (element: HTMLElement, options?: ScreenshotOptions) => Promise<ScreenshotResult>;
|
|
486
|
-
export interface CommentKitConfig {
|
|
487
|
-
/** Optional actual deployment branch, e.g. from your build environment. */
|
|
488
|
-
branch?: string;
|
|
489
|
-
/** API key from the CommentKit dashboard. */
|
|
490
|
-
apiKey: string;
|
|
491
|
-
/** Short-lived member token from your backend. Verified against /auth/me before sign-in. */
|
|
492
|
-
authToken?: string;
|
|
493
|
-
/** "memory" keeps bearer sessions and offline edits out of browser storage. Default: "session". */
|
|
494
|
-
persistence?: "memory" | "session";
|
|
495
|
-
/** API base URL override. Useful for self-hosted, staging, and local API deployments. */
|
|
496
|
-
baseUrl?: string;
|
|
497
|
-
/** Enable or disable the widget. Default: true */
|
|
498
|
-
enabled?: boolean;
|
|
499
|
-
/** Custom screenshot provider. When set, html2canvas is not required. */
|
|
500
|
-
screenshotProvider?: ScreenshotProvider;
|
|
501
|
-
ui?: {
|
|
502
|
-
/** Color theme. Auto-detects from .dark class or system preference. */
|
|
503
|
-
theme?: "light" | "dark" | "auto";
|
|
504
|
-
/** Toolbar position. Default: "bottom-right" */
|
|
505
|
-
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
506
|
-
/**
|
|
507
|
-
* Load the Geist font from the Google Fonts CDN when the host page
|
|
508
|
-
* doesn't already provide it. Default: false — injecting a third-party
|
|
509
|
-
* CDN request into the host page is opt-in (privacy/CSP); without it the
|
|
510
|
-
* widget falls back to the system font stack.
|
|
511
|
-
*/
|
|
512
|
-
loadRemoteFonts?: boolean;
|
|
513
|
-
/**
|
|
514
|
-
* Element-selector activation behavior. Default: `{ mode: "toggle" }`.
|
|
515
|
-
* - `toggle`: clicking the Element button (or pressing Alt+E) toggles the
|
|
516
|
-
* tool on/off — standard behavior.
|
|
517
|
-
* - `hold`: the tool is active only while `key` is held. Releasing the key
|
|
518
|
-
* deactivates it. Use when developers want to grab quickly without
|
|
519
|
-
* leaving select mode latched on.
|
|
520
|
-
*/
|
|
521
|
-
activation?: {
|
|
522
|
-
mode?: "toggle" | "hold";
|
|
523
|
-
key?: "Alt" | "Meta" | "Control" | "Shift";
|
|
524
|
-
};
|
|
525
|
-
};
|
|
526
|
-
/**
|
|
527
|
-
* Realtime collaboration tuning. Live cursors are a firehose on busy
|
|
528
|
-
* projects — a client receives up to (online peers × ~30fps) cursor events —
|
|
529
|
-
* so they are bounded by default and can be disabled for large deployments.
|
|
530
|
-
*/
|
|
531
|
-
realtime?: {
|
|
532
|
-
/**
|
|
533
|
-
* Broadcast and render live peer cursors. Default: true. Set false on
|
|
534
|
-
* high-concurrency projects (hundreds of simultaneous viewers) where
|
|
535
|
-
* cursor sharing is neither useful nor affordable — this stops outbound
|
|
536
|
-
* cursor whispers and drops inbound cursor events entirely.
|
|
537
|
-
*/
|
|
538
|
-
cursors?: boolean;
|
|
539
|
-
/**
|
|
540
|
-
* Track and surface the online-users presence list. Default: true. Set
|
|
541
|
-
* false to skip presence bookkeeping (the underlying presence channel is
|
|
542
|
-
* still used for comment broadcasts; only the online-users UI is dropped).
|
|
543
|
-
*/
|
|
544
|
-
presence?: boolean;
|
|
545
|
-
/**
|
|
546
|
-
* Max number of DISTINCT remote cursors rendered at once. Default 24.
|
|
547
|
-
* Bounds inbound cursor processing regardless of how many peers are
|
|
548
|
-
* online: once this many peers are active, further peers' cursors are
|
|
549
|
-
* dropped until an existing one goes idle.
|
|
550
|
-
*/
|
|
551
|
-
maxRenderedCursors?: number;
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* Internal resolved config. Extends the public config with properties
|
|
556
|
-
* that are auto-detected at runtime or read from the API response.
|
|
557
|
-
* Consumers never set these directly.
|
|
558
|
-
*/
|
|
559
|
-
export interface ResolvedConfig extends CommentKitConfig {
|
|
560
|
-
projectId?: string;
|
|
561
|
-
environment?: CommentEnvironment;
|
|
562
|
-
features?: {
|
|
563
|
-
comments?: boolean;
|
|
564
|
-
drawing?: boolean;
|
|
565
|
-
highlighting?: boolean;
|
|
566
|
-
screenshots?: boolean;
|
|
567
|
-
realtime?: boolean;
|
|
568
|
-
};
|
|
569
|
-
reverb?: {
|
|
570
|
-
key: string;
|
|
571
|
-
host: string;
|
|
572
|
-
port?: number;
|
|
573
|
-
scheme?: "ws" | "wss";
|
|
574
|
-
};
|
|
575
|
-
inviteToken?: string;
|
|
576
|
-
}
|
|
577
|
-
export interface CommentKitState {
|
|
578
|
-
isAuthenticated: boolean;
|
|
579
|
-
isOverlayVisible: boolean;
|
|
580
|
-
isCommentModeActive: boolean;
|
|
581
|
-
isDrawingModeActive: boolean;
|
|
582
|
-
isHighlightModeActive: boolean;
|
|
583
|
-
isScreenshotModeActive: boolean;
|
|
584
|
-
isSidebarVisible: boolean;
|
|
585
|
-
isLoginModalVisible: boolean;
|
|
586
|
-
isShortcutsOverlayVisible: boolean;
|
|
587
|
-
currentUser: User | null;
|
|
588
|
-
project: Project | null;
|
|
589
|
-
projectContext?: ProjectContext | null;
|
|
590
|
-
activeBranch?: string | null;
|
|
591
|
-
comments: Comment[];
|
|
592
|
-
commentQuery?: CommentQuery;
|
|
593
|
-
loadingThreadId?: string | null;
|
|
594
|
-
activeTool: ToolType;
|
|
595
|
-
selectedComment: Comment | null;
|
|
596
|
-
activeComment: Comment | null;
|
|
597
|
-
activeDrawing: DrawingData | null;
|
|
598
|
-
activeScreenshot: ScreenshotResult | null;
|
|
599
|
-
onlineUsers: User[];
|
|
600
|
-
connectionStatus: ConnectionStatus;
|
|
601
|
-
activities: ActivityItem[];
|
|
602
|
-
seenThreadIds: Set<string>;
|
|
603
|
-
panelView: PanelView;
|
|
604
|
-
isLoading: boolean;
|
|
605
|
-
error: string | null;
|
|
606
|
-
otpStep: OtpStep;
|
|
607
|
-
otpEmail: string | null;
|
|
608
|
-
/** In-memory, short-lived second-factor challenge; never persisted. */
|
|
609
|
-
otpMfaChallenge: string | null;
|
|
610
|
-
pagination: PaginationInfo | null;
|
|
611
|
-
pendingMutations: QueuedMutation[];
|
|
612
|
-
isOnline: boolean;
|
|
613
|
-
}
|
|
614
|
-
export interface AuthResponse {
|
|
615
|
-
success: boolean;
|
|
616
|
-
valid: boolean;
|
|
617
|
-
matched: boolean;
|
|
618
|
-
otpRequired?: boolean;
|
|
619
|
-
token?: string;
|
|
620
|
-
user?: User;
|
|
621
|
-
project?: Project;
|
|
622
|
-
}
|
|
623
|
-
export interface OtpResponse {
|
|
624
|
-
success: boolean;
|
|
625
|
-
message: string;
|
|
626
|
-
expiresIn?: number;
|
|
627
|
-
}
|
|
628
|
-
export interface OtpVerifyResponse {
|
|
629
|
-
success: boolean;
|
|
630
|
-
verified: boolean;
|
|
631
|
-
token?: string;
|
|
632
|
-
user?: User;
|
|
633
|
-
project?: Project;
|
|
634
|
-
mfaRequired?: boolean;
|
|
635
|
-
challenge?: string;
|
|
636
|
-
expiresIn?: number;
|
|
637
|
-
}
|
|
638
|
-
export interface SessionVerificationResponse {
|
|
639
|
-
success: boolean;
|
|
640
|
-
verified: boolean;
|
|
641
|
-
user: User;
|
|
642
|
-
project: Project;
|
|
643
|
-
}
|
|
644
|
-
export interface InviteValidationResponse {
|
|
645
|
-
accessScope?: "workspace" | "project";
|
|
646
|
-
invitationChallenge?: string | null;
|
|
647
|
-
success: boolean;
|
|
648
|
-
message: string;
|
|
649
|
-
user: User;
|
|
650
|
-
project: Project;
|
|
651
|
-
}
|
|
652
|
-
export interface ApiError {
|
|
653
|
-
error: string;
|
|
654
|
-
message: string;
|
|
655
|
-
code: number;
|
|
656
|
-
details?: Record<string, unknown>;
|
|
657
|
-
}
|
|
658
|
-
export interface CommentKitEvents {
|
|
659
|
-
"comment:created": Comment;
|
|
660
|
-
"comment:updated": Comment;
|
|
661
|
-
"comment:deleted": {
|
|
662
|
-
id: string;
|
|
663
|
-
};
|
|
664
|
-
"comment:resolved": Comment;
|
|
665
|
-
"comment:completed": Comment;
|
|
666
|
-
"comment:reaction": {
|
|
667
|
-
commentId: string;
|
|
668
|
-
emoji: string;
|
|
669
|
-
comment: Comment;
|
|
670
|
-
};
|
|
671
|
-
"comment:position": {
|
|
672
|
-
commentId: string;
|
|
673
|
-
position: Position;
|
|
674
|
-
};
|
|
675
|
-
"auth:login": User;
|
|
676
|
-
"auth:logout": void;
|
|
677
|
-
"auth:otp-requested": {
|
|
678
|
-
email: string;
|
|
679
|
-
expiresIn?: number;
|
|
680
|
-
};
|
|
681
|
-
"auth:otp-verified": User;
|
|
682
|
-
"tool:changed": ToolType;
|
|
683
|
-
"overlay:toggled": boolean;
|
|
684
|
-
"sidebar:toggled": boolean;
|
|
685
|
-
"shortcuts:toggled": boolean;
|
|
686
|
-
"loginmodal:toggled": boolean;
|
|
687
|
-
"state:changed": CommentKitState;
|
|
688
|
-
"connection:changed": ConnectionStatus;
|
|
689
|
-
"activity:new": ActivityItem;
|
|
690
|
-
"deeplink:navigate": {
|
|
691
|
-
commentId: string;
|
|
692
|
-
};
|
|
693
|
-
"offline:queued": QueuedMutation;
|
|
694
|
-
"offline:retrying": {
|
|
695
|
-
id: string;
|
|
696
|
-
attempt: number;
|
|
697
|
-
};
|
|
698
|
-
"offline:completed": {
|
|
699
|
-
id: string;
|
|
700
|
-
};
|
|
701
|
-
"offline:failed": {
|
|
702
|
-
id: string;
|
|
703
|
-
error: ApiError;
|
|
704
|
-
};
|
|
705
|
-
error: ApiError;
|
|
706
|
-
"cursor:move": CursorPosition;
|
|
707
|
-
"cursor:leave": {
|
|
708
|
-
userId: string;
|
|
709
|
-
};
|
|
710
|
-
"user:joined": User;
|
|
711
|
-
"user:left": {
|
|
712
|
-
userId: string;
|
|
713
|
-
};
|
|
714
|
-
"presence:update": {
|
|
715
|
-
users: User[];
|
|
716
|
-
};
|
|
717
|
-
"drawing:stroke": {
|
|
718
|
-
userId: string;
|
|
719
|
-
path: DrawingPath;
|
|
720
|
-
};
|
|
721
|
-
"sdk:outdated": {
|
|
722
|
-
current: string;
|
|
723
|
-
latest: string;
|
|
724
|
-
};
|
|
725
|
-
"agent:context-copied": {
|
|
726
|
-
commentCount: number;
|
|
727
|
-
sourceResolved?: boolean;
|
|
728
|
-
};
|
|
729
|
-
"agent:element-grabbed": {
|
|
730
|
-
source: string | null;
|
|
731
|
-
componentName: string | null;
|
|
732
|
-
};
|
|
733
|
-
"agent:elements-grabbed": {
|
|
734
|
-
count: number;
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
export type EventListener<T = any> = (data: T) => void;
|
|
738
|
-
export type Unsubscribe = () => void;
|
|
739
|
-
export interface ScreenshotOptions {
|
|
740
|
-
element?: HTMLElement;
|
|
741
|
-
quality?: number;
|
|
742
|
-
format?: "png" | "jpeg";
|
|
743
|
-
}
|
|
744
|
-
export interface ScreenshotResult {
|
|
745
|
-
dataUrl: string;
|
|
746
|
-
blob: Blob;
|
|
747
|
-
dimensions: {
|
|
748
|
-
width: number;
|
|
749
|
-
height: number;
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
export type RealtimeMessageType = "cursor_move" | "cursor_leave" | "comment_created" | "comment_updated" | "comment_deleted" | "comment_resolved" | "comment_completed" | "reply_added" | "reaction_added" | "reaction_removed" | "drawing_stroke" | "user_joined" | "user_left";
|
|
753
|
-
/** @deprecated Use Reverb broadcasting events instead. Kept for backward compatibility. */
|
|
754
|
-
export interface RealtimeMessage {
|
|
755
|
-
type: RealtimeMessageType | "presence_request" | "presence_response" | "auth" | "ping" | "pong";
|
|
756
|
-
userId: string;
|
|
757
|
-
data: unknown;
|
|
758
|
-
timestamp: string;
|
|
759
|
-
}
|
|
760
|
-
export interface CursorPosition {
|
|
761
|
-
x: number;
|
|
762
|
-
y: number;
|
|
763
|
-
page: string;
|
|
764
|
-
user: User;
|
|
765
|
-
}
|
|
766
|
-
export interface ReactCommentKitProps extends CommentKitConfig {
|
|
767
|
-
children?: unknown;
|
|
768
|
-
onReady?: () => void;
|
|
769
|
-
onError?: (error: ApiError) => void;
|
|
770
|
-
}
|