@prosekit/preact 0.0.20 → 0.0.21
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.
@@ -2,7 +2,6 @@ import type { AutocompleteEmptyProps as AutocompleteEmptyProps_2 } from '@prosek
|
|
2
2
|
import type { AutocompleteItemProps as AutocompleteItemProps_2 } from '@prosekit/lit/autocomplete-item';
|
3
3
|
import type { AutocompleteListProps as AutocompleteListProps_2 } from '@prosekit/lit/autocomplete-list';
|
4
4
|
import type { AutocompletePopoverProps as AutocompletePopoverProps_2 } from '@prosekit/lit/autocomplete-popover';
|
5
|
-
import type { CodeBlockPopoverProps as CodeBlockPopoverProps_2 } from '@prosekit/lit/code-block-popover';
|
6
5
|
import type { ComboBoxInputProps as ComboBoxInputProps_2 } from '@prosekit/lit/combo-box-input';
|
7
6
|
import type { ComboBoxItemProps as ComboBoxItemProps_2 } from '@prosekit/lit/combo-box-item';
|
8
7
|
import type { ComboBoxListProps as ComboBoxListProps_2 } from '@prosekit/lit/combo-box-list';
|
@@ -63,13 +62,6 @@ declare type AutocompletePopoverProps = {
|
|
63
62
|
export { AutocompletePopoverProps }
|
64
63
|
export { AutocompletePopoverProps as AutocompletePopoverProps_alias_1 }
|
65
64
|
|
66
|
-
export declare const CodeBlockPopover: ComponentType<CodeBlockPopoverProps>;
|
67
|
-
|
68
|
-
export declare type CodeBlockPopoverProps = {
|
69
|
-
class?: string;
|
70
|
-
children?: ComponentChildren;
|
71
|
-
} & CodeBlockPopoverProps_2;
|
72
|
-
|
73
65
|
export declare const ComboBox: ComponentType<ComboBoxProps>;
|
74
66
|
|
75
67
|
export declare const ComboBoxInput: ComponentType<ComboBoxInputProps>;
|
@@ -139,17 +131,11 @@ declare function useEditor<E extends Extension = any>(): Editor<E>;
|
|
139
131
|
export { useEditor }
|
140
132
|
export { useEditor as useEditor_alias_1 }
|
141
133
|
|
142
|
-
declare function useExtension(
|
134
|
+
declare function useExtension<T extends Extension = Extension>(extension: T): void;
|
143
135
|
export { useExtension }
|
144
136
|
export { useExtension as useExtension_alias_1 }
|
145
137
|
|
146
|
-
declare
|
147
|
-
extension: T;
|
148
|
-
}
|
149
|
-
|
150
|
-
declare function useKeymap({ keymap }: {
|
151
|
-
keymap: Keymap;
|
152
|
-
}): void;
|
138
|
+
declare function useKeymap(keymap: Keymap): void;
|
153
139
|
export { useKeymap }
|
154
140
|
export { useKeymap as useKeymap_alias_1 }
|
155
141
|
|
package/dist/prosekit-preact.js
CHANGED
@@ -28,17 +28,19 @@ function useEditor() {
|
|
28
28
|
// src/hooks/use-extension.ts
|
29
29
|
import "@prosekit/core";
|
30
30
|
import { useEffect } from "preact/hooks";
|
31
|
-
function useExtension(
|
31
|
+
function useExtension(extension) {
|
32
32
|
const editor = useEditor();
|
33
|
-
useEffect(() =>
|
33
|
+
useEffect(() => {
|
34
|
+
return editor.use(extension);
|
35
|
+
}, [editor, extension]);
|
34
36
|
}
|
35
37
|
|
36
38
|
// src/hooks/use-keymap.ts
|
37
39
|
import { defineKeymap } from "@prosekit/core";
|
38
40
|
import { useMemo } from "preact/hooks";
|
39
|
-
function useKeymap(
|
41
|
+
function useKeymap(keymap) {
|
40
42
|
const extension = useMemo(() => defineKeymap(keymap), [keymap]);
|
41
|
-
useExtension(
|
43
|
+
useExtension(extension);
|
42
44
|
}
|
43
45
|
export {
|
44
46
|
ProseKit,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/preact",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.21",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -50,11 +50,6 @@
|
|
50
50
|
"import": "./dist/prosekit-preact-autocomplete-popover.js",
|
51
51
|
"default": "./dist/prosekit-preact-autocomplete-popover.js"
|
52
52
|
},
|
53
|
-
"./code-block-popover": {
|
54
|
-
"types": "./dist/prosekit-preact-code-block-popover.d.ts",
|
55
|
-
"import": "./dist/prosekit-preact-code-block-popover.js",
|
56
|
-
"default": "./dist/prosekit-preact-code-block-popover.js"
|
57
|
-
},
|
58
53
|
"./combo-box": {
|
59
54
|
"types": "./dist/prosekit-preact-combo-box.d.ts",
|
60
55
|
"import": "./dist/prosekit-preact-combo-box.js",
|
@@ -90,8 +85,8 @@
|
|
90
85
|
"dist"
|
91
86
|
],
|
92
87
|
"dependencies": {
|
93
|
-
"@prosekit/core": "^0.0.
|
94
|
-
"@prosekit/lit": "^0.0.
|
88
|
+
"@prosekit/core": "^0.0.20",
|
89
|
+
"@prosekit/lit": "^0.0.24"
|
95
90
|
},
|
96
91
|
"peerDependencies": {
|
97
92
|
"preact": ">= 9.0.0"
|
@@ -130,9 +125,6 @@
|
|
130
125
|
"autocomplete-popover": [
|
131
126
|
"./dist/prosekit-preact-autocomplete-popover.d.ts"
|
132
127
|
],
|
133
|
-
"code-block-popover": [
|
134
|
-
"./dist/prosekit-preact-code-block-popover.d.ts"
|
135
|
-
],
|
136
128
|
"combo-box": [
|
137
129
|
"./dist/prosekit-preact-combo-box.d.ts"
|
138
130
|
],
|