@fileverse-dev/ddoc 2.1.1-ws-patch-1 → 2.1.2-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 +15 -0
- package/dist/index.es.js +33760 -33106
- package/dist/package/components/toc/document-outline.d.ts +3 -0
- package/dist/package/components/toc/toc.d.ts +5 -0
- package/dist/package/components/toc/types.d.ts +30 -0
- package/dist/package/extensions/default-extension.d.ts +1 -1
- package/dist/package/extensions/supercharged-table/extension-table/table-view.d.ts +2 -5
- package/dist/package/extensions/supercharged-table/extension-table-row/table-row-node-view.d.ts +2 -5
- package/dist/package/types.d.ts +6 -3
- package/dist/package/use-ddoc-editor.d.ts +3 -1
- package/dist/package/utils/security.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
@@ -0,0 +1,5 @@
|
|
1
|
+
import { ToCProps, ToCItemProps } from './types';
|
2
|
+
|
3
|
+
export declare const ToCItem: ({ item, onItemClick, index, }: ToCItemProps) => import("react/jsx-runtime").JSX.Element;
|
4
|
+
export declare const ToCEmptyState: () => import("react/jsx-runtime").JSX.Element;
|
5
|
+
export declare const ToC: ({ items, editor, setItems }: ToCProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { Editor } from '@tiptap/react';
|
2
|
+
import { SetStateAction } from 'react';
|
3
|
+
|
4
|
+
export interface ToCItemType {
|
5
|
+
id: string;
|
6
|
+
level: number;
|
7
|
+
textContent: string;
|
8
|
+
itemIndex: number;
|
9
|
+
isActive?: boolean;
|
10
|
+
}
|
11
|
+
export type ToCProps = {
|
12
|
+
items: ToCItemType[];
|
13
|
+
setItems: (items: ToCItemType[] | ((prev: ToCItemType[]) => ToCItemType[])) => void;
|
14
|
+
editor: Editor;
|
15
|
+
};
|
16
|
+
export type ToCItemProps = {
|
17
|
+
item: ToCItemType;
|
18
|
+
onItemClick: (e: React.MouseEvent, id: string) => void;
|
19
|
+
onItemRemove: (e: React.MouseEvent, id: string) => void;
|
20
|
+
index: number;
|
21
|
+
};
|
22
|
+
export interface DocumentOutlineProps {
|
23
|
+
editor: Editor;
|
24
|
+
hasToC: boolean;
|
25
|
+
items: ToCItemType[];
|
26
|
+
setItems: (items: ToCItemType[] | ((prev: ToCItemType[]) => ToCItemType[])) => void;
|
27
|
+
showTOC: boolean | undefined;
|
28
|
+
setShowTOC: React.Dispatch<SetStateAction<boolean>> | undefined;
|
29
|
+
isPreviewMode: boolean;
|
30
|
+
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { NodeType } from '@tiptap/pm/model';
|
2
2
|
import { InputRule } from '@tiptap/core';
|
3
3
|
|
4
|
-
export declare const defaultExtensions: (onError: (error: string) => void, secureImageUploadUrl?: string) => (import('@tiptap/core').
|
4
|
+
export declare const defaultExtensions: (onError: (error: string) => void, secureImageUploadUrl?: string) => (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
|
5
5
|
export declare const createInputRule: (pattern: RegExp, data: string, type: NodeType) => InputRule;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
2
|
-
import { NodeView } from 'prosemirror-view';
|
2
|
+
import { NodeView, ViewMutationRecord } from 'prosemirror-view';
|
3
3
|
|
4
4
|
export declare function updateColumns(node: ProseMirrorNode, colgroup: Element, table: HTMLTableElement, cellMinWidth: number, overrideCol?: number, overrideValue?: string): void;
|
5
5
|
export declare class TableView implements NodeView {
|
@@ -11,8 +11,5 @@ export declare class TableView implements NodeView {
|
|
11
11
|
contentDOM: HTMLElement;
|
12
12
|
constructor(node: ProseMirrorNode, cellMinWidth: number);
|
13
13
|
update(node: ProseMirrorNode): boolean;
|
14
|
-
ignoreMutation(mutation:
|
15
|
-
type: 'selection';
|
16
|
-
target: Element;
|
17
|
-
}): boolean;
|
14
|
+
ignoreMutation(mutation: ViewMutationRecord): boolean;
|
18
15
|
}
|
package/dist/package/extensions/supercharged-table/extension-table-row/table-row-node-view.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
2
|
-
import { NodeView } from 'prosemirror-view';
|
2
|
+
import { NodeView, ViewMutationRecord } from 'prosemirror-view';
|
3
3
|
|
4
4
|
export declare class TableRowNodeView implements NodeView {
|
5
5
|
node: ProseMirrorNode;
|
@@ -10,8 +10,5 @@ export declare class TableRowNodeView implements NodeView {
|
|
10
10
|
contentDOM: HTMLElement;
|
11
11
|
constructor(node: ProseMirrorNode, cellMinWidth: number);
|
12
12
|
update(node: ProseMirrorNode): boolean;
|
13
|
-
ignoreMutation(mutation:
|
14
|
-
type: 'selection';
|
15
|
-
target: Element;
|
16
|
-
}): boolean;
|
13
|
+
ignoreMutation(mutation: ViewMutationRecord): boolean;
|
17
14
|
}
|
package/dist/package/types.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { TagType } from '@fileverse/ui';
|
2
|
-
import { JSONContent } from '@tiptap/core';
|
2
|
+
import { Extension, JSONContent } from '@tiptap/core';
|
3
3
|
import { EditorProps } from '@tiptap/pm/view';
|
4
4
|
import { Editor } from '@tiptap/react';
|
5
5
|
import { default as React, SetStateAction } from 'react';
|
@@ -16,6 +16,9 @@ type InlineCommentData = {
|
|
16
16
|
handleClick: boolean;
|
17
17
|
};
|
18
18
|
export interface DdocProps {
|
19
|
+
showTOC?: boolean;
|
20
|
+
setShowTOC?: React.Dispatch<SetStateAction<boolean>>;
|
21
|
+
proExtensions?: Record<string, Extension | any>;
|
19
22
|
selectedTags?: TagType[];
|
20
23
|
setSelectedTags?: React.Dispatch<SetStateAction<TagType[]>>;
|
21
24
|
enableCollaboration?: boolean | undefined;
|
@@ -40,7 +43,7 @@ export interface DdocProps {
|
|
40
43
|
renderNavbar?: ({ editor }: {
|
41
44
|
editor: JSONContent;
|
42
45
|
}) => JSX.Element;
|
43
|
-
onChange?: (changes: Data['editorJSONData']
|
46
|
+
onChange?: (changes: Data['editorJSONData']) => void;
|
44
47
|
onCollaboratorChange?: (collaborators: undefined | IDocCollabUsers[]) => void;
|
45
48
|
onTextSelection?: (data: IEditorSelectionData) => void;
|
46
49
|
onCommentInteraction?: (data: IEditorSelectionData) => void;
|
@@ -75,7 +78,7 @@ export interface IEditorSelectionData {
|
|
75
78
|
isHighlightedYellow: boolean;
|
76
79
|
}
|
77
80
|
export interface Data {
|
78
|
-
editorJSONData:
|
81
|
+
editorJSONData: JSONContent;
|
79
82
|
}
|
80
83
|
export interface IUser {
|
81
84
|
name: string;
|
@@ -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, scrollPosition, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, }: Partial<DdocProps>) => {
|
4
|
+
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, ensResolutionUrl, onError, setCharacterCount, setWordCount, secureImageUploadUrl, scrollPosition, ddocId, enableIndexeddbSync, unFocused, zoomLevel, onInvalidContentError, ignoreCorruptedData, isPresentationMode, proExtensions, }: Partial<DdocProps>) => {
|
5
5
|
editor: import('@tiptap/core').Editor | null;
|
6
6
|
isContentLoading: boolean;
|
7
7
|
ref: import('react').RefObject<HTMLDivElement>;
|
@@ -10,4 +10,6 @@ export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableColl
|
|
10
10
|
refreshYjsIndexedDbProvider: () => Promise<void>;
|
11
11
|
slides: string[];
|
12
12
|
setSlides: import('react').Dispatch<import('react').SetStateAction<string[]>>;
|
13
|
+
tocItems: any[];
|
14
|
+
setTocItems: import('react').Dispatch<import('react').SetStateAction<any[]>>;
|
13
15
|
};
|
@@ -2,7 +2,7 @@ export declare const base64ToArrayBuffer: (base64String: string) => ArrayBufferL
|
|
2
2
|
export declare const arrayBufferToBase64: (buffer: ArrayBuffer) => string;
|
3
3
|
export declare const generateRSAKeyPair: () => Promise<{
|
4
4
|
publicKey: ArrayBuffer;
|
5
|
-
privateKey: Uint8Array
|
5
|
+
privateKey: Uint8Array<ArrayBuffer>;
|
6
6
|
}>;
|
7
7
|
export declare const decryptAESKey: (encryptedKeyBase64: string, privateKeyPem: BufferSource) => Promise<ArrayBuffer>;
|
8
8
|
export declare const decryptImageData: (encryptedImageData: ArrayBuffer, aesKeyBuffer: ArrayBuffer, iv: string) => Promise<ArrayBuffer>;
|