@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
|
@@ -1,10 +1,8 @@
|
|
|
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';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, }: {
|
|
5
|
+
declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, }: {
|
|
8
6
|
editor: Editor | null;
|
|
9
7
|
onError?: (errorString: string) => void;
|
|
10
8
|
zoomLevel: string;
|
|
@@ -25,8 +23,5 @@ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavb
|
|
|
25
23
|
file: File;
|
|
26
24
|
}>;
|
|
27
25
|
isConnected?: boolean;
|
|
28
|
-
tabs: Tab[];
|
|
29
|
-
ydoc: Y.Doc;
|
|
30
|
-
onRegisterExportTrigger?: ((trigger: ((format?: string, name?: string) => void) | null) => void) | undefined;
|
|
31
26
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
32
27
|
export default TiptapToolBar;
|
|
@@ -6,7 +6,7 @@ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
|
|
6
6
|
export interface IEditorToolElement {
|
|
7
7
|
icon: any;
|
|
8
8
|
title: string;
|
|
9
|
-
onClick: (
|
|
9
|
+
onClick: () => void;
|
|
10
10
|
isActive: boolean;
|
|
11
11
|
group?: string;
|
|
12
12
|
isNew?: boolean;
|
|
@@ -55,7 +55,7 @@ export declare const IMG_UPLOAD_SETTINGS: {
|
|
|
55
55
|
errorMsg: string;
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
|
-
export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, }: {
|
|
58
|
+
export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, isConnected, }: {
|
|
59
59
|
editor: Editor | null;
|
|
60
60
|
onError?: (errorString: string) => void;
|
|
61
61
|
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { IEditorToolElement } from './editor-utils';
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
import { Tab } from './tabs/utils/tab-utils';
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
declare const ImportExportButton: ({ fileExportsOpen, setFileExportsOpen, exportOptions, importOptions, setDropdownOpen, editor, tabs, ydoc, onRegisterExportTrigger, }: {
|
|
3
|
+
declare const ImportExportButton: ({ fileExportsOpen, setFileExportsOpen, exportOptions, importOptions, setDropdownOpen, }: {
|
|
7
4
|
fileExportsOpen: boolean;
|
|
8
5
|
setFileExportsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
9
6
|
exportOptions: (IEditorToolElement | null)[];
|
|
10
7
|
importOptions: (IEditorToolElement | null)[];
|
|
11
8
|
setDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
|
-
editor: Editor | null;
|
|
13
|
-
tabs: Tab[];
|
|
14
|
-
ydoc: Y.Doc;
|
|
15
|
-
onRegisterExportTrigger?: ((trigger: ((format?: string, name?: string) => void) | null) => void) | undefined;
|
|
16
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
10
|
export { ImportExportButton };
|
|
@@ -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,
|
|
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;
|
|
4
4
|
export declare const useComments: () => CommentContextType;
|
|
@@ -50,7 +50,6 @@ export interface CommentContextType extends CommentAccountProps {
|
|
|
50
50
|
isCommentActive: boolean;
|
|
51
51
|
isCommentResolved: boolean;
|
|
52
52
|
ensResolutionUrl: string;
|
|
53
|
-
activeTabId: string;
|
|
54
53
|
onCommentReply?: (activeCommentId: string, reply: IComment) => void;
|
|
55
54
|
onComment?: () => void;
|
|
56
55
|
setCommentDrawerOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
@@ -79,7 +78,6 @@ export interface CommentProviderProps extends CommentAccountProps {
|
|
|
79
78
|
setUsername?: React.Dispatch<SetStateAction<string>>;
|
|
80
79
|
activeCommentId: string | null;
|
|
81
80
|
setActiveCommentId: React.Dispatch<React.SetStateAction<string | null>>;
|
|
82
|
-
activeTabId: string;
|
|
83
81
|
focusCommentWithActiveId: (id: string) => void;
|
|
84
82
|
ensResolutionUrl: string;
|
|
85
83
|
onInlineComment?: () => void;
|
|
@@ -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,
|
|
3
|
+
export declare const DocumentOutline: ({ editor, hasToC, items, setItems, showTOC, setShowTOC, isPreviewMode, orientation, }: DocumentOutlineProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
|
2
|
-
import {
|
|
3
|
-
import { Tab } from '../tabs/utils/tab-utils';
|
|
2
|
+
import { SetStateAction } from 'react';
|
|
4
3
|
|
|
5
|
-
import * as Y from 'yjs';
|
|
6
4
|
export interface ToCItemType {
|
|
7
5
|
id: string;
|
|
8
6
|
level: number;
|
|
@@ -29,28 +27,7 @@ export interface DocumentOutlineProps {
|
|
|
29
27
|
items: ToCItemType[];
|
|
30
28
|
setItems: (items: ToCItemType[] | ((prev: ToCItemType[]) => ToCItemType[])) => void;
|
|
31
29
|
showTOC: boolean | undefined;
|
|
32
|
-
setShowTOC: Dispatch<SetStateAction<boolean>> | undefined;
|
|
30
|
+
setShowTOC: React.Dispatch<SetStateAction<boolean>> | undefined;
|
|
33
31
|
isPreviewMode: boolean;
|
|
34
32
|
orientation?: 'portrait' | 'landscape';
|
|
35
|
-
tabs: Tab[];
|
|
36
|
-
setTabs: Dispatch<SetStateAction<Tab[]>>;
|
|
37
|
-
activeTabId: string;
|
|
38
|
-
setActiveTabId: (id: string) => void;
|
|
39
|
-
createTab: () => void;
|
|
40
|
-
renameTab: (tabId: string, payload: {
|
|
41
|
-
newName?: string;
|
|
42
|
-
emoji?: string;
|
|
43
|
-
}) => void;
|
|
44
|
-
duplicateTab: (tabId: string) => void;
|
|
45
|
-
orderTab: (destinationTabId: string, activeTabId: string) => void;
|
|
46
|
-
ydoc: Y.Doc;
|
|
47
|
-
tabCommentCounts: Record<string, number>;
|
|
48
|
-
tabSectionContainer?: HTMLElement;
|
|
49
|
-
isVersionHistoryMode?: boolean;
|
|
50
|
-
tabConfig?: {
|
|
51
|
-
onCopyTabLink?: (tabId: string) => void;
|
|
52
|
-
defaultTabId?: string;
|
|
53
|
-
};
|
|
54
|
-
deleteTab?: (tabId: string) => void;
|
|
55
|
-
isConnected?: boolean;
|
|
56
33
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SyncMachineContext } from '.';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface IConnectConf {
|
|
4
4
|
username?: string;
|
|
5
5
|
roomKey: string;
|
|
6
6
|
roomId: string;
|
|
@@ -36,3 +36,4 @@ export declare const useSyncMachine: (config: Partial<SyncMachineContext>) => {
|
|
|
36
36
|
data: any;
|
|
37
37
|
}, import('xstate').BaseActionObject, import('xstate').ServiceMap>>;
|
|
38
38
|
};
|
|
39
|
+
export {};
|
package/dist/package/types.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export interface IDocCollabUsers {
|
|
|
11
11
|
name: string;
|
|
12
12
|
isEns: string;
|
|
13
13
|
color: string;
|
|
14
|
+
isTyping?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export type InlineCommentData = {
|
|
16
17
|
inlineCommentText: string;
|
|
@@ -71,17 +72,6 @@ export interface DocumentStyling {
|
|
|
71
72
|
orientation?: 'portrait' | 'landscape';
|
|
72
73
|
}
|
|
73
74
|
export interface DdocProps extends CommentAccountProps {
|
|
74
|
-
tabConfig?: {
|
|
75
|
-
onCopyTabLink?: (tabId: string) => void;
|
|
76
|
-
defaultTabId?: string;
|
|
77
|
-
};
|
|
78
|
-
versionHistoryState?: {
|
|
79
|
-
enabled: boolean;
|
|
80
|
-
versionId: string;
|
|
81
|
-
content: string | string[];
|
|
82
|
-
onActiveTabChange?: (tabId: string | null) => void;
|
|
83
|
-
};
|
|
84
|
-
tabSectionContainer?: HTMLElement;
|
|
85
75
|
isCollabDocumentPublished?: boolean;
|
|
86
76
|
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
87
77
|
url: string;
|
|
@@ -107,7 +97,6 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
107
97
|
setIsCommentSectionOpen?: React.Dispatch<SetStateAction<boolean>>;
|
|
108
98
|
inlineCommentData?: InlineCommentData;
|
|
109
99
|
setInlineCommentData?: React.Dispatch<React.SetStateAction<InlineCommentData>>;
|
|
110
|
-
theme?: 'dark' | 'light';
|
|
111
100
|
zoomLevel: string;
|
|
112
101
|
setZoomLevel: React.Dispatch<SetStateAction<string>>;
|
|
113
102
|
isNavbarVisible: boolean;
|
|
@@ -202,6 +191,8 @@ export interface IUser {
|
|
|
202
191
|
name: string;
|
|
203
192
|
color: string;
|
|
204
193
|
isEns: boolean;
|
|
194
|
+
isTyping?: boolean;
|
|
195
|
+
clientId?: number;
|
|
205
196
|
}
|
|
206
197
|
export { type IComment };
|
|
207
198
|
export interface IpfsImageUploadResponse {
|
|
@@ -1,37 +1,20 @@
|
|
|
1
1
|
import { DdocProps } from './types';
|
|
2
|
-
import {
|
|
2
|
+
import { ToCItemType } from './components/toc/types';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
refreshYjsIndexedDbProvider: () => Promise<void>;
|
|
8
|
-
terminateSession: () => void;
|
|
4
|
+
import * as Y from 'yjs';
|
|
5
|
+
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, onChange, onCollaboratorChange, onCommentInteraction, onError, setCharacterCount, setWordCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, collabConfig, onIndexedDbError, disableInlineComment, ...rest }: Partial<DdocProps>) => {
|
|
6
|
+
editor: import('@tiptap/core').Editor | null;
|
|
9
7
|
isContentLoading: boolean;
|
|
10
|
-
tabs: import('./components/tabs/utils/tab-utils').Tab[];
|
|
11
|
-
hasTabState: boolean;
|
|
12
|
-
isVersionMode: boolean;
|
|
13
|
-
activeTabId: string;
|
|
14
|
-
setTabs: import('react').Dispatch<import('react').SetStateAction<import('./components/tabs/utils/tab-utils').Tab[]>>;
|
|
15
|
-
setActiveTabId: (id: string) => void;
|
|
16
|
-
createTab: () => string;
|
|
17
|
-
deleteTab: (tabId: string) => void;
|
|
18
|
-
renameTab: (tabId: string, { newName, emoji }: {
|
|
19
|
-
newName?: string;
|
|
20
|
-
emoji?: string;
|
|
21
|
-
}) => void;
|
|
22
|
-
duplicateTab: (tabId: string) => string | undefined;
|
|
23
|
-
orderTab: (destinationTabId: string, movedTabId: string) => void;
|
|
24
|
-
onConnect: (connectConfig: import('./sync-local/useSyncMachine').IConnectConf) => void;
|
|
25
|
-
isReady: boolean;
|
|
26
|
-
hasCollabContentInitialised: boolean;
|
|
27
|
-
initialiseYjsIndexedDbProvider: () => Promise<void>;
|
|
28
|
-
editor: Editor | null;
|
|
29
8
|
ref: import('react').RefObject<HTMLDivElement>;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
tocItems: import('./components/toc/types').ToCItemType[];
|
|
33
|
-
setTocItems: import('react').Dispatch<import('react').SetStateAction<import('./components/toc/types').ToCItemType[]>>;
|
|
9
|
+
ydoc: Y.Doc;
|
|
10
|
+
refreshYjsIndexedDbProvider: () => Promise<void>;
|
|
34
11
|
activeCommentId: string | null;
|
|
35
12
|
setActiveCommentId: import('react').Dispatch<import('react').SetStateAction<string | null>>;
|
|
36
13
|
focusCommentWithActiveId: (id: string) => void;
|
|
14
|
+
slides: string[];
|
|
15
|
+
setSlides: import('react').Dispatch<import('react').SetStateAction<string[]>>;
|
|
16
|
+
tocItems: ToCItemType[];
|
|
17
|
+
setTocItems: import('react').Dispatch<import('react').SetStateAction<ToCItemType[]>>;
|
|
18
|
+
terminateSession: () => void;
|
|
19
|
+
awareness: any;
|
|
37
20
|
};
|