@commentkit/comment-kit 0.6.6 → 0.6.7
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 +6 -0
- package/dist/angular/comment-kit-ui-ClsgTVKj.js +24898 -0
- package/dist/angular/{mount-ui-CFdFsqXl.js → mount-ui-EPLnH0YJ.js} +1 -1
- package/dist/{preact/shadow-root-DAhpHo_W.js → angular/shadow-root-yMOaW9pk.js} +48 -41
- package/dist/angular/styles-CMz7-p8x.js +2 -0
- package/dist/angular/{ShadowRootContext-2BrAO1qU.js → widget-theme-CYPYAwhR.js} +18 -1
- package/dist/angular.es.js +3 -3
- package/dist/comment-kit.css +2 -0
- package/dist/comment-kit.es.js +3 -3
- package/dist/core/comment-kit-ui-BTYGcSK-.js +24898 -0
- package/dist/core/{mount-ui-BULAlAAF.js → mount-ui-B6jipL2Z.js} +1 -1
- package/dist/core/{shadow-root-09zwHxly.js → shadow-root-DAtdjHG2.js} +48 -41
- package/dist/core/styles-ClRoB6ro.js +2 -0
- package/dist/core/{ShadowRootContext--ArKkwbH.js → widget-theme-BWDYr7VR.js} +18 -1
- package/dist/preact/comment-kit-ui-nhY36fa4.js +24898 -0
- package/dist/preact/{mount-ui-rOHCwIhK.js → mount-ui-Dri-RQe3.js} +1 -1
- package/dist/{qwik/shadow-root-tLjXys-_.js → preact/shadow-root-D-NcwruG.js} +48 -41
- package/dist/preact/styles-D6i7be5-.js +2 -0
- package/dist/preact/{ShadowRootContext-CJWLIRy4.js → widget-theme-B7Z2pbaA.js} +18 -1
- package/dist/preact.es.js +3 -3
- package/dist/qwik/comment-kit-ui-B2oSKreb.js +24898 -0
- package/dist/qwik/{mount-ui-DsGe8vVw.js → mount-ui-DkvDtcft.js} +1 -1
- package/dist/{angular/shadow-root-C7wgghDv.js → qwik/shadow-root-PkjcnvPe.js} +48 -41
- package/dist/qwik/styles-DmEmq5Lh.js +2 -0
- package/dist/qwik/{ShadowRootContext-CTbULRKq.js → widget-theme-lbPF3I0A.js} +18 -1
- package/dist/qwik.es.js +3 -3
- package/dist/react.es.js +18649 -11656
- package/dist/solid/comment-kit-ui-B7GeN0T8.js +24898 -0
- package/dist/solid/{mount-ui-D15-Kp1w.js → mount-ui-CTFITRP7.js} +1 -1
- package/dist/solid/shadow-root-CssU3bQb.js +93 -0
- package/dist/solid/styles-DbueS9xx.js +2 -0
- package/dist/solid/widget-theme-B4DJ14fI.js +24 -0
- package/dist/solid.es.js +3 -3
- package/dist/svelte/comment-kit-ui-CKmdu0gr.js +24898 -0
- package/dist/svelte/{mount-ui-7Uc8joAI.js → mount-ui-N1vul-tl.js} +1 -1
- package/dist/svelte/shadow-root-DG8inbf6.js +93 -0
- package/dist/svelte/styles-BK_MaUpD.js +2 -0
- package/dist/svelte/widget-theme-CkfJNysI.js +24 -0
- package/dist/svelte.es.js +3 -3
- package/dist/types/react/comments/outcomes.d.ts +7 -1
- package/dist/types/react/comments/view-model.d.ts +8 -1
- package/dist/types/react/components/annotation-toolbar.d.ts +36 -0
- package/dist/types/react/components/build-panel-shared-props.d.ts +25 -0
- package/dist/types/react/components/comment-actions.d.ts +1 -2
- package/dist/types/react/components/comment-body.d.ts +1 -1
- package/dist/types/react/components/comment-branch-filter.d.ts +15 -0
- package/dist/types/react/components/comment-composer-extras-fields.d.ts +4 -7
- package/dist/types/react/components/comment-composer-extras-toolbar.d.ts +3 -22
- package/dist/types/react/components/comment-composer-extras.d.ts +1 -1
- package/dist/types/react/components/comment-composer-extras.state.d.ts +24 -0
- package/dist/types/react/components/comment-composer-hook.d.ts +1 -53
- package/dist/types/react/components/comment-composer-media.d.ts +1 -14
- package/dist/types/react/components/comment-composer.d.ts +1 -1
- package/dist/types/react/components/comment-composer.types.d.ts +41 -0
- package/dist/types/react/components/comment-composer.utils.d.ts +3 -0
- package/dist/types/react/components/comment-cursor-layer.d.ts +14 -0
- package/dist/types/react/components/comment-drawing-canvas.d.ts +10 -0
- package/dist/types/react/components/comment-extension-banner.d.ts +8 -0
- package/dist/types/react/components/comment-fab-tools.d.ts +37 -0
- package/dist/types/react/components/comment-filter-assignee.d.ts +9 -0
- package/dist/types/react/components/comment-filter-bar.d.ts +27 -0
- package/dist/types/react/components/comment-filter-popover.d.ts +20 -0
- package/dist/types/react/components/comment-format-toolbar.constants.d.ts +34 -0
- package/dist/types/react/components/comment-header.d.ts +1 -8
- package/dist/types/react/components/comment-highlight-layer.d.ts +11 -0
- package/dist/types/react/components/comment-highlight-marker.d.ts +9 -0
- package/dist/types/react/components/comment-image-lightbox.d.ts +1 -9
- package/dist/types/react/components/comment-images.d.ts +2 -10
- package/dist/types/react/components/comment-item.d.ts +2 -1
- package/dist/types/react/components/comment-keyboard-shortcuts.d.ts +7 -0
- package/dist/types/react/components/comment-kit-overlays.d.ts +15 -0
- package/dist/types/react/components/comment-kit.d.ts +12 -0
- package/dist/types/react/components/comment-list-filters.d.ts +14 -0
- package/dist/types/react/components/comment-marker-layer.d.ts +2 -1
- package/dist/types/react/components/comment-marker.d.ts +2 -1
- package/dist/types/react/components/comment-member-list.d.ts +10 -0
- package/dist/types/react/components/comment-mode-bar.d.ts +15 -0
- package/dist/types/react/components/comment-online-users.d.ts +8 -0
- package/dist/types/react/components/comment-panel-header.d.ts +22 -0
- package/dist/types/react/components/comment-panel-mobile.d.ts +9 -0
- package/dist/types/react/components/comment-panel-utils.d.ts +6 -0
- package/dist/types/react/components/comment-panel-view-body.d.ts +23 -0
- package/dist/types/react/components/comment-panel.d.ts +22 -2
- package/dist/types/react/components/comment-remote-cursor.d.ts +11 -0
- package/dist/types/react/components/comment-screenshot-annotator.d.ts +11 -0
- package/dist/types/react/components/comment-screenshot-overlay.d.ts +10 -0
- package/dist/types/react/components/comment-search-bar.d.ts +7 -0
- package/dist/types/react/components/comment-settings-view.d.ts +20 -0
- package/dist/types/react/components/comment-skeletons.d.ts +9 -0
- package/dist/types/react/components/comment-thread-detail-meta.d.ts +2 -1
- package/dist/types/react/components/comment-thread-detail.d.ts +4 -1
- package/dist/types/react/components/comment-thread-list-item.d.ts +2 -1
- package/dist/types/react/components/comment-thread-list.d.ts +9 -1
- package/dist/types/react/components/comment-users-context.d.ts +15 -0
- package/dist/types/react/components/comment-utils.d.ts +20 -0
- package/dist/types/react/components/comment.d.ts +26 -0
- package/dist/types/react/components/constants.d.ts +50 -0
- package/dist/types/react/components/drawing-path-renderer.d.ts +10 -0
- package/dist/types/react/components/ui.d.ts +44 -0
- package/dist/types/react/components/use-comment-composer.d.ts +28 -0
- package/dist/types/react/hooks/use-comment-fab-drag.d.ts +21 -0
- package/dist/types/react/hooks/use-comment-hash-link.d.ts +20 -0
- package/dist/types/react/hooks/use-comment-kit-filters.d.ts +19 -0
- package/dist/types/react/hooks/use-comment-kit-keyboard.d.ts +11 -0
- package/dist/types/react/hooks/use-comment-kit-prop-sync.d.ts +12 -0
- package/dist/types/react/hooks/use-comment-marker-drag.d.ts +23 -0
- package/dist/types/react/hooks/use-comment-panel-navigation.d.ts +21 -0
- package/dist/types/react/hooks/use-comment-realtime.d.ts +6 -0
- package/dist/types/react/hooks/use-comment-thread-actions.d.ts +15 -0
- package/dist/types/react/hooks/use-connection-retry.d.ts +9 -0
- package/dist/types/react/hooks/use-drawing.d.ts +32 -0
- package/dist/types/react/hooks/use-extension-conflicts.d.ts +13 -0
- package/dist/types/react/hooks/use-filtered-threads.d.ts +7 -0
- package/dist/types/react/hooks/use-marker-layer.d.ts +19 -0
- package/dist/types/react/hooks/use-screenshot.d.ts +18 -0
- package/dist/types/react/hooks/use-text-selection.d.ts +17 -0
- package/dist/types/react/hooks/use-websocket.d.ts +9 -0
- package/dist/types/react/ui/lib/widget-theme.d.ts +7 -0
- package/dist/types/react/ui/primitives/breadcrumb/breadcrumb.d.ts +10 -0
- package/dist/types/react/ui/primitives/breadcrumb/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/button-group/button-group.d.ts +9 -0
- package/dist/types/react/ui/primitives/button-group/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/input-otp/index.d.ts +1 -0
- package/dist/types/react/ui/primitives/input-otp/input-otp.d.ts +11 -0
- package/dist/vue/comment-kit-ui-MfED5JLH.js +24898 -0
- package/dist/vue/{mount-ui-CG9QrYe9.js → mount-ui-C85XBX4V.js} +1 -1
- package/dist/vue/shadow-root-zwd_wUIP.js +93 -0
- package/dist/vue/styles-B0NAkbKu.js +2 -0
- package/dist/vue/widget-theme-D7Vkagk7.js +24 -0
- package/dist/vue.es.js +3 -3
- package/package.json +2 -1
- package/dist/angular/comment-kit-ui-D8YIOzCe.js +0 -17929
- package/dist/angular/styles-CmEq782M.js +0 -2
- package/dist/core/comment-kit-ui-CYYImlEM.js +0 -17929
- package/dist/core/styles-Dzn_nEz7.js +0 -2
- package/dist/preact/comment-kit-ui-fCVNh5Gq.js +0 -17929
- package/dist/preact/styles-ECCK6Z_C.js +0 -2
- package/dist/qwik/comment-kit-ui-BVoctltC.js +0 -17929
- package/dist/qwik/styles-CMcDFAyE.js +0 -2
- package/dist/solid/ShadowRootContext-BS6MCclL.js +0 -7
- package/dist/solid/comment-kit-ui-CnlHcwzZ.js +0 -17929
- package/dist/solid/shadow-root-D5nErAFI.js +0 -86
- package/dist/solid/styles-Be_8-1ZV.js +0 -2
- package/dist/svelte/ShadowRootContext-DhByMr-q.js +0 -7
- package/dist/svelte/comment-kit-ui-BFWous-b.js +0 -17929
- package/dist/svelte/shadow-root-Cz-v-rYe.js +0 -86
- package/dist/svelte/styles-B863Tn5m.js +0 -2
- package/dist/vue/ShadowRootContext-BQTcHNil.js +0 -7
- package/dist/vue/comment-kit-ui-oPTLTwxG.js +0 -17929
- package/dist/vue/shadow-root-SLTVf5yk.js +0 -86
- package/dist/vue/styles-C4t8gcea.js +0 -2
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type CommentModeBarMode = "idle" | "pin" | "highlight" | "drawing" | "screenshot";
|
|
3
|
+
type ModeFeatures = {
|
|
4
|
+
highlighting?: boolean;
|
|
5
|
+
drawing?: boolean;
|
|
6
|
+
screenshots?: boolean;
|
|
7
|
+
};
|
|
8
|
+
interface CommentModeBarProps {
|
|
9
|
+
mode: CommentModeBarMode;
|
|
10
|
+
onModeChange: (mode: CommentModeBarMode) => void;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
features?: ModeFeatures;
|
|
13
|
+
}
|
|
14
|
+
export declare const CommentModeBar: React.MemoExoticComponent<({ mode, onModeChange, onClose, features, }: CommentModeBarProps) => import("react/jsx-runtime").JSX.Element>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type CommentAvatarUser } from "./comment-user-avatar-tooltip";
|
|
3
|
+
interface CommentOnlineUsersProps {
|
|
4
|
+
users: CommentAvatarUser[];
|
|
5
|
+
maxVisible?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const CommentOnlineUsers: React.MemoExoticComponent<({ users, maxVisible, }: CommentOnlineUsersProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type BranchItem } from "./comment-branch-filter";
|
|
3
|
+
import type { CommentAvatarUser } from "./comment-user-avatar-tooltip";
|
|
4
|
+
export interface CommentPanelHeaderProps {
|
|
5
|
+
view: "list" | "detail" | "settings";
|
|
6
|
+
branch?: string;
|
|
7
|
+
branches?: BranchItem[];
|
|
8
|
+
onBranchChange?: (branch: string) => void;
|
|
9
|
+
pagePath?: string;
|
|
10
|
+
projectName?: string;
|
|
11
|
+
pageFilter: "all" | "current";
|
|
12
|
+
onlineUsers?: CommentAvatarUser[];
|
|
13
|
+
hasPrev?: boolean;
|
|
14
|
+
hasNext?: boolean;
|
|
15
|
+
onBack: () => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
onLogout?: () => void;
|
|
18
|
+
onOpenSettings?: () => void;
|
|
19
|
+
onPrevThread?: () => void;
|
|
20
|
+
onNextThread?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const CommentPanelHeader: React.MemoExoticComponent<({ view, branch, branches, onBranchChange, pagePath, projectName, pageFilter, onlineUsers, hasPrev, hasNext, onBack, onClose, onLogout, onOpenSettings, onPrevThread, onNextThread, }: CommentPanelHeaderProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare function useIsMobilePanel(): boolean;
|
|
3
|
+
interface CommentPanelMobileProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const CommentPanelMobile: React.MemoExoticComponent<({ open, onClose, children, }: CommentPanelMobileProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type PanelView = "list" | "detail" | "settings";
|
|
2
|
+
export type PanelNavDirection = "forward" | "back";
|
|
3
|
+
export declare function getPanelViewAnimClass(view: PanelView, navDirection: PanelNavDirection): string;
|
|
4
|
+
export declare function getPanelViewKey(view: PanelView, activeThreadId: string | undefined): string;
|
|
5
|
+
/** Opening a thread or settings pushes forward. Returning to the list pops back. */
|
|
6
|
+
export declare function nextPanelNavDirection(previousView: PanelView, nextView: PanelView): PanelNavDirection;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ThreadView } from "../comments/view-model";
|
|
3
|
+
export interface CommentPanelViewBodyProps {
|
|
4
|
+
readonly view: "list" | "detail" | "settings";
|
|
5
|
+
readonly loading?: boolean;
|
|
6
|
+
readonly threads: ThreadView[];
|
|
7
|
+
readonly noMatches?: boolean;
|
|
8
|
+
readonly pageFilter?: "all" | "current";
|
|
9
|
+
readonly isThreadNew?: (thread: ThreadView) => boolean;
|
|
10
|
+
readonly selectedIds?: ReadonlySet<string>;
|
|
11
|
+
readonly onResetFilters?: () => void;
|
|
12
|
+
readonly activeThread?: ThreadView | null;
|
|
13
|
+
readonly settings?: React.ReactNode;
|
|
14
|
+
readonly onSelectThread: (id: string) => void;
|
|
15
|
+
readonly onReply: (body: string) => Promise<void>;
|
|
16
|
+
readonly onResolve: () => void;
|
|
17
|
+
readonly onReopen: () => void;
|
|
18
|
+
readonly onSaveEdit?: (id: string, body: string) => Promise<void>;
|
|
19
|
+
readonly onChecklistToggle?: (itemId: string, done: boolean) => void;
|
|
20
|
+
readonly onCopyUrl?: (threadId: string) => void;
|
|
21
|
+
readonly onLocate?: (threadId: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const CommentPanelViewBody: React.MemoExoticComponent<(props: CommentPanelViewBodyProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { ThreadView } from "../comments/view-model";
|
|
3
|
+
import { type BranchItem } from "./comment-branch-filter";
|
|
4
|
+
import type { CommentAvatarUser } from "./comment-user-avatar-tooltip";
|
|
3
5
|
export interface CommentPanelProps {
|
|
4
|
-
readonly view: "list" | "detail";
|
|
6
|
+
readonly view: "list" | "detail" | "settings";
|
|
5
7
|
readonly threads: ThreadView[];
|
|
6
8
|
readonly activeThread: ThreadView | null;
|
|
7
9
|
readonly dockSide?: "left" | "right";
|
|
10
|
+
readonly loading?: boolean;
|
|
11
|
+
readonly branch?: string;
|
|
12
|
+
readonly branches?: BranchItem[];
|
|
13
|
+
readonly onBranchChange?: (branch: string) => void;
|
|
14
|
+
readonly pagePath?: string;
|
|
15
|
+
readonly projectName?: string;
|
|
16
|
+
readonly pageFilter?: "all" | "current";
|
|
17
|
+
readonly currentUserId?: string;
|
|
18
|
+
readonly onlineUsers?: CommentAvatarUser[];
|
|
8
19
|
readonly onSelectThread: (id: string) => void;
|
|
9
20
|
readonly onBack: () => void;
|
|
10
21
|
readonly onClose: () => void;
|
|
@@ -12,6 +23,15 @@ export interface CommentPanelProps {
|
|
|
12
23
|
readonly onResolve: () => void;
|
|
13
24
|
readonly onReopen: () => void;
|
|
14
25
|
readonly onSaveEdit?: (id: string, body: string) => Promise<void>;
|
|
26
|
+
readonly onChecklistToggle?: (itemId: string, done: boolean) => void;
|
|
15
27
|
readonly onLogout?: () => void;
|
|
28
|
+
readonly onOpenSettings?: () => void;
|
|
29
|
+
readonly onPrevThread?: () => void;
|
|
30
|
+
readonly onNextThread?: () => void;
|
|
31
|
+
readonly onCopyUrl?: (threadId: string) => void;
|
|
32
|
+
readonly onLocate?: (threadId: string) => void;
|
|
33
|
+
readonly isThreadNew?: (thread: ThreadView) => boolean;
|
|
34
|
+
readonly presentation?: "dock" | "sheet";
|
|
35
|
+
readonly settings?: React.ReactNode;
|
|
16
36
|
}
|
|
17
|
-
export declare const CommentPanel: React.MemoExoticComponent<({ view, threads, activeThread, dockSide, onSelectThread, onBack, onClose, onReply, onResolve, onReopen, onSaveEdit, onLogout, }: CommentPanelProps) => import("react/jsx-runtime").JSX.Element>;
|
|
37
|
+
export declare const CommentPanel: React.MemoExoticComponent<({ view, threads, activeThread, dockSide, loading, branch, branches, onBranchChange, pagePath, projectName, pageFilter: pageFilterProp, currentUserId, onlineUsers, onSelectThread, onBack, onClose, onReply, onResolve, onReopen, onSaveEdit, onChecklistToggle, onLogout, onOpenSettings, onPrevThread, onNextThread, onCopyUrl, onLocate, isThreadNew, presentation, settings, }: CommentPanelProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommentUser } from "./comment-composer-extras-fields";
|
|
2
|
+
import "./comment-remote-cursor.css";
|
|
3
|
+
interface CommentRemoteCursorProps {
|
|
4
|
+
user: CommentUser;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
declare function cursorColor(userId: string): string;
|
|
9
|
+
declare function CommentRemoteCursor({ user, x, y }: CommentRemoteCursorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { CommentRemoteCursor, cursorColor };
|
|
11
|
+
export type { CommentRemoteCursorProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommentUser } from "./comment-composer-extras-fields";
|
|
2
|
+
import "./comment-screenshot-annotator.css";
|
|
3
|
+
interface CommentScreenshotAnnotatorProps {
|
|
4
|
+
imageUrl: string;
|
|
5
|
+
availableUsers?: CommentUser[];
|
|
6
|
+
onSave: (dataUrl: string, comment: string) => void | Promise<void>;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare function CommentScreenshotAnnotator({ imageUrl, availableUsers, onSave, onCancel, }: CommentScreenshotAnnotatorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { CommentScreenshotAnnotator };
|
|
11
|
+
export type { CommentScreenshotAnnotatorProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommentUser } from "./comment-composer-extras-fields";
|
|
2
|
+
import "./comment-screenshot-overlay.css";
|
|
3
|
+
interface CommentScreenshotOverlayProps {
|
|
4
|
+
availableUsers?: CommentUser[];
|
|
5
|
+
onSave: (dataUrl: string, comment: string) => void | Promise<void>;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
}
|
|
8
|
+
declare function CommentScreenshotOverlay({ availableUsers, onSave, onCancel, }: CommentScreenshotOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { CommentScreenshotOverlay };
|
|
10
|
+
export type { CommentScreenshotOverlayProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface CommentSearchBarProps {
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const CommentSearchBar: React.MemoExoticComponent<({ value, onChange, }: CommentSearchBarProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type CommentMember } from "./comment-member-list";
|
|
3
|
+
import type { UsageInfo, UserSettingsProfile } from "./ui";
|
|
4
|
+
export type CommentSettingsMember = CommentMember;
|
|
5
|
+
export type CommentSettingsUsage = UsageInfo;
|
|
6
|
+
export type CommentSettingsUser = Pick<UserSettingsProfile, "name" | "email" | "avatar">;
|
|
7
|
+
interface CommentSettingsViewProps {
|
|
8
|
+
user?: CommentSettingsUser | null;
|
|
9
|
+
projectName?: string;
|
|
10
|
+
organizationName?: string;
|
|
11
|
+
organizationPlan?: string;
|
|
12
|
+
usage?: CommentSettingsUsage;
|
|
13
|
+
dashboardUrl?: string;
|
|
14
|
+
onLogout?: () => void;
|
|
15
|
+
members?: CommentSettingsMember[];
|
|
16
|
+
currentUserId?: string;
|
|
17
|
+
onInvite?: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const CommentSettingsView: React.MemoExoticComponent<({ user, projectName, organizationName, organizationPlan, usage, dashboardUrl, onLogout, members, currentUserId, onInvite, }: CommentSettingsViewProps) => import("react/jsx-runtime").JSX.Element>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export declare const CommentThreadListSkeleton: React.MemoExoticComponent<({ count, className, }: {
|
|
3
|
+
count?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
6
|
+
export declare const CommentThreadDetailSkeleton: React.MemoExoticComponent<({ replyCount, className, }: {
|
|
7
|
+
replyCount?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -3,6 +3,7 @@ interface CommentThreadDetailMetaProps {
|
|
|
3
3
|
readonly thread: ThreadView;
|
|
4
4
|
readonly description?: string;
|
|
5
5
|
readonly onMarkComplete?: () => void;
|
|
6
|
+
readonly onChecklistToggle?: (itemId: string, done: boolean) => void;
|
|
6
7
|
}
|
|
7
|
-
export declare function CommentThreadDetailMeta({ thread, description, onMarkComplete, }: CommentThreadDetailMetaProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function CommentThreadDetailMeta({ thread, description, onMarkComplete, onChecklistToggle, }: CommentThreadDetailMetaProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -6,5 +6,8 @@ export interface CommentThreadDetailProps {
|
|
|
6
6
|
readonly onResolve: () => void;
|
|
7
7
|
readonly onReopen: () => void;
|
|
8
8
|
readonly onSaveEdit?: (id: string, body: string) => Promise<void>;
|
|
9
|
+
readonly onChecklistToggle?: (itemId: string, done: boolean) => void;
|
|
10
|
+
readonly onCopyUrl?: () => void;
|
|
11
|
+
readonly onLocate?: () => void;
|
|
9
12
|
}
|
|
10
|
-
export declare const CommentThreadDetail: React.MemoExoticComponent<({ thread, onReply, onResolve, onReopen, onSaveEdit, }: CommentThreadDetailProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
|
+
export declare const CommentThreadDetail: React.MemoExoticComponent<({ thread, onReply, onResolve, onReopen, onSaveEdit, onChecklistToggle, onCopyUrl, onLocate, }: CommentThreadDetailProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -5,10 +5,11 @@ interface CommentThreadListItemProps {
|
|
|
5
5
|
readonly thread: ThreadView;
|
|
6
6
|
readonly onSelect: (threadId: string) => void;
|
|
7
7
|
readonly selected?: boolean;
|
|
8
|
+
readonly pageFilter?: "all" | "current";
|
|
8
9
|
readonly reactions?: CommentReaction[];
|
|
9
10
|
readonly onCopyUrl?: (threadId: string) => void;
|
|
10
11
|
readonly onResolve?: (threadId: string) => void;
|
|
11
12
|
readonly onLocate?: (threadId: string) => void;
|
|
12
13
|
}
|
|
13
|
-
export declare const CommentThreadListItem: React.MemoExoticComponent<({ thread, onSelect, selected, reactions, onCopyUrl, onResolve, onLocate, }: CommentThreadListItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
|
+
export declare const CommentThreadListItem: React.MemoExoticComponent<({ thread, onSelect, selected, pageFilter, reactions, onCopyUrl, onResolve, onLocate, }: CommentThreadListItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
14
15
|
export {};
|
|
@@ -4,5 +4,13 @@ export interface CommentThreadListProps {
|
|
|
4
4
|
readonly threads: ThreadView[];
|
|
5
5
|
readonly onSelectThread: (id: string) => void;
|
|
6
6
|
readonly onResolve?: (id: string) => void;
|
|
7
|
+
readonly onCopyUrl?: (id: string) => void;
|
|
8
|
+
readonly onLocate?: (id: string) => void;
|
|
9
|
+
readonly onResetFilters?: () => void;
|
|
10
|
+
readonly noMatches?: boolean;
|
|
11
|
+
readonly pageFilter?: "all" | "current";
|
|
12
|
+
readonly isThreadNew?: (thread: ThreadView) => boolean;
|
|
13
|
+
readonly selectedIds?: ReadonlySet<string>;
|
|
14
|
+
readonly onScroll?: (event: React.UIEvent<HTMLElement>) => void;
|
|
7
15
|
}
|
|
8
|
-
export declare const CommentThreadList: React.MemoExoticComponent<({ threads, onSelectThread, onResolve, }: CommentThreadListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
16
|
+
export declare const CommentThreadList: React.MemoExoticComponent<({ threads, onSelectThread, onResolve, onCopyUrl, onLocate, onResetFilters, noMatches, pageFilter, isThreadNew, selectedIds, onScroll, }: CommentThreadListProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CommentKitState, User } from "../../core/types";
|
|
3
|
+
import type { CommentUser } from "./comment-composer-extras-fields";
|
|
4
|
+
declare function CommentUsersProvider({ users, children, }: {
|
|
5
|
+
users: CommentUser[];
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function useCommentUsers(): CommentUser[];
|
|
9
|
+
declare function toCommentUser(user: Pick<User, "id" | "name"> & {
|
|
10
|
+
email?: string;
|
|
11
|
+
avatar?: string;
|
|
12
|
+
}): CommentUser;
|
|
13
|
+
/** People the widget can name: the viewer, who is online, and comment authors. */
|
|
14
|
+
declare function collectCommentUsers(state: CommentKitState): CommentUser[];
|
|
15
|
+
export { CommentUsersProvider, collectCommentUsers, toCommentUser, useCommentUsers };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TaskStatus, User } from "../../core/types";
|
|
2
|
+
import type { CommentViewUser, ThreadView } from "../comments/view-model";
|
|
3
|
+
import type { CommentType } from "./comment";
|
|
4
|
+
/** Sort weight for priority (lower = higher priority). */
|
|
5
|
+
export declare const PRIORITY_WEIGHT: Record<ThreadView["priority"], number>;
|
|
6
|
+
type ThreadStatusSource = {
|
|
7
|
+
status?: TaskStatus;
|
|
8
|
+
isResolved?: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** Resolve task status from `status`, or from the legacy `isResolved` flag. */
|
|
11
|
+
export declare function getThreadStatus(thread: ThreadStatusSource): TaskStatus;
|
|
12
|
+
/** Shared type → display label map. */
|
|
13
|
+
export declare const TYPE_LABELS: Record<CommentType, string>;
|
|
14
|
+
/** True when the thread is resolved or the client marked it complete. */
|
|
15
|
+
export declare function getIsResolved(thread: ThreadStatusSource): boolean;
|
|
16
|
+
/** Signed-in profile, or a guest label when nobody is signed in. */
|
|
17
|
+
export declare function resolveCommentAuthor(user?: Pick<User, "id" | "name" | "avatar"> | null): CommentViewUser;
|
|
18
|
+
/** Human-readable byte size for image labels. */
|
|
19
|
+
export declare function formatFileSize(bytes?: number | null): string | null;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Display shapes for a comment. The record the engine stores is `Comment`
|
|
3
|
+
* in `src/core/types.ts` (content, page, replies, and the SVG drawing model).
|
|
4
|
+
* This file is the widget's view of an image and of browser context.
|
|
5
|
+
*/
|
|
6
|
+
export type { CommentReaction, TaskChecklistItem, TaskStatus, TextSelection, } from "../../core/types";
|
|
7
|
+
export type CommentType = "pin" | "highlight" | "drawing";
|
|
8
|
+
export type Priority = "low" | "medium" | "high" | "urgent";
|
|
9
|
+
export interface CommentImage {
|
|
10
|
+
id: string;
|
|
11
|
+
url: string;
|
|
12
|
+
alt?: string;
|
|
13
|
+
type?: "screenshot" | "file" | "drawing";
|
|
14
|
+
filename?: string;
|
|
15
|
+
size?: number;
|
|
16
|
+
thumbnail?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Browser context shown on a comment when the host supplies it. */
|
|
19
|
+
export interface DeviceInfo {
|
|
20
|
+
browser: string;
|
|
21
|
+
os: string;
|
|
22
|
+
windowSize: string;
|
|
23
|
+
devicePixelRatio: number;
|
|
24
|
+
deployment?: string;
|
|
25
|
+
type: "desktop" | "mobile";
|
|
26
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { PriorityFilter } from "../../core/types";
|
|
2
|
+
import type { Priority } from "./comment";
|
|
3
|
+
/**
|
|
4
|
+
* Shared widget constants. Stroke colors are hex because SVG fill and stroke
|
|
5
|
+
* do not read the shadow theme tokens.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DRAWING_COLORS: readonly [{
|
|
8
|
+
readonly value: "#ef4444";
|
|
9
|
+
readonly label: "Red";
|
|
10
|
+
}, {
|
|
11
|
+
readonly value: "#f97316";
|
|
12
|
+
readonly label: "Orange";
|
|
13
|
+
}, {
|
|
14
|
+
readonly value: "#eab308";
|
|
15
|
+
readonly label: "Yellow";
|
|
16
|
+
}, {
|
|
17
|
+
readonly value: "#22c55e";
|
|
18
|
+
readonly label: "Green";
|
|
19
|
+
}, {
|
|
20
|
+
readonly value: "#3b82f6";
|
|
21
|
+
readonly label: "Blue";
|
|
22
|
+
}, {
|
|
23
|
+
readonly value: "#8b5cf6";
|
|
24
|
+
readonly label: "Purple";
|
|
25
|
+
}, {
|
|
26
|
+
readonly value: "#ec4899";
|
|
27
|
+
readonly label: "Pink";
|
|
28
|
+
}];
|
|
29
|
+
/** Default stroke colour for a new drawing. */
|
|
30
|
+
export declare const DEFAULT_DRAWING_COLOR: "#ef4444";
|
|
31
|
+
/** One color per remote cursor, chosen by a hash of the user id. */
|
|
32
|
+
export declare const CURSOR_COLORS: readonly ["#6366f1", "#ec4899", "#f59e0b", "#10b981", "#3b82f6", "#8b5cf6", "#ef4444", "#14b8a6"];
|
|
33
|
+
/** Matches `.ck-composer-exit` so a composer finishes leaving before it unmounts. */
|
|
34
|
+
export declare const DISMISS_ANIMATION_MS = 220;
|
|
35
|
+
/** Pointer travel, in pixels, before a pin drag starts. */
|
|
36
|
+
export declare const MIN_DRAG_THRESHOLD_PX = 4;
|
|
37
|
+
/** Region smaller than this falls back to a full-page capture. */
|
|
38
|
+
export declare const MIN_SCREENSHOT_REGION_PX = 20;
|
|
39
|
+
/** Reactions shared by the emoji picker. */
|
|
40
|
+
export declare const EMOJIS: readonly ["👍", "👎", "❤️", "😄", "🤔", "👀", "🔥", "✅", "❌", "🐛", "🚀", "🎉"];
|
|
41
|
+
/** Priorities the filter popover offers. All still means every priority. */
|
|
42
|
+
export declare const PRIORITY_OPTIONS: {
|
|
43
|
+
value: Extract<PriorityFilter, "high" | "low">;
|
|
44
|
+
label: string;
|
|
45
|
+
}[];
|
|
46
|
+
/** Priorities a new comment can be given. */
|
|
47
|
+
export declare const COMMENT_PRIORITY_OPTIONS: ReadonlyArray<{
|
|
48
|
+
value: Priority;
|
|
49
|
+
label: string;
|
|
50
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { DrawingPath } from "../../core/types";
|
|
3
|
+
import type { StrokePath } from "../hooks/use-drawing";
|
|
4
|
+
interface DrawingPathRendererProps {
|
|
5
|
+
path: DrawingPath;
|
|
6
|
+
}
|
|
7
|
+
/** Convert a live stroke into the path shape the comment engine stores. */
|
|
8
|
+
export declare function strokeToDrawingPath(stroke: StrokePath): DrawingPath | null;
|
|
9
|
+
export declare const DrawingPathRenderer: React.MemoExoticComponent<({ path, }: DrawingPathRendererProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CommentUser } from "./comment-composer-extras-fields";
|
|
2
|
+
import type { AssigneeFilter, CommentMode, ConnectionStatus, PageFilter, PanelView, PriorityFilter, Project, SortOrder, StatusFilter, UserFilter } from "../../core/types";
|
|
3
|
+
/**
|
|
4
|
+
* Widget view types. Sort order, comment mode, and connection status are the
|
|
5
|
+
* engine unions (`newest`, `comment` / `draw`, and `error`). The reference
|
|
6
|
+
* names `latest`, `pin`, and `drawing` are not used here.
|
|
7
|
+
*/
|
|
8
|
+
export type { AssigneeFilter, CommentMode, ConnectionStatus, PageFilter, PanelView, PriorityFilter, SortOrder, StatusFilter, UserFilter, };
|
|
9
|
+
export type FeatureFlags = Project["features"];
|
|
10
|
+
export type LimitsConfig = Project["limits"];
|
|
11
|
+
/** Where the toolbar rests after a drag. */
|
|
12
|
+
export type FabDock = "left" | "right" | "center";
|
|
13
|
+
export interface UsageInfo {
|
|
14
|
+
used: number;
|
|
15
|
+
limit: number;
|
|
16
|
+
label?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface MemberItem {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
email?: string;
|
|
22
|
+
avatarUrl?: string;
|
|
23
|
+
role?: "owner" | "admin" | "member";
|
|
24
|
+
joinedAt?: string;
|
|
25
|
+
isOnline?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface RemoteCursorData {
|
|
28
|
+
readonly user: CommentUser;
|
|
29
|
+
readonly x: number;
|
|
30
|
+
readonly y: number;
|
|
31
|
+
}
|
|
32
|
+
/** Profile fields the settings screen can show. The widget edits theme only. */
|
|
33
|
+
export interface UserSettingsProfile {
|
|
34
|
+
id?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
email?: string;
|
|
37
|
+
avatar?: string;
|
|
38
|
+
timezone?: string;
|
|
39
|
+
locale?: string;
|
|
40
|
+
jobTitle?: string;
|
|
41
|
+
company?: string;
|
|
42
|
+
notificationPreferences?: string;
|
|
43
|
+
status?: "active" | "suspended" | "banned" | "churned";
|
|
44
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CommentUser } from "./comment-composer-extras-fields";
|
|
3
|
+
import { type ComposerExtrasState } from "./comment-composer-extras.state";
|
|
4
|
+
import type { CommentComposerProps, ComposerSubmitPayload, UploadItem } from "./comment-composer.types";
|
|
5
|
+
export type { UploadItem, ComposerSubmitPayload, CommentComposerProps };
|
|
6
|
+
/**
|
|
7
|
+
* Composer state for a reply, edit, or new thread. File attachments stay out
|
|
8
|
+
* until the engine accepts them; the attach control remains disabled.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCommentComposer({ mode, defaultValue, availableUsers, onSubmit, disabled, }: Pick<CommentComposerProps, "mode" | "defaultValue" | "availableUsers" | "onSubmit" | "disabled">): {
|
|
11
|
+
value: string;
|
|
12
|
+
extras: ComposerExtrasState;
|
|
13
|
+
setExtras: React.Dispatch<React.SetStateAction<ComposerExtrasState>>;
|
|
14
|
+
textareaRef: React.RefObject<HTMLTextAreaElement | null>;
|
|
15
|
+
mentionQuery: string | null;
|
|
16
|
+
isSubmitting: boolean;
|
|
17
|
+
hasContent: boolean;
|
|
18
|
+
showExtras: boolean;
|
|
19
|
+
filteredMentions: CommentUser[];
|
|
20
|
+
replyUrls: string[];
|
|
21
|
+
resolvedUsers: CommentUser[];
|
|
22
|
+
handleSubmit: () => Promise<void>;
|
|
23
|
+
handleFormatInsert: (prefix: string, suffix: string) => void;
|
|
24
|
+
insertMention: (user: CommentUser) => void;
|
|
25
|
+
handleKeyDown: (event: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
26
|
+
handlePaste: (event: React.ClipboardEvent<HTMLTextAreaElement>) => void;
|
|
27
|
+
handleValueChange: (next: string, selectionStart: number) => void;
|
|
28
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type FabDock = "left" | "center" | "right";
|
|
3
|
+
declare function useCommentFabDrag(defaultSide: "left" | "right"): {
|
|
4
|
+
dragging: boolean;
|
|
5
|
+
side: FabDock;
|
|
6
|
+
scrolling: boolean;
|
|
7
|
+
barRef: React.RefObject<HTMLDivElement | null>;
|
|
8
|
+
dragOriginX: number;
|
|
9
|
+
dragX: number;
|
|
10
|
+
dragStartOffsetY: number;
|
|
11
|
+
dragY: number;
|
|
12
|
+
offsetY: number;
|
|
13
|
+
verticalEdge: "top" | "bottom" | null;
|
|
14
|
+
onPointerDown: (event: React.PointerEvent) => void;
|
|
15
|
+
onPointerMove: (event: React.PointerEvent) => void;
|
|
16
|
+
onPointerUp: (event: React.PointerEvent) => void;
|
|
17
|
+
onPointerCancel: (event: React.PointerEvent) => void;
|
|
18
|
+
onLostPointerCapture: (event: React.PointerEvent) => void;
|
|
19
|
+
};
|
|
20
|
+
export { useCommentFabDrag };
|
|
21
|
+
export type { FabDock };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface HashThread {
|
|
2
|
+
id: string;
|
|
3
|
+
position: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
element?: string;
|
|
7
|
+
xpath?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface UseCommentHashLinkOptions {
|
|
11
|
+
threads: HashThread[];
|
|
12
|
+
onOpenThread: (threadId: string) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Opens `#comment-{id}` when that thread is loaded, and scrolls the pin into view.
|
|
16
|
+
* The engine also handles the hash; this covers comments that arrive after boot.
|
|
17
|
+
*/
|
|
18
|
+
declare function useCommentHashLink({ threads, onOpenThread }: UseCommentHashLinkOptions): void;
|
|
19
|
+
export { useCommentHashLink };
|
|
20
|
+
export type { HashThread };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { CommentListFilters } from "../components/comment-list-filters";
|
|
3
|
+
/** Filter and search state for the comment list. Sort stays `newest`, not `latest`. */
|
|
4
|
+
export declare function useCommentKitFilters(initialPageFilter?: CommentListFilters["pageFilter"]): {
|
|
5
|
+
pageFilter: "all" | "current";
|
|
6
|
+
setPageFilter: React.Dispatch<React.SetStateAction<"all" | "current">>;
|
|
7
|
+
statusFilter: import("..").StatusFilter;
|
|
8
|
+
setStatusFilter: React.Dispatch<React.SetStateAction<import("..").StatusFilter>>;
|
|
9
|
+
sortOrder: "priority" | "newest" | "oldest";
|
|
10
|
+
setSortOrder: React.Dispatch<React.SetStateAction<"priority" | "newest" | "oldest">>;
|
|
11
|
+
priorityFilter: import("..").PriorityFilter;
|
|
12
|
+
setPriorityFilter: React.Dispatch<React.SetStateAction<import("..").PriorityFilter>>;
|
|
13
|
+
searchQuery: string;
|
|
14
|
+
setSearchQuery: React.Dispatch<React.SetStateAction<string>>;
|
|
15
|
+
userFilter: import("..").UserFilter;
|
|
16
|
+
setUserFilter: React.Dispatch<React.SetStateAction<import("..").UserFilter>>;
|
|
17
|
+
assigneeFilter: string;
|
|
18
|
+
setAssigneeFilter: React.Dispatch<React.SetStateAction<string>>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface UseCommentKitKeyboardOptions {
|
|
2
|
+
/** Desktop panel is open. Keyboard shortcuts stay on the engine. */
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Closes the desktop comments panel on a second click outside it.
|
|
8
|
+
* Ctrl/Cmd+Shift+K, Escape, and tool keys are handled by the engine.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCommentKitKeyboard({ enabled, onClose }: UseCommentKitKeyboardOptions): void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommentKitCore } from "../../core/comment-kit-core";
|
|
2
|
+
interface UseCommentKitPropSyncOptions {
|
|
3
|
+
core: CommentKitCore;
|
|
4
|
+
commentIds: readonly string[];
|
|
5
|
+
onOpenThread: (commentId: string) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Opens a `#comment-{id}` target once that comment is in state.
|
|
9
|
+
* The engine opens it immediately when the comment is already loaded.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCommentKitPropSync({ core, commentIds, onOpenThread, }: UseCommentKitPropSyncOptions): void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface MarkerPoint {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}
|
|
6
|
+
interface UseCommentMarkerDragOptions {
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
pos: MarkerPoint | undefined;
|
|
9
|
+
threadId: string;
|
|
10
|
+
onPositionChange?: (threadId: string, x: number, y: number) => void;
|
|
11
|
+
}
|
|
12
|
+
declare function useCommentMarkerDrag({ isActive, pos, threadId, onPositionChange, }: UseCommentMarkerDragOptions): {
|
|
13
|
+
dragging: boolean;
|
|
14
|
+
dragOffset: {
|
|
15
|
+
dx: number;
|
|
16
|
+
dy: number;
|
|
17
|
+
} | null;
|
|
18
|
+
handlePointerDown: (event: React.PointerEvent) => void;
|
|
19
|
+
handlePointerMove: (event: React.PointerEvent) => void;
|
|
20
|
+
handlePointerUp: (event: React.PointerEvent) => void;
|
|
21
|
+
handleClick: (event: React.MouseEvent) => void;
|
|
22
|
+
};
|
|
23
|
+
export { useCommentMarkerDrag };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ThreadView } from "../comments/view-model";
|
|
2
|
+
import type { CommentListFilters } from "../components/comment-list-filters";
|
|
3
|
+
interface UseCommentPanelNavigationOptions {
|
|
4
|
+
filteredThreads: readonly ThreadView[];
|
|
5
|
+
navIndex: number;
|
|
6
|
+
onSelectThread: (id: string) => void;
|
|
7
|
+
setPageFilter: (filter: CommentListFilters["pageFilter"]) => void;
|
|
8
|
+
setStatusFilter: (filter: CommentListFilters["statusFilter"]) => void;
|
|
9
|
+
setSortOrder: (order: CommentListFilters["sortOrder"]) => void;
|
|
10
|
+
setPriorityFilter: (filter: CommentListFilters["priorityFilter"]) => void;
|
|
11
|
+
setUserFilter: (filter: CommentListFilters["userFilter"]) => void;
|
|
12
|
+
setAssigneeFilter: (filter: CommentListFilters["assigneeFilter"]) => void;
|
|
13
|
+
setSearchQuery: (query: string) => void;
|
|
14
|
+
setSearchOpen: (open: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
declare function useCommentPanelNavigation({ filteredThreads, navIndex, onSelectThread, setPageFilter, setStatusFilter, setSortOrder, setPriorityFilter, setUserFilter, setAssigneeFilter, setSearchQuery, setSearchOpen, }: UseCommentPanelNavigationOptions): {
|
|
17
|
+
resetFilters: () => void;
|
|
18
|
+
selectPrevious: () => void;
|
|
19
|
+
selectNext: () => void;
|
|
20
|
+
};
|
|
21
|
+
export { useCommentPanelNavigation };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CommentKitCore } from "../../core/comment-kit-core";
|
|
2
|
+
/**
|
|
3
|
+
* Toasts when someone joins or leaves. The engine already owns the socket,
|
|
4
|
+
* presence list, and connection status.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useCommentRealtime(core: CommentKitCore, currentUserId: string | null): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface LocatableThread {
|
|
2
|
+
id: string;
|
|
3
|
+
position: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
element?: string;
|
|
7
|
+
xpath?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
declare function useCommentThreadActions(threads: readonly LocatableThread[]): {
|
|
11
|
+
copyUrl: (threadId: string) => Promise<void>;
|
|
12
|
+
locate: (threadId: string) => void;
|
|
13
|
+
};
|
|
14
|
+
export { useCommentThreadActions };
|
|
15
|
+
export type { LocatableThread };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asks the engine to reconnect the live socket. The reference demo reloaded
|
|
3
|
+
* the page because it had no socket; this keeps the current comments open.
|
|
4
|
+
*/
|
|
5
|
+
declare function useConnectionRetry(retry: () => void): {
|
|
6
|
+
isRetrying: boolean;
|
|
7
|
+
handleRetry: () => void;
|
|
8
|
+
};
|
|
9
|
+
export { useConnectionRetry };
|