@fileverse-dev/ddoc 1.5.1 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +19 -13
- package/dist/index.es.js +6372 -6240
- package/dist/index.umd.js +95 -90
- package/dist/packages/ddoc/types.d.ts +11 -0
- package/dist/packages/ddoc/use-ddoc-editor.d.ts +1 -1
- package/package.json +1 -2
- package/dist/packages/ddoc/utils/buildUCANToken.d.ts +0 -2
@@ -1,5 +1,6 @@
|
|
1
1
|
import { JSONContent } from '@tiptap/core';
|
2
2
|
import { EditorProps } from '@tiptap/pm/view';
|
3
|
+
import { Editor } from '@tiptap/react';
|
3
4
|
|
4
5
|
export declare const DdocEditorProps: EditorProps;
|
5
6
|
export interface IDocCollabUsers {
|
@@ -24,6 +25,16 @@ export interface DdocProps {
|
|
24
25
|
onChange?: (changes: Data['editorJSONData']) => void;
|
25
26
|
handleImageUploadToIpfs: (file: File) => Promise<string>;
|
26
27
|
onCollaboratorChange?: (collaborators: undefined | IDocCollabUsers[]) => void;
|
28
|
+
onTextSelection?: (data: IEditorSelectionData) => void;
|
29
|
+
onCommentInteraction?: (data: IEditorSelectionData) => void;
|
30
|
+
handleCommentButtonOutsideClick?: (editor: Editor | null) => void;
|
31
|
+
handleCommentButtonClick?: (e: Editor) => void;
|
32
|
+
showCommentButton?: boolean;
|
33
|
+
}
|
34
|
+
export interface IEditorSelectionData {
|
35
|
+
from: number;
|
36
|
+
to: number;
|
37
|
+
text: string;
|
27
38
|
}
|
28
39
|
export interface Data {
|
29
40
|
editorJSONData: JSONContent;
|
@@ -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, onAutoSave, onChange, onCollaboratorChange, }: Partial<DdocProps>) => {
|
4
|
+
export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onAutoSave, onChange, onCollaboratorChange, onCommentInteraction, onTextSelection, }: Partial<DdocProps>) => {
|
5
5
|
editor: import('@tiptap/react').Editor | null;
|
6
6
|
ref: import('react').RefObject<HTMLDivElement>;
|
7
7
|
loading: boolean;
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@fileverse-dev/ddoc",
|
3
3
|
"private": false,
|
4
4
|
"description": "DDoc",
|
5
|
-
"version": "1.5.
|
5
|
+
"version": "1.5.3",
|
6
6
|
"main": "dist/index.umd.js",
|
7
7
|
"module": "dist/index.es.js",
|
8
8
|
"exports": {
|
@@ -64,7 +64,6 @@
|
|
64
64
|
"react-uuid": "^2.0.0",
|
65
65
|
"tailwindcss-animate": "^1.0.7",
|
66
66
|
"tippy.js": "^6.3.7",
|
67
|
-
"ucans": "^0.10.0",
|
68
67
|
"usehooks-ts": "^3.1.0",
|
69
68
|
"vaul": "^0.9.1",
|
70
69
|
"vite-plugin-dts": "^3.6.3",
|