@prosekit/react 0.6.0 → 0.6.2
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/{create-component-CBvs05W1.js → create-component-DzdxL6Ne.js} +4 -2
- package/dist/create-component-DzdxL6Ne.js.map +1 -0
- package/dist/{create-props-CkTwd_m_.d.ts → create-props-DTgCRwCm.d.ts} +3 -2
- package/dist/create-props-DTgCRwCm.d.ts.map +1 -0
- package/dist/{editor-context-Cci4uqN_.js → editor-context-cG0zkv13.js} +2 -1
- package/dist/editor-context-cG0zkv13.js.map +1 -0
- package/dist/prosekit-react-autocomplete.d.ts +11 -10
- package/dist/prosekit-react-autocomplete.d.ts.map +1 -0
- package/dist/prosekit-react-autocomplete.js +4 -3
- package/dist/prosekit-react-autocomplete.js.map +1 -0
- package/dist/prosekit-react-block-handle.d.ts +9 -8
- package/dist/prosekit-react-block-handle.d.ts.map +1 -0
- package/dist/prosekit-react-block-handle.js +4 -3
- package/dist/prosekit-react-block-handle.js.map +1 -0
- package/dist/prosekit-react-drop-indicator.d.ts +5 -4
- package/dist/prosekit-react-drop-indicator.d.ts.map +1 -0
- package/dist/prosekit-react-drop-indicator.js +4 -3
- package/dist/prosekit-react-drop-indicator.js.map +1 -0
- package/dist/prosekit-react-inline-popover.d.ts +5 -4
- package/dist/prosekit-react-inline-popover.d.ts.map +1 -0
- package/dist/prosekit-react-inline-popover.js +4 -3
- package/dist/prosekit-react-inline-popover.js.map +1 -0
- package/dist/prosekit-react-popover.d.ts +9 -8
- package/dist/prosekit-react-popover.d.ts.map +1 -0
- package/dist/prosekit-react-popover.js +4 -3
- package/dist/prosekit-react-popover.js.map +1 -0
- package/dist/prosekit-react-resizable.d.ts +7 -6
- package/dist/prosekit-react-resizable.d.ts.map +1 -0
- package/dist/prosekit-react-resizable.js +4 -3
- package/dist/prosekit-react-resizable.js.map +1 -0
- package/dist/prosekit-react-table-handle.d.ts +21 -20
- package/dist/prosekit-react-table-handle.d.ts.map +1 -0
- package/dist/prosekit-react-table-handle.js +4 -3
- package/dist/prosekit-react-table-handle.js.map +1 -0
- package/dist/prosekit-react-tooltip.d.ts +9 -8
- package/dist/prosekit-react-tooltip.d.ts.map +1 -0
- package/dist/prosekit-react-tooltip.js +4 -3
- package/dist/prosekit-react-tooltip.js.map +1 -0
- package/dist/prosekit-react.d.ts +94 -85
- package/dist/prosekit-react.d.ts.map +1 -0
- package/dist/prosekit-react.js +23 -29
- package/dist/prosekit-react.js.map +1 -0
- package/package.json +21 -21
- package/src/components/autocomplete/autocomplete-empty.gen.ts +34 -0
- package/src/components/autocomplete/autocomplete-item.gen.ts +34 -0
- package/src/components/autocomplete/autocomplete-list.gen.ts +34 -0
- package/src/components/autocomplete/autocomplete-popover.gen.ts +34 -0
- package/src/components/autocomplete/index.gen.ts +7 -0
- package/src/components/block-handle/block-handle-add.gen.ts +34 -0
- package/src/components/block-handle/block-handle-draggable.gen.ts +34 -0
- package/src/components/block-handle/block-handle-popover.gen.ts +34 -0
- package/src/components/block-handle/index.gen.ts +5 -0
- package/src/components/create-component.ts +137 -0
- package/src/components/create-props.ts +13 -0
- package/src/components/drop-indicator/drop-indicator.gen.ts +34 -0
- package/src/components/drop-indicator/index.gen.ts +1 -0
- package/src/components/inline-popover/index.gen.ts +1 -0
- package/src/components/inline-popover/inline-popover.gen.ts +34 -0
- package/src/components/merge-refs.ts +35 -0
- package/src/components/popover/index.gen.ts +5 -0
- package/src/components/popover/popover-content.gen.ts +34 -0
- package/src/components/popover/popover-root.gen.ts +34 -0
- package/src/components/popover/popover-trigger.gen.ts +34 -0
- package/src/components/prosekit.ts +37 -0
- package/src/components/resizable/index.gen.ts +3 -0
- package/src/components/resizable/resizable-handle.gen.ts +34 -0
- package/src/components/resizable/resizable-root.gen.ts +34 -0
- package/src/components/table-handle/index.gen.ts +17 -0
- package/src/components/table-handle/table-handle-column-root.gen.ts +34 -0
- package/src/components/table-handle/table-handle-column-trigger.gen.ts +34 -0
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +34 -0
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +34 -0
- package/src/components/table-handle/table-handle-popover-content.gen.ts +34 -0
- package/src/components/table-handle/table-handle-popover-item.gen.ts +34 -0
- package/src/components/table-handle/table-handle-root.gen.ts +34 -0
- package/src/components/table-handle/table-handle-row-root.gen.ts +34 -0
- package/src/components/table-handle/table-handle-row-trigger.gen.ts +34 -0
- package/src/components/tooltip/index.gen.ts +5 -0
- package/src/components/tooltip/tooltip-content.gen.ts +34 -0
- package/src/components/tooltip/tooltip-root.gen.ts +34 -0
- package/src/components/tooltip/tooltip-trigger.gen.ts +34 -0
- package/src/contexts/editor-context.ts +23 -0
- package/src/extensions/react-mark-view.ts +93 -0
- package/src/extensions/react-node-view.ts +93 -0
- package/src/hooks/use-doc-change.ts +24 -0
- package/src/hooks/use-editor-derived-value.ts +85 -0
- package/src/hooks/use-editor-extension.ts +24 -0
- package/src/hooks/use-editor.ts +62 -0
- package/src/hooks/use-extension.ts +41 -0
- package/src/hooks/use-keymap.ts +15 -0
- package/src/hooks/use-priority-extension.ts +18 -0
- package/src/hooks/use-state-update.ts +24 -0
- package/src/index.ts +29 -0
- package/src/types.ts +6 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineNodeViewComponent,
|
|
3
|
+
defineNodeViewFactory,
|
|
4
|
+
type Extension,
|
|
5
|
+
} from '@prosekit/core'
|
|
6
|
+
import type { NodeViewConstructor } from '@prosekit/pm/view'
|
|
7
|
+
import type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'
|
|
8
|
+
import {
|
|
9
|
+
useNodeViewContext,
|
|
10
|
+
useNodeViewFactory,
|
|
11
|
+
type NodeViewContext,
|
|
12
|
+
type ReactNodeViewUserOptions,
|
|
13
|
+
} from '@prosemirror-adapter/react'
|
|
14
|
+
import {
|
|
15
|
+
createElement,
|
|
16
|
+
useMemo,
|
|
17
|
+
type ComponentType,
|
|
18
|
+
type FC,
|
|
19
|
+
} from 'react'
|
|
20
|
+
|
|
21
|
+
import { useExtension } from '../hooks/use-extension'
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export interface ReactNodeViewProps extends NodeViewContext {}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export type ReactNodeViewComponent = ComponentType<ReactNodeViewProps>
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Options for {@link defineReactNodeView}.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export interface ReactNodeViewOptions extends CoreNodeViewUserOptions<ReactNodeViewComponent> {
|
|
39
|
+
/**
|
|
40
|
+
* The name of the node type.
|
|
41
|
+
*/
|
|
42
|
+
name: string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function withNodeViewProps(component: ReactNodeViewComponent) {
|
|
46
|
+
return function NodeViewPropsWrapper() {
|
|
47
|
+
const props: ReactNodeViewProps = useNodeViewContext()
|
|
48
|
+
return createElement(component, props)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
export const ReactNodeViewConsumer: FC = () => {
|
|
56
|
+
const nodeViewFactory = useNodeViewFactory()
|
|
57
|
+
const extension = useMemo(
|
|
58
|
+
() => defineReactNodeViewFactory(nodeViewFactory),
|
|
59
|
+
[nodeViewFactory],
|
|
60
|
+
)
|
|
61
|
+
useExtension(extension)
|
|
62
|
+
|
|
63
|
+
return null
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Defines a node view using a React component.
|
|
68
|
+
*
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export function defineReactNodeView(options: ReactNodeViewOptions): Extension {
|
|
72
|
+
const { name, component, ...userOptions } = options
|
|
73
|
+
|
|
74
|
+
const args: ReactNodeViewUserOptions = {
|
|
75
|
+
...userOptions,
|
|
76
|
+
component: withNodeViewProps(component),
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return defineNodeViewComponent<ReactNodeViewUserOptions>({
|
|
80
|
+
group: 'react',
|
|
81
|
+
name,
|
|
82
|
+
args,
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function defineReactNodeViewFactory(
|
|
87
|
+
factory: (options: ReactNodeViewUserOptions) => NodeViewConstructor,
|
|
88
|
+
) {
|
|
89
|
+
return defineNodeViewFactory<ReactNodeViewUserOptions>({
|
|
90
|
+
group: 'react',
|
|
91
|
+
factory,
|
|
92
|
+
})
|
|
93
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineDocChangeHandler } from '@prosekit/core'
|
|
2
|
+
import type { ProseMirrorNode } from '@prosekit/pm/model'
|
|
3
|
+
import { useMemo } from 'react'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
useExtension,
|
|
7
|
+
type UseExtensionOptions,
|
|
8
|
+
} from './use-extension'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Calls the given handler whenever the editor document changes.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export function useDocChange(
|
|
16
|
+
handler: (doc: ProseMirrorNode) => void,
|
|
17
|
+
options?: UseExtensionOptions,
|
|
18
|
+
): void {
|
|
19
|
+
const extension = useMemo(
|
|
20
|
+
() => defineDocChangeHandler((view) => handler(view.state.doc)),
|
|
21
|
+
[handler],
|
|
22
|
+
)
|
|
23
|
+
useExtension(extension, options)
|
|
24
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineMountHandler,
|
|
3
|
+
defineUpdateHandler,
|
|
4
|
+
EditorNotFoundError,
|
|
5
|
+
union,
|
|
6
|
+
type Editor,
|
|
7
|
+
type Extension,
|
|
8
|
+
} from '@prosekit/core'
|
|
9
|
+
import {
|
|
10
|
+
useMemo,
|
|
11
|
+
useSyncExternalStore,
|
|
12
|
+
} from 'react'
|
|
13
|
+
|
|
14
|
+
import { useEditorContext } from '../contexts/editor-context'
|
|
15
|
+
|
|
16
|
+
export interface UseEditorDerivedOptions<E extends Extension = any> {
|
|
17
|
+
/**
|
|
18
|
+
* The editor to add the extension to. If not provided, it will use the
|
|
19
|
+
* editor from the nearest `<ProseKit>` component.
|
|
20
|
+
*/
|
|
21
|
+
editor?: Editor<E>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Runs a function to derive a value from the editor instance after editor state
|
|
26
|
+
* changes.
|
|
27
|
+
*
|
|
28
|
+
* This is useful when you need to render something based on the editor state,
|
|
29
|
+
* for example, whether the selected text is wrapped in an italic mark.
|
|
30
|
+
*
|
|
31
|
+
* It returns the derived value that updates whenever the editor state changes.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export function useEditorDerivedValue<E extends Extension, Derived>(
|
|
36
|
+
/**
|
|
37
|
+
* A function that receives the editor instance and returns a derived value.
|
|
38
|
+
*
|
|
39
|
+
* It will be called whenever the editor's document state changes, or when it
|
|
40
|
+
* mounts.
|
|
41
|
+
*
|
|
42
|
+
* This function should be memoized.
|
|
43
|
+
*/
|
|
44
|
+
derive: (editor: Editor<E>) => Derived,
|
|
45
|
+
options?: UseEditorDerivedOptions<E>,
|
|
46
|
+
): Derived {
|
|
47
|
+
const editorContext = useEditorContext<E>()
|
|
48
|
+
const editor = options?.editor ?? editorContext
|
|
49
|
+
if (!editor) {
|
|
50
|
+
throw new EditorNotFoundError()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const [subscribe, getSnapshot] = useMemo(() => {
|
|
54
|
+
return createEditorStore(editor, derive)
|
|
55
|
+
}, [editor, derive])
|
|
56
|
+
|
|
57
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function createEditorStore<Derived, E extends Extension = any>(editor: Editor<E>, derive: (editor: Editor<E>) => Derived) {
|
|
61
|
+
let dirty = true
|
|
62
|
+
let derived: Derived
|
|
63
|
+
|
|
64
|
+
const subscribe = (onChange: VoidFunction): VoidFunction => {
|
|
65
|
+
const handleChange = () => {
|
|
66
|
+
dirty = true
|
|
67
|
+
onChange()
|
|
68
|
+
}
|
|
69
|
+
const extension = union(
|
|
70
|
+
defineUpdateHandler(handleChange),
|
|
71
|
+
defineMountHandler(handleChange),
|
|
72
|
+
)
|
|
73
|
+
return editor.use(extension)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const getSnapshot = () => {
|
|
77
|
+
if (dirty) {
|
|
78
|
+
dirty = false
|
|
79
|
+
derived = derive(editor)
|
|
80
|
+
}
|
|
81
|
+
return derived
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return [subscribe, getSnapshot] as const
|
|
85
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EditorNotFoundError,
|
|
3
|
+
type Editor,
|
|
4
|
+
type Extension,
|
|
5
|
+
} from '@prosekit/core'
|
|
6
|
+
import { useEffect } from 'react'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function useEditorExtension(
|
|
12
|
+
editor: Editor | null | undefined,
|
|
13
|
+
extension: Extension | null,
|
|
14
|
+
): void {
|
|
15
|
+
if (!editor) {
|
|
16
|
+
throw new EditorNotFoundError()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (extension) {
|
|
21
|
+
return editor.use(extension)
|
|
22
|
+
}
|
|
23
|
+
}, [editor, extension])
|
|
24
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineMountHandler,
|
|
3
|
+
defineUpdateHandler,
|
|
4
|
+
ProseKitError,
|
|
5
|
+
union,
|
|
6
|
+
type Editor,
|
|
7
|
+
type Extension,
|
|
8
|
+
} from '@prosekit/core'
|
|
9
|
+
import {
|
|
10
|
+
useEffect,
|
|
11
|
+
useReducer,
|
|
12
|
+
} from 'react'
|
|
13
|
+
|
|
14
|
+
import { useEditorContext } from '../contexts/editor-context'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves the editor instance from the nearest ProseKit component.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export function useEditor<E extends Extension = any>(options?: {
|
|
22
|
+
/**
|
|
23
|
+
* Whether to update the component when the editor is mounted or editor state
|
|
24
|
+
* is updated.
|
|
25
|
+
*
|
|
26
|
+
* Note this this option doesn't work with [React
|
|
27
|
+
* compiler](https://react.dev/learn/react-compiler) because the returned
|
|
28
|
+
* editor will be the same instance after state updates. If you're using React
|
|
29
|
+
* compiler, you should use {@link useEditorDerivedValue} instead.
|
|
30
|
+
*
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
update?: boolean
|
|
34
|
+
}): Editor<E> {
|
|
35
|
+
const update = options?.update ?? false
|
|
36
|
+
|
|
37
|
+
const editor = useEditorContext<E>()
|
|
38
|
+
if (!editor) {
|
|
39
|
+
throw new ProseKitError(
|
|
40
|
+
'useEditor must be used within the ProseKit component',
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const forceUpdate = useForceUpdate()
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (update) {
|
|
48
|
+
const extension = union(
|
|
49
|
+
defineMountHandler(forceUpdate),
|
|
50
|
+
defineUpdateHandler(forceUpdate),
|
|
51
|
+
)
|
|
52
|
+
return editor.use(extension)
|
|
53
|
+
}
|
|
54
|
+
}, [editor, update, forceUpdate])
|
|
55
|
+
|
|
56
|
+
return editor
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function useForceUpdate() {
|
|
60
|
+
const [, dispatch] = useReducer((x: number) => x + 1, 0)
|
|
61
|
+
return dispatch
|
|
62
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Editor,
|
|
3
|
+
Extension,
|
|
4
|
+
Priority,
|
|
5
|
+
} from '@prosekit/core'
|
|
6
|
+
|
|
7
|
+
import { useEditorContext } from '../contexts/editor-context'
|
|
8
|
+
|
|
9
|
+
import { useEditorExtension } from './use-editor-extension'
|
|
10
|
+
import { usePriorityExtension } from './use-priority-extension'
|
|
11
|
+
|
|
12
|
+
export interface UseExtensionOptions {
|
|
13
|
+
/**
|
|
14
|
+
* The editor to add the extension to. If not provided, it will use the
|
|
15
|
+
* editor from the nearest `<ProseKit>` component.
|
|
16
|
+
*/
|
|
17
|
+
editor?: Editor
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Optional priority to add the extension with.
|
|
21
|
+
*/
|
|
22
|
+
priority?: Priority
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Add an extension to the editor.
|
|
27
|
+
*/
|
|
28
|
+
export function useExtension(
|
|
29
|
+
/**
|
|
30
|
+
* The extension to add to the editor. If it changes, the previous
|
|
31
|
+
* extension will be removed and the new one (if not null) will be added.
|
|
32
|
+
*/
|
|
33
|
+
extension: Extension | null,
|
|
34
|
+
options?: UseExtensionOptions,
|
|
35
|
+
): void {
|
|
36
|
+
const editorContext = useEditorContext()
|
|
37
|
+
useEditorExtension(
|
|
38
|
+
options?.editor || editorContext,
|
|
39
|
+
usePriorityExtension(extension, options?.priority),
|
|
40
|
+
)
|
|
41
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineKeymap,
|
|
3
|
+
type Keymap,
|
|
4
|
+
} from '@prosekit/core'
|
|
5
|
+
import { useMemo } from 'react'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
useExtension,
|
|
9
|
+
type UseExtensionOptions,
|
|
10
|
+
} from './use-extension'
|
|
11
|
+
|
|
12
|
+
export function useKeymap(keymap: Keymap, options?: UseExtensionOptions): void {
|
|
13
|
+
const extension = useMemo(() => defineKeymap(keymap), [keymap])
|
|
14
|
+
useExtension(extension, options)
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
withPriority,
|
|
3
|
+
type Extension,
|
|
4
|
+
type Priority,
|
|
5
|
+
} from '@prosekit/core'
|
|
6
|
+
import { useMemo } from 'react'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function usePriorityExtension<T extends Extension = Extension>(
|
|
12
|
+
extension: T | null,
|
|
13
|
+
priority?: Priority | null,
|
|
14
|
+
): T | null {
|
|
15
|
+
return useMemo(() => {
|
|
16
|
+
return extension && priority ? withPriority(extension, priority) : extension
|
|
17
|
+
}, [extension, priority])
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineUpdateHandler } from '@prosekit/core'
|
|
2
|
+
import type { EditorState } from '@prosekit/pm/state'
|
|
3
|
+
import { useMemo } from 'react'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
useExtension,
|
|
7
|
+
type UseExtensionOptions,
|
|
8
|
+
} from './use-extension'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Calls the given handler whenever the editor state changes.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export function useStateUpdate(
|
|
16
|
+
handler: (state: EditorState) => void,
|
|
17
|
+
options?: UseExtensionOptions,
|
|
18
|
+
): void {
|
|
19
|
+
const extension = useMemo(
|
|
20
|
+
() => defineUpdateHandler((view) => handler(view.state)),
|
|
21
|
+
[handler],
|
|
22
|
+
)
|
|
23
|
+
useExtension(extension, options)
|
|
24
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export {
|
|
2
|
+
ProseKit,
|
|
3
|
+
type ProseKitProps,
|
|
4
|
+
} from './components/prosekit'
|
|
5
|
+
export {
|
|
6
|
+
defineReactMarkView,
|
|
7
|
+
type ReactMarkViewComponent,
|
|
8
|
+
type ReactMarkViewOptions,
|
|
9
|
+
type ReactMarkViewProps,
|
|
10
|
+
} from './extensions/react-mark-view'
|
|
11
|
+
export {
|
|
12
|
+
defineReactNodeView,
|
|
13
|
+
type ReactNodeViewComponent,
|
|
14
|
+
type ReactNodeViewOptions,
|
|
15
|
+
type ReactNodeViewProps,
|
|
16
|
+
} from './extensions/react-node-view'
|
|
17
|
+
export { useDocChange } from './hooks/use-doc-change'
|
|
18
|
+
export { useEditor } from './hooks/use-editor'
|
|
19
|
+
export {
|
|
20
|
+
useEditorDerivedValue,
|
|
21
|
+
type UseEditorDerivedOptions,
|
|
22
|
+
} from './hooks/use-editor-derived-value'
|
|
23
|
+
export {
|
|
24
|
+
useExtension,
|
|
25
|
+
type UseExtensionOptions,
|
|
26
|
+
} from './hooks/use-extension'
|
|
27
|
+
export { useKeymap } from './hooks/use-keymap'
|
|
28
|
+
export { useStateUpdate } from './hooks/use-state-update'
|
|
29
|
+
export { type PropsWithClassName } from './types'
|