@prosekit/preact 0.0.19 → 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.
- package/dist/_tsup-dts-rollup.d.ts +10 -16
- package/dist/prosekit-preact-inline-popover.d.ts +2 -0
- package/dist/prosekit-preact-inline-popover.js +9 -0
- package/dist/prosekit-preact.js +6 -4
- package/package.json +11 -11
- package/dist/prosekit-preact-code-block-popover.d.ts +0 -2
- package/dist/prosekit-preact-code-block-popover.js +0 -9
@@ -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';
|
@@ -12,6 +11,7 @@ import { ComponentType } from 'preact';
|
|
12
11
|
import { Context } from 'preact';
|
13
12
|
import { Editor } from '@prosekit/core';
|
14
13
|
import { Extension } from '@prosekit/core';
|
14
|
+
import type { InlinePopoverProps as InlinePopoverProps_2 } from '@prosekit/lit/inline-popover';
|
15
15
|
import { Keymap } from '@prosekit/core';
|
16
16
|
import { Options } from 'tsup';
|
17
17
|
import { PopoverOptions } from '@prosekit/lit/autocomplete-popover';
|
@@ -62,13 +62,6 @@ declare type AutocompletePopoverProps = {
|
|
62
62
|
export { AutocompletePopoverProps }
|
63
63
|
export { AutocompletePopoverProps as AutocompletePopoverProps_alias_1 }
|
64
64
|
|
65
|
-
export declare const CodeBlockPopover: ComponentType<CodeBlockPopoverProps>;
|
66
|
-
|
67
|
-
export declare type CodeBlockPopoverProps = {
|
68
|
-
class?: string;
|
69
|
-
children?: ComponentChildren;
|
70
|
-
} & CodeBlockPopoverProps_2;
|
71
|
-
|
72
65
|
export declare const ComboBox: ComponentType<ComboBoxProps>;
|
73
66
|
|
74
67
|
export declare const ComboBoxInput: ComponentType<ComboBoxInputProps>;
|
@@ -107,6 +100,13 @@ export declare interface EditorContext {
|
|
107
100
|
|
108
101
|
export declare const editorContext: Context<EditorContext | null>;
|
109
102
|
|
103
|
+
export declare const InlinePopover: ComponentType<InlinePopoverProps>;
|
104
|
+
|
105
|
+
export declare type InlinePopoverProps = {
|
106
|
+
class?: string;
|
107
|
+
children?: ComponentChildren;
|
108
|
+
} & InlinePopoverProps_2;
|
109
|
+
|
110
110
|
export declare const Popover: ComponentType<PopoverProps>;
|
111
111
|
|
112
112
|
export { PopoverOptions }
|
@@ -131,17 +131,11 @@ declare function useEditor<E extends Extension = any>(): Editor<E>;
|
|
131
131
|
export { useEditor }
|
132
132
|
export { useEditor as useEditor_alias_1 }
|
133
133
|
|
134
|
-
declare function useExtension(
|
134
|
+
declare function useExtension<T extends Extension = Extension>(extension: T): void;
|
135
135
|
export { useExtension }
|
136
136
|
export { useExtension as useExtension_alias_1 }
|
137
137
|
|
138
|
-
declare
|
139
|
-
extension: T;
|
140
|
-
}
|
141
|
-
|
142
|
-
declare function useKeymap({ keymap }: {
|
143
|
-
keymap: Keymap;
|
144
|
-
}): void;
|
138
|
+
declare function useKeymap(keymap: Keymap): void;
|
145
139
|
export { useKeymap }
|
146
140
|
export { useKeymap as useKeymap_alias_1 }
|
147
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",
|
@@ -75,6 +70,11 @@
|
|
75
70
|
"import": "./dist/prosekit-preact-combo-box-list.js",
|
76
71
|
"default": "./dist/prosekit-preact-combo-box-list.js"
|
77
72
|
},
|
73
|
+
"./inline-popover": {
|
74
|
+
"types": "./dist/prosekit-preact-inline-popover.d.ts",
|
75
|
+
"import": "./dist/prosekit-preact-inline-popover.js",
|
76
|
+
"default": "./dist/prosekit-preact-inline-popover.js"
|
77
|
+
},
|
78
78
|
"./popover": {
|
79
79
|
"types": "./dist/prosekit-preact-popover.d.ts",
|
80
80
|
"import": "./dist/prosekit-preact-popover.js",
|
@@ -85,8 +85,8 @@
|
|
85
85
|
"dist"
|
86
86
|
],
|
87
87
|
"dependencies": {
|
88
|
-
"@prosekit/core": "^0.0.
|
89
|
-
"@prosekit/lit": "^0.0.
|
88
|
+
"@prosekit/core": "^0.0.20",
|
89
|
+
"@prosekit/lit": "^0.0.24"
|
90
90
|
},
|
91
91
|
"peerDependencies": {
|
92
92
|
"preact": ">= 9.0.0"
|
@@ -125,9 +125,6 @@
|
|
125
125
|
"autocomplete-popover": [
|
126
126
|
"./dist/prosekit-preact-autocomplete-popover.d.ts"
|
127
127
|
],
|
128
|
-
"code-block-popover": [
|
129
|
-
"./dist/prosekit-preact-code-block-popover.d.ts"
|
130
|
-
],
|
131
128
|
"combo-box": [
|
132
129
|
"./dist/prosekit-preact-combo-box.d.ts"
|
133
130
|
],
|
@@ -140,6 +137,9 @@
|
|
140
137
|
"combo-box-list": [
|
141
138
|
"./dist/prosekit-preact-combo-box-list.d.ts"
|
142
139
|
],
|
140
|
+
"inline-popover": [
|
141
|
+
"./dist/prosekit-preact-inline-popover.d.ts"
|
142
|
+
],
|
143
143
|
"popover": [
|
144
144
|
"./dist/prosekit-preact-popover.d.ts"
|
145
145
|
]
|