@fileverse-dev/ddoc 2.3.0 → 2.3.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.
Files changed (29) hide show
  1. package/README.md +53 -1
  2. package/dist/{ccip-Um-ci_OZ.mjs → ccip-OTZyMJ99.mjs} +1 -1
  3. package/dist/{index-CCdUy9ON.mjs → index-DK7CAo5N.mjs} +33373 -32325
  4. package/dist/index.es.js +1 -1
  5. package/dist/package/components/editor-bubble-menu/props.d.ts +5 -0
  6. package/dist/package/components/editor-bubble-menu/types.d.ts +6 -1
  7. package/dist/package/components/editor-toolbar.d.ts +7 -2
  8. package/dist/package/components/editor-utils.d.ts +7 -2
  9. package/dist/package/components/mobile-toolbar.d.ts +7 -2
  10. package/dist/package/components/presentation-mode/presentation-mode.d.ts +7 -1
  11. package/dist/package/components/presentation-mode/preview-panel.d.ts +4 -1
  12. package/dist/package/components/secure-image-v2.d.ts +21 -0
  13. package/dist/package/context/editor-context.d.ts +3 -0
  14. package/dist/package/extensions/d-block/dblock.d.ts +2 -1
  15. package/dist/package/extensions/default-extension.d.ts +11 -1
  16. package/dist/package/extensions/iframe/iframe.d.ts +5 -0
  17. package/dist/package/extensions/mardown-paste-handler/index.d.ts +10 -3
  18. package/dist/package/extensions/reminder-block/reminder-menu-renderer.d.ts +1 -1
  19. package/dist/package/extensions/resizable-media/media-paste-drop-plugin/media-paste-drop-plugin.d.ts +2 -1
  20. package/dist/package/extensions/resizable-media/resizable-media-node-view.d.ts +5 -1
  21. package/dist/package/extensions/resizable-media/resizable-media.d.ts +6 -3
  22. package/dist/package/extensions/slash-command/slash-comand.d.ts +2 -1
  23. package/dist/package/extensions/slash-command/slash-command-utils.d.ts +3 -2
  24. package/dist/package/types.d.ts +55 -1
  25. package/dist/package/use-ddoc-editor.d.ts +1 -1
  26. package/dist/package/utils/md-to-slides.d.ts +5 -1
  27. package/dist/package/utils/upload-images.d.ts +2 -1
  28. package/dist/style.css +1 -1
  29. package/package.json +2 -2
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-CCdUy9ON.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-DK7CAo5N.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
@@ -54,6 +54,11 @@ export declare const bubbleMenuProps: (props: EditorBubbleMenuProps) => {
54
54
  commentDrawerOpen?: boolean;
55
55
  setCommentDrawerOpen?: React.Dispatch<import('react').SetStateAction<boolean>>;
56
56
  isCollabDocumentPublished?: boolean | undefined;
57
+ ipfsImageUploadFn?: (file: File) => Promise<import('../../types').IpfsImageUploadResponse>;
58
+ ipfsImageFetchFn?: (_data: import('../../types').IpfsImageFetchPayload) => Promise<{
59
+ url: string;
60
+ file: File;
61
+ }>;
57
62
  onReminderCreate?: (reminder: import('../../..').Reminder, type: string) => void;
58
63
  isConnected?: boolean;
59
64
  };
@@ -1,6 +1,6 @@
1
1
  import { BubbleMenuProps, Editor } from '@tiptap/react';
2
2
  import { SetStateAction } from 'react';
3
- import { InlineCommentData } from '../../types';
3
+ import { InlineCommentData, IpfsImageFetchPayload, IpfsImageUploadResponse } from '../../types';
4
4
  import { Reminder } from '../../extensions/reminder-block/types';
5
5
 
6
6
  export interface BubbleMenuItem {
@@ -24,6 +24,11 @@ export type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
24
24
  commentDrawerOpen?: boolean;
25
25
  setCommentDrawerOpen?: React.Dispatch<SetStateAction<boolean>>;
26
26
  isCollabDocumentPublished?: boolean | undefined;
27
+ ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
28
+ ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
29
+ url: string;
30
+ file: File;
31
+ }>;
27
32
  onReminderCreate?: (reminder: Reminder, type: string) => void;
