@prosekit/vue 0.4.17 → 0.5.1
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/{create-component-wOxhYs6n.js → create-component-C3NIgDxm.js} +3 -3
- package/dist/create-component-C3NIgDxm.js.map +1 -0
- package/dist/{create-emits-QdHrV9Ip.d.ts → create-emits-QrQextXf.d.ts} +3 -2
- package/dist/create-emits-QrQextXf.d.ts.map +1 -0
- package/dist/editor-context-DKYvJpUt.js +2 -1
- package/dist/editor-context-DKYvJpUt.js.map +1 -0
- package/dist/prosekit-vue-autocomplete.d.ts +19 -18
- package/dist/prosekit-vue-autocomplete.d.ts.map +1 -0
- package/dist/prosekit-vue-autocomplete.js +3 -2
- package/dist/prosekit-vue-autocomplete.js.map +1 -0
- package/dist/prosekit-vue-block-handle.d.ts +15 -14
- package/dist/prosekit-vue-block-handle.d.ts.map +1 -0
- package/dist/prosekit-vue-block-handle.js +3 -2
- package/dist/prosekit-vue-block-handle.js.map +1 -0
- package/dist/prosekit-vue-drop-indicator.d.ts +18 -0
- package/dist/prosekit-vue-drop-indicator.d.ts.map +1 -0
- package/dist/prosekit-vue-drop-indicator.js +10 -0
- package/dist/prosekit-vue-drop-indicator.js.map +1 -0
- package/dist/prosekit-vue-inline-popover.d.ts +7 -6
- package/dist/prosekit-vue-inline-popover.d.ts.map +1 -0
- package/dist/prosekit-vue-inline-popover.js +3 -2
- package/dist/prosekit-vue-inline-popover.js.map +1 -0
- package/dist/prosekit-vue-popover.d.ts +15 -14
- package/dist/prosekit-vue-popover.d.ts.map +1 -0
- package/dist/prosekit-vue-popover.js +3 -2
- package/dist/prosekit-vue-popover.js.map +1 -0
- package/dist/prosekit-vue-resizable.d.ts +11 -10
- package/dist/prosekit-vue-resizable.d.ts.map +1 -0
- package/dist/prosekit-vue-resizable.js +3 -2
- package/dist/prosekit-vue-resizable.js.map +1 -0
- package/dist/prosekit-vue-table-handle.d.ts +39 -38
- package/dist/prosekit-vue-table-handle.d.ts.map +1 -0
- package/dist/prosekit-vue-table-handle.js +3 -2
- package/dist/prosekit-vue-table-handle.js.map +1 -0
- package/dist/prosekit-vue-tooltip.d.ts +15 -14
- package/dist/prosekit-vue-tooltip.d.ts.map +1 -0
- package/dist/prosekit-vue-tooltip.js +3 -2
- package/dist/prosekit-vue-tooltip.js.map +1 -0
- package/dist/prosekit-vue.d.ts +70 -64
- package/dist/prosekit-vue.d.ts.map +1 -0
- package/dist/prosekit-vue.js +2 -1
- package/dist/prosekit-vue.js.map +1 -0
- package/package.json +25 -16
- package/src/components/autocomplete/autocomplete-empty.gen.ts +33 -0
- package/src/components/autocomplete/autocomplete-item.gen.ts +33 -0
- package/src/components/autocomplete/autocomplete-list.gen.ts +33 -0
- package/src/components/autocomplete/autocomplete-popover.gen.ts +33 -0
- package/src/components/autocomplete/index.gen.ts +7 -0
- package/src/components/block-handle/block-handle-add.gen.ts +33 -0
- package/src/components/block-handle/block-handle-draggable.gen.ts +33 -0
- package/src/components/block-handle/block-handle-popover.gen.ts +33 -0
- package/src/components/block-handle/index.gen.ts +5 -0
- package/src/components/create-component.ts +93 -0
- package/src/components/create-emits.ts +8 -0
- package/src/components/drop-indicator/drop-indicator.gen.ts +33 -0
- package/src/components/drop-indicator/index.gen.ts +1 -0
- package/src/components/inline-popover/index.gen.ts +1 -0
- package/src/components/inline-popover/inline-popover.gen.ts +33 -0
- package/src/components/popover/index.gen.ts +5 -0
- package/src/components/popover/popover-content.gen.ts +33 -0
- package/src/components/popover/popover-root.gen.ts +33 -0
- package/src/components/popover/popover-trigger.gen.ts +33 -0
- package/src/components/prosekit.ts +36 -0
- package/src/components/resizable/index.gen.ts +3 -0
- package/src/components/resizable/resizable-handle.gen.ts +33 -0
- package/src/components/resizable/resizable-root.gen.ts +33 -0
- package/src/components/table-handle/index.gen.ts +17 -0
- package/src/components/table-handle/table-handle-column-root.gen.ts +33 -0
- package/src/components/table-handle/table-handle-column-trigger.gen.ts +33 -0
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +33 -0
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +33 -0
- package/src/components/table-handle/table-handle-popover-content.gen.ts +33 -0
- package/src/components/table-handle/table-handle-popover-item.gen.ts +33 -0
- package/src/components/table-handle/table-handle-root.gen.ts +33 -0
- package/src/components/table-handle/table-handle-row-root.gen.ts +33 -0
- package/src/components/table-handle/table-handle-row-trigger.gen.ts +33 -0
- package/src/components/tooltip/index.gen.ts +5 -0
- package/src/components/tooltip/tooltip-content.gen.ts +33 -0
- package/src/components/tooltip/tooltip-root.gen.ts +33 -0
- package/src/components/tooltip/tooltip-trigger.gen.ts +33 -0
- package/src/extensions/vue-mark-view.ts +98 -0
- package/src/extensions/vue-node-view.ts +98 -0
- package/src/hooks/use-doc-change.ts +20 -0
- package/src/hooks/use-editor-extension.ts +34 -0
- package/src/hooks/use-editor.ts +57 -0
- package/src/hooks/use-extension.spec.ts +90 -0
- package/src/hooks/use-extension.ts +41 -0
- package/src/hooks/use-keymap.ts +22 -0
- package/src/hooks/use-priority-extension.ts +24 -0
- package/src/hooks/use-state-update.ts +20 -0
- package/src/index.ts +24 -0
- package/src/injection/editor-context.ts +25 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
autocompleteEmptyProps,
|
|
3
|
+
autocompleteEmptyEvents,
|
|
4
|
+
type AutocompleteEmptyProps as Props,
|
|
5
|
+
type AutocompleteEmptyEvents as Events,
|
|
6
|
+
} from '@prosekit/web/autocomplete'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link AutocompleteEmpty} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface AutocompleteEmptyProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link AutocompleteEmpty} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface AutocompleteEmptyEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const AutocompleteEmpty: DefineSetupFnComponent<
|
|
23
|
+
AutocompleteEmptyProps & HTMLAttributes,
|
|
24
|
+
AutocompleteEmptyEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
AutocompleteEmptyProps,
|
|
27
|
+
AutocompleteEmptyEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-autocomplete-empty',
|
|
30
|
+
'AutocompleteEmpty',
|
|
31
|
+
Object.keys(autocompleteEmptyProps),
|
|
32
|
+
Object.keys(autocompleteEmptyEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
autocompleteItemProps,
|
|
3
|
+
autocompleteItemEvents,
|
|
4
|
+
type AutocompleteItemProps as Props,
|
|
5
|
+
type AutocompleteItemEvents as Events,
|
|
6
|
+
} from '@prosekit/web/autocomplete'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link AutocompleteItem} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface AutocompleteItemProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link AutocompleteItem} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface AutocompleteItemEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const AutocompleteItem: DefineSetupFnComponent<
|
|
23
|
+
AutocompleteItemProps & HTMLAttributes,
|
|
24
|
+
AutocompleteItemEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
AutocompleteItemProps,
|
|
27
|
+
AutocompleteItemEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-autocomplete-item',
|
|
30
|
+
'AutocompleteItem',
|
|
31
|
+
Object.keys(autocompleteItemProps),
|
|
32
|
+
Object.keys(autocompleteItemEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
autocompleteListProps,
|
|
3
|
+
autocompleteListEvents,
|
|
4
|
+
type AutocompleteListProps as Props,
|
|
5
|
+
type AutocompleteListEvents as Events,
|
|
6
|
+
} from '@prosekit/web/autocomplete'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link AutocompleteList} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface AutocompleteListProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link AutocompleteList} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface AutocompleteListEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const AutocompleteList: DefineSetupFnComponent<
|
|
23
|
+
AutocompleteListProps & HTMLAttributes,
|
|
24
|
+
AutocompleteListEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
AutocompleteListProps,
|
|
27
|
+
AutocompleteListEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-autocomplete-list',
|
|
30
|
+
'AutocompleteList',
|
|
31
|
+
Object.keys(autocompleteListProps),
|
|
32
|
+
Object.keys(autocompleteListEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
autocompletePopoverProps,
|
|
3
|
+
autocompletePopoverEvents,
|
|
4
|
+
type AutocompletePopoverProps as Props,
|
|
5
|
+
type AutocompletePopoverEvents as Events,
|
|
6
|
+
} from '@prosekit/web/autocomplete'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link AutocompletePopover} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface AutocompletePopoverProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link AutocompletePopover} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface AutocompletePopoverEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const AutocompletePopover: DefineSetupFnComponent<
|
|
23
|
+
AutocompletePopoverProps & HTMLAttributes,
|
|
24
|
+
AutocompletePopoverEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
AutocompletePopoverProps,
|
|
27
|
+
AutocompletePopoverEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-autocomplete-popover',
|
|
30
|
+
'AutocompletePopover',
|
|
31
|
+
Object.keys(autocompletePopoverProps),
|
|
32
|
+
Object.keys(autocompletePopoverEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AutocompleteEmpty, type AutocompleteEmptyProps, type AutocompleteEmptyEmits } from './autocomplete-empty.gen'
|
|
2
|
+
|
|
3
|
+
export { AutocompleteItem, type AutocompleteItemProps, type AutocompleteItemEmits } from './autocomplete-item.gen'
|
|
4
|
+
|
|
5
|
+
export { AutocompleteList, type AutocompleteListProps, type AutocompleteListEmits } from './autocomplete-list.gen'
|
|
6
|
+
|
|
7
|
+
export { AutocompletePopover, type AutocompletePopoverProps, type AutocompletePopoverEmits } from './autocomplete-popover.gen'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
blockHandleAddProps,
|
|
3
|
+
blockHandleAddEvents,
|
|
4
|
+
type BlockHandleAddProps as Props,
|
|
5
|
+
type BlockHandleAddEvents as Events,
|
|
6
|
+
} from '@prosekit/web/block-handle'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link BlockHandleAdd} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface BlockHandleAddProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link BlockHandleAdd} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface BlockHandleAddEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const BlockHandleAdd: DefineSetupFnComponent<
|
|
23
|
+
BlockHandleAddProps & HTMLAttributes,
|
|
24
|
+
BlockHandleAddEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
BlockHandleAddProps,
|
|
27
|
+
BlockHandleAddEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-block-handle-add',
|
|
30
|
+
'BlockHandleAdd',
|
|
31
|
+
Object.keys(blockHandleAddProps),
|
|
32
|
+
Object.keys(blockHandleAddEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
blockHandleDraggableProps,
|
|
3
|
+
blockHandleDraggableEvents,
|
|
4
|
+
type BlockHandleDraggableProps as Props,
|
|
5
|
+
type BlockHandleDraggableEvents as Events,
|
|
6
|
+
} from '@prosekit/web/block-handle'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link BlockHandleDraggable} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface BlockHandleDraggableProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link BlockHandleDraggable} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface BlockHandleDraggableEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const BlockHandleDraggable: DefineSetupFnComponent<
|
|
23
|
+
BlockHandleDraggableProps & HTMLAttributes,
|
|
24
|
+
BlockHandleDraggableEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
BlockHandleDraggableProps,
|
|
27
|
+
BlockHandleDraggableEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-block-handle-draggable',
|
|
30
|
+
'BlockHandleDraggable',
|
|
31
|
+
Object.keys(blockHandleDraggableProps),
|
|
32
|
+
Object.keys(blockHandleDraggableEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
blockHandlePopoverProps,
|
|
3
|
+
blockHandlePopoverEvents,
|
|
4
|
+
type BlockHandlePopoverProps as Props,
|
|
5
|
+
type BlockHandlePopoverEvents as Events,
|
|
6
|
+
} from '@prosekit/web/block-handle'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link BlockHandlePopover} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface BlockHandlePopoverProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link BlockHandlePopover} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface BlockHandlePopoverEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const BlockHandlePopover: DefineSetupFnComponent<
|
|
23
|
+
BlockHandlePopoverProps & HTMLAttributes,
|
|
24
|
+
BlockHandlePopoverEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
BlockHandlePopoverProps,
|
|
27
|
+
BlockHandlePopoverEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-block-handle-popover',
|
|
30
|
+
'BlockHandlePopover',
|
|
31
|
+
Object.keys(blockHandlePopoverProps),
|
|
32
|
+
Object.keys(blockHandlePopoverEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { BlockHandleAdd, type BlockHandleAddProps, type BlockHandleAddEmits } from './block-handle-add.gen'
|
|
2
|
+
|
|
3
|
+
export { BlockHandleDraggable, type BlockHandleDraggableProps, type BlockHandleDraggableEmits } from './block-handle-draggable.gen'
|
|
4
|
+
|
|
5
|
+
export { BlockHandlePopover, type BlockHandlePopoverProps, type BlockHandlePopoverEmits } from './block-handle-popover.gen'
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineComponent,
|
|
3
|
+
h,
|
|
4
|
+
onMounted,
|
|
5
|
+
ref,
|
|
6
|
+
watchEffect,
|
|
7
|
+
type DefineSetupFnComponent,
|
|
8
|
+
type EmitsOptions,
|
|
9
|
+
type HTMLAttributes,
|
|
10
|
+
} from 'vue'
|
|
11
|
+
|
|
12
|
+
import { useEditorContext } from '../injection/editor-context'
|
|
13
|
+
|
|
14
|
+
export function createComponent<
|
|
15
|
+
Props extends { [PropName in keyof Props]: unknown },
|
|
16
|
+
Emits extends EmitsOptions,
|
|
17
|
+
>(
|
|
18
|
+
tagName: string,
|
|
19
|
+
displayName: string,
|
|
20
|
+
propNames: string[],
|
|
21
|
+
eventNames: string[],
|
|
22
|
+
): DefineSetupFnComponent<Partial<Props> & HTMLAttributes, Emits> {
|
|
23
|
+
const hasEditor = propNames.includes('editor')
|
|
24
|
+
|
|
25
|
+
const Component = defineComponent<any, any>(
|
|
26
|
+
(props: Record<string, unknown>, { slots, emit }) => {
|
|
27
|
+
const editor = useEditorContext()
|
|
28
|
+
|
|
29
|
+
const mounted = ref(false)
|
|
30
|
+
|
|
31
|
+
onMounted(() => {
|
|
32
|
+
mounted.value = true
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const elementRef = ref<HTMLElement | null>(null)
|
|
36
|
+
|
|
37
|
+
watchEffect((onCleanup) => {
|
|
38
|
+
const element = elementRef.value
|
|
39
|
+
if (!element) return
|
|
40
|
+
|
|
41
|
+
const eventHandlers: Record<string, (event: Event) => void> = {}
|
|
42
|
+
for (const eventName of eventNames) {
|
|
43
|
+
const extractDetail = eventName.endsWith('Change')
|
|
44
|
+
eventHandlers[eventName] = (event: Event) => {
|
|
45
|
+
emit(
|
|
46
|
+
eventName,
|
|
47
|
+
extractDetail ? (event as CustomEvent).detail : event,
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
for (const [eventName, handler] of Object.entries(eventHandlers)) {
|
|
53
|
+
element.addEventListener(eventName, handler)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
onCleanup(() => {
|
|
57
|
+
for (const [eventName, handler] of Object.entries(eventHandlers)) {
|
|
58
|
+
element.removeEventListener(eventName, handler)
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
return () => {
|
|
64
|
+
const properties: Record<string, unknown> = {}
|
|
65
|
+
|
|
66
|
+
for (const [key, value] of Object.entries(props)) {
|
|
67
|
+
if (value !== undefined && !key.startsWith('.')) {
|
|
68
|
+
properties[propNames.includes(key) ? '.' + key : key] = value
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Try to add the editor prop if it's missing.
|
|
73
|
+
if (hasEditor && editor && !properties['editor']) {
|
|
74
|
+
properties.editor = editor
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Ensure web components work after SSR hydration.
|
|
78
|
+
properties.key = mounted.value ? 1 : 0
|
|
79
|
+
|
|
80
|
+
properties.ref = elementRef
|
|
81
|
+
|
|
82
|
+
return h(tagName, properties, slots.default?.())
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: displayName,
|
|
87
|
+
props: propNames,
|
|
88
|
+
emits: eventNames,
|
|
89
|
+
},
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return Component
|
|
93
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
dropIndicatorProps,
|
|
3
|
+
dropIndicatorEvents,
|
|
4
|
+
type DropIndicatorProps as Props,
|
|
5
|
+
type DropIndicatorEvents as Events,
|
|
6
|
+
} from '@prosekit/web/drop-indicator'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link DropIndicator} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface DropIndicatorProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link DropIndicator} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface DropIndicatorEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const DropIndicator: DefineSetupFnComponent<
|
|
23
|
+
DropIndicatorProps & HTMLAttributes,
|
|
24
|
+
DropIndicatorEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
DropIndicatorProps,
|
|
27
|
+
DropIndicatorEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-drop-indicator',
|
|
30
|
+
'DropIndicator',
|
|
31
|
+
Object.keys(dropIndicatorProps),
|
|
32
|
+
Object.keys(dropIndicatorEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DropIndicator, type DropIndicatorProps, type DropIndicatorEmits } from './drop-indicator.gen'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { InlinePopover, type InlinePopoverProps, type InlinePopoverEmits } from './inline-popover.gen'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
inlinePopoverProps,
|
|
3
|
+
inlinePopoverEvents,
|
|
4
|
+
type InlinePopoverProps as Props,
|
|
5
|
+
type InlinePopoverEvents as Events,
|
|
6
|
+
} from '@prosekit/web/inline-popover'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link InlinePopover} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface InlinePopoverProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link InlinePopover} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface InlinePopoverEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const InlinePopover: DefineSetupFnComponent<
|
|
23
|
+
InlinePopoverProps & HTMLAttributes,
|
|
24
|
+
InlinePopoverEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
InlinePopoverProps,
|
|
27
|
+
InlinePopoverEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-inline-popover',
|
|
30
|
+
'InlinePopover',
|
|
31
|
+
Object.keys(inlinePopoverProps),
|
|
32
|
+
Object.keys(inlinePopoverEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PopoverContent, type PopoverContentProps, type PopoverContentEmits } from './popover-content.gen'
|
|
2
|
+
|
|
3
|
+
export { PopoverRoot, type PopoverRootProps, type PopoverRootEmits } from './popover-root.gen'
|
|
4
|
+
|
|
5
|
+
export { PopoverTrigger, type PopoverTriggerProps, type PopoverTriggerEmits } from './popover-trigger.gen'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
popoverContentProps,
|
|
3
|
+
popoverContentEvents,
|
|
4
|
+
type PopoverContentProps as Props,
|
|
5
|
+
type PopoverContentEvents as Events,
|
|
6
|
+
} from '@prosekit/web/popover'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link PopoverContent} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface PopoverContentProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link PopoverContent} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface PopoverContentEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const PopoverContent: DefineSetupFnComponent<
|
|
23
|
+
PopoverContentProps & HTMLAttributes,
|
|
24
|
+
PopoverContentEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
PopoverContentProps,
|
|
27
|
+
PopoverContentEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-popover-content',
|
|
30
|
+
'PopoverContent',
|
|
31
|
+
Object.keys(popoverContentProps),
|
|
32
|
+
Object.keys(popoverContentEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
popoverRootProps,
|
|
3
|
+
popoverRootEvents,
|
|
4
|
+
type PopoverRootProps as Props,
|
|
5
|
+
type PopoverRootEvents as Events,
|
|
6
|
+
} from '@prosekit/web/popover'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link PopoverRoot} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface PopoverRootProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link PopoverRoot} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface PopoverRootEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const PopoverRoot: DefineSetupFnComponent<
|
|
23
|
+
PopoverRootProps & HTMLAttributes,
|
|
24
|
+
PopoverRootEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
PopoverRootProps,
|
|
27
|
+
PopoverRootEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-popover-root',
|
|
30
|
+
'PopoverRoot',
|
|
31
|
+
Object.keys(popoverRootProps),
|
|
32
|
+
Object.keys(popoverRootEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
popoverTriggerProps,
|
|
3
|
+
popoverTriggerEvents,
|
|
4
|
+
type PopoverTriggerProps as Props,
|
|
5
|
+
type PopoverTriggerEvents as Events,
|
|
6
|
+
} from '@prosekit/web/popover'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link PopoverTrigger} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface PopoverTriggerProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link PopoverTrigger} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface PopoverTriggerEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const PopoverTrigger: DefineSetupFnComponent<
|
|
23
|
+
PopoverTriggerProps & HTMLAttributes,
|
|
24
|
+
PopoverTriggerEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
PopoverTriggerProps,
|
|
27
|
+
PopoverTriggerEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-popover-trigger',
|
|
30
|
+
'PopoverTrigger',
|
|
31
|
+
Object.keys(popoverTriggerProps),
|
|
32
|
+
Object.keys(popoverTriggerEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Editor } from '@prosekit/core'
|
|
2
|
+
import { ProsemirrorAdapterProvider } from '@prosemirror-adapter/vue'
|
|
3
|
+
import {
|
|
4
|
+
defineComponent,
|
|
5
|
+
h,
|
|
6
|
+
type DefineSetupFnComponent,
|
|
7
|
+
type PropType,
|
|
8
|
+
} from 'vue'
|
|
9
|
+
|
|
10
|
+
import { VueMarkViewsConsumer } from '../extensions/vue-mark-view'
|
|
11
|
+
import { VueNodeViewsConsumer } from '../extensions/vue-node-view'
|
|
12
|
+
import { provideEditor } from '../injection/editor-context'
|
|
13
|
+
|
|
14
|
+
export interface ProseKitProps {
|
|
15
|
+
editor: Editor
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The root component for a ProseKit editor.
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export const ProseKit: DefineSetupFnComponent<ProseKitProps> = defineComponent<ProseKitProps>({
|
|
24
|
+
name: 'ProseKit',
|
|
25
|
+
props: { editor: { type: Object as PropType<Editor>, required: true } },
|
|
26
|
+
setup: (props, { slots }) => {
|
|
27
|
+
provideEditor(props.editor)
|
|
28
|
+
return () => {
|
|
29
|
+
return h(ProsemirrorAdapterProvider, null, () => [
|
|
30
|
+
h(VueNodeViewsConsumer),
|
|
31
|
+
h(VueMarkViewsConsumer),
|
|
32
|
+
slots.default?.(),
|
|
33
|
+
])
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resizableHandleProps,
|
|
3
|
+
resizableHandleEvents,
|
|
4
|
+
type ResizableHandleProps as Props,
|
|
5
|
+
type ResizableHandleEvents as Events,
|
|
6
|
+
} from '@prosekit/web/resizable'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link ResizableHandle} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface ResizableHandleProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link ResizableHandle} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface ResizableHandleEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const ResizableHandle: DefineSetupFnComponent<
|
|
23
|
+
ResizableHandleProps & HTMLAttributes,
|
|
24
|
+
ResizableHandleEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
ResizableHandleProps,
|
|
27
|
+
ResizableHandleEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-resizable-handle',
|
|
30
|
+
'ResizableHandle',
|
|
31
|
+
Object.keys(resizableHandleProps),
|
|
32
|
+
Object.keys(resizableHandleEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resizableRootProps,
|
|
3
|
+
resizableRootEvents,
|
|
4
|
+
type ResizableRootProps as Props,
|
|
5
|
+
type ResizableRootEvents as Events,
|
|
6
|
+
} from '@prosekit/web/resizable'
|
|
7
|
+
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
8
|
+
|
|
9
|
+
import { createComponent } from '../create-component'
|
|
10
|
+
import type { CreateEmits } from '../create-emits'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link ResizableRoot} component.
|
|
14
|
+
*/
|
|
15
|
+
export interface ResizableRootProps extends Partial<Props> {}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Emits for the {@link ResizableRoot} component.
|
|
19
|
+
*/
|
|
20
|
+
export interface ResizableRootEmits extends CreateEmits<Events> {}
|
|
21
|
+
|
|
22
|
+
export const ResizableRoot: DefineSetupFnComponent<
|
|
23
|
+
ResizableRootProps & HTMLAttributes,
|
|
24
|
+
ResizableRootEmits
|
|
25
|
+
> = createComponent<
|
|
26
|
+
ResizableRootProps,
|
|
27
|
+
ResizableRootEmits
|
|
28
|
+
>(
|
|
29
|
+
'prosekit-resizable-root',
|
|
30
|
+
'ResizableRoot',
|
|
31
|
+
Object.keys(resizableRootProps),
|
|
32
|
+
Object.keys(resizableRootEvents),
|
|
33
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { TableHandleColumnRoot, type TableHandleColumnRootProps, type TableHandleColumnRootEmits } from './table-handle-column-root.gen'
|
|
2
|
+
|
|
3
|
+
export { TableHandleColumnTrigger, type TableHandleColumnTriggerProps, type TableHandleColumnTriggerEmits } from './table-handle-column-trigger.gen'
|
|
4
|
+
|
|
5
|
+
export { TableHandleDragPreview, type TableHandleDragPreviewProps, type TableHandleDragPreviewEmits } from './table-handle-drag-preview.gen'
|
|
6
|
+
|
|
7
|
+
export { TableHandleDropIndicator, type TableHandleDropIndicatorProps, type TableHandleDropIndicatorEmits } from './table-handle-drop-indicator.gen'
|
|
8
|
+
|
|
9
|
+
export { TableHandlePopoverContent, type TableHandlePopoverContentProps, type TableHandlePopoverContentEmits } from './table-handle-popover-content.gen'
|
|
10
|
+
|
|
11
|
+
export { TableHandlePopoverItem, type TableHandlePopoverItemProps, type TableHandlePopoverItemEmits } from './table-handle-popover-item.gen'
|
|
12
|
+
|
|
13
|
+
export { TableHandleRoot, type TableHandleRootProps, type TableHandleRootEmits } from './table-handle-root.gen'
|
|
14
|
+
|
|
15
|
+
export { TableHandleRowRoot, type TableHandleRowRootProps, type TableHandleRowRootEmits } from './table-handle-row-root.gen'
|
|
16
|
+
|
|
17
|
+
export { TableHandleRowTrigger, type TableHandleRowTriggerProps, type TableHandleRowTriggerEmits } from './table-handle-row-trigger.gen'
|