@fileverse-dev/ddoc 2.0.3 → 2.0.4-patch-2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1 @@
1
- interface SpinnerProps {
2
- height?: number;
3
- width?: number;
4
- }
5
- export declare const Spinner: ({ height, width }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
6
- export default Spinner;
1
+ export declare const Spinner: () => import("react/jsx-runtime").JSX.Element;
@@ -6,6 +6,8 @@ export interface BubbleMenuItem {
6
6
  command: () => void;
7
7
  icon: any;
8
8
  }
9
- type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'>;
9
+ type EditorBubbleMenuProps = Omit<BubbleMenuProps, 'children'> & {
10
+ onError?: (errorString: string) => void;
11
+ };
10
12
  export declare const EditorBubbleMenu: (props: EditorBubbleMenuProps) => import("react/jsx-runtime").JSX.Element;
11
13
  export {};
@@ -51,12 +51,18 @@ export declare const EditorList: ({ elementRef, editor, setToolVisibility, }: {
51
51
  editor: Editor;
52
52
  setToolVisibility: Dispatch<SetStateAction<IEditorTool>>;
53
53
  }) => import("react/jsx-runtime").JSX.Element;
54
- export declare const LinkPopup: ({ elementRef, editor, setToolVisibility, bubbleMenu, setIsLinkPopupOpen, }: {
54
+ export declare const LinkPopup: ({ elementRef, editor, setToolVisibility, bubbleMenu, setIsLinkPopupOpen, onError, }: {
55
55
  elementRef: React.RefObject<HTMLDivElement>;
56
56
  editor: Editor;
57
57
  setToolVisibility: Dispatch<SetStateAction<IEditorTool>>;
58
58
  bubbleMenu?: boolean;
59
59
  setIsLinkPopupOpen?: Dispatch<SetStateAction<boolean>>;
60
+ onError?: (errorString: string) => void;
61
+ }) => import("react/jsx-runtime").JSX.Element;
62
+ export declare const ScriptsPopup: ({ elementRef, editor, setToolVisibility, }: {
63
+ elementRef: React.RefObject<HTMLDivElement>;
64
+ editor: Editor;
65
+ setToolVisibility: Dispatch<SetStateAction<IEditorTool>>;
60
66
  }) => import("react/jsx-runtime").JSX.Element;
61
67
  export declare const TextColor: ({ editor, setVisibility, elementRef, }: {
62
68
  editor: Editor;
@@ -0,0 +1,12 @@
1
+ export interface TagProps {
2
+ name: string;
3
+ color: string;
4
+ }
5
+ export interface TagInputProps {
6
+ tags: TagProps[];
7
+ selectedTags: TagProps[];
8
+ onAddTag: (tag: TagProps) => void;
9
+ isPreviewMode: boolean;
10
+ }
11
+ declare const TagInput: ({ tags, selectedTags, onAddTag, isPreviewMode }: TagInputProps) => import("react/jsx-runtime").JSX.Element | null;
12
+ export { TagInput };
@@ -9,7 +9,8 @@ export declare enum IEditorTool {
9
9
  LIST = 7,
10
10
  TEXT_FORMATING = 8,
11
11
  TEXT_COLOR_PICKER = 9,
12
- LINK_POPUP = 10
12
+ LINK_POPUP = 10,
13
+ SCRIPTS = 11
13
14
  }
14
15
  export default function useComponentVisibility(initialIsVisible: boolean): {
15
16
  ref: import('react').RefObject<HTMLDivElement>;
@@ -1,3 +1,4 @@
1
+ import { TagType } from '@fileverse/ui';
1
2
  import { JSONContent } from '@tiptap/core';
2
3
  import { EditorProps } from '@tiptap/pm/view';
3
4
  import { Editor } from '@tiptap/react';
@@ -10,6 +11,8 @@ export interface IDocCollabUsers {
10
11
  color: string;
11
12
  }
12
13
  export interface DdocProps {
14
+ selectedTags?: TagType[];
15
+ setSelectedTags?: React.Dispatch<SetStateAction<TagType[]>>;
13
16
  enableCollaboration?: boolean;
14
17
  collaborationId?: string;
15
18
  isPreviewMode: boolean;
@@ -30,6 +33,10 @@ export interface DdocProps {
30
33
  onError?: (error: string) => void;
31
34
  setCharacterCount?: React.Dispatch<SetStateAction<number>>;
32
35
  setWordCount?: React.Dispatch<SetStateAction<number>>;
36
+ tags?: Array<{
37
+ name: string;
38
+ color: string;
39
+ }>;
33
40
  }
34
41
  export interface IEditorSelectionData {
35
42
  from: number;
@@ -2,7 +2,7 @@ import { DdocProps } from './types';
2
2
 
3
3
  import * as Y from 'yjs';
4
4
  export declare const useDdocEditor: ({ isPreviewMode, initialContent, enableCollaboration, collaborationId, walletAddress, username, onChange, onCollaboratorChange, onCommentInteraction, onTextSelection, ensResolutionUrl, onError, setCharacterCount, setWordCount, }: Partial<DdocProps>) => {
5
- editor: import('@tiptap/react').Editor | null;
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;
@@ -0,0 +1,3 @@
1
+ import { JSONContent } from '@tiptap/react';
2
+
3
+ export declare const getTemplateContent: (templateQuery: string) => JSONContent | null;
@@ -1,3 +1,4 @@
1
+ import { JSONContent } from '@tiptap/react';
1
2
  import { LucideIconProps } from '@fileverse/ui';
2
3
 
3
4
  type IconType = LucideIconProps['name'] | string;
@@ -5,9 +6,10 @@ type TemplateButtonProps = {
5
6
  label: string;
6
7
  icon: IconType;
7
8
  onClick: () => void;
9
+ content: JSONContent | null;
8
10
  }[];
9
11
  declare const renderIcon: (icon: IconType, className?: string) => import("react/jsx-runtime").JSX.Element | null;
10
- declare const createTemplateButtons: (addTemplate: (template: string) => void) => TemplateButtonProps;
11
- declare const createMoreTemplates: (addTemplate: (template: string) => void) => TemplateButtonProps;
12
- declare const renderTemplateButtons: (templateButtons: TemplateButtonProps, moreTemplates: TemplateButtonProps, visibleTemplateCount: number, expandAllTemplates: () => void) => import("react/jsx-runtime").JSX.Element;
12
+ declare const createTemplateButtons: (addTemplate: (template: JSONContent) => void) => TemplateButtonProps;
13
+ declare const createMoreTemplates: (addTemplate: (template: JSONContent) => void) => TemplateButtonProps;
14
+ declare const renderTemplateButtons: (templateButtons: TemplateButtonProps, moreTemplates: TemplateButtonProps, visibleTemplateCount: number, toggleAllTemplates: () => void, isExpanded: boolean) => import("react/jsx-runtime").JSX.Element;
13
15
  export { renderIcon, createTemplateButtons, createMoreTemplates, renderTemplateButtons };