28
33
  isConnected?: boolean;
29
34
  };
@@ -1,17 +1,22 @@
1
1
  import { default as React } from 'react';
2
2
  import { Editor } from '@tiptap/react';
3
+ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
3
4
 
4
- declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, secureImageUploadUrl, onMarkdownExport, onMarkdownImport, onPdfExport, isLoading, }: {
5
+ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, isLoading, ipfsImageFetchFn, }: {
5
6
  editor: Editor | null;
6
7
  onError?: (errorString: string) => void;
7
8
  zoomLevel: string;
8
9
  setZoomLevel: (zoom: string) => void;
9
10
  isNavbarVisible: boolean;
10
11
  setIsNavbarVisible: React.Dispatch<React.SetStateAction<boolean>>;
11
- secureImageUploadUrl?: string;
12
+ ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
12
13
  onMarkdownExport?: () => void;
13
14
  onMarkdownImport?: () => void;
14
15
  onPdfExport?: () => void;
15
16
  isLoading: boolean;
17
+ ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
18
+ url: string;
19
+ file: File;
20
+ }>;
16
21
  }) => import("react/jsx-runtime").JSX.Element;
17
22
  export default TiptapToolBar;
@@ -1,6 +1,7 @@
1
1
  import { default as React, Dispatch, SetStateAction } from 'react';
2
2
  import { IEditorTool } from '../hooks/use-visibility';
3
3
  import { Editor } from '@tiptap/react';
4
+ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
4
5
 
5
6
  interface IEditorToolElement {
6
7
  icon: any;
@@ -36,13 +37,17 @@ export declare const IMG_UPLOAD_SETTINGS: {
36
37
  errorMsg: string;
37
38
  };
38
39
  };
