@fileverse-dev/ddoc 2.0.2 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +81082 -59964
- package/dist/package/common/toolbar-button.d.ts +3 -3
- package/dist/package/components/editor-toolbar.d.ts +1 -0
- package/dist/package/components/editor-utils.d.ts +0 -4
- package/dist/package/components/node-selector.d.ts +3 -4
- package/dist/package/use-ddoc-editor.d.ts +1 -0
- package/dist/package/utils/colors.d.ts +4 -0
- package/dist/package/utils/template-utils.d.ts +13 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
@@ -1,9 +1,9 @@
|
|
1
|
-
|
1
|
+
declare const ToolbarButton: import('react').ForwardRefExoticComponent<{
|
2
2
|
icon: string;
|
3
3
|
isActive: boolean;
|
4
4
|
onClick: () => void;
|
5
5
|
tooltip?: string;
|
6
6
|
classNames?: string;
|
7
|
-
ref?: React.LegacyRef<HTMLButtonElement> | undefined;
|
8
7
|
disabled?: boolean;
|
9
|
-
}
|
8
|
+
} & import('react').RefAttributes<HTMLButtonElement>>;
|
9
|
+
export default ToolbarButton;
|
@@ -13,10 +13,6 @@ export declare const fonts: {
|
|
13
13
|
value: string;
|
14
14
|
command: (editor: Editor) => void;
|
15
15
|
}[];
|
16
|
-
export declare const colors: {
|
17
|
-
color: string;
|
18
|
-
code: string;
|
19
|
-
}[];
|
20
16
|
export declare const MAX_IMAGE_SIZE: number;
|
21
17
|
export declare const ERR_MSG_MAP: {
|
22
18
|
IMAGE_SIZE: string;
|
@@ -1,10 +1,9 @@
|
|
1
|
+
import { default as React } from 'react';
|
1
2
|
import { Editor } from '@tiptap/core';
|
2
|
-
import { Dispatch, FC, SetStateAction } from 'react';
|
3
3
|
|
4
4
|
interface NodeSelectorProps {
|
5
5
|
editor: Editor;
|
6
|
-
|
7
|
-
setIsOpen: Dispatch<SetStateAction<boolean>>;
|
6
|
+
elementRef: React.RefObject<HTMLDivElement>;
|
8
7
|
}
|
9
|
-
export declare const NodeSelector:
|
8
|
+
export declare const NodeSelector: ({ editor, elementRef }: NodeSelectorProps) => import("react/jsx-runtime").JSX.Element;
|
10
9
|
export {};
|
@@ -3,6 +3,7 @@ import { DdocProps } from './types';
|
|
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
5
|
editor: import('@tiptap/react').Editor | null;
|
6
|
+
isContentLoading: boolean;
|
6
7
|
ref: import('react').RefObject<HTMLDivElement>;
|
7
8
|
connect: (username: string | null | undefined, isEns?: boolean) => () => void;
|
8
9
|
ydoc: Y.Doc;
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { LucideIconProps } from '@fileverse/ui';
|
2
|
+
|
3
|
+
type IconType = LucideIconProps['name'] | string;
|
4
|
+
type TemplateButtonProps = {
|
5
|
+
label: string;
|
6
|
+
icon: IconType;
|
7
|
+
onClick: () => void;
|
8
|
+
}[];
|
9
|
+
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;
|
13
|
+
export { renderIcon, createTemplateButtons, createMoreTemplates, renderTemplateButtons };
|