@prosekit/vue 0.7.0-beta.0 → 0.7.0-beta.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/prosekit-vue-autocomplete.d.ts +216 -25
- package/dist/prosekit-vue-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-vue-autocomplete.js +270 -9
- package/dist/prosekit-vue-autocomplete.js.map +1 -1
- package/dist/prosekit-vue-block-handle.d.ts +202 -19
- package/dist/prosekit-vue-block-handle.d.ts.map +1 -1
- package/dist/prosekit-vue-block-handle.js +211 -7
- package/dist/prosekit-vue-block-handle.js.map +1 -1
- package/dist/prosekit-vue-drop-indicator.d.ts +24 -8
- package/dist/prosekit-vue-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-vue-drop-indicator.js +36 -3
- package/dist/prosekit-vue-drop-indicator.js.map +1 -1
- package/dist/prosekit-vue-inline-popover.d.ts +200 -9
- package/dist/prosekit-vue-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-vue-inline-popover.js +171 -5
- package/dist/prosekit-vue-inline-popover.js.map +1 -1
- package/dist/prosekit-vue-menu.d.ts +287 -0
- package/dist/prosekit-vue-menu.d.ts.map +1 -0
- package/dist/prosekit-vue-menu.js +313 -0
- package/dist/prosekit-vue-menu.js.map +1 -0
- package/dist/prosekit-vue-popover.d.ts +219 -19
- package/dist/prosekit-vue-popover.d.ts.map +1 -1
- package/dist/prosekit-vue-popover.js +222 -7
- package/dist/prosekit-vue-popover.js.map +1 -1
- package/dist/prosekit-vue-resizable.d.ts +50 -15
- package/dist/prosekit-vue-resizable.d.ts.map +1 -1
- package/dist/prosekit-vue-resizable.js +92 -7
- package/dist/prosekit-vue-resizable.js.map +1 -1
- package/dist/prosekit-vue-table-handle.d.ts +427 -55
- package/dist/prosekit-vue-table-handle.d.ts.map +1 -1
- package/dist/prosekit-vue-table-handle.js +455 -19
- package/dist/prosekit-vue-table-handle.js.map +1 -1
- package/dist/prosekit-vue-tooltip.d.ts +203 -19
- package/dist/prosekit-vue-tooltip.d.ts.map +1 -1
- package/dist/prosekit-vue-tooltip.js +202 -7
- package/dist/prosekit-vue-tooltip.js.map +1 -1
- package/package.json +27 -17
- package/src/components/autocomplete/autocomplete-empty.gen.ts +21 -25
- package/src/components/autocomplete/autocomplete-item.gen.ts +80 -26
- package/src/components/autocomplete/autocomplete-popup.gen.ts +80 -0
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +149 -0
- package/src/components/autocomplete/autocomplete-root.gen.ts +112 -0
- package/src/components/autocomplete/index.gen.ts +12 -4
- package/src/components/autocomplete/index.ts +27 -0
- package/src/components/block-handle/block-handle-add.gen.ts +51 -26
- package/src/components/block-handle/block-handle-draggable.gen.ts +51 -26
- package/src/components/block-handle/block-handle-popup.gen.ts +29 -0
- package/src/components/block-handle/block-handle-positioner.gen.ts +167 -0
- package/src/components/block-handle/block-handle-root.gen.ts +84 -0
- package/src/components/block-handle/index.gen.ts +13 -3
- package/src/components/block-handle/index.ts +27 -0
- package/src/components/drop-indicator/drop-indicator.gen.ts +57 -26
- package/src/components/drop-indicator/index.gen.ts +5 -1
- package/src/components/drop-indicator/index.ts +14 -0
- package/src/components/inline-popover/index.gen.ts +11 -1
- package/src/components/inline-popover/index.ts +22 -0
- package/src/components/inline-popover/inline-popover-popup.gen.ts +29 -0
- package/src/components/inline-popover/inline-popover-positioner.gen.ts +173 -0
- package/src/components/inline-popover/inline-popover-root.gen.ts +108 -0
- package/src/components/menu/index.gen.ts +19 -0
- package/src/components/menu/index.ts +37 -0
- package/src/components/menu/menu-item.gen.ts +91 -0
- package/src/components/menu/menu-popup.gen.ts +54 -0
- package/src/components/menu/menu-positioner.gen.ts +174 -0
- package/src/components/menu/menu-root.gen.ts +88 -0
- package/src/components/menu/menu-submenu-root.gen.ts +29 -0
- package/src/components/menu/menu-submenu-trigger.gen.ts +29 -0
- package/src/components/menu/menu-trigger.gen.ts +79 -0
- package/src/components/popover/index.gen.ts +11 -3
- package/src/components/popover/index.ts +24 -0
- package/src/components/popover/popover-popup.gen.ts +29 -0
- package/src/components/popover/popover-positioner.gen.ts +174 -0
- package/src/components/popover/popover-root.gen.ts +88 -26
- package/src/components/popover/popover-trigger.gen.ts +88 -26
- package/src/components/resizable/index.gen.ts +8 -2
- package/src/components/resizable/index.ts +20 -0
- package/src/components/resizable/resizable-handle.gen.ts +46 -26
- package/src/components/resizable/resizable-root.gen.ts +87 -26
- package/src/components/table-handle/index.gen.ts +17 -9
- package/src/components/table-handle/index.ts +58 -0
- package/src/components/table-handle/table-handle-column-menu-root.gen.ts +62 -0
- package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +56 -0
- package/src/components/table-handle/table-handle-column-popup.gen.ts +29 -0
- package/src/components/table-handle/table-handle-column-positioner.gen.ts +197 -0
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +49 -26
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +49 -26
- package/src/components/table-handle/table-handle-root.gen.ts +51 -26
- package/src/components/table-handle/table-handle-row-menu-root.gen.ts +62 -0
- package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +56 -0
- package/src/components/table-handle/table-handle-row-popup.gen.ts +29 -0
- package/src/components/table-handle/table-handle-row-positioner.gen.ts +197 -0
- package/src/components/tooltip/index.gen.ts +11 -3
- package/src/components/tooltip/index.ts +24 -0
- package/src/components/tooltip/tooltip-popup.gen.ts +29 -0
- package/src/components/tooltip/tooltip-positioner.gen.ts +174 -0
- package/src/components/tooltip/tooltip-root.gen.ts +81 -26
- package/src/components/tooltip/tooltip-trigger.gen.ts +55 -26
- package/src/extensions/vue-node-view.spec.ts +156 -0
- package/dist/create-component.js +0 -45
- package/dist/create-component.js.map +0 -1
- package/dist/create-emits.d.ts +0 -5
- package/dist/create-emits.d.ts.map +0 -1
- package/src/components/autocomplete/autocomplete-list.gen.ts +0 -33
- package/src/components/autocomplete/autocomplete-popover.gen.ts +0 -33
- package/src/components/block-handle/block-handle-popover.gen.ts +0 -33
- package/src/components/create-component.ts +0 -84
- package/src/components/create-emits.ts +0 -8
- package/src/components/inline-popover/inline-popover.gen.ts +0 -33
- package/src/components/popover/popover-content.gen.ts +0 -33
- package/src/components/table-handle/table-handle-column-root.gen.ts +0 -33
- package/src/components/table-handle/table-handle-column-trigger.gen.ts +0 -33
- package/src/components/table-handle/table-handle-popover-content.gen.ts +0 -33
- package/src/components/table-handle/table-handle-popover-item.gen.ts +0 -33
- package/src/components/table-handle/table-handle-row-root.gen.ts +0 -33
- package/src/components/table-handle/table-handle-row-trigger.gen.ts +0 -33
- package/src/components/tooltip/tooltip-content.gen.ts +0 -33
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { registerMenuTriggerElement, type MenuTriggerEvents, type MenuTriggerProps as MenuTriggerElementProps } from '@prosekit/web/menu';
|
|
6
|
+
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for the {@link MenuTrigger} Vue component.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface MenuTriggerProps {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the component should ignore user interaction.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
disabled?: MenuTriggerElementProps['disabled'];
|
|
20
|
+
/** Emitted when the menu is opened or closed. */
|
|
21
|
+
onOpenChange?: (event: MenuTriggerEvents['openChange']) => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A Vue component that renders an `prosekit-menu-trigger` custom element.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export const MenuTrigger: DefineSetupFnComponent<MenuTriggerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<MenuTriggerProps & HTMLAttributes>(
|
|
30
|
+
(props, { slots }) => {
|
|
31
|
+
registerMenuTriggerElement();
|
|
32
|
+
|
|
33
|
+
const elementRef = shallowRef<HTMLElement | null>(null);
|
|
34
|
+
|
|
35
|
+
const splittedProps = computed(() => {
|
|
36
|
+
const { disabled: p0, onOpenChange: e0, ...restProps } = props;
|
|
37
|
+
return [[p0, e0], restProps] as const;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const handlers: Array<((event: any) => void) | undefined> = [];
|
|
41
|
+
|
|
42
|
+
watchEffect(() => {
|
|
43
|
+
const element = elementRef.value;
|
|
44
|
+
if (!element) return;
|
|
45
|
+
|
|
46
|
+
const [p0, e0] = splittedProps.value[0];
|
|
47
|
+
|
|
48
|
+
Object.assign(element, { disabled: p0 });
|
|
49
|
+
|
|
50
|
+
handlers.length = 0;
|
|
51
|
+
handlers.push(e0);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
watchEffect(() => {
|
|
55
|
+
const element = elementRef.value;
|
|
56
|
+
if (!element) return;
|
|
57
|
+
|
|
58
|
+
const ac = new AbortController();
|
|
59
|
+
for (const [index, eventName] of ['openChange'].entries()) {
|
|
60
|
+
element.addEventListener(
|
|
61
|
+
eventName,
|
|
62
|
+
(event: Event) => {
|
|
63
|
+
handlers[index]?.(event);
|
|
64
|
+
},
|
|
65
|
+
{ signal: ac.signal },
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return () => ac.abort();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return () => {
|
|
72
|
+
const restProps = splittedProps.value[1];
|
|
73
|
+
return h('prosekit-menu-trigger', { ...restProps, ref: elementRef }, slots.default?.());
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
{ props: ['disabled', 'onOpenChange'] },
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
export type { MenuTriggerEvents };
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
2
4
|
|
|
3
|
-
export {
|
|
5
|
+
export { PopoverPopup, type PopoverPopupProps } from './popover-popup.gen.ts';
|
|
4
6
|
|
|
5
|
-
export {
|
|
7
|
+
export { PopoverPositioner, type PopoverPositionerProps } from './popover-positioner.gen.ts';
|
|
8
|
+
|
|
9
|
+
export { PopoverRoot, type PopoverRootProps, type PopoverRootEvents } from './popover-root.gen.ts';
|
|
10
|
+
|
|
11
|
+
export { PopoverTrigger, type PopoverTriggerProps, type PopoverTriggerEvents } from './popover-trigger.gen.ts';
|
|
12
|
+
|
|
13
|
+
export { OpenChangeEvent } from '@prosekit/web/popover';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
|
|
3
|
+
@module
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import {
|
|
9
|
+
PopoverPopup,
|
|
10
|
+
PopoverPositioner,
|
|
11
|
+
PopoverRoot,
|
|
12
|
+
PopoverTrigger,
|
|
13
|
+
} from 'prosekit/vue/popover'
|
|
14
|
+
|
|
15
|
+
<PopoverRoot>
|
|
16
|
+
<PopoverTrigger>...</PopoverTrigger>
|
|
17
|
+
<PopoverPositioner>
|
|
18
|
+
<PopoverPopup>...</PopoverPopup>
|
|
19
|
+
</PopoverPositioner>
|
|
20
|
+
</PopoverRoot>
|
|
21
|
+
```
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
export * from './index.gen.ts'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { registerPopoverPopupElement } from '@prosekit/web/popover';
|
|
6
|
+
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes } from 'vue';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for the {@link PopoverPopup} Vue component.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface PopoverPopupProps {}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A Vue component that renders an `prosekit-popover-popup` custom element.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export const PopoverPopup: DefineSetupFnComponent<PopoverPopupProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<PopoverPopupProps & HTMLAttributes>(
|
|
21
|
+
(props, { slots }) => {
|
|
22
|
+
registerPopoverPopupElement();
|
|
23
|
+
|
|
24
|
+
return () => {
|
|
25
|
+
return h('prosekit-popover-popup', props, slots.default?.());
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
{ props: [] },
|
|
29
|
+
);
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { registerPopoverPositionerElement, type PopoverPositionerProps as PopoverPositionerElementProps } from '@prosekit/web/popover';
|
|
6
|
+
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for the {@link PopoverPositioner} Vue component.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface PopoverPositionerProps {
|
|
14
|
+
/**
|
|
15
|
+
* The strategy to use for positioning
|
|
16
|
+
*
|
|
17
|
+
* @default "absolute"
|
|
18
|
+
*/
|
|
19
|
+
strategy?: PopoverPositionerElementProps['strategy'];
|
|
20
|
+
/**
|
|
21
|
+
* The initial placement of the floating element
|
|
22
|
+
*
|
|
23
|
+
* @default "top"
|
|
24
|
+
*/
|
|
25
|
+
placement?: PopoverPositionerElementProps['placement'];
|
|
26
|
+
/**
|
|
27
|
+
* Options to activate auto-update listeners
|
|
28
|
+
*
|
|
29
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
30
|
+
*
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
autoUpdate?: PopoverPositionerElementProps['autoUpdate'];
|
|
34
|
+
/**
|
|
35
|
+
* Whether to use the browser Popover API to place the floating element on
|
|
36
|
+
* top of other page content.
|
|
37
|
+
*
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
hoist?: PopoverPositionerElementProps['hoist'];
|
|
41
|
+
/**
|
|
42
|
+
* The distance between the reference and floating element.
|
|
43
|
+
*
|
|
44
|
+
* @default 6
|
|
45
|
+
*/
|
|
46
|
+
offset?: PopoverPositionerElementProps['offset'];
|
|
47
|
+
/**
|
|
48
|
+
* Whether to flip the `placement` in order to keep it in view when the
|
|
49
|
+
* preferred placement(s) will overflow the clipping boundary. You can also
|
|
50
|
+
* provide an array of placements to try sequentially if the preferred
|
|
51
|
+
* `placement` does not fit.
|
|
52
|
+
*
|
|
53
|
+
* @default true
|
|
54
|
+
*/
|
|
55
|
+
flip?: PopoverPositionerElementProps['flip'];
|
|
56
|
+
/**
|
|
57
|
+
* Whether the floating element should shift to keep it in view.
|
|
58
|
+
*
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
shift?: PopoverPositionerElementProps['shift'];
|
|
62
|
+
/**
|
|
63
|
+
* Whether the floating element can overlap the reference element to keep it
|
|
64
|
+
* in view.
|
|
65
|
+
*
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
overlap?: PopoverPositionerElementProps['overlap'];
|
|
69
|
+
/**
|
|
70
|
+
* Whether to constrain the floating element's width and height to not exceed
|
|
71
|
+
* the viewport.
|
|
72
|
+
*
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
fitViewport?: PopoverPositionerElementProps['fitViewport'];
|
|
76
|
+
/**
|
|
77
|
+
* Whether to constrain the floating element's width so that it matches the
|
|
78
|
+
* reference element.
|
|
79
|
+
*
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
sameWidth?: PopoverPositionerElementProps['sameWidth'];
|
|
83
|
+
/**
|
|
84
|
+
* Whether to constrain the floating element's height so that it matches the
|
|
85
|
+
* reference element.
|
|
86
|
+
*
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
sameHeight?: PopoverPositionerElementProps['sameHeight'];
|
|
90
|
+
/**
|
|
91
|
+
* Whether to improve positioning for inline reference elements that span over
|
|
92
|
+
* multiple lines.
|
|
93
|
+
*
|
|
94
|
+
* @default false
|
|
95
|
+
*/
|
|
96
|
+
inline?: PopoverPositionerElementProps['inline'];
|
|
97
|
+
/**
|
|
98
|
+
* Whether to hide the floating element when the reference element or the
|
|
99
|
+
* floating element is fully clipped.
|
|
100
|
+
*
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
hide?: PopoverPositionerElementProps['hide'];
|
|
104
|
+
/**
|
|
105
|
+
* Describes the clipping element(s) or area that overflow will be checked relative to.
|
|
106
|
+
* Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
|
|
107
|
+
*
|
|
108
|
+
* @default 'clippingAncestors'
|
|
109
|
+
*/
|
|
110
|
+
boundary?: PopoverPositionerElementProps['boundary'];
|
|
111
|
+
/**
|
|
112
|
+
* Describes the root boundary that the element will be checked for overflow relative to.
|
|
113
|
+
* Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
|
|
114
|
+
*
|
|
115
|
+
* @default 'viewport'
|
|
116
|
+
*/
|
|
117
|
+
rootBoundary?: PopoverPositionerElementProps['rootBoundary'];
|
|
118
|
+
/**
|
|
119
|
+
* Describes the virtual padding around the boundary to check for overflow.
|
|
120
|
+
* Please see https://floating-ui.com/docs/detectoverflow#padding for more information.
|
|
121
|
+
*
|
|
122
|
+
* @default 4
|
|
123
|
+
*/
|
|
124
|
+
overflowPadding?: PopoverPositionerElementProps['overflowPadding'];
|
|
125
|
+
/**
|
|
126
|
+
* The element that will be used to check for overflow. Please see
|
|
127
|
+
* https://floating-ui.com/docs/detectoverflow#elementcontext for more
|
|
128
|
+
* information.
|
|
129
|
+
*
|
|
130
|
+
* @default 'floating'
|
|
131
|
+
*/
|
|
132
|
+
elementContext?: PopoverPositionerElementProps['elementContext'];
|
|
133
|
+
/**
|
|
134
|
+
* Whether to check the alternate elementContext's boundary. Please see
|
|
135
|
+
* https://floating-ui.com/docs/detectoverflow#altboundary for more
|
|
136
|
+
* information.
|
|
137
|
+
*
|
|
138
|
+
* @default false
|
|
139
|
+
*/
|
|
140
|
+
altBoundary?: PopoverPositionerElementProps['altBoundary'];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* A Vue component that renders an `prosekit-popover-positioner` custom element.
|
|
145
|
+
*
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
export const PopoverPositioner: DefineSetupFnComponent<PopoverPositionerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<PopoverPositionerProps & HTMLAttributes>(
|
|
149
|
+
(props, { slots }) => {
|
|
150
|
+
registerPopoverPositionerElement();
|
|
151
|
+
|
|
152
|
+
const elementRef = shallowRef<HTMLElement | null>(null);
|
|
153
|
+
|
|
154
|
+
const splittedProps = computed(() => {
|
|
155
|
+
const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;
|
|
156
|
+
return [[p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17], restProps] as const;
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
watchEffect(() => {
|
|
160
|
+
const element = elementRef.value;
|
|
161
|
+
if (!element) return;
|
|
162
|
+
|
|
163
|
+
const [p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17] = splittedProps.value[0];
|
|
164
|
+
|
|
165
|
+
Object.assign(element, { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17 });
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
return () => {
|
|
169
|
+
const restProps = splittedProps.value[1];
|
|
170
|
+
return h('prosekit-popover-positioner', { ...restProps, ref: elementRef }, slots.default?.());
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
{ props: ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy'] },
|
|
174
|
+
);
|
|
@@ -1,33 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type PopoverRootProps as Props,
|
|
5
|
-
type PopoverRootEvents as Events,
|
|
6
|
-
} from '@prosekit/web/popover'
|
|
7
|
-
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
8
4
|
|
|
9
|
-
import {
|
|
10
|
-
import type
|
|
5
|
+
import { registerPopoverRootElement, type PopoverRootEvents, type PopoverRootProps as PopoverRootElementProps } from '@prosekit/web/popover';
|
|
6
|
+
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
11
7
|
|
|
12
8
|
/**
|
|
13
|
-
* Props for the {@link PopoverRoot} component.
|
|
9
|
+
* Props for the {@link PopoverRoot} Vue component.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
14
12
|
*/
|
|
15
|
-
export interface PopoverRootProps
|
|
13
|
+
export interface PopoverRootProps {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the popover should be modal.
|
|
16
|
+
* When true, the popover will trap focus and prevent interaction with the rest of the page.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
modal?: PopoverRootElementProps['modal'];
|
|
21
|
+
/**
|
|
22
|
+
* Whether the overlay is initially open.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
defaultOpen?: PopoverRootElementProps['defaultOpen'];
|
|
26
|
+
/**
|
|
27
|
+
* Whether the overlay is currently open.
|
|
28
|
+
* @default null
|
|
29
|
+
*/
|
|
30
|
+
open?: PopoverRootElementProps['open'];
|
|
31
|
+
/**
|
|
32
|
+
* Whether the component should ignore user interaction.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
disabled?: PopoverRootElementProps['disabled'];
|
|
36
|
+
/** Emitted when the popover is opened or closed. */
|
|
37
|
+
onOpenChange?: (event: PopoverRootEvents['openChange']) => void;
|
|
38
|
+
}
|
|
16
39
|
|
|
17
40
|
/**
|
|
18
|
-
*
|
|
41
|
+
* A Vue component that renders an `prosekit-popover-root` custom element.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
19
44
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
45
|
+
export const PopoverRoot: DefineSetupFnComponent<PopoverRootProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<PopoverRootProps & HTMLAttributes>(
|
|
46
|
+
(props, { slots }) => {
|
|
47
|
+
registerPopoverRootElement();
|
|
48
|
+
|
|
49
|
+
const elementRef = shallowRef<HTMLElement | null>(null);
|
|
50
|
+
|
|
51
|
+
const splittedProps = computed(() => {
|
|
52
|
+
const { defaultOpen: p0, disabled: p1, modal: p2, open: p3, onOpenChange: e0, ...restProps } = props;
|
|
53
|
+
return [[p0, p1, p2, p3, e0], restProps] as const;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const handlers: Array<((event: any) => void) | undefined> = [];
|
|
57
|
+
|
|
58
|
+
watchEffect(() => {
|
|
59
|
+
const element = elementRef.value;
|
|
60
|
+
if (!element) return;
|
|
61
|
+
|
|
62
|
+
const [p0, p1, p2, p3, e0] = splittedProps.value[0];
|
|
63
|
+
|
|
64
|
+
Object.assign(element, { defaultOpen: p0, disabled: p1, modal: p2, open: p3 });
|
|
65
|
+
|
|
66
|
+
handlers.length = 0;
|
|
67
|
+
handlers.push(e0);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
watchEffect(() => {
|
|
71
|
+
const element = elementRef.value;
|
|
72
|
+
if (!element) return;
|
|
73
|
+
|
|
74
|
+
const ac = new AbortController();
|
|
75
|
+
for (const [index, eventName] of ['openChange'].entries()) {
|
|
76
|
+
element.addEventListener(
|
|
77
|
+
eventName,
|
|
78
|
+
(event: Event) => {
|
|
79
|
+
handlers[index]?.(event);
|
|
80
|
+
},
|
|
81
|
+
{ signal: ac.signal },
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
return () => ac.abort();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return () => {
|
|
88
|
+
const restProps = splittedProps.value[1];
|
|
89
|
+
return h('prosekit-popover-root', { ...restProps, ref: elementRef }, slots.default?.());
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
{ props: ['defaultOpen', 'disabled', 'modal', 'open', 'onOpenChange'] },
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
export type { PopoverRootEvents };
|
|
@@ -1,33 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type PopoverTriggerProps as Props,
|
|
5
|
-
type PopoverTriggerEvents as Events,
|
|
6
|
-
} from '@prosekit/web/popover'
|
|
7
|
-
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
8
4
|
|
|
9
|
-
import {
|
|
10
|
-
import type
|
|
5
|
+
import { registerPopoverTriggerElement, type PopoverTriggerEvents, type PopoverTriggerProps as PopoverTriggerElementProps } from '@prosekit/web/popover';
|
|
6
|
+
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
11
7
|
|
|
12
8
|
/**
|
|
13
|
-
* Props for the {@link PopoverTrigger} component.
|
|
9
|
+
* Props for the {@link PopoverTrigger} Vue component.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
14
12
|
*/
|
|
15
|
-
export interface PopoverTriggerProps
|
|
13
|
+
export interface PopoverTriggerProps {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the component should ignore user interaction.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
disabled?: PopoverTriggerElementProps['disabled'];
|
|
19
|
+
/**
|
|
20
|
+
* Whether the popover should also open when the trigger is hovered.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
openOnHover?: PopoverTriggerElementProps['openOnHover'];
|
|
24
|
+
/**
|
|
25
|
+
* The delay in milliseconds before opening the popover when hovering.
|
|
26
|
+
* Only applies when `openOnHover` is true.
|
|
27
|
+
* @default 300
|
|
28
|
+
*/
|
|
29
|
+
delay?: PopoverTriggerElementProps['delay'];
|
|
30
|
+
/**
|
|
31
|
+
* The delay in milliseconds before closing the popover when hover ends.
|
|
32
|
+
* Only applies when `openOnHover` is true.
|
|
33
|
+
* @default 0
|
|
34
|
+
*/
|
|
35
|
+
closeDelay?: PopoverTriggerElementProps['closeDelay'];
|
|
36
|
+
/** Emitted when the popover is opened or closed. */
|
|
37
|
+
onOpenChange?: (event: PopoverTriggerEvents['openChange']) => void;
|
|
38
|
+
}
|
|
16
39
|
|
|
17
40
|
/**
|
|
18
|
-
*
|
|
41
|
+
* A Vue component that renders an `prosekit-popover-trigger` custom element.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
19
44
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
45
|
+
export const PopoverTrigger: DefineSetupFnComponent<PopoverTriggerProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<PopoverTriggerProps & HTMLAttributes>(
|
|
46
|
+
(props, { slots }) => {
|
|
47
|
+
registerPopoverTriggerElement();
|
|
48
|
+
|
|
49
|
+
const elementRef = shallowRef<HTMLElement | null>(null);
|
|
50
|
+
|
|
51
|
+
const splittedProps = computed(() => {
|
|
52
|
+
const { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3, onOpenChange: e0, ...restProps } = props;
|
|
53
|
+
return [[p0, p1, p2, p3, e0], restProps] as const;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const handlers: Array<((event: any) => void) | undefined> = [];
|
|
57
|
+
|
|
58
|
+
watchEffect(() => {
|
|
59
|
+
const element = elementRef.value;
|
|
60
|
+
if (!element) return;
|
|
61
|
+
|
|
62
|
+
const [p0, p1, p2, p3, e0] = splittedProps.value[0];
|
|
63
|
+
|
|
64
|
+
Object.assign(element, { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3 });
|
|
65
|
+
|
|
66
|
+
handlers.length = 0;
|
|
67
|
+
handlers.push(e0);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
watchEffect(() => {
|
|
71
|
+
const element = elementRef.value;
|
|
72
|
+
if (!element) return;
|
|
73
|
+
|
|
74
|
+
const ac = new AbortController();
|
|
75
|
+
for (const [index, eventName] of ['openChange'].entries()) {
|
|
76
|
+
element.addEventListener(
|
|
77
|
+
eventName,
|
|
78
|
+
(event: Event) => {
|
|
79
|
+
handlers[index]?.(event);
|
|
80
|
+
},
|
|
81
|
+
{ signal: ac.signal },
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
return () => ac.abort();
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return () => {
|
|
88
|
+
const restProps = splittedProps.value[1];
|
|
89
|
+
return h('prosekit-popover-trigger', { ...restProps, ref: elementRef }, slots.default?.());
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
{ props: ['closeDelay', 'delay', 'disabled', 'openOnHover', 'onOpenChange'] },
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
export type { PopoverTriggerEvents };
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
2
4
|
|
|
3
|
-
export { ResizableRoot, type ResizableRootProps, type
|
|
5
|
+
export { ResizableRoot, type ResizableRootProps, type ResizableRootEvents } from './resizable-root.gen.ts';
|
|
6
|
+
|
|
7
|
+
export { ResizableHandle, type ResizableHandleProps } from './resizable-handle.gen.ts';
|
|
8
|
+
|
|
9
|
+
export { ResizeEndEvent, ResizeStartEvent } from '@prosekit/web/resizable';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
|
|
3
|
+
@module
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import {
|
|
9
|
+
ResizableHandle,
|
|
10
|
+
ResizableRoot,
|
|
11
|
+
} from 'prosekit/vue/resizable'
|
|
12
|
+
|
|
13
|
+
<ResizableRoot>
|
|
14
|
+
<img src="..." />
|
|
15
|
+
<ResizableHandle>...</ResizableHandle>
|
|
16
|
+
</ResizableRoot>
|
|
17
|
+
```
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export * from './index.gen.ts'
|
|
@@ -1,33 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type ResizableHandleProps as Props,
|
|
5
|
-
type ResizableHandleEvents as Events,
|
|
6
|
-
} from '@prosekit/web/resizable'
|
|
7
|
-
import type { DefineSetupFnComponent, HTMLAttributes } from 'vue'
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
8
4
|
|
|
9
|
-
import {
|
|
10
|
-
import type
|
|
5
|
+
import { registerResizableHandleElement, type ResizableHandleProps as ResizableHandleElementProps } from '@prosekit/web/resizable';
|
|
6
|
+
import { defineComponent, h, type DefineSetupFnComponent, type HTMLAttributes, shallowRef, computed, watchEffect } from 'vue';
|
|
11
7
|
|
|
12
8
|
/**
|
|
13
|
-
* Props for the {@link ResizableHandle} component.
|
|
9
|
+
* Props for the {@link ResizableHandle} Vue component.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
14
12
|
*/
|
|
15
|
-
export interface ResizableHandleProps
|
|
13
|
+
export interface ResizableHandleProps {
|
|
14
|
+
/**
|
|
15
|
+
* The position of the handle.
|
|
16
|
+
*
|
|
17
|
+
* @default "bottom-right"
|
|
18
|
+
*/
|
|
19
|
+
position?: ResizableHandleElementProps['position'];
|
|
20
|
+
}
|
|
16
21
|
|
|
17
22
|
/**
|
|
18
|
-
*
|
|
23
|
+
* A Vue component that renders an `prosekit-resizable-handle` custom element.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
19
26
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
27
|
+
export const ResizableHandle: DefineSetupFnComponent<ResizableHandleProps & HTMLAttributes> = /* @__PURE__ */ defineComponent<ResizableHandleProps & HTMLAttributes>(
|
|
28
|
+
(props, { slots }) => {
|
|
29
|
+
registerResizableHandleElement();
|
|
30
|
+
|
|
31
|
+
const elementRef = shallowRef<HTMLElement | null>(null);
|
|
32
|
+
|
|
33
|
+
const splittedProps = computed(() => {
|
|
34
|
+
const { position: p0, ...restProps } = props;
|
|
35
|
+
return [[p0], restProps] as const;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
watchEffect(() => {
|
|
39
|
+
const element = elementRef.value;
|
|
40
|
+
if (!element) return;
|
|
41
|
+
|
|
42
|
+
const [p0] = splittedProps.value[0];
|
|
43
|
+
|
|
44
|
+
Object.assign(element, { position: p0 });
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return () => {
|
|
48
|
+
const restProps = splittedProps.value[1];
|
|
49
|
+
return h('prosekit-resizable-handle', { ...restProps, ref: elementRef }, slots.default?.());
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
{ props: ['position'] },
|
|
53
|
+
);
|