reactjs-tiptap-editor 0.0.4 → 0.0.6
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 +8 -0
- package/lib/index.d.cts +707 -0
- package/lib/index.d.ts +707 -4
- package/lib/reactjs-tiptap-editor.cjs +1 -0
- package/lib/reactjs-tiptap-editor.js +5452 -1
- package/lib/style.css +1 -1
- package/lib/{vendor-DlmsfAkr.js → vendor-B-W_3NKN.cjs} +162 -162
- package/lib/{vendor-B_w0TZys.mjs → vendor-D8S0CsNZ.js} +2712 -2754
- package/package.json +68 -61
- package/lib/components/ActionButton.d.ts +0 -20
- package/lib/components/ActionMenuButton.d.ts +0 -14
- package/lib/components/ColorPicker.d.ts +0 -12
- package/lib/components/RcTiptapEditor.d.ts +0 -26
- package/lib/components/Toolbar.d.ts +0 -2
- package/lib/components/icons/AspectRatio.d.ts +0 -3
- package/lib/components/icons/Blockquote.d.ts +0 -1
- package/lib/components/icons/DeleteColumn.d.ts +0 -4
- package/lib/components/icons/DeleteRow.d.ts +0 -4
- package/lib/components/icons/FileWordOutline.d.ts +0 -3
- package/lib/components/icons/Icon.d.ts +0 -7
- package/lib/components/icons/LineHeight.d.ts +0 -3
- package/lib/components/icons/MenuDown.d.ts +0 -3
- package/lib/components/icons/SizeL.d.ts +0 -3
- package/lib/components/icons/SizeM.d.ts +0 -3
- package/lib/components/icons/SizeS.d.ts +0 -3
- package/lib/components/icons/icons.d.ts +0 -2
- package/lib/components/menus/bubble.d.ts +0 -56
- package/lib/components/menus/components/BubbleMenuLink.d.ts +0 -2
- package/lib/components/menus/components/BubbleMenuMedia.d.ts +0 -9
- package/lib/components/menus/components/BubbleMenuText.d.ts +0 -8
- package/lib/components/menus/components/ContentMenu.d.ts +0 -2
- package/lib/components/menus/components/TableBubbleMenu.d.ts +0 -2
- package/lib/components/ui/button.d.ts +0 -11
- package/lib/components/ui/dropdown-menu.d.ts +0 -27
- package/lib/components/ui/input.d.ts +0 -5
- package/lib/components/ui/label.d.ts +0 -5
- package/lib/components/ui/popover.d.ts +0 -6
- package/lib/components/ui/separator.d.ts +0 -4
- package/lib/components/ui/switch.d.ts +0 -4
- package/lib/components/ui/tabs.d.ts +0 -7
- package/lib/components/ui/toast.d.ts +0 -15
- package/lib/components/ui/toaster.d.ts +0 -1
- package/lib/components/ui/toggle.d.ts +0 -12
- package/lib/components/ui/tooltip.d.ts +0 -7
- package/lib/components/ui/use-toast.d.ts +0 -44
- package/lib/constants/index.d.ts +0 -44
- package/lib/extensions/BaseKit.d.ts +0 -111
- package/lib/extensions/Blockquote/Blockquote.d.ts +0 -6
- package/lib/extensions/Blockquote/index.d.ts +0 -1
- package/lib/extensions/Bold/Bold.d.ts +0 -6
- package/lib/extensions/Bold/index.d.ts +0 -1
- package/lib/extensions/BulletList/BulletList.d.ts +0 -6
- package/lib/extensions/BulletList/index.d.ts +0 -1
- package/lib/extensions/Clear/Clear.d.ts +0 -6
- package/lib/extensions/Clear/index.d.ts +0 -1
- package/lib/extensions/Code/Code.d.ts +0 -6
- package/lib/extensions/Code/index.d.ts +0 -1
- package/lib/extensions/CodeBlock/CodeBlock.d.ts +0 -6
- package/lib/extensions/CodeBlock/index.d.ts +0 -1
- package/lib/extensions/Color/Color.d.ts +0 -6
- package/lib/extensions/Color/components/ColorActionButton.d.ts +0 -13
- package/lib/extensions/Color/index.d.ts +0 -1
- package/lib/extensions/Document/Document.d.ts +0 -2
- package/lib/extensions/Document/index.d.ts +0 -1
- package/lib/extensions/FontFamily/FontFamily.d.ts +0 -3
- package/lib/extensions/FontFamily/components/FontFamilyButton.d.ts +0 -26
- package/lib/extensions/FontFamily/index.d.ts +0 -1
- package/lib/extensions/FontSize/FontSize.d.ts +0 -32
- package/lib/extensions/FontSize/components/FontSizeMenuButton.d.ts +0 -23
- package/lib/extensions/FontSize/index.d.ts +0 -1
- package/lib/extensions/FormatPainter/FormatPainter.d.ts +0 -24
- package/lib/extensions/FormatPainter/index.d.ts +0 -1
- package/lib/extensions/Heading/Heading.d.ts +0 -6
- package/lib/extensions/Heading/components/HeadingButton.d.ts +0 -26
- package/lib/extensions/Heading/index.d.ts +0 -1
- package/lib/extensions/Highlight/Highlight.d.ts +0 -6
- package/lib/extensions/Highlight/components/HighlightActionButton.d.ts +0 -14
- package/lib/extensions/Highlight/index.d.ts +0 -1
- package/lib/extensions/History/History.d.ts +0 -6
- package/lib/extensions/History/components/HistoryActionButton.d.ts +0 -20
- package/lib/extensions/History/index.d.ts +0 -1
- package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +0 -6
- package/lib/extensions/HorizontalRule/index.d.ts +0 -1
- package/lib/extensions/Iframe/Iframe.d.ts +0 -23
- package/lib/extensions/Iframe/components/IframeNodeView.d.ts +0 -2
- package/lib/extensions/Iframe/embed.d.ts +0 -23
- package/lib/extensions/Iframe/index.d.ts +0 -1
- package/lib/extensions/Image/Image.d.ts +0 -25
- package/lib/extensions/Image/components/ImageView.d.ts +0 -2
- package/lib/extensions/Image/index.d.ts +0 -1
- package/lib/extensions/ImageUpload/ImageUpload.d.ts +0 -16
- package/lib/extensions/ImageUpload/components/ImageUploader.d.ts +0 -2
- package/lib/extensions/ImageUpload/index.d.ts +0 -1
- package/lib/extensions/Indent/Indent.d.ts +0 -23
- package/lib/extensions/Indent/index.d.ts +0 -1
- package/lib/extensions/Italic/Italic.d.ts +0 -6
- package/lib/extensions/Italic/index.d.ts +0 -1
- package/lib/extensions/LineHeight/LineHeight.d.ts +0 -17
- package/lib/extensions/LineHeight/components/LineHeightDropdown.d.ts +0 -12
- package/lib/extensions/LineHeight/index.d.ts +0 -1
- package/lib/extensions/Link/Link.d.ts +0 -6
- package/lib/extensions/Link/components/LinkEditBlock.d.ts +0 -6
- package/lib/extensions/Link/components/LinkEditPopover.d.ts +0 -14
- package/lib/extensions/Link/components/LinkViewBlock.d.ts +0 -8
- package/lib/extensions/Link/index.d.ts +0 -1
- package/lib/extensions/ListItem/ListItem.d.ts +0 -1
- package/lib/extensions/ListItem/index.d.ts +0 -1
- package/lib/extensions/MoreMark/MoreMark.d.ts +0 -20
- package/lib/extensions/MoreMark/components/ActionMoreButton.d.ts +0 -25
- package/lib/extensions/MoreMark/index.d.ts +0 -1
- package/lib/extensions/MultiColumn/Column.d.ts +0 -4
- package/lib/extensions/MultiColumn/ColumnToolbar.d.ts +0 -3
- package/lib/extensions/MultiColumn/Columns.d.ts +0 -22
- package/lib/extensions/MultiColumn/index.d.ts +0 -3
- package/lib/extensions/MultiColumn/menus/ColumnsMenu.d.ts +0 -6
- package/lib/extensions/MultiColumn/menus/index.d.ts +0 -1
- package/lib/extensions/OrderedList/OrderedList.d.ts +0 -6
- package/lib/extensions/OrderedList/index.d.ts +0 -1
- package/lib/extensions/Selection/Selection.d.ts +0 -4
- package/lib/extensions/Selection/index.d.ts +0 -1
- package/lib/extensions/SlashCommand/SlashCommand.d.ts +0 -4
- package/lib/extensions/SlashCommand/components/CommandsList.d.ts +0 -4
- package/lib/extensions/SlashCommand/groups.d.ts +0 -3
- package/lib/extensions/SlashCommand/index.d.ts +0 -1
- package/lib/extensions/SlashCommand/types.d.ts +0 -25
- package/lib/extensions/Strike/Strike.d.ts +0 -6
- package/lib/extensions/Strike/index.d.ts +0 -1
- package/lib/extensions/Subscript/Subscript.d.ts +0 -23
- package/lib/extensions/Subscript/index.d.ts +0 -1
- package/lib/extensions/Table/cell-background.d.ts +0 -19
- package/lib/extensions/Table/components/CreateTablePopover.d.ts +0 -14
- package/lib/extensions/Table/components/TableActionButton.d.ts +0 -13
- package/lib/extensions/Table/index.d.ts +0 -5
- package/lib/extensions/Table/table.d.ts +0 -24
- package/lib/extensions/TaskList/TaskList.d.ts +0 -12
- package/lib/extensions/TaskList/index.d.ts +0 -1
- package/lib/extensions/TextAlign/TextAlign.d.ts +0 -18
- package/lib/extensions/TextAlign/components/TextAlignMenuButton.d.ts +0 -27
- package/lib/extensions/TextAlign/index.d.ts +0 -1
- package/lib/extensions/TextBubble/TextBubble.d.ts +0 -7
- package/lib/extensions/TextBubble/components/TextDropdown.d.ts +0 -10
- package/lib/extensions/TextBubble/index.d.ts +0 -1
- package/lib/extensions/TrailingNode/TrailingNode.d.ts +0 -12
- package/lib/extensions/TrailingNode/index.d.ts +0 -1
- package/lib/extensions/UnderLine/Underline.d.ts +0 -6
- package/lib/extensions/UnderLine/index.d.ts +0 -1
- package/lib/extensions/Video/Video.d.ts +0 -55
- package/lib/extensions/Video/index.d.ts +0 -1
- package/lib/extensions/VideoUpload/VideoUpload.d.ts +0 -14
- package/lib/extensions/VideoUpload/components/VideoUploaderView.d.ts +0 -2
- package/lib/extensions/VideoUpload/index.d.ts +0 -1
- package/lib/extensions/index.d.ts +0 -64
- package/lib/lib/utils.d.ts +0 -3
- package/lib/locales/en.d.ts +0 -2
- package/lib/locales/index.d.ts +0 -33
- package/lib/locales/vi.d.ts +0 -2
- package/lib/plugins/image-upload.d.ts +0 -12
- package/lib/reactjs-tiptap-editor.mjs +0 -5315
- package/lib/theme/theme.d.ts +0 -4
- package/lib/types.d.ts +0 -80
- package/lib/utils/getRenderContainer.d.ts +0 -4
- package/lib/utils/indent.d.ts +0 -15
- package/lib/utils/is-mobile.d.ts +0 -19
- package/lib/utils/line-height.d.ts +0 -7
- package/lib/utils/mitt.d.ts +0 -24
- package/lib/utils/plateform.d.ts +0 -11
- package/lib/utils/utils.d.ts +0 -17
package/lib/theme/theme.d.ts
DELETED
package/lib/types.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Editor as CoreEditor, Extension, JSONContent } from '@tiptap/core';
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
|
|
4
|
-
export type { Editor, JSONContent } from '@tiptap/core';
|
|
5
|
-
/**
|
|
6
|
-
* Represents the onChange event for EchoEditor.
|
|
7
|
-
*/
|
|
8
|
-
export type EchoEditorOnChange = {
|
|
9
|
-
/** Editor object */
|
|
10
|
-
editor: CoreEditor;
|
|
11
|
-
/** Output content, can be a string or JSON content */
|
|
12
|
-
output: string | JSONContent;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Represents the keys for different extensions.
|
|
16
|
-
*/
|
|
17
|
-
export type ExtensionNameKeys = 'bold' | 'italic' | 'underline' | 'strike' | 'color' | 'highlight' | 'heading' | 'textAlign' | 'bulletList' | 'orderedList' | 'taskList' | 'indent' | 'link' | 'image' | 'video' | 'table' | 'blockquote' | 'horizontalRule' | 'code' | 'codeBlock' | 'clear' | 'history';
|
|
18
|
-
/**
|
|
19
|
-
* Represents the general options for Tiptap extensions.
|
|
20
|
-
*/
|
|
21
|
-
export interface GeneralOptions<T> {
|
|
22
|
-
/** Enabled divider */
|
|
23
|
-
divider: boolean;
|
|
24
|
-
/** Enabled spacer */
|
|
25
|
-
spacer: boolean;
|
|
26
|
-
/** Button view function */
|
|
27
|
-
button: ButtonView<T>;
|
|
28
|
-
/** Show on Toolbar */
|
|
29
|
-
toolbar?: boolean;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Represents the props for the ButtonView component.
|
|
33
|
-
*/
|
|
34
|
-
export interface ButtonViewReturnComponentProps {
|
|
35
|
-
/** Method triggered when action is performed */
|
|
36
|
-
action?: (value?: any) => void;
|
|
37
|
-
/** Whether it is in the active state */
|
|
38
|
-
isActive?: () => boolean;
|
|
39
|
-
/** Button icon */
|
|
40
|
-
icon?: any;
|
|
41
|
-
/** Text displayed on hover */
|
|
42
|
-
tooltip?: string;
|
|
43
|
-
[x: string]: any;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Represents the slots for the ButtonView component.
|
|
47
|
-
*/
|
|
48
|
-
export interface ButtonViewReturnComponentSlots {
|
|
49
|
-
/** Dialog slot */
|
|
50
|
-
dialog: () => any;
|
|
51
|
-
[x: string]: () => any;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Represents the return value for the ButtonView component.
|
|
55
|
-
*/
|
|
56
|
-
export interface ButtonViewReturn {
|
|
57
|
-
/** Component */
|
|
58
|
-
component: unknown;
|
|
59
|
-
/** Component props */
|
|
60
|
-
componentProps: ButtonViewReturnComponentProps;
|
|
61
|
-
/** Component slots */
|
|
62
|
-
componentSlots?: ButtonViewReturnComponentSlots;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Represents the parameters for the ButtonView function.
|
|
66
|
-
*/
|
|
67
|
-
export interface ButtonViewParams<T = any> {
|
|
68
|
-
/** Editor object */
|
|
69
|
-
editor: Editor;
|
|
70
|
-
/** Extension object */
|
|
71
|
-
extension: Extension<T>;
|
|
72
|
-
/** Translation function */
|
|
73
|
-
t: (path: string) => string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Represents the ButtonView function.
|
|
77
|
-
*/
|
|
78
|
-
export interface ButtonView<T = any> {
|
|
79
|
-
(options: ButtonViewParams<T>): ButtonViewReturn | ButtonViewReturn[];
|
|
80
|
-
}
|
package/lib/utils/indent.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Command } from '@tiptap/core';
|
|
2
|
-
import { Transaction } from '@tiptap/pm/state';
|
|
3
|
-
|
|
4
|
-
export declare const enum IndentProps {
|
|
5
|
-
max = 7,
|
|
6
|
-
min = 0,
|
|
7
|
-
more = 1,
|
|
8
|
-
less = -1
|
|
9
|
-
}
|
|
10
|
-
export declare function clamp(val: number, min: number, max: number): number;
|
|
11
|
-
export declare function setNodeIndentMarkup(tr: Transaction, pos: number, delta: number): Transaction;
|
|
12
|
-
export declare function createIndentCommand({ delta, types }: {
|
|
13
|
-
delta: number;
|
|
14
|
-
types: string[];
|
|
15
|
-
}): Command;
|
package/lib/utils/is-mobile.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
interface HttpRequestHeadersInterfaceMock {
|
|
2
|
-
[id: string]: string | string[] | undefined;
|
|
3
|
-
}
|
|
4
|
-
interface HttpRequestInterfaceMock {
|
|
5
|
-
headers: HttpRequestHeadersInterfaceMock;
|
|
6
|
-
[id: string]: any;
|
|
7
|
-
}
|
|
8
|
-
export interface IsMobileOptions {
|
|
9
|
-
ua?: string | HttpRequestInterfaceMock;
|
|
10
|
-
tablet?: boolean;
|
|
11
|
-
featureDetect?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Determines if the current device is a mobile or tablet device.
|
|
15
|
-
* @param opts - Options for the detection.
|
|
16
|
-
* @returns `true` if the device is mobile or tablet, `false` otherwise.
|
|
17
|
-
*/
|
|
18
|
-
export declare function isMobile(opts?: IsMobileOptions): boolean;
|
|
19
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Command } from '@tiptap/core';
|
|
2
|
-
import { EditorState, Transaction } from '@tiptap/pm/state';
|
|
3
|
-
|
|
4
|
-
export declare const ALLOWED_NODE_TYPES: string[];
|
|
5
|
-
export declare function isLineHeightActive(state: EditorState, lineHeight: string): boolean;
|
|
6
|
-
export declare function setTextLineHeight(tr: Transaction, lineHeight: string | null): Transaction;
|
|
7
|
-
export declare function createLineHeightCommand(lineHeight: string): Command;
|
package/lib/utils/mitt.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* copy to https://github.com/developit/mitt
|
|
3
|
-
*/
|
|
4
|
-
export type EventType = string | symbol;
|
|
5
|
-
export type Handler<T = unknown> = (event: T) => void;
|
|
6
|
-
export type WildcardHandler<T = Record<string, unknown>> = (type: keyof T, event: T[keyof T]) => void;
|
|
7
|
-
export type EventHandlerList<T = unknown> = Array<Handler<T>>;
|
|
8
|
-
export type WildCardEventHandlerList<T = Record<string, unknown>> = Array<WildcardHandler<T>>;
|
|
9
|
-
export type EventHandlerMap<Events extends Record<EventType, unknown>> = Map<keyof Events | '*', EventHandlerList<Events[keyof Events]> | WildCardEventHandlerList<Events>>;
|
|
10
|
-
export interface Emitter<Events extends Record<EventType, unknown>> {
|
|
11
|
-
all: EventHandlerMap<Events>;
|
|
12
|
-
on<Key extends keyof Events>(type: Key, handler: Handler<Events[Key]>): void;
|
|
13
|
-
on(type: '*', handler: WildcardHandler<Events>): void;
|
|
14
|
-
off<Key extends keyof Events>(type: Key, handler?: Handler<Events[Key]>): void;
|
|
15
|
-
off(type: '*', handler: WildcardHandler<Events>): void;
|
|
16
|
-
emit<Key extends keyof Events>(type: Key, event: Events[Key]): void;
|
|
17
|
-
emit<Key extends keyof Events>(type: undefined extends Events[Key] ? Key : never): void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Mitt: Tiny (~200b) functional event emitter / pubsub.
|
|
21
|
-
* @name mitt
|
|
22
|
-
* @returns {Mitt}
|
|
23
|
-
*/
|
|
24
|
-
export default function mitt<Events extends Record<EventType, unknown>>(all?: EventHandlerMap<Events>): Emitter<Events>;
|
package/lib/utils/plateform.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Return true if the user is using a Mac (as opposed to Windows, etc.) device.
|
|
3
|
-
*/
|
|
4
|
-
export declare function isMac(): boolean;
|
|
5
|
-
/**
|
|
6
|
-
* 根据 Mac 和非 Mac 平台,返回应该用于键盘快捷键的修饰键的可读版本。用于直观地指示应该按哪个键。
|
|
7
|
-
*/
|
|
8
|
-
export declare function getShortcutKey(key: string): string;
|
|
9
|
-
export declare function getShortcutKeys(keys: string[]): string;
|
|
10
|
-
/** Return true if the user is using a touch-based device. */
|
|
11
|
-
export declare function isTouchDevice(): boolean;
|
package/lib/utils/utils.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Editor } from '@tiptap/core';
|
|
2
|
-
|
|
3
|
-
export declare const getCssUnitWithDefault: (value?: string | number, defaultUnit?: string) => string | number | undefined;
|
|
4
|
-
export declare function clamp(val: number, min: number, max: number): number;
|
|
5
|
-
export declare const isNumber: (value: unknown) => value is number;
|
|
6
|
-
export declare const isString: (value: unknown) => value is string;
|
|
7
|
-
export declare const isBoolean: (value: unknown) => value is boolean;
|
|
8
|
-
export declare const isFunction: (value: unknown) => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Checks if the editor has a specific extension method with the given name.
|
|
11
|
-
*
|
|
12
|
-
* @param {Editor} editor - An instance of the editor.
|
|
13
|
-
* @param {string} name - The name of the extension method.
|
|
14
|
-
* @returns {boolean} - Returns true if the specified extension method is present, otherwise returns false.
|
|
15
|
-
*/
|
|
16
|
-
export declare function hasExtension(editor: Editor, name: string): boolean;
|
|
17
|
-
export { differenceBy, isEqual, throttle, truncate } from 'lodash-unified';
|