@commentkit/comment-kit 0.6.9 → 0.7.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 +36 -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 +23 -11
- package/dist/demo.es.js +146 -69
- package/dist/headless.es.js +2 -2
- 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-B9SxYqoF.js +1093 -0
- package/dist/shared/{bridge-DRE03N9X.js → bridge-CJoGYngu.js} +6 -3
- package/dist/shared/{button-group-CHfMRXyA.js → button-group-Cl9CrvvU.js} +1 -1
- package/dist/shared/comment-drawing-canvas-Dzb5YoFw.js +124 -0
- package/dist/shared/{comment-image-lightbox-0VdAs2iT.js → comment-image-lightbox-BPYJT1sB.js} +62 -57
- package/dist/shared/{comment-kit-core-D0kY00St.js → comment-kit-core-BaSuMzp9.js} +1027 -729
- package/dist/shared/comment-kit-ui-CzfdAZs2.js +20181 -0
- package/dist/shared/comment-screenshot-annotator-C7X-_bm6.js +151 -0
- package/dist/shared/comment-screenshot-overlay-wIrZrcRy.js +206 -0
- package/dist/shared/comment-utils-BycYTSxA.js +602 -0
- package/dist/shared/{dev-export-panel-BLngcr5q.js → dev-export-panel-FwFVdady.js} +8 -8
- package/dist/shared/{dev-grab-pDAfH2lr.js → dev-grab-DDqg0LQf.js} +1 -1
- package/dist/shared/dist-De294MVF.js +623 -0
- package/dist/shared/{element-selector-CtFzgHvq.js → element-selector-BhJm-NSs.js} +294 -288
- package/dist/shared/{icons-BSHCWYO1.js → icons-nzMOLzrm.js} +2 -3
- package/dist/shared/{mount-ui-CVivB_eQ.js → mount-ui--ijs8pWT.js} +4 -4
- package/dist/shared/{pusher-BEl7Qn-8.js → pusher-ipHMJnO_.js} +1 -1
- package/dist/shared/{realtime-BG_t_ze7.js → realtime-Dk41VwKg.js} +71 -50
- package/dist/shared/{separator-DusFNTs-.js → separator-XDBsaWyw.js} +891 -785
- package/dist/shared/{shadow-root-CmYXiSRR.js → shadow-root-C5v-T8lQ.js} +1 -1
- package/dist/shared/styles-D3yMtaec.js +2 -0
- package/dist/shared/{useValueChanged-DQXLia-2.js → useValueChanged-CrzfD8l-.js} +15 -15
- package/dist/shared/{websocket-manager-BTRqNTB7.js → websocket-manager-DhLWh3Jr.js} +2 -2
- 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 +16 -17
- package/dist/types/core/comment-kit-core.d.ts +19 -11
- package/dist/types/core/local-demo.d.ts +1 -0
- package/dist/types/core/types.d.ts +68 -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 +372 -0
- package/docs/local-demo.md +60 -0
- package/package.json +16 -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-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/local-demo-context-BohlYbHt.js +0 -6
- 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
|
@@ -67,6 +67,9 @@ export declare class CommentKitService implements OnDestroy {
|
|
|
67
67
|
toggleShortcutsOverlay(): void;
|
|
68
68
|
setPanelView(view: CommentKitState["panelView"]): void;
|
|
69
69
|
loadMoreComments(): Promise<void>;
|
|
70
|
+
reloadComments(): Promise<void>;
|
|
71
|
+
setBranch(...args: Parameters<AdapterMethods["setBranch"]>): Promise<void>;
|
|
72
|
+
reloadProjectContext(): Promise<void>;
|
|
70
73
|
getProjectMembers(): Promise<import("./index.ts").User[]>;
|
|
71
74
|
createComment(...args: Parameters<AdapterMethods["createComment"]>): Promise<void>;
|
|
72
75
|
updateComment(...args: Parameters<AdapterMethods["updateComment"]>): Promise<void>;
|
|
@@ -75,10 +78,10 @@ export declare class CommentKitService implements OnDestroy {
|
|
|
75
78
|
unresolveComment(id: string): Promise<void>;
|
|
76
79
|
completeComment(id: string): Promise<void>;
|
|
77
80
|
selectComment(...args: Parameters<AdapterMethods["selectComment"]>): void;
|
|
78
|
-
addReply(
|
|
79
|
-
updateReply(
|
|
81
|
+
addReply(...args: Parameters<AdapterMethods["addReply"]>): Promise<void>;
|
|
82
|
+
updateReply(...args: Parameters<AdapterMethods["updateReply"]>): Promise<void>;
|
|
80
83
|
deleteReply(commentId: string, replyId: string): Promise<void>;
|
|
81
|
-
reactToComment(
|
|
84
|
+
reactToComment(...args: Parameters<AdapterMethods["reactToComment"]>): Promise<void>;
|
|
82
85
|
updateCommentPosition(commentId: string, x: number, y: number): Promise<void>;
|
|
83
86
|
createHighlight(...args: Parameters<AdapterMethods["createHighlight"]>): Promise<void>;
|
|
84
87
|
createDrawing(...args: Parameters<AdapterMethods["createDrawing"]>): Promise<void>;
|
|
@@ -87,7 +90,7 @@ export declare class CommentKitService implements OnDestroy {
|
|
|
87
90
|
captureScreenshot(...args: Parameters<AdapterMethods["captureScreenshot"]>): Promise<import("./index.ts").ScreenshotResult | null>;
|
|
88
91
|
uploadScreenshot(...args: Parameters<AdapterMethods["uploadScreenshot"]>): Promise<import("./index.ts").Comment | null>;
|
|
89
92
|
setActiveScreenshot(...args: Parameters<AdapterMethods["setActiveScreenshot"]>): void;
|
|
90
|
-
uploadFiles(
|
|
93
|
+
uploadFiles(...args: Parameters<AdapterMethods["uploadFiles"]>): Promise<string[]>;
|
|
91
94
|
markThreadSeen(threadId: string): void;
|
|
92
95
|
isThreadNew(threadId: string): boolean;
|
|
93
96
|
markAllActivitiesRead(): void;
|
|
@@ -116,7 +119,14 @@ export declare class CommentKitService implements OnDestroy {
|
|
|
116
119
|
destroy(): void;
|
|
117
120
|
}
|
|
118
121
|
export declare function createCommentKitService(): CommentKitService;
|
|
119
|
-
export declare function provideCommentKit(config: AngularCommentKitConfig): (
|
|
122
|
+
export declare function provideCommentKit(config: AngularCommentKitConfig): ({
|
|
123
|
+
provide: typeof CommentKitService;
|
|
124
|
+
useFactory: (options: AngularCommentKitConfig) => CommentKitService;
|
|
125
|
+
deps: InjectionToken<CommentKitConfig>[];
|
|
126
|
+
useValue?: undefined;
|
|
127
|
+
} | {
|
|
128
|
+
useFactory?: undefined;
|
|
129
|
+
deps?: undefined;
|
|
120
130
|
provide: InjectionToken<CommentKitConfig>;
|
|
121
131
|
useValue: AngularCommentKitConfig;
|
|
122
132
|
})[];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { AuthResponse, Comment, CommentEnvironment, DrawingData, InviteValidationResponse, Mention, OtpResponse, OtpVerifyResponse, Position, ResolvedConfig,
|
|
1
|
+
import type { AuthResponse, Comment, CommentEnvironment, CommentCreateOptions, CommentDeviceInfo, ProjectContext, ReplyOptions, DrawingData, InviteValidationResponse, Mention, OtpResponse, OtpVerifyResponse, Position, ResolvedConfig, TextSelection, User } from "./types";
|
|
2
2
|
export declare class ApiClient {
|
|
3
3
|
private baseUrl;
|
|
4
4
|
private apiKey;
|
|
5
5
|
private projectId;
|
|
6
6
|
private userEmail;
|
|
7
7
|
private authToken;
|
|
8
|
+
private authRevision;
|
|
8
9
|
private environment;
|
|
9
10
|
private onAuthExpired;
|
|
10
11
|
constructor(config: ResolvedConfig);
|
|
@@ -23,7 +24,7 @@ export declare class ApiClient {
|
|
|
23
24
|
requestOtp(email: string): Promise<OtpResponse>;
|
|
24
25
|
verifyOtp(email: string, otp: string): Promise<OtpVerifyResponse>;
|
|
25
26
|
validateInvite(token: string, email: string): Promise<InviteValidationResponse>;
|
|
26
|
-
getComments(pagePath?: string, status?: "open" | "resolved" | "all", page?: number, limit?: number, environment?: CommentEnvironment): Promise<{
|
|
27
|
+
getComments(pagePath?: string, status?: "open" | "resolved" | "all", page?: number, limit?: number, environment?: CommentEnvironment, branch?: string | null): Promise<{
|
|
27
28
|
comments: Comment[];
|
|
28
29
|
pagination: {
|
|
29
30
|
total: number;
|
|
@@ -32,6 +33,7 @@ export declare class ApiClient {
|
|
|
32
33
|
limit: number;
|
|
33
34
|
};
|
|
34
35
|
}>;
|
|
36
|
+
getComment(commentId: string): Promise<Comment>;
|
|
35
37
|
/**
|
|
36
38
|
* Build an Idempotency-Key header from a client-supplied key. The backend
|
|
37
39
|
* dedups retried creates/replies on this key, so an offline-queue replay (or
|
|
@@ -43,37 +45,30 @@ export declare class ApiClient {
|
|
|
43
45
|
url: string;
|
|
44
46
|
path: string;
|
|
45
47
|
title: string;
|
|
46
|
-
}, priority?: "low" | "medium" | "high" | "urgent", textSelection?: TextSelection, drawingData?: DrawingData, options?:
|
|
47
|
-
|
|
48
|
-
assignees?: User[];
|
|
49
|
-
checklist?: TaskChecklistItem[];
|
|
50
|
-
mentions?: Mention[];
|
|
51
|
-
/** Link previously uploaded orphan attachment ids. */
|
|
52
|
-
attachmentIds?: Array<string | number>;
|
|
53
|
-
}, idempotencyKey?: string): Promise<Comment>;
|
|
54
|
-
updateComment(commentId: string, updates: Partial<Pick<Comment, "content" | "status" | "priority" | "description" | "assignees" | "checklist" | "textSelection" | "drawingData"> & {
|
|
48
|
+
}, priority?: "low" | "medium" | "high" | "urgent", textSelection?: TextSelection, drawingData?: DrawingData, options?: CommentCreateOptions, idempotencyKey?: string): Promise<Comment>;
|
|
49
|
+
updateComment(commentId: string, updates: Partial<Pick<Comment, "content" | "status" | "priority" | "description" | "assignees" | "checklist" | "textSelection" | "drawingData" | "mentions"> & {
|
|
55
50
|
attachmentIds?: Array<string | number>;
|
|
56
51
|
}>): Promise<Comment>;
|
|
57
52
|
deleteComment(commentId: string): Promise<void>;
|
|
58
|
-
addReply(commentId: string, content: string, idempotencyKey?: string): Promise<Comment["replies"][0]>;
|
|
59
|
-
updateReply(commentId: string, replyId: string, content: string): Promise<Comment["replies"][0]>;
|
|
53
|
+
addReply(commentId: string, content: string, idempotencyKey?: string, options?: ReplyOptions): Promise<Comment["replies"][0]>;
|
|
54
|
+
updateReply(commentId: string, replyId: string, content: string, options?: ReplyOptions): Promise<Comment["replies"][0]>;
|
|
60
55
|
deleteReply(commentId: string, replyId: string): Promise<void>;
|
|
61
56
|
resolveComment(commentId: string): Promise<Comment>;
|
|
62
57
|
unresolveComment(commentId: string): Promise<Comment>;
|
|
63
58
|
markComplete(commentId: string): Promise<Comment>;
|
|
64
|
-
addReaction(commentId: string, emoji: string): Promise<void>;
|
|
65
|
-
removeReaction(commentId: string, emoji: string): Promise<void>;
|
|
59
|
+
addReaction(commentId: string, emoji: string, replyId?: string): Promise<void>;
|
|
60
|
+
removeReaction(commentId: string, emoji: string, replyId?: string): Promise<void>;
|
|
66
61
|
updatePosition(commentId: string, position: Position): Promise<Comment>;
|
|
67
62
|
createHighlight(content: string, textSelection: TextSelection, page: {
|
|
68
63
|
url: string;
|
|
69
64
|
path: string;
|
|
70
65
|
title: string;
|
|
71
|
-
}, priority?: "low" | "medium" | "high" | "urgent", idempotencyKey?: string): Promise<Comment>;
|
|
66
|
+
}, priority?: "low" | "medium" | "high" | "urgent", idempotencyKey?: string, options?: CommentCreateOptions): Promise<Comment>;
|
|
72
67
|
createDrawing(content: string, drawingData: DrawingData, position: Position, page: {
|
|
73
68
|
url: string;
|
|
74
69
|
path: string;
|
|
75
70
|
title: string;
|
|
76
|
-
}, idempotencyKey?: string): Promise<Comment>;
|
|
71
|
+
}, idempotencyKey?: string, options?: CommentCreateOptions): Promise<Comment>;
|
|
77
72
|
private validateFile;
|
|
78
73
|
/**
|
|
79
74
|
* Upload a file. Pass `commentId` (and optionally `replyId`) so the backend
|
|
@@ -90,6 +85,7 @@ export declare class ApiClient {
|
|
|
90
85
|
url: string;
|
|
91
86
|
thumbnail?: string;
|
|
92
87
|
filename?: string;
|
|
88
|
+
mimeType?: string;
|
|
93
89
|
size: number;
|
|
94
90
|
}>;
|
|
95
91
|
uploadScreenshot(file: File, metadata: {
|
|
@@ -100,11 +96,14 @@ export declare class ApiClient {
|
|
|
100
96
|
path: string;
|
|
101
97
|
title: string;
|
|
102
98
|
};
|
|
99
|
+
branch?: string;
|
|
100
|
+
deviceInfo?: CommentDeviceInfo;
|
|
103
101
|
}): Promise<Comment>;
|
|
104
102
|
uploadFiles(files: File[], options?: {
|
|
105
103
|
commentId?: string;
|
|
106
104
|
replyId?: string;
|
|
107
105
|
}): Promise<string[]>;
|
|
106
|
+
getProjectContext(): Promise<ProjectContext>;
|
|
108
107
|
getProjectMembers(): Promise<User[]>;
|
|
109
108
|
}
|
|
110
109
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from "../utils/event-emitter";
|
|
2
2
|
import type { LocalDemoStore } from "./local-demo";
|
|
3
|
-
import type { AgentContextExport, AgentContextOptions, Comment, CommentKitConfig, CommentKitState, DevGrabBundle, DevGrabOptions, DevGrabResult, DrawingData, DrawingPath, Position, ResolvedConfig, ScreenshotResult, StateSlice,
|
|
3
|
+
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
4
|
/**
|
|
5
5
|
* Current SDK version — compared against the backend's sdkLatestVersion on
|
|
6
6
|
* init. Injected from package.json at build time (vite `define`) so it can't
|
|
@@ -25,6 +25,13 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
25
25
|
private offlineHandler;
|
|
26
26
|
private initialized;
|
|
27
27
|
private destroyed;
|
|
28
|
+
private sessionRevision;
|
|
29
|
+
private authRequestRevision;
|
|
30
|
+
private commentsFetchRevision;
|
|
31
|
+
private contextFetchRevision;
|
|
32
|
+
private deepLinkRequest;
|
|
33
|
+
private reactionRequests;
|
|
34
|
+
private draftUploads;
|
|
28
35
|
private screenshotProvider;
|
|
29
36
|
private bootRetryTimer;
|
|
30
37
|
private bootAttempts;
|
|
@@ -109,6 +116,7 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
109
116
|
private restorePersistedSession;
|
|
110
117
|
/** Shared post-auth path used by OTP verify and session restore. */
|
|
111
118
|
private afterAuthenticated;
|
|
119
|
+
private beginAuthRequest;
|
|
112
120
|
login(email: string): Promise<void>;
|
|
113
121
|
private otpFailedAttempts;
|
|
114
122
|
private otpCooldownUntil;
|
|
@@ -130,6 +138,7 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
130
138
|
private operationContext;
|
|
131
139
|
private operationCallbacks;
|
|
132
140
|
private loadMoreGuard;
|
|
141
|
+
private commentsRequestContext;
|
|
133
142
|
private loadComments;
|
|
134
143
|
loadMoreComments(): Promise<void>;
|
|
135
144
|
/**
|
|
@@ -138,23 +147,22 @@ export declare class CommentKitCore extends EventEmitter {
|
|
|
138
147
|
* loaded, this refreshes existing data — e.g. to pick up remote edits.
|
|
139
148
|
*/
|
|
140
149
|
reloadComments(): Promise<void>;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}): Promise<void>;
|
|
150
|
+
/** Refresh authenticated member, plan and usage data without fabricating demo values. */
|
|
151
|
+
reloadProjectContext(): Promise<void>;
|
|
152
|
+
setBranch(branch: string | null): Promise<void>;
|
|
153
|
+
/** Upload drafts before creating their record. Reuse successful uploads if saving is retried. */
|
|
154
|
+
uploadDraftFiles(files: File[]): Promise<string[]>;
|
|
155
|
+
createComment(type: "pin" | "highlight" | "drawing", content: string, position: Position, priority?: "low" | "medium" | "high" | "urgent", textSelection?: TextSelection, drawingData?: DrawingData, options?: CommentCreateOptions): Promise<void>;
|
|
148
156
|
updateComment(commentId: string, updates: Partial<Comment>): Promise<void>;
|
|
149
157
|
deleteComment(commentId: string): Promise<void>;
|
|
150
|
-
addReply(commentId: string, content: string): Promise<void>;
|
|
151
|
-
updateReply(commentId: string, replyId: string, content: string): Promise<void>;
|
|
158
|
+
addReply(commentId: string, content: string, options?: ReplyOptions): Promise<void>;
|
|
159
|
+
updateReply(commentId: string, replyId: string, content: string, options?: ReplyOptions): Promise<void>;
|
|
152
160
|
deleteReply(commentId: string, replyId: string): Promise<void>;
|
|
153
161
|
resolveComment(commentId: string): Promise<void>;
|
|
154
162
|
unresolveComment(commentId: string): Promise<void>;
|
|
155
163
|
selectComment(comment: Comment | null): void;
|
|
156
164
|
completeComment(commentId: string): Promise<void>;
|
|
157
|
-
reactToComment(commentId: string, emoji: string): Promise<void>;
|
|
165
|
+
reactToComment(commentId: string, emoji: string, replyId?: string): Promise<void>;
|
|
158
166
|
updateCommentPosition(commentId: string, x: number, y: number): Promise<void>;
|
|
159
167
|
private offlinePersistUnsub;
|
|
160
168
|
/**
|
|
@@ -197,6 +197,57 @@ export interface Project {
|
|
|
197
197
|
createdAt?: string;
|
|
198
198
|
updatedAt?: string;
|
|
199
199
|
}
|
|
200
|
+
/** Authenticated project data used by the embedded member and settings views. */
|
|
201
|
+
export interface ProjectContext {
|
|
202
|
+
project: Pick<Project, "id" | "name" | "slug">;
|
|
203
|
+
organization: {
|
|
204
|
+
id: string;
|
|
205
|
+
name: string;
|
|
206
|
+
plan: "none" | "pro" | "ltd";
|
|
207
|
+
};
|
|
208
|
+
members: Array<User & {
|
|
209
|
+
role: "owner" | "admin" | "member";
|
|
210
|
+
}>;
|
|
211
|
+
usage: {
|
|
212
|
+
used: number;
|
|
213
|
+
limit: number | null;
|
|
214
|
+
label: string;
|
|
215
|
+
};
|
|
216
|
+
branches: Array<{
|
|
217
|
+
name: string;
|
|
218
|
+
}>;
|
|
219
|
+
permissions: {
|
|
220
|
+
canManageComments: boolean;
|
|
221
|
+
canInvite: boolean;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
export interface CommentDeviceInfo {
|
|
225
|
+
browser: string;
|
|
226
|
+
os: string;
|
|
227
|
+
windowSize: string;
|
|
228
|
+
devicePixelRatio: number;
|
|
229
|
+
deployment?: string;
|
|
230
|
+
type: "desktop" | "mobile";
|
|
231
|
+
}
|
|
232
|
+
export interface ReplyTarget {
|
|
233
|
+
id: string;
|
|
234
|
+
type: "comment" | "reply";
|
|
235
|
+
}
|
|
236
|
+
export interface ReplyOptions {
|
|
237
|
+
attachmentIds?: Array<string | number>;
|
|
238
|
+
mentions?: Mention[];
|
|
239
|
+
replyTo?: ReplyTarget;
|
|
240
|
+
}
|
|
241
|
+
export interface CommentCreateOptions {
|
|
242
|
+
description?: string;
|
|
243
|
+
assignees?: User[];
|
|
244
|
+
checklist?: TaskChecklistItem[];
|
|
245
|
+
mentions?: Mention[];
|
|
246
|
+
files?: File[];
|
|
247
|
+
attachmentIds?: Array<string | number>;
|
|
248
|
+
branch?: string;
|
|
249
|
+
deviceInfo?: CommentDeviceInfo;
|
|
250
|
+
}
|
|
200
251
|
export type TaskStatus = "open" | "resolved" | "complete";
|
|
201
252
|
export interface TaskChecklistItem {
|
|
202
253
|
id: string;
|
|
@@ -205,6 +256,8 @@ export interface TaskChecklistItem {
|
|
|
205
256
|
sortOrder?: number;
|
|
206
257
|
}
|
|
207
258
|
export interface CommentReaction {
|
|
259
|
+
/** Participant IDs let realtime consumers derive their own reacted state. */
|
|
260
|
+
userIds?: string[];
|
|
208
261
|
emoji: string;
|
|
209
262
|
count: number;
|
|
210
263
|
reacted: boolean;
|
|
@@ -225,11 +278,15 @@ export interface Comment {
|
|
|
225
278
|
status: TaskStatus;
|
|
226
279
|
priority: "low" | "medium" | "high" | "urgent";
|
|
227
280
|
environment?: CommentEnvironment;
|
|
281
|
+
branch?: string;
|
|
282
|
+
deviceInfo?: CommentDeviceInfo;
|
|
228
283
|
author: User;
|
|
229
284
|
userId: string;
|
|
230
285
|
createdAt: string;
|
|
231
286
|
updatedAt: string;
|
|
232
287
|
isEdited?: boolean;
|
|
288
|
+
resolvedAt?: string;
|
|
289
|
+
completedAt?: string;
|
|
233
290
|
page: {
|
|
234
291
|
url: string;
|
|
235
292
|
path: string;
|
|
@@ -246,6 +303,10 @@ export interface Comment {
|
|
|
246
303
|
drawingData?: DrawingData;
|
|
247
304
|
}
|
|
248
305
|
export interface Reply {
|
|
306
|
+
replyTo?: ReplyTarget & {
|
|
307
|
+
authorName: string;
|
|
308
|
+
body: string;
|
|
309
|
+
};
|
|
249
310
|
id: string;
|
|
250
311
|
content: string;
|
|
251
312
|
author: User;
|
|
@@ -256,6 +317,7 @@ export interface Reply {
|
|
|
256
317
|
attachments?: Attachment[];
|
|
257
318
|
}
|
|
258
319
|
export interface Attachment {
|
|
320
|
+
mimeType?: string;
|
|
259
321
|
id: string;
|
|
260
322
|
type: "screenshot" | "file" | "drawing";
|
|
261
323
|
url: string;
|
|
@@ -333,6 +395,8 @@ export interface PaginationInfo {
|
|
|
333
395
|
}
|
|
334
396
|
export interface QueuedMutation {
|
|
335
397
|
id: string;
|
|
398
|
+
/** Authenticated author captured at enqueue time. Legacy entries without an owner cannot replay. */
|
|
399
|
+
ownerId?: string;
|
|
336
400
|
type: "createComment" | "createHighlight" | "createDrawing" | "updateComment" | "deleteComment" | "resolveComment" | "unresolveComment" | "completeComment" | "addReply" | "reactToComment" | "updatePosition";
|
|
337
401
|
args: any[];
|
|
338
402
|
timestamp: number;
|
|
@@ -347,6 +411,8 @@ export interface QueuedMutation {
|
|
|
347
411
|
export type StateSlice = "auth" | "ui" | "comments" | "realtime";
|
|
348
412
|
export type ScreenshotProvider = (element: HTMLElement, options?: ScreenshotOptions) => Promise<ScreenshotResult>;
|
|
349
413
|
export interface CommentKitConfig {
|
|
414
|
+
/** Optional actual deployment branch, e.g. from your build environment. */
|
|
415
|
+
branch?: string;
|
|
350
416
|
/** API key from the CommentKit dashboard. */
|
|
351
417
|
apiKey: string;
|
|
352
418
|
/** API base URL override. Useful for self-hosted, staging, and local API deployments. */
|
|
@@ -443,6 +509,8 @@ export interface CommentKitState {
|
|
|
443
509
|
isShortcutsOverlayVisible: boolean;
|
|
444
510
|
currentUser: User | null;
|
|
445
511
|
project: Project | null;
|
|
512
|
+
projectContext?: ProjectContext | null;
|
|
513
|
+
activeBranch?: string | null;
|
|
446
514
|
comments: Comment[];
|
|
447
515
|
activeTool: ToolType;
|
|
448
516
|
selectedComment: Comment | null;
|
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-BaSuMzp9.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--ijs8pWT.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) {
|