@fileverse-dev/ddoc 2.1.1-v2-patch-14 → 2.1.1-ws-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.
Files changed (33) hide show
  1. package/README.md +0 -15
  2. package/dist/index.es.js +73475 -76365
  3. package/dist/package/components/{editor-bubble-menu/types.d.ts → editor-bubble-menu.d.ts} +5 -11
  4. package/dist/package/components/node-selector.d.ts +9 -0
  5. package/dist/package/components/presentation-mode/presentation-mode.d.ts +3 -3
  6. package/dist/package/extensions/default-extension.d.ts +1 -1
  7. package/dist/package/extensions/supercharged-table/extension-table/table-view.d.ts +5 -2
  8. package/dist/package/extensions/supercharged-table/extension-table-row/table-row-node-view.d.ts +5 -2
  9. package/dist/package/types.d.ts +5 -26
  10. package/dist/package/use-ddoc-editor.d.ts +1 -6
  11. package/dist/package/utils/security.d.ts +1 -1
  12. package/dist/style.css +1 -1
  13. package/package.json +2 -3
  14. package/dist/package/components/editor-bubble-menu/editor-bubble-menu.d.ts +0 -3
  15. package/dist/package/components/editor-bubble-menu/node-selector.d.ts +0 -3
  16. package/dist/package/components/editor-bubble-menu/props.d.ts +0 -58
  17. package/dist/package/components/inline-comment/comment-bubble-card.d.ts +0 -7
  18. package/dist/package/components/inline-comment/comment-card.d.ts +0 -3
  19. package/dist/package/components/inline-comment/comment-drawer.d.ts +0 -3
  20. package/dist/package/components/inline-comment/comment-dropdown.d.ts +0 -3
  21. package/dist/package/components/inline-comment/comment-section.d.ts +0 -3
  22. package/dist/package/components/inline-comment/comment-username.d.ts +0 -4
  23. package/dist/package/components/inline-comment/context/comment-context.d.ts +0 -6
  24. package/dist/package/components/inline-comment/context/types.d.ts +0 -74
  25. package/dist/package/components/inline-comment/types.d.ts +0 -65
  26. package/dist/package/components/inline-comment/use-comment-actions.d.ts +0 -0
  27. package/dist/package/components/toc/document-outline.d.ts +0 -3
  28. package/dist/package/components/toc/toc.d.ts +0 -5
  29. package/dist/package/components/toc/types.d.ts +0 -30
  30. package/dist/package/extensions/comment/comment.d.ts +0 -63
  31. package/dist/package/extensions/comment/index.d.ts +0 -2
  32. package/dist/package/utils/helpers.d.ts +0 -2
  33. package/dist/package/utils/responsive.d.ts +0 -7
@@ -1,6 +1,5 @@
1
- import { BubbleMenuProps, Editor } from '@tiptap/react';
2
- import { SetStateAction } from 'react';
3
- import { InlineCommentData } from '../../types';
1
+ import { BubbleMenuProps } from '@tiptap/react';
2
+ import { default as React } from 'react';
4
3
 
5
4
  export interface BubbleMenuItem {
6
5
  name: string;
@@ -8,8 +7,7 @@ export interface BubbleMenuItem {
8
7
  command: () => void;
9
8
  icon: any;
10
9
  }
11
- export type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
12
- activeCommentId: string | null;
10
+ type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
13
11
  isPreviewMode: boolean;
14
12
  onError?: (errorString: string) => void;
15
13
  zoomLevel: string;
@@ -19,10 +17,6 @@ export type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
19
17
  walletAddress?: string;
20
18
  username?: string;
21
19
  onInlineComment?: () => void;
22
- commentDrawerOpen?: boolean;
23
- setCommentDrawerOpen?: React.Dispatch<SetStateAction<boolean>>;
24
20
  };
25
- export interface NodeSelectorProps {
26
- editor: Editor;
27
- elementRef: React.RefObject<HTMLDivElement>;
28
- }
21
+ export declare const EditorBubbleMenu: (props: EditorBubbleMenuProps) => import("react/jsx-runtime").JSX.Element;
22
+ export {};
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import { Editor } from '@tiptap/core';
3
+
4
+ interface NodeSelectorProps {
5
+ editor: Editor;
6
+ elementRef: React.RefObject<HTMLDivElement>;
7
+ }
8
+ export declare const NodeSelector: ({ editor, elementRef }: NodeSelectorProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -4,9 +4,9 @@ interface PresentationModeProps {
4
4
  editor: Editor;
5
5
  onClose: () => void;
6
6
  isFullscreen: boolean;
7
- setIsFullscreen: React.Dispatch<React.SetStateAction<boolean>>;
7
+ setIsFullscreen: (isFullscreen: boolean) => void;
8
8
  onError?: (error: string) => void;
9
- setCommentDrawerOpen: React.Dispatch<React.SetStateAction<boolean>> | undefined;
9
+ setIsCommentSectionOpen: React.Dispatch<React.SetStateAction<boolean>> | undefined;
10
10
  sharedSlidesLink?: string;
11
11
  isPreviewMode: boolean;
12
12
  documentName: string;
@@ -14,5 +14,5 @@ interface PresentationModeProps {
14
14
  slides: string[];
15
15
  setSlides: React.Dispatch<React.SetStateAction<string[]>>;
16
16
  }
17
- export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setCommentDrawerOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
17
+ export declare const PresentationMode: ({ editor, onClose, isFullscreen, setIsFullscreen, onError, setIsCommentSectionOpen, sharedSlidesLink, isPreviewMode, documentName, onSlidesShare, slides, setSlides, }: PresentationModeProps) => import("react/jsx-runtime").JSX.Element | null;
18
18
  export {};
@@ -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').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<any, any>)[];
4
+ export declare const defaultExtensions: (onError: (error: string) => void, secureImageUploadUrl?: string) => (import('@tiptap/core').Node<any, any> | import('@tiptap/core').Extension<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, ViewMutationRecord } from 'prosemirror-view';
2
+ import { NodeView } 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,5 +11,8 @@ 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: ViewMutationRecord): boolean;
14
+ ignoreMutation(mutation: MutationRecord | {
15
+ type: 'selection';
16
+ target: Element;
17
+ }): boolean;
15
18
  }
