@fileverse-dev/ddoc 2.1.4 → 2.1.5-patch-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 +94 -92
- package/dist/index.es.js +33187 -31477
- package/dist/package/components/editor-bubble-menu/props.d.ts +1 -0
- package/dist/package/components/editor-bubble-menu/types.d.ts +1 -0
- package/dist/package/components/editor-toolbar.d.ts +2 -1
- package/dist/package/components/editor-utils.d.ts +2 -1
- package/dist/package/components/inline-comment/context/types.d.ts +8 -1
- package/dist/package/components/link-preview-card.d.ts +12 -0
- package/dist/package/components/presentation-mode/presentation-mode.d.ts +2 -1
- package/dist/package/components/presentation-mode/preview-panel.d.ts +1 -6
- package/dist/package/extensions/action-button/action-button-node-view.d.ts +1 -1
- package/dist/package/extensions/default-extension.d.ts +1 -1
- package/dist/package/extensions/link-preview/link-preview.d.ts +7 -0
- package/dist/package/extensions/resizable-media/resizable-media-menu-util.d.ts +4 -1
- package/dist/package/hooks/use-headless-editor.d.ts +1 -0
- package/dist/package/types.d.ts +4 -0
- package/dist/package/use-ddoc-editor.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
@@ -42,6 +42,7 @@ export declare const bubbleMenuProps: (props: EditorBubbleMenuProps) => {
|
|
42
42
|
}) => boolean) | null | undefined;
|
43
43
|
activeCommentId: string | null;
|
44
44
|
isPreviewMode: boolean;
|
45
|
+
disableInlineComment: boolean;
|
45
46
|
onError?: (errorString: string) => void;
|
46
47
|
zoomLevel: string;
|
47
48
|
setIsCommentSectionOpen?: (isOpen: boolean) => void;
|
@@ -11,6 +11,7 @@ export interface BubbleMenuItem {
|
|
11
11
|
export type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
|
12
12
|
activeCommentId: string | null;
|
13
13
|
isPreviewMode: boolean;
|
14
|
+
disableInlineComment: boolean;
|
14
15
|
onError?: (errorString: string) => void;
|
15
16
|
zoomLevel: string;
|
16
17
|
setIsCommentSectionOpen?: (isOpen: boolean) => void;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { default as React } from 'react';
|
2
2
|
import { Editor } from '@tiptap/react';
|
3
3
|
|
4
|
-
declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, secureImageUploadUrl, onMarkdownExport, onMarkdownImport, }: {
|
4
|
+
declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, secureImageUploadUrl, onMarkdownExport, onMarkdownImport, onPdfExport, }: {
|
5
5
|
editor: Editor;
|
6
6
|
onError?: (errorString: string) => void;
|
7
7
|
zoomLevel: string;
|
@@ -11,5 +11,6 @@ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavb
|
|
11
11
|
secureImageUploadUrl?: string;
|
12
12
|
onMarkdownExport?: () => void;
|
13
13
|
onMarkdownImport?: () => void;
|
14
|
+
onPdfExport?: () => void;
|
14
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
15
16
|
export default TiptapToolBar;
|
@@ -27,12 +27,13 @@ export declare const IMG_UPLOAD_SETTINGS: {
|
|
27
27
|
errorMsg: string;
|
28
28
|
};
|
29
29
|
};
|
30
|
-
export declare const useEditorToolbar: ({ editor, onError, secureImageUploadUrl, onMarkdownExport, onMarkdownImport, }: {
|
30
|
+
export declare const useEditorToolbar: ({ editor, onError, secureImageUploadUrl, onMarkdownExport, onMarkdownImport, onPdfExport, }: {
|
31
31
|
editor: Editor;
|
32
32
|
onError?: (errorString: string) => void;
|
33
33
|
secureImageUploadUrl?: string;
|
34
34
|
onMarkdownExport?: () => void;
|
35
35
|
onMarkdownImport?: () => void;
|
36
|
+
onPdfExport?: () => void;
|
36
37
|
}) => {
|
37
38
|
undoRedoTools: (IEditorToolElement | null)[];
|
38
39
|
toolbar: (IEditorToolElement | null)[];
|
@@ -38,7 +38,6 @@ export interface CommentContextType extends CommentAccountProps {
|
|
38
38
|
activeComment: IComment | undefined;
|
39
39
|
selectedText: string;
|
40
40
|
isCommentOpen: boolean;
|
41
|
-
onInlineCommentClick: (event: React.MouseEvent) => void;
|
42
41
|
handleInlineComment: () => void;
|
43
42
|
portalRef: React.RefObject<HTMLDivElement>;
|
44
43
|
buttonRef: React.RefObject<HTMLDivElement>;
|
@@ -51,6 +50,14 @@ export interface CommentContextType extends CommentAccountProps {
|
|
51
50
|
onCommentReply?: (activeCommentId: string, reply: IComment) => void;
|
52
51
|
onComment?: () => void;
|
53
52
|
setCommentDrawerOpen?: React.Dispatch<React.SetStateAction<boolean>>;
|
53
|
+
inlineCommentData: {
|
54
|
+
inlineCommentText: string;
|
55
|
+
handleClick: boolean;
|
56
|
+
};
|
57
|
+
setInlineCommentData: React.Dispatch<React.SetStateAction<{
|
58
|
+
inlineCommentText: string;
|
59
|
+
handleClick: boolean;
|
60
|
+
}>>;
|
54
61
|
}
|
55
62
|
export interface CommentProviderProps extends CommentAccountProps {
|
56
63
|
children: React.ReactNode;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export interface LinkPreviewData {
|
2
|
+
image: string;
|
3
|
+
title: string;
|
4
|
+
description: string;
|
5
|
+
favicon: string;
|
6
|
+
link: string;
|
7
|
+
}
|
8
|
+
export declare const LinkPreviewCard: ({ link, metadataProxyUrl, hoverEvent, }: {
|
9
|
+
link: string;
|
10
|
+
metadataProxyUrl: string;
|
11
|
+
hoverEvent: EventTarget;
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
@@ -13,6 +13,7 @@ interface PresentationModeProps {
|
|
13
13
|
onSlidesShare?: () => void;
|
14
14
|
slides: string[];
|
15
15
|
setSlides: React.Dispatch<React.SetStateAction<string[]>>;
|
16
|
+
renderThemeToggle?: () => JSX.Element;
|
16
17
|
}
|
17
|
-
export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
|
18
|
+
export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, renderThemeToggle, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
|
18
19
|
export {};
|
@@ -1,12 +1,7 @@
|
|
1
|
-
import { Editor } from '@tiptap/react';
|
2
|
-
|
3
1
|
interface PreviewPanelProps {
|
4
2
|
slides: string[];
|
5
3
|
currentSlide: number;
|
6
4
|
setCurrentSlide: (index: number) => void;
|
7
|
-
previewEditors: {
|
8
|
-
[key: number]: Editor;
|
9
|
-
};
|
10
5
|
}
|
11
|
-
export declare const PreviewPanel: ({ slides, currentSlide, setCurrentSlide,
|
6
|
+
export declare const PreviewPanel: ({ slides, currentSlide, setCurrentSlide, }: PreviewPanelProps) => import("react/jsx-runtime").JSX.Element;
|
12
7
|
export {};
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { NodeViewProps } from '@tiptap/core';
|
2
2
|
|
3
|
-
export declare const ActionButtonNodeView: ({ node, editor, getPos, }: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
|
3
|
+
export declare const ActionButtonNodeView: ({ node, editor, getPos, deleteNode, }: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { NodeType } from '@tiptap/pm/model';
|
2
2
|
import { InputRule } from '@tiptap/core';
|
3
3
|
|
4
|
-
export declare const defaultExtensions: (onError: (error: string) => void, secureImageUploadUrl?: string) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
|
4
|
+
export declare const defaultExtensions: (onError: (error: string) => void, secureImageUploadUrl?: string, metadataProxyUrl?: string) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
|
5
5
|
export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
|
@@ -3,8 +3,11 @@ import { Attrs } from '@tiptap/pm/model';
|
|
3
3
|
interface ResizableMediaAttributes {
|
4
4
|
dataAlign: string;
|
5
5
|
dataFloat: null | string;
|
6
|
+
showCaptionInput?: boolean;
|
7
|
+
caption?: string;
|
6
8
|
}
|
7
|
-
type
|
9
|
+
type UpdateAttributes = (attrs: Partial<ResizableMediaAttributes>) => void;
|
10
|
+
type Action = (updateAttributes: UpdateAttributes) => void;
|
8
11
|
interface ResizableMediaAction {
|
9
12
|
tooltip: string;
|
10
13
|
icon?: string;
|
@@ -9,4 +9,5 @@ export declare const useHeadlessEditor: () => {
|
|
9
9
|
};
|
10
10
|
convertJSONContentToYjsEncodedString: (content: JSONContent) => string;
|
11
11
|
downloadContentAsMd: (content: string | string[] | JSONContent, title: string) => void;
|
12
|
+
mergeYjsUpdates: (contents: string[]) => string;
|
12
13
|
};
|
package/dist/package/types.d.ts
CHANGED
@@ -25,6 +25,7 @@ export interface CommentAccountProps {
|
|
25
25
|
}
|
26
26
|
export interface DdocProps extends CommentAccountProps {
|
27
27
|
isCollabDocumentPublished?: boolean;
|
28
|
+
disableInlineComment?: boolean;
|
28
29
|
commentDrawerOpen?: boolean;
|
29
30
|
setCommentDrawerOpen?: React.Dispatch<SetStateAction<boolean>>;
|
30
31
|
initialComments?: IComment[];
|
@@ -85,11 +86,14 @@ export interface DdocProps extends CommentAccountProps {
|
|
85
86
|
onInlineComment?: () => void;
|
86
87
|
onMarkdownExport?: () => void;
|
87
88
|
onMarkdownImport?: () => void;
|
89
|
+
onPdfExport?: () => void;
|
88
90
|
sharedSlidesLink?: string;
|
89
91
|
documentName?: string;
|
90
92
|
onInvalidContentError?: (e: unknown) => void;
|
91
93
|
ignoreCorruptedData?: boolean;
|
92
94
|
onSlidesShare?: () => void;
|
95
|
+
renderThemeToggle?: () => JSX.Element;
|
96
|
+
metadataProxyUrl?: string;
|
93
97
|
}
|
94
98
|
export interface IEditorSelectionData {
|
95
99
|
from: number;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { DdocProps } from './types';
|
2
2
|
|
3
3
|
import * as Y from 'yjs';
|
4
|
-
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, scrollPosition, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, }: Partial<DdocProps>) => {
|
4
|
+
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, scrollPosition, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, }: Partial<DdocProps>) => {
|
5
5
|
editor: import('@tiptap/core').Editor | null;
|
6
6
|
isContentLoading: boolean;
|
7
7
|
ref: import('react').RefObject<HTMLDivElement>;
|