@fileverse-dev/ddoc 2.4.4 → 2.4.5

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/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-CZq9gyW-.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-Dp20dCiD.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
@@ -2,7 +2,7 @@ import { default as React } from 'react';
2
2
  import { Editor } from '@tiptap/react';
3
3
  import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
4
4
 
5
- declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, isLoading, ipfsImageFetchFn, }: {
5
+ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onDocxImport, isLoading, ipfsImageFetchFn, }: {
6
6
  editor: Editor | null;
7
7
  onError?: (errorString: string) => void;
8
8
  zoomLevel: string;
@@ -15,6 +15,7 @@ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavb
15
15
  onPdfExport?: () => void;
16
16
  onHtmlExport?: () => void;
17
17
  onTxtExport?: () => void;
18
+ onDocxImport?: () => void;
18
19
  isLoading: boolean;
19
20
  ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
20
21
  url: string;
@@ -38,7 +38,7 @@ export declare const IMG_UPLOAD_SETTINGS: {
38
38
  errorMsg: string;
39
39
  };
40
40
  };
41
- export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, ipfsImageFetchFn, }: {
41
+ export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, ipfsImageFetchFn, onDocxImport, }: {
42
42
  editor: Editor | null;
43
43
  onError?: (errorString: string) => void;
44
44
  ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
@@ -51,6 +51,7 @@ export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, on
51
51
  url: string;
52
52
  file: File;
53
53
  }>;
54
+ onDocxImport?: () => void;
54
55
  }) => {
55
56
  undoRedoTools: (IEditorToolElement | null)[];
56
57
  toolbar: (IEditorToolElement | null)[];
@@ -0,0 +1,15 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { IpfsImageUploadResponse } from '../../types';
3
+
4
+ declare module '@tiptap/core' {
5
+ interface Commands {
6
+ uploadDocxFile: {
7
+ /**
8
+ * Import a DOCX file and insert its content into the editor.
9
+ * Automatically handles embedded images via IPFS secure image upload.
10
+ */
11
+ uploadDocxFile: (ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, onError?: (error: string) => void, onDocxImport?: () => void) => any;
12
+ };
13
+ }
14
+ }
15
+ export declare const DocxFileHandler: Extension<any, any>;
@@ -7,7 +7,7 @@ export declare const turndownService: TurndownService;
7
7
  declare module '@tiptap/core' {
8
8
  interface Commands {
9
9
  uploadMarkdownFile: {
10
- uploadMarkdownFile: (ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>) => any;
10
+ uploadMarkdownFile: (ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, onError?: (error: string) => void) => any;
11
11
  };
12
12
  exportMarkdownFile: {
13
13
  exportMarkdownFile: (props?: {
@@ -133,6 +133,7 @@ export interface DdocProps extends CommentAccountProps {
133
133
  onPdfExport?: () => void;
134
134
  onHtmlExport?: () => void;
135
135
  onTxtExport?: () => void;
136
+ onDocxImport?: () => void;
136
137
  sharedSlidesLink?: string;
137
138
  documentName?: string;
138
139
  onInvalidContentError?: (e: unknown) => void;