@handlewithcare/react-prosemirror 2.7.0-tiptap.9 → 2.7.1

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.
Files changed (45) hide show
  1. package/README.md +5 -71
  2. package/dist/cjs/StaticEditorView.js +0 -3
  3. package/dist/cjs/dom.js +8 -3
  4. package/dist/cjs/plugins/beforeInputPlugin.js +1 -1
  5. package/dist/cjs/viewdesc.js +6 -0
  6. package/dist/esm/StaticEditorView.js +0 -3
  7. package/dist/esm/dom.js +8 -3
  8. package/dist/esm/hooks/useEditorEffect.js +0 -4
  9. package/dist/esm/hooks/useEditorEventCallback.js +5 -3
  10. package/dist/esm/plugins/beforeInputPlugin.js +1 -1
  11. package/dist/esm/viewdesc.js +6 -0
  12. package/dist/tsconfig.tsbuildinfo +1 -1
  13. package/dist/types/AbstractEditorView.d.ts +0 -1
  14. package/dist/types/StaticEditorView.d.ts +0 -1
  15. package/dist/types/hooks/useEditorEffect.d.ts +0 -4
  16. package/dist/types/hooks/useEditorEventCallback.d.ts +5 -3
  17. package/dist/types/viewdesc.d.ts +2 -0
  18. package/package.json +8 -11
  19. package/dist/cjs/tiptap/TiptapEditor.js +0 -34
  20. package/dist/cjs/tiptap/TiptapEditorContent.js +0 -136
  21. package/dist/cjs/tiptap/TiptapEditorView.js +0 -99
  22. package/dist/cjs/tiptap/extensions/ReactProseMirror.js +0 -20
  23. package/dist/cjs/tiptap/hooks/useTiptapEditor.js +0 -29
  24. package/dist/cjs/tiptap/hooks/useTiptapEditorEffect.js +0 -32
  25. package/dist/cjs/tiptap/hooks/useTiptapEditorEventCallback.js +0 -35
  26. package/dist/cjs/tiptap/index.js +0 -44
  27. package/dist/cjs/tiptap/tiptapNodeView.js +0 -188
  28. package/dist/esm/tiptap/TiptapEditor.js +0 -24
  29. package/dist/esm/tiptap/TiptapEditorContent.js +0 -85
  30. package/dist/esm/tiptap/TiptapEditorView.js +0 -50
  31. package/dist/esm/tiptap/extensions/ReactProseMirror.js +0 -10
  32. package/dist/esm/tiptap/hooks/useTiptapEditor.js +0 -19
  33. package/dist/esm/tiptap/hooks/useTiptapEditorEffect.js +0 -39
  34. package/dist/esm/tiptap/hooks/useTiptapEditorEventCallback.js +0 -35
  35. package/dist/esm/tiptap/index.js +0 -8
  36. package/dist/esm/tiptap/tiptapNodeView.js +0 -156
  37. package/dist/types/tiptap/TiptapEditor.d.ts +0 -6
  38. package/dist/types/tiptap/TiptapEditorContent.d.ts +0 -19
  39. package/dist/types/tiptap/TiptapEditorView.d.ts +0 -13
  40. package/dist/types/tiptap/extensions/ReactProseMirror.d.ts +0 -2
  41. package/dist/types/tiptap/hooks/useTiptapEditor.d.ts +0 -4
  42. package/dist/types/tiptap/hooks/useTiptapEditorEffect.d.ts +0 -21
  43. package/dist/types/tiptap/hooks/useTiptapEditorEventCallback.d.ts +0 -13
  44. package/dist/types/tiptap/index.d.ts +0 -8
  45. package/dist/types/tiptap/tiptapNodeView.d.ts +0 -48
