@fileverse-dev/ddoc 3.0.98 → 3.0.100
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 +25487 -22913
- package/dist/package/components/editor-toolbar.d.ts +2 -1
- package/dist/package/components/editor-utils.d.ts +2 -1
- package/dist/package/components/preview-export-trigger.d.ts +2 -1
- package/dist/package/extensions/mardown-paste-handler/index.d.ts +1 -1
- package/dist/package/extensions/odt-export/index.d.ts +30 -0
- package/dist/package/hooks/use-ddoc-export.d.ts +1 -1
- package/dist/package/hooks/use-export-headless-editor-content.d.ts +1 -1
- package/dist/package/types.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +3 -2
|
@@ -4,7 +4,7 @@ import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
|
|
4
4
|
import { Tab } from './tabs/utils/tab-utils';
|
|
5
5
|
|
|
6
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, onRegisterExportTrigger, toggleFocusMode, }: {
|
|
7
|
+
declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onDocxImport, isLoading, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, toggleFocusMode, }: {
|
|
8
8
|
editor: Editor | null;
|
|
9
9
|
onError?: (errorString: string) => void;
|
|
10
10
|
zoomLevel: string;
|
|
@@ -17,6 +17,7 @@ declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavb
|
|
|
17
17
|
onPdfExport?: () => void;
|
|
18
18
|
onHtmlExport?: () => void;
|
|
19
19
|
onTxtExport?: () => void;
|
|
20
|
+
onOdtExport?: () => void;
|
|
20
21
|
onDocxImport?: () => void;
|
|
21
22
|
isLoading: boolean;
|
|
22
23
|
fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
|
|
@@ -56,7 +56,7 @@ export declare const IMG_UPLOAD_SETTINGS: {
|
|
|
56
56
|
errorMsg: string;
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
-
export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, }: {
|
|
59
|
+
export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, }: {
|
|
60
60
|
editor: Editor | null;
|
|
61
61
|
onError?: (errorString: string) => void;
|
|
62
62
|
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
|
@@ -65,6 +65,7 @@ export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, on
|
|
|
65
65
|
onPdfExport?: () => void;
|
|
66
66
|
onHtmlExport?: () => void;
|
|
67
67
|
onTxtExport?: () => void;
|
|
68
|
+
onOdtExport?: () => void;
|
|
68
69
|
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
69
70
|
url: string;
|
|
70
71
|
file: File;
|
|
@@ -15,10 +15,11 @@ interface PreviewModeExportTriggerProps {
|
|
|
15
15
|
onPdfExport?: DdocProps['onPdfExport'];
|
|
16
16
|
onHtmlExport?: DdocProps['onHtmlExport'];
|
|
17
17
|
onTxtExport?: DdocProps['onTxtExport'];
|
|
18
|
+
onOdtExport?: DdocProps['onOdtExport'];
|
|
18
19
|
ipfsImageFetchFn?: DdocProps['ipfsImageFetchFn'];
|
|
19
20
|
onDocxImport?: DdocProps['onDocxImport'];
|
|
20
21
|
fetchV1ImageFn?: DdocProps['fetchV1ImageFn'];
|
|
21
22
|
isConnected?: DdocProps['isConnected'];
|
|
22
23
|
}
|
|
23
|
-
declare const PreviewModeExportTrigger: ({ editor, ydoc, tabs, onRegisterExportTrigger, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, isConnected, }: PreviewModeExportTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const PreviewModeExportTrigger: ({ editor, ydoc, tabs, onRegisterExportTrigger, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, isConnected, }: PreviewModeExportTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export { PreviewModeExportTrigger };
|
|
@@ -22,7 +22,7 @@ declare module '@tiptap/core' {
|
|
|
22
22
|
declare const MarkdownPasteHandler: (ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
23
23
|
url: string;
|
|
24
24
|
file: File;
|
|
25
|
-
}>, fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined
|
|
25
|
+
}>, fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>, onError?: (error: string) => void) => Extension<any, any>;
|
|
26
26
|
export declare const stripFrontmatter: (markdown: string) => string;
|
|
27
27
|
export declare function handleMarkdownContent(view: any, content: string, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>): Promise<void>;
|
|
28
28
|
export default MarkdownPasteHandler;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
import { IpfsImageFetchPayload } from '../../types';
|
|
3
|
+
|
|
4
|
+
declare module '@tiptap/core' {
|
|
5
|
+
interface Commands {
|
|
6
|
+
exportOdtFile: {
|
|
7
|
+
exportOdtFile: (props?: {
|
|
8
|
+
title?: string;
|
|
9
|
+
}) => any;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Preprocess TipTap HTML for odf-kit compatibility:
|
|
15
|
+
* - Convert task lists to standard lists with checkbox text prefixes
|
|
16
|
+
* - Replace <img> tags with warning text (odf-kit v1 skips images)
|
|
17
|
+
* - Convert callouts (<aside>) to blockquotes
|
|
18
|
+
* - Convert Twitter embeds to links
|
|
19
|
+
* - Convert iframes (YouTube, SoundCloud, etc.) to links
|
|
20
|
+
* - Strip TipTap-specific data attributes
|
|
21
|
+
* - Convert void elements to self-closing XHTML for the XML parser
|
|
22
|
+
*/
|
|
23
|
+
export declare function preprocessHtml(html: string): {
|
|
24
|
+
html: string;
|
|
25
|
+
};
|
|
26
|
+
declare const OdtExportExtension: (ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
27
|
+
url: string;
|
|
28
|
+
file: File;
|
|
29
|
+
}>, fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>) => Extension<any, any>;
|
|
30
|
+
export default OdtExportExtension;
|
|
@@ -10,7 +10,7 @@ interface UseDdocExportArgs {
|
|
|
10
10
|
exportOptions: (IEditorToolElement | null)[];
|
|
11
11
|
}
|
|
12
12
|
declare const useDdocExport: ({ editor, tabs, ydoc, exportOptions, }: UseDdocExportArgs) => {
|
|
13
|
-
getOptionFormat: (title: string) => "" | "md" | "pdf" | "html" | "txt";
|
|
13
|
+
getOptionFormat: (title: string) => "" | "md" | "pdf" | "html" | "txt" | "odt";
|
|
14
14
|
formatSelectOptions: {
|
|
15
15
|
id: string;
|
|
16
16
|
label: string;
|
|
@@ -3,7 +3,7 @@ import { DdocExportModalProps } from '../components/export-modal';
|
|
|
3
3
|
import { UseHeadlessEditorProps } from './use-headless-editor';
|
|
4
4
|
|
|
5
5
|
import * as Y from 'yjs';
|
|
6
|
-
export type HeadlessEditorExportFormat = 'pdf' | 'md' | 'html' | 'txt';
|
|
6
|
+
export type HeadlessEditorExportFormat = 'pdf' | 'md' | 'html' | 'txt' | 'odt';
|
|
7
7
|
export interface HeadlessEditorExportOption {
|
|
8
8
|
content: string;
|
|
9
9
|
fileName?: string;
|
package/dist/package/types.d.ts
CHANGED
|
@@ -165,6 +165,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
165
165
|
onPdfExport?: () => void;
|
|
166
166
|
onHtmlExport?: () => void;
|
|
167
167
|
onTxtExport?: () => void;
|
|
168
|
+
onOdtExport?: () => void;
|
|
168
169
|
onDocxImport?: () => void;
|
|
169
170
|
sharedSlidesLink?: string;
|
|
170
171
|
documentName?: string;
|