@fileverse-dev/ddoc 3.4.6 → 3.4.8-mp-fixes-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 +38378 -37693
- package/dist/package/components/editor-bubble-menu/editor-bubble-menu.d.ts +2 -1
- package/dist/package/components/editor-toolbar.d.ts +3 -3
- package/dist/package/components/mobile-toolbar.d.ts +4 -3
- package/dist/package/extensions/d-block/dblock-collapse.d.ts +37 -0
- package/dist/package/extensions/d-block/dblock-media-plugin.d.ts +22 -0
- package/dist/package/extensions/d-block/dblock-node-view.d.ts +34 -3
- package/dist/package/extensions/d-block/dblock-runtime.d.ts +11 -0
- package/dist/package/extensions/d-block/dblock-toolbar.d.ts +9 -0
- package/dist/package/extensions/d-block/dblock-view-registry.d.ts +16 -0
- package/dist/package/extensions/d-block/dblock.d.ts +3 -0
- package/dist/package/extensions/default-extension.d.ts +5 -2
- package/dist/package/extensions/table-of-contents.d.ts +11 -0
- package/dist/package/hooks/use-content-item-actions.d.ts +6 -1
- package/dist/package/hooks/use-tab-editor-cache.d.ts +24 -0
- package/dist/package/hooks/use-tab-editor.d.ts +5 -1
- package/dist/package/use-ddoc-editor.d.ts +6 -1
- package/dist/package/utils/y-prosemirror-cleanup.d.ts +5 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/package/extensions/d-block/use-heading-collapse.d.ts +0 -17
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { EditorBubbleMenuProps } from './types';
|
|
2
3
|
|
|
3
|
-
export declare const EditorBubbleMenu: (props: EditorBubbleMenuProps) => import("react/jsx-runtime").JSX.Element | null
|
|
4
|
+
export declare const EditorBubbleMenu: React.MemoExoticComponent<(props: EditorBubbleMenuProps) => import("react/jsx-runtime").JSX.Element | null>;
|
|
@@ -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
|
|
7
|
+
declare const MemoizedTiptapToolBar: React.MemoExoticComponent<({ editor, onError, isPresentationMode, setIsPresentationMode, enableCollaboration, 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
|
isPresentationMode?: boolean;
|
|
@@ -33,5 +33,5 @@ declare const TiptapToolBar: ({ editor, onError, isPresentationMode, setIsPresen
|
|
|
33
33
|
ydoc: Y.Doc;
|
|
34
34
|
toggleFocusMode?: () => void;
|
|
35
35
|
onRegisterExportTrigger?: ((trigger: ((format?: string, name?: string) => void) | null) => void) | undefined;
|
|
36
|
-
}) => import("react/jsx-runtime").JSX.Element
|
|
37
|
-
export default
|
|
36
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
37
|
+
export default MemoizedTiptapToolBar;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { Editor } from '@tiptap/react';
|
|
2
3
|
import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
|
3
4
|
|
|
4
|
-
declare const
|
|
5
|
+
declare const MemoizedMobileToolbar: React.MemoExoticComponent<({ editor, onError, isKeyboardVisible, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, isLoading, ipfsImageFetchFn, fetchV1ImageFn, }: {
|
|
5
6
|
editor: Editor | null;
|
|
6
7
|
onError?: (errorString: string) => void;
|
|
7
8
|
isKeyboardVisible: boolean;
|
|
@@ -14,5 +15,5 @@ declare const MobileToolbar: ({ editor, onError, isKeyboardVisible, isNavbarVisi
|
|
|
14
15
|
file: File;
|
|
15
16
|
}>;
|
|
16
17
|
fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
|
|
17
|
-
}) => import("react/jsx-runtime").JSX.Element
|
|
18
|
-
export default
|
|
18
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
19
|
+
export default MemoizedMobileToolbar;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
+
import { EditorState, Plugin, PluginKey, Transaction } from '@tiptap/pm/state';
|
|
4
|
+
import { DecorationSet } from '@tiptap/pm/view';
|
|
5
|
+
|
|
6
|
+
export declare const DBLOCK_HIDDEN_CLASS = "d-block-hidden";
|
|
7
|
+
export interface HeadingLookup {
|
|
8
|
+
id: string;
|
|
9
|
+
level: number;
|
|
10
|
+
position: number;
|
|
11
|
+
children: string[];
|
|
12
|
+
parent?: string;
|
|
13
|
+
}
|
|
14
|
+
export type HeadingLookupMap = Map<string, HeadingLookup>;
|
|
15
|
+
export interface DBlockRenderMeta {
|
|
16
|
+
isHeading: boolean;
|
|
17
|
+
headingId: string | null;
|
|
18
|
+
isThisHeadingCollapsed: boolean;
|
|
19
|
+
headingAlignment?: string;
|
|
20
|
+
isTable: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface DBlockCollapsePluginState {
|
|
23
|
+
decorations: DecorationSet;
|
|
24
|
+
structureSignature: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const getDBlockRenderMeta: (node: ProseMirrorNode, pos: number) => DBlockRenderMeta;
|
|
27
|
+
export declare const getHeadingAlignmentClass: (alignment?: string) => "justify-center" | "justify-end" | "justify-start";
|
|
28
|
+
export declare const getHeadingLinkSlug: (node: ProseMirrorNode, pos: number) => string | null;
|
|
29
|
+
export declare const buildHeadingMap: (doc: ProseMirrorNode) => HeadingLookupMap;
|
|
30
|
+
export declare const shouldHideDBlock: (doc: ProseMirrorNode, node: ProseMirrorNode, position: number, headingMap: HeadingLookupMap) => boolean;
|
|
31
|
+
export declare const findEndOfCollapsedContent: (doc: ProseMirrorNode, headingPos: number) => number;
|
|
32
|
+
export declare const buildToggleHeadingCollapseTransaction: (state: EditorState, position: number) => Transaction | null;
|
|
33
|
+
export declare const toggleHeadingCollapse: (editor: Editor, position: number) => boolean;
|
|
34
|
+
export declare const expandHeadingContent: (editor: Editor, nodePos: number) => boolean;
|
|
35
|
+
export declare const dBlockCollapsePluginKey: PluginKey<DBlockCollapsePluginState>;
|
|
36
|
+
export declare const createDBlockCollapsePlugin: () => Plugin<DBlockCollapsePluginState>;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
import { Plugin } from '@tiptap/pm/state';
|
|
3
|
+
import { DBlockRuntimeState } from './dblock-runtime';
|
|
4
|
+
|
|
5
|
+
type MediaCandidate = {
|
|
6
|
+
type: 'img';
|
|
7
|
+
src: string;
|
|
8
|
+
from: number;
|
|
9
|
+
to: number;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'iframe';
|
|
12
|
+
src: string;
|
|
13
|
+
from: number;
|
|
14
|
+
to: number;
|
|
15
|
+
};
|
|
16
|
+
interface MediaPluginState {
|
|
17
|
+
version: number;
|
|
18
|
+
shouldScan: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const getDBlockMediaCandidate: (node: ProseMirrorNode, position: number) => MediaCandidate | null;
|
|
21
|
+
export declare const createDBlockMediaConversionPlugin: (getRuntimeState?: () => DBlockRuntimeState) => Plugin<MediaPluginState>;
|
|
22
|
+
export {};
|
|
@@ -1,4 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
3
|
+
import { Decoration, NodeView, ViewMutationRecord } from '@tiptap/pm/view';
|
|
4
|
+
import { DBlockRuntimeState } from './dblock-runtime';
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
interface DBlockNodeViewOptions {
|
|
7
|
+
editor: Editor;
|
|
8
|
+
node: ProseMirrorNode;
|
|
9
|
+
getPos: () => number;
|
|
10
|
+
decorations: readonly Decoration[];
|
|
11
|
+
HTMLAttributes: Record<string, unknown>;
|
|
12
|
+
getRuntimeState?: () => DBlockRuntimeState;
|
|
13
|
+
onCopyHeadingLink?: (link: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare class DBlockNodeView implements NodeView {
|
|
16
|
+
node: ProseMirrorNode;
|
|
17
|
+
editor: Editor;
|
|
18
|
+
getPos: () => number;
|
|
19
|
+
dom: HTMLDivElement;
|
|
20
|
+
gutterElement: HTMLElement;
|
|
21
|
+
contentElement: HTMLDivElement;
|
|
22
|
+
contentDOM: HTMLDivElement;
|
|
23
|
+
private id;
|
|
24
|
+
private decorations;
|
|
25
|
+
private getRuntimeState?;
|
|
26
|
+
private unregister;
|
|
27
|
+
constructor({ editor, node, getPos, decorations, HTMLAttributes, getRuntimeState, onCopyHeadingLink, }: DBlockNodeViewOptions);
|
|
28
|
+
update(node: ProseMirrorNode, decorations: readonly Decoration[]): boolean;
|
|
29
|
+
ignoreMutation(mutation: ViewMutationRecord): boolean;
|
|
30
|
+
stopEvent(event: Event): boolean;
|
|
31
|
+
destroy(): void;
|
|
32
|
+
private syncDOM;
|
|
33
|
+
private safeGetPos;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DBlockRuntimeState {
|
|
2
|
+
isPreviewMode: boolean;
|
|
3
|
+
isPresentationMode: boolean;
|
|
4
|
+
isPreviewEditor: boolean;
|
|
5
|
+
isCollaboratorsDoc: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const DEFAULT_DBLOCK_RUNTIME_STATE: DBlockRuntimeState;
|
|
8
|
+
export type DBlockRuntimeStateRef = {
|
|
9
|
+
current: DBlockRuntimeState;
|
|
10
|
+
};
|
|
11
|
+
export declare const getDBlockRuntimeState: (getRuntimeState?: () => DBlockRuntimeState) => DBlockRuntimeState;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Editor } from '@tiptap/react';
|
|
3
|
+
import { DBlockRuntimeState } from './dblock-runtime';
|
|
4
|
+
|
|
5
|
+
export declare const DBlockToolbarProvider: ({ children, editor, runtimeState, }: {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
editor: Editor | null;
|
|
8
|
+
runtimeState?: DBlockRuntimeState;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
|
2
|
+
|
|
3
|
+
export interface DBlockViewHandle {
|
|
4
|
+
id: string;
|
|
5
|
+
dom: HTMLElement;
|
|
6
|
+
gutterElement: HTMLElement;
|
|
7
|
+
contentElement: HTMLElement;
|
|
8
|
+
getPos: () => number;
|
|
9
|
+
getNode: () => ProseMirrorNode;
|
|
10
|
+
refresh: () => void;
|
|
11
|
+
onCopyHeadingLink?: (link: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const registerDBlockView: (handle: DBlockViewHandle) => () => void;
|
|
14
|
+
export declare const getDBlockViewFromElement: (element: Element | null) => DBlockViewHandle | null;
|
|
15
|
+
export declare const getDBlockViewFromEventTarget: (target: EventTarget | null) => DBlockViewHandle | null;
|
|
16
|
+
export declare const refreshRegisteredDBlockViews: () => void;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Node } from '@tiptap/core';
|
|
2
2
|
import { IpfsImageUploadResponse } from '../../types';
|
|
3
|
+
import { DBlockRuntimeState } from './dblock-runtime';
|
|
3
4
|
|
|
4
5
|
export interface DBlockOptions {
|
|
5
6
|
HTMLAttributes: Record<string, any>;
|
|
6
7
|
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
|
7
8
|
onCopyHeadingLink?: (link: string) => void;
|
|
8
9
|
hasAvailableModels: boolean;
|
|
10
|
+
getRuntimeState?: () => DBlockRuntimeState;
|
|
9
11
|
}
|
|
10
12
|
declare module '@tiptap/core' {
|
|
11
13
|
interface Commands<ReturnType> {
|
|
@@ -15,3 +17,4 @@ declare module '@tiptap/core' {
|
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
export declare const DBlock: Node<DBlockOptions, any>;
|
|
20
|
+
export declare const createDBlockExtension: (options?: Partial<DBlockOptions>) => Node<DBlockOptions, any>;
|
|
@@ -2,8 +2,9 @@ import { NodeType } from '@tiptap/pm/model';
|
|
|
2
2
|
import { InputRule } from '@tiptap/core';
|
|
3
3
|
import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
|
4
4
|
import { ToCItemType } from '../components/toc/types';
|
|
5
|
+
import { DBlockRuntimeStateRef } from './d-block/dblock-runtime';
|
|
5
6
|
|
|
6
|
-
export declare const defaultExtensions: ({ ipfsImageFetchFn, onError, metadataProxyUrl, onCopyHeadingLink, ipfsImageUploadFn, fetchV1ImageFn, onTocUpdate, }: {
|
|
7
|
+
export declare const defaultExtensions: ({ ipfsImageFetchFn, onError, metadataProxyUrl, onCopyHeadingLink, ipfsImageUploadFn, fetchV1ImageFn, onTocUpdate, dBlockRuntimeStateRef, hasAvailableModels, }: {
|
|
7
8
|
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
|
8
9
|
url: string;
|
|
9
10
|
file: File;
|
|
@@ -14,5 +15,7 @@ export declare const defaultExtensions: ({ ipfsImageFetchFn, onError, metadataPr
|
|
|
14
15
|
onCopyHeadingLink?: (link: string) => void;
|
|
15
16
|
fetchV1ImageFn?: (url: string) => Promise<ArrayBuffer | undefined>;
|
|
16
17
|
onTocUpdate?: (data: ToCItemType[], isCreate?: boolean) => void;
|
|
17
|
-
|
|
18
|
+
dBlockRuntimeStateRef?: DBlockRuntimeStateRef;
|
|
19
|
+
hasAvailableModels?: boolean;
|
|
20
|
+
}) => (import('@tiptap/core').AnyExtension | 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').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').Mark<import('@tiptap/extension-text-style').TextStyleOptions, any> | import('@tiptap/core').Mark<import('@tiptap/extension-subscript').SubscriptExtensionOptions, any> | 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-typography').TypographyOptions, 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').BulletListOptions, 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>)[];
|
|
18
21
|
export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { TableOfContentsStorage } from '@tiptap/extension-table-of-contents';
|
|
3
|
+
|
|
4
|
+
type EditorWithTableOfContentsStorage = {
|
|
5
|
+
storage?: {
|
|
6
|
+
tableOfContents?: TableOfContentsStorage | null;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export declare const clearTableOfContentsStorage: (target: Editor | EditorWithTableOfContentsStorage | TableOfContentsStorage | null | undefined) => boolean;
|
|
10
|
+
export declare const DdocTableOfContents: import('@tiptap/core').Extension<import('@tiptap/extension-table-of-contents').TableOfContentsOptions, TableOfContentsStorage>;
|
|
11
|
+
export {};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { Node } from '@tiptap/pm/model';
|
|
2
2
|
import { Editor } from '@tiptap/react';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export interface ResolvedContentItem {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
node: Node;
|
|
7
|
+
pos: number;
|
|
8
|
+
}
|
|
9
|
+
declare const useContentItemActions: (editor: Editor, resolveCurrentBlock: () => ResolvedContentItem | null) => {
|
|
5
10
|
resetTextFormatting: () => void;
|
|
6
11
|
duplicateNode: () => void;
|
|
7
12
|
copyNodeToClipboard: () => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { Editor } from '@tiptap/react';
|
|
3
|
+
|
|
4
|
+
export interface CachedTabEditorRenderEntry {
|
|
5
|
+
tabId: string;
|
|
6
|
+
editor: Editor;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface UseTabEditorCacheArgs {
|
|
10
|
+
activeTabId: string;
|
|
11
|
+
tabIds?: string[];
|
|
12
|
+
activeTabIdRef: MutableRefObject<string>;
|
|
13
|
+
activeEditorRef: MutableRefObject<Editor | null>;
|
|
14
|
+
editorRef?: MutableRefObject<Editor | null>;
|
|
15
|
+
readyState: boolean;
|
|
16
|
+
createEditorForTab: (tabId: string) => Editor;
|
|
17
|
+
destroyEditor: (editor: Editor) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const useTabEditorCache: ({ activeTabId, tabIds, activeTabIdRef, activeEditorRef, editorRef, readyState, createEditorForTab, destroyEditor, }: UseTabEditorCacheArgs) => {
|
|
20
|
+
editor: Editor | null;
|
|
21
|
+
cachedEditorEntries: CachedTabEditorRenderEntry[];
|
|
22
|
+
destroyAllCachedEditors: () => void;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
|
2
2
|
import { DdocProps, SerializedCommentAnchor, ThemeKey } from '../types';
|
|
3
3
|
import { AnyExtension, Editor } from '@tiptap/react';
|
|
4
4
|
import { CommentAnchor } from '../extensions/comment/comment-decoration-plugin';
|
|
5
|
+
import { DBlockRuntimeStateRef } from '../extensions/d-block/dblock-runtime';
|
|
5
6
|
import { ToCItemType } from '../components/toc/types';
|
|
6
7
|
import { CollabConnectionConfig, CollaborationProps } from '../sync-local/types';
|
|
7
8
|
|
|
@@ -48,12 +49,15 @@ interface UseTabEditorArgs {
|
|
|
48
49
|
externalExtensions?: Record<string, AnyExtension>;
|
|
49
50
|
isContentLoading?: boolean;
|
|
50
51
|
activeTabId: string;
|
|
52
|
+
tabIds?: string[];
|
|
51
53
|
theme?: ThemeKey;
|
|
52
54
|
editorRef?: MutableRefObject<Editor | null>;
|
|
53
55
|
initialCommentAnchors?: SerializedCommentAnchor[];
|
|
56
|
+
dBlockRuntimeStateRef?: DBlockRuntimeStateRef;
|
|
54
57
|
}
|
|
55
|
-
export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, viewerMode, initialContent, collaboration, isReady, isSyncing, awareness, disableInlineComment, isFocusMode, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect, hasCollabContentInitialised, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, theme, editorRef, initialCommentAnchors, }: UseTabEditorArgs) => {
|
|
58
|
+
export declare const useTabEditor: ({ ydoc, isVersionMode, hasTabState, versionId, isPreviewMode, viewerMode, initialContent, collaboration, isReady, isSyncing, awareness, disableInlineComment, isFocusMode, onCommentInteraction, onError, ipfsImageUploadFn, metadataProxyUrl, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, setCharacterCount, setWordCount, setPageCount, setIsContentLoading, setIsCollabContentLoading, unFocused, zoomLevel, isPresentationMode, onInvalidContentError, ignoreCorruptedData, onCollaboratorChange, onConnect, hasCollabContentInitialised, initialiseYjsIndexedDbProvider, externalExtensions, isContentLoading, activeTabId, tabIds, theme, editorRef, initialCommentAnchors, dBlockRuntimeStateRef, }: UseTabEditorArgs) => {
|
|
56
59
|
editor: Editor | null;
|
|
60
|
+
cachedEditorEntries: import('./use-tab-editor-cache').CachedTabEditorRenderEntry[];
|
|
57
61
|
ref: import('react').RefObject<HTMLDivElement>;
|
|
58
62
|
slides: string[];
|
|
59
63
|
setSlides: Dispatch<SetStateAction<string[]>>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { DdocProps } from './types';
|
|
2
2
|
import { Editor } from '@tiptap/react';
|
|
3
|
+
import { DBlockRuntimeState } from './extensions/d-block/dblock-runtime';
|
|
3
4
|
|
|
4
|
-
export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent, versionHistoryState, collaboration, onChange, onCollaboratorChange, onCommentInteraction, onError, setCharacterCount, setWordCount, setPageCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, isFocusMode, theme, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, onIndexedDbError, disableInlineComment, initialCommentAnchors, ...rest }: Partial<DdocProps> & {
|
|
5
|
+
export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent, versionHistoryState, collaboration, onChange, onCollaboratorChange, onCommentInteraction, onError, setCharacterCount, setWordCount, setPageCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, isFocusMode, theme, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, fetchV1ImageFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, onIndexedDbError, disableInlineComment, initialCommentAnchors, isPreviewEditor, ...rest }: Partial<DdocProps> & {
|
|
5
6
|
isFocusMode?: boolean;
|
|
7
|
+
isPreviewEditor?: boolean;
|
|
6
8
|
}) => {
|
|
7
9
|
ydoc: import('yjs').Doc;
|
|
8
10
|
awareness: import('y-protocols/awareness.js').Awareness | null;
|
|
@@ -11,6 +13,8 @@ export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent
|
|
|
11
13
|
isContentLoading: boolean;
|
|
12
14
|
tabs: import('./components/tabs/utils/tab-utils').Tab[];
|
|
13
15
|
hasTabState: boolean;
|
|
16
|
+
dBlockRuntimeState: DBlockRuntimeState;
|
|
17
|
+
dBlockRuntimeStateRef: import('react').MutableRefObject<DBlockRuntimeState>;
|
|
14
18
|
isVersionMode: boolean;
|
|
15
19
|
activeTabId: string;
|
|
16
20
|
setTabs: import('react').Dispatch<import('react').SetStateAction<import('./components/tabs/utils/tab-utils').Tab[]>>;
|
|
@@ -32,6 +36,7 @@ export declare const useDdocEditor: ({ isPreviewMode, viewerMode, initialContent
|
|
|
32
36
|
flushPendingUpdate: () => void;
|
|
33
37
|
collabState: import('./types').CollabState;
|
|
34
38
|
editor: Editor | null;
|
|
39
|
+
cachedEditorEntries: import('./hooks/use-tab-editor-cache').CachedTabEditorRenderEntry[];
|
|
35
40
|
ref: import('react').RefObject<HTMLDivElement>;
|
|
36
41
|
slides: string[];
|
|
37
42
|
setSlides: import('react').Dispatch<import('react').SetStateAction<string[]>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
export declare const cleanupYProsemirrorBinding: (editor: Editor | null | undefined) => void;
|
|
4
|
+
export declare const cleanupYUndoManager: (editor: Editor | null | undefined) => void;
|
|
5
|
+
export declare const destroyEditorWithYSyncCleanup: (editor: Editor | null | undefined) => void;
|