@prosekit/react 0.0.23 → 0.0.24
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.
@@ -8,8 +8,6 @@ import { AutocompleteList as AutocompleteList_2 } from '@prosekit/lit/autocomple
|
|
8
8
|
import { AutocompleteListProps as AutocompleteListProps_2 } from '@prosekit/lit/autocomplete-list';
|
9
9
|
import { AutocompletePopover as AutocompletePopover_2 } from '@prosekit/lit/autocomplete-popover';
|
10
10
|
import { AutocompletePopoverProps as AutocompletePopoverProps_2 } from '@prosekit/lit/autocomplete-popover';
|
11
|
-
import { CodeBlockPopover as CodeBlockPopover_2 } from '@prosekit/lit/code-block-popover';
|
12
|
-
import { CodeBlockPopoverProps as CodeBlockPopoverProps_2 } from '@prosekit/lit/code-block-popover';
|
13
11
|
import { ComboBox as ComboBox_2 } from '@prosekit/lit/combo-box';
|
14
12
|
import { ComboBoxInput as ComboBoxInput_2 } from '@prosekit/lit/combo-box-input';
|
15
13
|
import { ComboBoxInputProps as ComboBoxInputProps_2 } from '@prosekit/lit/combo-box-input';
|
@@ -85,13 +83,6 @@ declare type AutocompletePopoverProps = SimplifyUnion<{
|
|
85
83
|
export { AutocompletePopoverProps }
|
86
84
|
export { AutocompletePopoverProps as AutocompletePopoverProps_alias_1 }
|
87
85
|
|
88
|
-
export declare const CodeBlockPopover: ForwardRefExoticComponent<PropsWithoutRef<CodeBlockPopoverProps> & RefAttributes<CodeBlockPopover_2>>;
|
89
|
-
|
90
|
-
export declare type CodeBlockPopoverProps = SimplifyUnion<{
|
91
|
-
className?: string;
|
92
|
-
children?: React_2.ReactNode;
|
93
|
-
} & CodeBlockPopoverProps_2>;
|
94
|
-
|
95
86
|
export declare const ComboBox: ForwardRefExoticComponent<PropsWithoutRef<ComboBoxProps> & RefAttributes<ComboBox_2>>;
|
96
87
|
|
97
88
|
export declare const ComboBoxInput: ForwardRefExoticComponent<PropsWithoutRef<ComboBoxInputProps> & RefAttributes<ComboBoxInput_2>>;
|
@@ -188,17 +179,11 @@ declare interface UseEditorOptions {
|
|
188
179
|
export { UseEditorOptions }
|
189
180
|
export { UseEditorOptions as UseEditorOptions_alias_1 }
|
190
181
|
|
191
|
-
declare function useExtension(
|
182
|
+
declare function useExtension<T extends Extension = Extension>(extension: T): void;
|
192
183
|
export { useExtension }
|
193
184
|
export { useExtension as useExtension_alias_1 }
|
194
185
|
|
195
|
-
declare
|
196
|
-
extension: T;
|
197
|
-
}
|
198
|
-
|
199
|
-
declare function useKeymap({ keymap }: {
|
200
|
-
keymap: Keymap;
|
201
|
-
}): void;
|
186
|
+
declare function useKeymap(keymap: Keymap): void;
|
202
187
|
export { useKeymap }
|
203
188
|
export { useKeymap as useKeymap_alias_1 }
|
204
189
|
|
package/dist/prosekit-react.js
CHANGED
@@ -57,7 +57,7 @@ import { useEffect as useEffect2 } from "react";
|
|
57
57
|
// src/hooks/use-editor.ts
|
58
58
|
import {
|
59
59
|
ProseKitError,
|
60
|
-
|
60
|
+
defineUpdateHandler
|
61
61
|
} from "@prosekit/core";
|
62
62
|
import { useContext, useEffect, useReducer } from "react";
|
63
63
|
function useEditor(options) {
|
@@ -73,7 +73,7 @@ function useEditor(options) {
|
|
73
73
|
const forceUpdate = useForceUpdate();
|
74
74
|
useEffect(() => {
|
75
75
|
if (update) {
|
76
|
-
return editor.use(
|
76
|
+
return editor.use(defineUpdateHandler(forceUpdate));
|
77
77
|
}
|
78
78
|
}, [editor, update, forceUpdate]);
|
79
79
|
return editor;
|
@@ -84,7 +84,7 @@ function useForceUpdate() {
|
|
84
84
|
}
|
85
85
|
|
86
86
|
// src/hooks/use-extension.ts
|
87
|
-
function useExtension(
|
87
|
+
function useExtension(extension) {
|
88
88
|
const editor = useEditor();
|
89
89
|
useEffect2(() => {
|
90
90
|
return editor.use(extension);
|
@@ -111,7 +111,7 @@ function RendererRegister() {
|
|
111
111
|
() => defineReactNodeViewRenderer({ nodeViewFactory }),
|
112
112
|
[nodeViewFactory]
|
113
113
|
);
|
114
|
-
useExtension(
|
114
|
+
useExtension(extension);
|
115
115
|
return null;
|
116
116
|
}
|
117
117
|
var EditorContextProvider = editorContext.Provider;
|
@@ -119,9 +119,9 @@ var EditorContextProvider = editorContext.Provider;
|
|
119
119
|
// src/hooks/use-keymap.ts
|
120
120
|
import { defineKeymap } from "@prosekit/core";
|
121
121
|
import { useMemo as useMemo2 } from "react";
|
122
|
-
function useKeymap(
|
122
|
+
function useKeymap(keymap) {
|
123
123
|
const extension = useMemo2(() => defineKeymap(keymap), [keymap]);
|
124
|
-
useExtension(
|
124
|
+
useExtension(extension);
|
125
125
|
}
|
126
126
|
export {
|
127
127
|
ProseKit,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/react",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.24",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -50,11 +50,6 @@
|
|
50
50
|
"import": "./dist/prosekit-react-autocomplete-popover.js",
|
51
51
|
"default": "./dist/prosekit-react-autocomplete-popover.js"
|
52
52
|
},
|
53
|
-
"./code-block-popover": {
|
54
|
-
"types": "./dist/prosekit-react-code-block-popover.d.ts",
|
55
|
-
"import": "./dist/prosekit-react-code-block-popover.js",
|
56
|
-
"default": "./dist/prosekit-react-code-block-popover.js"
|
57
|
-
},
|
58
53
|
"./combo-box": {
|
59
54
|
"types": "./dist/prosekit-react-combo-box.d.ts",
|
60
55
|
"import": "./dist/prosekit-react-combo-box.js",
|
@@ -91,8 +86,8 @@
|
|
91
86
|
],
|
92
87
|
"dependencies": {
|
93
88
|
"@lit/react": "^1.0.1",
|
94
|
-
"@prosekit/core": "^0.0.
|
95
|
-
"@prosekit/lit": "^0.0.
|
89
|
+
"@prosekit/core": "^0.0.20",
|
90
|
+
"@prosekit/lit": "^0.0.24",
|
96
91
|
"@prosemirror-adapter/react": "^0.2.6"
|
97
92
|
},
|
98
93
|
"peerDependencies": {
|
@@ -109,8 +104,8 @@
|
|
109
104
|
},
|
110
105
|
"devDependencies": {
|
111
106
|
"@prosekit/dev": "*",
|
112
|
-
"@types/react": "^18.2.
|
113
|
-
"@types/react-dom": "^18.2.
|
107
|
+
"@types/react": "^18.2.37",
|
108
|
+
"@types/react-dom": "^18.2.15",
|
114
109
|
"react": "^18.2.0",
|
115
110
|
"react-dom": "^18.2.0",
|
116
111
|
"tsup": "^7.2.0",
|
@@ -139,9 +134,6 @@
|
|
139
134
|
"autocomplete-popover": [
|
140
135
|
"./dist/prosekit-react-autocomplete-popover.d.ts"
|
141
136
|
],
|
142
|
-
"code-block-popover": [
|
143
|
-
"./dist/prosekit-react-code-block-popover.d.ts"
|
144
|
-
],
|
145
137
|
"combo-box": [
|
146
138
|
"./dist/prosekit-react-combo-box.d.ts"
|
147
139
|
],
|
@@ -1,17 +0,0 @@
|
|
1
|
-
// src/components/code-block-popover.gen.ts
|
2
|
-
import { createComponent } from "@lit/react";
|
3
|
-
import { CodeBlockPopover as CodeBlockPopoverElement } from "@prosekit/lit/code-block-popover";
|
4
|
-
import React from "react";
|
5
|
-
var CodeBlockPopoverInner = createComponent({
|
6
|
-
tagName: "prosekit-code-block-popover",
|
7
|
-
elementClass: CodeBlockPopoverElement,
|
8
|
-
react: React,
|
9
|
-
displayName: "CodeBlockPopoverInner"
|
10
|
-
});
|
11
|
-
var CodeBlockPopover = React.forwardRef((props, ref) => {
|
12
|
-
return React.createElement(CodeBlockPopoverInner, { ...props, ref });
|
13
|
-
});
|
14
|
-
CodeBlockPopover.displayName = "CodeBlockPopover";
|
15
|
-
export {
|
16
|
-
CodeBlockPopover
|
17
|
-
};
|