@fileverse-dev/ddoc 7.2.3 → 7.2.5-tiptap.0
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/headless-editor-utils.es.js +1 -1
- package/dist/{index-BljnoTGY.mjs → index-D_ppfbYw.mjs} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +9032 -8322
- package/dist/package/components/editor-toolbar.d.ts +3 -1
- package/dist/package/components/editor-utils.d.ts +4 -2
- package/dist/package/components/import-export-button.d.ts +3 -1
- package/dist/package/components/preview-export-trigger.d.ts +2 -1
- package/dist/package/extensions/blockquote.d.ts +1 -0
- package/dist/package/extensions/caret-marks/dispatch-context.d.ts +2 -0
- package/dist/package/extensions/caret-marks/test-helpers.d.ts +1 -0
- package/dist/package/extensions/comment/comment-decoration-plugin.d.ts +1 -1
- package/dist/package/extensions/cover-selection-node-view.d.ts +5 -0
- package/dist/package/extensions/custom-link/index.d.ts +2 -0
- package/dist/package/extensions/default-extension.d.ts +1 -1
- package/dist/package/extensions/input-rule-undo-group.d.ts +3 -0
- package/dist/package/extensions/ordered-list.d.ts +1 -0
- package/dist/package/extensions/supercharged-table/extension-table/table.d.ts +1 -1
- package/dist/package/extensions/supercharged-table/extension-table-row/table-row-node-view.d.ts +1 -1
- package/dist/package/extensions/typography.d.ts +1 -0
- package/dist/package/hooks/use-ddoc-export.d.ts +3 -1
- package/dist/package/hooks/use-tab-editor.d.ts +8 -0
- package/dist/package/types.d.ts +6 -0
- package/dist/package/utils/color-utils.d.ts +7 -0
- package/dist/package/utils/export-watchdog.d.ts +5 -0
- package/dist/package/utils/handle-print.d.ts +1 -1
- package/dist/package/utils/mount-editor-content.d.ts +8 -0
- package/dist/{use-headless-editor-BVgpWreQ.mjs → use-headless-editor-CjTkqBM4.mjs} +17127 -14930
- package/package.json +33 -34
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { Editor } from '@tiptap/react';
|
|
3
3
|
import { FontDescriptor, IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
|
4
|
+
import { ExportErrorHandler } from '../utils/export-watchdog';
|
|
4
5
|
import { Tab } from './tabs/utils/tab-utils';
|
|
5
6
|
|
|
6
7
|
import * as Y from 'yjs';
|
|
7
|
-
declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onError, isPresentationMode, setIsPresentationMode, enableCollaboration, isNavbarVisible, setIsNavbarVisible, showNavbarToggle, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onDocxImport, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, toggleFocusMode, isSplitView, onToggleSplitView, fonts: consumerFonts, renderToolbarLeading, }: {
|
|
8
|
+
declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onError, isPresentationMode, setIsPresentationMode, enableCollaboration, isNavbarVisible, setIsNavbarVisible, showNavbarToggle, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onExportError, onDocxImport, ipfsImageFetchFn, fetchV1ImageFn, isConnected, tabs, ydoc, onRegisterExportTrigger, toggleFocusMode, isSplitView, onToggleSplitView, fonts: consumerFonts, renderToolbarLeading, }: {
|
|
8
9
|
editor: Editor | null;
|
|
9
10
|
onError?: (errorString: string) => void;
|
|
10
11
|
isPresentationMode?: boolean;
|
|
@@ -20,6 +21,7 @@ declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onErro
|
|
|
20
21
|
onHtmlExport?: () => void;
|
|
21
22
|
onTxtExport?: () => void;
|
|
22
23
|
onOdtExport?: () => void;
|
|
24
|
+
onExportError?: ExportErrorHandler;
|
|
23
25
|
onDocxImport?: () => void;
|
|
24
26
|
fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
|
|
25
27
|
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
@@ -3,11 +3,12 @@ import { FontDescriptor, IpfsImageFetchPayload, IpfsImageUploadResponse } from '
|
|
|
3
3
|
import { IEditorTool } from '../hooks/use-visibility';
|
|
4
4
|
import { Editor } from '@tiptap/react';
|
|
5
5
|
import { EditorProps } from '@tiptap/pm/view';
|
|
6
|
+
import { ExportErrorHandler } from '../utils/export-watchdog';
|
|
6
7
|
|
|
7
8
|
export interface IEditorToolElement {
|
|
8
9
|
icon: any;
|
|
9
10
|
title: string;
|
|
10
|
-
onClick: (name?: string) => void
|
|
11
|
+
onClick: (name?: string) => void | Promise<void>;
|
|
11
12
|
isActive: boolean;
|
|
12
13
|
group?: string;
|
|
13
14
|
isNew?: boolean;
|
|
@@ -52,7 +53,7 @@ export declare function shortcutAction(event: Pick<KeyboardEvent, 'key' | 'metaK
|
|
|
52
53
|
* `editor.setOptions({ editorProps: ... })` directly.
|
|
53
54
|
*/
|
|
54
55
|
export declare const mergeEditorProps: (editor: Editor, patch: Partial<EditorProps>) => void;
|
|
55
|
-
export declare const useEditorToolbar: ({ editor, onError, isPresentationMode, setIsPresentationMode, enableCollaboration, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, }: {
|
|
56
|
+
export declare const useEditorToolbar: ({ editor, onError, isPresentationMode, setIsPresentationMode, enableCollaboration, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onExportError, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, }: {
|
|
56
57
|
editor: Editor | null;
|
|
57
58
|
isPresentationMode?: boolean;
|
|
58
59
|
setIsPresentationMode?: () => void;
|
|
@@ -65,6 +66,7 @@ export declare const useEditorToolbar: ({ editor, onError, isPresentationMode, s
|
|
|
65
66
|
onHtmlExport?: () => void;
|
|
66
67
|
onTxtExport?: () => void;
|
|
67
68
|
onOdtExport?: () => void;
|
|
69
|
+
onExportError?: ExportErrorHandler;
|
|
68
70
|
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
69
71
|
url: string;
|
|
70
72
|
file: File;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { CopyAo3Html, IEditorToolElement } from './editor-utils';
|
|
2
2
|
import { Editor } from '@tiptap/react';
|
|
3
3
|
import { Tab } from './tabs/utils/tab-utils';
|
|
4
|
+
import { ExportErrorHandler } from '../utils/export-watchdog';
|
|
4
5
|
|
|
5
6
|
import * as Y from 'yjs';
|
|
6
|
-
declare const ImportExportButton: ({ fileExportsOpen, setFileExportsOpen, exportOptions, importOptions, editor, tabs, ydoc, copyAo3Html, onRegisterExportTrigger, }: {
|
|
7
|
+
declare const ImportExportButton: ({ fileExportsOpen, setFileExportsOpen, exportOptions, importOptions, editor, tabs, ydoc, copyAo3Html, onRegisterExportTrigger, onExportError, }: {
|
|
7
8
|
fileExportsOpen: boolean;
|
|
8
9
|
setFileExportsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
9
10
|
exportOptions: (IEditorToolElement | null)[];
|
|
@@ -13,5 +14,6 @@ declare const ImportExportButton: ({ fileExportsOpen, setFileExportsOpen, export
|
|
|
13
14
|
ydoc: Y.Doc;
|
|
14
15
|
copyAo3Html: CopyAo3Html;
|
|
15
16
|
onRegisterExportTrigger?: ((trigger: ((format?: string, name?: string) => void) | null) => void) | undefined;
|
|
17
|
+
onExportError?: ExportErrorHandler;
|
|
16
18
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export { ImportExportButton };
|
|
@@ -16,10 +16,11 @@ interface PreviewModeExportTriggerProps {
|
|
|
16
16
|
onHtmlExport?: DdocProps['onHtmlExport'];
|
|
17
17
|
onTxtExport?: DdocProps['onTxtExport'];
|
|
18
18
|
onOdtExport?: DdocProps['onOdtExport'];
|
|
19
|
+
onExportError?: DdocProps['onExportError'];
|
|
19
20
|
ipfsImageFetchFn?: DdocProps['ipfsImageFetchFn'];
|
|
20
21
|
onDocxImport?: DdocProps['onDocxImport'];
|
|
21
22
|
fetchV1ImageFn?: DdocProps['fetchV1ImageFn'];
|
|
22
23
|
isConnected?: DdocProps['isConnected'];
|
|
23
24
|
}
|
|
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;
|
|
25
|
+
declare const PreviewModeExportTrigger: ({ editor, ydoc, tabs, onRegisterExportTrigger, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, onHtmlExport, onTxtExport, onOdtExport, onExportError, ipfsImageFetchFn, onDocxImport, fetchV1ImageFn, isConnected, }: PreviewModeExportTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
26
|
export { PreviewModeExportTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Blockquote: import('@tiptap/core').Node<import('@tiptap/extension-blockquote').BlockquoteOptions, any>;
|
|
@@ -25,6 +25,8 @@ export type DispatchContext = {
|
|
|
25
25
|
docChanged: boolean;
|
|
26
26
|
oldCaret: OldCaret | null;
|
|
27
27
|
pending: Pending | null;
|
|
28
|
+
/** The root emptied the document from a whole-document selection. */
|
|
29
|
+
wholeDocClear: boolean;
|
|
28
30
|
};
|
|
29
31
|
export declare const EMPTY_CONTEXT: DispatchContext;
|
|
30
32
|
export declare const isRootTransaction: (tr: Transaction) => boolean;
|
|
@@ -12,6 +12,7 @@ import * as Y from 'yjs';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const makeEditor: (schemaVersion: number, content?: string | null, options?: {
|
|
14
14
|
ydoc?: Y.Doc;
|
|
15
|
+
field?: string;
|
|
15
16
|
extensions?: AnyExtension[];
|
|
16
17
|
}) => Editor;
|
|
17
18
|
export declare const track: (editor: Editor) => Editor;
|
|
@@ -51,7 +51,7 @@ export declare function resolveCommentAnchorRangeInState(anchor: Pick<CommentAnc
|
|
|
51
51
|
export declare function resolveCommentAnchorPointInState(anchor: Pick<CommentAnchor, 'anchorFrom'>, state: EditorState): number | null;
|
|
52
52
|
/** Resolve following Adds against the accepted break's persisted Yjs position. */
|
|
53
53
|
export declare function resolveSuggestionAddPointInState(anchor: CommentAnchor, state: EditorState, anchors: CommentAnchor[] | ReadonlyMap<string, CommentAnchor>): number | null;
|
|
54
|
-
export declare function hasResolvableCommentAnchorInState(anchor: Pick<CommentAnchor, 'anchorFrom' | 'anchorTo' | 'isSuggestion' | 'suggestionType'>, state: EditorState): boolean;
|
|
54
|
+
export declare function hasResolvableCommentAnchorInState(anchor: Pick<CommentAnchor, 'id' | 'anchorFrom' | 'anchorTo' | 'isSuggestion' | 'suggestionType' | 'followsSuggestionId'>, state: EditorState): boolean;
|
|
55
55
|
export declare function resolveCommentAnchorRangeForAnalysis(anchor: Pick<CommentAnchor, 'id' | 'anchorFrom' | 'anchorTo'>, state: EditorState): CommentAnchorRange | null;
|
|
56
56
|
export declare function resolveCommentAnchorPointForAnalysis(anchor: Pick<CommentAnchor, 'id' | 'anchorFrom'>, state: EditorState): number | null;
|
|
57
57
|
/**
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NodeViewRenderer } from '@tiptap/core';
|
|
2
|
+
import { ReactNodeViewProps, ReactNodeViewRendererOptions } from '@tiptap/react';
|
|
3
|
+
import { ComponentType } from 'react';
|
|
4
|
+
|
|
5
|
+
export declare function CoverSelectionNodeViewRenderer(component: ComponentType<ReactNodeViewProps>, options?: Partial<ReactNodeViewRendererOptions>): NodeViewRenderer;
|
|
@@ -8,6 +8,8 @@ export interface CustomLinkOptions extends LinkOptions {
|
|
|
8
8
|
*/
|
|
9
9
|
onForeignHeadingLink?: (message: string) => void;
|
|
10
10
|
}
|
|
11
|
+
/** What Link's paste handler passed to shouldAutoLink on Tiptap 3.11 (linkify's href). */
|
|
12
|
+
export declare const autoLinkCandidate: (url: string) => string;
|
|
11
13
|
/**
|
|
12
14
|
* Extends tiptap's Link with a paste-time hook that detects
|
|
13
15
|
* heading links pointing at headings from other dDocs and dispatches
|
|
@@ -18,5 +18,5 @@ export declare const defaultExtensions: ({ ipfsImageFetchFn, onError, metadataPr
|
|
|
18
18
|
dBlockRuntimeStateRef?: DBlockRuntimeStateRef;
|
|
19
19
|
hasAvailableModels?: boolean;
|
|
20
20
|
schemaVersion?: number;
|
|
21
|
-
}) => (import('@tiptap/core').AnyExtension | import('@tiptap/core').Mark<import('@tiptap/extension-text-style').TextStyleOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-italic').ItalicOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-horizontal-rule').HorizontalRuleOptions, any> | import('@tiptap/core').Extension<import('./multi-column').ColumnExtensionOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-heading').HeadingOptions, any> | import('@tiptap/core').Node<import('./iframe').IframeOptions, any> | import('@tiptap/core').Node<import('./twitter-embed').EmbeddedTweetOptions, any> | import('@tiptap/core').Extension<import('./d-block/dblock-collapse').FlatHeadingCollapseOptions, any> | import('@tiptap/core').Extension<import('./d-block/dblock-media-plugin').FlatMediaConversionOptions, any> | import('@tiptap/core').Node<import('./d-block').DBlockOptions, any> | import('@tiptap/core').Extension<import('./trailing-node').TrailingNodeOptions, any> | import('@tiptap/core').Node<import('./action-button').ActionButtonOptions, any> | import('@tiptap/core').Node<import('./resizable-media').MediaOptions, any> | import('@tiptap/core').Extension<import('./link-preview/link-preview').LinkPreviewOptions, any> | import('@tiptap/core').Node<import('./code-block/custom-code-block-lowlight').CustomCodeBlockLowlightOptions, any> | import('@tiptap/core').Mark<import('./custom-link').CustomLinkOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-table-of-contents').TableOfContentsOptions, import('@tiptap/extension-table-of-contents').TableOfContentsStorage> | import('@tiptap/core').Extension<import('./search-replace/search-replace').SearchAndReplaceOptions, import('./search-replace/search-replace').SearchAndReplaceStorage> | import('@tiptap/core').Extension<import('@tiptap/extension-text-style').FontFamilyOptions, any> | import('@tiptap/core').Extension<import('@tiptap/starter-kit').StarterKitOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-
|
|
21
|
+
}) => (import('@tiptap/core').Node<any, any> | import('@tiptap/core').AnyExtension | import('@tiptap/core').Mark<import('@tiptap/extension-text-style').TextStyleOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-italic').ItalicOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-horizontal-rule').HorizontalRuleOptions, any> | import('@tiptap/core').Extension<import('./multi-column').ColumnExtensionOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-heading').HeadingOptions, any> | import('@tiptap/core').Node<import('./iframe').IframeOptions, any> | import('@tiptap/core').Node<import('./twitter-embed').EmbeddedTweetOptions, any> | import('@tiptap/core').Extension<import('./d-block/dblock-collapse').FlatHeadingCollapseOptions, any> | import('@tiptap/core').Extension<import('./d-block/dblock-media-plugin').FlatMediaConversionOptions, any> | import('@tiptap/core').Node<import('./d-block').DBlockOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-list').OrderedListOptions, any> | import('@tiptap/core').Extension<import('./trailing-node').TrailingNodeOptions, any> | import('@tiptap/core').Node<import('./action-button').ActionButtonOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-typography').TypographyOptions, any> | import('@tiptap/core').Node<import('./resizable-media').MediaOptions, any> | import('@tiptap/core').Extension<import('./link-preview/link-preview').LinkPreviewOptions, any> | import('@tiptap/core').Node<import('./code-block/custom-code-block-lowlight').CustomCodeBlockLowlightOptions, any> | import('@tiptap/core').Mark<import('./custom-link').CustomLinkOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-table-of-contents').TableOfContentsOptions, import('@tiptap/extension-table-of-contents').TableOfContentsStorage> | import('@tiptap/core').Extension<import('./search-replace/search-replace').SearchAndReplaceOptions, import('./search-replace/search-replace').SearchAndReplaceStorage> | import('@tiptap/core').Extension<import('@tiptap/extension-text-style').FontFamilyOptions, any> | import('@tiptap/core').Extension<import('@tiptap/starter-kit').StarterKitOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extension-text-align').TextAlignOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').PlaceholderOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-highlight').HighlightOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-list').TaskListOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-list').TaskItemOptions, any> | import('@tiptap/core').Node<import('@tiptap/extension-list').ListItemOptions, any> | import('@tiptap/core').Extension<import('@tiptap/extensions').DropcursorOptions, any> | import('@tiptap/core').Extension<import('tiptap-markdown').MarkdownOptions, import('tiptap-markdown').MarkdownStorage> | import('@tiptap/core').Extension<import('@tiptap/extensions').CharacterCountOptions, import('@tiptap/extensions').CharacterCountStorage> | import('@tiptap/core').Extension<import('@aarkue/tiptap-math-extension').MathExtensionOption, any>)[];
|
|
22
22
|
export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OrderedList: import('@tiptap/core').Node<import('@tiptap/extension-list').OrderedListOptions, any>;
|
package/dist/package/extensions/supercharged-table/extension-table-row/table-row-node-view.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { NodeView, ViewMutationRecord } from 'prosemirror-view';
|
|
|
4
4
|
export declare class TableRowNodeView implements NodeView {
|
|
5
5
|
node: ProseMirrorNode;
|
|
6
6
|
cellMinWidth: number;
|
|
7
|
-
dom:
|
|
7
|
+
dom: HTMLElement;
|
|
8
8
|
table: HTMLTableElement;
|
|
9
9
|
colgroup: Element;
|
|
10
10
|
contentDOM: HTMLElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Typography: import('@tiptap/core').Extension<import('@tiptap/extension-typography').TypographyOptions, any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
|
2
2
|
import { CopyAo3Html, IEditorToolElement } from '../components/editor-utils';
|
|
3
3
|
import { Tab } from '../components/tabs/utils/tab-utils';
|
|
4
|
+
import { ExportErrorHandler } from '../utils/export-watchdog';
|
|
4
5
|
|
|
5
6
|
import * as Y from 'yjs';
|
|
6
7
|
interface UseDdocExportArgs {
|
|
@@ -9,8 +10,9 @@ interface UseDdocExportArgs {
|
|
|
9
10
|
ydoc: Y.Doc | null;
|
|
10
11
|
exportOptions: (IEditorToolElement | null)[];
|
|
11
12
|
copyAo3Html?: CopyAo3Html;
|
|
13
|
+
onExportError?: ExportErrorHandler;
|
|
12
14
|
}
|
|
13
|
-
declare const useDdocExport: ({ editor, tabs, ydoc, exportOptions, copyAo3Html, }: UseDdocExportArgs) => {
|
|
15
|
+
declare const useDdocExport: ({ editor, tabs, ydoc, exportOptions, copyAo3Html, onExportError, }: UseDdocExportArgs) => {
|
|
14
16
|
getOptionFormat: (title: string) => "" | "md" | "html" | "pdf" | "ao3-html" | "md-css" | "txt" | "odt";
|
|
15
17
|
formatSelectOptions: {
|
|
16
18
|
id: string;
|
|
@@ -84,4 +84,12 @@ export declare const useTabEditor: ({ ydoc, editorWidthStore, isVersionMode, has
|
|
|
84
84
|
draftAnchorsRef: MutableRefObject<CommentAnchor[]>;
|
|
85
85
|
storeApiRef: MutableRefObject<import('zustand').StoreApi<import('../stores/comment-store').CommentStoreState> | null>;
|
|
86
86
|
};
|
|
87
|
+
interface UseExtensionSyncWithCollaborationArgs {
|
|
88
|
+
editor?: Editor | null;
|
|
89
|
+
isReady?: boolean;
|
|
90
|
+
awareness?: any;
|
|
91
|
+
collaboration?: CollaborationProps;
|
|
92
|
+
collaborationCleanupRef: MutableRefObject<() => void>;
|
|
93
|
+
}
|
|
94
|
+
export declare const useExtensionSyncWithCollaboration: ({ editor, isReady, awareness, collaboration, collaborationCleanupRef, }: UseExtensionSyncWithCollaborationArgs) => void;
|
|
87
95
|
export {};
|
package/dist/package/types.d.ts
CHANGED
|
@@ -137,6 +137,11 @@ export type PageSetup = {
|
|
|
137
137
|
mode: 'pages' | 'pageless';
|
|
138
138
|
paper: 'a4' | 'letter';
|
|
139
139
|
};
|
|
140
|
+
export type ExportErrorContext = {
|
|
141
|
+
format: string;
|
|
142
|
+
/** Last step reached before the failure, e.g. `embed-images`, `print`, `timeout`. */
|
|
143
|
+
stage: string;
|
|
144
|
+
};
|
|
140
145
|
export type DdocStats = {
|
|
141
146
|
words: number;
|
|
142
147
|
characters: number;
|
|
@@ -332,6 +337,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
|
332
337
|
onHtmlExport?: () => void;
|
|
333
338
|
onTxtExport?: () => void;
|
|
334
339
|
onOdtExport?: () => void;
|
|
340
|
+
onExportError?: (error: unknown, context: ExportErrorContext) => void;
|
|
335
341
|
onDocxImport?: () => void;
|
|
336
342
|
sharedSlidesLink?: string;
|
|
337
343
|
documentName?: string;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
export declare const isBlackOrWhiteShade: (color: string) => boolean;
|
|
2
|
+
/**
|
|
3
|
+
* The paste clean-up's test. Tiptap 3.20+ stores a pasted colour as authored
|
|
4
|
+
* (`#333`, `hsl(...)`, `rgba(...)`) where browsers used to hand us
|
|
5
|
+
* `rgb(51, 51, 51)`, so any CSS colour is judged by its rgb() form, never by
|
|
6
|
+
* the hex list. Translucent colours stay `rgba(...)` and are kept.
|
|
7
|
+
*/
|
|
8
|
+
export declare const isPastedBlackOrWhiteShade: (color: string) => boolean;
|
|
2
9
|
export declare const getContrastColor: (hex: string) => "#000000" | "#ffffff";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExportErrorContext } from '../types';
|
|
2
|
+
|
|
3
|
+
export type ExportErrorHandler = (error: unknown, context: ExportErrorContext) => void;
|
|
4
|
+
/** A catch cannot see an export that hangs, so report one still running after a minute. */
|
|
5
|
+
export declare const startExportWatchdog: (format: string, getStage: () => string, onExportError?: ExportErrorHandler) => (() => void);
|
|
@@ -15,5 +15,5 @@ export type ContentPrintOptions = {
|
|
|
15
15
|
export declare const mountContentPrintHost: (content: string, options?: ContentPrintOptions) => {
|
|
16
16
|
cleanup: () => void;
|
|
17
17
|
};
|
|
18
|
-
export declare const handleContentPrint: (content: string, options?: ContentPrintOptions) => void
|
|
18
|
+
export declare const handleContentPrint: (content: string, options?: ContentPrintOptions) => Promise<void>;
|
|
19
19
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Test helper: mounts the editor in EditorContent, as every product editor is.
|
|
5
|
+
* Since @tiptap/react 3.34 a React node view (table cell, media, code block)
|
|
6
|
+
* renders an empty placeholder until then. Unmount with RTL's `cleanup`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const mountEditorContent: (editor: Editor) => Editor;
|