@prosekit/vue 0.0.0-next-20230709090937 → 0.0.0-next-20231120040948
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 +159 -0
- package/dist/prosekit-vue-autocomplete-empty.d.ts +2 -0
- package/dist/prosekit-vue-autocomplete-empty.js +19 -0
- package/dist/prosekit-vue-autocomplete-item.d.ts +2 -0
- package/dist/prosekit-vue-autocomplete-item.js +19 -0
- package/dist/prosekit-vue-autocomplete-list.d.ts +2 -0
- package/dist/prosekit-vue-autocomplete-list.js +19 -0
- package/dist/prosekit-vue-autocomplete-popover.d.ts +3 -0
- package/dist/prosekit-vue-autocomplete-popover.js +19 -0
- package/dist/prosekit-vue-combo-box-input.d.ts +2 -0
- package/dist/prosekit-vue-combo-box-input.js +19 -0
- package/dist/prosekit-vue-combo-box-item.d.ts +2 -0
- package/dist/prosekit-vue-combo-box-item.js +19 -0
- package/dist/prosekit-vue-combo-box-list.d.ts +2 -0
- package/dist/prosekit-vue-combo-box-list.js +19 -0
- package/dist/prosekit-vue-combo-box.d.ts +2 -0
- package/dist/prosekit-vue-combo-box.js +19 -0
- package/dist/prosekit-vue-inline-popover.d.ts +3 -0
- package/dist/prosekit-vue-inline-popover.js +19 -0
- package/dist/prosekit-vue-popover.d.ts +2 -0
- package/dist/prosekit-vue-popover.js +19 -0
- package/dist/prosekit-vue.d.ts +4 -14
- package/dist/prosekit-vue.js +32 -10
- package/package.json +79 -31
- package/src/index.ts +0 -4
- package/dist/prosekit-vue-components-menu-item.d.ts +0 -9
- package/dist/prosekit-vue-components-menu-item.js +0 -14
- package/dist/prosekit-vue-components-menu.d.ts +0 -9
- package/dist/prosekit-vue-components-menu.js +0 -14
- package/dist/prosekit-vue-components-popover-suggestion.d.ts +0 -18
- package/dist/prosekit-vue-components-popover-suggestion.js +0 -42
- package/dist/prosekit-vue-components-popover.d.ts +0 -9
- package/dist/prosekit-vue-components-popover.js +0 -14
@@ -0,0 +1,159 @@
|
|
1
|
+
import { AutocompleteEmptyProps as AutocompleteEmptyProps_2 } from '@prosekit/lit/autocomplete-empty';
|
2
|
+
import { AutocompleteItemProps as AutocompleteItemProps_2 } from '@prosekit/lit/autocomplete-item';
|
3
|
+
import { AutocompleteListProps as AutocompleteListProps_2 } from '@prosekit/lit/autocomplete-list';
|
4
|
+
import { AutocompletePopoverProps as AutocompletePopoverProps_2 } from '@prosekit/lit/autocomplete-popover';
|
5
|
+
import { ComboBoxInputProps as ComboBoxInputProps_2 } from '@prosekit/lit/combo-box-input';
|
6
|
+
import { ComboBoxItemProps as ComboBoxItemProps_2 } from '@prosekit/lit/combo-box-item';
|
7
|
+
import { ComboBoxListProps as ComboBoxListProps_2 } from '@prosekit/lit/combo-box-list';
|
8
|
+
import { ComboBoxProps as ComboBoxProps_2 } from '@prosekit/lit/combo-box';
|
9
|
+
import { Editor } from '@prosekit/core';
|
10
|
+
import { Extension } from '@prosekit/core';
|
11
|
+
import { InlinePopoverProps as InlinePopoverProps_2 } from '@prosekit/lit/inline-popover';
|
12
|
+
import { Keymap } from '@prosekit/core';
|
13
|
+
import { Options } from 'tsup';
|
14
|
+
import { PopoverOptions } from '@prosekit/lit/autocomplete-popover';
|
15
|
+
import { PopoverOptions as PopoverOptions_alias_1 } from '@prosekit/lit/inline-popover';
|
16
|
+
import { PopoverProps as PopoverProps_2 } from '@prosekit/lit/popover';
|
17
|
+
import { Ref } from 'vue';
|
18
|
+
import { ShallowRef } from 'vue';
|
19
|
+
import { UserProjectConfigExport } from 'vitest/dist/config.js';
|
20
|
+
|
21
|
+
declare const AutocompleteEmpty: (props: {
|
22
|
+
class?: string | undefined;
|
23
|
+
} & AutocompleteEmptyProps_2 & {}) => any;
|
24
|
+
export { AutocompleteEmpty }
|
25
|
+
export { AutocompleteEmpty as AutocompleteEmpty_alias_1 }
|
26
|
+
|
27
|
+
declare type AutocompleteEmptyProps = {
|
28
|
+
class?: string;
|
29
|
+
} & AutocompleteEmptyProps_2;
|
30
|
+
export { AutocompleteEmptyProps }
|
31
|
+
export { AutocompleteEmptyProps as AutocompleteEmptyProps_alias_1 }
|
32
|
+
|
33
|
+
declare const AutocompleteItem: (props: {
|
34
|
+
class?: string | undefined;
|
35
|
+
} & AutocompleteItemProps_2 & {}) => any;
|
36
|
+
export { AutocompleteItem }
|
37
|
+
export { AutocompleteItem as AutocompleteItem_alias_1 }
|
38
|
+
|
39
|
+
declare type AutocompleteItemProps = {
|
40
|
+
class?: string;
|
41
|
+
} & AutocompleteItemProps_2;
|
42
|
+
export { AutocompleteItemProps }
|
43
|
+
export { AutocompleteItemProps as AutocompleteItemProps_alias_1 }
|
44
|
+
|
45
|
+
declare const AutocompleteList: (props: {
|
46
|
+
class?: string | undefined;
|
47
|
+
} & AutocompleteListProps_2 & {}) => any;
|
48
|
+
export { AutocompleteList }
|
49
|
+
export { AutocompleteList as AutocompleteList_alias_1 }
|
50
|
+
|
51
|
+
declare type AutocompleteListProps = {
|
52
|
+
class?: string;
|
53
|
+
} & AutocompleteListProps_2;
|
54
|
+
export { AutocompleteListProps }
|
55
|
+
export { AutocompleteListProps as AutocompleteListProps_alias_1 }
|
56
|
+
|
57
|
+
declare const AutocompletePopover: (props: {
|
58
|
+
class?: string | undefined;
|
59
|
+
} & AutocompletePopoverProps_2 & {}) => any;
|
60
|
+
export { AutocompletePopover }
|
61
|
+
export { AutocompletePopover as AutocompletePopover_alias_1 }
|
62
|
+
|
63
|
+
declare type AutocompletePopoverProps = {
|
64
|
+
class?: string;
|
65
|
+
} & AutocompletePopoverProps_2;
|
66
|
+
export { AutocompletePopoverProps }
|
67
|
+
export { AutocompletePopoverProps as AutocompletePopoverProps_alias_1 }
|
68
|
+
|
69
|
+
export declare const ComboBox: (props: {
|
70
|
+
class?: string | undefined;
|
71
|
+
} & ComboBoxProps_2 & {}) => any;
|
72
|
+
|
73
|
+
export declare const ComboBoxInput: (props: {
|
74
|
+
class?: string | undefined;
|
75
|
+
} & ComboBoxInputProps_2 & {}) => any;
|
76
|
+
|
77
|
+
export declare type ComboBoxInputProps = {
|
78
|
+
class?: string;
|
79
|
+
} & ComboBoxInputProps_2;
|
80
|
+
|
81
|
+
export declare const ComboBoxItem: (props: {
|
82
|
+
class?: string | undefined;
|
83
|
+
} & ComboBoxItemProps_2 & {}) => any;
|
84
|
+
|
85
|
+
export declare type ComboBoxItemProps = {
|
86
|
+
class?: string;
|
87
|
+
} & ComboBoxItemProps_2;
|
88
|
+
|
89
|
+
export declare const ComboBoxList: (props: {
|
90
|
+
class?: string | undefined;
|
91
|
+
} & ComboBoxListProps_2 & {}) => any;
|
92
|
+
|
93
|
+
export declare type ComboBoxListProps = {
|
94
|
+
class?: string;
|
95
|
+
} & ComboBoxListProps_2;
|
96
|
+
|
97
|
+
export declare type ComboBoxProps = {
|
98
|
+
class?: string;
|
99
|
+
} & ComboBoxProps_2;
|
100
|
+
|
101
|
+
export declare const default_alias: Options | Options[] | ((overrideOptions: Options) => Options | Options[] | Promise<Options | Options[]>);
|
102
|
+
|
103
|
+
export declare const default_alias_1: UserProjectConfigExport;
|
104
|
+
|
105
|
+
export declare function injectEditor(): Editor;
|
106
|
+
|
107
|
+
declare const InlinePopover: (props: {
|
108
|
+
class?: string | undefined;
|
109
|
+
} & InlinePopoverProps_2 & {}) => any;
|
110
|
+
export { InlinePopover }
|
111
|
+
export { InlinePopover as InlinePopover_alias_1 }
|
112
|
+
|
113
|
+
declare type InlinePopoverProps = {
|
114
|
+
class?: string;
|
115
|
+
} & InlinePopoverProps_2;
|
116
|
+
export { InlinePopoverProps }
|
117
|
+
export { InlinePopoverProps as InlinePopoverProps_alias_1 }
|
118
|
+
|
119
|
+
export declare const Popover: (props: {
|
120
|
+
class?: string | undefined;
|
121
|
+
} & PopoverProps_2 & {}) => any;
|
122
|
+
|
123
|
+
export { PopoverOptions }
|
124
|
+
|
125
|
+
export { PopoverOptions_alias_1 }
|
126
|
+
|
127
|
+
export declare type PopoverProps = {
|
128
|
+
class?: string;
|
129
|
+
} & PopoverProps_2;
|
130
|
+
|
131
|
+
declare const ProseKit: (props: ProseKitProps & {}) => any;
|
132
|
+
export { ProseKit }
|
133
|
+
export { ProseKit as ProseKit_alias_1 }
|
134
|
+
|
135
|
+
declare interface ProseKitProps {
|
136
|
+
editor: Editor;
|
137
|
+
}
|
138
|
+
export { ProseKitProps }
|
139
|
+
export { ProseKitProps as ProseKitProps_alias_1 }
|
140
|
+
|
141
|
+
export declare function provideEditor(editor: Editor): void;
|
142
|
+
|
143
|
+
/**
|
144
|
+
* Returns a shallow ref to the editor. If `update` is `true`, any editor update
|
145
|
+
* will trigger an effect.
|
146
|
+
*/
|
147
|
+
declare function useEditor<E extends Extension = any>(options?: {
|
148
|
+
update?: boolean;
|
149
|
+
}): ShallowRef<Editor<E>>;
|
150
|
+
export { useEditor }
|
151
|
+
export { useEditor as useEditor_alias_1 }
|
152
|
+
|
153
|
+
export declare function useExtension<T extends Extension = Extension>(extension: Ref<T>): void;
|
154
|
+
|
155
|
+
declare function useKeymap(keymap: Ref<Keymap>): void;
|
156
|
+
export { useKeymap }
|
157
|
+
export { useKeymap as useKeymap_alias_1 }
|
158
|
+
|
159
|
+
export { }
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/autocomplete-empty.gen.ts
|
2
|
+
import "@prosekit/lit/autocomplete-empty";
|
3
|
+
import { propNames } from "@prosekit/lit/autocomplete-empty";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var AutocompleteEmpty = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-autocomplete-empty", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
AutocompleteEmpty
|
19
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/autocomplete-item.gen.ts
|
2
|
+
import "@prosekit/lit/autocomplete-item";
|
3
|
+
import { propNames } from "@prosekit/lit/autocomplete-item";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var AutocompleteItem = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-autocomplete-item", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
AutocompleteItem
|
19
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/autocomplete-list.gen.ts
|
2
|
+
import "@prosekit/lit/autocomplete-list";
|
3
|
+
import { propNames } from "@prosekit/lit/autocomplete-list";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var AutocompleteList = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-autocomplete-list", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
AutocompleteList
|
19
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/autocomplete-popover.gen.ts
|
2
|
+
import "@prosekit/lit/autocomplete-popover";
|
3
|
+
import { propNames } from "@prosekit/lit/autocomplete-popover";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var AutocompletePopover = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-autocomplete-popover", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
AutocompletePopover
|
19
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/combo-box-input.gen.ts
|
2
|
+
import "@prosekit/lit/combo-box-input";
|
3
|
+
import { propNames } from "@prosekit/lit/combo-box-input";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var ComboBoxInput = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-combo-box-input", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
ComboBoxInput
|
19
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/combo-box-item.gen.ts
|
2
|
+
import "@prosekit/lit/combo-box-item";
|
3
|
+
import { propNames } from "@prosekit/lit/combo-box-item";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var ComboBoxItem = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-combo-box-item", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
ComboBoxItem
|
19
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/combo-box-list.gen.ts
|
2
|
+
import "@prosekit/lit/combo-box-list";
|
3
|
+
import { propNames } from "@prosekit/lit/combo-box-list";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var ComboBoxList = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-combo-box-list", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
ComboBoxList
|
19
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/combo-box.gen.ts
|
2
|
+
import "@prosekit/lit/combo-box";
|
3
|
+
import { propNames } from "@prosekit/lit/combo-box";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var ComboBox = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-combo-box", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
ComboBox
|
19
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/inline-popover.gen.ts
|
2
|
+
import "@prosekit/lit/inline-popover";
|
3
|
+
import { propNames } from "@prosekit/lit/inline-popover";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var InlinePopover = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-inline-popover", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
InlinePopover
|
19
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
// src/components/popover.gen.ts
|
2
|
+
import "@prosekit/lit/popover";
|
3
|
+
import { propNames } from "@prosekit/lit/popover";
|
4
|
+
import { defineComponent, h } from "vue";
|
5
|
+
var Popover = defineComponent(
|
6
|
+
(props, { slots }) => {
|
7
|
+
return () => {
|
8
|
+
var _a;
|
9
|
+
const webComponentProps = Object.fromEntries(
|
10
|
+
Object.entries(props).filter((entry) => entry[1] !== void 0).map(([key, value]) => [(key === "class" ? "" : ".") + key, value])
|
11
|
+
);
|
12
|
+
return h("prosekit-popover", webComponentProps, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
13
|
+
};
|
14
|
+
},
|
15
|
+
{ props: ["class", ...propNames] }
|
16
|
+
);
|
17
|
+
export {
|
18
|
+
Popover
|
19
|
+
};
|
package/dist/prosekit-vue.d.ts
CHANGED
@@ -1,14 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
}
|
6
|
-
declare const ProseKit: (props: ProseKitProps & {}) => any;
|
7
|
-
|
8
|
-
declare function useKeymap({ keymap }: {
|
9
|
-
keymap: Keymap;
|
10
|
-
}): void;
|
11
|
-
|
12
|
-
declare function useEditor<E extends Extension = any>(): Editor<E>;
|
13
|
-
|
14
|
-
export { ProseKit, ProseKitProps, useEditor, useKeymap };
|
1
|
+
export { ProseKit } from './_tsup-dts-rollup';
|
2
|
+
export { ProseKitProps } from './_tsup-dts-rollup';
|
3
|
+
export { useKeymap } from './_tsup-dts-rollup';
|
4
|
+
export { useEditor } from './_tsup-dts-rollup';
|
package/dist/prosekit-vue.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
// src/components/prosekit.ts
|
2
|
+
import "@prosekit/core";
|
2
3
|
import { defineComponent } from "vue";
|
3
4
|
|
4
5
|
// src/injection/editor-injection.ts
|
@@ -29,27 +30,48 @@ var ProseKit = defineComponent(
|
|
29
30
|
);
|
30
31
|
|
31
32
|
// src/hooks/use-keymap.ts
|
32
|
-
import {
|
33
|
-
import { computed } from "vue";
|
33
|
+
import { defineKeymap } from "@prosekit/core";
|
34
|
+
import { computed, unref as unref2 } from "vue";
|
34
35
|
|
35
36
|
// src/hooks/use-extension.ts
|
36
|
-
import
|
37
|
+
import "@prosekit/core";
|
38
|
+
import { unref, watchPostEffect } from "vue";
|
37
39
|
|
38
40
|
// src/hooks/use-editor.ts
|
39
|
-
|
40
|
-
|
41
|
+
import { defineUpdateHandler } from "@prosekit/core";
|
42
|
+
import {
|
43
|
+
onMounted,
|
44
|
+
onUnmounted,
|
45
|
+
shallowRef,
|
46
|
+
triggerRef
|
47
|
+
} from "vue";
|
48
|
+
function useEditor(options) {
|
49
|
+
var _a;
|
50
|
+
const update = (_a = options == null ? void 0 : options.update) != null ? _a : false;
|
51
|
+
const editor = injectEditor();
|
52
|
+
const editorRef = shallowRef(editor);
|
53
|
+
if (update) {
|
54
|
+
onMounted(() => {
|
55
|
+
const forceUpdate = () => triggerRef(editorRef);
|
56
|
+
const dispose = editor.use(defineUpdateHandler(forceUpdate));
|
57
|
+
onUnmounted(dispose);
|
58
|
+
});
|
59
|
+
}
|
60
|
+
return editorRef;
|
41
61
|
}
|
42
62
|
|
43
63
|
// src/hooks/use-extension.ts
|
44
|
-
function useExtension(
|
64
|
+
function useExtension(extension) {
|
45
65
|
const editor = useEditor();
|
46
|
-
|
66
|
+
watchPostEffect((onCleanup) => {
|
67
|
+
onCleanup(editor.value.use(unref(extension)));
|
68
|
+
});
|
47
69
|
}
|
48
70
|
|
49
71
|
// src/hooks/use-keymap.ts
|
50
|
-
function useKeymap(
|
51
|
-
const extension = computed(() =>
|
52
|
-
useExtension(
|
72
|
+
function useKeymap(keymap) {
|
73
|
+
const extension = computed(() => defineKeymap(unref2(keymap)));
|
74
|
+
useExtension(extension);
|
53
75
|
}
|
54
76
|
export {
|
55
77
|
ProseKit,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/vue",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.0-next-
|
4
|
+
"version": "0.0.0-next-20231120040948",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -30,33 +30,63 @@
|
|
30
30
|
"import": "./dist/prosekit-vue.js",
|
31
31
|
"default": "./dist/prosekit-vue.js"
|
32
32
|
},
|
33
|
-
"./
|
34
|
-
"types": "./dist/prosekit-vue-
|
35
|
-
"import": "./dist/prosekit-vue-
|
36
|
-
"default": "./dist/prosekit-vue-
|
33
|
+
"./autocomplete-empty": {
|
34
|
+
"types": "./dist/prosekit-vue-autocomplete-empty.d.ts",
|
35
|
+
"import": "./dist/prosekit-vue-autocomplete-empty.js",
|
36
|
+
"default": "./dist/prosekit-vue-autocomplete-empty.js"
|
37
37
|
},
|
38
|
-
"./
|
39
|
-
"types": "./dist/prosekit-vue-
|
40
|
-
"import": "./dist/prosekit-vue-
|
41
|
-
"default": "./dist/prosekit-vue-
|
38
|
+
"./autocomplete-item": {
|
39
|
+
"types": "./dist/prosekit-vue-autocomplete-item.d.ts",
|
40
|
+
"import": "./dist/prosekit-vue-autocomplete-item.js",
|
41
|
+
"default": "./dist/prosekit-vue-autocomplete-item.js"
|
42
42
|
},
|
43
|
-
"./
|
44
|
-
"types": "./dist/prosekit-vue-
|
45
|
-
"import": "./dist/prosekit-vue-
|
46
|
-
"default": "./dist/prosekit-vue-
|
43
|
+
"./autocomplete-list": {
|
44
|
+
"types": "./dist/prosekit-vue-autocomplete-list.d.ts",
|
45
|
+
"import": "./dist/prosekit-vue-autocomplete-list.js",
|
46
|
+
"default": "./dist/prosekit-vue-autocomplete-list.js"
|
47
47
|
},
|
48
|
-
"./
|
49
|
-
"types": "./dist/prosekit-vue-
|
50
|
-
"import": "./dist/prosekit-vue-
|
51
|
-
"default": "./dist/prosekit-vue-
|
48
|
+
"./autocomplete-popover": {
|
49
|
+
"types": "./dist/prosekit-vue-autocomplete-popover.d.ts",
|
50
|
+
"import": "./dist/prosekit-vue-autocomplete-popover.js",
|
51
|
+
"default": "./dist/prosekit-vue-autocomplete-popover.js"
|
52
|
+
},
|
53
|
+
"./combo-box": {
|
54
|
+
"types": "./dist/prosekit-vue-combo-box.d.ts",
|
55
|
+
"import": "./dist/prosekit-vue-combo-box.js",
|
56
|
+
"default": "./dist/prosekit-vue-combo-box.js"
|
57
|
+
},
|
58
|
+
"./combo-box-input": {
|
59
|
+
"types": "./dist/prosekit-vue-combo-box-input.d.ts",
|
60
|
+
"import": "./dist/prosekit-vue-combo-box-input.js",
|
61
|
+
"default": "./dist/prosekit-vue-combo-box-input.js"
|
62
|
+
},
|
63
|
+
"./combo-box-item": {
|
64
|
+
"types": "./dist/prosekit-vue-combo-box-item.d.ts",
|
65
|
+
"import": "./dist/prosekit-vue-combo-box-item.js",
|
66
|
+
"default": "./dist/prosekit-vue-combo-box-item.js"
|
67
|
+
},
|
68
|
+
"./combo-box-list": {
|
69
|
+
"types": "./dist/prosekit-vue-combo-box-list.d.ts",
|
70
|
+
"import": "./dist/prosekit-vue-combo-box-list.js",
|
71
|
+
"default": "./dist/prosekit-vue-combo-box-list.js"
|
72
|
+
},
|
73
|
+
"./inline-popover": {
|
74
|
+
"types": "./dist/prosekit-vue-inline-popover.d.ts",
|
75
|
+
"import": "./dist/prosekit-vue-inline-popover.js",
|
76
|
+
"default": "./dist/prosekit-vue-inline-popover.js"
|
77
|
+
},
|
78
|
+
"./popover": {
|
79
|
+
"types": "./dist/prosekit-vue-popover.d.ts",
|
80
|
+
"import": "./dist/prosekit-vue-popover.js",
|
81
|
+
"default": "./dist/prosekit-vue-popover.js"
|
52
82
|
}
|
53
83
|
},
|
54
84
|
"files": [
|
55
85
|
"dist"
|
56
86
|
],
|
57
87
|
"dependencies": {
|
58
|
-
"@prosekit/core": "0.0.0-next-
|
59
|
-
"@prosekit/lit": "0.0.0-next-
|
88
|
+
"@prosekit/core": "0.0.0-next-20231120040948",
|
89
|
+
"@prosekit/lit": "0.0.0-next-20231120040948"
|
60
90
|
},
|
61
91
|
"peerDependencies": {
|
62
92
|
"vue": ">= 3.0.0"
|
@@ -68,10 +98,10 @@
|
|
68
98
|
},
|
69
99
|
"devDependencies": {
|
70
100
|
"@prosekit/dev": "*",
|
71
|
-
"tsup": "^
|
72
|
-
"typescript": "^5.
|
73
|
-
"vitest": "^0.
|
74
|
-
"vue": "^3.3.
|
101
|
+
"tsup": "^8.0.0",
|
102
|
+
"typescript": "^5.2.2",
|
103
|
+
"vitest": "^0.34.6",
|
104
|
+
"vue": "^3.3.8"
|
75
105
|
},
|
76
106
|
"scripts": {
|
77
107
|
"build:tsup": "tsup",
|
@@ -83,17 +113,35 @@
|
|
83
113
|
".": [
|
84
114
|
"./dist/prosekit-vue.d.ts"
|
85
115
|
],
|
86
|
-
"
|
87
|
-
"./dist/prosekit-vue-
|
116
|
+
"autocomplete-empty": [
|
117
|
+
"./dist/prosekit-vue-autocomplete-empty.d.ts"
|
118
|
+
],
|
119
|
+
"autocomplete-item": [
|
120
|
+
"./dist/prosekit-vue-autocomplete-item.d.ts"
|
121
|
+
],
|
122
|
+
"autocomplete-list": [
|
123
|
+
"./dist/prosekit-vue-autocomplete-list.d.ts"
|
124
|
+
],
|
125
|
+
"autocomplete-popover": [
|
126
|
+
"./dist/prosekit-vue-autocomplete-popover.d.ts"
|
127
|
+
],
|
128
|
+
"combo-box": [
|
129
|
+
"./dist/prosekit-vue-combo-box.d.ts"
|
130
|
+
],
|
131
|
+
"combo-box-input": [
|
132
|
+
"./dist/prosekit-vue-combo-box-input.d.ts"
|
133
|
+
],
|
134
|
+
"combo-box-item": [
|
135
|
+
"./dist/prosekit-vue-combo-box-item.d.ts"
|
88
136
|
],
|
89
|
-
"
|
90
|
-
"./dist/prosekit-vue-
|
137
|
+
"combo-box-list": [
|
138
|
+
"./dist/prosekit-vue-combo-box-list.d.ts"
|
91
139
|
],
|
92
|
-
"
|
93
|
-
"./dist/prosekit-vue-
|
140
|
+
"inline-popover": [
|
141
|
+
"./dist/prosekit-vue-inline-popover.d.ts"
|
94
142
|
],
|
95
|
-
"
|
96
|
-
"./dist/prosekit-vue-
|
143
|
+
"popover": [
|
144
|
+
"./dist/prosekit-vue-popover.d.ts"
|
97
145
|
]
|
98
146
|
}
|
99
147
|
}
|
package/src/index.ts
CHANGED
@@ -1,14 +0,0 @@
|
|
1
|
-
// src/components/menu-item.gen.ts
|
2
|
-
import "@prosekit/lit/elements/menu-item";
|
3
|
-
import { defineComponent, h } from "vue";
|
4
|
-
var MenuItem = defineComponent(
|
5
|
-
(props, { slots }) => {
|
6
|
-
return () => {
|
7
|
-
var _a;
|
8
|
-
return h("prosekit-menu-item", props, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
9
|
-
};
|
10
|
-
}
|
11
|
-
);
|
12
|
-
export {
|
13
|
-
MenuItem
|
14
|
-
};
|
@@ -1,14 +0,0 @@
|
|
1
|
-
// src/components/menu.gen.ts
|
2
|
-
import "@prosekit/lit/elements/menu";
|
3
|
-
import { defineComponent, h } from "vue";
|
4
|
-
var Menu = defineComponent(
|
5
|
-
(props, { slots }) => {
|
6
|
-
return () => {
|
7
|
-
var _a;
|
8
|
-
return h("prosekit-menu", props, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
9
|
-
};
|
10
|
-
}
|
11
|
-
);
|
12
|
-
export {
|
13
|
-
Menu
|
14
|
-
};
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { Editor } from '@prosekit/core';
|
2
|
-
import { PredictionRule, PopoverSuggestionContext } from '@prosekit/lit/elements/popover-suggestion';
|
3
|
-
export { PopoverSuggestionContext, PredictionRule } from '@prosekit/lit/elements/popover-suggestion';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @module @prosekit/vue/components/popover-suggestion
|
7
|
-
*/
|
8
|
-
|
9
|
-
interface PopoverSuggestionProps {
|
10
|
-
editor: Editor;
|
11
|
-
rules: PredictionRule[];
|
12
|
-
}
|
13
|
-
interface PopoverSuggestionSlots {
|
14
|
-
default: PopoverSuggestionContext;
|
15
|
-
}
|
16
|
-
declare const PopoverSuggestion: (props: PopoverSuggestionProps & {}) => any;
|
17
|
-
|
18
|
-
export { PopoverSuggestion, PopoverSuggestionProps, PopoverSuggestionSlots };
|
@@ -1,42 +0,0 @@
|
|
1
|
-
// src/components/popover-suggestion.ts
|
2
|
-
import { defineComponent as defineComponent2, h as h2, ref } from "vue";
|
3
|
-
|
4
|
-
// src/components/popover-suggestion.gen.ts
|
5
|
-
import "@prosekit/lit/elements/popover-suggestion";
|
6
|
-
import { defineComponent, h } from "vue";
|
7
|
-
var PopoverSuggestion = defineComponent(
|
8
|
-
(props, { slots }) => {
|
9
|
-
return () => {
|
10
|
-
var _a;
|
11
|
-
return h("prosekit-popover-suggestion", props, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
12
|
-
};
|
13
|
-
}
|
14
|
-
);
|
15
|
-
|
16
|
-
// src/components/popover-suggestion.ts
|
17
|
-
var PopoverSuggestion2 = defineComponent2(
|
18
|
-
({ editor, rules }, { slots }) => {
|
19
|
-
const contextRef = ref(null);
|
20
|
-
const onContext = (context) => {
|
21
|
-
contextRef.value = context;
|
22
|
-
};
|
23
|
-
return () => {
|
24
|
-
const context = contextRef.value;
|
25
|
-
return h2(
|
26
|
-
PopoverSuggestion,
|
27
|
-
{
|
28
|
-
".editor": editor,
|
29
|
-
".rules": rules,
|
30
|
-
".onContext": onContext
|
31
|
-
},
|
32
|
-
() => {
|
33
|
-
var _a;
|
34
|
-
return (_a = slots.default) == null ? void 0 : _a.call(slots, context);
|
35
|
-
}
|
36
|
-
);
|
37
|
-
};
|
38
|
-
}
|
39
|
-
);
|
40
|
-
export {
|
41
|
-
PopoverSuggestion2 as PopoverSuggestion
|
42
|
-
};
|
@@ -1,14 +0,0 @@
|
|
1
|
-
// src/components/popover.gen.ts
|
2
|
-
import "@prosekit/lit/elements/popover";
|
3
|
-
import { defineComponent, h } from "vue";
|
4
|
-
var Popover = defineComponent(
|
5
|
-
(props, { slots }) => {
|
6
|
-
return () => {
|
7
|
-
var _a;
|
8
|
-
return h("prosekit-popover", props, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
9
|
-
};
|
10
|
-
}
|
11
|
-
);
|
12
|
-
export {
|
13
|
-
Popover
|
14
|
-
};
|