@fileverse-dev/ddoc 3.1.7-comment-re-arch-23 → 3.1.7-linkCaption-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +28758 -32692
- package/dist/package/components/editor-bubble-menu/props.d.ts +0 -2
- package/dist/package/components/inline-comment/comment-card.d.ts +1 -1
- package/dist/package/components/inline-comment/comment-drawer.d.ts +1 -1
- package/dist/package/components/inline-comment/comment-dropdown.d.ts +1 -1
- package/dist/package/components/inline-comment/comment-section.d.ts +1 -1
- package/dist/package/components/inline-comment/comment-username.d.ts +1 -1
- package/dist/package/components/inline-comment/context/comment-context.d.ts +4 -0
- package/dist/package/components/inline-comment/context/types.d.ts +89 -46
- package/dist/package/components/inline-comment/empty-comments.d.ts +1 -4
- package/dist/package/components/inline-comment/types.d.ts +0 -24
- package/dist/package/components/tabs/document-tabs-sidebar.d.ts +1 -2
- package/dist/package/extensions/comment/comment.d.ts +0 -33
- package/dist/package/extensions/resizable-media/media-caption.d.ts +3 -0
- package/dist/package/extensions/resizable-media/resizable-media-menu-util.d.ts +4 -5
- package/dist/package/extensions/resizable-media/resizable-media-node-view.d.ts +1 -1
- package/dist/package/hooks/use-tab-editor.d.ts +2 -6
- package/dist/package/types.d.ts +2 -16
- package/dist/package/use-ddoc-editor.d.ts +1 -4
- package/dist/style.css +1 -1
- package/package.json +3 -4
- package/dist/package/components/inline-comment/comment-floating-container.d.ts +0 -1
- package/dist/package/components/inline-comment/comment-floating-layout.d.ts +0 -34
- package/dist/package/components/inline-comment/comment-input-field.d.ts +0 -4
- package/dist/package/components/inline-comment/comment-reply-input.d.ts +0 -8
- package/dist/package/components/inline-comment/constants.d.ts +0 -1
- package/dist/package/components/inline-comment/delete-confirm-overlay.d.ts +0 -10
- package/dist/package/components/inline-comment/floating-comment/comment-floating-container.d.ts +0 -3
- package/dist/package/components/inline-comment/floating-comment/draft-floating-card.d.ts +0 -3
- package/dist/package/components/inline-comment/floating-comment/floating-auth-prompt.d.ts +0 -1
- package/dist/package/components/inline-comment/floating-comment/floating-card-shell.d.ts +0 -3
- package/dist/package/components/inline-comment/floating-comment/index.d.ts +0 -1
- package/dist/package/components/inline-comment/floating-comment/thread-floating-card.d.ts +0 -3
- package/dist/package/components/inline-comment/floating-comment/types.d.ts +0 -34
- package/dist/package/components/inline-comment/floating-comment-layout-utils.d.ts +0 -78
- package/dist/package/components/inline-comment/resize-inline-comment-textarea.d.ts +0 -1
- package/dist/package/components/inline-comment/use-anchor-registry.d.ts +0 -34
- package/dist/package/components/inline-comment/use-comment-card.d.ts +0 -29
- package/dist/package/components/inline-comment/use-comment-list-container.d.ts +0 -17
- package/dist/package/components/inline-comment/use-ens-status.d.ts +0 -3
- package/dist/package/components/inline-comment/use-floating-card-state.d.ts +0 -36
- package/dist/package/components/inline-comment/use-floating-comment-card-layout.d.ts +0 -23
- package/dist/package/components/inline-comment/use-floating-comment-card-state.d.ts +0 -13
- package/dist/package/components/inline-comment/use-floating-layout-engine.d.ts +0 -26
- package/dist/package/components/inline-comment/use-is-selected-content-deleted.d.ts +0 -1
- package/dist/package/extensions/comment/comment-decoration-plugin.d.ts +0 -70
- package/dist/package/stores/comment-store-provider.d.ts +0 -56
- package/dist/package/stores/comment-store.d.ts +0 -195
- package/dist/package/utils/comment-anchor-serialization.d.ts +0 -5
- package/dist/package/utils/comment-scroll-into-view.d.ts +0 -21
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@fileverse-dev/ddoc",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "DDoc",
|
|
5
|
-
"version": "3.1.7-
|
|
5
|
+
"version": "3.1.7-linkCaption-0",
|
|
6
6
|
"main": "dist/index.es.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
8
8
|
"exports": {
|
|
@@ -114,8 +114,7 @@
|
|
|
114
114
|
"y-prosemirror": "^1.2.5",
|
|
115
115
|
"y-protocols": "^1.0.6",
|
|
116
116
|
"y-webrtc": "^10.3.0",
|
|
117
|
-
"yjs": "^13.6.15"
|
|
118
|
-
"zustand": "^5.0.12"
|
|
117
|
+
"yjs": "^13.6.15"
|
|
119
118
|
},
|
|
120
119
|
"peerDependencies": {
|
|
121
120
|
"@dnd-kit/core": ">=6.3.1",
|
|
@@ -154,4 +153,4 @@
|
|
|
154
153
|
"typescript": "^5.2.2",
|
|
155
154
|
"vite": "^5.0.0"
|
|
156
155
|
}
|
|
157
|
-
}
|
|
156
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CommentFloatingContainer } from './floating-comment';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare const FLOATING_COMMENT_CARD_GAP = 8;
|
|
2
|
-
export declare const enum FloatingLayoutInvalidationFlag {
|
|
3
|
-
None = 0,
|
|
4
|
-
Anchor = 1,
|
|
5
|
-
Viewport = 2,
|
|
6
|
-
Height = 4,
|
|
7
|
-
Visibility = 8
|
|
8
|
-
}
|
|
9
|
-
export interface FloatingCardLayoutInput {
|
|
10
|
-
floatingCardId: string;
|
|
11
|
-
anchorTop: number | null;
|
|
12
|
-
height: number;
|
|
13
|
-
isVisible: boolean;
|
|
14
|
-
isMeasured: boolean;
|
|
15
|
-
lastCommittedTranslateY: number | null;
|
|
16
|
-
invalidationFlags: FloatingLayoutInvalidationFlag;
|
|
17
|
-
}
|
|
18
|
-
export interface FloatingLayoutResult {
|
|
19
|
-
placements: Map<string, {
|
|
20
|
-
translateY: number | null;
|
|
21
|
-
isVisible: boolean;
|
|
22
|
-
}>;
|
|
23
|
-
stopIndex: number;
|
|
24
|
-
usedFocusedLayout: boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare const roundFloatingTranslateY: (translateY: number | null) => number | null;
|
|
27
|
-
export declare const computeFloatingCommentLayout: ({ floatingCards, recomputeStartIndex, firstInvalidatedIndex, lastInvalidatedIndex, gap, focusedFloatingCardId, }: {
|
|
28
|
-
floatingCards: FloatingCardLayoutInput[];
|
|
29
|
-
recomputeStartIndex: number;
|
|
30
|
-
firstInvalidatedIndex?: number;
|
|
31
|
-
lastInvalidatedIndex: number;
|
|
32
|
-
gap?: number;
|
|
33
|
-
focusedFloatingCardId?: string | null;
|
|
34
|
-
}) => FloatingLayoutResult;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
interface CommentReplyInputProps {
|
|
2
|
-
commentId: string;
|
|
3
|
-
commentUsername?: string;
|
|
4
|
-
replyCount: number;
|
|
5
|
-
isCollaborationEnabled: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare const CommentReplyInput: ({ commentId, replyCount, isCollaborationEnabled, }: CommentReplyInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const FLOATING_CARD_WIDTH = 300;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const DeleteConfirmOverlay: ({ isVisible, title, onCancel, onConfirm, className, heading, description, confirmLabel, }: {
|
|
2
|
-
isVisible: boolean;
|
|
3
|
-
title: string;
|
|
4
|
-
onCancel: () => void;
|
|
5
|
-
onConfirm: () => void;
|
|
6
|
-
className?: string;
|
|
7
|
-
heading?: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
confirmLabel?: string;
|
|
10
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
package/dist/package/components/inline-comment/floating-comment/comment-floating-container.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { CommentFloatingContainerProps } from './types';
|
|
2
|
-
|
|
3
|
-
export declare const CommentFloatingContainer: ({ editor, editorWrapperRef, scrollContainerRef, tabName, isHidden, isCollaborationEnabled, }: CommentFloatingContainerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const FloatingAuthPrompt: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CommentFloatingContainer } from './comment-floating-container';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { IComment } from '../../../extensions/comment';
|
|
4
|
-
import { CommentFloatingDraftCard, CommentFloatingThreadCard } from '../context/types';
|
|
5
|
-
|
|
6
|
-
export type RegisterCardNode = (floatingCardId: string, node: HTMLDivElement | null) => void;
|
|
7
|
-
export interface CommentFloatingContainerProps {
|
|
8
|
-
editor: Editor;
|
|
9
|
-
editorWrapperRef: RefObject<HTMLDivElement>;
|
|
10
|
-
scrollContainerRef: RefObject<HTMLDivElement>;
|
|
11
|
-
tabName: string;
|
|
12
|
-
isHidden: boolean;
|
|
13
|
-
isCollaborationEnabled?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface FloatingCardShellProps {
|
|
16
|
-
floatingCardId: string;
|
|
17
|
-
isHidden: boolean;
|
|
18
|
-
isFocused: boolean;
|
|
19
|
-
onFocus: () => void;
|
|
20
|
-
children: ReactNode;
|
|
21
|
-
}
|
|
22
|
-
export interface DraftFloatingCardProps {
|
|
23
|
-
draft: CommentFloatingDraftCard;
|
|
24
|
-
isHidden: boolean;
|
|
25
|
-
registerCardNode: RegisterCardNode;
|
|
26
|
-
}
|
|
27
|
-
export interface ThreadFloatingCardProps {
|
|
28
|
-
thread: CommentFloatingThreadCard;
|
|
29
|
-
comment: IComment | undefined;
|
|
30
|
-
tabName: string;
|
|
31
|
-
isHidden: boolean;
|
|
32
|
-
registerCardNode: RegisterCardNode;
|
|
33
|
-
isCollaborationEnabled?: boolean;
|
|
34
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { FloatingLayoutInvalidationFlag, FloatingCardLayoutInput } from './comment-floating-layout';
|
|
3
|
-
import { CommentFloatingCard } from './context/types';
|
|
4
|
-
|
|
5
|
-
export type AnchorType = 'draft' | 'thread';
|
|
6
|
-
export interface CachedAnchorRect {
|
|
7
|
-
top: number;
|
|
8
|
-
height: number;
|
|
9
|
-
scrollTop: number;
|
|
10
|
-
containerTop: number;
|
|
11
|
-
}
|
|
12
|
-
export interface AnchorRecord {
|
|
13
|
-
floatingCardId: string;
|
|
14
|
-
anchorId: string;
|
|
15
|
-
anchorType: AnchorType;
|
|
16
|
-
elements: HTMLElement[];
|
|
17
|
-
pmPos: number | null;
|
|
18
|
-
anchorVersion: number;
|
|
19
|
-
cachedRect: CachedAnchorRect | null;
|
|
20
|
-
lastSeenEditorRoot: HTMLElement | null;
|
|
21
|
-
missingSinceDocVersion: number | null;
|
|
22
|
-
missingSinceCycle: number | null;
|
|
23
|
-
}
|
|
24
|
-
export interface FloatingCardRuntimeState {
|
|
25
|
-
floatingCardId: string;
|
|
26
|
-
anchorPosition: number | null;
|
|
27
|
-
anchorVersion: number;
|
|
28
|
-
anchorTop: number | null;
|
|
29
|
-
anchorHeight: number;
|
|
30
|
-
height: number;
|
|
31
|
-
isMeasured: boolean;
|
|
32
|
-
isInViewport: boolean;
|
|
33
|
-
translateY: number | null;
|
|
34
|
-
lastCommittedTranslateY: number | null;
|
|
35
|
-
lastCommittedVisible: boolean;
|
|
36
|
-
needsTransformSync: boolean;
|
|
37
|
-
invalidationFlags: FloatingLayoutInvalidationFlag;
|
|
38
|
-
}
|
|
39
|
-
export declare const FLOATING_VIEWPORT_BUFFER_MULTIPLIER = 1;
|
|
40
|
-
export declare const getAnchorIdentity: (floatingCard: CommentFloatingCard) => {
|
|
41
|
-
anchorId: string;
|
|
42
|
-
anchorType: "draft";
|
|
43
|
-
} | {
|
|
44
|
-
anchorId: string;
|
|
45
|
-
anchorType: "thread";
|
|
46
|
-
};
|
|
47
|
-
export declare const getAnchorElements: ({ editorRoot, anchorId, anchorType, }: {
|
|
48
|
-
editorRoot: HTMLElement;
|
|
49
|
-
anchorId: string;
|
|
50
|
-
anchorType: AnchorType;
|
|
51
|
-
}) => HTMLElement[];
|
|
52
|
-
export declare const getAnchorStartPos: (editor: Editor, elements: HTMLElement[]) => null;
|
|
53
|
-
export declare const getEditorRoot: (editor: Editor) => HTMLElement | null;
|
|
54
|
-
export declare const areAnchorElementsEqual: (previousElements: HTMLElement[], nextElements: HTMLElement[]) => boolean;
|
|
55
|
-
export declare const isAnchorEntryValid: (entry: AnchorRecord, editorRoot: HTMLElement) => boolean;
|
|
56
|
-
export declare const getCachedAnchorRect: ({ cachedRect, scrollTop, containerTop, }: {
|
|
57
|
-
cachedRect: CachedAnchorRect;
|
|
58
|
-
scrollTop: number;
|
|
59
|
-
containerTop: number;
|
|
60
|
-
}) => {
|
|
61
|
-
top: number;
|
|
62
|
-
height: number;
|
|
63
|
-
};
|
|
64
|
-
export declare const getRect: ({ elements, viewportTop, viewportBottom, }: {
|
|
65
|
-
elements: HTMLElement[];
|
|
66
|
-
viewportTop: number;
|
|
67
|
-
viewportBottom: number;
|
|
68
|
-
}) => DOMRect | null;
|
|
69
|
-
export declare const reconcileOrderedFloatingCardIds: ({ previousOrderedFloatingCardIds, nextFloatingCards, getPos, }: {
|
|
70
|
-
previousOrderedFloatingCardIds: string[];
|
|
71
|
-
nextFloatingCards: CommentFloatingCard[];
|
|
72
|
-
getPos: (floatingCardId: string) => number | null;
|
|
73
|
-
}) => {
|
|
74
|
-
orderedFloatingCardIds: string[];
|
|
75
|
-
firstChangedIndex: number | null;
|
|
76
|
-
};
|
|
77
|
-
export declare const areFloatingCardIdListsEqual: (a: string[], b: string[]) => boolean;
|
|
78
|
-
export declare const toFloatingCardLayoutInput: (floatingCardState: FloatingCardRuntimeState) => FloatingCardLayoutInput;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const resizeInlineCommentTextarea: (textarea: HTMLTextAreaElement, maxHeight?: number) => void;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
import { FloatingLayoutInvalidationFlag } from './comment-floating-layout';
|
|
4
|
-
import { CommentFloatingCard } from './context/types';
|
|
5
|
-
import { AnchorRecord, FloatingCardRuntimeState } from './floating-comment-layout-utils';
|
|
6
|
-
|
|
7
|
-
interface SyncAnchorsArgs {
|
|
8
|
-
currentCycle: number;
|
|
9
|
-
currentDocVersion: number;
|
|
10
|
-
editor: Editor;
|
|
11
|
-
editorRoot: HTMLElement;
|
|
12
|
-
editorWrapperNode: HTMLDivElement | null;
|
|
13
|
-
floatingCards: CommentFloatingCard[];
|
|
14
|
-
getFloatingCardRuntimeState: (floatingCardId: string) => FloatingCardRuntimeState;
|
|
15
|
-
markFloatingCardInvalidated: (floatingCardId: string, flag: FloatingLayoutInvalidationFlag) => void;
|
|
16
|
-
markFloatingCardOrderDirty: () => void;
|
|
17
|
-
markRecomputeFromIndex: (recomputeFromIndex: number) => void;
|
|
18
|
-
getOrderedFloatingCardIndex: (floatingCardId: string) => number | null;
|
|
19
|
-
}
|
|
20
|
-
interface SyncAnchorsResult {
|
|
21
|
-
activeFloatingCards: CommentFloatingCard[];
|
|
22
|
-
activeFloatingCardMap: Map<string, CommentFloatingCard>;
|
|
23
|
-
floatingCardIdsToClose: Set<string>;
|
|
24
|
-
shouldScheduleFollowUp: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface UseAnchorRegistryResult {
|
|
27
|
-
anchorRegistryRef: MutableRefObject<Map<string, AnchorRecord>>;
|
|
28
|
-
queueAnchorRefresh: (floatingCardId: string) => void;
|
|
29
|
-
queueAnchorRefreshForCards: (floatingCards: CommentFloatingCard[]) => void;
|
|
30
|
-
resetAnchorRegistry: () => void;
|
|
31
|
-
syncAnchors: (args: SyncAnchorsArgs) => SyncAnchorsResult;
|
|
32
|
-
}
|
|
33
|
-
export declare const useAnchorRegistry: () => UseAnchorRegistryResult;
|
|
34
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from 'react';
|
|
2
|
-
import { IComment } from '../../extensions/comment';
|
|
3
|
-
import { CommentCardProps } from './types';
|
|
4
|
-
|
|
5
|
-
export declare const useCommentCard: ({ username, comment, replies, onResolve, onRequestDelete, onUnresolve, onFocusRequest, isResolved, isDropdown, isCommentDrawerContext, activeCommentId, id, isFocused, }: CommentCardProps) => {
|
|
6
|
-
commentsContainerRef: import('react').RefObject<HTMLDivElement>;
|
|
7
|
-
displayedComment: string | undefined;
|
|
8
|
-
displayedReplies: IComment[];
|
|
9
|
-
dropdownRef: import('react').RefObject<HTMLDivElement>;
|
|
10
|
-
ensStatus: import('./types').EnsStatus;
|
|
11
|
-
focusCardIfNeeded: () => void;
|
|
12
|
-
handleCommentExpandClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
-
handleReplyToggleClick: (event: MouseEvent<HTMLElement>) => void;
|
|
14
|
-
handleRequestEditClick: () => void;
|
|
15
|
-
handleRequestDeleteClick: () => void;
|
|
16
|
-
handleResolveClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
-
handleUnresolveClick: () => void;
|
|
18
|
-
isBelow1280px: boolean;
|
|
19
|
-
isCardActive: boolean;
|
|
20
|
-
isCommentExpanded: boolean;
|
|
21
|
-
isCommentMobileFocused: boolean;
|
|
22
|
-
isCommentTruncated: boolean;
|
|
23
|
-
replyToggleLabel: string;
|
|
24
|
-
shouldShowReplyThread: boolean;
|
|
25
|
-
shouldShowReplyToggle: boolean;
|
|
26
|
-
shouldShowResolvedMobileReplyCount: boolean;
|
|
27
|
-
showAllReplies: boolean;
|
|
28
|
-
visibleReplies: IComment[];
|
|
29
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
import { CommentFloatingCard } from './context/types';
|
|
4
|
-
|
|
5
|
-
export interface UseCommentListContainerProps {
|
|
6
|
-
editor: Editor;
|
|
7
|
-
editorWrapperRef: RefObject<HTMLDivElement>;
|
|
8
|
-
scrollContainerRef: RefObject<HTMLDivElement>;
|
|
9
|
-
isHidden: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface UseCommentListContainerResult {
|
|
12
|
-
floatingCardListContainerRef: RefObject<HTMLDivElement>;
|
|
13
|
-
mountedFloatingCards: CommentFloatingCard[];
|
|
14
|
-
registerCardNode: (floatingCardId: string, node: HTMLDivElement | null) => void;
|
|
15
|
-
shouldRender: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare const useCommentListContainer: ({ editor, editorWrapperRef, scrollContainerRef, isHidden, }: UseCommentListContainerProps) => UseCommentListContainerResult;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
import { FloatingLayoutInvalidationFlag, FloatingCardLayoutInput } from './comment-floating-layout';
|
|
3
|
-
import { CommentFloatingCard } from './context/types';
|
|
4
|
-
import { FloatingCardRuntimeState } from './floating-comment-layout-utils';
|
|
5
|
-
|
|
6
|
-
interface SyncMountedFloatingCardIdsResult {
|
|
7
|
-
didChange: boolean;
|
|
8
|
-
previousMountedFloatingCardIds: Set<string>;
|
|
9
|
-
}
|
|
10
|
-
export interface UseFloatingCardStateResult {
|
|
11
|
-
floatingCardStateRef: MutableRefObject<Map<string, FloatingCardRuntimeState>>;
|
|
12
|
-
orderedFloatingCardIdsRef: MutableRefObject<string[]>;
|
|
13
|
-
orderDirtyRef: MutableRefObject<boolean>;
|
|
14
|
-
heightMeasurementQueueRef: MutableRefObject<Set<string>>;
|
|
15
|
-
layoutBoundaryRef: MutableRefObject<{
|
|
16
|
-
recomputeFromIndex: number;
|
|
17
|
-
}>;
|
|
18
|
-
mountedFloatingCardIdsRef: MutableRefObject<string[]>;
|
|
19
|
-
mountedFloatingCardIds: string[];
|
|
20
|
-
getFloatingCardRuntimeState: (floatingCardId: string) => FloatingCardRuntimeState;
|
|
21
|
-
getOrderedFloatingCardIndex: (floatingCardId: string) => number | null;
|
|
22
|
-
markRecomputeFromIndex: (recomputeFromIndex: number) => void;
|
|
23
|
-
markFloatingCardInvalidated: (floatingCardId: string, flag: FloatingLayoutInvalidationFlag) => void;
|
|
24
|
-
markFloatingCardOrderDirty: () => void;
|
|
25
|
-
reconcileFloatingCardOrder: (nextFloatingCards: CommentFloatingCard[]) => {
|
|
26
|
-
orderedFloatingCardIds: string[];
|
|
27
|
-
firstChangedIndex: number | null;
|
|
28
|
-
};
|
|
29
|
-
pruneFloatingCardRuntimeState: (activeFloatingCardIds: Set<string>) => void;
|
|
30
|
-
syncMountedFloatingCardIds: (nextMountedFloatingCardIds: string[]) => SyncMountedFloatingCardIdsResult;
|
|
31
|
-
clearInvalidationFlagsThroughIndex: (stopIndex: number) => void;
|
|
32
|
-
getFloatingCardLayoutInputs: () => FloatingCardLayoutInput[];
|
|
33
|
-
resetFloatingCardState: () => void;
|
|
34
|
-
}
|
|
35
|
-
export declare const useFloatingCardState: () => UseFloatingCardStateResult;
|
|
36
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
import { CommentFloatingCard } from './context/types';
|
|
4
|
-
|
|
5
|
-
interface UseFloatingCommentCardLayoutProps {
|
|
6
|
-
blurFloatingCard: (floatingCardId: string) => void;
|
|
7
|
-
closeFloatingCard: (floatingCardId: string) => void;
|
|
8
|
-
editor: Editor;
|
|
9
|
-
editorWrapperRef: RefObject<HTMLDivElement>;
|
|
10
|
-
floatingCardIdsKey: string;
|
|
11
|
-
floatingCards: CommentFloatingCard[];
|
|
12
|
-
focusedFloatingCardId: string | null;
|
|
13
|
-
isDesktopFloatingEnabled: boolean;
|
|
14
|
-
isHidden: boolean;
|
|
15
|
-
scrollContainerRef: RefObject<HTMLDivElement>;
|
|
16
|
-
}
|
|
17
|
-
interface UseFloatingCommentCardLayoutResult {
|
|
18
|
-
floatingCardListContainerRef: RefObject<HTMLDivElement>;
|
|
19
|
-
mountedFloatingCardIds: string[];
|
|
20
|
-
registerCardNode: (floatingCardId: string, node: HTMLDivElement | null) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const useFloatingCommentCardLayout: ({ blurFloatingCard, closeFloatingCard, editor, editorWrapperRef, floatingCardIdsKey, floatingCards, focusedFloatingCardId, isDesktopFloatingEnabled, isHidden, scrollContainerRef, }: UseFloatingCommentCardLayoutProps) => UseFloatingCommentCardLayoutResult;
|
|
23
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { CommentFloatingCard } from './context/types';
|
|
2
|
-
|
|
3
|
-
interface UseFloatingCommentCardStateResult {
|
|
4
|
-
blurFloatingCard: (floatingCardId: string) => void;
|
|
5
|
-
closeFloatingCard: (floatingCardId: string) => void;
|
|
6
|
-
floatingCardIdsKey: string;
|
|
7
|
-
floatingCardMap: Map<string, CommentFloatingCard>;
|
|
8
|
-
floatingCards: CommentFloatingCard[];
|
|
9
|
-
focusedFloatingCardId: string | null;
|
|
10
|
-
isDesktopFloatingEnabled: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare const useFloatingCommentCardState: () => UseFloatingCommentCardStateResult;
|
|
13
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
import { CommentFloatingCard } from './context/types';
|
|
4
|
-
import { UseAnchorRegistryResult } from './use-anchor-registry';
|
|
5
|
-
import { UseFloatingCardStateResult } from './use-floating-card-state';
|
|
6
|
-
|
|
7
|
-
interface UseFloatingLayoutEngineProps {
|
|
8
|
-
blurFloatingCard: (floatingCardId: string) => void;
|
|
9
|
-
closeFloatingCard: (floatingCardId: string) => void;
|
|
10
|
-
editor: Editor;
|
|
11
|
-
editorWrapperRef: RefObject<HTMLDivElement>;
|
|
12
|
-
floatingCardIdsKey: string;
|
|
13
|
-
floatingCards: CommentFloatingCard[];
|
|
14
|
-
focusedFloatingCardId: string | null;
|
|
15
|
-
isDesktopFloatingEnabled: boolean;
|
|
16
|
-
isHidden: boolean;
|
|
17
|
-
scrollContainerRef: RefObject<HTMLDivElement>;
|
|
18
|
-
anchorRegistry: UseAnchorRegistryResult;
|
|
19
|
-
floatingCardState: UseFloatingCardStateResult;
|
|
20
|
-
}
|
|
21
|
-
export interface UseFloatingLayoutEngineResult {
|
|
22
|
-
floatingCardListContainerRef: RefObject<HTMLDivElement>;
|
|
23
|
-
registerCardNode: (floatingCardId: string, node: HTMLDivElement | null) => void;
|
|
24
|
-
}
|
|
25
|
-
export declare const useFloatingLayoutEngine: ({ blurFloatingCard, closeFloatingCard, editor, editorWrapperRef, floatingCardIdsKey, floatingCards, focusedFloatingCardId, isDesktopFloatingEnabled, isHidden, scrollContainerRef, anchorRegistry, floatingCardState, }: UseFloatingLayoutEngineProps) => UseFloatingLayoutEngineResult;
|
|
26
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useIsSelectedContentDeleted(commentId: string | undefined, selectedContent: string | undefined, commentTabId: string | undefined): boolean;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Extension, Editor } from '@tiptap/core';
|
|
2
|
-
import { EditorState, PluginKey } from '@tiptap/pm/state';
|
|
3
|
-
import { Transform } from '@tiptap/pm/transform';
|
|
4
|
-
import { DecorationSet } from '@tiptap/pm/view';
|
|
5
|
-
|
|
6
|
-
import * as Y from 'yjs';
|
|
7
|
-
export interface CommentAnchor {
|
|
8
|
-
id: string;
|
|
9
|
-
anchorFrom: Y.RelativePosition;
|
|
10
|
-
anchorTo: Y.RelativePosition;
|
|
11
|
-
resolved: boolean;
|
|
12
|
-
deleted: boolean;
|
|
13
|
-
}
|
|
14
|
-
interface CommentDecorationPluginState {
|
|
15
|
-
decorations: DecorationSet;
|
|
16
|
-
}
|
|
17
|
-
type CommentAnchorRange = {
|
|
18
|
-
from: number;
|
|
19
|
-
to: number;
|
|
20
|
-
};
|
|
21
|
-
type CommentAnchorRelativeRange = {
|
|
22
|
-
anchorFrom: Y.RelativePosition;
|
|
23
|
-
anchorTo: Y.RelativePosition;
|
|
24
|
-
};
|
|
25
|
-
export type CommentAnchorTransactionChange = {
|
|
26
|
-
id: string;
|
|
27
|
-
type: 'unchanged';
|
|
28
|
-
} | {
|
|
29
|
-
id: string;
|
|
30
|
-
type: 'deleted';
|
|
31
|
-
} | ({
|
|
32
|
-
id: string;
|
|
33
|
-
type: 'edited';
|
|
34
|
-
} & CommentAnchorRange & CommentAnchorRelativeRange);
|
|
35
|
-
export declare const commentDecorationPluginKey: PluginKey<CommentDecorationPluginState>;
|
|
36
|
-
export declare function resolveCommentAnchorRangeInState(anchor: Pick<CommentAnchor, 'anchorFrom' | 'anchorTo'>, state: EditorState): CommentAnchorRange | null;
|
|
37
|
-
export declare function resolveCommentAnchorRangeForAnalysis(anchor: Pick<CommentAnchor, 'id' | 'anchorFrom' | 'anchorTo'>, state: EditorState): CommentAnchorRange | null;
|
|
38
|
-
/**
|
|
39
|
-
* Analyze transaction changes to classify each active anchor's mutation status.
|
|
40
|
-
*
|
|
41
|
-
* This is the core transaction analysis function that determines
|
|
42
|
-
* whether each anchor remains unchanged, gets edited, or is deleted.
|
|
43
|
-
*
|
|
44
|
-
* Classification rules (in order):
|
|
45
|
-
* 1. Skip deleted or resolved anchors → 'unchanged'
|
|
46
|
-
* 2. If anchor has no old position → 'unchanged'
|
|
47
|
-
* 3. If no changed ranges touch the anchor → 'unchanged'
|
|
48
|
-
* 4. If any changed range fully covers the anchor → 'deleted' (full-span replacement)
|
|
49
|
-
* 5. If combined changed ranges fully cover the anchor → 'deleted' (multi-step removal)
|
|
50
|
-
* 6. If anchor maps through transform → check if position or content changed:
|
|
51
|
-
* a. If both unchanged → 'unchanged'
|
|
52
|
-
* b. Otherwise → 'edited' (return new position and relative anchor)
|
|
53
|
-
* 7. If mapping fails → 'deleted'
|
|
54
|
-
*/
|
|
55
|
-
export declare function analyzeCommentAnchorTransactionChanges(anchors: CommentAnchor[], oldState: EditorState, newState: EditorState, transform: Transform): CommentAnchorTransactionChange[];
|
|
56
|
-
export interface CommentDecorationOptions {
|
|
57
|
-
getAnchors: () => CommentAnchor[];
|
|
58
|
-
getActiveCommentId: () => string | null;
|
|
59
|
-
}
|
|
60
|
-
export declare const CommentDecorationExtension: Extension<CommentDecorationOptions, any>;
|
|
61
|
-
/**
|
|
62
|
-
* Public helper functions for comment anchor creation and inspection.
|
|
63
|
-
* These are consumed by the draft-creation flow and transaction-analysis layer.
|
|
64
|
-
*/
|
|
65
|
-
export declare function createCommentAnchorFromEditor(editor: Editor, from: number, to: number): CommentAnchorRelativeRange | null;
|
|
66
|
-
export declare function createCommentAnchorFromSelection(editor: Editor): CommentAnchorRelativeRange | null;
|
|
67
|
-
export declare function triggerDecorationRebuild(editor: Editor): void;
|
|
68
|
-
export declare function getCommentAtPosition(editor: Editor, pos: number, getAnchors: () => CommentAnchor[]): CommentAnchor | null;
|
|
69
|
-
export declare function getCommentAnchorRange(editor: Editor, commentId: string, getAnchors: () => CommentAnchor[]): CommentAnchorRange | null;
|
|
70
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { Editor } from '@tiptap/core';
|
|
3
|
-
import { IComment } from '../extensions/comment';
|
|
4
|
-
import { CommentAnchor } from '../extensions/comment/comment-decoration-plugin';
|
|
5
|
-
import { CommentMutationMeta, SerializedCommentAnchor } from '../types';
|
|
6
|
-
|
|
7
|
-
import * as Y from 'yjs';
|
|
8
|
-
export interface CommentStoreProviderProps {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
editor: Editor | null;
|
|
11
|
-
ydoc: Y.Doc;
|
|
12
|
-
isFocusMode?: boolean;
|
|
13
|
-
setActiveCommentId: (id: string | null) => void;
|
|
14
|
-
focusCommentWithActiveId: (id: string) => void;
|
|
15
|
-
setInitialComments?: React.Dispatch<React.SetStateAction<IComment[]>>;
|
|
16
|
-
onNewComment?: (comment: IComment, meta?: CommentMutationMeta) => void;
|
|
17
|
-
onEditComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
18
|
-
onEditReply?: (commentId: string, replyId: string, meta?: CommentMutationMeta) => void;
|
|
19
|
-
onCommentReply?: (activeCommentId: string, reply: IComment) => void;
|
|
20
|
-
onResolveComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
21
|
-
onUnresolveComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
22
|
-
onDeleteComment?: (commentId: string, meta?: CommentMutationMeta) => void;
|
|
23
|
-
onInlineComment?: () => void;
|
|
24
|
-
onComment?: () => void;
|
|
25
|
-
setCommentDrawerOpen?: (open: boolean) => void;
|
|
26
|
-
connectViaWallet?: () => Promise<void>;
|
|
27
|
-
connectViaUsername?: (username: string) => Promise<void>;
|
|
28
|
-
ensResolutionUrl: string;
|
|
29
|
-
commentAnchorsRef?: React.MutableRefObject<CommentAnchor[]>;
|
|
30
|
-
initialCommentAnchors?: SerializedCommentAnchor[];
|
|
31
|
-
initialComments: IComment[];
|
|
32
|
-
username: string | null;
|
|
33
|
-
activeCommentId: string | null;
|
|
34
|
-
activeTabId: string;
|
|
35
|
-
isConnected?: boolean;
|
|
36
|
-
isLoading?: boolean;
|
|
37
|
-
isDDocOwner?: boolean;
|
|
38
|
-
setUsername?: React.Dispatch<React.SetStateAction<string>>;
|
|
39
|
-
}
|
|
40
|
-
export declare const CommentStoreProvider: ({ children, editor, ydoc, isFocusMode, setActiveCommentId, focusCommentWithActiveId, setInitialComments, onNewComment, onEditComment, onEditReply, onCommentReply, onResolveComment, onUnresolveComment, onDeleteComment, onInlineComment, onComment, setCommentDrawerOpen, connectViaWallet, connectViaUsername, ensResolutionUrl, commentAnchorsRef, initialCommentAnchors, setUsername: setUsernameProp, initialComments, username, activeCommentId, activeTabId, isConnected, isLoading, isDDocOwner, }: CommentStoreProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
interface CommentRefsContextType {
|
|
42
|
-
commentsSectionRef: React.RefObject<HTMLDivElement>;
|
|
43
|
-
replySectionRef: React.RefObject<HTMLDivElement>;
|
|
44
|
-
portalRef: React.RefObject<HTMLDivElement>;
|
|
45
|
-
buttonRef: React.RefObject<HTMLDivElement>;
|
|
46
|
-
dropdownRef: React.RefObject<HTMLDivElement>;
|
|
47
|
-
mobileDraftRef: React.RefObject<HTMLDivElement>;
|
|
48
|
-
}
|
|
49
|
-
export declare const useCommentRefs: () => CommentRefsContextType;
|
|
50
|
-
interface CommentAnchorsContextType {
|
|
51
|
-
activeCommentAnchorIds: Set<string>;
|
|
52
|
-
activeCommentAnchorIdsTabId: string | null;
|
|
53
|
-
hasRenderedCommentAnchor: (commentId: string) => boolean;
|
|
54
|
-
}
|
|
55
|
-
export declare const useCommentAnchors: () => CommentAnchorsContextType;
|
|
56
|
-
export {};
|