@handlewithcare/react-prosemirror 3.1.0-tiptap.47 → 3.1.0-tiptap.49
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 +36 -6
- package/dist/cjs/tiptap/hooks/useEditor.js +349 -0
- package/dist/cjs/tiptap/hooks/useTiptapEditor.js +2 -2
- package/dist/cjs/tiptap/utils/ssrJSDOMPatch.js +59 -0
- package/dist/esm/tiptap/hooks/useEditor.js +339 -0
- package/dist/esm/tiptap/hooks/useTiptapEditor.js +1 -1
- package/dist/esm/tiptap/utils/ssrJSDOMPatch.js +56 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/tiptap/hooks/useEditor.d.ts +38 -0
- package/dist/types/tiptap/hooks/useTiptapEditor.d.ts +1 -1
- package/dist/types/tiptap/utils/ssrJSDOMPatch.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Editor, type EditorOptions } from "@tiptap/core";
|
|
2
|
+
import { DependencyList } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* The options for the `useEditor` hook.
|
|
5
|
+
*/
|
|
6
|
+
export type UseEditorOptions = Partial<EditorOptions> & {
|
|
7
|
+
/**
|
|
8
|
+
* Whether to render the editor on the first render.
|
|
9
|
+
* If client-side rendering, set this to `true`.
|
|
10
|
+
* If server-side rendering, set this to `false`.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
immediatelyRender?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to re-render the editor on each transaction.
|
|
16
|
+
* This is legacy behavior that will be removed in future versions.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
shouldRerenderOnTransaction?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* This hook allows you to create an editor instance.
|
|
23
|
+
* @param options The editor options
|
|
24
|
+
* @param deps The dependencies to watch for changes
|
|
25
|
+
* @returns The editor instance
|
|
26
|
+
* @example const editor = useEditor({ extensions: [...] })
|
|
27
|
+
*/
|
|
28
|
+
export declare function useEditor(options: UseEditorOptions & {
|
|
29
|
+
immediatelyRender: false;
|
|
30
|
+
}, deps?: DependencyList): Editor | null;
|
|
31
|
+
/**
|
|
32
|
+
* This hook allows you to create an editor instance.
|
|
33
|
+
* @param options The editor options
|
|
34
|
+
* @param deps The dependencies to watch for changes
|
|
35
|
+
* @returns The editor instance
|
|
36
|
+
* @example const editor = useEditor({ extensions: [...] })
|
|
37
|
+
*/
|
|
38
|
+
export declare function useEditor(options: UseEditorOptions, deps?: DependencyList): Editor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEditor } from "@tiptap/react";
|
|
2
1
|
import { DependencyList } from "react";
|
|
2
|
+
import { useEditor } from "./useEditor.js";
|
|
3
3
|
export type UseTiptapEditorOptions = Omit<Parameters<typeof useEditor>[0], "element">;
|
|
4
4
|
export declare function useTiptapEditor(options: UseTiptapEditorOptions, deps?: DependencyList): import("@tiptap/core").Editor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|