@prosekit/solid 0.7.0-beta.1 → 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-solid-autocomplete.d.ts +225 -19
- package/dist/prosekit-solid-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-solid-autocomplete.js +204 -9
- package/dist/prosekit-solid-autocomplete.js.map +1 -1
- package/dist/prosekit-solid-block-handle.d.ts +209 -15
- package/dist/prosekit-solid-block-handle.d.ts.map +1 -1
- package/dist/prosekit-solid-block-handle.js +160 -7
- package/dist/prosekit-solid-block-handle.js.map +1 -1
- package/dist/prosekit-solid-drop-indicator.d.ts +26 -7
- package/dist/prosekit-solid-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-solid-drop-indicator.js +29 -3
- package/dist/prosekit-solid-drop-indicator.js.map +1 -1
- package/dist/prosekit-solid-inline-popover.d.ts +203 -9
- package/dist/prosekit-solid-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-solid-inline-popover.js +128 -5
- package/dist/prosekit-solid-inline-popover.js.map +1 -1
- package/dist/prosekit-solid-menu.d.ts +287 -0
- package/dist/prosekit-solid-menu.d.ts.map +1 -0
- package/dist/prosekit-solid-menu.js +241 -0
- package/dist/prosekit-solid-menu.js.map +1 -0
- package/dist/prosekit-solid-popover.d.ts +226 -15
- package/dist/prosekit-solid-popover.d.ts.map +1 -1
- package/dist/prosekit-solid-popover.js +165 -7
- package/dist/prosekit-solid-popover.js.map +1 -1
- package/dist/prosekit-solid-resizable.d.ts +55 -13
- package/dist/prosekit-solid-resizable.d.ts.map +1 -1
- package/dist/prosekit-solid-resizable.js +69 -7
- package/dist/prosekit-solid-resizable.js.map +1 -1
- package/dist/prosekit-solid-table-handle.d.ts +446 -39
- package/dist/prosekit-solid-table-handle.d.ts.map +1 -1
- package/dist/prosekit-solid-table-handle.js +334 -19
- package/dist/prosekit-solid-table-handle.js.map +1 -1
- package/dist/prosekit-solid-tooltip.d.ts +210 -15
- package/dist/prosekit-solid-tooltip.d.ts.map +1 -1
- package/dist/prosekit-solid-tooltip.js +149 -7
- package/dist/prosekit-solid-tooltip.js.map +1 -1
- package/dist/prosekit-solid.d.ts +23 -2
- package/dist/prosekit-solid.d.ts.map +1 -1
- package/package.json +26 -18
- package/src/components/autocomplete/autocomplete-empty.gen.ts +22 -24
- package/src/components/autocomplete/autocomplete-item.gen.ts +82 -26
- package/src/components/autocomplete/autocomplete-popup.gen.ts +78 -0
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +167 -0
- package/src/components/autocomplete/autocomplete-root.gen.ts +110 -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 +54 -26
- package/src/components/block-handle/block-handle-draggable.gen.ts +54 -26
- package/src/components/block-handle/block-handle-popup.gen.ts +27 -0
- package/src/components/block-handle/block-handle-positioner.gen.ts +185 -0
- package/src/components/block-handle/block-handle-root.gen.ts +82 -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 +60 -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 +27 -0
- package/src/components/inline-popover/inline-popover-positioner.gen.ts +191 -0
- package/src/components/inline-popover/inline-popover-root.gen.ts +106 -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 +89 -0
- package/src/components/menu/menu-popup.gen.ts +53 -0
- package/src/components/menu/menu-positioner.gen.ts +192 -0
- package/src/components/menu/menu-root.gen.ts +86 -0
- package/src/components/menu/menu-submenu-root.gen.ts +27 -0
- package/src/components/menu/menu-submenu-trigger.gen.ts +27 -0
- package/src/components/menu/menu-trigger.gen.ts +77 -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 +27 -0
- package/src/components/popover/popover-positioner.gen.ts +192 -0
- package/src/components/popover/popover-root.gen.ts +90 -26
- package/src/components/popover/popover-trigger.gen.ts +90 -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 +49 -26
- package/src/components/resizable/resizable-root.gen.ts +89 -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 +61 -0
- package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +55 -0
- package/src/components/table-handle/table-handle-column-popup.gen.ts +27 -0
- package/src/components/table-handle/table-handle-column-positioner.gen.ts +196 -0
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +52 -26
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +52 -26
- package/src/components/table-handle/table-handle-root.gen.ts +54 -26
- package/src/components/table-handle/table-handle-row-menu-root.gen.ts +61 -0
- package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +55 -0
- package/src/components/table-handle/table-handle-row-popup.gen.ts +27 -0
- package/src/components/table-handle/table-handle-row-positioner.gen.ts +196 -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 +27 -0
- package/src/components/tooltip/tooltip-positioner.gen.ts +192 -0
- package/src/components/tooltip/tooltip-root.gen.ts +83 -26
- package/src/components/tooltip/tooltip-trigger.gen.ts +58 -26
- package/dist/create-component.js +0 -41
- package/dist/create-component.js.map +0 -1
- package/dist/create-props.d.ts +0 -6
- package/dist/create-props.d.ts.map +0 -1
- package/dist/types.d.ts +0 -26
- package/dist/types.d.ts.map +0 -1
- package/src/components/autocomplete/autocomplete-list.gen.ts +0 -29
- package/src/components/autocomplete/autocomplete-popover.gen.ts +0 -29
- package/src/components/block-handle/block-handle-popover.gen.ts +0 -29
- package/src/components/create-component.ts +0 -60
- package/src/components/create-props.ts +0 -13
- package/src/components/inline-popover/inline-popover.gen.ts +0 -29
- package/src/components/popover/popover-content.gen.ts +0 -29
- package/src/components/table-handle/table-handle-column-root.gen.ts +0 -29
- package/src/components/table-handle/table-handle-column-trigger.gen.ts +0 -29
- package/src/components/table-handle/table-handle-popover-content.gen.ts +0 -29
- package/src/components/table-handle/table-handle-popover-item.gen.ts +0 -29
- package/src/components/table-handle/table-handle-row-root.gen.ts +0 -29
- package/src/components/table-handle/table-handle-row-trigger.gen.ts +0 -29
- package/src/components/tooltip/tooltip-content.gen.ts +0 -29
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { registerBlockHandlePopupElement, type BlockHandlePopupElement } from '@prosekit/web/block-handle';
|
|
6
|
+
import type { Component, JSX } from 'solid-js';
|
|
7
|
+
import h from 'solid-js/h';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props for the {@link BlockHandlePopup} Solid component.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface BlockHandlePopupProps extends JSX.HTMLAttributes<BlockHandlePopupElement> {}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Solid component that renders an `prosekit-block-handle-popup` custom element.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export const BlockHandlePopup: Component<BlockHandlePopupProps> = (props): any => {
|
|
22
|
+
registerBlockHandlePopupElement();
|
|
23
|
+
|
|
24
|
+
const restProps = props;
|
|
25
|
+
|
|
26
|
+
return () => h('prosekit-block-handle-popup', restProps);
|
|
27
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { registerBlockHandlePositionerElement, type BlockHandlePositionerElement, type BlockHandlePositionerProps as BlockHandlePositionerElementProps } from '@prosekit/web/block-handle';
|
|
6
|
+
import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
|
|
7
|
+
import type { Component, JSX } from 'solid-js';
|
|
8
|
+
import h from 'solid-js/h';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Props for the {@link BlockHandlePositioner} Solid component.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export interface BlockHandlePositionerProps extends JSX.HTMLAttributes<BlockHandlePositionerElement> {
|
|
16
|
+
/**
|
|
17
|
+
* The placement of the popover, relative to the hovered block.
|
|
18
|
+
*
|
|
19
|
+
* @default "left"
|
|
20
|
+
*/
|
|
21
|
+
placement?: BlockHandlePositionerElementProps['placement'];
|
|
22
|
+
/**
|
|
23
|
+
* Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
|
|
24
|
+
* to place the floating element on top of other page content.
|
|
25
|
+
*
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
hoist?: BlockHandlePositionerElementProps['hoist'];
|
|
29
|
+
/**
|
|
30
|
+
* @default false
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
flip?: BlockHandlePositionerElementProps['flip'];
|
|
34
|
+
/**
|
|
35
|
+
* @default false
|
|
36
|
+
* @hidden
|
|
37
|
+
*/
|
|
38
|
+
shift?: BlockHandlePositionerElementProps['shift'];
|
|
39
|
+
/**
|
|
40
|
+
* @default true
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
hide?: BlockHandlePositionerElementProps['hide'];
|
|
44
|
+
/**
|
|
45
|
+
* The strategy to use for positioning
|
|
46
|
+
*
|
|
47
|
+
* @default "absolute"
|
|
48
|
+
*/
|
|
49
|
+
strategy?: BlockHandlePositionerElementProps['strategy'];
|
|
50
|
+
/**
|
|
51
|
+
* Options to activate auto-update listeners
|
|
52
|
+
*
|
|
53
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
54
|
+
*
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
autoUpdate?: BlockHandlePositionerElementProps['autoUpdate'];
|
|
58
|
+
/**
|
|
59
|
+
* The distance between the reference and floating element.
|
|
60
|
+
*
|
|
61
|
+
* @default 6
|
|
62
|
+
*/
|
|
63
|
+
offset?: BlockHandlePositionerElementProps['offset'];
|
|
64
|
+
/**
|
|
65
|
+
* Whether the floating element can overlap the reference element to keep it
|
|
66
|
+
* in view.
|
|
67
|
+
*
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
overlap?: BlockHandlePositionerElementProps['overlap'];
|
|
71
|
+
/**
|
|
72
|
+
* Whether to constrain the floating element's width and height to not exceed
|
|
73
|
+
* the viewport.
|
|
74
|
+
*
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
fitViewport?: BlockHandlePositionerElementProps['fitViewport'];
|
|
78
|
+
/**
|
|
79
|
+
* Whether to constrain the floating element's width so that it matches the
|
|
80
|
+
* reference element.
|
|
81
|
+
*
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
sameWidth?: BlockHandlePositionerElementProps['sameWidth'];
|
|
85
|
+
/**
|
|
86
|
+
* Whether to constrain the floating element's height so that it matches the
|
|
87
|
+
* reference element.
|
|
88
|
+
*
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
sameHeight?: BlockHandlePositionerElementProps['sameHeight'];
|
|
92
|
+
/**
|
|
93
|
+
* Whether to improve positioning for inline reference elements that span over
|
|
94
|
+
* multiple lines.
|
|
95
|
+
*
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
inline?: BlockHandlePositionerElementProps['inline'];
|
|
99
|
+
/**
|
|
100
|
+
* Describes the clipping element(s) or area that overflow will be checked relative to.
|
|
101
|
+
* Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
|
|
102
|
+
*
|
|
103
|
+
* @default 'clippingAncestors'
|
|
104
|
+
*/
|
|
105
|
+
boundary?: BlockHandlePositionerElementProps['boundary'];
|
|
106
|
+
/**
|
|
107
|
+
* Describes the root boundary that the element will be checked for overflow relative to.
|
|
108
|
+
* Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
|
|
109
|
+
*
|
|
110
|
+
* @default 'viewport'
|
|
111
|
+
*/
|
|
112
|
+
rootBoundary?: BlockHandlePositionerElementProps['rootBoundary'];
|
|
113
|
+
/**
|
|
114
|
+
* Describes the virtual padding around the boundary to check for overflow.
|
|
115
|
+
* Please see https://floating-ui.com/docs/detectoverflow#padding for more information.
|
|
116
|
+
*
|
|
117
|
+
* @default 4
|
|
118
|
+
*/
|
|
119
|
+
overflowPadding?: BlockHandlePositionerElementProps['overflowPadding'];
|
|
120
|
+
/**
|
|
121
|
+
* The element that will be used to check for overflow. Please see
|
|
122
|
+
* https://floating-ui.com/docs/detectoverflow#elementcontext for more
|
|
123
|
+
* information.
|
|
124
|
+
*
|
|
125
|
+
* @default 'floating'
|
|
126
|
+
*/
|
|
127
|
+
elementContext?: BlockHandlePositionerElementProps['elementContext'];
|
|
128
|
+
/**
|
|
129
|
+
* Whether to check the alternate elementContext's boundary. Please see
|
|
130
|
+
* https://floating-ui.com/docs/detectoverflow#altboundary for more
|
|
131
|
+
* information.
|
|
132
|
+
*
|
|
133
|
+
* @default false
|
|
134
|
+
*/
|
|
135
|
+
altBoundary?: BlockHandlePositionerElementProps['altBoundary'];
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A Solid component that renders an `prosekit-block-handle-positioner` custom element.
|
|
140
|
+
*
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
|
+
export const BlockHandlePositioner: Component<BlockHandlePositionerProps> = (props): any => {
|
|
144
|
+
registerBlockHandlePositionerElement();
|
|
145
|
+
|
|
146
|
+
const [getElement, setElement] = createSignal<BlockHandlePositionerElement | null>(null);
|
|
147
|
+
|
|
148
|
+
const [elementProps, restProps] = splitProps(props, ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy']);
|
|
149
|
+
|
|
150
|
+
createEffect(() => {
|
|
151
|
+
const element = getElement();
|
|
152
|
+
if (!element) return;
|
|
153
|
+
|
|
154
|
+
Object.assign(element, {
|
|
155
|
+
altBoundary: elementProps.altBoundary,
|
|
156
|
+
autoUpdate: elementProps.autoUpdate,
|
|
157
|
+
boundary: elementProps.boundary,
|
|
158
|
+
elementContext: elementProps.elementContext,
|
|
159
|
+
fitViewport: elementProps.fitViewport,
|
|
160
|
+
flip: elementProps.flip,
|
|
161
|
+
hide: elementProps.hide,
|
|
162
|
+
hoist: elementProps.hoist,
|
|
163
|
+
inline: elementProps.inline,
|
|
164
|
+
offset: elementProps.offset,
|
|
165
|
+
overflowPadding: elementProps.overflowPadding,
|
|
166
|
+
overlap: elementProps.overlap,
|
|
167
|
+
placement: elementProps.placement,
|
|
168
|
+
rootBoundary: elementProps.rootBoundary,
|
|
169
|
+
sameHeight: elementProps.sameHeight,
|
|
170
|
+
sameWidth: elementProps.sameWidth,
|
|
171
|
+
shift: elementProps.shift,
|
|
172
|
+
strategy: elementProps.strategy,
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
return () =>
|
|
177
|
+
h(
|
|
178
|
+
'prosekit-block-handle-positioner',
|
|
179
|
+
mergeProps(restProps, {
|
|
180
|
+
ref: (el: BlockHandlePositionerElement | null) => {
|
|
181
|
+
setElement(el);
|
|
182
|
+
},
|
|
183
|
+
}),
|
|
184
|
+
);
|
|
185
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { registerBlockHandleRootElement, type BlockHandleRootElement, type BlockHandleRootEvents, type BlockHandleRootProps as BlockHandleRootElementProps } from '@prosekit/web/block-handle';
|
|
6
|
+
import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
|
|
7
|
+
import type { Component, JSX } from 'solid-js';
|
|
8
|
+
import h from 'solid-js/h';
|
|
9
|
+
|
|
10
|
+
import { useEditorContext } from '../../contexts/editor-context.ts';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link BlockHandleRoot} Solid component.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export interface BlockHandleRootProps extends JSX.HTMLAttributes<BlockHandleRootElement> {
|
|
18
|
+
/**
|
|
19
|
+
* The ProseKit editor instance.
|
|
20
|
+
*
|
|
21
|
+
* @default null
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
editor?: BlockHandleRootElementProps['editor'];
|
|
25
|
+
/** Fired when the hovered block changes. */
|
|
26
|
+
onStateChange?: (event: BlockHandleRootEvents['stateChange']) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A Solid component that renders an `prosekit-block-handle-root` custom element.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export const BlockHandleRoot: Component<BlockHandleRootProps> = (props): any => {
|
|
35
|
+
registerBlockHandleRootElement();
|
|
36
|
+
|
|
37
|
+
const [getElement, setElement] = createSignal<BlockHandleRootElement | null>(null);
|
|
38
|
+
const handlers: Array<((event: any) => void) | undefined> = [];
|
|
39
|
+
|
|
40
|
+
const [elementProps, eventHandlers, restProps] = splitProps(props, ['editor'], ['onStateChange']);
|
|
41
|
+
|
|
42
|
+
const p0Fallback = useEditorContext();
|
|
43
|
+
|
|
44
|
+
createEffect(() => {
|
|
45
|
+
const element = getElement();
|
|
46
|
+
if (!element) return;
|
|
47
|
+
|
|
48
|
+
Object.assign(element, { editor: elementProps.editor ?? p0Fallback });
|
|
49
|
+
|
|
50
|
+
handlers.length = 0;
|
|
51
|
+
handlers.push(eventHandlers.onStateChange);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
createEffect(() => {
|
|
55
|
+
const element = getElement();
|
|
56
|
+
if (!element) return;
|
|
57
|
+
|
|
58
|
+
const ac = new AbortController();
|
|
59
|
+
for (const [index, eventName] of ['stateChange'].entries()) {
|
|
60
|
+
element.addEventListener(
|
|
61
|
+
eventName,
|
|
62
|
+
(event) => {
|
|
63
|
+
handlers[index]?.(event);
|
|
64
|
+
},
|
|
65
|
+
{ signal: ac.signal },
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
return () => ac.abort();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return () =>
|
|
72
|
+
h(
|
|
73
|
+
'prosekit-block-handle-root',
|
|
74
|
+
mergeProps(restProps, {
|
|
75
|
+
ref: (el: BlockHandleRootElement | null) => {
|
|
76
|
+
setElement(el);
|
|
77
|
+
},
|
|
78
|
+
}),
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type { BlockHandleRootEvents };
|
|
@@ -1,5 +1,15 @@
|
|
|
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 { BlockHandleAdd, type BlockHandleAddProps } from './block-handle-add.gen.ts';
|
|
4
6
|
|
|
5
|
-
export {
|
|
7
|
+
export { BlockHandleDraggable, type BlockHandleDraggableProps } from './block-handle-draggable.gen.ts';
|
|
8
|
+
|
|
9
|
+
export { BlockHandlePopup, type BlockHandlePopupProps } from './block-handle-popup.gen.ts';
|
|
10
|
+
|
|
11
|
+
export { BlockHandlePositioner, type BlockHandlePositionerProps } from './block-handle-positioner.gen.ts';
|
|
12
|
+
|
|
13
|
+
export { BlockHandleRoot, type BlockHandleRootProps, type BlockHandleRootEvents } from './block-handle-root.gen.ts';
|
|
14
|
+
|
|
15
|
+
export { BlockHandleStateChangeEvent } from '@prosekit/web/block-handle';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
|
|
3
|
+
@module
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import {
|
|
9
|
+
BlockHandleAdd,
|
|
10
|
+
BlockHandleDraggable,
|
|
11
|
+
BlockHandlePopup,
|
|
12
|
+
BlockHandlePositioner,
|
|
13
|
+
BlockHandleRoot,
|
|
14
|
+
} from 'prosekit/solid/block-handle'
|
|
15
|
+
|
|
16
|
+
<BlockHandleRoot>
|
|
17
|
+
<BlockHandlePositioner>
|
|
18
|
+
<BlockHandlePopup>
|
|
19
|
+
<BlockHandleAdd>...</BlockHandleAdd>
|
|
20
|
+
<BlockHandleDraggable>...</BlockHandleDraggable>
|
|
21
|
+
</BlockHandlePopup>
|
|
22
|
+
</BlockHandlePositioner>
|
|
23
|
+
</BlockHandleRoot>
|
|
24
|
+
```
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export * from './index.gen.ts'
|
|
@@ -1,29 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from '
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { registerDropIndicatorElement, type DropIndicatorElement, type DropIndicatorProps as DropIndicatorElementProps } from '@prosekit/web/drop-indicator';
|
|
6
|
+
import { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';
|
|
7
|
+
import type { Component, JSX } from 'solid-js';
|
|
8
|
+
import h from 'solid-js/h';
|
|
9
|
+
|
|
10
|
+
import { useEditorContext } from '../../contexts/editor-context.ts';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link DropIndicator} Solid component.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export interface DropIndicatorProps extends JSX.HTMLAttributes<DropIndicatorElement> {
|
|
18
|
+
/**
|
|
19
|
+
* The ProseKit editor instance.
|
|
20
|
+
*
|
|
21
|
+
* @default null
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
editor?: DropIndicatorElementProps['editor'];
|
|
25
|
+
/**
|
|
26
|
+
* The line width in pixels.
|
|
27
|
+
*
|
|
28
|
+
* @default 2
|
|
29
|
+
*/
|
|
30
|
+
width?: DropIndicatorElementProps['width'];
|
|
31
|
+
}
|
|
13
32
|
|
|
14
33
|
/**
|
|
15
|
-
*
|
|
34
|
+
* A Solid component that renders an `prosekit-drop-indicator` custom element.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
16
37
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
export const DropIndicator: Component<DropIndicatorProps> = (props): any => {
|
|
39
|
+
registerDropIndicatorElement();
|
|
40
|
+
|
|
41
|
+
const [getElement, setElement] = createSignal<DropIndicatorElement | null>(null);
|
|
42
|
+
|
|
43
|
+
const [elementProps, restProps] = splitProps(props, ['editor', 'width']);
|
|
44
|
+
|
|
45
|
+
const p0Fallback = useEditorContext();
|
|
46
|
+
|
|
47
|
+
createEffect(() => {
|
|
48
|
+
const element = getElement();
|
|
49
|
+
if (!element) return;
|
|
50
|
+
|
|
51
|
+
Object.assign(element, { editor: elementProps.editor ?? p0Fallback, width: elementProps.width });
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
return () =>
|
|
55
|
+
h(
|
|
56
|
+
'prosekit-drop-indicator',
|
|
57
|
+
mergeProps(restProps, {
|
|
58
|
+
ref: (el: DropIndicatorElement | null) => {
|
|
59
|
+
setElement(el);
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
};
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { InlinePopoverPopup, type InlinePopoverPopupProps } from './inline-popover-popup.gen.ts';
|
|
6
|
+
|
|
7
|
+
export { InlinePopoverPositioner, type InlinePopoverPositionerProps } from './inline-popover-positioner.gen.ts';
|
|
8
|
+
|
|
9
|
+
export { InlinePopoverRoot, type InlinePopoverRootProps, type InlinePopoverRootEvents } from './inline-popover-root.gen.ts';
|
|
10
|
+
|
|
11
|
+
export { OpenChangeEvent } from '@prosekit/web/inline-popover';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
|
|
3
|
+
@module
|
|
4
|
+
|
|
5
|
+
## Anatomy
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import {
|
|
9
|
+
InlinePopoverPopup,
|
|
10
|
+
InlinePopoverPositioner,
|
|
11
|
+
InlinePopoverRoot,
|
|
12
|
+
} from 'prosekit/solid/inline-popover'
|
|
13
|
+
|
|
14
|
+
<InlinePopoverRoot>
|
|
15
|
+
<InlinePopoverPositioner>
|
|
16
|
+
<InlinePopoverPopup>...</InlinePopoverPopup>
|
|
17
|
+
</InlinePopoverPositioner>
|
|
18
|
+
</InlinePopoverRoot>
|
|
19
|
+
```
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
export * from './index.gen.ts'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { registerInlinePopoverPopupElement, type InlinePopoverPopupElement } from '@prosekit/web/inline-popover';
|
|
6
|
+
import type { Component, JSX } from 'solid-js';
|
|
7
|
+
import h from 'solid-js/h';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props for the {@link InlinePopoverPopup} Solid component.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface InlinePopoverPopupProps extends JSX.HTMLAttributes<InlinePopoverPopupElement> {}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Solid component that renders an `prosekit-inline-popover-popup` custom element.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export const InlinePopoverPopup: Component<InlinePopoverPopupProps> = (props): any => {
|
|
22
|
+
registerInlinePopoverPopupElement();
|
|
23
|
+
|
|
24
|
+
const restProps = props;
|
|
25
|
+
|
|
26
|
+
return () => h('prosekit-inline-popover-popup', restProps);
|
|
27
|
+
};
|