@prosekit/solid 0.0.20 → 0.0.22
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-solid-inline-popover.d.ts +2 -0
- package/dist/prosekit-solid-inline-popover.js +9 -0
- package/dist/prosekit-solid.js +8 -9
- package/package.json +11 -11
- package/dist/prosekit-solid-code-block-popover.d.ts +0 -2
- package/dist/prosekit-solid-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';
|
@@ -11,6 +10,7 @@ import { Component } from 'solid-js';
|
|
11
10
|
import { Context } from 'solid-js';
|
12
11
|
import { Editor } from '@prosekit/core';
|
13
12
|
import { Extension } from '@prosekit/core';
|
13
|
+
import type { InlinePopoverProps as InlinePopoverProps_2 } from '@prosekit/lit/inline-popover';
|
14
14
|
import type { JSXElement } from 'solid-js';
|
15
15
|
import { Keymap } from '@prosekit/core';
|
16
16
|
import { Options } from 'tsup';
|
@@ -63,13 +63,6 @@ declare type AutocompletePopoverProps = {
|
|
63
63
|
export { AutocompletePopoverProps }
|
64
64
|
export { AutocompletePopoverProps as AutocompletePopoverProps_alias_1 }
|
65
65
|
|
66
|
-
export declare const CodeBlockPopover: Component<CodeBlockPopoverProps>;
|
67
|
-
|
68
|
-
export declare type CodeBlockPopoverProps = {
|
69
|
-
class?: string;
|
70
|
-
children?: JSXElement;
|
71
|
-
} & CodeBlockPopoverProps_2;
|
72
|
-
|
73
66
|
export declare const ComboBox: Component<ComboBoxProps>;
|
74
67
|
|
75
68
|
export declare const ComboBoxInput: Component<ComboBoxInputProps>;
|
@@ -108,6 +101,13 @@ declare interface EditorContext {
|
|
108
101
|
|
109
102
|
export declare const editorContext: Context<EditorContext | null>;
|
110
103
|
|
104
|
+
export declare const InlinePopover: Component<InlinePopoverProps>;
|
105
|
+
|
106
|
+
export declare type InlinePopoverProps = {
|
107
|
+
class?: string;
|
108
|
+
children?: JSXElement;
|
109
|
+
} & InlinePopoverProps_2;
|
110
|
+
|
111
111
|
export declare const Popover: Component<PopoverProps>;
|
112
112
|
|
113
113
|
export { PopoverOptions }
|
@@ -135,17 +135,11 @@ export declare interface UseEditorOptions {
|
|
135
135
|
update?: boolean;
|
136
136
|
}
|
137
137
|
|
138
|
-
declare function useExtension(
|
138
|
+
declare function useExtension<T extends Extension = Extension>(extension: T): void;
|
139
139
|
export { useExtension }
|
140
140
|
export { useExtension as useExtension_alias_1 }
|
141
141
|
|
142
|
-
declare
|
143
|
-
extension: T;
|
144
|
-
}
|
145
|
-
|
146
|
-
declare function useKeymap({ keymap }: {
|
147
|
-
keymap: Keymap;
|
148
|
-
}): void;
|
142
|
+
declare function useKeymap(keymap: Keymap): void;
|
149
143
|
export { useKeymap }
|
150
144
|
export { useKeymap as useKeymap_alias_1 }
|
151
145
|
|
package/dist/prosekit-solid.js
CHANGED
@@ -22,7 +22,7 @@ var ProseKit = (props) => {
|
|
22
22
|
// src/hooks/use-editor.ts
|
23
23
|
import {
|
24
24
|
ProseKitError,
|
25
|
-
|
25
|
+
defineUpdateHandler
|
26
26
|
} from "@prosekit/core";
|
27
27
|
import { useContext, createEffect, createSignal } from "solid-js";
|
28
28
|
function useEditor(options) {
|
@@ -38,7 +38,7 @@ function useEditor(options) {
|
|
38
38
|
const [depend, forceUpdate] = useForceUpdate();
|
39
39
|
createEffect(() => {
|
40
40
|
if (update) {
|
41
|
-
return editor.use(
|
41
|
+
return editor.use(defineUpdateHandler(forceUpdate));
|
42
42
|
}
|
43
43
|
}, [editor, update, forceUpdate]);
|
44
44
|
return () => {
|
@@ -52,20 +52,19 @@ function useForceUpdate() {
|
|
52
52
|
|
53
53
|
// src/hooks/use-extension.ts
|
54
54
|
import "@prosekit/core";
|
55
|
-
import {
|
56
|
-
function useExtension(
|
55
|
+
import { createEffect as createEffect2, onCleanup } from "solid-js";
|
56
|
+
function useExtension(extension) {
|
57
57
|
const editor = useEditor();
|
58
|
-
|
59
|
-
|
60
|
-
onCleanup(cleanup);
|
58
|
+
createEffect2(() => {
|
59
|
+
onCleanup(editor().use(extension));
|
61
60
|
});
|
62
61
|
}
|
63
62
|
|
64
63
|
// src/hooks/use-keymap.ts
|
65
64
|
import { defineKeymap } from "@prosekit/core";
|
66
|
-
function useKeymap(
|
65
|
+
function useKeymap(keymap) {
|
67
66
|
const extension = defineKeymap(keymap);
|
68
|
-
useExtension(
|
67
|
+
useExtension(extension);
|
69
68
|
}
|
70
69
|
export {
|
71
70
|
ProseKit,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/solid",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.22",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -50,11 +50,6 @@
|
|
50
50
|
"import": "./dist/prosekit-solid-autocomplete-popover.js",
|
51
51
|
"default": "./dist/prosekit-solid-autocomplete-popover.js"
|
52
52
|
},
|
53
|
-
"./code-block-popover": {
|
54
|
-
"types": "./dist/prosekit-solid-code-block-popover.d.ts",
|
55
|
-
"import": "./dist/prosekit-solid-code-block-popover.js",
|
56
|
-
"default": "./dist/prosekit-solid-code-block-popover.js"
|
57
|
-
},
|
58
53
|
"./combo-box": {
|
59
54
|
"types": "./dist/prosekit-solid-combo-box.d.ts",
|
60
55
|
"import": "./dist/prosekit-solid-combo-box.js",
|
@@ -75,6 +70,11 @@
|
|
75
70
|
"import": "./dist/prosekit-solid-combo-box-list.js",
|
76
71
|
"default": "./dist/prosekit-solid-combo-box-list.js"
|
77
72
|
},
|
73
|
+
"./inline-popover": {
|
74
|
+
"types": "./dist/prosekit-solid-inline-popover.d.ts",
|
75
|
+
"import": "./dist/prosekit-solid-inline-popover.js",
|
76
|
+
"default": "./dist/prosekit-solid-inline-popover.js"
|
77
|
+
},
|
78
78
|
"./popover": {
|
79
79
|
"types": "./dist/prosekit-solid-popover.d.ts",
|
80
80
|
"import": "./dist/prosekit-solid-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
|
"solid-js": ">= 1.7.0"
|
@@ -125,9 +125,6 @@
|
|
125
125
|
"autocomplete-popover": [
|
126
126
|
"./dist/prosekit-solid-autocomplete-popover.d.ts"
|
127
127
|
],
|
128
|
-
"code-block-popover": [
|
129
|
-
"./dist/prosekit-solid-code-block-popover.d.ts"
|
130
|
-
],
|
131
128
|
"combo-box": [
|
132
129
|
"./dist/prosekit-solid-combo-box.d.ts"
|
133
130
|
],
|
@@ -140,6 +137,9 @@
|
|
140
137
|
"combo-box-list": [
|
141
138
|
"./dist/prosekit-solid-combo-box-list.d.ts"
|
142
139
|
],
|
140
|
+
"inline-popover": [
|
141
|
+
"./dist/prosekit-solid-inline-popover.d.ts"
|
142
|
+
],
|
143
143
|
"popover": [
|
144
144
|
"./dist/prosekit-solid-popover.d.ts"
|
145
145
|
]
|