@fileverse-dev/ddoc 3.0.45-patch-20 → 3.0.45-patch-22

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 CHANGED
@@ -1,4 +1,4 @@
1
- import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-wPv4ZU7p.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-BOWgrubD.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
@@ -1,4 +1,4 @@
1
1
  import { CommentContextType, CommentProviderProps } from './types';
2
2
 
3
- export declare const CommentProvider: ({ children, editor, initialComments, setInitialComments, username, setUsername, activeCommentId, setActiveCommentId, focusCommentWithActiveId, onNewComment, onCommentReply, ensResolutionUrl, onResolveComment, onUnresolveComment, onDeleteComment, isConnected, connectViaWallet, isLoading, connectViaUsername, isDDocOwner, onInlineComment, onComment, setCommentDrawerOpen, }: CommentProviderProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const CommentProvider: ({ children, editor, initialComments, setInitialComments, username, setUsername, activeCommentId, setActiveCommentId, activeTabId, focusCommentWithActiveId, onNewComment, onCommentReply, ensResolutionUrl, onResolveComment, onUnresolveComment, onDeleteComment, isConnected, connectViaWallet, isLoading, connectViaUsername, isDDocOwner, onInlineComment, onComment, setCommentDrawerOpen, }: CommentProviderProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export declare const useComments: () => CommentContextType;
@@ -50,6 +50,7 @@ export interface CommentContextType extends CommentAccountProps {
50
50
  isCommentActive: boolean;
51
51
  isCommentResolved: boolean;
52
52
  ensResolutionUrl: string;
53
+ activeTabId: string;
53
54
  onCommentReply?: (activeCommentId: string, reply: IComment) => void;
54
55
  onComment?: () => void;
55
56
  setCommentDrawerOpen?: React.Dispatch<React.SetStateAction<boolean>>;
@@ -78,6 +79,7 @@ export interface CommentProviderProps extends CommentAccountProps {
78
79
  setUsername?: React.Dispatch<SetStateAction<string>>;
79
80
  activeCommentId: string | null;
80
81
  setActiveCommentId: React.Dispatch<React.SetStateAction<string | null>>;
82
+ activeTabId: string;
81
83
  focusCommentWithActiveId: (id: string) => void;
82
84
  ensResolutionUrl: string;
83
85
  onInlineComment?: () => void;
@@ -16,5 +16,7 @@ export interface DocumentMobileTabPanelProps {
16
16
  emoji?: string;
17
17
  }) => void;
18
18
  duplicateTab: (tabId: string) => void;
19
+ tabCommentCounts: Record<string, number>;
20
+ isPreviewMode: boolean;
19
21
  }
20
- export declare const DocumentMobileTabPanel: ({ tabs, activeTabId, setActiveTabId, editor, items, setItems, orientation, renameTab, duplicateTab, }: DocumentMobileTabPanelProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const DocumentMobileTabPanel: ({ tabs, activeTabId, setActiveTabId, editor, items, setItems, orientation, renameTab, duplicateTab, tabCommentCounts, isPreviewMode, }: DocumentMobileTabPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -25,10 +25,13 @@ export interface DocumentTabsSidebarProps {
25
25
  duplicateTab: (tabId: string) => void;
26
26
  orderTab: (destinationTabId: string, activeTabId: string) => void;
27
27
  ydoc: Y.Doc;
28
+ tabCommentCounts: Record<string, number>;
28
29
  }
29
- export declare const DocumentTabsSidebar: ({ tabs, activeTabId, setActiveTabId, showTOC, setShowTOC, hasToC, isPreviewMode, editor, items, setItems, orientation, createTab, renameTab, duplicateTab, orderTab, ydoc, }: DocumentTabsSidebarProps) => import("react/jsx-runtime").JSX.Element;
30
- export declare const DdocTab: ({ tab, handleEmojiChange, handleNameChange, onClick, editor, tocItem, setTocItems, orientation, activeTabId, duplicateTab, activeDragId, ydoc, }: {
30
+ export declare const DocumentTabsSidebar: ({ tabs, activeTabId, setActiveTabId, showTOC, setShowTOC, hasToC, isPreviewMode, editor, items, setItems, orientation, createTab, renameTab, duplicateTab, orderTab, ydoc, tabCommentCounts, }: DocumentTabsSidebarProps) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const DdocTab: ({ tab, tabIndex, tabCount, handleEmojiChange, handleNameChange, onClick, editor, tocItem, setTocItems, orientation, activeTabId, duplicateTab, activeDragId, ydoc, commentCount, moveTabUp, moveTabDown, isPreviewMode, }: {
31
32
  tab: Tab;
33
+ tabIndex: number;
34
+ tabCount: number;
32
35
  handleNameChange: (tabId: string, nextName: string) => void;
33
36
  handleEmojiChange: (tabId: string, nextEmoji: string) => void;
34
37
  onClick: () => void;
@@ -40,4 +43,8 @@ export declare const DdocTab: ({ tab, handleEmojiChange, handleNameChange, onCli
40
43
  duplicateTab: (tabId: string) => void;
41
44
  activeDragId: string | null;
42
45
  ydoc: Y.Doc;
46
+ commentCount: number;
47
+ moveTabUp: () => void;
48
+ moveTabDown: () => void;
49
+ isPreviewMode: boolean;
43
50
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,10 @@
1
1
  import { EmojiPickerListCategoryHeaderProps, EmojiPickerListEmojiProps, EmojiPickerListRowProps, EmojiPicker as EmojiPickerPrimitive } from 'frimousse';
2
2
 
3
- export declare const TabEmojiPicker: ({ emoji, setEmoji, isEditing, }: {
3
+ export declare const TabEmojiPicker: ({ emoji, setEmoji, isEditing, openPickerTrigger, }: {
4
4
  emoji: string;
5
5
  setEmoji: (emoji: string) => void;
6
6
  isEditing: boolean;
7
+ openPickerTrigger?: number;
7
8
  }) => import("react/jsx-runtime").JSX.Element;
8
9
  export declare function EmojiPicker({ className, ...props }: React.ComponentProps<typeof EmojiPickerPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
9
10
  export declare function EmojiPickerSearch({ className, ...props }: React.ComponentProps<typeof EmojiPickerPrimitive.Search>): import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,48 @@
1
- export declare const SortableTabItem: (props: any) => import("react/jsx-runtime").JSX.Element;
2
- export declare const TabItem: ({ tabId, name, emoji, onNameChange, onEmojiChange, onClick, isActive, onDuplicate, dragHandleProps, hideContentMenu, }: {
1
+ import { ComponentProps, HTMLAttributes } from 'react';
2
+ import { LucideIcon } from '@fileverse/ui';
3
+
4
+ export interface TabItemProps {
3
5
  tabId: string;
4
6
  name: string;
5
7
  emoji: string;
8
+ commentCount?: number;
6
9
  onNameChange: (name: string) => void;
7
10
  onEmojiChange: (emoji: string) => void;
8
11
  onClick: () => void;
9
12
  isActive: boolean;
10
13
  onDuplicate?: (id: string) => void;
11
- dragHandleProps?: any;
14
+ dragHandleProps?: HTMLAttributes<HTMLDivElement>;
12
15
  hideContentMenu?: boolean;
13
- }) => import("react/jsx-runtime").JSX.Element;
16
+ showOutline?: boolean;
17
+ handleShowOutline?: (value: boolean) => void;
18
+ canMoveUp?: boolean;
19
+ canMoveDown?: boolean;
20
+ onMoveUp?: () => void;
21
+ onMoveDown?: () => void;
22
+ isPreviewMode: boolean;
23
+ }
24
+ interface SortableTabItemProps extends Omit<TabItemProps, 'dragHandleProps'> {
25
+ id: string;
26
+ }
27
+ interface TabContextMenuItem {
28
+ id: string;
29
+ label: string;
30
+ icon: ComponentProps<typeof LucideIcon>['name'];
31
+ onSelect?: () => void;
32
+ visible?: boolean;
33
+ closeOnSelect?: boolean;
34
+ }
35
+ interface TabContextMenuProps {
36
+ sections: TabContextMenuItem[][];
37
+ }
38
+ export declare const SortableTabItem: (props: SortableTabItemProps) => import("react/jsx-runtime").JSX.Element;
39
+ export declare const TabItem: ({ tabId, name, emoji, commentCount, onNameChange, onEmojiChange, onClick, isActive, onDuplicate, dragHandleProps, hideContentMenu, showOutline, handleShowOutline, canMoveUp, canMoveDown, onMoveUp, onMoveDown, isPreviewMode, }: TabItemProps) => import("react/jsx-runtime").JSX.Element;
14
40
  export declare const TabDragPreview: ({ name, emoji, }: {
15
41
  name: string;
16
42
  emoji: string;
17
43
  }) => import("react/jsx-runtime").JSX.Element;
44
+ export declare const TabContextMenuAction: ({ item, }: {
45
+ item: TabContextMenuItem;
46
+ }) => import("react/jsx-runtime").JSX.Element;
47
+ export declare const TabContextMenu: ({ sections }: TabContextMenuProps) => import("react/jsx-runtime").JSX.Element;
48
+ export {};
@@ -5,6 +5,8 @@ export interface Tab {
5
5
  showOutline: boolean;
6
6
  emoji: string | null;
7
7
  }
8
+ export declare const DEFAULT_TAB_ID = "default-tab";
9
+ export declare const DEFAULT_TAB_NAME = "Tab 1";
8
10
  export declare function migrateDefaultFragmentToTab(doc: Y.Doc, targetTabId: string): void;
9
11
  export declare function deriveTabsFromEncodedState(yjsEncodedState: string, doc: Y.Doc): {
10
12
  tabList: Tab[];
@@ -1,3 +1,3 @@
1
1
  import { DocumentOutlineProps } from './types';
2
2
 
3
- export declare const DocumentOutline: ({ editor, hasToC, items, setItems, showTOC, setShowTOC, isPreviewMode, orientation, tabs, setTabs, activeTabId, setActiveTabId, createTab, renameTab, duplicateTab, orderTab, ydoc, }: DocumentOutlineProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const DocumentOutline: ({ editor, hasToC, items, setItems, showTOC, setShowTOC, isPreviewMode, orientation, tabs, setTabs, activeTabId, setActiveTabId, createTab, renameTab, duplicateTab, orderTab, ydoc, tabCommentCounts, }: DocumentOutlineProps) => import("react/jsx-runtime").JSX.Element;
@@ -44,4 +44,5 @@ export interface DocumentOutlineProps {
44
44
  duplicateTab: (tabId: string) => void;
45
45
  orderTab: (destinationTabId: string, activeTabId: string) => void;
46
46
  ydoc: Y.Doc;
47
+ tabCommentCounts: Record<string, number>;
47
48
  }
@@ -47,6 +47,7 @@ export interface CommentStorage {
47
47
  }
48
48
  export interface IComment {
49
49
  id?: string;
50
+ tabId?: string;
50
51
  username?: string;
51
52
  reactions?: {
52
53
  count: number;