@fileverse-dev/ddoc 2.1.1 → 2.1.2-patch-2

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.
@@ -7,6 +7,7 @@ interface IEditorToolElement {
7
7
  title: string;
8
8
  onClick: () => void;
9
9
  isActive: boolean;
10
+ group?: string;
10
11
  }
11
12
  export declare const fonts: {
12
13
  title: string;
@@ -36,12 +37,15 @@ export declare const useEditorToolbar: ({ editor, onError, secureImageUploadUrl,
36
37
  undoRedoTools: (IEditorToolElement | null)[];
37
38
  toolbar: (IEditorToolElement | null)[];
38
39
  markdownOptions: (IEditorToolElement | null)[];
40
+ pdfExportOption: (IEditorToolElement | null)[];
39
41
  bottomToolbar: (IEditorToolElement | null)[];
40
42
  toolRef: React.RefObject<HTMLDivElement>;
41
43
  toolVisibility: IEditorTool;
42
44
  setToolVisibility: React.Dispatch<React.SetStateAction<IEditorTool>>;
43
45
  isExportModalOpen: boolean;
44
46
  setIsExportModalOpen: React.Dispatch<React.SetStateAction<boolean>>;
47
+ fileExportsOpen: boolean;
48
+ setFileExportsOpen: React.Dispatch<React.SetStateAction<boolean>>;
45
49
  };
46
50
  export declare const TextHighlighter: ({ editor, setVisibility, elementRef, }: {
47
51
  editor: Editor;
@@ -102,8 +106,10 @@ export declare const TextHeading: ({ editor, setVisibility, elementRef, }: {
102
106
  elementRef: React.RefObject<HTMLDivElement>;
103
107
  setVisibility: Dispatch<SetStateAction<IEditorTool>>;
104
108
  }) => import("react/jsx-runtime").JSX.Element;
105
- export declare const TextFormatingPopup: ({ editor, setToolVisibility, }: {
109
+ export declare const TextFormatingPopup: ({ editor, isOpen, setIsOpen, setToolVisibility, }: {
106
110
  editor: Editor;
111
+ isOpen: boolean;
112
+ setIsOpen: (open: boolean) => void;
107
113
  setToolVisibility: Dispatch<SetStateAction<IEditorTool>>;
108
114
  }) => import("react/jsx-runtime").JSX.Element;
109
115
  export declare const TextColorPicker: ({ editor }: {
@@ -10,6 +10,9 @@ interface PresentationModeProps {
10
10
  sharedSlidesLink?: string;
11
11
  isPreviewMode: boolean;
12
12
  documentName: string;
13
+ onSlidesShare?: () => void;
14
+ slides: string[];
15
+ setSlides: React.Dispatch<React.SetStateAction<string[]>>;
13
16
  }
14
- export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setIsCommentSectionOpen, sharedSlidesLink, isPreviewMode, documentName, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
17
+ export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setIsCommentSectionOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
15
18
  export {};
@@ -0,0 +1,3 @@
1
+ import { DocumentOutlineProps } from './types';
2
+
3
+ export declare const DocumentOutline: ({ editor, hasToC, items, setItems, showTOC, setShowTOC, isPreviewMode, }: DocumentOutlineProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ToCProps, ToCItemProps } from './types';
2
+
3
+ export declare const ToCItem: ({ item, onItemClick, index, }: ToCItemProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const ToCEmptyState: () => import("react/jsx-runtime").JSX.Element;
5
+ export declare const ToC: ({ items, editor, setItems }: ToCProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,30 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { SetStateAction } from 'react';
3
+
4
+ export interface ToCItemType {
5
+ id: string;
6
+ level: number;
7
+ textContent: string;
8
+ itemIndex: number;
9
+ isActive?: boolean;
10
+ }
11
+ export type ToCProps = {
12
+ items: ToCItemType[];
13
+ setItems: (items: ToCItemType[] | ((prev: ToCItemType[]) => ToCItemType[])) => void;
14
+ editor: Editor;
15
+ };
16
+ export type ToCItemProps = {
17
+ item: ToCItemType;
18
+ onItemClick: (e: React.MouseEvent, id: string) => void;
19
+ onItemRemove: (e: React.MouseEvent, id: string) => void;
20
+ index: number;
21
+ };
22
+ export interface DocumentOutlineProps {
23
+ editor: Editor;
24
+ hasToC: boolean;
25
+ items: ToCItemType[];
26
+ setItems: (items: ToCItemType[] | ((prev: ToCItemType[]) => ToCItemType[])) => void;
27
+ showTOC: boolean | undefined;
28
+ setShowTOC: React.Dispatch<SetStateAction<boolean>> | undefined;
29
+ isPreviewMode: boolean;
30
+ }
@@ -3,7 +3,10 @@ import { default as React } from 'react';
3
3
  interface UtilsModalProps {
4
4
  title: string;
5
5
  content: React.ReactNode;
6
+ isOpen?: boolean;
7
+ setIsOpen?: (open: boolean) => void;
6
8
  contentClassName?: string;
9
+ onCloseAutoFocus?: () => void;
7
10
  }
8
- declare const UtilsModal: ({ title, content, contentClassName }: UtilsModalProps) => import("react/jsx-runtime").JSX.Element;
11
+ declare const UtilsModal: ({ title, content, isOpen, setIsOpen, contentClassName, onCloseAutoFocus, }: UtilsModalProps) => import("react/jsx-runtime").JSX.Element;
9
12
  export default UtilsModal;
@@ -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').Node<any, any> | import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Mark<any, any>)[];
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>)[];
5
5
  export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
@@ -1,5 +1,5 @@
1
1
  import { Extension } from '@tiptap/core';
2
2
 
3
- export declare const updateScrollView: (container: HTMLElement, item: HTMLElement) => void;
3
+ export declare const Command: Extension<any, any>;
4
4
  declare const SlashCommand: (onError?: (errorString: string) => void, secureImageUploadUrl?: string) => Extension<any, any>;
5
5
  export default SlashCommand;
@@ -0,0 +1,15 @@
1
+ import { CommandProps } from './types';
2
+
3
+ export declare const getSuggestionItems: ({ query, onError, secureImageUploadUrl, }: {
4
+ query: string;
5
+ onError?: (errorString: string) => void;
6
+ secureImageUploadUrl?: string;
7
+ }) => {
8
+ title: string;
9
+ description: string;
10
+ searchTerms: string[];
11
+ icon: import("react/jsx-runtime").JSX.Element;
12
+ image: string;
13
+ command: ({ editor, range }: CommandProps) => void;
14
+ }[];
15
+ export declare const updateScrollView: (container: HTMLElement, item: HTMLElement) => void;
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ import { Editor, Range } from '@tiptap/core';
3
+
4
+ export interface CommandItemProps {
5
+ title: string;
6
+ description: string;
7
+ icon: ReactNode;
8
+ image?: string;
9
+ }
10
+ export interface CommandProps {
11
+ editor: Editor;
12
+ range: Range;
13
+ }
@@ -1,5 +1,5 @@
1
1
  import { Node as ProseMirrorNode } from 'prosemirror-model';
2
- import { NodeView } from 'prosemirror-view';
2
+ import { NodeView, ViewMutationRecord } from 'prosemirror-view';
3
3
 
4
4
  export declare function updateColumns(node: ProseMirrorNode, colgroup: Element, table: HTMLTableElement, cellMinWidth: number, overrideCol?: number, overrideValue?: string): void;
5
5
  export declare class TableView implements NodeView {
@@ -11,8 +11,5 @@ export declare class TableView implements NodeView {
11
11
  contentDOM: HTMLElement;
12
12
  constructor(node: ProseMirrorNode, cellMinWidth: number);
13
13
  update(node: ProseMirrorNode): boolean;
14
- ignoreMutation(mutation: MutationRecord | {
15
- type: 'selection';
16
- target: Element;
17
- }): boolean;
14
+ ignoreMutation(mutation: ViewMutationRecord): boolean;
18
15
  }
@@ -1,5 +1,5 @@
1
1
  import { Node as ProseMirrorNode } from 'prosemirror-model';
2
- import { NodeView } from 'prosemirror-view';
2
+ import { NodeView, ViewMutationRecord } from 'prosemirror-view';
3
3
 
4
4
  export declare class TableRowNodeView implements NodeView {
5
5
  node: ProseMirrorNode;
@@ -10,8 +10,5 @@ export declare class TableRowNodeView implements NodeView {
10
10
  contentDOM: HTMLElement;
11
11
  constructor(node: ProseMirrorNode, cellMinWidth: number);
12
12
  update(node: ProseMirrorNode): boolean;
13
- ignoreMutation(mutation: MutationRecord | {
14
- type: 'selection';
15
- target: Element;
16
- }): boolean;
13
+ ignoreMutation(mutation: ViewMutationRecord): boolean;
17
14
  }
@@ -1,5 +1,5 @@
1
1
  import { TagType } from '@fileverse/ui';
2
- import { JSONContent } from '@tiptap/core';
2
+ import { Extension, JSONContent } from '@tiptap/core';
3
3
  import { EditorProps } from '@tiptap/pm/view';
4
4
  import { Editor } from '@tiptap/react';
5
5
  import { default as React, SetStateAction } from 'react';
@@ -16,6 +16,9 @@ type InlineCommentData = {
16
16
  handleClick: boolean;
17
17
  };
18
18
  export interface DdocProps {
19
+ showTOC?: boolean;
20
+ setShowTOC?: React.Dispatch<SetStateAction<boolean>>;
21
+ proExtensions?: Record<string, Extension | any>;
19
22
  selectedTags?: TagType[];
20
23
  setSelectedTags?: React.Dispatch<SetStateAction<TagType[]>>;
21
24
  enableCollaboration?: boolean | undefined;
@@ -66,6 +69,7 @@ export interface DdocProps {
66
69
  documentName?: string;
67
70
  onInvalidContentError?: (e: unknown) => void;
68
71
  ignoreCorruptedData?: boolean;
72
+ onSlidesShare?: () => void;
69
73
  }
70
74
  export interface IEditorSelectionData {
71
75
  from: number;
@@ -1,11 +1,15 @@
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, }: 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, }: 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
10
  refreshYjsIndexedDbProvider: () => Promise<void>;
11
+ slides: string[];
12
+ setSlides: import('react').Dispatch<import('react').SetStateAction<string[]>>;
13
+ tocItems: any[];
14
+ setTocItems: import('react').Dispatch<import('react').SetStateAction<any[]>>;
11
15
  };
@@ -0,0 +1 @@
1
+ export declare const validateImageExtension: (file: File, onError?: (message: string) => void) => boolean;
@@ -1 +1,2 @@
1
1
  export declare const handlePrint: (slides: string[]) => void;
2
+ export declare const handleContentPrint: (content: string) => void;
@@ -2,7 +2,7 @@ export declare const base64ToArrayBuffer: (base64String: string) => ArrayBufferL
2
2
  export declare const arrayBufferToBase64: (buffer: ArrayBuffer) => string;
3
3
  export declare const generateRSAKeyPair: () => Promise<{
4
4
  publicKey: ArrayBuffer;
5
- privateKey: Uint8Array;
5
+ privateKey: Uint8Array<ArrayBuffer>;
6
6
  }>;
7
7
  export declare const decryptAESKey: (encryptedKeyBase64: string, privateKeyPem: BufferSource) => Promise<ArrayBuffer>;
8
8
  export declare const decryptImageData: (encryptedImageData: ArrayBuffer, aesKeyBuffer: ArrayBuffer, iv: string) => Promise<ArrayBuffer>;