@fileverse-dev/ddoc 2.2.9 → 2.3.0-enableReminders-patch-2
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/README.md +10 -1
- package/dist/{ccip-DHM22k9N.mjs → ccip-DqBFD-vM.mjs} +1 -1
- package/dist/{index-DI5an1c5.mjs → index-Lzfdyy5-.mjs} +40623 -36044
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +6 -4
- package/dist/package/components/editor-bubble-menu/props.d.ts +7 -0
- package/dist/package/components/editor-bubble-menu/types.d.ts +9 -1
- package/dist/package/components/editor-toolbar.d.ts +7 -2
- package/dist/package/components/editor-utils.d.ts +7 -2
- package/dist/package/components/mobile-toolbar.d.ts +7 -2
- package/dist/package/components/presentation-mode/presentation-mode.d.ts +6 -1
- package/dist/package/components/secure-image-v2.d.ts +21 -0
- package/dist/package/extensions/d-block/dblock.d.ts +3 -2
- package/dist/package/extensions/default-extension.d.ts +11 -1
- package/dist/package/extensions/iframe/iframe.d.ts +5 -0
- package/dist/package/extensions/mardown-paste-handler/index.d.ts +10 -3
- package/dist/package/extensions/reminder-block/reminder-block.d.ts +14 -0
- package/dist/package/extensions/reminder-block/reminder-menu-renderer.d.ts +5 -0
- package/dist/package/extensions/reminder-block/reminder-menu.d.ts +3 -0
- package/dist/package/extensions/reminder-block/reminder-node-view.d.ts +3 -0
- package/dist/package/extensions/reminder-block/types.d.ts +24 -0
- package/dist/package/extensions/reminder-block/utils.d.ts +4 -0
- package/dist/package/extensions/resizable-media/media-paste-drop-plugin/media-paste-drop-plugin.d.ts +2 -1
- package/dist/package/extensions/resizable-media/resizable-media-node-view.d.ts +5 -1
- package/dist/package/extensions/resizable-media/resizable-media.d.ts +6 -3
- package/dist/package/extensions/slash-command/slash-comand.d.ts +2 -1
- package/dist/package/extensions/slash-command/slash-command-utils.d.ts +5 -3
- package/dist/package/extensions/supercharged-table/extension-table/table-view.d.ts +7 -6
- package/dist/package/extensions/supercharged-table/extension-table/table.d.ts +38 -3
- package/dist/package/extensions/supercharged-table/extension-table/utilities/col-style.d.ts +1 -0
- package/dist/package/extensions/supercharged-table/extension-table/utilities/create-cell.d.ts +1 -1
- package/dist/package/extensions/supercharged-table/extension-table/utilities/create-col-group.d.ts +18 -0
- package/dist/package/extensions/supercharged-table/extension-table/utilities/create-table.d.ts +1 -1
- package/dist/package/extensions/supercharged-table/extension-table/utilities/get-table-node-types.d.ts +1 -1
- package/dist/package/extensions/supercharged-table/extension-table/utilities/is-cell-selection.d.ts +1 -1
- package/dist/package/hooks/use-ai-writer-active-state.d.ts +6 -0
- package/dist/package/hooks/use-reminder.d.ts +16 -0
- package/dist/package/types.d.ts +21 -1
- package/dist/package/use-ddoc-editor.d.ts +1 -1
- package/dist/package/utils/helpers.d.ts +4 -0
- package/dist/package/utils/md-to-slides.d.ts +5 -1
- package/dist/package/utils/upload-images.d.ts +2 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -2,3 +2,6 @@ export { default as DdocEditor } from './package/ddoc-editor';
|
|
2
2
|
export { PreviewDdocEditor } from './package/preview-ddoc-editor';
|
3
3
|
export { handleContentPrint } from './package/utils/handle-print';
|
4
4
|
export { useHeadlessEditor } from './package/hooks/use-headless-editor';
|
5
|
+
export { ReminderBlock } from './package/extensions/reminder-block/reminder-block';
|
6
|
+
export { type Reminder, type ReminderBlockOptions, } from './package/extensions/reminder-block/types';
|
7
|
+
export { Editor } from '@tiptap/react';
|
package/dist/index.es.js
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
import { D as d,
|
1
|
+
import { D as d, E as r, P as s, R as a, h as t, u as i } from "./index-Lzfdyy5-.mjs";
|
2
2
|
export {
|
3
3
|
d as DdocEditor,
|
4
|
-
r as
|
5
|
-
s as
|
6
|
-
|
4
|
+
r as Editor,
|
5
|
+
s as PreviewDdocEditor,
|
6
|
+
a as ReminderBlock,
|
7
|
+
t as handleContentPrint,
|
8
|
+
i as useHeadlessEditor
|
7
9
|
};
|
@@ -54,6 +54,13 @@ export declare const bubbleMenuProps: (props: EditorBubbleMenuProps) => {
|
|
54
54
|
commentDrawerOpen?: boolean;
|
55
55
|
setCommentDrawerOpen?: React.Dispatch<import('react').SetStateAction<boolean>>;
|
56
56
|
isCollabDocumentPublished?: boolean | undefined;
|
57
|
+
ipfsImageUploadFn?: (file: File) => Promise<import('../../types').IpfsImageUploadResponse>;
|
58
|
+
ipfsImageFetchFn?: (_data: import('../../types').IpfsImageFetchPayload) => Promise<{
|
59
|
+
url: string;
|
60
|
+
file: File;
|
61
|
+
}>;
|
62
|
+
onReminderCreate?: (reminder: import('../../..').Reminder, type: string) => void;
|
63
|
+
isConnected?: boolean;
|
57
64
|
};
|
58
65
|
export declare const shouldShow: ({ editor }: {
|
59
66
|
editor: Editor;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { BubbleMenuProps, Editor } from '@tiptap/react';
|
2
2
|
import { SetStateAction } from 'react';
|
3
|
-
import { InlineCommentData } from '../../types';
|
3
|
+
import { InlineCommentData, IpfsImageFetchPayload, IpfsImageUploadResponse } from '../../types';
|
4
|
+
import { Reminder } from '../../extensions/reminder-block/types';
|
4
5
|
|
5
6
|
export interface BubbleMenuItem {
|
6
7
|
name: string;
|
@@ -23,6 +24,13 @@ export type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
|
|
23
24
|
commentDrawerOpen?: boolean;
|
24
25
|
setCommentDrawerOpen?: React.Dispatch<SetStateAction<boolean>>;
|
25
26
|
isCollabDocumentPublished?: boolean | undefined;
|
27
|
+
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
28
|
+
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
29
|
+
url: string;
|
30
|
+
file: File;
|
31
|
+
}>;
|
32
|
+
onReminderCreate?: (reminder: Reminder, type: string) => void;
|
33
|
+
isConnected?: boolean;
|
26
34
|
};
|
27
35
|
export interface NodeSelectorProps {
|
28
36
|
editor: Editor;
|
@@ -1,17 +1,22 @@
|
|
1
1
|
import { default as React } from 'react';
|
2
2
|
import { Editor } from '@tiptap/react';
|
3
|
+
import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
3
4
|
|
4
|
-
declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible,
|
5
|
+
declare const TiptapToolBar: ({ editor, onError, zoomLevel, setZoomLevel, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, isLoading, ipfsImageFetchFn, }: {
|
5
6
|
editor: Editor | null;
|
6
7
|
onError?: (errorString: string) => void;
|
7
8
|
zoomLevel: string;
|
8
9
|
setZoomLevel: (zoom: string) => void;
|
9
10
|
isNavbarVisible: boolean;
|
10
11
|
setIsNavbarVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
11
|
-
|
12
|
+
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
12
13
|
onMarkdownExport?: () => void;
|
13
14
|
onMarkdownImport?: () => void;
|
14
15
|
onPdfExport?: () => void;
|
15
16
|
isLoading: boolean;
|
17
|
+
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
18
|
+
url: string;
|
19
|
+
file: File;
|
20
|
+
}>;
|
16
21
|
}) => import("react/jsx-runtime").JSX.Element;
|
17
22
|
export default TiptapToolBar;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { default as React, Dispatch, SetStateAction } from 'react';
|
2
2
|
import { IEditorTool } from '../hooks/use-visibility';
|
3
3
|
import { Editor } from '@tiptap/react';
|
4
|
+
import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
4
5
|
|
5
6
|
interface IEditorToolElement {
|
6
7
|
icon: any;
|
@@ -36,13 +37,17 @@ export declare const IMG_UPLOAD_SETTINGS: {
|
|
36
37
|
errorMsg: string;
|
37
38
|
};
|
38
39
|
};
|
39
|
-
export declare const useEditorToolbar: ({ editor, onError,
|
40
|
+
export declare const useEditorToolbar: ({ editor, onError, ipfsImageUploadFn, onMarkdownExport, onMarkdownImport, onPdfExport, ipfsImageFetchFn, }: {
|
40
41
|
editor: Editor | null;
|
41
42
|
onError?: (errorString: string) => void;
|
42
|
-
|
43
|
+
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
43
44
|
onMarkdownExport?: () => void;
|
44
45
|
onMarkdownImport?: () => void;
|
45
46
|
onPdfExport?: () => void;
|
47
|
+
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
48
|
+
url: string;
|
49
|
+
file: File;
|
50
|
+
}>;
|
46
51
|
}) => {
|
47
52
|
undoRedoTools: (IEditorToolElement | null)[];
|
48
53
|
toolbar: (IEditorToolElement | null)[];
|
@@ -1,12 +1,17 @@
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
2
|
+
import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
2
3
|
|
3
|
-
declare const MobileToolbar: ({ editor, onError, isKeyboardVisible, isNavbarVisible, setIsNavbarVisible,
|
4
|
+
declare const MobileToolbar: ({ editor, onError, isKeyboardVisible, isNavbarVisible, setIsNavbarVisible, ipfsImageUploadFn, isLoading, ipfsImageFetchFn, }: {
|
4
5
|
editor: Editor | null;
|
5
6
|
onError?: (errorString: string) => void;
|
6
7
|
isKeyboardVisible: boolean;
|
7
8
|
isNavbarVisible: boolean;
|
8
9
|
setIsNavbarVisible: React.Dispatch<React.SetStateAction<boolean>>;
|
9
|
-
|
10
|
+
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
10
11
|
isLoading: boolean;
|
12
|
+
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
13
|
+
url: string;
|
14
|
+
file: File;
|
15
|
+
}>;
|
11
16
|
}) => import("react/jsx-runtime").JSX.Element;
|
12
17
|
export default MobileToolbar;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Editor } from '@tiptap/react';
|
2
|
+
import { IpfsImageFetchPayload } from '../../types';
|
2
3
|
|
3
4
|
interface PresentationModeProps {
|
4
5
|
editor: Editor;
|
@@ -15,6 +16,10 @@ interface PresentationModeProps {
|
|
15
16
|
setSlides: React.Dispatch<React.SetStateAction<string[]>>;
|
16
17
|
renderThemeToggle?: () => JSX.Element;
|
17
18
|
isContentLoading: boolean;
|
19
|
+
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
20
|
+
url: string;
|
21
|
+
file: File;
|
22
|
+
}>;
|
18
23
|
}
|
19
|
-
export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, renderThemeToggle, isContentLoading, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
|
24
|
+
export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, renderThemeToggle, isContentLoading, ipfsImageFetchFn, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
|
20
25
|
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { IpfsImageFetchPayload } from '../types.ts';
|
2
|
+
|
3
|
+
type Props = {
|
4
|
+
encryptionKey: string;
|
5
|
+
url: string;
|
6
|
+
nonce: string;
|
7
|
+
alt?: string;
|
8
|
+
width?: string;
|
9
|
+
height?: string;
|
10
|
+
className?: string;
|
11
|
+
caption?: string;
|
12
|
+
ipfsImageFetchFn: (_data: IpfsImageFetchPayload) => Promise<{
|
13
|
+
url: string;
|
14
|
+
file: File;
|
15
|
+
}>;
|
16
|
+
ipfsHash: string;
|
17
|
+
mimeType: string;
|
18
|
+
authTag: string;
|
19
|
+
};
|
20
|
+
export declare const SecureImageV2: import('react').ForwardRefExoticComponent<Props & import('react').RefAttributes<HTMLImageElement>>;
|
21
|
+
export {};
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { Node } from '@tiptap/core';
|
2
|
+
import { IpfsImageUploadResponse } from '../../types';
|
2
3
|
|
3
4
|
export interface DBlockOptions {
|
4
5
|
HTMLAttributes: Record<string, any>;
|
5
|
-
|
6
|
+
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
6
7
|
onCopyHeadingLink?: (link: string) => void;
|
7
|
-
hasAvailableModels
|
8
|
+
hasAvailableModels: boolean;
|
8
9
|
}
|
9
10
|
declare module '@tiptap/core' {
|
10
11
|
interface Commands<ReturnType> {
|
@@ -1,5 +1,15 @@
|
|
1
1
|
import { NodeType } from '@tiptap/pm/model';
|
2
2
|
import { InputRule } from '@tiptap/core';
|
3
|
+
import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../types';
|
3
4
|
|
4
|
-
export declare const defaultExtensions: (
|
5
|
+
export declare const defaultExtensions: ({ ipfsImageFetchFn, onError, metadataProxyUrl, onCopyHeadingLink, ipfsImageUploadFn, }: {
|
6
|
+
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
7
|
+
url: string;
|
8
|
+
file: File;
|
9
|
+
}>;
|
10
|
+
onError: (error: string) => void;
|
11
|
+
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
12
|
+
metadataProxyUrl?: string;
|
13
|
+
onCopyHeadingLink?: (link: string) => void;
|
14
|
+
}) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
|
5
15
|
export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Node } from '@tiptap/core';
|
2
|
+
import { IpfsImageFetchPayload } from '../../types';
|
2
3
|
|
3
4
|
export interface IframeOptions {
|
4
5
|
allowFullscreen: boolean;
|
@@ -7,6 +8,10 @@ export interface IframeOptions {
|
|
7
8
|
};
|
8
9
|
width?: number;
|
9
10
|
height?: number;
|
11
|
+
ipfsImageFetchFn: (_data: IpfsImageFetchPayload) => Promise<{
|
12
|
+
url: string;
|
13
|
+
file: File;
|
14
|
+
}>;
|
10
15
|
}
|
11
16
|
declare module '@tiptap/core' {
|
12
17
|
interface Commands<ReturnType> {
|
@@ -1,18 +1,25 @@
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
2
2
|
import { Node as PMNode } from 'prosemirror-model';
|
3
3
|
import { default as TurndownService } from 'turndown';
|
4
|
+
import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../../types';
|
4
5
|
|
5
6
|
export declare const turndownService: TurndownService;
|
6
7
|
declare module '@tiptap/core' {
|
7
8
|
interface Commands {
|
8
9
|
uploadMarkdownFile: {
|
9
|
-
uploadMarkdownFile: (
|
10
|
+
uploadMarkdownFile: (ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>) => any;
|
10
11
|
};
|
11
12
|
exportMarkdownFile: {
|
12
13
|
exportMarkdownFile: () => any;
|
13
14
|
};
|
14
15
|
}
|
15
16
|
}
|
16
|
-
declare const MarkdownPasteHandler: (
|
17
|
+
declare const MarkdownPasteHandler: (ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
18
|
+
url: string;
|
19
|
+
file: File;
|
20
|
+
}>) => Extension<any, any>;
|
17
21
|
export default MarkdownPasteHandler;
|
18
|
-
export declare function searchForSecureImageNodeAndEmbedImageContent(originalDoc: PMNode
|
22
|
+
export declare function searchForSecureImageNodeAndEmbedImageContent(originalDoc: PMNode, ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
23
|
+
url: string;
|
24
|
+
file: File;
|
25
|
+
}>): Promise<PMNode>;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Node } from '@tiptap/core';
|
2
|
+
import { ReminderBlockOptions, Reminder } from './types';
|
3
|
+
|
4
|
+
declare module '@tiptap/core' {
|
5
|
+
interface Commands<ReturnType> {
|
6
|
+
reminderBlock: {
|
7
|
+
setReminderBlock: (attributes: {
|
8
|
+
id: string;
|
9
|
+
reminder: Reminder;
|
10
|
+
}) => ReturnType;
|
11
|
+
};
|
12
|
+
}
|
13
|
+
}
|
14
|
+
export declare const ReminderBlock: Node<ReminderBlockOptions, any>;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import { Editor, Range } from '@tiptap/core';
|
2
|
+
import { ReactRenderer } from '@tiptap/react';
|
3
|
+
import { ReminderMenuProps } from './types';
|
4
|
+
|
5
|
+
export declare function showReminderMenu(editor: Editor, range: Range, type: ReminderMenuProps['type'], onError?: (error: string) => void): ReactRenderer<HTMLDivElement, ReminderMenuProps & import('react').RefAttributes<HTMLDivElement>>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { default as React } from 'react';
|
2
|
+
|
3
|
+
export interface Reminder {
|
4
|
+
id: string;
|
5
|
+
title: string;
|
6
|
+
timestamp: string;
|
7
|
+
createdAt: string;
|
8
|
+
status: 'pending' | 'completed' | 'cancelled';
|
9
|
+
walletAddress?: string;
|
10
|
+
}
|
11
|
+
export interface ReminderBlockOptions {
|
12
|
+
onReminderCreate?: (reminder: Reminder, type: string) => Promise<void>;
|
13
|
+
onReminderDelete?: (reminderId: string) => Promise<void>;
|
14
|
+
onReminderUpdate?: (reminder: Reminder) => Promise<void>;
|
15
|
+
reminders?: Reminder[];
|
16
|
+
}
|
17
|
+
export interface ReminderMenuProps {
|
18
|
+
isOpen: boolean;
|
19
|
+
onClose: () => void;
|
20
|
+
onCreateReminder: (reminder: Reminder, type: string) => void;
|
21
|
+
initialReminderTitle?: string;
|
22
|
+
type: 'inline' | 'slash';
|
23
|
+
setInitialReminderTitle: React.Dispatch<React.SetStateAction<string>>;
|
24
|
+
}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export declare const formatDate: (value: string) => string;
|
2
|
+
export declare const formatTime: (value: string) => string;
|
3
|
+
export declare const parseCustomDateTime: (dateStr: string, timeStr: string) => number | null;
|
4
|
+
export declare const formatDateForReminder: (timestamp: string) => string;
|
package/dist/package/extensions/resizable-media/media-paste-drop-plugin/media-paste-drop-plugin.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Plugin } from 'prosemirror-state';
|
2
|
+
import { IpfsImageUploadResponse } from '../../../types.ts';
|
2
3
|
|
3
4
|
export type UploadFnType = (image: File) => Promise<string>;
|
4
5
|
/**
|
@@ -9,4 +10,4 @@ export type UploadFnType = (image: File) => Promise<string>;
|
|
9
10
|
* If no upload function is provided, it reads the media file as DataURL and uses this in the new node.
|
10
11
|
* The function returns a new instance of the Plugin.
|
11
12
|
*/
|
12
|
-
export declare const getMediaPasteDropPlugin: (
|
13
|
+
export declare const getMediaPasteDropPlugin: (onError: (error: string) => void, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>) => Plugin<any>;
|
@@ -1,3 +1,7 @@
|
|
1
1
|
import { NodeViewProps } from '@tiptap/react';
|
2
|
+
import { IpfsImageFetchPayload } from '../../types.ts';
|
2
3
|
|
3
|
-
export declare const
|
4
|
+
export declare const getResizableMediaNodeView: (ipfsImageFetchFn: (_data: IpfsImageFetchPayload) => Promise<{
|
5
|
+
url: string;
|
6
|
+
file: File;
|
7
|
+
}>) => ({ node, updateAttributes, deleteNode }: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Node } from '@tiptap/core';
|
2
|
-
import {
|
2
|
+
import { IpfsImageFetchPayload, IpfsImageUploadResponse } from '../../types';
|
3
3
|
|
4
4
|
declare module '@tiptap/core' {
|
5
5
|
interface Commands<ReturnType> {
|
@@ -20,9 +20,12 @@ declare module '@tiptap/core' {
|
|
20
20
|
}
|
21
21
|
export interface MediaOptions {
|
22
22
|
HTMLAttributes: Record<string, any>;
|
23
|
-
uploadFn: UploadFnType;
|
24
23
|
onError: (error: string) => void;
|
25
|
-
|
24
|
+
ipfsImageUploadFn: (file: File) => Promise<IpfsImageUploadResponse>;
|
25
|
+
ipfsImageFetchFn: (_data: IpfsImageFetchPayload) => Promise<{
|
26
|
+
url: string;
|
27
|
+
file: File;
|
28
|
+
}>;
|
26
29
|
}
|
27
30
|
export declare const IMAGE_INPUT_REGEX: RegExp;
|
28
31
|
export declare const VIDEO_INPUT_REGEX: RegExp;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
2
|
+
import { IpfsImageUploadResponse } from '../../types';
|
2
3
|
|
3
4
|
export declare const Command: Extension<any, any>;
|
4
|
-
declare const SlashCommand: (onError?: (errorString: string) => void,
|
5
|
+
declare const SlashCommand: (onError?: (errorString: string) => void, ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>, isConnected?: boolean) => Extension<any, any>;
|
5
6
|
export default SlashCommand;
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import { CommandProps } from './types';
|
2
|
+
import { IpfsImageUploadResponse } from '../../types';
|
2
3
|
|
3
|
-
export declare const getSuggestionItems: ({ query, onError,
|
4
|
+
export declare const getSuggestionItems: ({ query, onError, isConnected, ipfsImageUploadFn, editor, }: {
|
4
5
|
query: string;
|
5
6
|
onError?: (errorString: string) => void;
|
6
|
-
|
7
|
-
|
7
|
+
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
8
|
+
isConnected?: boolean;
|
9
|
+
editor?: any;
|
8
10
|
}) => ({
|
9
11
|
title: string;
|
10
12
|
description: string;
|
@@ -1,14 +1,15 @@
|
|
1
|
-
import { Node as ProseMirrorNode } from '
|
2
|
-
import { NodeView, ViewMutationRecord } from '
|
1
|
+
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
2
|
+
import { NodeView, ViewMutationRecord } from '@tiptap/pm/view';
|
3
3
|
|
4
|
-
export declare function updateColumns(node: ProseMirrorNode, colgroup:
|
4
|
+
export declare function updateColumns(node: ProseMirrorNode, colgroup: HTMLTableColElement, // <colgroup> has the same prototype as <col>
|
5
|
+
table: HTMLTableElement, cellMinWidth: number, overrideCol?: number, overrideValue?: number): void;
|
5
6
|
export declare class TableView implements NodeView {
|
6
7
|
node: ProseMirrorNode;
|
7
8
|
cellMinWidth: number;
|
8
|
-
dom:
|
9
|
+
dom: HTMLDivElement;
|
9
10
|
table: HTMLTableElement;
|
10
|
-
colgroup:
|
11
|
-
contentDOM:
|
11
|
+
colgroup: HTMLTableColElement;
|
12
|
+
contentDOM: HTMLTableSectionElement;
|
12
13
|
constructor(node: ProseMirrorNode, cellMinWidth: number);
|
13
14
|
update(node: ProseMirrorNode): boolean;
|
14
15
|
ignoreMutation(mutation: ViewMutationRecord): boolean;
|
@@ -1,13 +1,48 @@
|
|
1
1
|
import { Node, ParentConfig } from '@tiptap/core';
|
2
|
-
import { NodeView } from '
|
2
|
+
import { EditorView, NodeView } from '@tiptap/pm/view';
|
3
|
+
import { Node as ProseMirrorNode } from '@tiptap/pm/model';
|
3
4
|
|
4
5
|
export interface TableOptions {
|
5
|
-
|
6
|
+
/**
|
7
|
+
* HTML attributes for the table element.
|
8
|
+
* @default {}
|
9
|
+
* @example { class: 'foo' }
|
10
|
+
*/
|
11
|
+
HTMLAttributes: Record<string, any>;
|
12
|
+
/**
|
13
|
+
* Enables the resizing of tables.
|
14
|
+
* @default false
|
15
|
+
* @example true
|
16
|
+
*/
|
6
17
|
resizable: boolean;
|
18
|
+
/**
|
19
|
+
* The width of the resize handle.
|
20
|
+
* @default 5
|
21
|
+
* @example 10
|
22
|
+
*/
|
7
23
|
handleWidth: number;
|
24
|
+
/**
|
25
|
+
* The minimum width of a cell.
|
26
|
+
* @default 25
|
27
|
+
* @example 50
|
28
|
+
*/
|
8
29
|
cellMinWidth: number;
|
9
|
-
|
30
|
+
/**
|
31
|
+
* The node view to render the table.
|
32
|
+
* @default TableView
|
33
|
+
*/
|
34
|
+
View: (new (node: ProseMirrorNode, cellMinWidth: number, view: EditorView) => NodeView) | null;
|
35
|
+
/**
|
36
|
+
* Enables the resizing of the last column.
|
37
|
+
* @default true
|
38
|
+
* @example false
|
39
|
+
*/
|
10
40
|
lastColumnResizable: boolean;
|
41
|
+
/**
|
42
|
+
* Allow table node selection.
|
43
|
+
* @default false
|
44
|
+
* @example true
|
45
|
+
*/
|
11
46
|
allowTableNodeSelection: boolean;
|
12
47
|
}
|
13
48
|
declare module '@tiptap/core' {
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare function getColStyleDeclaration(minWidth: number, width: number | undefined): [string, string];
|
package/dist/package/extensions/supercharged-table/extension-table/utilities/create-cell.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import { Fragment, Node as ProsemirrorNode, NodeType } from '
|
1
|
+
import { Fragment, Node as ProsemirrorNode, NodeType } from '@tiptap/pm/model';
|
2
2
|
|
3
3
|
export declare function createCell(cellType: NodeType, cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>): ProsemirrorNode | null | undefined;
|
package/dist/package/extensions/supercharged-table/extension-table/utilities/create-col-group.d.ts
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
import { DOMOutputSpec, Node as ProseMirrorNode } from '@tiptap/pm/model';
|
2
|
+
|
3
|
+
export type ColGroup = {
|
4
|
+
colgroup: DOMOutputSpec;
|
5
|
+
tableWidth: string;
|
6
|
+
tableMinWidth: string;
|
7
|
+
} | Record<string, never>;
|
8
|
+
/**
|
9
|
+
* Creates a colgroup element for a table node in ProseMirror.
|
10
|
+
*
|
11
|
+
* @param node - The ProseMirror node representing the table.
|
12
|
+
* @param cellMinWidth - The minimum width of a cell in the table.
|
13
|
+
* @param overrideCol - (Optional) The index of the column to override the width of.
|
14
|
+
* @param overrideValue - (Optional) The width value to use for the overridden column.
|
15
|
+
* @returns An object containing the colgroup element, the total width of the table, and the minimum width of the table.
|
16
|
+
*/
|
17
|
+
export declare function createColGroup(node: ProseMirrorNode, cellMinWidth: number): ColGroup;
|
18
|
+
export declare function createColGroup(node: ProseMirrorNode, cellMinWidth: number, overrideCol: number, overrideValue: number): ColGroup;
|
package/dist/package/extensions/supercharged-table/extension-table/utilities/create-table.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import { Fragment, Node as ProsemirrorNode, Schema } from '
|
1
|
+
import { Fragment, Node as ProsemirrorNode, Schema } from '@tiptap/pm/model';
|
2
2
|
|
3
3
|
export declare function createTable(schema: Schema, rowsCount: number, colsCount: number, withHeaderRow: boolean, cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>): ProsemirrorNode;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
2
|
+
import { Reminder } from '../extensions/reminder-block/types';
|
3
|
+
|
4
|
+
interface UseReminderProps {
|
5
|
+
editor: Editor;
|
6
|
+
onReminderCreate?: (reminder: Reminder, type: string) => Promise<void>;
|
7
|
+
onError?: (errorString: string) => void;
|
8
|
+
}
|
9
|
+
export declare const useReminder: ({ editor, onReminderCreate, onError, }: UseReminderProps) => {
|
10
|
+
reminderRef: import('react').RefObject<HTMLDivElement>;
|
11
|
+
handleReminderOnClose: () => void;
|
12
|
+
handleReminderCreate: (reminder: Reminder, type: string) => Promise<void>;
|
13
|
+
initialReminderTitle: string;
|
14
|
+
setInitialReminderTitle: import('react').Dispatch<import('react').SetStateAction<string>>;
|
15
|
+
};
|
16
|
+
export {};
|
package/dist/package/types.d.ts
CHANGED
@@ -34,6 +34,10 @@ export interface CustomModel {
|
|
34
34
|
}
|
35
35
|
export interface DdocProps extends CommentAccountProps {
|
36
36
|
isCollabDocumentPublished?: boolean;
|
37
|
+
ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
38
|
+
url: string;
|
39
|
+
file: File;
|
40
|
+
}>;
|
37
41
|
disableInlineComment?: boolean;
|
38
42
|
commentDrawerOpen?: boolean;
|
39
43
|
setCommentDrawerOpen?: React.Dispatch<SetStateAction<boolean>>;
|
@@ -47,6 +51,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
47
51
|
showTOC?: boolean;
|
48
52
|
setShowTOC?: React.Dispatch<SetStateAction<boolean>>;
|
49
53
|
proExtensions?: Record<string, Extension | any>;
|
54
|
+
extensions?: Record<string, Extension | any>;
|
50
55
|
selectedTags?: TagType[];
|
51
56
|
setSelectedTags?: React.Dispatch<SetStateAction<TagType[]>>;
|
52
57
|
enableCollaboration?: boolean | undefined;
|
@@ -62,7 +67,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
62
67
|
collaborationId?: string;
|
63
68
|
isPreviewMode: boolean;
|
64
69
|
ensResolutionUrl?: string;
|
65
|
-
|
70
|
+
ipfsImageUploadFn?: (file: File) => Promise<IpfsImageUploadResponse>;
|
66
71
|
enableIndexeddbSync?: boolean;
|
67
72
|
ddocId?: string;
|
68
73
|
initialContent?: JSONContent | string | string[] | null;
|
@@ -123,3 +128,18 @@ export interface IUser {
|
|
123
128
|
isEns: boolean;
|
124
129
|
}
|
125
130
|
export { type IComment };
|
131
|
+
export interface IpfsImageUploadResponse {
|
132
|
+
encryptionKey: string;
|
133
|
+
nonce: string;
|
134
|
+
ipfsUrl: string;
|
135
|
+
ipfsHash: string;
|
136
|
+
authTag: string;
|
137
|
+
}
|
138
|
+
export interface IpfsImageFetchPayload {
|
139
|
+
encryptionKey: string;
|
140
|
+
nonce: string;
|
141
|
+
ipfsUrl: string;
|
142
|
+
ipfsHash: string;
|
143
|
+
mimeType: string;
|
144
|
+
authTag: string;
|
145
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { DdocProps } from './types';
|
2
2
|
|
3
3
|
import * as Y from 'yjs';
|
4
|
-
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount,
|
4
|
+
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, ipfsImageUploadFn, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, ipfsImageFetchFn, isConnected, activeModel, maxTokens, isAIAgentEnabled, }: Partial<DdocProps>) => {
|
5
5
|
editor: import('@tiptap/core').Editor | null;
|
6
6
|
isContentLoading: boolean;
|
7
7
|
ref: import('react').RefObject<HTMLDivElement>;
|
@@ -1,3 +1,7 @@
|
|
1
|
+
import { Editor, JSONContent } from '@tiptap/core';
|
2
|
+
|
1
3
|
export declare const nameFormatter: (username: string) => string;
|
4
|
+
export declare const EXTENSIONS_WITH_DUPLICATE_WARNINGS: string[];
|
5
|
+
export declare const getTemporaryEditor: (editor: Editor, content: JSONContent) => Editor;
|
2
6
|
export declare const dateFormatter: (date: Date) => string | import("react/jsx-runtime").JSX.Element;
|
3
7
|
export declare const renderTextWithLinks: (text: string) => (string | import("react/jsx-runtime").JSX.Element)[];
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { default as MarkdownIt } from 'markdown-it';
|
2
2
|
import { Editor } from '@tiptap/react';
|
3
|
+
import { IpfsImageFetchPayload } from '../types';
|
3
4
|
|
4
5
|
interface SlideContent {
|
5
6
|
type: 'h1' | 'h2' | 'content' | 'image' | 'table';
|
@@ -9,6 +10,9 @@ export interface Slides {
|
|
9
10
|
[key: number]: SlideContent[];
|
10
11
|
}
|
11
12
|
export declare const md: MarkdownIt;
|
12
|
-
export declare const convertToMarkdown: (editor: Editor) => Promise<
|
13
|
+
export declare const convertToMarkdown: (editor: Editor, ipfsImageFetchFn?: (_data: IpfsImageFetchPayload) => Promise<{
|
14
|
+
url: string;
|
15
|
+
file: File;
|
16
|
+
}>) => Promise<string>;
|
13
17
|
export declare const processMarkdownContent: (markdown: string) => Slides;
|
14
18
|
export {};
|