@tiptap/react 2.0.0-beta.11 → 2.0.0-beta.114
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/LICENSE.md +1 -1
- package/README.md +2 -2
- package/dist/packages/react/src/BubbleMenu.d.ts +6 -3
- package/dist/packages/react/src/Editor.d.ts +1 -1
- package/dist/packages/react/src/EditorContent.d.ts +2 -2
- package/dist/packages/react/src/FloatingMenu.d.ts +6 -3
- package/dist/packages/react/src/NodeViewContent.d.ts +2 -2
- package/dist/packages/react/src/NodeViewWrapper.d.ts +2 -2
- package/dist/packages/react/src/ReactNodeViewRenderer.d.ts +12 -6
- package/dist/packages/react/src/ReactRenderer.d.ts +13 -10
- package/dist/packages/react/src/index.d.ts +6 -6
- package/dist/packages/react/src/useEditor.d.ts +2 -1
- package/dist/packages/react/src/useReactNodeView.d.ts +1 -1
- package/dist/tiptap-react.cjs.js +216 -147
- package/dist/tiptap-react.cjs.js.map +1 -1
- package/dist/tiptap-react.esm.js +215 -144
- package/dist/tiptap-react.esm.js.map +1 -1
- package/dist/tiptap-react.umd.js +218 -149
- package/dist/tiptap-react.umd.js.map +1 -1
- package/package.json +18 -10
- package/src/BubbleMenu.tsx +37 -15
- package/src/Editor.ts +2 -1
- package/src/EditorContent.tsx +9 -7
- package/src/FloatingMenu.tsx +37 -14
- package/src/NodeViewContent.tsx +10 -6
- package/src/NodeViewWrapper.tsx +12 -9
- package/src/ReactNodeViewRenderer.tsx +87 -33
- package/src/ReactRenderer.tsx +38 -14
- package/src/index.ts +6 -6
- package/src/useEditor.ts +16 -4
- package/src/useReactNodeView.ts +1 -2
- package/CHANGELOG.md +0 -96
- package/dist/tiptap-react.bundle.umd.min.js +0 -54
- package/dist/tiptap-react.bundle.umd.min.js.map +0 -1
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
## Introduction
|
|
8
8
|
tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Official Documentation
|
|
11
11
|
Documentation can be found on the [tiptap website](https://tiptap.dev).
|
|
12
12
|
|
|
13
13
|
## License
|
|
14
|
-
tiptap is open
|
|
14
|
+
tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
3
|
-
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
4
|
+
export declare type BubbleMenuProps = Omit<Optional<BubbleMenuPluginProps, 'pluginKey'>, 'element'> & {
|
|
4
5
|
className?: string;
|
|
6
|
+
children: React.ReactNode;
|
|
5
7
|
};
|
|
6
|
-
export declare const BubbleMenu:
|
|
8
|
+
export declare const BubbleMenu: (props: BubbleMenuProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Editor as CoreEditor } from '@tiptap/core';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { EditorContentProps, EditorContentState } from './EditorContent';
|
|
4
4
|
export declare class Editor extends CoreEditor {
|
|
5
5
|
contentComponent: React.Component<EditorContentProps, EditorContentState> | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { HTMLProps } from 'react';
|
|
2
2
|
import { Editor } from './Editor';
|
|
3
3
|
import { ReactRenderer } from './ReactRenderer';
|
|
4
|
-
export interface EditorContentProps {
|
|
4
|
+
export interface EditorContentProps extends HTMLProps<HTMLDivElement> {
|
|
5
5
|
editor: Editor | null;
|
|
6
6
|
}
|
|
7
7
|
export interface EditorContentState {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { FloatingMenuPluginProps } from '@tiptap/extension-floating-menu';
|
|
3
|
-
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
4
|
+
export declare type FloatingMenuProps = Omit<Optional<FloatingMenuPluginProps, 'pluginKey'>, 'element'> & {
|
|
4
5
|
className?: string;
|
|
6
|
+
children: React.ReactNode;
|
|
5
7
|
};
|
|
6
|
-
export declare const FloatingMenu:
|
|
8
|
+
export declare const FloatingMenu: (props: FloatingMenuProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { NodeViewRenderer } from '@tiptap/core';
|
|
2
|
-
import { Decoration } from 'prosemirror-view';
|
|
1
|
+
import { NodeViewRenderer, NodeViewRendererOptions } from '@tiptap/core';
|
|
3
2
|
import { Node as ProseMirrorNode } from 'prosemirror-model';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
update: ((
|
|
3
|
+
import { Decoration } from 'prosemirror-view';
|
|
4
|
+
export interface ReactNodeViewRendererOptions extends NodeViewRendererOptions {
|
|
5
|
+
update: ((props: {
|
|
6
|
+
oldNode: ProseMirrorNode;
|
|
7
|
+
oldDecorations: Decoration[];
|
|
8
|
+
newNode: ProseMirrorNode;
|
|
9
|
+
newDecorations: Decoration[];
|
|
10
|
+
updateProps: () => void;
|
|
11
|
+
}) => boolean) | null;
|
|
12
|
+
as?: string;
|
|
13
|
+
className?: string;
|
|
7
14
|
}
|
|
8
15
|
export declare function ReactNodeViewRenderer(component: any, options?: Partial<ReactNodeViewRendererOptions>): NodeViewRenderer;
|
|
9
|
-
export {};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Editor } from './Editor';
|
|
3
|
+
import { Editor as ExtendedEditor } from './Editor';
|
|
4
4
|
export interface ReactRendererOptions {
|
|
5
|
-
as?: string;
|
|
6
5
|
editor: Editor;
|
|
7
|
-
props?:
|
|
6
|
+
props?: Record<string, any>;
|
|
7
|
+
as?: string;
|
|
8
|
+
className?: string;
|
|
8
9
|
}
|
|
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> {
|
|
10
12
|
id: string;
|
|
11
|
-
editor:
|
|
13
|
+
editor: ExtendedEditor;
|
|
12
14
|
component: any;
|
|
13
15
|
element: Element;
|
|
14
|
-
props:
|
|
16
|
+
props: Record<string, any>;
|
|
15
17
|
reactElement: React.ReactNode;
|
|
16
|
-
ref:
|
|
17
|
-
constructor(component:
|
|
18
|
+
ref: R | null;
|
|
19
|
+
constructor(component: ComponentType<R, P>, { editor, props, as, className, }: ReactRendererOptions);
|
|
18
20
|
render(): void;
|
|
19
|
-
updateProps(props?:
|
|
21
|
+
updateProps(props?: Record<string, any>): void;
|
|
20
22
|
destroy(): void;
|
|
21
23
|
}
|
|
24
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from '@tiptap/core';
|
|
2
1
|
export * from './BubbleMenu';
|
|
3
2
|
export { Editor } from './Editor';
|
|
4
|
-
export * from './FloatingMenu';
|
|
5
|
-
export * from './useEditor';
|
|
6
|
-
export * from './ReactRenderer';
|
|
7
|
-
export * from './ReactNodeViewRenderer';
|
|
8
3
|
export * from './EditorContent';
|
|
9
|
-
export * from './
|
|
4
|
+
export * from './FloatingMenu';
|
|
10
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';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { EditorOptions } from '@tiptap/core';
|
|
2
|
+
import { DependencyList } from 'react';
|
|
2
3
|
import { Editor } from './Editor';
|
|
3
|
-
export declare const useEditor: (options?: Partial<EditorOptions
|
|
4
|
+
export declare const useEditor: (options?: Partial<EditorOptions>, deps?: DependencyList) => Editor | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface ReactNodeViewContextProps {
|
|
3
|
-
isEditable: boolean;
|
|
4
3
|
onDragStart: (event: DragEvent) => void;
|
|
4
|
+
nodeViewContentRef: (element: HTMLElement | null) => void;
|
|
5
5
|
}
|
|
6
6
|
export declare const ReactNodeViewContext: import("react").Context<Partial<ReactNodeViewContextProps>>;
|
|
7
7
|
export declare const useReactNodeView: () => Partial<ReactNodeViewContextProps>;
|