@@ -1,5 +1,5 @@
1
1
  import { Node as ProseMirrorNode } from 'prosemirror-model';
2
- import { NodeView, ViewMutationRecord } from 'prosemirror-view';
2
+ import { NodeView } from 'prosemirror-view';
3
3
 
4
4
  export declare class TableRowNodeView implements NodeView {
5
5
  node: ProseMirrorNode;
@@ -10,5 +10,8 @@ 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: ViewMutationRecord): boolean;
13
+ ignoreMutation(mutation: MutationRecord | {
14
+ type: 'selection';
15
+ target: Element;
16
+ }): boolean;
14
17
  }
@@ -1,9 +1,8 @@
1
1
  import { TagType } from '@fileverse/ui';
2
- import { Extension, JSONContent } from '@tiptap/core';
2
+ import { 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';
6
- import { IComment } from './extensions/comment';
7
6
 
8
7
  export declare const DdocEditorProps: EditorProps;
9
8
  export interface IDocCollabUsers {
@@ -11,31 +10,12 @@ export interface IDocCollabUsers {
11
10
  isEns: string;
12
11
  color: string;
13
12
  }
14
- export type InlineCommentData = {
13
+ type InlineCommentData = {
15
14
  inlineCommentText: string;
16
15
  highlightedTextContent: string;
17
16
  handleClick: boolean;
18
17
  };
19
- export interface CommentAccountProps {
20
- isConnected?: boolean;
21
- connectViaWallet?: () => Promise<void>;
22
- isLoading?: boolean;
23
- connectViaUsername?: (username: string) => Promise<void>;
24
- isDDocOwner?: boolean;
25
- }
26
- export interface DdocProps extends CommentAccountProps {
27
- commentDrawerOpen?: boolean;
28
- setCommentDrawerOpen?: React.Dispatch<SetStateAction<boolean>>;
29
- initialComments?: IComment[];
30
- setInitialComments?: React.Dispatch<SetStateAction<IComment[]>>;
31
- onCommentReply?: (activeCommentId: string, reply: IComment) => void;
32
- onNewComment?: (newComment: IComment) => void;
33
- onResolveComment?: (activeCommentId: string) => void;
34
- onUnresolveComment?: (activeCommentId: string) => void;
35
- onDeleteComment?: (activeCommentId: string) => void;
36
- showTOC?: boolean;
37
- setShowTOC?: React.Dispatch<SetStateAction<boolean>>;
38
- proExtensions?: Record<string, Extension | any>;
18
+ export interface DdocProps {
39
19
  selectedTags?: TagType[];
40
20
  setSelectedTags?: React.Dispatch<SetStateAction<TagType[]>>;
41
21
  enableCollaboration?: boolean | undefined;
@@ -57,11 +37,10 @@ export interface DdocProps extends CommentAccountProps {
57
37
  initialContent?: JSONContent | string | string[] | null;
58
38
  walletAddress?: string | null;
59
39
  username?: string | null;
60
- setUsername?: React.Dispatch<SetStateAction<string>>;
61
40
  renderNavbar?: ({ editor }: {
62
41
  editor: JSONContent;
63
42
  }) => JSX.Element;
64
- onChange?: (updatedDocContent: Data['editorJSONData'], updateChunk: string) => void;
43
+ onChange?: (changes: Data['editorJSONData'], update: string) => void;
65
44
  onCollaboratorChange?: (collaborators: undefined | IDocCollabUsers[]) => void;
66
45
  onTextSelection?: (data: IEditorSelectionData) => void;
67
46
  onCommentInteraction?: (data: IEditorSelectionData) => void;
@@ -103,4 +82,4 @@ export interface IUser {
103
82
  color: string;
104
83
  isEns: boolean;
105
84
  }
106
- export { type IComment };
85
+ export {};
@@ -1,18 +1,13 @@
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, proExtensions, }: 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, }: Partial<DdocProps>) => {
5
5
  editor: import('@tiptap/core').Editor | null;
6
6
  isContentLoading: boolean;
7
7
  ref: import('react').RefObject<HTMLDivElement>;
8
8
  connect: (username: string | null | undefined, isEns?: boolean) => () => void;
9
9
  ydoc: Y.Doc;
10
10
  refreshYjsIndexedDbProvider: () => Promise<void>;
11
- activeCommentId: string | null;
12
- setActiveCommentId: import('react').Dispatch<import('react').SetStateAction<string | null>>;
13
- focusCommentWithActiveId: (id: string) => void;
14
11
  slides: string[];
15
12
  setSlides: import('react').Dispatch<import('react').SetStateAction<string[]>>;
16
- tocItems: any[];
17
- setTocItems: import('react').Dispatch<import('react').SetStateAction<any[]>>;
18
13
  };
@@ -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<ArrayBuffer>;
5
+ privateKey: Uint8Array;
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>;