@tiptap/react 2.0.0-beta.213 → 2.0.0-beta.215
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/dist/index.cjs +391 -422
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +366 -420
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +406 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/packages/react/src/BubbleMenu.d.ts +10 -0
- package/dist/packages/react/src/Editor.d.ts +12 -0
- package/dist/packages/react/src/EditorContent.d.ts +23 -0
- package/dist/packages/react/src/FloatingMenu.d.ts +9 -0
- package/dist/packages/react/src/NodeViewContent.d.ts +6 -0
- package/dist/packages/react/src/NodeViewWrapper.d.ts +6 -0
- package/dist/packages/react/src/ReactNodeViewRenderer.d.ts +15 -0
- package/dist/packages/react/src/ReactRenderer.d.ts +24 -0
- package/dist/packages/react/src/index.d.ts +10 -0
- package/dist/packages/react/src/useEditor.d.ts +4 -0
- package/dist/packages/react/src/useReactNodeView.d.ts +7 -0
- package/package.json +10 -19
- package/dist/index.d.ts +0 -101
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Editor as ExtendedEditor } from './Editor';
|
|
4
|
+
export interface ReactRendererOptions {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
props?: Record<string, any>;
|
|
7
|
+
as?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare type ComponentType<R, P> = React.ComponentClass<P> | React.FunctionComponent<P> | React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<R>>;
|
|
11
|
+
export declare class ReactRenderer<R = unknown, P = unknown> {
|
|
12
|
+
id: string;
|
|
13
|
+
editor: ExtendedEditor;
|
|
14
|
+
component: any;
|
|
15
|
+
element: Element;
|
|
16
|
+
props: Record<string, any>;
|
|
17
|
+
reactElement: React.ReactNode;
|
|
18
|
+
ref: R | null;
|
|
19
|
+
constructor(component: ComponentType<R, P>, { editor, props, as, className, }: ReactRendererOptions);
|
|
20
|
+
render(): void;
|
|
21
|
+
updateProps(props?: Record<string, any>): void;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './BubbleMenu';
|
|
2
|
+
export { Editor } from './Editor';
|
|
3
|
+
export * from './EditorContent';
|
|
4
|
+
export * from './FloatingMenu';
|
|
5
|
+
export * from './NodeViewContent';
|
|
6
|
+
export * from './NodeViewWrapper';
|
|
7
|
+
export * from './ReactNodeViewRenderer';
|
|
8
|
+
export * from './ReactRenderer';
|
|
9
|
+
export * from './useEditor';
|
|
10
|
+
export * from '@tiptap/core';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ReactNodeViewContextProps {
|
|
3
|
+
onDragStart: (event: DragEvent) => void;
|
|
4
|
+
nodeViewContentRef: (element: HTMLElement | null) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const ReactNodeViewContext: import("react").Context<Partial<ReactNodeViewContextProps>>;
|
|
7
|
+
export declare const useReactNodeView: () => Partial<ReactNodeViewContextProps>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/react",
|
|
3
3
|
"description": "React components for tiptap",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.215",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -14,22 +14,23 @@
|
|
|
14
14
|
},
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
17
|
+
"types": "./dist/packages/react/src/index.d.ts",
|
|
18
18
|
"import": "./dist/index.js",
|
|
19
19
|
"require": "./dist/index.cjs"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"main": "dist/index.cjs",
|
|
23
23
|
"module": "dist/index.js",
|
|
24
|
-
"
|
|
24
|
+
"umd": "dist/index.umd.js",
|
|
25
|
+
"types": "dist/packages/react/src/index.d.ts",
|
|
25
26
|
"type": "module",
|
|
26
27
|
"files": [
|
|
27
28
|
"src",
|
|
28
29
|
"dist"
|
|
29
30
|
],
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@tiptap/core": "^2.0.0-beta.
|
|
32
|
-
"@tiptap/pm": "^2.0.0-beta.
|
|
32
|
+
"@tiptap/core": "^2.0.0-beta.215",
|
|
33
|
+
"@tiptap/pm": "^2.0.0-beta.215",
|
|
33
34
|
"@types/react": "^18.0.1",
|
|
34
35
|
"@types/react-dom": "^18.0.0",
|
|
35
36
|
"react": "^18.0.0",
|
|
@@ -42,8 +43,8 @@
|
|
|
42
43
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
43
44
|
},
|
|
44
45
|
"dependencies": {
|
|
45
|
-
"@tiptap/extension-bubble-menu": "^2.0.0-beta.
|
|
46
|
-
"@tiptap/extension-floating-menu": "^2.0.0-beta.
|
|
46
|
+
"@tiptap/extension-bubble-menu": "^2.0.0-beta.215",
|
|
47
|
+
"@tiptap/extension-floating-menu": "^2.0.0-beta.215"
|
|
47
48
|
},
|
|
48
49
|
"repository": {
|
|
49
50
|
"type": "git",
|
|
@@ -52,17 +53,7 @@
|
|
|
52
53
|
},
|
|
53
54
|
"sideEffects": false,
|
|
54
55
|
"scripts": {
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
"tsup": {
|
|
58
|
-
"entry": [
|
|
59
|
-
"src/index.ts"
|
|
60
|
-
],
|
|
61
|
-
"dts": true,
|
|
62
|
-
"splitting": true,
|
|
63
|
-
"format": [
|
|
64
|
-
"esm",
|
|
65
|
-
"cjs"
|
|
66
|
-
]
|
|
56
|
+
"clean": "rm -rf dist",
|
|
57
|
+
"build": "npm run clean && rollup -c"
|
|
67
58
|
}
|
|
68
59
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
2
|
-
import React, { HTMLProps, DependencyList } from 'react';
|
|
3
|
-
import { Editor as Editor$1, NodeViewRendererOptions, NodeViewRenderer, EditorOptions } from '@tiptap/core';
|
|
4
|
-
export * from '@tiptap/core';
|
|
5
|
-
import { FloatingMenuPluginProps } from '@tiptap/extension-floating-menu';
|
|
6
|
-
import { Node } from '@tiptap/pm/model';
|
|
7
|
-
import { Decoration } from '@tiptap/pm/view';
|
|
8
|
-
|
|
9
|
-
declare type Optional$1<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
10
|
-
declare type BubbleMenuProps = Omit<Optional$1<BubbleMenuPluginProps, 'pluginKey'>, 'element'> & {
|
|
11
|
-
className?: string;
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
updateDelay?: number;
|
|
14
|
-
};
|
|
15
|
-
declare const BubbleMenu: (props: BubbleMenuProps) => JSX.Element;
|
|
16
|
-
|
|
17
|
-
interface ReactRendererOptions {
|
|
18
|
-
editor: Editor$1;
|
|
19
|
-
props?: Record<string, any>;
|
|
20
|
-
as?: string;
|
|
21
|
-
className?: string;
|
|
22
|
-
}
|
|
23
|
-
declare type ComponentType<R, P> = React.ComponentClass<P> | React.FunctionComponent<P> | React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<R>>;
|
|
24
|
-
declare class ReactRenderer<R = unknown, P = unknown> {
|
|
25
|
-
id: string;
|
|
26
|
-
editor: Editor;
|
|
27
|
-
component: any;
|
|
28
|
-
element: Element;
|
|
29
|
-
props: Record<string, any>;
|
|
30
|
-
reactElement: React.ReactNode;
|
|
31
|
-
ref: R | null;
|
|
32
|
-
constructor(component: ComponentType<R, P>, { editor, props, as, className, }: ReactRendererOptions);
|
|
33
|
-
render(): void;
|
|
34
|
-
updateProps(props?: Record<string, any>): void;
|
|
35
|
-
destroy(): void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface EditorContentProps extends HTMLProps<HTMLDivElement> {
|
|
39
|
-
editor: Editor | null;
|
|
40
|
-
}
|
|
41
|
-
interface EditorContentState {
|
|
42
|
-
renderers: Record<string, ReactRenderer>;
|
|
43
|
-
}
|
|
44
|
-
declare class PureEditorContent extends React.Component<EditorContentProps, EditorContentState> {
|
|
45
|
-
editorContentRef: React.RefObject<any>;
|
|
46
|
-
initialized: boolean;
|
|
47
|
-
constructor(props: EditorContentProps);
|
|
48
|
-
componentDidMount(): void;
|
|
49
|
-
componentDidUpdate(): void;
|
|
50
|
-
init(): void;
|
|
51
|
-
maybeFlushSync(fn: () => void): void;
|
|
52
|
-
setRenderer(id: string, renderer: ReactRenderer): void;
|
|
53
|
-
removeRenderer(id: string): void;
|
|
54
|
-
componentWillUnmount(): void;
|
|
55
|
-
render(): JSX.Element;
|
|
56
|
-
}
|
|
57
|
-
declare const EditorContent: React.MemoExoticComponent<typeof PureEditorContent>;
|
|
58
|
-
|
|
59
|
-
declare type ContentComponent = React.Component<EditorContentProps, EditorContentState> & {
|
|
60
|
-
setRenderer(id: string, renderer: ReactRenderer): void;
|
|
61
|
-
removeRenderer(id: string): void;
|
|
62
|
-
};
|
|
63
|
-
declare class Editor extends Editor$1 {
|
|
64
|
-
contentComponent: ContentComponent | null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
68
|
-
declare type FloatingMenuProps = Omit<Optional<FloatingMenuPluginProps, 'pluginKey'>, 'element'> & {
|
|
69
|
-
className?: string;
|
|
70
|
-
children: React.ReactNode;
|
|
71
|
-
};
|
|
72
|
-
declare const FloatingMenu: (props: FloatingMenuProps) => JSX.Element;
|
|
73
|
-
|
|
74
|
-
interface NodeViewContentProps {
|
|
75
|
-
[key: string]: any;
|
|
76
|
-
as?: React.ElementType;
|
|
77
|
-
}
|
|
78
|
-
declare const NodeViewContent: React.FC<NodeViewContentProps>;
|
|
79
|
-
|
|
80
|
-
interface NodeViewWrapperProps {
|
|
81
|
-
[key: string]: any;
|
|
82
|
-
as?: React.ElementType;
|
|
83
|
-
}
|
|
84
|
-
declare const NodeViewWrapper: React.FC<NodeViewWrapperProps>;
|
|
85
|
-
|
|
86
|
-
interface ReactNodeViewRendererOptions extends NodeViewRendererOptions {
|
|
87
|
-
update: ((props: {
|
|
88
|
-
oldNode: Node;
|
|
89
|
-
oldDecorations: Decoration[];
|
|
90
|
-
newNode: Node;
|
|
91
|
-
newDecorations: Decoration[];
|
|
92
|
-
updateProps: () => void;
|
|
93
|
-
}) => boolean) | null;
|
|
94
|
-
as?: string;
|
|
95
|
-
className?: string;
|
|
96
|
-
}
|
|
97
|
-
declare function ReactNodeViewRenderer(component: any, options?: Partial<ReactNodeViewRendererOptions>): NodeViewRenderer;
|
|
98
|
-
|
|
99
|
-
declare const useEditor: (options?: Partial<EditorOptions>, deps?: DependencyList) => Editor | null;
|
|
100
|
-
|
|
101
|
-
export { BubbleMenu, BubbleMenuProps, Editor, EditorContent, EditorContentProps, EditorContentState, FloatingMenu, FloatingMenuProps, NodeViewContent, NodeViewContentProps, NodeViewWrapper, NodeViewWrapperProps, PureEditorContent, ReactNodeViewRenderer, ReactNodeViewRendererOptions, ReactRenderer, ReactRendererOptions, useEditor };
|