@fileverse-dev/ddoc 3.1.6-patch-001 → 3.1.6-patch-002

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.
Files changed (60) hide show
  1. package/dist/index.es.js +35447 -35952
  2. package/dist/package/components/editor-toolbar.d.ts +2 -1
  3. package/dist/package/components/editor-utils.d.ts +2 -1
  4. package/dist/package/components/inline-comment/comment-card.d.ts +1 -1
  5. package/dist/package/components/inline-comment/comment-drawer.d.ts +1 -1
  6. package/dist/package/components/inline-comment/comment-dropdown.d.ts +1 -1
  7. package/dist/package/components/inline-comment/comment-section.d.ts +1 -1
  8. package/dist/package/components/inline-comment/comment-username.d.ts +1 -1
  9. package/dist/package/components/inline-comment/context/comment-context.d.ts +4 -0
  10. package/dist/package/components/inline-comment/context/types.d.ts +89 -46
  11. package/dist/package/components/inline-comment/empty-comments.d.ts +1 -4
  12. package/dist/package/components/inline-comment/types.d.ts +0 -22
  13. package/dist/package/components/presentation-mode/presentation-mode.d.ts +2 -2
  14. package/dist/package/components/presentation-mode/preview-panel.d.ts +2 -2
  15. package/dist/package/components/preview-export-trigger.d.ts +2 -1
  16. package/dist/package/components/tabs/document-tabs-sidebar.d.ts +1 -2
  17. package/dist/package/context/editor-context.d.ts +3 -3
  18. package/dist/package/extensions/comment/comment.d.ts +0 -27
  19. package/dist/package/extensions/custom-link/index.d.ts +19 -0
  20. package/dist/package/extensions/default-extension.d.ts +1 -1
  21. package/dist/package/extensions/odt-export/index.d.ts +30 -0
  22. package/dist/package/hooks/use-ddoc-export.d.ts +1 -1
  23. package/dist/package/hooks/use-export-headless-editor-content.d.ts +1 -1
  24. package/dist/package/hooks/use-tab-editor.d.ts +3 -5
  25. package/dist/package/hooks/use-tab-manager.d.ts +2 -1
  26. package/dist/package/sync-local/SyncManager.d.ts +12 -0
  27. package/dist/package/sync-local/types/index.d.ts +4 -0
  28. package/dist/package/types.d.ts +7 -17
  29. package/dist/package/use-ddoc-editor.d.ts +0 -1
  30. package/dist/package/utils/colors.d.ts +3 -1
  31. package/dist/package/utils/document-styling.d.ts +3 -3
  32. package/dist/package/utils/heading-link.d.ts +23 -0
  33. package/dist/style.css +1 -1
  34. package/package.json +1 -1
  35. package/dist/package/components/inline-comment/comment-floating-container.d.ts +0 -1
  36. package/dist/package/components/inline-comment/comment-floating-layout.d.ts +0 -31
  37. package/dist/package/components/inline-comment/comment-input-field.d.ts +0 -3
  38. package/dist/package/components/inline-comment/comment-reply-input.d.ts +0 -7
  39. package/dist/package/components/inline-comment/constants.d.ts +0 -1
  40. package/dist/package/components/inline-comment/delete-confirm-overlay.d.ts +0 -10
  41. package/dist/package/components/inline-comment/floating-comment/comment-floating-container.d.ts +0 -3
  42. package/dist/package/components/inline-comment/floating-comment/draft-floating-card.d.ts +0 -3
  43. package/dist/package/components/inline-comment/floating-comment/floating-auth-prompt.d.ts +0 -1
  44. package/dist/package/components/inline-comment/floating-comment/floating-card-shell.d.ts +0 -3
  45. package/dist/package/components/inline-comment/floating-comment/index.d.ts +0 -1
  46. package/dist/package/components/inline-comment/floating-comment/thread-floating-card.d.ts +0 -3
  47. package/dist/package/components/inline-comment/floating-comment/types.d.ts +0 -32
  48. package/dist/package/components/inline-comment/floating-comment-layout-utils.d.ts +0 -78
  49. package/dist/package/components/inline-comment/resize-inline-comment-textarea.d.ts +0 -1
  50. package/dist/package/components/inline-comment/use-anchor-registry.d.ts +0 -34
  51. package/dist/package/components/inline-comment/use-comment-card.d.ts +0 -29
  52. package/dist/package/components/inline-comment/use-comment-list-container.d.ts +0 -17
  53. package/dist/package/components/inline-comment/use-ens-status.d.ts +0 -3
  54. package/dist/package/components/inline-comment/use-floating-card-state.d.ts +0 -36
  55. package/dist/package/components/inline-comment/use-floating-comment-card-layout.d.ts +0 -23
  56. package/dist/package/components/inline-comment/use-floating-comment-card-state.d.ts +0 -13
  57. package/dist/package/components/inline-comment/use-floating-layout-engine.d.ts +0 -26
  58. package/dist/package/extensions/comment/comment-decoration-plugin.d.ts +0 -67
  59. package/dist/package/stores/comment-store-provider.d.ts +0 -50
  60. package/dist/package/stores/comment-store.d.ts +0 -185
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.6-patch-001",
5
+ "version": "3.1.6-patch-002",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {
@@ -1 +0,0 @@
1
- export { CommentFloatingContainer } from './floating-comment';
@@ -1,31 +0,0 @@
1
- export declare const FLOATING_COMMENT_CARD_GAP = 12;
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
- }
25
- export declare const roundFloatingTranslateY: (translateY: number | null) => number | null;
26
- export declare const computeFloatingCommentLayout: ({ floatingCards, recomputeStartIndex, lastInvalidatedIndex, gap, }: {
27
- floatingCards: FloatingCardLayoutInput[];
28
- recomputeStartIndex: number;
29
- lastInvalidatedIndex: number;
30
- gap?: number;
31
- }) => FloatingLayoutResult;
@@ -1,3 +0,0 @@
1
- export declare const CommentInputField: ({ tabId }: {
2
- tabId?: string;
3
- }) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +0,0 @@
1
- interface CommentReplyInputProps {
2
- commentId: string;
3
- commentUsername?: string;
4
- replyCount: number;
5
- }
6
- export declare const CommentReplyInput: ({ commentId, replyCount, }: CommentReplyInputProps) => import("react/jsx-runtime").JSX.Element;
7
- 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;
@@ -1,3 +0,0 @@
1
- import { CommentFloatingContainerProps } from './types';
2
-
3
- export declare const CommentFloatingContainer: ({ editor, editorWrapperRef, scrollContainerRef, tabName, isHidden, }: CommentFloatingContainerProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,3 +0,0 @@
1
- import { DraftFloatingCardProps } from './types';
2
-
3
- export declare const DraftFloatingCard: ({ draft, isHidden, registerCardNode, }: DraftFloatingCardProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1 +0,0 @@
1
- export declare const FloatingAuthPrompt: () => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- import { FloatingCardShellProps } from './types';
2
-
3
- export declare const FloatingCardShell: import('react').ForwardRefExoticComponent<FloatingCardShellProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1 +0,0 @@
1
- export { CommentFloatingContainer } from './comment-floating-container';
@@ -1,3 +0,0 @@
1
- import { ThreadFloatingCardProps } from './types';
2
-
3
- export declare const ThreadFloatingCard: ({ thread, comment, tabName, isHidden, registerCardNode, }: ThreadFloatingCardProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,32 +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
- }
14
- export interface FloatingCardShellProps {
15
- floatingCardId: string;
16
- isHidden: boolean;
17
- isFocused: boolean;
18
- onFocus: () => void;
19
- children: ReactNode;
20
- }
21
- export interface DraftFloatingCardProps {
22
- draft: CommentFloatingDraftCard;
23
- isHidden: boolean;
24
- registerCardNode: RegisterCardNode;
25
- }
26
- export interface ThreadFloatingCardProps {
27
- thread: CommentFloatingThreadCard;
28
- comment: IComment | undefined;
29
- tabName: string;
30
- isHidden: boolean;
31
- registerCardNode: RegisterCardNode;
32
- }
@@ -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,3 +0,0 @@
1
- import { EnsStatus } from './types';
2
-
3
- export declare const useEnsStatus: (walletAddressOrName?: string | null) => EnsStatus;
@@ -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,67 +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
- /**
37
- * Analyze transaction changes to classify each active anchor's mutation status.
38
- *
39
- * This is the core transaction analysis function that determines
40
- * whether each anchor remains unchanged, gets edited, or is deleted.
41
- *
42
- * Classification rules (in order):
43
- * 1. Skip deleted or resolved anchors → 'unchanged'
44
- * 2. If anchor has no old position → 'unchanged'
45
- * 3. If no changed ranges touch the anchor → 'unchanged'
46
- * 4. If any changed range fully covers the anchor → 'deleted' (full-span replacement)
47
- * 5. If combined changed ranges fully cover the anchor → 'deleted' (multi-step removal)
48
- * 6. If anchor maps through transform → check if position or content changed:
49
- * a. If both unchanged → 'unchanged'
50
- * b. Otherwise → 'edited' (return new position and relative anchor)
51
- * 7. If mapping fails → 'deleted'
52
- */
53
- export declare function analyzeCommentAnchorTransactionChanges(anchors: CommentAnchor[], oldState: EditorState, newState: EditorState, transform: Transform): CommentAnchorTransactionChange[];
54
- export interface CommentDecorationOptions {
55
- getAnchors: () => CommentAnchor[];
56
- }
57
- export declare const CommentDecorationExtension: Extension<CommentDecorationOptions, any>;
58
- /**
59
- * Public helper functions for comment anchor creation and inspection.
60
- * These are consumed by the draft-creation flow and transaction-analysis layer.
61
- */
62
- export declare function createCommentAnchorFromEditor(editor: Editor, from: number, to: number): CommentAnchorRelativeRange | null;
63
- export declare function createCommentAnchorFromSelection(editor: Editor): CommentAnchorRelativeRange | null;
64
- export declare function triggerDecorationRebuild(editor: Editor): void;
65
- export declare function getCommentAtPosition(editor: Editor, pos: number, getAnchors: () => CommentAnchor[]): CommentAnchor | null;
66
- export declare function getCommentAnchorRange(editor: Editor, commentId: string, getAnchors: () => CommentAnchor[]): CommentAnchorRange | null;
67
- export {};
@@ -1,50 +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
- export {};