39
- export declare const useEditorToolbar: ({ editor, onError, secureImageUploadUrl, onMarkdownExport, onMarkdownImport, onPdfExport, }: {
40
+ export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, ipfsImageFetchFn, }: {
40
41
  editor: Editor | null;
41
42
  onError?: (errorString: string) => void;
42
- secureImageUploadUrl?: string;
43
+ ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
43
44
  onMarkdownExport?: () => void;
44
45
  onMarkdownImport?: () => void;
45
46
  onPdfExport?: () => void;
47
+ ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
48
+ url: string;
49
+ file: File;
50
+ }>;
46
51
  }) => {
47
52
  undoRedoTools: (IEditorToolElement | null)[];
48
53
  toolbar: (IEditorToolElement | null)[];
@@ -1,12 +1,17 @@
1
1
  import { Editor } from '@tiptap/react';
2
+ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
2
3
 
3
- declare const MobileToolbar: ({ editor, onError, isKeyboardVisible, isNavbarVisible, setIsNavbarVisible, secureImageUploadUrl, isLoading, }: {
4
+ declare const MobileToolbar: ({ editor, onError, isKeyboardVisible, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, isLoading, ipfsImageFetchFn, }: {
4
5
  editor: Editor | null;
5
6
  onError?: (errorString: string) => void;
6
7
  isKeyboardVisible: boolean;
7
8
  isNavbarVisible: boolean;
8
9
  setIsNavbarVisible: React.Dispatch<React.SetStateAction<boolean>>;
9
- secureImageUploadUrl?: string;
10
+ ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
10
11
  isLoading: boolean;
12
+ ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
13
+ url: string;
14
+ file: File;
15
+ }>;
11
16
  }) => import("react/jsx-runtime").JSX.Element;
12
17
  export default MobileToolbar;
@@ -1,4 +1,5 @@
1
1
  import { Editor } from '@tiptap/react';
2
+ import { IpfsImageFetchPayload, DdocProps } from '../../types';
2
3
 
3
4
  interface PresentationModeProps {
4
5
  editor: Editor;
@@ -15,6 +16,11 @@ interface PresentationModeProps {
15
16
  setSlides: React.Dispatch<React.SetStateAction<string[]>>;
16
17
  renderThemeToggle?: () => JSX.Element;
17
18
  isContentLoading: boolean;
19
+ ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
20
+ url: string;
21
+ file: File;
22
+ }>;
23
+ documentStyling?: DdocProps['documentStyling'];
18
24
  }
19
- export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, renderThemeToggle, isContentLoading, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
25
+ export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, renderThemeToggle, isContentLoading, ipfsImageFetchFn, documentStyling, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
20
26
  export {};
@@ -1,7 +1,10 @@
1
+ import { DdocProps } from '../../types';
2
+
1
3
  interface PreviewPanelProps {
2
4
  slides: string[];
3
5
  currentSlide: number;
4
6
  setCurrentSlide: (index: number) => void;
7
+ documentStyling?: DdocProps['documentStyling'];
5
8
  }
6
- export declare const PreviewPanel: ({ slides, currentSlide, setCurrentSlide, }: PreviewPanelProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const PreviewPanel: ({ slides, currentSlide, setCurrentSlide, documentStyling, }: PreviewPanelProps) => import("react/jsx-runtime").JSX.Element;
7
10
  export {};
@@ -0,0 +1,21 @@
1
+ import { IpfsImageFetchPayload } from '../types.ts';
2
+
3
+ type Props = {
4
+ encryptionKey: string;
5
+ url: string;
6
+ nonce: string;
7
+ alt?: string;
8
+ width?: string;
9
+ height?: string;
10
+ className?: string;
11
+ caption?: string;
12
+ ipfsImageFetchFn: (_data: IpfsImageFetchPayload) => Promise<{
13
+ url: string;
14
+ file: File;
15
+ }>;
16
+ ipfsHash: string;
17
+ mimeType: string;
18
+ authTag: string;
19
+ };
20
+ export declare const SecureImageV2: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLImageElement>>;
21
+ export {};
@@ -1,14 +1,17 @@
1
1
  import { default as React, ReactNode } from 'react';
2
+ import { DocumentStyling } from '../types';
2
3
 
3
4
  interface EditorContextType {
4
5
  collapsedHeadings: Set<string>;
5
6
  setCollapsedHeadings: (updater: (prev: Set<string>) => Set<string>) => void;
6
7
  isHeadingCollapsed: (id: string) => boolean;
7
8
  expandMultipleHeadings: (ids: string[]) => void;
9
+ documentStyling?: DocumentStyling;
8
10
  }
9
11
  export declare const EditorContext: React.Context<EditorContextType | null>;
10
12
  export declare const useEditorContext: () => EditorContextType;
11
13
  export declare const EditorProvider: React.FC<{
12
14
  children: ReactNode;
15
+ documentStyling?: DocumentStyling;
13
16
  }>;
14
17
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Node } from '@tiptap/core';
2
+ import { IpfsImageUploadResponse } from '../../types';
2
3
 
3
4
  export interface DBlockOptions {
4
5
  HTMLAttributes: Record<string, any>;
5
- secureImageUploadUrl?: string;
6
+ ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
6
7
  onCopyHeadingLink?: (link: string) => void;
7
8
  hasAvailableModels: boolean;
8
9
  }
@@ -1,5 +1,15 @@
1
1
  import { NodeType } from '@tiptap/pm/model';
2
2
  import { InputRule } from '@tiptap/core';
3
+ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
3
4
 
4
- export declare const defaultExtensions: (onError: (error: string) => void, secureImageUploadUrl?: string, metadataProxyUrl?: string, onCopyHeadingLink?: (link: string) => void) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
5
+ export declare const defaultExtensions: ({ ipfsImageFetchFn, onError, metadataProxyUrl, onCopyHeadingLink, ipfsImageUploadFn, }: {
6
+ ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
7
+ url: string;
8
+ file: File;
9
+ }>;
10
+ onError: (error: string) => void;
11
+ ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
12
+ metadataProxyUrl?: string;
13
+ onCopyHeadingLink?: (link: string) => void;
14
+ }) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
5
15
  export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
@@ -1,4 +1,5 @@
1
1
  import { Node } from '@tiptap/core';
2
+ import { IpfsImageFetchPayload } from '../../types';
2
3
 
3
4
  export interface IframeOptions {
4
5
  allowFullscreen: boolean;
@@ -7,6 +8,10 @@ export interface IframeOptions {
7
8
  };
8
9
  width?: number;
9
10
  height?: number;
11
+ ipfsImageFetchFn: (_data: IpfsImageFetchPayload) => Promise<{
12
+ url: string;
13
+ file: File;
14
+ }>;
10
15
  }
11
16
  declare module '@tiptap/core' {
12
17
  interface Commands<ReturnType> {
@@ -1,18 +1,25 @@
1
1
  import { Extension } from '@tiptap/core';
2
2
  import { Node as PMNode } from 'prosemirror-model';
3
3
  import { default as TurndownService } from 'turndown';
4
+ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../../types';
4
5
 
5
6
  export declare const turndownService: TurndownService;
6
7
  declare module '@tiptap/core' {
7
8
  interface Commands {
8
9
  uploadMarkdownFile: {
9
- uploadMarkdownFile: (secureImageUploadUrl?: string) => any;
10
+ uploadMarkdownFile: (ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>) => any;
10
11
  };
11
12
  exportMarkdownFile: {
12
13
  exportMarkdownFile: () => any;
13
14
  };
14
15
  }
15
16
  }
16
- declare const MarkdownPasteHandler: (secureImageUploadUrl?: string) => Extension<any, any>;
17
+ declare const MarkdownPasteHandler: (ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
18
+ url: string;
19
+ file: File;
20
+ }>) => Extension<any, any>;
17
21
  export default MarkdownPasteHandler;
18
- export declare function searchForSecureImageNodeAndEmbedImageContent(originalDoc: PMNode): Promise<PMNode>;
22
+ export declare function searchForSecureImageNodeAndEmbedImageContent(originalDoc: PMNode, ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
23
+ url: string;
24
+ file: File;
25
+ }>): Promise<PMNode>;
@@ -2,4 +2,4 @@ import { Editor, Range } from '@tiptap/core';
2
2
  import { ReactRenderer } from '@tiptap/react';
3
3
  import { ReminderMenuProps } from './types';
4
4
 
5
- export declare function showReminderMenu(editor: Editor, range: Range, type: ReminderMenuProps['type']): ReactRenderer<HTMLDivElement, ReminderMenuProps & import('react').RefAttributes<HTMLDivElement>>;
5
+ export declare function showReminderMenu(editor: Editor, range: Range, type: ReminderMenuProps['type'], onError?: (error: string) => void): ReactRenderer<HTMLDivElement, ReminderMenuProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,4 +1,5 @@
1
1
  import { Plugin } from 'prosemirror-state';
2
+ import { IpfsImageUploadResponse } from '../../../types.ts';
2
3
 
3
4
  export type UploadFnType = (image: File) => Promise<string>;
4
5
  /**
@@ -9,4 +10,4 @@ export type UploadFnType = (image: File) => Promise<string>;
9
10
  * If no upload function is provided, it reads the media file as DataURL and uses this in the new node.
10
11
  * The function returns a new instance of the Plugin.
11
12
  */
12
- export declare const getMediaPasteDropPlugin: (upload: UploadFnType, onError: (error: string) => void, secureImageUploadUrl?: string) => Plugin<any>;
13
+ export declare const getMediaPasteDropPlugin: (onError: (error: string) => void, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>) => Plugin<any>;
@@ -1,3 +1,7 @@
1
1
  import { NodeViewProps } from '@tiptap/react';
2
+ import { IpfsImageFetchPayload } from '../../types.ts';
2
3
 
3
- export declare const ResizableMediaNodeView: ({ node, updateAttributes, deleteNode, }: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const getResizableMediaNodeView: (ipfsImageFetchFn: (_data: IpfsImageFetchPayload) => Promise<{
5
+ url: string;
6
+ file: File;
7
+ }>) => ({ node, updateAttributes, deleteNode }: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { Node } from '@tiptap/core';
2
- import { UploadFnType } from './media-paste-drop-plugin';
2
+ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../../types';
3
3
 
4
4
  declare module '@tiptap/core' {
5
5
  interface Commands<ReturnType> {
@@ -20,9 +20,12 @@ declare module '@tiptap/core' {
20
20
  }
21
21
  export interface MediaOptions {
22
22
  HTMLAttributes: Record<string, any>;
23
- uploadFn: UploadFnType;
24
23
  onError: (error: string) => void;
25
- secureImageUploadUrl?: string;
24
+ ipfsImageUploadFn: (file: File) => Promise<IpfsImageUploadResponse>;
25
+ ipfsImageFetchFn: (_data: IpfsImageFetchPayload) => Promise<{
26
+ url: string;
27
+ file: File;
28
+ }>;
26
29
  }
27
30
  export declare const IMAGE_INPUT_REGEX: RegExp;
28
31
  export declare const VIDEO_INPUT_REGEX: RegExp;
@@ -1,5 +1,6 @@
1
1
  import { Extension } from '@tiptap/core';
2
+ import { IpfsImageUploadResponse } from '../../types';
2
3
 
3
4
  export declare const Command: Extension<any, any>;
4
- declare const SlashCommand: (onError?: (errorString: string) => void, secureImageUploadUrl?: string, isConnected?: boolean) => Extension<any, any>;
5
+ declare const SlashCommand: (onError?: (errorString: string) => void, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, isConnected?: boolean) => Extension<any, any>;
5
6
  export default SlashCommand;
@@ -1,9 +1,10 @@
1
1
  import { CommandProps } from './types';
2
+ import { IpfsImageUploadResponse } from '../../types';
2
3
 
3
- export declare const getSuggestionItems: ({ query, onError, secureImageUploadUrl, editor, }: {
4
+ export declare const getSuggestionItems: ({ query, onError, isConnected, ipfsImageUploadFn, editor, }: {
4
5
  query: string;
5
6
  onError?: (errorString: string) => void;
6
- secureImageUploadUrl?: string;
7
+ ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
7
8
  isConnected?: boolean;
8
9
  editor?: any;
9
10
  }) => ({
@@ -32,8 +32,42 @@ export interface CustomModel {
32
32
  apiKey: string;
33
33
  systemPrompt: string;
34
34
  }
35
+ /**
36
+ * Document styling configuration interface
37
+ * @description Defines the styling options available for customizing the document editor appearance
38
+ */
39
+ export interface DocumentStyling {
40
+ /**
41
+ * Outer page/document background
42
+ * @description Controls the background of the entire editor area. Supports solid colors and CSS gradients.
43
+ * @example "#f8f9fa" | "linear-gradient(135deg, #667eea 0%, #764ba2 100%)"
44
+ */
45
+ background?: string;
46
+ /**
47
+ * Editor content area background
48
+ * @description Controls the background color of the actual editor content where text is written. Should be solid colors for readability.
49
+ * @example "#ffffff" | "#f5f5f5"
50
+ */
51
+ canvasBackground?: string;
52
+ /**
53
+ * Text color
54
+ * @description Controls the color of the text content in the editor.
55
+ * @example "#000000" | "#1a1a1a"
56
+ */
57
+ textColor?: string;
58
+ /**
59
+ * Font family
60
+ * @description Controls the font family used for the editor content.
61
+ * @example "Inter" | "Arial" | "Georgia"
62
+ */
63
+ fontFamily?: string;
64
+ }
35
65
  export interface DdocProps extends CommentAccountProps {
36
66
  isCollabDocumentPublished?: boolean;
67
+ ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
68
+ url: string;
69
+ file: File;
70
+ }>;
37
71
  disableInlineComment?: boolean;
38
72
  commentDrawerOpen?: boolean;
39
73
  setCommentDrawerOpen?: React.Dispatch<SetStateAction<boolean>>;
@@ -63,7 +97,7 @@ export interface DdocProps extends CommentAccountProps {
63
97
  collaborationId?: string;
64
98
  isPreviewMode: boolean;
65
99
  ensResolutionUrl?: string;
66
- secureImageUploadUrl?: string;
100
+ ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
67
101
  enableIndexeddbSync?: boolean;
68
102
  ddocId?: string;
69
103
  initialContent?: JSONContent | string | string[] | null;
@@ -108,6 +142,11 @@ export interface DdocProps extends CommentAccountProps {
108
142
  activeModel?: CustomModel;
109
143
  maxTokens?: number;
110
144
  isAIAgentEnabled?: boolean;
145
+ /**
146
+ * Document styling configuration
147
+ * @description Customize the appearance of the document editor
148
+ */
149
+ documentStyling?: DocumentStyling;
111
150
  }
112
151
  export interface IEditorSelectionData {
113
152
  from: number;
@@ -124,3 +163,18 @@ export interface IUser {
124
163
  isEns: boolean;
125
164
  }
126
165
  export { type IComment };
166
+ export interface IpfsImageUploadResponse {
167
+ encryptionKey: string;
168
+ nonce: string;
169
+ ipfsUrl: string;
170
+ ipfsHash: string;
171
+ authTag: string;
172
+ }
173
+ export interface IpfsImageFetchPayload {
174
+ encryptionKey: string;
175
+ nonce: string;
176
+ ipfsUrl: string;
177
+ ipfsHash: string;
178
+ mimeType: string;
179
+ authTag: string;
180
+ }
@@ -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, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, isConnected, activeModel, maxTokens, isAIAgentEnabled, }: Partial<DdocProps>) => {
4
+ export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, }: Partial<DdocProps>) => {
5
5
  editor: import('@tiptap/core').Editor | null;
6
6
  isContentLoading: boolean;
7
7
  ref: import('react').RefObject<HTMLDivElement>;
@@ -1,5 +1,6 @@
1
1
  import { default as MarkdownIt } from 'markdown-it';
2
2
  import { Editor } from '@tiptap/react';
3
+ import { IpfsImageFetchPayload } from '../types';
3
4
 
4
5
  interface SlideContent {
5
6
  type: 'h1' | 'h2' | 'content' | 'image' | 'table';
@@ -9,6 +10,9 @@ export interface Slides {
9
10
  [key: number]: SlideContent[];
10
11
  }
11
12
  export declare const md: MarkdownIt;
12
- export declare const convertToMarkdown: (editor: Editor) => Promise<string>;
13
+ export declare const convertToMarkdown: (editor: Editor, ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
14
+ url: string;
15
+ file: File;
16
+ }>) => Promise<string>;
13
17
  export declare const processMarkdownContent: (markdown: string) => Slides;
14
18
  export {};
@@ -1,9 +1,10 @@
1
1
  import { Plugin } from '@tiptap/pm/state';
2
2
  import { DecorationSet, EditorView } from '@tiptap/pm/view';
3
+ import { IpfsImageUploadResponse } from '../types';
3
4
 
4
5
  declare const UploadImagesPlugin: () => Plugin<DecorationSet>;
5
6
  export default UploadImagesPlugin;
6
- export declare function startImageUpload(file: File, view: EditorView, pos: number, secureImageUploadUrl?: string): Promise<void>;
7
+ export declare function startImageUpload(file: File, view: EditorView, pos: number, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>): Promise<void>;
7
8
  export declare const uploadFn: (image: File) => Promise<string>;
8
9
  export declare const uploadSecureImage: (url: string, image: File, publicKey: ArrayBuffer) => Promise<any>;
9
10
  export declare const handleDecryptImage: (url: string, encryptedKey: string, privateKey: string, iv: string) => Promise<string | undefined>;