@fileverse-dev/ddoc 3.0.45-patch-21 → 3.0.45-patch-30

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-CYbWD8RM.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-CuEStokt.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
@@ -1,8 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { Editor } from '@tiptap/react';
3
3
  import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
4
+ import { Tab } from './tabs/utils/tab-utils';
4
5
 
5
- declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, }: {
6
+ import * as Y from 'yjs';
7
+ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, }: {
6
8
  editor: Editor | null;
7
9
  onError?: (errorString: string) => void;
8
10
  zoomLevel: string;
@@ -23,5 +25,7 @@ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavb
23
25
  file: File;
24
26
  }>;
25
27
  isConnected?: boolean;
28
+ tabs: Tab[];
29
+ ydoc: Y.Doc;
26
30
  }) => import("react/jsx-runtime").JSX.Element;
27
31
  export default TiptapToolBar;
@@ -1,3 +1,11 @@
1
+ interface ExportFormatOption {
2
+ id: string;
3
+ label: string;
4
+ }
5
+ interface ExportTabOption {
6
+ id: string;
7
+ label: string;
8
+ }
1
9
  interface ExportAsModalProps {
2
10
  open: boolean;
3
11
  onOpenChange: (open: boolean) => void;
@@ -5,6 +13,10 @@ interface ExportAsModalProps {
5
13
  format: string;
6
14
  tab: string;
7
15
  }) => void;
16
+ formatOptions: ExportFormatOption[];
17
+ tabOptions: ExportTabOption[];
18
+ initialFormat?: string;
19
+ initialTab?: string;
8
20
  }
9
- export declare const ExportAsModal: ({ open, onOpenChange, onExport, }: ExportAsModalProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const ExportAsModal: ({ open, onOpenChange, onExport, formatOptions, tabOptions, initialFormat, initialTab, }: ExportAsModalProps) => import("react/jsx-runtime").JSX.Element;
10
22
  export {};
@@ -1,10 +1,16 @@
1
1
  import { IEditorToolElement } from './editor-utils';
2
+ import { Editor } from '@tiptap/react';
3
+ import { Tab } from './tabs/utils/tab-utils';
2
4
 
3
- declare const ImportExportButton: ({ fileExportsOpen, setFileExportsOpen, exportOptions, importOptions, setDropdownOpen, }: {
5
+ import * as Y from 'yjs';
6
+ declare const ImportExportButton: ({ fileExportsOpen, setFileExportsOpen, exportOptions, importOptions, setDropdownOpen, editor, tabs, ydoc, }: {
4
7
  fileExportsOpen: boolean;
5
8
  setFileExportsOpen: React.Dispatch<React.SetStateAction<boolean>>;
6
9
  exportOptions: (IEditorToolElement | null)[];
7
10
  importOptions: (IEditorToolElement | null)[];
8
11
  setDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
12
+ editor: Editor | null;
13
+ tabs: Tab[];
14
+ ydoc: Y.Doc;
9
15
  }) => import("react/jsx-runtime").JSX.Element;
10
16
  export { ImportExportButton };
@@ -17,5 +17,6 @@ export interface DocumentMobileTabPanelProps {
17
17
  }) => void;
18
18
  duplicateTab: (tabId: string) => void;
19
19
  tabCommentCounts: Record<string, number>;
20
+ isPreviewMode: boolean;
20
21
  }
21
- export declare const DocumentMobileTabPanel: ({ tabs, activeTabId, setActiveTabId, editor, items, setItems, orientation, renameTab, duplicateTab, tabCommentCounts, }: 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;
@@ -28,8 +28,10 @@ export interface DocumentTabsSidebarProps {
28
28
  tabCommentCounts: Record<string, number>;
29
29
  }
30
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, handleEmojiChange, handleNameChange, onClick, editor, tocItem, setTocItems, orientation, activeTabId, duplicateTab, activeDragId, ydoc, commentCount, }: {
31
+ export declare const DdocTab: ({ tab, tabIndex, tabCount, handleEmojiChange, handleNameChange, onClick, editor, tocItem, setTocItems, orientation, activeTabId, duplicateTab, activeDragId, ydoc, commentCount, moveTabUp, moveTabDown, isPreviewMode, }: {
32
32
  tab: Tab;
33
+ tabIndex: number;
34
+ tabCount: number;
33
35
  handleNameChange: (tabId: string, nextName: string) => void;
34
36
  handleEmojiChange: (tabId: string, nextEmoji: string) => void;
35
37
  onClick: () => void;
@@ -42,4 +44,7 @@ export declare const DdocTab: ({ tab, handleEmojiChange, handleNameChange, onCli
42
44
  activeDragId: string | null;
43
45
  ydoc: Y.Doc;
44
46
  commentCount: number;
47
+ moveTabUp: () => void;
48
+ moveTabDown: () => void;
49
+ isPreviewMode: boolean;
45
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,5 +1,7 @@
1
- export declare const SortableTabItem: (props: any) => import("react/jsx-runtime").JSX.Element;
2
- export declare const TabItem: ({ tabId, name, emoji, commentCount, 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;
@@ -9,10 +11,38 @@ export declare const TabItem: ({ tabId, name, emoji, commentCount, onNameChange,
9
11
  onClick: () => void;
10
12
  isActive: boolean;
11
13
  onDuplicate?: (id: string) => void;
12
- dragHandleProps?: any;
14
+ dragHandleProps?: HTMLAttributes<HTMLDivElement>;
13
15
  hideContentMenu?: boolean;
14
- }) => 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;
15
40
  export declare const TabDragPreview: ({ name, emoji, }: {
16
41
  name: string;
17
42
  emoji: string;
18
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 {};
@@ -0,0 +1,23 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { IEditorToolElement } from '../components/editor-utils';
3
+ import { Tab } from '../components/tabs/utils/tab-utils';
4
+
5
+ import * as Y from 'yjs';
6
+ interface UseDdocExportArgs {
7
+ editor: Editor | null;
8
+ tabs: Tab[];
9
+ ydoc: Y.Doc;
10
+ exportOptions: (IEditorToolElement | null)[];
11
+ }
12
+ declare const useDdocExport: ({ editor, tabs, ydoc, exportOptions, }: UseDdocExportArgs) => {
13
+ getOptionFormat: (title: string) => "" | "md" | "pdf" | "html" | "txt";
14
+ formatSelectOptions: {
15
+ id: string;
16
+ label: string;
17
+ }[];
18
+ handleExport: ({ format, tab }: {
19
+ format: string;
20
+ tab: string;
21
+ }) => void;
22
+ };
23
+ export { useDdocExport };
@@ -1,7 +1,12 @@
1
1
  import { DdocProps } from './types';
2
+ import { Tab } from './components/tabs/utils/tab-utils';
2
3
 
3
4
  declare const PreviewDdocEditor: import('react').ForwardRefExoticComponent<DdocProps & {
4
5
  contentClassName?: string;
5
6
  isLoading?: boolean;
7
+ onSnapshotHydrated?: (data: {
8
+ activeTabId: string;
9
+ tabs: Tab[];
10
+ }) => void;
6
11
  } & import('react').RefAttributes<unknown>>;
7
12
  export { PreviewDdocEditor };