@prosekit/solid 0.1.5 → 0.2.0
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.
@@ -15,8 +15,8 @@ import type { JSXElement } from 'solid-js';
|
|
15
15
|
import { Keymap } from '@prosekit/core';
|
16
16
|
import { Options } from 'tsup';
|
17
17
|
import { ParentProps } from 'solid-js';
|
18
|
-
import { PopoverOptions } from '@prosekit/lit/autocomplete-popover';
|
19
18
|
import type { PopoverProps as PopoverProps_2 } from '@prosekit/lit/popover';
|
19
|
+
import { PositioningOptions } from '@prosekit/lit/autocomplete-popover';
|
20
20
|
import { Priority } from '@prosekit/core';
|
21
21
|
import type { ResizableHandleProps as ResizableHandleProps_2 } from '@prosekit/lit/resizable-handle';
|
22
22
|
import type { ResizableProps as ResizableProps_2 } from '@prosekit/lit/resizable';
|
@@ -91,10 +91,10 @@ export declare type InlinePopoverProps = PropsWithChildren<PropsWithClass<Inline
|
|
91
91
|
|
92
92
|
export declare const Popover: Component<PopoverProps>;
|
93
93
|
|
94
|
-
export { PopoverOptions }
|
95
|
-
|
96
94
|
export declare type PopoverProps = PropsWithChildren<PropsWithClass<PopoverProps_2>>;
|
97
95
|
|
96
|
+
export { PositioningOptions }
|
97
|
+
|
98
98
|
/**
|
99
99
|
* @internal
|
100
100
|
*/
|
@@ -131,7 +131,18 @@ export declare type ResizableHandleProps = PropsWithChildren<PropsWithClass<Resi
|
|
131
131
|
|
132
132
|
export declare type ResizableProps = PropsWithChildren<PropsWithClass<ResizableProps_2>>;
|
133
133
|
|
134
|
+
/**
|
135
|
+
* Retrieves the editor instance from the nearest ProseKit component.
|
136
|
+
*
|
137
|
+
* @public
|
138
|
+
*/
|
134
139
|
declare function useEditor<E extends Extension = any>(options?: {
|
140
|
+
/**
|
141
|
+
* Whether to update the component when the editor is mounted or editor state
|
142
|
+
* is updated.
|
143
|
+
*
|
144
|
+
* @default false
|
145
|
+
*/
|
135
146
|
update?: boolean;
|
136
147
|
}): () => Editor<E>;
|
137
148
|
export { useEditor }
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export {
|
1
|
+
export { PositioningOptions } from './_tsup-dts-rollup';
|
2
2
|
export { AutocompletePopover_alias_1 as AutocompletePopover } from './_tsup-dts-rollup';
|
3
3
|
export { AutocompletePopoverProps_alias_1 as AutocompletePopoverProps } from './_tsup-dts-rollup';
|
package/dist/prosekit-solid.js
CHANGED
@@ -22,7 +22,9 @@ var ProseKit = (props) => {
|
|
22
22
|
// src/hooks/use-editor.ts
|
23
23
|
import {
|
24
24
|
ProseKitError,
|
25
|
-
defineUpdateHandler
|
25
|
+
defineUpdateHandler,
|
26
|
+
defineMountHandler,
|
27
|
+
union
|
26
28
|
} from "@prosekit/core";
|
27
29
|
import { createEffect, createSignal, useContext } from "solid-js";
|
28
30
|
function useEditor(options) {
|
@@ -38,7 +40,11 @@ function useEditor(options) {
|
|
38
40
|
const [depend, forceUpdate] = useForceUpdate();
|
39
41
|
createEffect(() => {
|
40
42
|
if (update) {
|
41
|
-
|
43
|
+
const extension = union([
|
44
|
+
defineMountHandler(forceUpdate),
|
45
|
+
defineUpdateHandler(forceUpdate)
|
46
|
+
]);
|
47
|
+
return editor.use(extension);
|
42
48
|
}
|
43
49
|
}, [editor, update, forceUpdate]);
|
44
50
|
return () => {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/solid",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.2.0",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -95,8 +95,8 @@
|
|
95
95
|
"dist"
|
96
96
|
],
|
97
97
|
"dependencies": {
|
98
|
-
"@prosekit/core": "^0.2.
|
99
|
-
"@prosekit/lit": "^0.
|
98
|
+
"@prosekit/core": "^0.2.5",
|
99
|
+
"@prosekit/lit": "^0.2.0"
|
100
100
|
},
|
101
101
|
"peerDependencies": {
|
102
102
|
"solid-js": ">= 1.7.0"
|
@@ -108,10 +108,10 @@
|
|
108
108
|
},
|
109
109
|
"devDependencies": {
|
110
110
|
"@prosekit/dev": "*",
|
111
|
-
"solid-js": "^1.8.
|
111
|
+
"solid-js": "^1.8.11",
|
112
112
|
"tsup": "^8.0.1",
|
113
113
|
"typescript": "^5.3.3",
|
114
|
-
"vitest": "^1.
|
114
|
+
"vitest": "^1.2.0"
|
115
115
|
},
|
116
116
|
"scripts": {
|
117
117
|
"build:tsup": "tsup",
|