@fileverse-dev/ddoc 3.0.55-patch-6 → 3.0.55-pill-1
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/README.md +1 -5
- package/dist/index.es.js +39062 -41770
- package/dist/package/components/editor-toolbar.d.ts +1 -6
- package/dist/package/components/editor-utils.d.ts +2 -2
- package/dist/package/components/import-export-button.d.ts +1 -8
- package/dist/package/components/inline-comment/context/comment-context.d.ts +1 -1
- package/dist/package/components/inline-comment/context/types.d.ts +0 -2
- package/dist/package/components/toc/document-outline.d.ts +1 -1
- package/dist/package/components/toc/types.d.ts +2 -25
- package/dist/package/extensions/comment/comment.d.ts +0 -1
- package/dist/package/sync-local/useSyncMachine.d.ts +2 -1
- package/dist/package/types.d.ts +3 -12
- package/dist/package/use-ddoc-editor.d.ts +12 -29
- package/dist/style.css +1 -1
- package/package.json +2 -6
- package/dist/package/components/export-modal.d.ts +0 -22
- package/dist/package/components/preview-export-trigger.d.ts +0 -24
- package/dist/package/components/tabs/confirm-delete-modal.d.ts +0 -19
- package/dist/package/components/tabs/document-mobile-tab-panel.d.ts +0 -27
- package/dist/package/components/tabs/document-tabs-sidebar.d.ts +0 -60
- package/dist/package/components/tabs/tab-emoji-picker.d.ts +0 -16
- package/dist/package/components/tabs/tab-item.d.ts +0 -58
- package/dist/package/components/tabs/utils/tab-utils.d.ts +0 -21
- package/dist/package/components/toc/document-outline-toc-panel.d.ts +0 -5
- package/dist/package/components/toc/memorized-toc.d.ts +0 -3
- package/dist/package/hooks/use-ddoc-export.d.ts +0 -24
- package/dist/package/hooks/use-tab-editor.d.ts +0 -62
- package/dist/package/hooks/use-tab-manager.d.ts +0 -32
- package/dist/package/hooks/use-tab-metadata-history.d.ts +0 -14
- package/dist/package/hooks/use-yjs-setup.d.ts +0 -27
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.0.55-
|
|
5
|
+
"version": "3.0.55-pill-1",
|
|
6
6
|
"main": "dist/index.es.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
8
8
|
"exports": {
|
|
@@ -120,13 +120,9 @@
|
|
|
120
120
|
"yjs": "^13.6.15"
|
|
121
121
|
},
|
|
122
122
|
"peerDependencies": {
|
|
123
|
-
"@dnd-kit/core": ">=6.3.1",
|
|
124
|
-
"@dnd-kit/sortable": ">=10.0.0",
|
|
125
|
-
"@dnd-kit/utilities": ">=3.2.2",
|
|
126
123
|
"@fileverse/crypto": ">=0.0.21",
|
|
127
124
|
"@fileverse/ui": ">=5.0.0",
|
|
128
125
|
"framer-motion": ">=11.2.10",
|
|
129
|
-
"frimousse": ">=0.3.0",
|
|
130
126
|
"viem": ">=2.13.8"
|
|
131
127
|
},
|
|
132
128
|
"devDependencies": {
|
|
@@ -156,4 +152,4 @@
|
|
|
156
152
|
"typescript": "^5.2.2",
|
|
157
153
|
"vite": "^5.0.0"
|
|
158
154
|
}
|
|
159
|
-
}
|
|
155
|
+
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
interface ExportFormatOption {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
}
|
|
5
|
-
interface ExportTabOption {
|
|
6
|
-
id: string;
|
|
7
|
-
label: string;
|
|
8
|
-
}
|
|
9
|
-
interface ExportAsModalProps {
|
|
10
|
-
open: boolean;
|
|
11
|
-
onOpenChange: (open: boolean) => void;
|
|
12
|
-
onExport?: (data: {
|
|
13
|
-
format: string;
|
|
14
|
-
tab: string;
|
|
15
|
-
}) => void;
|
|
16
|
-
formatOptions: ExportFormatOption[];
|
|
17
|
-
tabOptions: ExportTabOption[];
|
|
18
|
-
initialFormat?: string;
|
|
19
|
-
initialTab?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare const ExportAsModal: ({ open, onOpenChange, onExport, formatOptions, tabOptions, initialFormat, initialTab, }: ExportAsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { Tab } from './tabs/utils/tab-utils';
|
|
3
|
-
import { DdocProps } from '../types';
|
|
4
|
-
|
|
5
|
-
import * as Y from 'yjs';
|
|
6
|
-
interface PreviewModeExportTriggerProps {
|
|
7
|
-
editor: Editor | null;
|
|
8
|
-
ydoc: Y.Doc;
|
|
9
|
-
tabs: Tab[];
|
|
10
|
-
onRegisterExportTrigger?: (trigger: ((format?: string, name?: string) => void) | null) => void;
|
|
11
|
-
onError?: (errorString: string) => void;
|
|
12
|
-
ipfsImageUploadFn?: DdocProps['ipfsImageUploadFn'];
|
|
13
|
-
onMarkdownExport?: DdocProps['onMarkdownExport'];
|
|
14
|
-
onMarkdownImport?: DdocProps['onMarkdownImport'];
|
|
15
|
-
onPdfExport?: DdocProps['onPdfExport'];
|
|
16
|
-
onHtmlExport?: DdocProps['onHtmlExport'];
|
|
17
|
-
onTxtExport?: DdocProps['onTxtExport'];
|
|
18
|
-
ipfsImageFetchFn?: DdocProps['ipfsImageFetchFn'];
|
|
19
|
-
onDocxImport?: DdocProps['onDocxImport'];
|
|
20
|
-
fetchV1ImageFn?: DdocProps['fetchV1ImageFn'];
|
|
21
|
-
isConnected?: DdocProps['isConnected'];
|
|
22
|
-
}
|
|
23
|
-
declare const PreviewModeExportTrigger: ({ editor, ydoc, tabs, onRegisterExportTrigger, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, isConnected, }: PreviewModeExportTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export { PreviewModeExportTrigger };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
interface IConfirmDeleteModalProps {
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
onConfirm: () => void;
|
|
6
|
-
isOpen: boolean;
|
|
7
|
-
documentTitle: string;
|
|
8
|
-
isLoading: boolean;
|
|
9
|
-
text?: string | ReactNode;
|
|
10
|
-
title?: string;
|
|
11
|
-
overlayClasses?: string;
|
|
12
|
-
noOverlay?: boolean;
|
|
13
|
-
primaryLabel?: string;
|
|
14
|
-
secondaryLabel?: string;
|
|
15
|
-
hasCloseIcon?: boolean;
|
|
16
|
-
hideTitleIcon?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare const ConfirmDeleteModal: ({ onClose, onConfirm, isOpen, isLoading, title, overlayClasses, noOverlay, hasCloseIcon, primaryLabel, hideTitleIcon, }: IConfirmDeleteModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { DocumentOutlineProps } from '../toc/types';
|
|
3
|
-
import { Tab } from './utils/tab-utils';
|
|
4
|
-
|
|
5
|
-
export interface DocumentMobileTabPanelProps {
|
|
6
|
-
tabs: Tab[];
|
|
7
|
-
setTabs: Dispatch<SetStateAction<Tab[]>>;
|
|
8
|
-
activeTabId: string;
|
|
9
|
-
setActiveTabId: (id: string) => void;
|
|
10
|
-
editor: DocumentOutlineProps['editor'];
|
|
11
|
-
items: DocumentOutlineProps['items'];
|
|
12
|
-
setItems: DocumentOutlineProps['setItems'];
|
|
13
|
-
orientation?: DocumentOutlineProps['orientation'];
|
|
14
|
-
renameTab: (tabId: string, payload: {
|
|
15
|
-
newName?: string;
|
|
16
|
-
emoji?: string;
|
|
17
|
-
}) => void;
|
|
18
|
-
createTab: () => void;
|
|
19
|
-
duplicateTab: (tabId: string) => void;
|
|
20
|
-
deleteTab?: (tabId: string) => void;
|
|
21
|
-
tabCommentCounts: Record<string, number>;
|
|
22
|
-
isPreviewMode: boolean;
|
|
23
|
-
tabConfig?: DocumentOutlineProps['tabConfig'];
|
|
24
|
-
isVersionHistoryMode: boolean;
|
|
25
|
-
isConnected?: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare const DocumentMobileTabPanel: ({ tabs, activeTabId, setActiveTabId, editor, items, setItems, orientation, renameTab, createTab, duplicateTab, deleteTab, tabCommentCounts, isPreviewMode, tabConfig, isVersionHistoryMode, isConnected, }: DocumentMobileTabPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { DocumentOutlineProps } from '../toc/types';
|
|
3
|
-
import { Tab } from './utils/tab-utils';
|
|
4
|
-
import { Editor } from '@tiptap/core';
|
|
5
|
-
|
|
6
|
-
import * as Y from 'yjs';
|
|
7
|
-
export interface DocumentTabsSidebarProps {
|
|
8
|
-
tabs: Tab[];
|
|
9
|
-
setTabs: React.Dispatch<React.SetStateAction<Tab[]>>;
|
|
10
|
-
activeTabId: string;
|
|
11
|
-
setActiveTabId: (id: string) => void;
|
|
12
|
-
showTOC: DocumentOutlineProps['showTOC'];
|
|
13
|
-
setShowTOC: DocumentOutlineProps['setShowTOC'];
|
|
14
|
-
hasToC: DocumentOutlineProps['hasToC'];
|
|
15
|
-
isPreviewMode: DocumentOutlineProps['isPreviewMode'];
|
|
16
|
-
editor: DocumentOutlineProps['editor'];
|
|
17
|
-
items: DocumentOutlineProps['items'];
|
|
18
|
-
setItems: DocumentOutlineProps['setItems'];
|
|
19
|
-
orientation?: DocumentOutlineProps['orientation'];
|
|
20
|
-
createTab: () => void;
|
|
21
|
-
renameTab: (tabId: string, payload: {
|
|
22
|
-
newName?: string;
|
|
23
|
-
emoji?: string;
|
|
24
|
-
}) => void;
|
|
25
|
-
duplicateTab: (tabId: string) => void;
|
|
26
|
-
orderTab: (destinationTabId: string, activeTabId: string) => void;
|
|
27
|
-
ydoc: Y.Doc;
|
|
28
|
-
tabCommentCounts: Record<string, number>;
|
|
29
|
-
tabSectionContainer?: HTMLElement;
|
|
30
|
-
isVersionHistoryMode?: boolean;
|
|
31
|
-
tabConfig?: DocumentOutlineProps['tabConfig'];
|
|
32
|
-
deleteTab?: (tabId: string) => void;
|
|
33
|
-
isConnected?: boolean;
|
|
34
|
-
}
|
|
35
|
-
export declare const DocumentTabsSidebar: ({ tabSectionContainer, ...rest }: DocumentTabsSidebarProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
36
|
-
export declare const TabSidebar: ({ tabs, activeTabId, setActiveTabId, showTOC, setShowTOC, hasToC, isPreviewMode, editor, items, setItems, orientation, createTab, renameTab, duplicateTab, orderTab, tabCommentCounts, isVersionHistoryMode, tabConfig, deleteTab, isConnected, }: DocumentTabsSidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export declare const DdocTab: ({ tab, tabIndex, tabCount, handleEmojiChange, handleNameChange, onClick, editor, tocItem, setTocItems, orientation, activeTabId, duplicateTab, commentCount, moveTabUp, moveTabDown, isPreviewMode, isVersionHistoryMode, tabConfig, onDelete, showOutline, onShowOutlineChange, isConnected, }: {
|
|
38
|
-
tab: Tab;
|
|
39
|
-
tabIndex: number;
|
|
40
|
-
tabCount: number;
|
|
41
|
-
handleNameChange: (tabId: string, nextName: string, nextEmoji?: string) => void;
|
|
42
|
-
handleEmojiChange: (tabId: string, nextEmoji: string) => void;
|
|
43
|
-
onClick: () => void;
|
|
44
|
-
editor: Editor;
|
|
45
|
-
tocItem: DocumentOutlineProps["items"];
|
|
46
|
-
setTocItems: DocumentOutlineProps["setItems"];
|
|
47
|
-
orientation: DocumentOutlineProps["orientation"];
|
|
48
|
-
activeTabId: string;
|
|
49
|
-
duplicateTab: (tabId: string) => void;
|
|
50
|
-
commentCount: number;
|
|
51
|
-
moveTabUp: () => void;
|
|
52
|
-
moveTabDown: () => void;
|
|
53
|
-
isPreviewMode: boolean;
|
|
54
|
-
isVersionHistoryMode?: boolean;
|
|
55
|
-
tabConfig?: DocumentOutlineProps["tabConfig"];
|
|
56
|
-
onDelete?: (tab: Tab) => void;
|
|
57
|
-
showOutline: boolean;
|
|
58
|
-
onShowOutlineChange: (value: boolean) => void;
|
|
59
|
-
isConnected?: boolean;
|
|
60
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EmojiPickerListCategoryHeaderProps, EmojiPickerListEmojiProps, EmojiPickerListRowProps, EmojiPicker as EmojiPickerPrimitive } from 'frimousse';
|
|
2
|
-
|
|
3
|
-
export declare const TabEmojiPicker: ({ emoji, setEmoji, isEditing, openPickerTrigger, disableEmoji, }: {
|
|
4
|
-
emoji: string;
|
|
5
|
-
setEmoji: (emoji: string) => void;
|
|
6
|
-
isEditing: boolean;
|
|
7
|
-
openPickerTrigger?: number;
|
|
8
|
-
disableEmoji: boolean;
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare function EmojiPicker({ className, ...props }: React.ComponentProps<typeof EmojiPickerPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare function EmojiPickerSearch({ className, ...props }: React.ComponentProps<typeof EmojiPickerPrimitive.Search>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export declare function EmojiPickerRow({ children, ...props }: EmojiPickerListRowProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare function EmojiPickerEmoji({ emoji, className, ...props }: EmojiPickerListEmojiProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export declare function EmojiPickerCategoryHeader({ category, ...props }: EmojiPickerListCategoryHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export declare function EmojiPickerContent({ className, ...props }: React.ComponentProps<typeof EmojiPickerPrimitive.Viewport>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare function EmojiPickerFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { ComponentProps, HTMLAttributes } from 'react';
|
|
2
|
-
import { LucideIcon } from '@fileverse/ui';
|
|
3
|
-
|
|
4
|
-
export interface TabItemProps {
|
|
5
|
-
tabId: string;
|
|
6
|
-
name: string;
|
|
7
|
-
emoji: string;
|
|
8
|
-
commentCount?: number;
|
|
9
|
-
onNameChange: (name: string, emoji?: string) => void;
|
|
10
|
-
onEmojiChange: (emoji: string) => void;
|
|
11
|
-
onClick: () => void;
|
|
12
|
-
isActive: boolean;
|
|
13
|
-
onDuplicate?: (id: string) => void;
|
|
14
|
-
dragHandleProps?: HTMLAttributes<HTMLDivElement>;
|
|
15
|
-
hideContentMenu?: boolean;
|
|
16
|
-
showOutline?: boolean;
|
|
17
|
-
handleShowOutline?: (value: boolean) => void;
|
|
18
|
-
canMoveUp?: boolean;
|
|
19
|
-
canMoveDown?: boolean;
|
|
20
|
-
onMoveUp?: () => void;
|
|
21
|
-
onMoveDown?: () => void;
|
|
22
|
-
isPreviewMode: boolean;
|
|
23
|
-
isVersionHistoryMode?: boolean;
|
|
24
|
-
onCopyLink?: () => void;
|
|
25
|
-
onDelete?: () => void;
|
|
26
|
-
isConnected?: boolean;
|
|
27
|
-
}
|
|
28
|
-
interface SortableTabItemProps extends Omit<TabItemProps, 'dragHandleProps'> {
|
|
29
|
-
id: string;
|
|
30
|
-
}
|
|
31
|
-
interface TabContextMenuItem {
|
|
32
|
-
id: string;
|
|
33
|
-
label: string;
|
|
34
|
-
icon: ComponentProps<typeof LucideIcon>['name'];
|
|
35
|
-
onSelect?: () => void;
|
|
36
|
-
visible?: boolean;
|
|
37
|
-
closeOnSelect?: boolean;
|
|
38
|
-
textClassName?: string;
|
|
39
|
-
iconStroke?: string;
|
|
40
|
-
tooltipText?: string;
|
|
41
|
-
disabled?: boolean;
|
|
42
|
-
}
|
|
43
|
-
interface TabContextMenuProps {
|
|
44
|
-
sections: TabContextMenuItem[][];
|
|
45
|
-
popoverSide?: 'top' | 'bottom';
|
|
46
|
-
popoverClassName?: string;
|
|
47
|
-
}
|
|
48
|
-
export declare const SortableTabItem: (props: SortableTabItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
-
export declare const TabItem: ({ tabId, name, emoji, commentCount, onNameChange, onEmojiChange, onClick, isActive, onDuplicate, dragHandleProps, hideContentMenu, showOutline, handleShowOutline, canMoveUp, canMoveDown, onMoveUp, onMoveDown, isPreviewMode, isVersionHistoryMode, onCopyLink, onDelete, isConnected, }: TabItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
-
export declare const TabDragPreview: ({ name, emoji, }: {
|
|
51
|
-
name: string;
|
|
52
|
-
emoji: string;
|
|
53
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
export declare const TabContextMenuAction: ({ item, }: {
|
|
55
|
-
item: TabContextMenuItem;
|
|
56
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
57
|
-
export declare const TabContextMenu: ({ sections, popoverSide, popoverClassName, }: TabContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
58
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as Y from 'yjs';
|
|
2
|
-
export interface Tab {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
emoji: string | null;
|
|
6
|
-
}
|
|
7
|
-
export declare const DEFAULT_TAB_ID = "default";
|
|
8
|
-
export declare const DEFAULT_TAB_NAME = "Tab 1";
|
|
9
|
-
export declare function deriveTabsFromEncodedState(yjsEncodedState: string, doc: Y.Doc, options?: {
|
|
10
|
-
createDefaultTabIfMissing?: boolean;
|
|
11
|
-
}): {
|
|
12
|
-
tabList: Tab[];
|
|
13
|
-
activeTabId: string;
|
|
14
|
-
};
|
|
15
|
-
export declare function getTabsYdocNodes(doc: Y.Doc): {
|
|
16
|
-
root: Y.Map<unknown>;
|
|
17
|
-
order: Y.Array<string>;
|
|
18
|
-
tabs: Y.Map<Y.Map<string | null>>;
|
|
19
|
-
activeTab: Y.Text;
|
|
20
|
-
};
|
|
21
|
-
export declare function cloneFragmentContent(fragment: Y.XmlFragment): (Y.XmlElement | Y.XmlText)[];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { DocumentOutlineProps } from './types';
|
|
2
|
-
|
|
3
|
-
type DocumentOutlineTOCPanelProps = Pick<DocumentOutlineProps, 'editor' | 'hasToC' | 'items' | 'setItems' | 'showTOC' | 'setShowTOC' | 'isPreviewMode' | 'orientation'>;
|
|
4
|
-
export declare const DocumentOutlineTOCPanel: ({ editor, hasToC, items, setItems, showTOC, setShowTOC, isPreviewMode, orientation, }: DocumentOutlineTOCPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
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, name }: {
|
|
19
|
-
format: string;
|
|
20
|
-
tab: string;
|
|
21
|
-
name?: string;
|
|
22
|
-
}) => void;
|
|
23
|
-
};
|
|
24
|
-
export { useDdocExport };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
2
|
-
import { DdocProps } from '../types';
|
|
3
|
-
import { AnyExtension, Editor } from '@tiptap/react';
|
|
4
|
-
import { ToCItemType } from '../components/toc/types';
|
|
5
|
-
import { IConnectConf } from '../sync-local/useSyncMachine';
|
|
6
|
-
|
|
7
|
-
import * as Y from 'yjs';
|
|
8
|
-
interface UseTabEditorArgs {
|
|
9
|
-
ydoc: Y.Doc;
|
|
10
|
-
isVersionMode?: boolean;
|
|
11
|
-
hasTabState?: boolean;
|
|
12
|
-
versionId?: string;
|
|
13
|
-
isPreviewMode?: boolean;
|
|
14
|
-
initialContent: DdocProps['initialContent'];
|
|
15
|
-
enableCollaboration?: boolean;
|
|
16
|
-
collabConfig?: DdocProps['collabConfig'];
|
|
17
|
-
isReady?: boolean;
|
|
18
|
-
awareness?: any;
|
|
19
|
-
disableInlineComment?: boolean;
|
|
20
|
-
onCommentInteraction?: DdocProps['onCommentInteraction'];
|
|
21
|
-
onError?: DdocProps['onError'];
|
|
22
|
-
ipfsImageUploadFn?: DdocProps['ipfsImageUploadFn'];
|
|
23
|
-
metadataProxyUrl?: string;
|
|
24
|
-
onCopyHeadingLink?: DdocProps['onCopyHeadingLink'];
|
|
25
|
-
ipfsImageFetchFn?: DdocProps['ipfsImageFetchFn'];
|
|
26
|
-
fetchV1ImageFn?: DdocProps['fetchV1ImageFn'];
|
|
27
|
-
isConnected?: boolean;
|
|
28
|
-
activeModel?: DdocProps['activeModel'];
|
|
29
|
-
maxTokens?: number;
|
|
30
|
-
isAIAgentEnabled?: boolean;
|
|
31
|
-
setCharacterCount?: DdocProps['setCharacterCount'];
|
|
32
|
-
setWordCount?: DdocProps['setWordCount'];
|
|
33
|
-
setIsContentLoading: Dispatch<SetStateAction<boolean>>;
|
|
34
|
-
setIsCollabContentLoading: Dispatch<SetStateAction<boolean>>;
|
|
35
|
-
unFocused?: boolean;
|
|
36
|
-
zoomLevel?: string;
|
|
37
|
-
isPresentationMode?: boolean;
|
|
38
|
-
onInvalidContentError?: DdocProps['onInvalidContentError'];
|
|
39
|
-
ignoreCorruptedData?: boolean;
|
|
40
|
-
onCollaboratorChange?: DdocProps['onCollaboratorChange'];
|
|
41
|
-
onConnect: (connectConfig: IConnectConf) => void;
|
|
42
|
-
hasCollabContentInitialised?: boolean;
|
|
43
|
-
initialiseYjsIndexedDbProvider: () => Promise<void>;
|
|
44
|
-
externalExtensions?: Record<string, AnyExtension>;
|
|
45
|
-
isContentLoading?: boolean;
|
|
46
|
-
activeTabId: string;
|
|
47
|
-
theme?: 'dark' | 'light';
|
|
48
|
-
editorRef?: MutableRefObject<Editor | null>;
|
|
49
|
-
}
|
|
50
|
-
export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, initialContent, enableCollaboration, collabConfig, isReady, awareness, disableInlineComment, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect, hasCollabContentInitialised, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, theme, editorRef, }: UseTabEditorArgs) => {
|
|
51
|
-
editor: Editor | null;
|
|
52
|
-
ref: import('react').RefObject<HTMLDivElement>;
|
|
53
|
-
slides: string[];
|
|
54
|
-
setSlides: Dispatch<SetStateAction<string[]>>;
|
|
55
|
-
tocItems: ToCItemType[];
|
|
56
|
-
setTocItems: Dispatch<SetStateAction<ToCItemType[]>>;
|
|
57
|
-
activeCommentId: string | null;
|
|
58
|
-
setActiveCommentId: Dispatch<SetStateAction<string | null>>;
|
|
59
|
-
focusCommentWithActiveId: (id: string) => void;
|
|
60
|
-
isContentLoading: boolean | undefined;
|
|
61
|
-
};
|
|
62
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { DdocProps } from '../types';
|
|
3
|
-
import { Tab } from '../components/tabs/utils/tab-utils';
|
|
4
|
-
import * as Y from 'yjs';
|
|
5
|
-
interface UseTabManagerArgs {
|
|
6
|
-
ydoc: Y.Doc;
|
|
7
|
-
initialContent: DdocProps['initialContent'];
|
|
8
|
-
enableCollaboration: DdocProps['enableCollaboration'];
|
|
9
|
-
isDDocOwner: boolean;
|
|
10
|
-
createDefaultTabIfMissing: boolean;
|
|
11
|
-
shouldSyncActiveTab: boolean;
|
|
12
|
-
defaultTabId?: string;
|
|
13
|
-
onVersionHistoryActiveTabChange?: (tabId: string | null) => void;
|
|
14
|
-
getEditor?: () => Editor | null;
|
|
15
|
-
}
|
|
16
|
-
export declare const getNewTabId: () => string;
|
|
17
|
-
export declare const useTabManager: ({ ydoc, initialContent, enableCollaboration, isDDocOwner, createDefaultTabIfMissing, shouldSyncActiveTab, defaultTabId, onVersionHistoryActiveTabChange, getEditor, }: UseTabManagerArgs) => {
|
|
18
|
-
tabs: Tab[];
|
|
19
|
-
hasTabState: boolean;
|
|
20
|
-
activeTabId: string;
|
|
21
|
-
setTabs: import('react').Dispatch<import('react').SetStateAction<Tab[]>>;
|
|
22
|
-
setActiveTabId: (id: string) => void;
|
|
23
|
-
createTab: () => string;
|
|
24
|
-
deleteTab: (tabId: string) => void;
|
|
25
|
-
renameTab: (tabId: string, { newName, emoji }: {
|
|
26
|
-
newName?: string;
|
|
27
|
-
emoji?: string;
|
|
28
|
-
}) => void;
|
|
29
|
-
duplicateTab: (tabId: string) => string | undefined;
|
|
30
|
-
orderTab: (destinationTabId: string, movedTabId: string) => void;
|
|
31
|
-
};
|
|
32
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as Y from 'yjs';
|
|
2
|
-
interface ApplyRenameArgs {
|
|
3
|
-
tabId: string;
|
|
4
|
-
newName?: string;
|
|
5
|
-
emoji?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const useTabMetadataHistory: (ydoc: Y.Doc) => {
|
|
8
|
-
applyRename: ({ tabId, newName, emoji }: ApplyRenameArgs) => {
|
|
9
|
-
tabNotFound: boolean;
|
|
10
|
-
};
|
|
11
|
-
undo: () => boolean;
|
|
12
|
-
redo: () => boolean;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { JSONContent } from '@tiptap/react';
|
|
2
|
-
import { DdocProps } from '../types';
|
|
3
|
-
import * as Y from 'yjs';
|
|
4
|
-
interface UseYjsSetupArgs {
|
|
5
|
-
onChange?: (updatedDocContent: string | JSONContent, updateChunk: string) => void;
|
|
6
|
-
enableIndexeddbSync?: boolean;
|
|
7
|
-
ddocId?: string;
|
|
8
|
-
enableCollaboration?: boolean;
|
|
9
|
-
onIndexedDbError?: (error: Error) => void;
|
|
10
|
-
onCollabError?: DdocProps['onCollabError'];
|
|
11
|
-
onCollaborationConnectCallback?: DdocProps['onCollaborationConnectCallback'];
|
|
12
|
-
onCollaborationCommit?: DdocProps['onCollaborationCommit'];
|
|
13
|
-
onFetchCommitContent?: DdocProps['onFetchCommitContent'];
|
|
14
|
-
onCollabSessionTermination?: () => void;
|
|
15
|
-
onUnMergedUpdates?: (state: boolean) => void;
|
|
16
|
-
}
|
|
17
|
-
export declare const useYjsSetup: ({ onChange, enableIndexeddbSync, ddocId, enableCollaboration, onIndexedDbError, onCollabError, onCollaborationConnectCallback, onCollaborationCommit, onFetchCommitContent, onCollabSessionTermination, onUnMergedUpdates, }: UseYjsSetupArgs) => {
|
|
18
|
-
ydoc: Y.Doc;
|
|
19
|
-
onConnect: (connectConfig: import('../sync-local/useSyncMachine').IConnectConf) => void;
|
|
20
|
-
isReady: boolean;
|
|
21
|
-
terminateSession: () => void;
|
|
22
|
-
awareness: any;
|
|
23
|
-
hasCollabContentInitialised: boolean;
|
|
24
|
-
initialiseYjsIndexedDbProvider: () => Promise<void>;
|
|
25
|
-
refreshYjsIndexedDbProvider: () => Promise<void>;
|
|
26
|
-
};
|
|
27
|
-
export {};
|