@fileverse-dev/ddoc 2.2.9 → 2.3.0-patch-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/README.md +8 -0
- package/dist/{ccip-DHM22k9N.mjs → ccip-K_5DUUoN.mjs} +1 -1
- package/dist/{index-DI5an1c5.mjs → index-Cpi2heJH.mjs} +39166 -34764
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +6 -4
- package/dist/package/components/editor-bubble-menu/props.d.ts +2 -0
- package/dist/package/components/editor-bubble-menu/types.d.ts +3 -0
- package/dist/package/extensions/d-block/dblock.d.ts +1 -1
- 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/slash-command/slash-comand.d.ts +1 -1
- package/dist/package/extensions/slash-command/slash-command-utils.d.ts +3 -2
- 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 +1 -0
- package/dist/package/use-ddoc-editor.d.ts +1 -1
- package/dist/package/utils/helpers.d.ts +4 -0
- 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-Cpi2heJH.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,8 @@ 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
|
+
onReminderCreate?: (reminder: import('../../..').Reminder, type: string) => void;
|
58
|
+
isConnected?: boolean;
|
57
59
|
};
|
58
60
|
export declare const shouldShow: ({ editor }: {
|
59
61
|
editor: Editor;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { BubbleMenuProps, Editor } from '@tiptap/react';
|
2
2
|
import { SetStateAction } from 'react';
|
3
3
|
import { InlineCommentData } from '../../types';
|
4
|
+
import { Reminder } from '../../extensions/reminder-block/types';
|
4
5
|
|
5
6
|
export interface BubbleMenuItem {
|
6
7
|
name: string;
|
@@ -23,6 +24,8 @@ export type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
|
|
23
24
|
commentDrawerOpen?: boolean;
|
24
25
|
setCommentDrawerOpen?: React.Dispatch<SetStateAction<boolean>>;
|
25
26
|
isCollabDocumentPublished?: boolean | undefined;
|
27
|
+
onReminderCreate?: (reminder: Reminder, type: string) => void;
|
28
|
+
isConnected?: boolean;
|
26
29
|
};
|
27
30
|
export interface NodeSelectorProps {
|
28
31
|
editor: Editor;
|
@@ -4,7 +4,7 @@ export interface DBlockOptions {
|
|
4
4
|
HTMLAttributes: Record<string, any>;
|
5
5
|
secureImageUploadUrl?: string;
|
6
6
|
onCopyHeadingLink?: (link: string) => void;
|
7
|
-
hasAvailableModels
|
7
|
+
hasAvailableModels: boolean;
|
8
8
|
}
|
9
9
|
declare module '@tiptap/core' {
|
10
10
|
interface Commands<ReturnType> {
|
@@ -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']): 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;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Extension } from '@tiptap/core';
|
2
2
|
|
3
3
|
export declare const Command: Extension<any, any>;
|
4
|
-
declare const SlashCommand: (onError?: (errorString: string) => void, secureImageUploadUrl?: string,
|
4
|
+
declare const SlashCommand: (onError?: (errorString: string) => void, secureImageUploadUrl?: string, isConnected?: boolean) => Extension<any, any>;
|
5
5
|
export default SlashCommand;
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import { CommandProps } from './types';
|
2
2
|
|
3
|
-
export declare const getSuggestionItems: ({ query, onError, secureImageUploadUrl,
|
3
|
+
export declare const getSuggestionItems: ({ query, onError, secureImageUploadUrl, editor, }: {
|
4
4
|
query: string;
|
5
5
|
onError?: (errorString: string) => void;
|
6
6
|
secureImageUploadUrl?: string;
|
7
|
-
|
7
|
+
isConnected?: boolean;
|
8
|
+
editor?: any;
|
8
9
|
}) => ({
|
9
10
|
title: string;
|
10
11
|
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
@@ -47,6 +47,7 @@ export interface DdocProps extends CommentAccountProps {
|
|
47
47
|
showTOC?: boolean;
|
48
48
|
setShowTOC?: React.Dispatch<SetStateAction<boolean>>;
|
49
49
|
proExtensions?: Record<string, Extension | any>;
|
50
|
+
extensions?: Record<string, Extension | any>;
|
50
51
|
selectedTags?: TagType[];
|
51
52
|
setSelectedTags?: React.Dispatch<SetStateAction<TagType[]>>;
|
52
53
|
enableCollaboration?: boolean | undefined;
|
@@ -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, secureImageUploadUrl, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, onCopyHeadingLink, activeModel, maxTokens, isAIAgentEnabled, }: Partial<DdocProps>) => {
|
4
|
+
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, metadataProxyUrl, extensions: externalExtensions, onCopyHeadingLink, 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)[];
|