@@ -1,21 +0,0 @@
1
- import { Editor } from "@tiptap/core";
2
- import { DependencyList } from "react";
3
- /**
4
- * Registers a layout effect to run after the EditorView has
5
- * been updated with the latest EditorState and Decorations.
6
- *
7
- * Effects can take a Tiptap Editor instance as an argument.
8
- * This hook should be used to execute layout effects that
9
- * depend on the Editor, such as for positioning DOM
10
- * nodes based on ProseMirror positions.
11
- *
12
- * Layout effects registered with this hook still fire
13
- * synchronously after all DOM mutations, but they do so
14
- * _after_ the Editor has been updated, even when the
15
- * Editor lives in an ancestor component.
16
- *
17
- * This hook can only be used in a component that is mounted
18
- * as a child of the TiptapEditorView component, including
19
- * React node view components.
20
- */
21
- export declare function useTiptapEditorEffect(effect: (editor: Editor) => void | (() => void), dependencies?: DependencyList): void;
@@ -1,13 +0,0 @@
1
- import { Editor } from "@tiptap/core";
2
- /**
3
- * Returns a stable function reference to be used as an
4
- * event handler callback.
5
- *
6
- * The callback will be called with the Tiptap Editor instance
7
- * as its first argument.
8
- *
9
- * This hook can only be used in a component that is mounted
10
- * as a child of the TiptapEditorView component, including
11
- * React node view components.
12
- */
13
- export declare function useTiptapEditorEventCallback<T extends unknown[], R>(callback: (editor: Editor, ...args: T) => R): (...args: T) => R;
@@ -1,8 +0,0 @@
1
- export { tiptapNodeView } from "./tiptapNodeView.js";
2
- export { TiptapEditorView } from "./TiptapEditorView.js";
3
- export { TiptapEditorContent } from "./TiptapEditorContent.js";
4
- export { useTiptapEditorEffect } from "./hooks/useTiptapEditorEffect.js";
5
- export { useTiptapEditorEventCallback } from "./hooks/useTiptapEditorEventCallback.js";
6
- export { TiptapEditor } from "./TiptapEditor.js";
7
- export { type UseTiptapEditorOptions, useTiptapEditor, } from "./hooks/useTiptapEditor.js";
8
- export { ReactProseMirror } from "./extensions/ReactProseMirror.js";
@@ -1,48 +0,0 @@
1
- import { type ReactNodeViewProps } from "@tiptap/react";
2
- import { type Node as ProseMirrorNode } from "prosemirror-model";
3
- import { ViewMutationRecord } from "prosemirror-view";
4
- import React, { type ComponentType, ElementType } from "react";
5
- import { NodeViewComponentProps } from "../components/NodeViewComponentProps.js";
6
- export interface TiptapNodeViewProps {
7
- component: ComponentType<ReactNodeViewProps>;
8
- extension: ReactNodeViewProps["extension"];
9
- className?: string | undefined;
10
- attrs?: Record<string, string> | ((props: {
11
- node: ProseMirrorNode;
12
- HTMLAttributes: Record<string, unknown>;
13
- }) => Record<string, string>) | undefined;
14
- as?: ElementType | undefined;
15
- stopEvent?: ((props: {
16
- event: Event;
17
- }) => boolean) | null;
18
- ignoreMutation?: ((props: {
19
- mutation: ViewMutationRecord;
20
- }) => boolean) | null;
21
- contentDOMElementTag?: ElementType | undefined;
22
- }
23
- /**
24
- * Convert a Tiptap node view component to a React ProseMirror node view component
25
- *
26
- * Given a Tiptap-compatible React component and a Tiptap extension, returns
27
- * a React component that can be passed to React ProseMirror as a custom node view.
28
- *
29
- * Example:
30
- *
31
- * ```tsx
32
- * const nodeViews = {
33
- * codeBlock: nodeView({
34
- * component: function CodeBlock(nodeViewProps) {
35
- * return (
36
- * <AnnotatableNodeViewWrapper {...nodeViewProps}>
37
- * <pre>
38
- * <NodeViewContent as="code" />
39
- * </pre>
40
- * </AnnotatableNodeViewWrapper>
41
- * )
42
- * },
43
- * extension: CodeBlockExtension,
44
- * }),
45
- * }
46
- * ```
47
- */
48
- export declare function tiptapNodeView({ component: WrappedComponent, extension, as, className, attrs, contentDOMElementTag: InnerTag, stopEvent, ignoreMutation, }: TiptapNodeViewProps): React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<NodeViewComponentProps, "ref"> & React.RefAttributes<HTMLElement | null>>>;