@fileverse-dev/ddoc 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,7 @@ type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
16
16
  setInlineCommentData?: React.Dispatch<React.SetStateAction<InlineCommentData>>;
17
17
  walletAddress?: string;
18
18
  username?: string;
19
+ onInlineComment?: () => void;
19
20
  };
20
21
  export declare const EditorBubbleMenu: (props: EditorBubbleMenuProps) => import("react/jsx-runtime").JSX.Element;
21
22
  export {};
@@ -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, }: {
4
+ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, secureImageUploadUrl, onMarkdownExport, onMarkdownImport, }: {
5
5
  editor: Editor;
6
6
  onError?: (errorString: string) => void;
7
7
  zoomLevel: string;
@@ -9,5 +9,7 @@ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavb
9
9
  isNavbarVisible: boolean;
10
10
  setIsNavbarVisible: React.Dispatch<React.SetStateAction<boolean>>;
11
11
  secureImageUploadUrl?: string;
12
+ onMarkdownExport?: () => void;
13
+ onMarkdownImport?: () => void;
12
14
  }) => import("react/jsx-runtime").JSX.Element;
13
15
  export default TiptapToolBar;
@@ -26,10 +26,12 @@ export declare const IMG_UPLOAD_SETTINGS: {
26
26
  errorMsg: string;
27
27
  };
28
28
  };
29
- export declare const useEditorToolbar: ({ editor, onError, secureImageUploadUrl, }: {
29
+ export declare const useEditorToolbar: ({ editor, onError, secureImageUploadUrl, onMarkdownExport, onMarkdownImport, }: {
30
30
  editor: Editor;
31
31
  onError?: (errorString: string) => void;
32
32
  secureImageUploadUrl?: string;
33
+ onMarkdownExport?: () => void;
34
+ onMarkdownImport?: () => void;
33
35
  }) => {
34
36
  undoRedoTools: (IEditorToolElement | null)[];
35
37
  toolbar: (IEditorToolElement | null)[];
@@ -69,7 +71,7 @@ export declare const LinkPopup: ({ elementRef, editor, setToolVisibility, bubble
69
71
  setIsLinkPopupOpen?: Dispatch<SetStateAction<boolean>>;
70
72
  onError?: (errorString: string) => void;
71
73
  }) => import("react/jsx-runtime").JSX.Element;
72
- export declare const InlineCommentPopup: ({ elementRef, editor, setIsCommentSectionOpen, setIsInlineCommentOpen, inlineCommentData, setInlineCommentData, }: {
74
+ export declare const InlineCommentPopup: ({ elementRef, editor, setIsCommentSectionOpen, setIsInlineCommentOpen, inlineCommentData, setInlineCommentData, onInlineComment, }: {
73
75
  elementRef: React.RefObject<HTMLDivElement>;
74
76
  editor: Editor;
75
77
  setIsCommentSectionOpen: Dispatch<SetStateAction<boolean>>;
@@ -84,6 +86,7 @@ export declare const InlineCommentPopup: ({ elementRef, editor, setIsCommentSect
84
86
  inlineCommentText?: string;
85
87
  handleClick?: boolean;
86
88
  }) => void;
89
+ onInlineComment?: () => void;
87
90
  }) => import("react/jsx-runtime").JSX.Element;
88
91
  export declare const ScriptsPopup: ({ elementRef, editor, }: {
89
92
  elementRef: React.RefObject<HTMLDivElement>;
@@ -6,6 +6,10 @@ interface PresentationModeProps {
6
6
  isFullscreen: boolean;
7
7
  setIsFullscreen: (isFullscreen: boolean) => void;
8
8
  onError?: (error: string) => void;
9
+ setIsCommentSectionOpen: React.Dispatch<React.SetStateAction<boolean>> | undefined;
10
+ sharedSlidesLink?: string;
11
+ isPreviewMode: boolean;
12
+ documentName: string;
9
13
  }
10
- export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
14
+ export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setIsCommentSectionOpen, sharedSlidesLink, isPreviewMode, documentName, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
11
15
  export {};
@@ -26,12 +26,15 @@ export interface DdocProps {
26
26
  setZoomLevel: React.Dispatch<SetStateAction<string>>;
27
27
  isNavbarVisible: boolean;
28
28
  setIsNavbarVisible: React.Dispatch<SetStateAction<boolean>>;
29
+ editorCanvasClassNames?: string;
29
30
  isCommentSectionOpen?: boolean;
30
31
  collaborationId?: string;
31
32
  isPreviewMode: boolean;
32
33
  ensResolutionUrl?: string;
33
34
  secureImageUploadUrl?: string;
34
- initialContent?: JSONContent | null;
35
+ enableIndexeddbSync?: boolean;
36
+ ddocId?: string;
37
+ initialContent?: JSONContent | string | string[] | null;
35
38
  walletAddress?: string | null;
36
39
  username?: string | null;
37
40
  renderNavbar?: ({ editor }: {
@@ -56,6 +59,13 @@ export interface DdocProps {
56
59
  unFocused?: boolean;
57
60
  isPresentationMode?: boolean;
58
61
  setIsPresentationMode?: React.Dispatch<SetStateAction<boolean>>;
62
+ onInlineComment?: () => void;
63
+ onMarkdownExport?: () => void;
64
+ onMarkdownImport?: () => void;
65
+ sharedSlidesLink?: string;
66
+ documentName?: string;
67
+ onInvalidContentError?: (e: unknown) => void;
68
+ ignoreCorruptedData?: boolean;
59
69
  }
60
70
  export interface IEditorSelectionData {
61
71
  from: number;
@@ -1,10 +1,11 @@
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, unFocused, }: 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, }: Partial<DdocProps>) => {
5
5
  editor: import('@tiptap/core').Editor | null;
6
6
  isContentLoading: boolean;
7
7
  ref: import('react').RefObject<HTMLDivElement>;
8
8
  connect: (username: string | null | undefined, isEns?: boolean) => () => void;
9
9
  ydoc: Y.Doc;
10
+ refreshYjsIndexedDbProvider: () => Promise<void>;
10
11
  };
@@ -0,0 +1 @@
1
+ export declare function isJSONString(str: unknown): boolean;
@@ -0,0 +1,9 @@
1
+ import { JSONContent } from '@tiptap/core';
2
+
3
+ type SanitizeContentProps = {
4
+ data: JSONContent;
5
+ ignoreCorruptedData?: boolean;
6
+ onInvalidContentError?: (e: unknown) => void;
7
+ };
8
+ export declare const sanitizeContent: ({ data, ignoreCorruptedData, onInvalidContentError, }: SanitizeContentProps) => JSONContent;
9
+ export {};
@@ -0,0 +1,10 @@
1
+ declare class ZoomService {
2
+ private static instance;
3
+ private _currentZoom;
4
+ static getInstance(): ZoomService;
5
+ get currentZoom(): string;
6
+ setZoom(zoom: string): void;
7
+ private updateElementPosition;
8
+ }
9
+ export declare const zoomService: ZoomService;
10
+ export {};