@commentkit/comment-kit 0.0.0-stage → 0.6.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 +276 -0
- package/LICENSE +18 -0
- package/README.md +766 -2
- package/dist/angular/ShadowRootContext-2BrAO1qU.js +7 -0
- package/dist/angular/chunk-Cyg4N8Ue.js +11 -0
- package/dist/angular/comment-kit-ui-wEJfMh4T.js +9483 -0
- package/dist/angular/dom-ON-u4y6t.js +97 -0
- package/dist/angular/error-boundary-CxhCm8iF.js +21 -0
- package/dist/angular/limits-AEqOBweE.js +71 -0
- package/dist/angular/mount-ui-CxChSb8B.js +55 -0
- package/dist/angular/pusher-Vs-W-c8I.js +2504 -0
- package/dist/angular/realtime-CfJZMEAi.js +558 -0
- package/dist/angular/shadow-root-C7wgghDv.js +86 -0
- package/dist/angular/styles-CvndAWRF.js +2 -0
- package/dist/angular.es.js +3656 -0
- package/dist/comment-kit.es.js +3361 -0
- package/dist/core/ShadowRootContext--ArKkwbH.js +7 -0
- package/dist/core/chunk-t7YoJN_i.js +11 -0
- package/dist/core/comment-kit-ui-DjWARy4X.js +9483 -0
- package/dist/core/dom-x9svfpMk.js +223 -0
- package/dist/core/error-boundary-CN_BGsYl.js +21 -0
- package/dist/core/mount-ui-DrFjMJJu.js +55 -0
- package/dist/core/pusher-CizoY5NA.js +2504 -0
- package/dist/core/realtime-DYf6E_sN.js +278 -0
- package/dist/core/shadow-root-09zwHxly.js +86 -0
- package/dist/core/styles-D19zARBi.js +2 -0
- package/dist/core/websocket-manager-DorGPjR4.js +351 -0
- package/dist/preact/ShadowRootContext-CJWLIRy4.js +7 -0
- package/dist/preact/chunk-CZ0PdaaN.js +11 -0
- package/dist/preact/comment-kit-ui-BKi15Z4Q.js +9483 -0
- package/dist/preact/dom-BAV8grk_.js +97 -0
- package/dist/preact/error-boundary-B4-Bfy3g.js +21 -0
- package/dist/preact/limits-C3ZEKcL_.js +71 -0
- package/dist/preact/mount-ui-b9JcJQYE.js +55 -0
- package/dist/preact/pusher-BP4kCufH.js +2504 -0
- package/dist/preact/realtime-BFgP4BlB.js +558 -0
- package/dist/preact/shadow-root-DAhpHo_W.js +86 -0
- package/dist/preact/styles-Dwd4AJR8.js +2 -0
- package/dist/preact.es.js +3465 -0
- package/dist/qwik/ShadowRootContext-CTbULRKq.js +7 -0
- package/dist/qwik/chunk-CKKKzG2Q.js +11 -0
- package/dist/qwik/comment-kit-ui-CRmJhZlX.js +9483 -0
- package/dist/qwik/dom-BjJ-QroQ.js +97 -0
- package/dist/qwik/error-boundary-C4hlYQwS.js +21 -0
- package/dist/qwik/limits-DK35yjGY.js +71 -0
- package/dist/qwik/mount-ui-CaRrLb9u.js +55 -0
- package/dist/qwik/pusher-B1KgC4iB.js +2504 -0
- package/dist/qwik/realtime-DUhkZAVc.js +558 -0
- package/dist/qwik/shadow-root-tLjXys-_.js +86 -0
- package/dist/qwik/styles-BB1B91hh.js +2 -0
- package/dist/qwik.es.js +3458 -0
- package/dist/react/chunk--MHYZ-zp.js +12 -0
- package/dist/react/limits-Dflmuf1P.js +168 -0
- package/dist/react/pusher-3dki8s2l.js +2505 -0
- package/dist/react/realtime-C7h-Agwo.js +558 -0
- package/dist/react.es.js +13010 -0
- package/dist/solid/ShadowRootContext-BS6MCclL.js +7 -0
- package/dist/solid/chunk-B2NCWFvW.js +11 -0
- package/dist/solid/comment-kit-ui-Dw_67h_e.js +9483 -0
- package/dist/solid/dom-Bpw1A0oz.js +97 -0
- package/dist/solid/error-boundary-9mimpbZA.js +21 -0
- package/dist/solid/limits-B_69IbLl.js +71 -0
- package/dist/solid/mount-ui-bPWYgjmm.js +55 -0
- package/dist/solid/pusher-_RVNpj1f.js +2504 -0
- package/dist/solid/realtime-DK86zDCJ.js +558 -0
- package/dist/solid/shadow-root-D5nErAFI.js +86 -0
- package/dist/solid/styles-CtYBghRP.js +2 -0
- package/dist/solid.es.js +3446 -0
- package/dist/svelte/ShadowRootContext-DhByMr-q.js +7 -0
- package/dist/svelte/chunk-Pi70BKld.js +11 -0
- package/dist/svelte/comment-kit-ui-DhCWlEd8.js +9483 -0
- package/dist/svelte/dom-mfioQqLy.js +97 -0
- package/dist/svelte/error-boundary-C3GWI_IX.js +21 -0
- package/dist/svelte/limits-CURF22v3.js +71 -0
- package/dist/svelte/mount-ui-DtXWMEYn.js +55 -0
- package/dist/svelte/pusher-DN1BiUDw.js +2504 -0
- package/dist/svelte/realtime-zYOctwRk.js +558 -0
- package/dist/svelte/shadow-root-Cz-v-rYe.js +86 -0
- package/dist/svelte/styles-DKCGeARl.js +2 -0
- package/dist/svelte.es.js +3478 -0
- package/dist/types/adapters/bridge.d.ts +125 -0
- package/dist/types/adapters/errors.d.ts +3 -0
- package/dist/types/angular/index.d.ts +135 -0
- package/dist/types/core/agent-context.d.ts +17 -0
- package/dist/types/core/api-client.d.ts +137 -0
- package/dist/types/core/auth.d.ts +18 -0
- package/dist/types/core/comment-kit-core.d.ts +215 -0
- package/dist/types/core/comments.d.ts +43 -0
- package/dist/types/core/dev-grab.d.ts +14 -0
- package/dist/types/core/keyboard.d.ts +12 -0
- package/dist/types/core/limits.d.ts +52 -0
- package/dist/types/core/offline-queue.d.ts +23 -0
- package/dist/types/core/realtime.d.ts +9 -0
- package/dist/types/core/screenshot.d.ts +12 -0
- package/dist/types/core/session.d.ts +9 -0
- package/dist/types/core/source-resolver.d.ts +19 -0
- package/dist/types/core/state.d.ts +24 -0
- package/dist/types/core/types.d.ts +610 -0
- package/dist/types/core/websocket-manager.d.ts +107 -0
- package/dist/types/index.d.ts +85 -0
- package/dist/types/preact/index.d.ts +25 -0
- package/dist/types/qwik/index.d.ts +70 -0
- package/dist/types/react/client.d.ts +31 -0
- package/dist/types/react/comment-kit-ui.d.ts +9 -0
- package/dist/types/react/components/comment-fab.d.ts +34 -0
- package/dist/types/react/components/dev-export-panel.d.ts +10 -0
- package/dist/types/react/components/element-selector.d.ts +11 -0
- package/dist/types/react/components/live-region.d.ts +16 -0
- package/dist/types/react/components/screenshot-capture.d.ts +17 -0
- package/dist/types/react/components/status-indicator.d.ts +43 -0
- package/dist/types/react/error-boundary.d.ts +25 -0
- package/dist/types/react/index.d.ts +4 -0
- package/dist/types/react/is-local-host.d.ts +2 -0
- package/dist/types/react/mount-ui.d.ts +19 -0
- package/dist/types/react/shadow-root.d.ts +23 -0
- package/dist/types/react/shims/use-sync-external-store-with-selector.d.ts +4 -0
- package/dist/types/react/shims/use-sync-external-store.d.ts +1 -0
- package/dist/types/react/ui/lib/ShadowRootContext.d.ts +10 -0
- package/dist/types/react/ui/lib/cn.d.ts +12 -0
- package/dist/types/react/ui/primitives/alert-dialog/alert-dialog.d.ts +23 -0
- package/dist/types/react/ui/primitives/alert-dialog/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/avatar/avatar.d.ts +10 -0
- package/dist/types/react/ui/primitives/avatar/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/badge/badge.d.ts +5 -0
- package/dist/types/react/ui/primitives/badge/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/button/button.d.ts +6 -0
- package/dist/types/react/ui/primitives/button/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/card/card.d.ts +11 -0
- package/dist/types/react/ui/primitives/card/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/checkbox/checkbox.d.ts +3 -0
- package/dist/types/react/ui/primitives/checkbox/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/dialog/dialog.d.ts +17 -0
- package/dist/types/react/ui/primitives/dialog/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/dropdown-menu/dropdown-menu.d.ts +29 -0
- package/dist/types/react/ui/primitives/dropdown-menu/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/empty/empty.d.ts +10 -0
- package/dist/types/react/ui/primitives/empty/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/field/field.d.ts +22 -0
- package/dist/types/react/ui/primitives/field/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/hover-card/hover-card.d.ts +6 -0
- package/dist/types/react/ui/primitives/hover-card/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/input/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/input/input.d.ts +3 -0
- package/dist/types/react/ui/primitives/input-group/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/input-group/input-group.d.ts +16 -0
- package/dist/types/react/ui/primitives/kbd/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/kbd/kbd.d.ts +4 -0
- package/dist/types/react/ui/primitives/label/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/label/label.d.ts +3 -0
- package/dist/types/react/ui/primitives/native-select/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/native-select/native-select.d.ts +7 -0
- package/dist/types/react/ui/primitives/popover/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/popover/popover.d.ts +9 -0
- package/dist/types/react/ui/primitives/preview/component-preview.d.ts +8 -0
- package/dist/types/react/ui/primitives/progress/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/progress/progress.d.ts +7 -0
- package/dist/types/react/ui/primitives/radio-group/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/radio-group/radio-group.d.ts +6 -0
- package/dist/types/react/ui/primitives/scroll-area/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/scroll-area/scroll-area.d.ts +6 -0
- package/dist/types/react/ui/primitives/select/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/select/select.d.ts +15 -0
- package/dist/types/react/ui/primitives/separator/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/separator/separator.d.ts +3 -0
- package/dist/types/react/ui/primitives/sheet/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/sheet/sheet.d.ts +14 -0
- package/dist/types/react/ui/primitives/skeleton/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/skeleton/skeleton.d.ts +3 -0
- package/dist/types/react/ui/primitives/slider/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/slider/slider.d.ts +7 -0
- package/dist/types/react/ui/primitives/sonner/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/sonner/sonner.d.ts +4 -0
- package/dist/types/react/ui/primitives/spinner/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/spinner/spinner.d.ts +3 -0
- package/dist/types/react/ui/primitives/switch/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/switch/switch.d.ts +5 -0
- package/dist/types/react/ui/primitives/tabs/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/tabs/tabs.d.ts +8 -0
- package/dist/types/react/ui/primitives/textarea/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/textarea/textarea.d.ts +3 -0
- package/dist/types/react/ui/primitives/toggle/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/toggle/toggle.d.ts +7 -0
- package/dist/types/react/ui/primitives/toggle-group/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/toggle-group/toggle-group.d.ts +14 -0
- package/dist/types/react/ui/primitives/tooltip/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/tooltip/tooltip.d.ts +7 -0
- package/dist/types/solid/index.d.ts +37 -0
- package/dist/types/svelte/index.d.ts +55 -0
- package/dist/types/utils/dom.d.ts +59 -0
- package/dist/types/utils/event-emitter.d.ts +11 -0
- package/dist/types/utils/freeze-animations.d.ts +8 -0
- package/dist/types/utils/text.d.ts +9 -0
- package/dist/types/utils/validation.d.ts +10 -0
- package/dist/types/vue/index.d.ts +87 -0
- package/dist/vue/ShadowRootContext-BQTcHNil.js +7 -0
- package/dist/vue/chunk-DHrubWSL.js +11 -0
- package/dist/vue/comment-kit-ui-BX1wDZ2c.js +9483 -0
- package/dist/vue/dom-eo0P9Z6Z.js +97 -0
- package/dist/vue/error-boundary-DW6uGR8U.js +21 -0
- package/dist/vue/limits-B6csdQeI.js +71 -0
- package/dist/vue/mount-ui-DdTYzv6J.js +55 -0
- package/dist/vue/pusher-cmjNbW6a.js +2504 -0
- package/dist/vue/realtime-YJKvS2eB.js +558 -0
- package/dist/vue/shadow-root-SLTVf5yk.js +86 -0
- package/dist/vue/styles-BrHt1-ia.js +2 -0
- package/dist/vue.es.js +3495 -0
- package/package.json +205 -4
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export { ApiClient, formatMention, parseMentions, stripMentionMarkup } from "./core/api-client";
|
|
2
|
+
export { createAgentContext, formatAgentContext } from "./core/agent-context";
|
|
3
|
+
export { CommentKitCore, SDK_VERSION } from "./core/comment-kit-core";
|
|
4
|
+
export { WebSocketManager } from "./core/websocket-manager";
|
|
5
|
+
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 { debounce, findElement, generateId, generateSelector, generateXPath, getCurrentPage, getElementBounds, getSelectionRange, getSelectionText, isElementVisible, isInteractiveElement, percentageToViewport, throttle, viewportToPercentage, } from "./utils/dom";
|
|
7
|
+
export { EventEmitter } from "./utils/event-emitter";
|
|
8
|
+
import type { CommentKitConfig, CommentKitEvents, DrawingData, DrawingPath, EventListener, ScreenshotResult } from "./core/types";
|
|
9
|
+
import { CommentKitCore } from "./core/comment-kit-core";
|
|
10
|
+
export declare class CommentKit {
|
|
11
|
+
private core;
|
|
12
|
+
private mountedUI;
|
|
13
|
+
private destroyed;
|
|
14
|
+
constructor(config: CommentKitConfig);
|
|
15
|
+
private mount;
|
|
16
|
+
getState(): import(".").CommentKitState;
|
|
17
|
+
getConfig(): Readonly<CommentKitConfig>;
|
|
18
|
+
getFeatures(): {
|
|
19
|
+
comments?: boolean;
|
|
20
|
+
drawing?: boolean;
|
|
21
|
+
highlighting?: boolean;
|
|
22
|
+
screenshots?: boolean;
|
|
23
|
+
realtime?: boolean;
|
|
24
|
+
};
|
|
25
|
+
validateInvite(email: string): Promise<void>;
|
|
26
|
+
login(email: string): Promise<void>;
|
|
27
|
+
verifyOtp(otp: string): Promise<void>;
|
|
28
|
+
cancelOtp(): void;
|
|
29
|
+
resendOtp(): Promise<void>;
|
|
30
|
+
logout(): void;
|
|
31
|
+
toggleLoginModal(): void;
|
|
32
|
+
toggleOverlay(): void;
|
|
33
|
+
toggleSidebar(): void;
|
|
34
|
+
setTool(tool: Parameters<CommentKitCore["setTool"]>[0]): void;
|
|
35
|
+
createComment(...args: Parameters<CommentKitCore["createComment"]>): Promise<void>;
|
|
36
|
+
updateComment(...args: Parameters<CommentKitCore["updateComment"]>): Promise<void>;
|
|
37
|
+
deleteComment(id: string): Promise<void>;
|
|
38
|
+
resolveComment(id: string): Promise<void>;
|
|
39
|
+
unresolveComment(id: string): Promise<void>;
|
|
40
|
+
completeComment(id: string): Promise<void>;
|
|
41
|
+
selectComment(comment: Parameters<CommentKitCore["selectComment"]>[0]): void;
|
|
42
|
+
addReply(commentId: string, content: string): Promise<void>;
|
|
43
|
+
updateReply(commentId: string, replyId: string, content: string): Promise<void>;
|
|
44
|
+
deleteReply(commentId: string, replyId: string): Promise<void>;
|
|
45
|
+
reactToComment(commentId: string, emoji: string): Promise<void>;
|
|
46
|
+
updateCommentPosition(commentId: string, x: number, y: number): Promise<void>;
|
|
47
|
+
loadMoreComments(): Promise<void>;
|
|
48
|
+
createHighlight(...args: Parameters<CommentKitCore["createHighlight"]>): Promise<void>;
|
|
49
|
+
createDrawing(...args: Parameters<CommentKitCore["createDrawing"]>): Promise<void>;
|
|
50
|
+
setActiveDrawing(drawing: DrawingData | null): void;
|
|
51
|
+
sendDrawingStroke(path: DrawingPath): void;
|
|
52
|
+
captureScreenshot(el?: HTMLElement): Promise<ScreenshotResult | null>;
|
|
53
|
+
uploadScreenshot(...args: Parameters<CommentKitCore["uploadScreenshot"]>): Promise<import(".").Comment | null>;
|
|
54
|
+
setActiveScreenshot(screenshot: ScreenshotResult | null): void;
|
|
55
|
+
uploadFiles(files: File[]): Promise<string[]>;
|
|
56
|
+
getOnlineUsers(): import(".").User[];
|
|
57
|
+
getProjectMembers(): Promise<import(".").User[]>;
|
|
58
|
+
toggleShortcutsOverlay(): void;
|
|
59
|
+
markThreadSeen(threadId: string): void;
|
|
60
|
+
isThreadNew(threadId: string): boolean;
|
|
61
|
+
setPanelView(view: Parameters<CommentKitCore["setPanelView"]>[0]): void;
|
|
62
|
+
markAllActivitiesRead(): void;
|
|
63
|
+
getUnreadActivityCount(): number;
|
|
64
|
+
getPendingMutationCount(): number;
|
|
65
|
+
getAgentContext(...args: Parameters<CommentKitCore["getAgentContext"]>): import(".").AgentContextExport;
|
|
66
|
+
getAgentContextAsync(...args: Parameters<CommentKitCore["getAgentContextAsync"]>): Promise<import(".").AgentContextExport>;
|
|
67
|
+
formatAgentContext(...args: Parameters<CommentKitCore["formatAgentContext"]>): string;
|
|
68
|
+
formatAgentContextAsync(...args: Parameters<CommentKitCore["formatAgentContextAsync"]>): Promise<string>;
|
|
69
|
+
copyAgentContext(...args: Parameters<CommentKitCore["copyAgentContext"]>): Promise<string>;
|
|
70
|
+
grabElement(...args: Parameters<CommentKitCore["grabElement"]>): Promise<import("./core/types").DevGrabResult | null>;
|
|
71
|
+
grabElements(...args: Parameters<CommentKitCore["grabElements"]>): Promise<import("./core/types").DevGrabBundle | null>;
|
|
72
|
+
on<K extends keyof CommentKitEvents>(event: K, listener: EventListener<CommentKitEvents[K]>): import(".").Unsubscribe;
|
|
73
|
+
off<K extends keyof CommentKitEvents>(event: K, listener: EventListener<CommentKitEvents[K]>): void;
|
|
74
|
+
onSlice(...args: Parameters<CommentKitCore["onSlice"]>): import(".").Unsubscribe;
|
|
75
|
+
select(...args: Parameters<CommentKitCore["select"]>): import(".").Unsubscribe;
|
|
76
|
+
getCore(): CommentKitCore;
|
|
77
|
+
destroy(): void;
|
|
78
|
+
}
|
|
79
|
+
declare global {
|
|
80
|
+
interface Window {
|
|
81
|
+
CommentKitConfig?: CommentKitConfig;
|
|
82
|
+
CommentKit?: typeof CommentKit;
|
|
83
|
+
CommentKitInstance?: CommentKit;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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";
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
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";
|
|
@@ -0,0 +1,31 @@
|
|
|
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;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CommentKitCore } from "../core/comment-kit-core";
|
|
3
|
+
import type { CommentKitState } from "../core/types";
|
|
4
|
+
interface CommentKitUIProps {
|
|
5
|
+
core: CommentKitCore;
|
|
6
|
+
state: CommentKitState;
|
|
7
|
+
}
|
|
8
|
+
export declare const CommentKitUI: React.FC<CommentKitUIProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CommentKitCore } from "../../core/comment-kit-core";
|
|
3
|
+
import type { CommentKitState } from "../../core/types";
|
|
4
|
+
interface CommentFabProps {
|
|
5
|
+
/** CommentKitCore instance — drives all state */
|
|
6
|
+
core: CommentKitCore;
|
|
7
|
+
/** Current state snapshot from core */
|
|
8
|
+
state: CommentKitState;
|
|
9
|
+
/** Feature flags from config (core.config.features) */
|
|
10
|
+
features?: {
|
|
11
|
+
comments?: boolean;
|
|
12
|
+
drawing?: boolean;
|
|
13
|
+
highlighting?: boolean;
|
|
14
|
+
screenshots?: boolean;
|
|
15
|
+
realtime?: boolean;
|
|
16
|
+
};
|
|
17
|
+
/** Whether the FAB is hidden */
|
|
18
|
+
hidden?: boolean;
|
|
19
|
+
/** Called when user confirms hiding the toolbar */
|
|
20
|
+
onHide?: () => void;
|
|
21
|
+
/** Number of comments currently available for agent handoff */
|
|
22
|
+
agentCommentCount?: number;
|
|
23
|
+
/** Copies comments and element context for agent handoff */
|
|
24
|
+
onCopyAgentContext?: () => void;
|
|
25
|
+
/** Show the dev-only "Dev export" button (multi-select bulk export panel). */
|
|
26
|
+
showDevExport?: boolean;
|
|
27
|
+
/** Toggles the dev-export panel (sets panelView=dev-export + ensures sidebar). */
|
|
28
|
+
onOpenDevExport?: () => void;
|
|
29
|
+
/** Whether the dev-export panel is currently open. */
|
|
30
|
+
devExportOpen?: boolean;
|
|
31
|
+
}
|
|
32
|
+
declare const CommentFab: React.MemoExoticComponent<({ core, state, features, hidden, onHide, agentCommentCount, onCopyAgentContext, showDevExport, onOpenDevExport, devExportOpen, }: CommentFabProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
33
|
+
export { CommentFab };
|
|
34
|
+
export type { CommentFabProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CommentKitCore } from "../../core/comment-kit-core";
|
|
3
|
+
import type { CommentKitState } from "../../core/types";
|
|
4
|
+
interface DevExportPanelProps {
|
|
5
|
+
core: CommentKitCore;
|
|
6
|
+
state: CommentKitState;
|
|
7
|
+
}
|
|
8
|
+
declare const DevExportPanel: React.FC<DevExportPanelProps>;
|
|
9
|
+
export { DevExportPanel };
|
|
10
|
+
export type { DevExportPanelProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CommentKitCore } from "../../core/comment-kit-core";
|
|
3
|
+
import type { CommentKitState } from "../../core/types";
|
|
4
|
+
interface ElementSelectorProps {
|
|
5
|
+
core: CommentKitCore;
|
|
6
|
+
state: CommentKitState;
|
|
7
|
+
active: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const ElementSelector: React.MemoExoticComponent<({ core, state, active, }: ElementSelectorProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
10
|
+
export { ElementSelector };
|
|
11
|
+
export type { ElementSelectorProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CommentKitCore } from "../../core/comment-kit-core";
|
|
3
|
+
import type { CommentKitState } from "../../core/types";
|
|
4
|
+
interface LiveRegionProps {
|
|
5
|
+
core: CommentKitCore;
|
|
6
|
+
state: CommentKitState;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Visually-hidden polite live region. Mounted once by CommentKitUI; subscribes
|
|
10
|
+
* to core events and announces realtime/connection/offline-queue changes for
|
|
11
|
+
* screen-reader users. All announcements are coalesced so a burst of identical
|
|
12
|
+
* messages (e.g. several queued mutations completing) doesn't flood the SR.
|
|
13
|
+
*/
|
|
14
|
+
declare const LiveRegion: React.MemoExoticComponent<({ core }: LiveRegionProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
|
+
export { LiveRegion };
|
|
16
|
+
export type { LiveRegionProps };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CommentKitCore } from "../../core/comment-kit-core";
|
|
3
|
+
import type { CommentKitState } from "../../core/types";
|
|
4
|
+
interface ScreenshotCaptureProps {
|
|
5
|
+
core: CommentKitCore;
|
|
6
|
+
state: CommentKitState;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Drives the screenshot tool. The toolbar only flips `activeTool` to
|
|
10
|
+
* "screenshot"; before this, capture/upload happened silently (or not at all).
|
|
11
|
+
* This component runs the capture → upload flow when the tool activates and
|
|
12
|
+
* surfaces progress ("Capturing…" / "Uploading…") and failures via the same
|
|
13
|
+
* sonner `toast()` pattern used elsewhere in the shell. Renders nothing.
|
|
14
|
+
*/
|
|
15
|
+
declare const ScreenshotCapture: React.MemoExoticComponent<({ core, state, }: ScreenshotCaptureProps) => null>;
|
|
16
|
+
export { ScreenshotCapture };
|
|
17
|
+
export type { ScreenshotCaptureProps };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CommentKitCore } from "../../core/comment-kit-core";
|
|
3
|
+
import type { CommentKitState } from "../../core/types";
|
|
4
|
+
interface StatusIndicatorProps {
|
|
5
|
+
core: CommentKitCore;
|
|
6
|
+
state: CommentKitState;
|
|
7
|
+
}
|
|
8
|
+
type StatusTone = "connecting" | "offline" | "syncing";
|
|
9
|
+
interface StatusChip {
|
|
10
|
+
tone: StatusTone;
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Derive the connection / offline / sync chip from the current state.
|
|
15
|
+
*
|
|
16
|
+
* Visibility rules (returns null = hidden):
|
|
17
|
+
* - Online + connected (or realtime off) + empty queue → nothing to show.
|
|
18
|
+
* - Offline (or no network) with a queue → "Offline — N change(s) queued".
|
|
19
|
+
* - Offline with empty queue → "Offline".
|
|
20
|
+
* - connectionStatus "connecting"/"error" while authenticated → "Reconnecting…".
|
|
21
|
+
* - Online + connected with a non-empty queue → "Syncing N…".
|
|
22
|
+
*/
|
|
23
|
+
declare function deriveStatus(state: CommentKitState): StatusChip | null;
|
|
24
|
+
/**
|
|
25
|
+
* Small, unobtrusive offline / pending-mutation / reconnect status chip.
|
|
26
|
+
* Pinned to the bottom of the viewport (opposite the draggable FAB) and
|
|
27
|
+
* non-interactive so it never steals host-page pointer events.
|
|
28
|
+
*/
|
|
29
|
+
declare const StatusIndicator: React.MemoExoticComponent<({ state }: StatusIndicatorProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
30
|
+
/**
|
|
31
|
+
* True when the first comment fetch is still in flight: authenticated, loading,
|
|
32
|
+
* no comments yet, and no error. Distinguishes "loading" from a genuine empty
|
|
33
|
+
* state so the host doesn't flash "no comments" before the request resolves.
|
|
34
|
+
*/
|
|
35
|
+
declare function isInitialLoading(state: CommentKitState): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Subtle "Loading comments…" affordance shown only during the initial fetch
|
|
38
|
+
* (see isInitialLoading). Token-styled, non-interactive, and marked aria-busy
|
|
39
|
+
* so assistive tech knows the region is updating.
|
|
40
|
+
*/
|
|
41
|
+
declare const LoadingIndicator: React.MemoExoticComponent<({ state }: StatusIndicatorProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
42
|
+
export { StatusIndicator, LoadingIndicator, deriveStatus, isInitialLoading };
|
|
43
|
+
export type { StatusIndicatorProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface Props {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
fallback?: React.ReactNode;
|
|
5
|
+
/** Optional key to trigger a reset when it changes (e.g. pass a timestamp or counter) */
|
|
6
|
+
resetKey?: string | number;
|
|
7
|
+
}
|
|
8
|
+
interface State {
|
|
9
|
+
hasError: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Catches rendering errors so CommentKit never crashes the host application.
|
|
13
|
+
* Fails silently — the widget disappears rather than breaking the page.
|
|
14
|
+
*
|
|
15
|
+
* To recover after a transient error, change `resetKey` or call the static reset pattern:
|
|
16
|
+
* wrap in a key prop on the parent to force remount.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ErrorBoundary extends React.Component<Props, State> {
|
|
19
|
+
state: State;
|
|
20
|
+
static getDerivedStateFromError(): State;
|
|
21
|
+
componentDidUpdate(prevProps: Props): void;
|
|
22
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
23
|
+
render(): React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
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";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared UI mounting utility — mounts the React-based CommentKit UI
|
|
3
|
+
* inside a Shadow DOM container. Used by all framework adapters
|
|
4
|
+
* (vanilla, Vue, Svelte, Angular, Solid, Qwik, Preact) to render
|
|
5
|
+
* the identical widget UI without framework-specific UI code.
|
|
6
|
+
*/
|
|
7
|
+
import type { CommentKitCore } from "../core/comment-kit-core";
|
|
8
|
+
export interface MountedUI {
|
|
9
|
+
unmount: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Mount the CommentKit React UI in a Shadow DOM container.
|
|
13
|
+
* All React dependencies are dynamically imported so non-React
|
|
14
|
+
* entry points only pay the cost when this function is called.
|
|
15
|
+
*
|
|
16
|
+
* @param core — initialized CommentKitCore instance
|
|
17
|
+
* @returns handle with `unmount()` for cleanup
|
|
18
|
+
*/
|
|
19
|
+
export declare function mountCommentKitUI(core: CommentKitCore): Promise<MountedUI>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CommentKitConfig } from "../core/types";
|
|
3
|
+
interface ShadowContainerProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
styles: string;
|
|
6
|
+
/** Resolved widget config — used for opt-in behaviors like remote fonts. */
|
|
7
|
+
config?: Pick<CommentKitConfig, "ui">;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders children inside a Shadow DOM for full CSS isolation.
|
|
11
|
+
* Injects scoped styles as a <style> tag within the shadow root.
|
|
12
|
+
* Uses React portal so event delegation works correctly.
|
|
13
|
+
*
|
|
14
|
+
* Handles cross-boundary concerns:
|
|
15
|
+
* 1. Dark mode — observes .dark class on <html> (next-themes) and
|
|
16
|
+
* overrides token values inside the shadow root.
|
|
17
|
+
* 2. Fonts — auto-detects if Geist is loaded by the host page. If not,
|
|
18
|
+
* loads it from Google Fonts CDN. Then reads host CSS font variables
|
|
19
|
+
* (e.g. --font-sans from next/font) and forwards them into the shadow.
|
|
20
|
+
* @font-face from the document head is accessible inside Shadow DOM.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ShadowContainer: React.FC<ShadowContainerProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
type SnapshotGetter<Snapshot> = () => Snapshot;
|
|
2
|
+
type Subscribe = (callback: () => void) => () => void;
|
|
3
|
+
export declare function useSyncExternalStoreWithSelector<Snapshot, Selection>(subscribe: Subscribe, getSnapshot: SnapshotGetter<Snapshot>, getServerSnapshot: SnapshotGetter<Snapshot> | undefined, selector: (snapshot: Snapshot) => Selection, isEqual?: (a: Selection, b: Selection) => boolean): Selection;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useSyncExternalStore } from "react";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React context that provides the portal container reference to child components.
|
|
3
|
+
* Used by components like Popover, Dialog, Sheet etc. that need to portal
|
|
4
|
+
* content inside the .ck-root element (instead of document.body).
|
|
5
|
+
*
|
|
6
|
+
* Portals render INTO .ck-root so they inherit pointer-events: auto from
|
|
7
|
+
* `.ck-root > *` and are matched by `.ck-root[data-theme="dark"]` selectors.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ShadowRootContext: import("react").Context<HTMLElement | null>;
|
|
10
|
+
export declare function useShadowRoot(): HTMLElement | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal className joiner (a small subset of clsx, not a drop-in replacement).
|
|
3
|
+
* Joins truthy string class names into a single space-separated string.
|
|
4
|
+
*
|
|
5
|
+
* Accepts: strings, falsy values (false / null / undefined / "" / 0, all
|
|
6
|
+
* skipped), and nested arrays of the same. This covers the conditional
|
|
7
|
+
* `cond && "class"` and `["a", className]` patterns used across the UI.
|
|
8
|
+
*
|
|
9
|
+
* Not supported (unlike clsx): numbers are dropped rather than stringified,
|
|
10
|
+
* and object syntax (`{ "class": boolean }`) is ignored — none are used here.
|
|
11
|
+
*/
|
|
12
|
+
export declare function cn(...inputs: unknown[]): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog";
|
|
3
|
+
declare function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const AlertDialogTrigger: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.Trigger.Props<unknown>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogPopupProps & {
|
|
8
|
+
size?: "default" | "sm";
|
|
9
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const AlertDialogHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const AlertDialogFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const AlertDialogMedia: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
14
|
+
declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
15
|
+
declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogCloseProps & Pick<Omit<import("@base-ui/react").ButtonProps & {
|
|
16
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link";
|
|
17
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
18
|
+
}, "ref"> & React.RefAttributes<HTMLElement>, "size" | "variant">, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
+
declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogCloseProps & Pick<Omit<import("@base-ui/react").ButtonProps & {
|
|
20
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link";
|
|
21
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
22
|
+
}, "ref"> & React.RefAttributes<HTMLElement>, "size" | "variant">, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, } from "./alert-dialog";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Avatar: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AvatarRootProps & {
|
|
3
|
+
size?: "default" | "xxs" | "xs" | "sm" | "lg";
|
|
4
|
+
}, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AvatarImageProps, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
6
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").AvatarFallbackProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
7
|
+
declare const AvatarBadge: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
declare const AvatarGroup: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const AvatarGroupCount: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount, } from "./avatar";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & {
|
|
3
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "ghost" | "link";
|
|
4
|
+
}): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
5
|
+
export { Badge };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Badge } from "./badge";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Button: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").ButtonProps & {
|
|
3
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link";
|
|
4
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
5
|
+
}, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
6
|
+
export { Button };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from "./button";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
size?: "default" | "sm";
|
|
4
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CardHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const CardTitle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const CardAction: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const CardContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const CardFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from "./card";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Checkbox } from "./checkbox";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
3
|
+
declare function Dialog({ ...props }: DialogPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<Omit<DialogPrimitive.Trigger.Props<unknown>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogPopupProps & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const DialogHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DialogFooter: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
16
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<Omit<import("@base-ui/react").DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
17
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./dialog";
|