@fileverse-dev/ddoc 3.0.45-patch-22 → 3.0.45-patch-31

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-BOWgrubD.mjs";
1
+ import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-C_btFjJO.mjs";
2
2
  export {
3
3
  d as DdocEditor,
4
4
  r as Editor,
@@ -1,8 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { Editor } from '@tiptap/react';
3
3
  import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
4
+ import { Tab } from './tabs/utils/tab-utils';
4
5
 
5
- declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, }: {
6
+ import * as Y from 'yjs';
7
+ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, }: {
6
8
  editor: Editor | null;
7
9
  onError?: (errorString: string) => void;
8
10
  zoomLevel: string;
@@ -23,5 +25,7 @@ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavb
23
25
  file: File;
24
26
  }>;
25
27
  isConnected?: boolean;
28
+ tabs: Tab[];
29
+ ydoc: Y.Doc;
26
30
  }) => import("react/jsx-runtime").JSX.Element;
27
31
  export default TiptapToolBar;
@@ -1,3 +1,11 @@
1
+ interface ExportFormatOption {
2
+ id: string;
3
+ label: string;
4
+ }
5
+ interface ExportTabOption {
6
+ id: string;
7
+ label: string;
8
+ }
1
9
  interface ExportAsModalProps {
2
10
  open: boolean;
3
11
  onOpenChange: (open: boolean) => void;
@@ -5,6 +13,10 @@ interface ExportAsModalProps {
5
13
  format: string;
6
14
  tab: string;
7
15
  }) => void;
16
+ formatOptions: ExportFormatOption[];
17
+ tabOptions: ExportTabOption[];
18
+ initialFormat?: string;
19
+ initialTab?: string;
8
20
  }
9
- export declare const ExportAsModal: ({ open, onOpenChange, onExport, }: ExportAsModalProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const ExportAsModal: ({ open, onOpenChange, onExport, formatOptions, tabOptions, initialFormat, initialTab, }: ExportAsModalProps) => import("react/jsx-runtime").JSX.Element;
10
22
  export {};
@@ -1,10 +1,16 @@
1
1
  import { IEditorToolElement } from './editor-utils';
2
+ import { Editor } from '@tiptap/react';
3
+ import { Tab } from './tabs/utils/tab-utils';
2
4
 
3
- declare const ImportExportButton: ({ fileExportsOpen, setFileExportsOpen, exportOptions, importOptions, setDropdownOpen, }: {
5
+ import * as Y from 'yjs';
6
+ declare const ImportExportButton: ({ fileExportsOpen, setFileExportsOpen, exportOptions, importOptions, setDropdownOpen, editor, tabs, ydoc, }: {
4
7
  fileExportsOpen: boolean;
5
8
  setFileExportsOpen: React.Dispatch<React.SetStateAction<boolean>>;
6
9
  exportOptions: (IEditorToolElement | null)[];
7
10
  importOptions: (IEditorToolElement | null)[];
8
11
  setDropdownOpen: React.Dispatch<React.SetStateAction<boolean>>;
12
+ editor: Editor | null;
13
+ tabs: Tab[];
14
+ ydoc: Y.Doc;
9
15
  }) => import("react/jsx-runtime").JSX.Element;
10
16
  export { ImportExportButton };
@@ -0,0 +1,23 @@
1
+ import { Editor } from '@tiptap/react';
2
+ import { IEditorToolElement } from '../components/editor-utils';
3
+ import { Tab } from '../components/tabs/utils/tab-utils';
4
+
5
+ import * as Y from 'yjs';
6
+ interface UseDdocExportArgs {
7
+ editor: Editor | null;
8
+ tabs: Tab[];
9
+ ydoc: Y.Doc;
10
+ exportOptions: (IEditorToolElement | null)[];
11
+ }
12
+ declare const useDdocExport: ({ editor, tabs, ydoc, exportOptions, }: UseDdocExportArgs) => {
13
+ getOptionFormat: (title: string) => "" | "md" | "pdf" | "html" | "txt";
14
+ formatSelectOptions: {
15
+ id: string;
16
+ label: string;
17
+ }[];
18
+ handleExport: ({ format, tab }: {
19
+ format: string;
20
+ tab: string;
21
+ }) => void;
22
+ };
23
+ export { useDdocExport };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fileverse-dev/ddoc",
3
3
  "private": false,
4
4
  "description": "DDoc",
5
- "version": "3.0.45-patch-22",
5
+ "version": "3.0.45-patch-31",
6
6
  "main": "dist/index.es.js",
7
7
  "module": "dist/index.es.js",
8
8
  "exports": {