@prosekit/solid 0.1.0 → 0.1.2
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 +9 -1
- package/dist/chunk-RLHZTH3K.js +16 -0
- package/dist/prosekit-solid-autocomplete-empty.js +5 -1
- package/dist/prosekit-solid-autocomplete-item.js +5 -1
- package/dist/prosekit-solid-autocomplete-list.js +5 -1
- package/dist/prosekit-solid-autocomplete-popover.js +5 -1
- package/dist/prosekit-solid-combo-box-input.js +5 -1
- package/dist/prosekit-solid-combo-box-item.js +5 -1
- package/dist/prosekit-solid-combo-box-list.js +5 -1
- package/dist/prosekit-solid-combo-box.js +5 -1
- package/dist/prosekit-solid-inline-popover.js +5 -1
- package/dist/prosekit-solid-popover.js +5 -1
- package/dist/prosekit-solid.js +3 -1
- package/package.json +3 -3
- package/src/index.ts +4 -0
@@ -101,6 +101,8 @@ declare interface EditorContext {
|
|
101
101
|
|
102
102
|
export declare const editorContext: Context<EditorContext | null>;
|
103
103
|
|
104
|
+
export declare function forceProps<T extends Record<string, any>>(props: T): T;
|
105
|
+
|
104
106
|
export declare const InlinePopover: Component<InlinePopoverProps>;
|
105
107
|
|
106
108
|
export declare type InlinePopoverProps = {
|
@@ -135,7 +137,13 @@ export declare interface UseEditorOptions {
|
|
135
137
|
update?: boolean;
|
136
138
|
}
|
137
139
|
|
138
|
-
|
140
|
+
/**
|
141
|
+
* Add an extension to the editor.
|
142
|
+
*
|
143
|
+
* It accepts an optional extension. If the extension is changed, the previous
|
144
|
+
* extension will be removed and the new one (if not null) will be added.
|
145
|
+
*/
|
146
|
+
declare function useExtension<T extends Extension = Extension>(extension: T | null): void;
|
139
147
|
export { useExtension }
|
140
148
|
export { useExtension as useExtension_alias_1 }
|
141
149
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// src/utils/force-props.ts
|
2
|
+
function forceProps(props) {
|
3
|
+
return Object.fromEntries(
|
4
|
+
Object.entries(props).map(([key, value]) => {
|
5
|
+
if (key === "children" || key === "ref" || key.includes(":")) {
|
6
|
+
return [key, value];
|
7
|
+
} else {
|
8
|
+
return [`prop:${key}`, value];
|
9
|
+
}
|
10
|
+
})
|
11
|
+
);
|
12
|
+
}
|
13
|
+
|
14
|
+
export {
|
15
|
+
forceProps
|
16
|
+
};
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/autocomplete-empty.gen.ts
|
2
6
|
import "@prosekit/lit/autocomplete-empty";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var AutocompleteEmpty = (props) => {
|
5
|
-
return html`<prosekit-autocomplete-empty ...${props} />`;
|
9
|
+
return html`<prosekit-autocomplete-empty ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
AutocompleteEmpty
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/autocomplete-item.gen.ts
|
2
6
|
import "@prosekit/lit/autocomplete-item";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var AutocompleteItem = (props) => {
|
5
|
-
return html`<prosekit-autocomplete-item ...${props} />`;
|
9
|
+
return html`<prosekit-autocomplete-item ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
AutocompleteItem
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/autocomplete-list.gen.ts
|
2
6
|
import "@prosekit/lit/autocomplete-list";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var AutocompleteList = (props) => {
|
5
|
-
return html`<prosekit-autocomplete-list ...${props} />`;
|
9
|
+
return html`<prosekit-autocomplete-list ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
AutocompleteList
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/autocomplete-popover.gen.ts
|
2
6
|
import "@prosekit/lit/autocomplete-popover";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var AutocompletePopover = (props) => {
|
5
|
-
return html`<prosekit-autocomplete-popover ...${props} />`;
|
9
|
+
return html`<prosekit-autocomplete-popover ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
AutocompletePopover
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/combo-box-input.gen.ts
|
2
6
|
import "@prosekit/lit/combo-box-input";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var ComboBoxInput = (props) => {
|
5
|
-
return html`<prosekit-combo-box-input ...${props} />`;
|
9
|
+
return html`<prosekit-combo-box-input ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
ComboBoxInput
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/combo-box-item.gen.ts
|
2
6
|
import "@prosekit/lit/combo-box-item";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var ComboBoxItem = (props) => {
|
5
|
-
return html`<prosekit-combo-box-item ...${props} />`;
|
9
|
+
return html`<prosekit-combo-box-item ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
ComboBoxItem
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/combo-box-list.gen.ts
|
2
6
|
import "@prosekit/lit/combo-box-list";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var ComboBoxList = (props) => {
|
5
|
-
return html`<prosekit-combo-box-list ...${props} />`;
|
9
|
+
return html`<prosekit-combo-box-list ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
ComboBoxList
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/combo-box.gen.ts
|
2
6
|
import "@prosekit/lit/combo-box";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var ComboBox = (props) => {
|
5
|
-
return html`<prosekit-combo-box ...${props} />`;
|
9
|
+
return html`<prosekit-combo-box ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
ComboBox
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/inline-popover.gen.ts
|
2
6
|
import "@prosekit/lit/inline-popover";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var InlinePopover = (props) => {
|
5
|
-
return html`<prosekit-inline-popover ...${props} />`;
|
9
|
+
return html`<prosekit-inline-popover ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
InlinePopover
|
@@ -1,8 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
forceProps
|
3
|
+
} from "./chunk-RLHZTH3K.js";
|
4
|
+
|
1
5
|
// src/components/popover.gen.ts
|
2
6
|
import "@prosekit/lit/popover";
|
3
7
|
import html from "solid-js/html";
|
4
8
|
var Popover = (props) => {
|
5
|
-
return html`<prosekit-popover ...${props} />`;
|
9
|
+
return html`<prosekit-popover ...${forceProps(props)} />`;
|
6
10
|
};
|
7
11
|
export {
|
8
12
|
Popover
|
package/dist/prosekit-solid.js
CHANGED
@@ -56,7 +56,9 @@ import { createEffect as createEffect2, onCleanup } from "solid-js";
|
|
56
56
|
function useExtension(extension) {
|
57
57
|
const editor = useEditor();
|
58
58
|
createEffect2(() => {
|
59
|
-
|
59
|
+
if (extension) {
|
60
|
+
onCleanup(editor().use(extension));
|
61
|
+
}
|
60
62
|
});
|
61
63
|
}
|
62
64
|
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/solid",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.1.
|
4
|
+
"version": "0.1.2",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -99,8 +99,8 @@
|
|
99
99
|
"devDependencies": {
|
100
100
|
"@prosekit/dev": "*",
|
101
101
|
"solid-js": "^1.8.5",
|
102
|
-
"tsup": "^
|
103
|
-
"typescript": "^5.
|
102
|
+
"tsup": "^8.0.1",
|
103
|
+
"typescript": "^5.3.2",
|
104
104
|
"vitest": "^0.34.6"
|
105
105
|
},
|
106
106
|
"scripts": {
|
package/src/index.ts
ADDED