@commentkit/comment-kit 0.7.7 → 1.0.0-beta.2
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 +87 -0
- package/README.md +172 -732
- package/SECURITY.md +24 -14
- package/dist/npm/THIRD_PARTY_NOTICES.txt +73 -0
- package/dist/npm/chunks/Guest-CKoV6pEK.js +157 -0
- package/dist/npm/chunks/MarkupEditor-DAo4qppg.js +199 -0
- package/dist/npm/chunks/Panel-BRBDHlGg.js +399 -0
- package/dist/npm/chunks/Shortcuts-CHMcrjAM.js +56 -0
- package/dist/npm/chunks/ThreadCard-D8FzIxbs.js +570 -0
- package/dist/npm/chunks/anchor-DT-Ynhh1.js +270 -0
- package/dist/npm/chunks/ar-D3SPpN1T.js +195 -0
- package/dist/npm/chunks/client-D1NizpDK.js +627 -0
- package/dist/{shared/capture-colors-D0uLr-vZ.js → npm/chunks/colors-CX-IPjvb.js} +2 -0
- package/dist/npm/chunks/de-C8eC6c6f.js +187 -0
- package/dist/npm/chunks/es-Bczf42tm.js +187 -0
- package/dist/npm/chunks/extension--it1LAj-.js +54 -0
- package/dist/npm/chunks/extension-XfuRGu2o.js +26 -0
- package/dist/npm/chunks/format-Bw_tNOh9.js +524 -0
- package/dist/npm/chunks/fr-BaQw-v2e.js +187 -0
- package/dist/npm/chunks/hi-BamV-yXv.js +187 -0
- package/dist/npm/chunks/html2canvas-DfGb8yka.js +4024 -0
- package/dist/npm/chunks/it-DC14_EjN.js +187 -0
- package/dist/npm/chunks/ja-B1mmTN7Y.js +187 -0
- package/dist/npm/chunks/mount-5fFig0k6.js +1447 -0
- package/dist/npm/chunks/nl-BfhqUsmX.js +187 -0
- package/dist/npm/chunks/privacy-DLhezjyi.js +30 -0
- package/dist/npm/chunks/pt-BR-CEPu4W5U.js +187 -0
- package/dist/{shared/pusher-CnhQgAvF.js → npm/chunks/pusher-BSsQoE1K.js} +224 -222
- package/dist/npm/chunks/realtime-CBRW9BB3.js +34 -0
- package/dist/npm/chunks/report-Dh4fxd4J.js +27 -0
- package/dist/npm/chunks/rolldown-runtime-Y_bBpyJl.js +20 -0
- package/dist/npm/chunks/src-DujplxfI.js +517 -0
- package/dist/npm/chunks/zh-CN-kgqjYwHQ.js +187 -0
- package/dist/npm/element.js +41 -0
- package/dist/npm/headless.js +3 -0
- package/dist/npm/index.js +3 -0
- package/dist/npm/react.js +26 -0
- package/dist/npm/svelte.js +17 -0
- package/dist/npm/types/adapters/react.d.ts +11 -0
- package/dist/npm/types/adapters/svelte.d.ts +9 -0
- package/dist/npm/types/adapters/vue.d.ts +118 -0
- package/dist/npm/types/anchor/index.d.ts +49 -0
- package/dist/npm/types/core/api.d.ts +31 -0
- package/dist/npm/types/core/auth.d.ts +87 -0
- package/dist/npm/types/core/client.d.ts +114 -0
- package/dist/npm/types/core/store.d.ts +7 -0
- package/dist/npm/types/core/types.d.ts +303 -0
- package/dist/npm/types/element.d.ts +13 -0
- package/dist/npm/types/headless.d.ts +7 -0
- package/dist/npm/types/index.d.ts +32 -0
- package/dist/npm/vue.js +71 -0
- package/package.json +71 -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-zeiCmKIr.js +0 -1086
- package/dist/shared/attachment-refresh-DAacLaRu.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-CiOrcAlt.js +0 -101
- package/dist/shared/comment-drawing-canvas-Btc12IsS.js +0 -124
- package/dist/shared/comment-icon-D8JTCEJ7.js +0 -607
- package/dist/shared/comment-image-lightbox--QpbcAtH.js +0 -190
- package/dist/shared/comment-images-content-C_r4SHM-.js +0 -214
- package/dist/shared/comment-kit-core-CmLUFujd.js +0 -3682
- package/dist/shared/comment-kit-ui-BHwYuSIi.js +0 -19391
- package/dist/shared/comment-screenshot-annotator-zJZyO-XM.js +0 -151
- package/dist/shared/comment-screenshot-overlay-CoKTYB0J.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-Cnt6oCZU.js +0 -207
- package/dist/shared/dev-grab-B85jo9AS.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-Cng84xC7.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-Dz7FB_Ak.js +0 -208
- package/dist/shared/realtime-recovery-BjlV-ewc.js +0 -162
- package/dist/shared/realtime-yGLX4wMK.js +0 -334
- package/dist/shared/request-activity-DQrAUwfA.js +0 -11
- package/dist/shared/screenshot-B5-hwpmt.js +0 -199
- package/dist/shared/separator-UhJb0Row.js +0 -3955
- package/dist/shared/shadow-root-B58ZI2yz.js +0 -133
- package/dist/shared/styles-CnYsLS2f.js +0 -2
- package/dist/shared/text-B4HHZNaa.js +0 -23
- package/dist/shared/token-session-D92MYbNu.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-KhH4hL0Q.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,125 +0,0 @@
|
|
|
1
|
-
import type { Comment, CursorPosition, DrawingPath, Reply, User } from "./types";
|
|
2
|
-
export interface WebSocketConfig {
|
|
3
|
-
/** Reverb/Pusher app key */
|
|
4
|
-
key: string;
|
|
5
|
-
/** WebSocket host (e.g. ws-xxx-reverb.laravel.cloud) */
|
|
6
|
-
wsHost: string;
|
|
7
|
-
/** WebSocket port (default 443) */
|
|
8
|
-
wsPort?: number;
|
|
9
|
-
/** Force TLS (default true) */
|
|
10
|
-
forceTLS?: boolean;
|
|
11
|
-
/** Project ID to subscribe to */
|
|
12
|
-
projectId: string;
|
|
13
|
-
/** API key for channel auth */
|
|
14
|
-
apiKey: string;
|
|
15
|
-
/** Base URL for the backend API (used for auth endpoint) */
|
|
16
|
-
authEndpoint: string;
|
|
17
|
-
/** User email for auth header */
|
|
18
|
-
userEmail?: string;
|
|
19
|
-
/** User info for presence channel */
|
|
20
|
-
userInfo?: {
|
|
21
|
-
id: string;
|
|
22
|
-
name: string;
|
|
23
|
-
email: string;
|
|
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
|
-
}>;
|
|
30
|
-
}
|
|
31
|
-
export interface WebSocketEvents {
|
|
32
|
-
connected: void;
|
|
33
|
-
subscribed: void;
|
|
34
|
-
disconnected: {
|
|
35
|
-
code: number;
|
|
36
|
-
reason: string;
|
|
37
|
-
};
|
|
38
|
-
reconnecting: {
|
|
39
|
-
attempt: number;
|
|
40
|
-
maxAttempts: number;
|
|
41
|
-
};
|
|
42
|
-
error: Error;
|
|
43
|
-
"cursor:move": CursorPosition;
|
|
44
|
-
"cursor:leave": {
|
|
45
|
-
userId: string;
|
|
46
|
-
};
|
|
47
|
-
"comment:created": Comment;
|
|
48
|
-
"comment:updated": Comment;
|
|
49
|
-
"comment:deleted": {
|
|
50
|
-
id: string;
|
|
51
|
-
};
|
|
52
|
-
"comment:resolved": Comment;
|
|
53
|
-
"comment:completed": Comment;
|
|
54
|
-
"comment:refresh": {
|
|
55
|
-
commentId: string;
|
|
56
|
-
event: "comment:created" | "comment:updated" | "comment:resolved" | "comment:completed";
|
|
57
|
-
};
|
|
58
|
-
"reply:added": {
|
|
59
|
-
commentId: string;
|
|
60
|
-
reply: Reply;
|
|
61
|
-
};
|
|
62
|
-
"reaction:added": {
|
|
63
|
-
commentId: string;
|
|
64
|
-
replyId?: string;
|
|
65
|
-
emoji: string;
|
|
66
|
-
userId: string;
|
|
67
|
-
};
|
|
68
|
-
"reaction:removed": {
|
|
69
|
-
commentId: string;
|
|
70
|
-
replyId?: string;
|
|
71
|
-
emoji: string;
|
|
72
|
-
userId: string;
|
|
73
|
-
};
|
|
74
|
-
"drawing:stroke": {
|
|
75
|
-
userId: string;
|
|
76
|
-
path: DrawingPath;
|
|
77
|
-
};
|
|
78
|
-
"user:joined": User;
|
|
79
|
-
"user:left": {
|
|
80
|
-
userId: string;
|
|
81
|
-
};
|
|
82
|
-
"presence:update": {
|
|
83
|
-
users: User[];
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
type WsEventKey = keyof WebSocketEvents;
|
|
87
|
-
type WsListener<T = unknown> = (data: T) => void;
|
|
88
|
-
export declare class WebSocketManager {
|
|
89
|
-
private listeners;
|
|
90
|
-
private pusher;
|
|
91
|
-
private presenceChannel;
|
|
92
|
-
private config;
|
|
93
|
-
private onlineUsers;
|
|
94
|
-
private lastCursorUpdate;
|
|
95
|
-
private cursorThrottle;
|
|
96
|
-
private reconnectAttempts;
|
|
97
|
-
private connecting;
|
|
98
|
-
private destroyed;
|
|
99
|
-
private authorizationGeneration;
|
|
100
|
-
private static readonly MAX_LISTENERS_PER_EVENT;
|
|
101
|
-
constructor(config: WebSocketConfig);
|
|
102
|
-
on<K extends WsEventKey>(event: K, listener: WsListener<WebSocketEvents[K]>): () => void;
|
|
103
|
-
private emit;
|
|
104
|
-
connect(): Promise<void>;
|
|
105
|
-
private openConnection;
|
|
106
|
-
private createChannelAuthorizer;
|
|
107
|
-
/**
|
|
108
|
-
* Ask an existing socket to connect again. When no socket exists yet,
|
|
109
|
-
* this starts the normal connect path.
|
|
110
|
-
*/
|
|
111
|
-
reconnect(): void;
|
|
112
|
-
disconnect(): void;
|
|
113
|
-
isConnected(): boolean;
|
|
114
|
-
getOnlineUsers(): User[];
|
|
115
|
-
private subscribeToChannel;
|
|
116
|
-
private authenticatedClientEventUser;
|
|
117
|
-
private memberToUser;
|
|
118
|
-
sendCursorMove(x: number, y: number, page: string): void;
|
|
119
|
-
sendCursorLeave(): void;
|
|
120
|
-
sendDrawingStroke(path: DrawingPath): void;
|
|
121
|
-
requestPresence(): void;
|
|
122
|
-
private triggerClientEvent;
|
|
123
|
-
destroy(): void;
|
|
124
|
-
}
|
|
125
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CommentKitState, ResolvedConfig } from "./types";
|
|
2
|
-
export interface CommentWriteAccess {
|
|
3
|
-
canWrite: boolean;
|
|
4
|
-
canManageComments: boolean;
|
|
5
|
-
canTriage?: boolean;
|
|
6
|
-
canComplete?: boolean;
|
|
7
|
-
planRequired: boolean;
|
|
8
|
-
message: string;
|
|
9
|
-
}
|
|
10
|
-
/** Mirrors the server capability. Authentication and authorization remain server enforced. */
|
|
11
|
-
export declare function getCommentWriteAccess(config: Pick<ResolvedConfig, "features">, state: Pick<CommentKitState, "projectContext">, restriction?: "plan_required" | "feature_disabled" | null): CommentWriteAccess;
|
package/dist/types/demo.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CommentKitCore } from "./core/comment-kit-core";
|
|
2
|
-
import type { CommentKitDemoOptions, CommentKitDemoSession } from "./core/local-demo";
|
|
3
|
-
export type { CommentKitDemoOptions, CommentKitDemoSession } from "./core/local-demo";
|
|
4
|
-
/** A real SDK instance with a private, fixed 24-hour browser-local data store. */
|
|
5
|
-
export interface CommentKitDemo {
|
|
6
|
-
start(): void;
|
|
7
|
-
reset(): void;
|
|
8
|
-
destroy(): void;
|
|
9
|
-
getSession(): CommentKitDemoSession;
|
|
10
|
-
getCore(): CommentKitCore;
|
|
11
|
-
onSessionChange(listener: (session: CommentKitDemoSession) => void): () => void;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Opt-in sandbox. No project/API key, OTP, production session, network client,
|
|
15
|
-
* realtime connection, file upload, or offline mutation queue is created.
|
|
16
|
-
*/
|
|
17
|
-
export declare function createCommentKitDemo(options?: CommentKitDemoOptions): Promise<CommentKitDemo>;
|
package/dist/types/headless.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** Engine, protocol types and helpers without any UI runtime or global registration. */
|
|
2
|
-
export { ApiClient, formatMention, parseMentions, stripMentionMarkup } from "./core/api-client";
|
|
3
|
-
export { createAgentContext, formatAgentContext } from "./core/agent-context";
|
|
4
|
-
export { CommentKitCore, SDK_VERSION } from "./core/comment-kit-core";
|
|
5
|
-
export { WebSocketManager } from "./core/websocket-manager";
|
|
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
|
-
export { debounce, findElement, generateId, generateSelector, generateXPath, getCurrentPage, getElementBounds, getSelectionRange, getSelectionText, isElementVisible, isInteractiveElement, percentageToViewport, throttle, viewportToPercentage, } from "./utils/dom";
|
|
8
|
-
export { EventEmitter } from "./utils/event-emitter";
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { CommentKitDemo, CommentKitDemoOptions } from "./demo";
|
|
2
|
-
/** @deprecated Prefer the dedicated `@commentkit/comment-kit/demo` entry. */
|
|
3
|
-
export declare function createCommentKitDemo(options?: CommentKitDemoOptions): Promise<CommentKitDemo>;
|
|
4
|
-
export type { CommentKitDemo, CommentKitDemoOptions, CommentKitDemoSession } from "./demo";
|
|
5
|
-
export * from "./headless";
|
|
6
|
-
import type { CommentKitConfig, CommentKitEvents, DrawingData, DrawingPath, EventListener, ScreenshotResult } from "./core/types";
|
|
7
|
-
import { CommentKitCore } from "./core/comment-kit-core";
|
|
8
|
-
export declare class CommentKit {
|
|
9
|
-
private core;
|
|
10
|
-
private mountedUI;
|
|
11
|
-
private destroyed;
|
|
12
|
-
constructor(config: CommentKitConfig);
|
|
13
|
-
private mount;
|
|
14
|
-
getState(): import("./headless").CommentKitState;
|
|
15
|
-
getConfig(): Readonly<CommentKitConfig>;
|
|
16
|
-
getFeatures(): {
|
|
17
|
-
comments?: boolean;
|
|
18
|
-
drawing?: boolean;
|
|
19
|
-
highlighting?: boolean;
|
|
20
|
-
screenshots?: boolean;
|
|
21
|
-
realtime?: boolean;
|
|
22
|
-
};
|
|
23
|
-
validateInvite(email: string): Promise<void>;
|
|
24
|
-
login(email: string): Promise<void>;
|
|
25
|
-
verifyOtp(otp: string): Promise<void>;
|
|
26
|
-
cancelOtp(): void;
|
|
27
|
-
resendOtp(): Promise<void>;
|
|
28
|
-
logout(): void;
|
|
29
|
-
toggleLoginModal(): void;
|
|
30
|
-
toggleOverlay(): void;
|
|
31
|
-
toggleSidebar(): void;
|
|
32
|
-
setTool(tool: Parameters<CommentKitCore["setTool"]>[0]): void;
|
|
33
|
-
createComment(...args: Parameters<CommentKitCore["createComment"]>): Promise<void>;
|
|
34
|
-
updateComment(...args: Parameters<CommentKitCore["updateComment"]>): Promise<void>;
|
|
35
|
-
deleteComment(id: string): Promise<void>;
|
|
36
|
-
resolveComment(id: string): Promise<void>;
|
|
37
|
-
unresolveComment(id: string): Promise<void>;
|
|
38
|
-
completeComment(id: string): Promise<void>;
|
|
39
|
-
selectComment(comment: Parameters<CommentKitCore["selectComment"]>[0]): void;
|
|
40
|
-
addReply(...args: Parameters<CommentKitCore["addReply"]>): Promise<void>;
|
|
41
|
-
updateReply(...args: Parameters<CommentKitCore["updateReply"]>): Promise<void>;
|
|
42
|
-
deleteReply(commentId: string, replyId: string): Promise<void>;
|
|
43
|
-
reactToComment(...args: Parameters<CommentKitCore["reactToComment"]>): Promise<void>;
|
|
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>;
|
|
48
|
-
loadMoreComments(): Promise<void>;
|
|
49
|
-
createHighlight(...args: Parameters<CommentKitCore["createHighlight"]>): Promise<void>;
|
|
50
|
-
createDrawing(...args: Parameters<CommentKitCore["createDrawing"]>): Promise<void>;
|
|
51
|
-
setActiveDrawing(drawing: DrawingData | null): void;
|
|
52
|
-
sendDrawingStroke(path: DrawingPath): void;
|
|
53
|
-
captureScreenshot(el?: HTMLElement): Promise<ScreenshotResult | null>;
|
|
54
|
-
uploadScreenshot(...args: Parameters<CommentKitCore["uploadScreenshot"]>): Promise<import("./headless").Comment | null>;
|
|
55
|
-
setActiveScreenshot(screenshot: ScreenshotResult | null): void;
|
|
56
|
-
uploadFiles(...args: Parameters<CommentKitCore["uploadFiles"]>): Promise<string[]>;
|
|
57
|
-
getOnlineUsers(): import("./headless").User[];
|
|
58
|
-
getProjectMembers(): Promise<import("./headless").User[]>;
|
|
59
|
-
toggleShortcutsOverlay(): void;
|
|
60
|
-
markThreadSeen(threadId: string): void;
|
|
61
|
-
isThreadNew(threadId: string): boolean;
|
|
62
|
-
blockEscape(): () => void;
|
|
63
|
-
setPanelView(view: Parameters<CommentKitCore["setPanelView"]>[0]): void;
|
|
64
|
-
markAllActivitiesRead(): void;
|
|
65
|
-
getUnreadActivityCount(): number;
|
|
66
|
-
getPendingMutationCount(): number;
|
|
67
|
-
getAgentContext(...args: Parameters<CommentKitCore["getAgentContext"]>): import("./headless").AgentContextExport;
|
|
68
|
-
getAgentContextAsync(...args: Parameters<CommentKitCore["getAgentContextAsync"]>): Promise<import("./headless").AgentContextExport>;
|
|
69
|
-
formatAgentContext(...args: Parameters<CommentKitCore["formatAgentContext"]>): string;
|
|
70
|
-
formatAgentContextAsync(...args: Parameters<CommentKitCore["formatAgentContextAsync"]>): Promise<string>;
|
|
71
|
-
copyAgentContext(...args: Parameters<CommentKitCore["copyAgentContext"]>): Promise<string>;
|
|
72
|
-
grabElement(...args: Parameters<CommentKitCore["grabElement"]>): Promise<import("./core/types").DevGrabResult | null>;
|
|
73
|
-
grabElements(...args: Parameters<CommentKitCore["grabElements"]>): Promise<import("./core/types").DevGrabBundle | null>;
|
|
74
|
-
on<K extends keyof CommentKitEvents>(event: K, listener: EventListener<CommentKitEvents[K]>): import("./headless").Unsubscribe;
|
|
75
|
-
off<K extends keyof CommentKitEvents>(event: K, listener: EventListener<CommentKitEvents[K]>): void;
|
|
76
|
-
onSlice(...args: Parameters<CommentKitCore["onSlice"]>): import("./headless").Unsubscribe;
|
|
77
|
-
select(...args: Parameters<CommentKitCore["select"]>): import("./headless").Unsubscribe;
|
|
78
|
-
getCore(): CommentKitCore;
|
|
79
|
-
destroy(): void;
|
|
80
|
-
}
|
|
81
|
-
declare global {
|
|
82
|
-
interface Window {
|
|
83
|
-
CommentKitConfig?: CommentKitConfig;
|
|
84
|
-
CommentKit?: typeof CommentKit;
|
|
85
|
-
CommentKitInstance?: CommentKit;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Preact integration for CommentKit
|
|
3
|
-
* Uses Preact hooks for reactive state + shared adapter bridge for methods.
|
|
4
|
-
* Mounts the React UI in Shadow DOM automatically (React is a required peer dep).
|
|
5
|
-
*/
|
|
6
|
-
import { STATE_SELECTORS, type AdapterMethods } from "../adapters/bridge";
|
|
7
|
-
import { CommentKitCore } from "../core/comment-kit-core";
|
|
8
|
-
import type { ApiError, CommentKitConfig, CommentKitState } from "../core/types";
|
|
9
|
-
export interface PreactCommentKitOptions extends CommentKitConfig {
|
|
10
|
-
onReady?: () => void;
|
|
11
|
-
onError?: (error: ApiError) => void;
|
|
12
|
-
}
|
|
13
|
-
/** Selector-derived state exposed for parity with the other framework adapters. */
|
|
14
|
-
type SelectedState = {
|
|
15
|
-
[K in keyof typeof STATE_SELECTORS]: ReturnType<(typeof STATE_SELECTORS)[K]>;
|
|
16
|
-
};
|
|
17
|
-
export interface PreactCommentKitReturn extends AdapterMethods, SelectedState {
|
|
18
|
-
state: CommentKitState | null;
|
|
19
|
-
core: CommentKitCore | null;
|
|
20
|
-
isReady: boolean;
|
|
21
|
-
isLoading: boolean;
|
|
22
|
-
error: ApiError | null;
|
|
23
|
-
}
|
|
24
|
-
export declare function useCommentKit(config: PreactCommentKitOptions): PreactCommentKitReturn;
|
|
25
|
-
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";
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Qwik integration for CommentKit
|
|
3
|
-
* Uses Qwik signals for reactive state + shared adapter bridge for methods.
|
|
4
|
-
* Mounts the React UI in Shadow DOM automatically via useVisibleTask$.
|
|
5
|
-
*/
|
|
6
|
-
import { type NoSerialize, type QRL, type ReadonlySignal, type Signal } from "@builder.io/qwik";
|
|
7
|
-
import { type AdapterMethods } from "../adapters/bridge";
|
|
8
|
-
import { CommentKitCore } from "../core/comment-kit-core";
|
|
9
|
-
import type { ApiError, Comment, CommentKitConfig, CommentKitState, ConnectionStatus, DrawingData, PanelView, ScreenshotResult, User } from "../core/types";
|
|
10
|
-
export interface QwikCommentKitOptions extends CommentKitConfig {
|
|
11
|
-
/**
|
|
12
|
-
* Plain-function callback. Works in CSR-only apps; under SSR it cannot be
|
|
13
|
-
* serialized across the resume boundary — use {@link onReady$} instead.
|
|
14
|
-
*/
|
|
15
|
-
onReady?: () => void;
|
|
16
|
-
/** Plain-function error callback (CSR-only) — prefer {@link onError$} under SSR. */
|
|
17
|
-
onError?: (error: ApiError) => void;
|
|
18
|
-
/** SSR-safe QRL ready callback. Fired on first authentication. */
|
|
19
|
-
onReady$?: QRL<() => void>;
|
|
20
|
-
/** SSR-safe QRL error callback. */
|
|
21
|
-
onError$?: QRL<(error: ApiError) => void>;
|
|
22
|
-
}
|
|
23
|
-
export interface QwikCommentKitReturn extends AdapterMethods {
|
|
24
|
-
state: Signal<CommentKitState | null>;
|
|
25
|
-
/** True once the core is created and the first state snapshot arrived. */
|
|
26
|
-
isReady: Signal<boolean>;
|
|
27
|
-
isLoading: Signal<boolean>;
|
|
28
|
-
error: Signal<ApiError | null>;
|
|
29
|
-
/**
|
|
30
|
-
* Live core instance (client-only). Under SSR the value is dropped at
|
|
31
|
-
* serialization and re-populated when the visible task runs on the client —
|
|
32
|
-
* always access it as `core.value?.method()` from client-side code.
|
|
33
|
-
*/
|
|
34
|
-
core: Signal<NoSerialize<CommentKitCore> | null>;
|
|
35
|
-
isAuthenticated: ReadonlySignal<boolean>;
|
|
36
|
-
isOverlayVisible: ReadonlySignal<boolean>;
|
|
37
|
-
isSidebarVisible: ReadonlySignal<boolean>;
|
|
38
|
-
currentUser: ReadonlySignal<User | null>;
|
|
39
|
-
comments: ReadonlySignal<Comment[]>;
|
|
40
|
-
activeTool: ReadonlySignal<string | null>;
|
|
41
|
-
otpStep: ReadonlySignal<string>;
|
|
42
|
-
otpEmail: ReadonlySignal<string | null>;
|
|
43
|
-
pendingMutationCount: ReadonlySignal<number>;
|
|
44
|
-
isOnline: ReadonlySignal<boolean>;
|
|
45
|
-
selectedComment: ReadonlySignal<Comment | null>;
|
|
46
|
-
connectionStatus: ReadonlySignal<ConnectionStatus>;
|
|
47
|
-
panelView: ReadonlySignal<PanelView>;
|
|
48
|
-
isShortcutsOverlayVisible: ReadonlySignal<boolean>;
|
|
49
|
-
activeDrawing: ReadonlySignal<DrawingData | null>;
|
|
50
|
-
activeScreenshot: ReadonlySignal<ScreenshotResult | null>;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Qwik integration for CommentKit.
|
|
54
|
-
*
|
|
55
|
-
* SSR/resumability contract: the `useVisibleTask$` closure captures only
|
|
56
|
-
* serializable values — signals, a plain-data config snapshot, and optional
|
|
57
|
-
* QRL callbacks (`onReady$`/`onError$`). Unserializable extras (plain-function
|
|
58
|
-
* callbacks, `screenshotProvider`) travel through a `noSerialize` store slot:
|
|
59
|
-
* they survive in CSR-only apps and are cleanly dropped (not crashed on) when
|
|
60
|
-
* the component was server-rendered. The widget itself initializes on the
|
|
61
|
-
* client in both cases.
|
|
62
|
-
*
|
|
63
|
-
* Bridge methods returned from this hook are plain closures — they work when
|
|
64
|
-
* called from client-side code but must not be captured across another
|
|
65
|
-
* `$`-serialization boundary (e.g. an `onClick$`). For interactive handlers,
|
|
66
|
-
* read the live instance from the returned `core` signal instead:
|
|
67
|
-
* `core.value?.toggleOverlay()`.
|
|
68
|
-
*/
|
|
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 };
|
|
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";
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { STATE_SELECTORS } from "../adapters/bridge";
|
|
3
|
-
import type { AdapterMethods } from "../adapters/bridge";
|
|
4
|
-
import { CommentKitCore } from "../core/comment-kit-core";
|
|
5
|
-
import type { ApiError, CommentKitConfig, CommentKitState, ReactCommentKitProps as BaseReactCommentKitProps } from "../core/types";
|
|
6
|
-
/**
|
|
7
|
-
* Precisely-typed React props. The core types module ships a loose
|
|
8
|
-
* `children?: unknown` so its .d.ts doesn't require @types/react.
|
|
9
|
-
*/
|
|
10
|
-
export interface ReactCommentKitProps extends Omit<BaseReactCommentKitProps, "children"> {
|
|
11
|
-
children?: React.ReactNode;
|
|
12
|
-
}
|
|
13
|
-
interface UseCommentKitCallbacks {
|
|
14
|
-
onReady?: () => void;
|
|
15
|
-
onError?: (error: ApiError) => void;
|
|
16
|
-
}
|
|
17
|
-
/** Selector-derived state exposed for parity with the other framework adapters. */
|
|
18
|
-
type SelectedState = {
|
|
19
|
-
[K in keyof typeof STATE_SELECTORS]: ReturnType<(typeof STATE_SELECTORS)[K]>;
|
|
20
|
-
};
|
|
21
|
-
export interface UseCommentKitResult extends AdapterMethods, SelectedState {
|
|
22
|
-
state: CommentKitState | null;
|
|
23
|
-
core: CommentKitCore | null;
|
|
24
|
-
isReady: boolean;
|
|
25
|
-
isLoading: boolean;
|
|
26
|
-
error: ApiError | null;
|
|
27
|
-
}
|
|
28
|
-
export declare function useCommentKit(config: CommentKitConfig, callbacks?: UseCommentKitCallbacks): UseCommentKitResult;
|
|
29
|
-
export declare const CommentKit: React.FC<ReactCommentKitProps>;
|
|
30
|
-
export declare const CommentKitProvider: React.FC<ReactCommentKitProps>;
|
|
31
|
-
export default CommentKit;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { CommentKit, CommentKitProvider, useCommentKit } from "./client";
|
|
2
|
-
export type { ReactCommentKitProps, UseCommentKitResult } from "./client";
|
|
3
|
-
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";
|
|
4
|
-
export { default } from "./client";
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Solid.js integration for CommentKit
|
|
3
|
-
* Uses Solid signals for reactive state + shared adapter bridge for methods.
|
|
4
|
-
* Mounts the React UI in Shadow DOM automatically.
|
|
5
|
-
*/
|
|
6
|
-
import { type AdapterMethods } from "../adapters/bridge";
|
|
7
|
-
import { CommentKitCore } from "../core/comment-kit-core";
|
|
8
|
-
import type { ApiError, Comment, CommentKitConfig, CommentKitState, ConnectionStatus, DrawingData, PanelView, ScreenshotResult, User } from "../core/types";
|
|
9
|
-
export interface SolidCommentKitOptions extends CommentKitConfig {
|
|
10
|
-
onReady?: () => void;
|
|
11
|
-
onError?: (error: ApiError) => void;
|
|
12
|
-
}
|
|
13
|
-
export interface SolidCommentKitReturn extends AdapterMethods {
|
|
14
|
-
state: () => CommentKitState | null;
|
|
15
|
-
isReady: () => boolean;
|
|
16
|
-
isLoading: () => boolean;
|
|
17
|
-
error: () => ApiError | null;
|
|
18
|
-
core: () => CommentKitCore | null;
|
|
19
|
-
isAuthenticated: () => boolean;
|
|
20
|
-
isOverlayVisible: () => boolean;
|
|
21
|
-
isSidebarVisible: () => boolean;
|
|
22
|
-
currentUser: () => User | null;
|
|
23
|
-
comments: () => Comment[];
|
|
24
|
-
activeTool: () => string | null;
|
|
25
|
-
otpStep: () => string;
|
|
26
|
-
otpEmail: () => string | null;
|
|
27
|
-
pendingMutationCount: () => number;
|
|
28
|
-
isOnline: () => boolean;
|
|
29
|
-
selectedComment: () => Comment | null;
|
|
30
|
-
connectionStatus: () => ConnectionStatus;
|
|
31
|
-
panelView: () => PanelView;
|
|
32
|
-
isShortcutsOverlayVisible: () => boolean;
|
|
33
|
-
activeDrawing: () => DrawingData | null;
|
|
34
|
-
activeScreenshot: () => ScreenshotResult | null;
|
|
35
|
-
}
|
|
36
|
-
export declare function useCommentKit(options: SolidCommentKitOptions): SolidCommentKitReturn;
|
|
37
|
-
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";
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Svelte Stores integration for CommentKit
|
|
3
|
-
* Provides reactive stores and component integration with proper Svelte patterns
|
|
4
|
-
*
|
|
5
|
-
* Uses the shared adapter bridge for method delegations, keeping this file
|
|
6
|
-
* focused on Svelte-specific reactivity wiring (writable/derived stores).
|
|
7
|
-
*/
|
|
8
|
-
import { type Readable } from "svelte/store";
|
|
9
|
-
import { CommentKitCore } from "../core/comment-kit-core";
|
|
10
|
-
import type { AdapterMethods } from "../adapters/bridge";
|
|
11
|
-
import type { ApiError, CommentKitConfig, CommentKitState, ConnectionStatus, DrawingData, ScreenshotResult, Comment, PanelView, User } from "../core/types";
|
|
12
|
-
export interface SvelteCommentKitOptions extends CommentKitConfig {
|
|
13
|
-
onReady?: () => void;
|
|
14
|
-
onError?: (error: ApiError) => void;
|
|
15
|
-
}
|
|
16
|
-
export interface SvelteCommentKitStore extends AdapterMethods {
|
|
17
|
-
core: Readable<CommentKitCore | null>;
|
|
18
|
-
state: Readable<CommentKitState | null>;
|
|
19
|
-
isReady: Readable<boolean>;
|
|
20
|
-
isLoading: Readable<boolean>;
|
|
21
|
-
error: Readable<ApiError | null>;
|
|
22
|
-
isAuthenticated: Readable<boolean>;
|
|
23
|
-
isOverlayVisible: Readable<boolean>;
|
|
24
|
-
isSidebarVisible: Readable<boolean>;
|
|
25
|
-
currentUser: Readable<User | null>;
|
|
26
|
-
comments: Readable<Comment[]>;
|
|
27
|
-
activeTool: Readable<string | null>;
|
|
28
|
-
otpStep: Readable<string>;
|
|
29
|
-
otpEmail: Readable<string | null>;
|
|
30
|
-
pendingMutationCount: Readable<number>;
|
|
31
|
-
isOnline: Readable<boolean>;
|
|
32
|
-
selectedComment: Readable<Comment | null>;
|
|
33
|
-
connectionStatus: Readable<ConnectionStatus>;
|
|
34
|
-
panelView: Readable<PanelView>;
|
|
35
|
-
isShortcutsOverlayVisible: Readable<boolean>;
|
|
36
|
-
activeDrawing: Readable<DrawingData | null>;
|
|
37
|
-
activeScreenshot: Readable<ScreenshotResult | null>;
|
|
38
|
-
destroy: () => void;
|
|
39
|
-
}
|
|
40
|
-
export declare function createCommentKitStore(options: SvelteCommentKitOptions): SvelteCommentKitStore;
|
|
41
|
-
export declare function useCommentKit(options: SvelteCommentKitOptions): SvelteCommentKitStore;
|
|
42
|
-
export declare function commentKitAction(_node: HTMLElement, options: SvelteCommentKitOptions): {
|
|
43
|
-
/** The live store — lets `use:commentKitAction` consumers subscribe to
|
|
44
|
-
* state and call SDK methods (previously the store was unreachable). */
|
|
45
|
-
getStore(): SvelteCommentKitStore;
|
|
46
|
-
destroy(): void;
|
|
47
|
-
update(newOptions: SvelteCommentKitOptions): void;
|
|
48
|
-
};
|
|
49
|
-
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";
|
|
50
|
-
declare const _default: {
|
|
51
|
-
createCommentKitStore: typeof createCommentKitStore;
|
|
52
|
-
useCommentKit: typeof useCommentKit;
|
|
53
|
-
commentKitAction: typeof commentKitAction;
|
|
54
|
-
};
|
|
55
|
-
export default _default;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { Position } from "../core/types";
|
|
2
|
-
export declare function generateSelector(element: Element): string;
|
|
3
|
-
export declare function generateXPath(element: Element): string;
|
|
4
|
-
export declare function findElement(selector: string, xpath?: string): Element | null;
|
|
5
|
-
export declare function viewportToPercentage(x: number, y: number, viewport?: {
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
}): Position;
|
|
9
|
-
export declare function percentageToViewport(x: number, y: number, viewport?: {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
}): {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
};
|
|
16
|
-
export declare function getCurrentPage(): {
|
|
17
|
-
url: string;
|
|
18
|
-
path: string;
|
|
19
|
-
title: string;
|
|
20
|
-
domain: string;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* True when the element's bounding rect lies ENTIRELY inside the viewport.
|
|
24
|
-
* Note: an element partially scrolled off-screen (or larger than the
|
|
25
|
-
* viewport) returns false — this is an "is fully in view" check, not a
|
|
26
|
-
* general visibility test.
|
|
27
|
-
*/
|
|
28
|
-
export declare function isElementVisible(element: Element): boolean;
|
|
29
|
-
export declare function getElementBounds(element: Element): {
|
|
30
|
-
top: number;
|
|
31
|
-
left: number;
|
|
32
|
-
width: number;
|
|
33
|
-
height: number;
|
|
34
|
-
bottom: number;
|
|
35
|
-
right: number;
|
|
36
|
-
};
|
|
37
|
-
export declare function generateId(prefix?: string): string;
|
|
38
|
-
export interface DebouncedFn<T extends (...args: never[]) => unknown> {
|
|
39
|
-
(...args: Parameters<T>): void;
|
|
40
|
-
/** Cancel any pending trailing invocation. */
|
|
41
|
-
cancel: () => void;
|
|
42
|
-
}
|
|
43
|
-
export declare function debounce<T extends (...args: never[]) => unknown>(func: T, wait: number): DebouncedFn<T>;
|
|
44
|
-
export interface ThrottledFn<T extends (...args: never[]) => unknown> {
|
|
45
|
-
(...args: Parameters<T>): void;
|
|
46
|
-
/** Cancel any pending trailing invocation. */
|
|
47
|
-
cancel: () => void;
|
|
48
|
-
}
|
|
49
|
-
export declare function throttle<T extends (...args: never[]) => unknown>(func: T, limit: number): ThrottledFn<T>;
|
|
50
|
-
export declare function isInteractiveElement(element: Element): boolean;
|
|
51
|
-
export declare function getSelectionText(): string;
|
|
52
|
-
export declare function getSelectionRange(): {
|
|
53
|
-
text: string;
|
|
54
|
-
startOffset: number;
|
|
55
|
-
endOffset: number;
|
|
56
|
-
element: string;
|
|
57
|
-
xpath: string;
|
|
58
|
-
range: Range;
|
|
59
|
-
} | null;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CommentKitEvents, EventListener, Unsubscribe } from "../core/types";
|
|
2
|
-
export declare class EventEmitter {
|
|
3
|
-
private listeners;
|
|
4
|
-
private onceWrappers;
|
|
5
|
-
on<K extends keyof CommentKitEvents>(event: K, listener: EventListener<CommentKitEvents[K]>): Unsubscribe;
|
|
6
|
-
off<K extends keyof CommentKitEvents>(event: K, listener: EventListener<CommentKitEvents[K]>): void;
|
|
7
|
-
emit<K extends keyof CommentKitEvents>(event: K, data: CommentKitEvents[K]): void;
|
|
8
|
-
once<K extends keyof CommentKitEvents>(event: K, listener: EventListener<CommentKitEvents[K]>): Unsubscribe;
|
|
9
|
-
removeAllListeners(event?: keyof CommentKitEvents): void;
|
|
10
|
-
listenerCount(event: keyof CommentKitEvents): number;
|
|
11
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vue 3 Composition API integration for CommentKit
|
|
3
|
-
* Uses the shared adapter bridge for method delegations.
|
|
4
|
-
*/
|
|
5
|
-
import { type Ref, type ShallowRef, type VNode } from "vue";
|
|
6
|
-
import { CommentKitCore } from "../core/comment-kit-core";
|
|
7
|
-
import { type AdapterMethods } from "../adapters/bridge";
|
|
8
|
-
import type { ApiError, Comment, CommentKitConfig, CommentKitState, DrawingData, ScreenshotResult, User } from "../core/types";
|
|
9
|
-
export interface VueCommentKitOptions extends CommentKitConfig {
|
|
10
|
-
onReady?: () => void;
|
|
11
|
-
onError?: (error: ApiError) => void;
|
|
12
|
-
}
|
|
13
|
-
export interface VueCommentKitReturn extends AdapterMethods {
|
|
14
|
-
state: Ref<CommentKitState | null>;
|
|
15
|
-
isReady: Ref<boolean>;
|
|
16
|
-
isLoading: Ref<boolean>;
|
|
17
|
-
error: Ref<ApiError | null>;
|
|
18
|
-
core: ShallowRef<CommentKitCore | null>;
|
|
19
|
-
isAuthenticated: Ref<boolean>;
|
|
20
|
-
isOverlayVisible: Ref<boolean>;
|
|
21
|
-
isSidebarVisible: Ref<boolean>;
|
|
22
|
-
currentUser: Ref<User | null>;
|
|
23
|
-
comments: Ref<Comment[]>;
|
|
24
|
-
activeTool: Ref<string | null>;
|
|
25
|
-
otpStep: Ref<string>;
|
|
26
|
-
otpEmail: Ref<string | null>;
|
|
27
|
-
pendingMutationCount: Ref<number>;
|
|
28
|
-
isOnline: Ref<boolean>;
|
|
29
|
-
selectedComment: Ref<Comment | null>;
|
|
30
|
-
connectionStatus: Ref<string>;
|
|
31
|
-
panelView: Ref<string>;
|
|
32
|
-
isShortcutsOverlayVisible: Ref<boolean>;
|
|
33
|
-
activeDrawing: Ref<DrawingData | null>;
|
|
34
|
-
activeScreenshot: Ref<ScreenshotResult | null>;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Vue composable for CommentKit.
|
|
38
|
-
*
|
|
39
|
-
* Accepts either a plain options object or a getter over reactive sources
|
|
40
|
-
* (e.g. `() => ({ apiKey: props.apiKey, ... })`). With a getter, changes to
|
|
41
|
-
* `apiKey`/`baseUrl`/`enabled`/`ui` destroy and re-create the core — parity
|
|
42
|
-
* with the React adapter. A plain object is captured once (no reactivity).
|
|
43
|
-
*
|
|
44
|
-
* `isReady` becomes true once the core is created and the first state
|
|
45
|
-
* snapshot has arrived (aligned across all adapters); the `onReady` callback
|
|
46
|
-
* still fires on first authentication.
|
|
47
|
-
*/
|
|
48
|
-
export declare function useCommentKit(options: VueCommentKitOptions | (() => VueCommentKitOptions)): VueCommentKitReturn;
|
|
49
|
-
export declare const CommentKit: {
|
|
50
|
-
name: string;
|
|
51
|
-
props: {
|
|
52
|
-
apiKey: {
|
|
53
|
-
type: StringConstructor;
|
|
54
|
-
required: boolean;
|
|
55
|
-
};
|
|
56
|
-
baseUrl: {
|
|
57
|
-
type: StringConstructor;
|
|
58
|
-
default: undefined;
|
|
59
|
-
};
|
|
60
|
-
enabled: {
|
|
61
|
-
default: undefined;
|
|
62
|
-
};
|
|
63
|
-
screenshotProvider: {
|
|
64
|
-
type: FunctionConstructor;
|
|
65
|
-
default: undefined;
|
|
66
|
-
};
|
|
67
|
-
ui: {
|
|
68
|
-
type: ObjectConstructor;
|
|
69
|
-
default: undefined;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
emits: string[];
|
|
73
|
-
setup(props: Record<string, unknown>, { emit, slots, }: {
|
|
74
|
-
emit: (event: string, ...args: unknown[]) => void;
|
|
75
|
-
slots: Record<string, (() => VNode[]) | undefined>;
|
|
76
|
-
}): () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
77
|
-
[key: string]: any;
|
|
78
|
-
}>;
|
|
79
|
-
};
|
|
80
|
-
export declare const CommentKitPlugin: {
|
|
81
|
-
install(app: {
|
|
82
|
-
component: (name: string, component: unknown) => void;
|
|
83
|
-
provide: (key: string, value: unknown) => void;
|
|
84
|
-
}): void;
|
|
85
|
-
};
|
|
86
|
-
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";
|
|
87
|
-
export default CommentKit;
|