@fileverse-dev/ddoc 3.0.97-sepia-3 → 3.0.98-odfkit-1
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 +24543 -24661
- package/dist/package/components/editor-toolbar.d.ts +2 -1
- package/dist/package/components/editor-utils.d.ts +2 -1
- package/dist/package/components/presentation-mode/presentation-mode.d.ts +2 -2
- package/dist/package/components/presentation-mode/preview-panel.d.ts +2 -2
- package/dist/package/components/preview-export-trigger.d.ts +2 -1
- package/dist/package/context/editor-context.d.ts +3 -3
- package/dist/package/extensions/odt-export/index.d.ts +19 -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/hooks/use-tab-editor.d.ts +2 -2
- package/dist/package/types.d.ts +2 -4
- package/dist/package/utils/colors.d.ts +1 -3
- package/dist/package/utils/document-styling.d.ts +3 -3
- package/dist/style.css +1 -1
- package/package.json +5 -4
|
@@ -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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
|
2
|
-
import { IpfsImageFetchPayload, DdocProps
|
|
2
|
+
import { IpfsImageFetchPayload, DdocProps } from '../../types';
|
|
3
3
|
|
|
4
4
|
interface PresentationModeProps {
|
|
5
5
|
editor: Editor;
|
|
@@ -22,7 +22,7 @@ interface PresentationModeProps {
|
|
|
22
22
|
}>;
|
|
23
23
|
documentStyling?: DdocProps['documentStyling'];
|
|
24
24
|
fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
|
|
25
|
-
theme?:
|
|
25
|
+
theme?: 'light' | 'dark';
|
|
26
26
|
}
|
|
27
27
|
export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, renderThemeToggle, isContentLoading, ipfsImageFetchFn, documentStyling, fetchV1ImageFn, theme, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
28
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { DdocProps
|
|
1
|
+
import { DdocProps } from '../../types';
|
|
2
2
|
|
|
3
3
|
interface PreviewPanelProps {
|
|
4
4
|
slides: string[];
|
|
5
5
|
currentSlide: number;
|
|
6
6
|
setCurrentSlide: (index: number) => void;
|
|
7
7
|
documentStyling?: DdocProps['documentStyling'];
|
|
8
|
-
theme?:
|
|
8
|
+
theme?: 'light' | 'dark';
|
|
9
9
|
}
|
|
10
10
|
export declare const PreviewPanel: ({ slides, currentSlide, setCurrentSlide, documentStyling, theme, }: PreviewPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -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 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
-
import { DocumentStyling
|
|
2
|
+
import { DocumentStyling } from '../types';
|
|
3
3
|
|
|
4
4
|
interface EditorContextType {
|
|
5
5
|
documentStyling?: DocumentStyling;
|
|
6
|
-
theme:
|
|
6
|
+
theme: 'light' | 'dark';
|
|
7
7
|
isFocusMode: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare const EditorContext: React.Context<EditorContextType | null>;
|
|
@@ -11,7 +11,7 @@ export declare const useEditorContext: () => EditorContextType;
|
|
|
11
11
|
export declare const EditorProvider: React.FC<{
|
|
12
12
|
children: ReactNode;
|
|
13
13
|
documentStyling?: DocumentStyling;
|
|
14
|
-
theme?:
|
|
14
|
+
theme?: 'light' | 'dark';
|
|
15
15
|
isFocusMode?: boolean;
|
|
16
16
|
}>;
|
|
17
17
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Extension } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
declare module '@tiptap/core' {
|
|
4
|
+
interface Commands {
|
|
5
|
+
exportOdtFile: {
|
|
6
|
+
exportOdtFile: (props?: {
|
|
7
|
+
title?: string;
|
|
8
|
+
}) => any;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Convert markdown to ODT using pandoc-wasm.
|
|
14
|
+
* Lazily imports pandoc-wasm to avoid loading the ~58 MB WASM binary
|
|
15
|
+
* until the user actually triggers an ODT export.
|
|
16
|
+
*/
|
|
17
|
+
export declare function markdownToOdt(markdown: string): Promise<Blob>;
|
|
18
|
+
declare const OdtExportExtension: () => Extension<any, any>;
|
|
19
|
+
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" | "odt" | "html" | "txt";
|
|
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;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
2
|
-
import { DdocProps
|
|
2
|
+
import { DdocProps } from '../types';
|
|
3
3
|
import { AnyExtension, Editor } from '@tiptap/react';
|
|
4
4
|
import { ToCItemType } from '../components/toc/types';
|
|
5
5
|
import { CollabConnectionConfig, CollaborationProps } from '../sync-local/types';
|
|
@@ -45,7 +45,7 @@ interface UseTabEditorArgs {
|
|
|
45
45
|
externalExtensions?: Record<string, AnyExtension>;
|
|
46
46
|
isContentLoading?: boolean;
|
|
47
47
|
activeTabId: string;
|
|
48
|
-
theme?:
|
|
48
|
+
theme?: 'dark' | 'light';
|
|
49
49
|
editorRef?: MutableRefObject<Editor | null>;
|
|
50
50
|
}
|
|
51
51
|
export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, initialContent, collaboration, isReady, isSyncing, awareness, disableInlineComment, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, theme, editorRef, }: UseTabEditorArgs) => {
|
package/dist/package/types.d.ts
CHANGED
|
@@ -40,12 +40,9 @@ export interface CustomModel {
|
|
|
40
40
|
apiKey: string;
|
|
41
41
|
systemPrompt: string;
|
|
42
42
|
}
|
|
43
|
-
export type ThemeKey = 'light' | 'dark' | 'theme-sepia' | 'theme-pink';
|
|
44
43
|
export interface ThemeVariantValue {
|
|
45
44
|
light: string;
|
|
46
45
|
dark: string;
|
|
47
|
-
sepia?: string;
|
|
48
|
-
[key: string]: string | undefined;
|
|
49
46
|
}
|
|
50
47
|
export type DocumentStylingValue = string | ThemeVariantValue;
|
|
51
48
|
/**
|
|
@@ -122,7 +119,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
122
119
|
setIsCommentSectionOpen?: React.Dispatch<SetStateAction<boolean>>;
|
|
123
120
|
inlineCommentData?: InlineCommentData;
|
|
124
121
|
setInlineCommentData?: React.Dispatch<React.SetStateAction<InlineCommentData>>;
|
|
125
|
-
theme?:
|
|
122
|
+
theme?: 'dark' | 'light';
|
|
126
123
|
zoomLevel: string;
|
|
127
124
|
setZoomLevel: React.Dispatch<SetStateAction<string>>;
|
|
128
125
|
isNavbarVisible: boolean;
|
|
@@ -168,6 +165,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
168
165
|
onPdfExport?: () => void;
|
|
169
166
|
onHtmlExport?: () => void;
|
|
170
167
|
onTxtExport?: () => void;
|
|
168
|
+
onOdtExport?: () => void;
|
|
171
169
|
onDocxImport?: () => void;
|
|
172
170
|
sharedSlidesLink?: string;
|
|
173
171
|
documentName?: string;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ThemeKey } from '../types';
|
|
2
|
-
|
|
3
1
|
export declare const colors: {
|
|
4
2
|
color: string;
|
|
5
3
|
code: string;
|
|
@@ -9,4 +7,4 @@ export declare const textColors: {
|
|
|
9
7
|
light: string;
|
|
10
8
|
dark: string;
|
|
11
9
|
}[];
|
|
12
|
-
export declare const getResponsiveColor: (color?: string, theme?:
|
|
10
|
+
export declare const getResponsiveColor: (color?: string, theme?: "light" | "dark") => string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DocumentStylingValue,
|
|
1
|
+
import { DocumentStylingValue, ThemeVariantValue } from '../types';
|
|
2
2
|
|
|
3
3
|
export declare const isThemeVariantValue: (value: DocumentStylingValue | undefined) => value is ThemeVariantValue;
|
|
4
|
-
export declare const getThemeStyle: (value?: DocumentStylingValue, theme?:
|
|
5
|
-
export declare const getResponsiveThemeTextColor: (value?: DocumentStylingValue, theme?:
|
|
4
|
+
export declare const getThemeStyle: (value?: DocumentStylingValue, theme?: "light" | "dark") => string | undefined;
|
|
5
|
+
export declare const getResponsiveThemeTextColor: (value?: DocumentStylingValue, theme?: "light" | "dark") => string | undefined;
|