@commentkit/comment-kit 0.6.9 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +63 -4
- package/LICENSE +18 -2
- package/README.md +133 -88
- package/SECURITY.md +48 -0
- package/dist/THIRD_PARTY_NOTICES.txt +284 -0
- package/dist/angular.es.js +25 -12
- package/dist/comment-kit.es.js +25 -13
- package/dist/demo.es.js +148 -70
- package/dist/headless.es.js +3 -3
- package/dist/preact.es.js +3 -3
- package/dist/qwik.es.js +1 -110
- package/dist/qwik.qwik.mjs +114 -0
- package/dist/react.es.js +3 -3
- package/dist/shared/annotation-icons-Dh-bmNYK.js +172 -0
- package/dist/shared/annotation-toolbar-cGC1p-SP.js +1093 -0
- package/dist/shared/attachment-refresh-CzQFXHkL.js +94 -0
- package/dist/shared/{bridge-DRE03N9X.js → bridge-CJoGYngu.js} +6 -3
- package/dist/shared/{button-group-CHfMRXyA.js → button-group-CWdKaOlC.js} +14 -16
- package/dist/shared/capture-colors-CxSLsU5-.js +74 -0
- package/dist/shared/comment-drawing-canvas-DdXlMgbF.js +124 -0
- package/dist/shared/comment-icon-Dg9ZWpz-.js +608 -0
- package/dist/shared/comment-image-lightbox-B7iHjnAz.js +190 -0
- package/dist/shared/comment-images-content-D7YNUgo5.js +214 -0
- package/dist/shared/{comment-kit-core-D0kY00St.js → comment-kit-core-C862uNAm.js} +1371 -853
- package/dist/shared/comment-kit-ui-0vd-DY4S.js +19977 -0
- package/dist/shared/comment-screenshot-annotator-DcaSSuWB.js +151 -0
- package/dist/shared/comment-screenshot-overlay-D_nFoJmM.js +207 -0
- package/dist/shared/{dev-export-panel-BLngcr5q.js → dev-export-panel-pWBlhlse.js} +8 -8
- package/dist/shared/dev-grab-eQ9EgEGY.js +210 -0
- package/dist/shared/dist-De294MVF.js +623 -0
- package/dist/shared/{element-selector-CtFzgHvq.js → element-selector-DC-_XJ0k.js} +350 -305
- package/dist/shared/{icons-BSHCWYO1.js → icons-nzMOLzrm.js} +2 -3
- package/dist/shared/{mount-ui-CVivB_eQ.js → mount-ui-B68j8r6I.js} +4 -4
- package/dist/shared/{pusher-BEl7Qn-8.js → pusher-C1FHQGXV.js} +1 -1
- package/dist/shared/realtime-Diqz7G_y.js +317 -0
- package/dist/shared/realtime-recovery-DJ_adc-H.js +135 -0
- package/dist/shared/{separator-DusFNTs-.js → separator-XDBsaWyw.js} +891 -785
- package/dist/shared/{shadow-root-CmYXiSRR.js → shadow-root-CrO75sED.js} +1 -1
- package/dist/shared/styles-C9Jwvm0Q.js +2 -0
- package/dist/shared/useRender-D1z_X_BY.js +5 -0
- package/dist/shared/{useValueChanged-DQXLia-2.js → useValueChanged-CrzfD8l-.js} +15 -15
- package/dist/shared/{validation-C7QG8j7Z.js → validation-D-8u4M7I.js} +14 -1
- package/dist/shared/{websocket-manager-BTRqNTB7.js → websocket-manager-CFak_YHy.js} +148 -89
- package/dist/solid.es.js +3 -3
- package/dist/svelte.es.js +3 -3
- package/dist/types/adapters/bridge.d.ts +9 -12
- package/dist/types/angular/index.d.ts +15 -5
- package/dist/types/core/api-client.d.ts +24 -18
- package/dist/types/core/comment-kit-core.d.ts +28 -11
- package/dist/types/core/local-demo.d.ts +1 -0
- package/dist/types/core/types.d.ts +103 -0
- package/dist/types/core/websocket-manager.d.ts +12 -0
- package/dist/types/core/write-access.d.ts +9 -0
- package/dist/types/headless.d.ts +1 -1
- package/dist/types/index.d.ts +8 -4
- package/dist/types/qwik/index.d.ts +4 -1
- package/dist/vue.es.js +3 -3
- package/docs/api-reference.md +378 -0
- package/docs/local-demo.md +60 -0
- package/package.json +17 -6
- package/dist/shared/annotation-toolbar-pX17NLmJ.js +0 -1104
- package/dist/shared/clamp-CcFVX0vC.js +0 -55
- package/dist/shared/comment-drawing-canvas-CYu5SwRf.js +0 -126
- package/dist/shared/comment-image-lightbox-0VdAs2iT.js +0 -178
- package/dist/shared/comment-kit-ui-D2j2gvnm.js +0 -16685
- package/dist/shared/comment-screenshot-annotator-BuojwviY.js +0 -137
- package/dist/shared/comment-screenshot-overlay-BZX0Vcb8.js +0 -144
- package/dist/shared/dev-grab-pDAfH2lr.js +0 -203
- package/dist/shared/local-demo-context-BohlYbHt.js +0 -6
- package/dist/shared/realtime-BG_t_ze7.js +0 -281
- package/dist/shared/resolveAriaLabelledBy-CIKpnjNJ.js +0 -669
- package/dist/shared/styles-D_FEJZ9G.js +0 -2
- package/dist/shared/useLabelableId-DGbfdMi_.js +0 -155
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type CommentWriteAccess } from "./write-access";
|
|
1
2
|
import { EventEmitter } from "../utils/event-emitter";
|
|
2
3
|
import type { LocalDemoStore } from "./local-demo";
|
|
3
|
-
import type { AgentContextExport, AgentContextOptions, Comment, CommentKitConfig, CommentKitState, DevGrabBundle, DevGrabOptions, DevGrabResult, DrawingData, DrawingPath, Position, ResolvedConfig, ScreenshotResult, StateSlice,
|
|
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
5
|
/**
|
|
5
6
|
* Current SDK version — compared against the backend's sdkLatestVersion on
|
|
6
7
|
* init. Injected from package.json at build time (vite `define`) so it can't
|
|
@@ -25,6 +26,15 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
25
26
|
private offlineHandler;
|
|
26
27
|
private initialized;
|
|
27
28
|
private destroyed;
|
|
29
|
+
private sessionRevision;
|
|
30
|
+
private writeRestriction;
|
|
31
|
+
private authRequestRevision;
|
|
32
|
+
private commentsFetchRevision;
|
|
33
|
+
private contextFetchRevision;
|
|
34
|
+
private deepLinkRequest;
|
|
35
|
+
private reactionRequests;
|
|
36
|
+
private draftUploads;
|
|
37
|
+
private attachmentRefreshes;
|
|
28
38
|
private screenshotProvider;
|
|
29
39
|
private bootRetryTimer;
|
|
30
40
|
private bootAttempts;
|
|
@@ -79,6 +89,10 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
79
89
|
* Use this instead of accessing config directly.
|
|
80
90
|
*/
|
|
81
91
|
getFeatures(): NonNullable<ResolvedConfig["features"]>;
|
|
92
|
+
/** Whether this project currently permits comment mutations (independent of login). */
|
|
93
|
+
canWriteComments(): boolean;
|
|
94
|
+
getWriteAccess(): CommentWriteAccess;
|
|
95
|
+
private requireCommentWrite;
|
|
82
96
|
/**
|
|
83
97
|
* Get the public configuration (excludes internal auto-detected fields
|
|
84
98
|
* such as projectId and reverb connection details).
|
|
@@ -109,6 +123,7 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
109
123
|
private restorePersistedSession;
|
|
110
124
|
/** Shared post-auth path used by OTP verify and session restore. */
|
|
111
125
|
private afterAuthenticated;
|
|
126
|
+
private beginAuthRequest;
|
|
112
127
|
login(email: string): Promise<void>;
|
|
113
128
|
private otpFailedAttempts;
|
|
114
129
|
private otpCooldownUntil;
|
|
@@ -130,6 +145,7 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
130
145
|
private operationContext;
|
|
131
146
|
private operationCallbacks;
|
|
132
147
|
private loadMoreGuard;
|
|
148
|
+
private commentsRequestContext;
|
|
133
149
|
private loadComments;
|
|
134
150
|
loadMoreComments(): Promise<void>;
|
|
135
151
|
/**
|
|
@@ -138,23 +154,24 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
138
154
|
* loaded, this refreshes existing data — e.g. to pick up remote edits.
|
|
139
155
|
*/
|
|
140
156
|
reloadComments(): Promise<void>;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
157
|
+
/** @internal Refresh signed attachment links without discarding pagination or local edits. */
|
|
158
|
+
refreshAttachmentUrl(attachmentId: string): Promise<string | null>;
|
|
159
|
+
/** Refresh authenticated member, plan and usage data without fabricating demo values. */
|
|
160
|
+
reloadProjectContext(): Promise<void>;
|
|
161
|
+
setBranch(branch: string | null): Promise<void>;
|
|
162
|
+
/** Upload drafts before creating their record. Reuse successful uploads if saving is retried. */
|
|
163
|
+
uploadDraftFiles(files: File[]): Promise<string[]>;
|
|
164
|
+
createComment(type: "pin" | "highlight" | "drawing", content: string, position: Position, priority?: "low" | "medium" | "high" | "urgent", textSelection?: TextSelection, drawingData?: DrawingData, options?: CommentCreateOptions): Promise<void>;
|
|
148
165
|
updateComment(commentId: string, updates: Partial<Comment>): Promise<void>;
|
|
149
166
|
deleteComment(commentId: string): Promise<void>;
|
|
150
|
-
addReply(commentId: string, content: string): Promise<void>;
|
|
151
|
-
updateReply(commentId: string, replyId: string, content: string): Promise<void>;
|
|
167
|
+
addReply(commentId: string, content: string, options?: ReplyOptions): Promise<void>;
|
|
168
|
+
updateReply(commentId: string, replyId: string, content: string, options?: ReplyOptions): Promise<void>;
|
|
152
169
|
deleteReply(commentId: string, replyId: string): Promise<void>;
|
|
153
170
|
resolveComment(commentId: string): Promise<void>;
|
|
154
171
|
unresolveComment(commentId: string): Promise<void>;
|
|
155
172
|
selectComment(comment: Comment | null): void;
|
|
156
173
|
completeComment(commentId: string): Promise<void>;
|
|
157
|
-
reactToComment(commentId: string, emoji: string): Promise<void>;
|
|
174
|
+
reactToComment(commentId: string, emoji: string, replyId?: string): Promise<void>;
|
|
158
175
|
updateCommentPosition(commentId: string, x: number, y: number): Promise<void>;
|
|
159
176
|
private offlinePersistUnsub;
|
|
160
177
|
/**
|
|
@@ -74,9 +74,24 @@ export interface AgentCommentContext {
|
|
|
74
74
|
author: Pick<User, "id" | "name" | "email">;
|
|
75
75
|
createdAt: string;
|
|
76
76
|
updatedAt: string;
|
|
77
|
+
environment?: CommentEnvironment;
|
|
78
|
+
branch?: string;
|
|
79
|
+
deviceInfo?: CommentDeviceInfo;
|
|
80
|
+
description?: string;
|
|
81
|
+
assignees?: Array<Pick<User, "id" | "name" | "email">>;
|
|
82
|
+
mentions?: Mention[];
|
|
83
|
+
checklist?: TaskChecklistItem[];
|
|
84
|
+
reactions?: CommentReaction[];
|
|
85
|
+
isEdited?: boolean;
|
|
86
|
+
resolvedAt?: string;
|
|
87
|
+
completedAt?: string;
|
|
77
88
|
page: Comment["page"];
|
|
78
89
|
position: Position;
|
|
90
|
+
textSelection?: TextSelection;
|
|
91
|
+
drawingData?: DrawingData;
|
|
79
92
|
element: AgentElementContext;
|
|
93
|
+
/** All files and annotations attached to the feedback, not only the first screenshot. */
|
|
94
|
+
attachments?: Attachment[];
|
|
80
95
|
/** Stakeholder-attached screenshot (data URL or remote URL), when present. */
|
|
81
96
|
screenshotUrl?: string;
|
|
82
97
|
replies: Array<{
|
|
@@ -84,6 +99,11 @@ export interface AgentCommentContext {
|
|
|
84
99
|
content: string;
|
|
85
100
|
author: Pick<User, "id" | "name" | "email">;
|
|
86
101
|
createdAt: string;
|
|
102
|
+
isEdited?: boolean;
|
|
103
|
+
replyTo?: Reply["replyTo"];
|
|
104
|
+
mentions?: Mention[];
|
|
105
|
+
reactions?: CommentReaction[];
|
|
106
|
+
attachments?: Attachment[];
|
|
87
107
|
}>;
|
|
88
108
|
}
|
|
89
109
|
export interface AgentContextExport {
|
|
@@ -96,6 +116,19 @@ export interface AgentContextExport {
|
|
|
96
116
|
title: string;
|
|
97
117
|
};
|
|
98
118
|
comments: AgentCommentContext[];
|
|
119
|
+
/** Identifiers only: API keys, auth tokens and project settings are never exported. */
|
|
120
|
+
project?: Pick<Project, "id" | "name" | "slug">;
|
|
121
|
+
/** Export scope describes the loaded snapshot; it does not fetch additional pages. */
|
|
122
|
+
scope?: {
|
|
123
|
+
activeBranch: string | null;
|
|
124
|
+
currentPageOnly: boolean;
|
|
125
|
+
includeResolved: boolean;
|
|
126
|
+
loadedCommentCount: number;
|
|
127
|
+
matchingCommentCount: number;
|
|
128
|
+
exportedCommentCount: number;
|
|
129
|
+
hasMoreOnServer: boolean;
|
|
130
|
+
truncated: boolean;
|
|
131
|
+
};
|
|
99
132
|
/** True when source resolution succeeded for at least one comment. */
|
|
100
133
|
sourceResolved: boolean;
|
|
101
134
|
}
|
|
@@ -197,6 +230,59 @@ export interface Project {
|
|
|
197
230
|
createdAt?: string;
|
|
198
231
|
updatedAt?: string;
|
|
199
232
|
}
|
|
233
|
+
/** Authenticated project data used by the embedded member and settings views. */
|
|
234
|
+
export interface ProjectContext {
|
|
235
|
+
project: Pick<Project, "id" | "name" | "slug">;
|
|
236
|
+
organization: {
|
|
237
|
+
id: string;
|
|
238
|
+
name: string;
|
|
239
|
+
plan: "none" | "pro" | "ltd";
|
|
240
|
+
};
|
|
241
|
+
members: Array<User & {
|
|
242
|
+
role: "owner" | "admin" | "member";
|
|
243
|
+
}>;
|
|
244
|
+
usage: {
|
|
245
|
+
used: number;
|
|
246
|
+
limit: number | null;
|
|
247
|
+
label: string;
|
|
248
|
+
};
|
|
249
|
+
branches: Array<{
|
|
250
|
+
name: string;
|
|
251
|
+
}>;
|
|
252
|
+
permissions: {
|
|
253
|
+
canManageComments: boolean;
|
|
254
|
+
canInvite: boolean;
|
|
255
|
+
canWriteComments?: boolean;
|
|
256
|
+
writeRestriction?: "plan_required" | "feature_disabled" | null;
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
export interface CommentDeviceInfo {
|
|
260
|
+
browser: string;
|
|
261
|
+
os: string;
|
|
262
|
+
windowSize: string;
|
|
263
|
+
devicePixelRatio: number;
|
|
264
|
+
deployment?: string;
|
|
265
|
+
type: "desktop" | "mobile";
|
|
266
|
+
}
|
|
267
|
+
export interface ReplyTarget {
|
|
268
|
+
id: string;
|
|
269
|
+
type: "comment" | "reply";
|
|
270
|
+
}
|
|
271
|
+
export interface ReplyOptions {
|
|
272
|
+
attachmentIds?: Array<string | number>;
|
|
273
|
+
mentions?: Mention[];
|
|
274
|
+
replyTo?: ReplyTarget;
|
|
275
|
+
}
|
|
276
|
+
export interface CommentCreateOptions {
|
|
277
|
+
description?: string;
|
|
278
|
+
assignees?: User[];
|
|
279
|
+
checklist?: TaskChecklistItem[];
|
|
280
|
+
mentions?: Mention[];
|
|
281
|
+
files?: File[];
|
|
282
|
+
attachmentIds?: Array<string | number>;
|
|
283
|
+
branch?: string;
|
|
284
|
+
deviceInfo?: CommentDeviceInfo;
|
|
285
|
+
}
|
|
200
286
|
export type TaskStatus = "open" | "resolved" | "complete";
|
|
201
287
|
export interface TaskChecklistItem {
|
|
202
288
|
id: string;
|
|
@@ -205,6 +291,8 @@ export interface TaskChecklistItem {
|
|
|
205
291
|
sortOrder?: number;
|
|
206
292
|
}
|
|
207
293
|
export interface CommentReaction {
|
|
294
|
+
/** Participant IDs let realtime consumers derive their own reacted state. */
|
|
295
|
+
userIds?: string[];
|
|
208
296
|
emoji: string;
|
|
209
297
|
count: number;
|
|
210
298
|
reacted: boolean;
|
|
@@ -225,11 +313,15 @@ export interface Comment {
|
|
|
225
313
|
status: TaskStatus;
|
|
226
314
|
priority: "low" | "medium" | "high" | "urgent";
|
|
227
315
|
environment?: CommentEnvironment;
|
|
316
|
+
branch?: string;
|
|
317
|
+
deviceInfo?: CommentDeviceInfo;
|
|
228
318
|
author: User;
|
|
229
319
|
userId: string;
|
|
230
320
|
createdAt: string;
|
|
231
321
|
updatedAt: string;
|
|
232
322
|
isEdited?: boolean;
|
|
323
|
+
resolvedAt?: string;
|
|
324
|
+
completedAt?: string;
|
|
233
325
|
page: {
|
|
234
326
|
url: string;
|
|
235
327
|
path: string;
|
|
@@ -246,6 +338,10 @@ export interface Comment {
|
|
|
246
338
|
drawingData?: DrawingData;
|
|
247
339
|
}
|
|
248
340
|
export interface Reply {
|
|
341
|
+
replyTo?: ReplyTarget & {
|
|
342
|
+
authorName: string;
|
|
343
|
+
body: string;
|
|
344
|
+
};
|
|
249
345
|
id: string;
|
|
250
346
|
content: string;
|
|
251
347
|
author: User;
|
|
@@ -256,6 +352,7 @@ export interface Reply {
|
|
|
256
352
|
attachments?: Attachment[];
|
|
257
353
|
}
|
|
258
354
|
export interface Attachment {
|
|
355
|
+
mimeType?: string;
|
|
259
356
|
id: string;
|
|
260
357
|
type: "screenshot" | "file" | "drawing";
|
|
261
358
|
url: string;
|
|
@@ -333,6 +430,8 @@ export interface PaginationInfo {
|
|
|
333
430
|
}
|
|
334
431
|
export interface QueuedMutation {
|
|
335
432
|
id: string;
|
|
433
|
+
/** Authenticated author captured at enqueue time. Legacy entries without an owner cannot replay. */
|
|
434
|
+
ownerId?: string;
|
|
336
435
|
type: "createComment" | "createHighlight" | "createDrawing" | "updateComment" | "deleteComment" | "resolveComment" | "unresolveComment" | "completeComment" | "addReply" | "reactToComment" | "updatePosition";
|
|
337
436
|
args: any[];
|
|
338
437
|
timestamp: number;
|
|
@@ -347,6 +446,8 @@ export interface QueuedMutation {
|
|
|
347
446
|
export type StateSlice = "auth" | "ui" | "comments" | "realtime";
|
|
348
447
|
export type ScreenshotProvider = (element: HTMLElement, options?: ScreenshotOptions) => Promise<ScreenshotResult>;
|
|
349
448
|
export interface CommentKitConfig {
|
|
449
|
+
/** Optional actual deployment branch, e.g. from your build environment. */
|
|
450
|
+
branch?: string;
|
|
350
451
|
/** API key from the CommentKit dashboard. */
|
|
351
452
|
apiKey: string;
|
|
352
453
|
/** API base URL override. Useful for self-hosted, staging, and local API deployments. */
|
|
@@ -443,6 +544,8 @@ export interface CommentKitState {
|
|
|
443
544
|
isShortcutsOverlayVisible: boolean;
|
|
444
545
|
currentUser: User | null;
|
|
445
546
|
project: Project | null;
|
|
547
|
+
projectContext?: ProjectContext | null;
|
|
548
|
+
activeBranch?: string | null;
|
|
446
549
|
comments: Comment[];
|
|
447
550
|
activeTool: ToolType;
|
|
448
551
|
selectedComment: Comment | null;
|
|
@@ -22,9 +22,15 @@ export interface WebSocketConfig {
|
|
|
22
22
|
name: string;
|
|
23
23
|
email: string;
|
|
24
24
|
};
|
|
25
|
+
/** Session-aware authorization; keeps bearer credentials inside the API client. */
|
|
26
|
+
authorizeChannel?: (socketId: string, channelName: string) => Promise<{
|
|
27
|
+
auth: string;
|
|
28
|
+
channel_data: string;
|
|
29
|
+
}>;
|
|
25
30
|
}
|
|
26
31
|
export interface WebSocketEvents {
|
|
27
32
|
connected: void;
|
|
33
|
+
subscribed: void;
|
|
28
34
|
disconnected: {
|
|
29
35
|
code: number;
|
|
30
36
|
reason: string;
|
|
@@ -45,6 +51,10 @@ export interface WebSocketEvents {
|
|
|
45
51
|
};
|
|
46
52
|
"comment:resolved": Comment;
|
|
47
53
|
"comment:completed": Comment;
|
|
54
|
+
"comment:refresh": {
|
|
55
|
+
commentId: string;
|
|
56
|
+
event: "comment:created" | "comment:updated" | "comment:resolved" | "comment:completed";
|
|
57
|
+
};
|
|
48
58
|
"reply:added": {
|
|
49
59
|
commentId: string;
|
|
50
60
|
reply: Reply;
|
|
@@ -86,12 +96,14 @@ export declare class WebSocketManager {
|
|
|
86
96
|
private reconnectAttempts;
|
|
87
97
|
private connecting;
|
|
88
98
|
private destroyed;
|
|
99
|
+
private authorizationGeneration;
|
|
89
100
|
private static readonly MAX_LISTENERS_PER_EVENT;
|
|
90
101
|
constructor(config: WebSocketConfig);
|
|
91
102
|
on<K extends WsEventKey>(event: K, listener: WsListener<WebSocketEvents[K]>): () => void;
|
|
92
103
|
private emit;
|
|
93
104
|
connect(): Promise<void>;
|
|
94
105
|
private openConnection;
|
|
106
|
+
private createChannelAuthorizer;
|
|
95
107
|
/**
|
|
96
108
|
* Ask an existing socket to connect again. When no socket exists yet,
|
|
97
109
|
* this starts the normal connect path.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommentKitState, ResolvedConfig } from "./types";
|
|
2
|
+
export interface CommentWriteAccess {
|
|
3
|
+
canWrite: boolean;
|
|
4
|
+
canManageComments: boolean;
|
|
5
|
+
planRequired: boolean;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
/** Mirrors the server capability. Authentication and authorization remain server enforced. */
|
|
9
|
+
export declare function getCommentWriteAccess(config: Pick<ResolvedConfig, "features">, state: Pick<CommentKitState, "projectContext">, restriction?: "plan_required" | "feature_disabled" | null): CommentWriteAccess;
|
package/dist/types/headless.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { ApiClient, formatMention, parseMentions, stripMentionMarkup } from "./c
|
|
|
3
3
|
export { createAgentContext, formatAgentContext } from "./core/agent-context";
|
|
4
4
|
export { CommentKitCore, SDK_VERSION } from "./core/comment-kit-core";
|
|
5
5
|
export { WebSocketManager } from "./core/websocket-manager";
|
|
6
|
-
export type { ActivityItem, AgentCommentContext, AgentContextExport, AgentContextOptions, AgentElementContext, ApiError, AssigneeFilter, Attachment, AuthResponse, Comment, CommentFilter, CommentKitConfig, CommentKitEvents, CommentKitState, CommentMode, CommentReaction, ConnectionStatus, CursorPosition, DeviceInfo, DevGrabAttachment, DevGrabAttachmentPathSource, DevGrabOptions, DrawingData, DrawingPath, EventListener, InviteValidationResponse, Mention, Organization, OrganizationMember, OtpResponse, OtpStep, OtpVerifyResponse, PageFilter, PaginationInfo, PanelView, Position, PriorityFilter, Project, QueuedMutation, RealtimeMessage, Reply, ScreenshotOptions, ScreenshotProvider, ScreenshotResult, SortOrder, StateSlice, StatusFilter, TaskChecklistItem, TaskStatus, TextSelection, ToolType, Unsubscribe, User, UserFilter, } from "./core/types";
|
|
6
|
+
export type { ActivityItem, AgentCommentContext, AgentContextExport, AgentContextOptions, AgentElementContext, ApiError, AssigneeFilter, Attachment, AuthResponse, Comment, CommentCreateOptions, CommentDeviceInfo, CommentFilter, CommentKitConfig, CommentKitEvents, CommentKitState, CommentMode, CommentReaction, ConnectionStatus, CursorPosition, DeviceInfo, DevGrabAttachment, DevGrabAttachmentPathSource, DevGrabOptions, DrawingData, DrawingPath, EventListener, InviteValidationResponse, Mention, Organization, OrganizationMember, OtpResponse, OtpStep, OtpVerifyResponse, PageFilter, PaginationInfo, PanelView, Position, PriorityFilter, Project, ProjectContext, QueuedMutation, RealtimeMessage, Reply, ReplyOptions, ReplyTarget, ScreenshotOptions, ScreenshotProvider, ScreenshotResult, SortOrder, StateSlice, StatusFilter, TaskChecklistItem, TaskStatus, TextSelection, ToolType, Unsubscribe, User, UserFilter, } from "./core/types";
|
|
7
7
|
export { debounce, findElement, generateId, generateSelector, generateXPath, getCurrentPage, getElementBounds, getSelectionRange, getSelectionText, isElementVisible, isInteractiveElement, percentageToViewport, throttle, viewportToPercentage, } from "./utils/dom";
|
|
8
8
|
export { EventEmitter } from "./utils/event-emitter";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -37,11 +37,14 @@ export declare class CommentKit {
|
|
|
37
37
|
unresolveComment(id: string): Promise<void>;
|
|
38
38
|
completeComment(id: string): Promise<void>;
|
|
39
39
|
selectComment(comment: Parameters<CommentKitCore["selectComment"]>[0]): void;
|
|
40
|
-
addReply(
|
|
41
|
-
updateReply(
|
|
40
|
+
addReply(...args: Parameters<CommentKitCore["addReply"]>): Promise<void>;
|
|
41
|
+
updateReply(...args: Parameters<CommentKitCore["updateReply"]>): Promise<void>;
|
|
42
42
|
deleteReply(commentId: string, replyId: string): Promise<void>;
|
|
43
|
-
reactToComment(
|
|
43
|
+
reactToComment(...args: Parameters<CommentKitCore["reactToComment"]>): Promise<void>;
|
|
44
44
|
updateCommentPosition(commentId: string, x: number, y: number): Promise<void>;
|
|
45
|
+
setBranch(branch: string | null): Promise<void>;
|
|
46
|
+
reloadProjectContext(): Promise<void>;
|
|
47
|
+
reloadComments(): Promise<void>;
|
|
45
48
|
loadMoreComments(): Promise<void>;
|
|
46
49
|
createHighlight(...args: Parameters<CommentKitCore["createHighlight"]>): Promise<void>;
|
|
47
50
|
createDrawing(...args: Parameters<CommentKitCore["createDrawing"]>): Promise<void>;
|
|
@@ -50,12 +53,13 @@ export declare class CommentKit {
|
|
|
50
53
|
captureScreenshot(el?: HTMLElement): Promise<ScreenshotResult | null>;
|
|
51
54
|
uploadScreenshot(...args: Parameters<CommentKitCore["uploadScreenshot"]>): Promise<import("./headless").Comment | null>;
|
|
52
55
|
setActiveScreenshot(screenshot: ScreenshotResult | null): void;
|
|
53
|
-
uploadFiles(
|
|
56
|
+
uploadFiles(...args: Parameters<CommentKitCore["uploadFiles"]>): Promise<string[]>;
|
|
54
57
|
getOnlineUsers(): import("./headless").User[];
|
|
55
58
|
getProjectMembers(): Promise<import("./headless").User[]>;
|
|
56
59
|
toggleShortcutsOverlay(): void;
|
|
57
60
|
markThreadSeen(threadId: string): void;
|
|
58
61
|
isThreadNew(threadId: string): boolean;
|
|
62
|
+
blockEscape(): () => void;
|
|
59
63
|
setPanelView(view: Parameters<CommentKitCore["setPanelView"]>[0]): void;
|
|
60
64
|
markAllActivitiesRead(): void;
|
|
61
65
|
getUnreadActivityCount(): number;
|
|
@@ -66,5 +66,8 @@ export interface QwikCommentKitReturn extends AdapterMethods {
|
|
|
66
66
|
* read the live instance from the returned `core` signal instead:
|
|
67
67
|
* `core.value?.toggleOverlay()`.
|
|
68
68
|
*/
|
|
69
|
-
export declare function useCommentKit
|
|
69
|
+
export declare function useCommentKit(options: QwikCommentKitOptions): QwikCommentKitReturn;
|
|
70
|
+
/** @deprecated Use useCommentKit: its argument is configuration, not a QRL. */
|
|
71
|
+
export { useCommentKit as useCommentKit$ };
|
|
72
|
+
export { useCommentKit as useCommentKitQrl };
|
|
70
73
|
export type { AgentCommentContext, AgentContextExport, AgentContextOptions, AgentElementContext, ApiError, Comment, CommentKitConfig, CommentKitEvents, CommentKitState, ConnectionStatus, DevGrabAttachment, DevGrabAttachmentPathSource, DevGrabOptions, DrawingData, DrawingPath, EventListener, PanelView, Position, ScreenshotResult, StateSlice, TaskChecklistItem, TextSelection, Unsubscribe, User, } from "../core/types";
|
package/dist/vue.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./shared/comment-kit-core-
|
|
2
|
-
import { n as t, r as n, t as r } from "./shared/bridge-
|
|
1
|
+
import { t as e } from "./shared/comment-kit-core-C862uNAm.js";
|
|
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";
|
|
5
5
|
function f(s) {
|
|
@@ -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-
|
|
22
|
+
let { mountCommentKitUI: t } = await import("./shared/mount-ui-B68j8r6I.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) {
|