@fileverse-dev/ddoc 3.2.2-sg-6 → 3.2.2-sg-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.
@@ -0,0 +1 @@
1
+ export declare const ALL_TABS_OPTION_ID = "__all_tabs__";
@@ -0,0 +1,35 @@
1
+ import { IComment } from '../../extensions/comment';
2
+
3
+ interface DrawerSelectOption {
4
+ id: string;
5
+ label: string;
6
+ }
7
+ interface CommentDrawerDesktopProps {
8
+ activeCommentId: string | null;
9
+ commentType: string;
10
+ commentTypeOptions: DrawerSelectOption[];
11
+ filteredComments: IComment[];
12
+ isCollaborationEnabled: boolean;
13
+ isCommentTypeSelectOpen: boolean;
14
+ isConnected: boolean;
15
+ isNavbarVisible: boolean;
16
+ isOpen: boolean;
17
+ isPresentationMode: boolean;
18
+ isPreviewMode: boolean;
19
+ isTabSelectOpen: boolean;
20
+ newCommentTabId: string;
21
+ onClose: () => void;
22
+ onCommentFocus: (commentId: string, tabId?: string) => void;
23
+ onCommentTypeChange: (commentType: string) => void;
24
+ onCommentTypeSelectOpenChange: (open: boolean) => void;
25
+ onReset: () => void;
26
+ onTabChange: (tabId: string) => void;
27
+ onTabSelectOpenChange: (open: boolean) => void;
28
+ sectionLabel: string;
29
+ selectedTab: string;
30
+ selectedTabLabel: string;
31
+ tabList: DrawerSelectOption[];
32
+ tabNameById: Record<string, string>;
33
+ }
34
+ export declare const CommentDrawerDesktop: ({ activeCommentId, commentType, commentTypeOptions, filteredComments, isCollaborationEnabled, isCommentTypeSelectOpen, isConnected, isNavbarVisible, isOpen, isPresentationMode, isPreviewMode, isTabSelectOpen, newCommentTabId, onClose, onCommentFocus, onCommentTypeChange, onCommentTypeSelectOpenChange, onReset, onTabChange, onTabSelectOpenChange, sectionLabel, selectedTab, selectedTabLabel, tabList, tabNameById, }: CommentDrawerDesktopProps) => import("react/jsx-runtime").JSX.Element;
35
+ export {};
@@ -0,0 +1,43 @@
1
+ import { IComment } from '../../extensions/comment';
2
+ import { InlineCommentDraft, SuggestionFloatingDraftCard } from './context/types';
3
+
4
+ interface CommentDrawerMobileProps {
5
+ activeCommentId: string | null;
6
+ activeDraft: InlineCommentDraft | null;
7
+ activeDraftId: string | null;
8
+ activeSuggestionDraftCard: SuggestionFloatingDraftCard | null;
9
+ canGoToNextMobileComment: boolean;
10
+ canGoToPreviousMobileComment: boolean;
11
+ comments: IComment[];
12
+ isCollaborationEnabled: boolean;
13
+ isCommentMobileFocused: boolean;
14
+ isConnected: boolean;
15
+ isDiscardCommentOverlayVisible: boolean;
16
+ isDiscardSuggestionOverlayVisible: boolean;
17
+ isInlineDraftOpen: boolean;
18
+ isMobileDrawerVisible: boolean;
19
+ isNavbarVisible: boolean;
20
+ isPresentationMode: boolean;
21
+ mobileActiveCommentsCount: number;
22
+ mobileDraftRef: React.RefObject<HTMLDivElement>;
23
+ mobileFocusedCommentIndex: number;
24
+ onAttemptCloseNewComment: () => void;
25
+ onAttemptCloseSuggestionDraft: () => void;
26
+ onCancelDiscardComment: () => void;
27
+ onCancelDiscardSuggestion: () => void;
28
+ onCloseDrawer: () => void;
29
+ onCommentFocus: (commentId: string, tabId?: string) => void;
30
+ onCreateComment: () => void;
31
+ onDiscardSuggestionDraft: () => void;
32
+ onFocusSuggestionDraft: () => void;
33
+ onNextMobileComment: () => void;
34
+ onPreviousMobileComment: () => void;
35
+ onStartNewMobileComment: () => void;
36
+ onSubmitSuggestionDraft: () => void;
37
+ onUpdateInlineDraftText: (draftId: string, text: string) => void;
38
+ onViewAllComments: () => void;
39
+ tabNameById: Record<string, string>;
40
+ username: string | null;
41
+ }
42
+ export declare const CommentDrawerMobile: ({ activeCommentId, activeDraft, activeDraftId, activeSuggestionDraftCard, canGoToNextMobileComment, canGoToPreviousMobileComment, comments, isCollaborationEnabled, isCommentMobileFocused, isConnected, isDiscardCommentOverlayVisible, isDiscardSuggestionOverlayVisible, isInlineDraftOpen, isMobileDrawerVisible, isNavbarVisible, isPresentationMode, mobileActiveCommentsCount, mobileDraftRef, mobileFocusedCommentIndex, onAttemptCloseNewComment, onAttemptCloseSuggestionDraft, onCancelDiscardComment, onCancelDiscardSuggestion, onCloseDrawer, onCommentFocus, onCreateComment, onDiscardSuggestionDraft, onFocusSuggestionDraft, onNextMobileComment, onPreviousMobileComment, onStartNewMobileComment, onSubmitSuggestionDraft, onUpdateInlineDraftText, onViewAllComments, tabNameById, username, }: CommentDrawerMobileProps) => import("react/jsx-runtime").JSX.Element;
43
+ export {};
@@ -0,0 +1,15 @@
1
+ import { InlineCommentDraft } from './context/types';
2
+
3
+ interface MobileInlineCommentProps {
4
+ activeDraft: InlineCommentDraft | null;
5
+ activeDraftId: string | null;
6
+ isDiscardCommentOverlayVisible: boolean;
7
+ mobileDraftRef: React.RefObject<HTMLDivElement>;
8
+ onAttemptClose: () => void;
9
+ onCancelDiscard: () => void;
10
+ onConfirmDiscard: () => void;
11
+ onSubmit: () => void;
12
+ onUpdateDraftText: (draftId: string, text: string) => void;
13
+ }
14
+ export declare const MobileInlineComment: ({ activeDraft, activeDraftId, isDiscardCommentOverlayVisible, mobileDraftRef, onAttemptClose, onCancelDiscard, onConfirmDiscard, onSubmit, onUpdateDraftText, }: MobileInlineCommentProps) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import { SuggestionFloatingDraftCard } from './context/types';
2
+
3
+ interface MobileSuggestionDraftProps {
4
+ activeSuggestionDraftCard: SuggestionFloatingDraftCard;
5
+ isConnected: boolean;
6
+ isDiscardSuggestionOverlayVisible: boolean;
7
+ username: string | null;
8
+ onAttemptClose: () => void;
9
+ onCancelDiscard: () => void;
10
+ onConfirmDiscard: () => void;
11
+ onFocusSuggestionText: () => void;
12
+ onSubmit: () => void;
13
+ }
14
+ export declare const MobileSuggestionDraft: ({ activeSuggestionDraftCard, isConnected, isDiscardSuggestionOverlayVisible, username, onAttemptClose, onCancelDiscard, onConfirmDiscard, onFocusSuggestionText, onSubmit, }: MobileSuggestionDraftProps) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -50,6 +50,7 @@ export interface CommentCardProps extends IComment {
50
50
  activeCommentId?: string;
51
51
  isDisabled?: boolean;
52
52
  isCommentOwner?: boolean;
53
+ canResolveComment?: boolean;
53
54
  version?: string;
54
55
  emptyComment?: boolean;
55
56
  isFocused?: boolean;
@@ -0,0 +1,22 @@
1
+ import { SuggestionFloatingDraftCard } from './context/types';
2
+
3
+ interface UseCommentDrawerDraftsProps {
4
+ selectedCommentTabId: string;
5
+ setOpenReplyId: (commentId: string | null) => void;
6
+ }
7
+ export declare const useCommentDrawerDrafts: ({ selectedCommentTabId, setOpenReplyId, }: UseCommentDrawerDraftsProps) => {
8
+ activeDraft: import('./context/types').InlineCommentDraft | null;
9
+ activeDraftId: string | null;
10
+ activeSuggestionDraftCard: SuggestionFloatingDraftCard | null;
11
+ handleCreateComment: () => void;
12
+ handleDiscardSuggestionDraft: () => void;
13
+ handleStartNewMobileComment: () => void;
14
+ handleSubmitSuggestionDraft: () => void;
15
+ isDiscardCommentOverlayVisible: boolean;
16
+ isDiscardSuggestionOverlayVisible: boolean;
17
+ isInlineDraftOpen: boolean;
18
+ setIsDiscardCommentOverlayVisible: import('react').Dispatch<import('react').SetStateAction<boolean>>;
19
+ setIsDiscardSuggestionOverlayVisible: import('react').Dispatch<import('react').SetStateAction<boolean>>;
20
+ updateInlineDraftText: (draftId: string, value: string) => void;
21
+ };
22
+ export {};
@@ -0,0 +1,40 @@
1
+ import { IComment } from '../../extensions/comment';
2
+ import { Tab } from '../tabs/utils/tab-utils';
3
+
4
+ export declare const commentTypeOptions: {
5
+ id: string;
6
+ label: string;
7
+ }[];
8
+ interface UseCommentDrawerFiltersProps {
9
+ activeTabId: string;
10
+ comments: IComment[];
11
+ tabs: Tab[];
12
+ }
13
+ export declare const useCommentDrawerFilters: ({ activeTabId, comments, tabs, }: UseCommentDrawerFiltersProps) => {
14
+ closeFilterSelects: () => void;
15
+ commentType: string;
16
+ commentTypeOptions: {
17
+ id: string;
18
+ label: string;
19
+ }[];
20
+ filteredComments: IComment[];
21
+ handleCommentTypeSelectOpenChange: (open: boolean) => void;
22
+ handleTabSelectOpenChange: (open: boolean) => void;
23
+ isCommentTypeSelectOpen: boolean;
24
+ isTabSelectOpen: boolean;
25
+ resetFilters: () => void;
26
+ sectionLabel: string;
27
+ selectedCommentTabId: string;
28
+ selectedTab: string;
29
+ selectedTabLabel: string;
30
+ setCommentType: import('react').Dispatch<import('react').SetStateAction<string>>;
31
+ setTab: import('react').Dispatch<import('react').SetStateAction<string>>;
32
+ tabList: {
33
+ id: string;
34
+ label: string;
35
+ }[];
36
+ tabNameById: {
37
+ [k: string]: string;
38
+ };
39
+ };
40
+ export {};
@@ -0,0 +1,17 @@
1
+ import { IComment } from '../../extensions/comment';
2
+
3
+ interface UseCommentDrawerFocusProps {
4
+ activeTabId: string;
5
+ comments: IComment[];
6
+ focusCommentInEditor: (commentId: string, options?: {
7
+ source?: 'explicit-ui';
8
+ }) => void;
9
+ isBelow1280px: boolean;
10
+ onTabChange?: (tabId: string) => void;
11
+ setOpenReplyId: (commentId: string | null) => void;
12
+ }
13
+ export declare const useCommentDrawerFocus: ({ activeTabId, comments, focusCommentInEditor, isBelow1280px, onTabChange, setOpenReplyId, }: UseCommentDrawerFocusProps) => {
14
+ clearPendingCommentFocus: () => void;
15
+ handleCommentFocus: (commentId: string, commentTabId?: string) => void;
16
+ };
17
+ export {};
@@ -0,0 +1,13 @@
1
+ interface UseCommentDrawerLifecycleProps {
2
+ activeSuggestionDraftCard: unknown;
3
+ closeFilterSelects: () => void;
4
+ isBelow1280px: boolean;
5
+ isCommentMobileFocused: boolean;
6
+ isInlineDraftOpen: boolean;
7
+ isOpen: boolean;
8
+ onClose: () => void;
9
+ setIsDiscardCommentOverlayVisible: (visible: boolean) => void;
10
+ setIsDiscardSuggestionOverlayVisible: (visible: boolean) => void;
11
+ }
12
+ export declare const useCommentDrawerLifecycle: ({ activeSuggestionDraftCard, closeFilterSelects, isBelow1280px, isCommentMobileFocused, isInlineDraftOpen, isOpen, onClose, setIsDiscardCommentOverlayVisible, setIsDiscardSuggestionOverlayVisible, }: UseCommentDrawerLifecycleProps) => void;
13
+ export {};
@@ -0,0 +1,20 @@
1
+ import { RefObject } from 'react';
2
+ import { IComment } from '../../extensions/comment';
3
+
4
+ interface UseMobileCommentNavigationProps {
5
+ comments: IComment[];
6
+ mobileDrawerRef: RefObject<HTMLDivElement>;
7
+ onCommentFocus: (commentId: string, tabId?: string) => void;
8
+ openReplyId: string | null;
9
+ setOpenReplyId: (commentId: string | null) => void;
10
+ }
11
+ export declare const useMobileCommentNavigation: ({ comments, mobileDrawerRef, onCommentFocus, openReplyId, setOpenReplyId, }: UseMobileCommentNavigationProps) => {
12
+ canGoToNextMobileComment: boolean;
13
+ canGoToPreviousMobileComment: boolean;
14
+ handleNextMobileComment: () => void;
15
+ handlePreviousMobileComment: () => void;
16
+ handleViewAllComments: () => void;
17
+ mobileActiveCommentsCount: number;
18
+ mobileFocusedCommentIndex: number;
19
+ };
20
+ export {};
@@ -258,6 +258,7 @@ export interface CommentStoreState {
258
258
  editReplyContent: (commentId: string, replyId: string, content: string) => void;
259
259
  handleAddReply: (activeCommentId: string, replyContent: string, replyCallback?: (activeCommentId: string, reply: IComment) => void) => void;
260
260
  focusCommentInEditor: (commentId: string, options?: FocusCommentInEditorOptions) => void;
261
+ focusSuggestionDraftInEditor: (suggestionId: string) => void;
261
262
  onPrevComment: () => void;
262
263
  onNextComment: () => void;
263
264
  getEnsStatus: (walletAddress: string, setEnsStatus: React.Dispatch<React.SetStateAction<EnsStatus>>) => void;
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.2.2-sg-6",
5
+ "version": "3.2.2-sg-7",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {