@prosekit/solid 0.7.0-beta.1 → 0.7.0-beta.3
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 +23 -15
- 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
|
@@ -1,28 +1,222 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Component } from "solid-js";
|
|
4
|
-
import { BlockHandleAddElement, BlockHandleAddEvents, BlockHandleAddProps as BlockHandleAddProps$1, BlockHandleDraggableElement, BlockHandleDraggableEvents, BlockHandleDraggableProps as BlockHandleDraggableProps$1, BlockHandlePopoverElement, BlockHandlePopoverEvents, BlockHandlePopoverProps as BlockHandlePopoverProps$1 } from "@prosekit/web/block-handle";
|
|
1
|
+
import { Component, JSX } from "solid-js";
|
|
2
|
+
import { BlockHandleAddElement, BlockHandleAddProps as BlockHandleAddProps$1, BlockHandleDraggableElement, BlockHandleDraggableProps as BlockHandleDraggableProps$1, BlockHandlePopupElement, BlockHandlePositionerElement, BlockHandlePositionerProps as BlockHandlePositionerProps$1, BlockHandleRootElement, BlockHandleRootEvents, BlockHandleRootProps as BlockHandleRootProps$1, BlockHandleStateChangeEvent } from "@prosekit/web/block-handle";
|
|
5
3
|
|
|
6
4
|
//#region src/components/block-handle/block-handle-add.gen.d.ts
|
|
7
5
|
/**
|
|
8
|
-
* Props for the {@link BlockHandleAdd} component.
|
|
6
|
+
* Props for the {@link BlockHandleAdd} Solid component.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
9
|
*/
|
|
10
|
-
interface BlockHandleAddProps extends
|
|
11
|
-
|
|
10
|
+
interface BlockHandleAddProps extends JSX.HTMLAttributes<BlockHandleAddElement> {
|
|
11
|
+
/**
|
|
12
|
+
* The ProseKit editor instance.
|
|
13
|
+
*
|
|
14
|
+
* @default null
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
editor?: BlockHandleAddProps$1['editor'];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A Solid component that renders an `prosekit-block-handle-add` custom element.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
declare const BlockHandleAdd: Component<BlockHandleAddProps>;
|
|
12
25
|
//#endregion
|
|
13
26
|
//#region src/components/block-handle/block-handle-draggable.gen.d.ts
|
|
14
27
|
/**
|
|
15
|
-
* Props for the {@link BlockHandleDraggable} component.
|
|
28
|
+
* Props for the {@link BlockHandleDraggable} Solid component.
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
interface BlockHandleDraggableProps extends JSX.HTMLAttributes<BlockHandleDraggableElement> {
|
|
33
|
+
/**
|
|
34
|
+
* The ProseKit editor instance.
|
|
35
|
+
*
|
|
36
|
+
* @default null
|
|
37
|
+
* @hidden
|
|
38
|
+
*/
|
|
39
|
+
editor?: BlockHandleDraggableProps$1['editor'];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A Solid component that renders an `prosekit-block-handle-draggable` custom element.
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
declare const BlockHandleDraggable: Component<BlockHandleDraggableProps>;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/components/block-handle/block-handle-popup.gen.d.ts
|
|
49
|
+
/**
|
|
50
|
+
* Props for the {@link BlockHandlePopup} Solid component.
|
|
51
|
+
*
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
interface BlockHandlePopupProps extends JSX.HTMLAttributes<BlockHandlePopupElement> {}
|
|
55
|
+
/**
|
|
56
|
+
* A Solid component that renders an `prosekit-block-handle-popup` custom element.
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
declare const BlockHandlePopup: Component<BlockHandlePopupProps>;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/components/block-handle/block-handle-positioner.gen.d.ts
|
|
63
|
+
/**
|
|
64
|
+
* Props for the {@link BlockHandlePositioner} Solid component.
|
|
65
|
+
*
|
|
66
|
+
* @public
|
|
16
67
|
*/
|
|
17
|
-
interface
|
|
18
|
-
|
|
68
|
+
interface BlockHandlePositionerProps extends JSX.HTMLAttributes<BlockHandlePositionerElement> {
|
|
69
|
+
/**
|
|
70
|
+
* The placement of the popover, relative to the hovered block.
|
|
71
|
+
*
|
|
72
|
+
* @default "left"
|
|
73
|
+
*/
|
|
74
|
+
placement?: BlockHandlePositionerProps$1['placement'];
|
|
75
|
+
/**
|
|
76
|
+
* Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
|
|
77
|
+
* to place the floating element on top of other page content.
|
|
78
|
+
*
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
hoist?: BlockHandlePositionerProps$1['hoist'];
|
|
82
|
+
/**
|
|
83
|
+
* @default false
|
|
84
|
+
* @hidden
|
|
85
|
+
*/
|
|
86
|
+
flip?: BlockHandlePositionerProps$1['flip'];
|
|
87
|
+
/**
|
|
88
|
+
* @default false
|
|
89
|
+
* @hidden
|
|
90
|
+
*/
|
|
91
|
+
shift?: BlockHandlePositionerProps$1['shift'];
|
|
92
|
+
/**
|
|
93
|
+
* @default true
|
|
94
|
+
* @hidden
|
|
95
|
+
*/
|
|
96
|
+
hide?: BlockHandlePositionerProps$1['hide'];
|
|
97
|
+
/**
|
|
98
|
+
* The strategy to use for positioning
|
|
99
|
+
*
|
|
100
|
+
* @default "absolute"
|
|
101
|
+
*/
|
|
102
|
+
strategy?: BlockHandlePositionerProps$1['strategy'];
|
|
103
|
+
/**
|
|
104
|
+
* Options to activate auto-update listeners
|
|
105
|
+
*
|
|
106
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
107
|
+
*
|
|
108
|
+
* @default true
|
|
109
|
+
*/
|
|
110
|
+
autoUpdate?: BlockHandlePositionerProps$1['autoUpdate'];
|
|
111
|
+
/**
|
|
112
|
+
* The distance between the reference and floating element.
|
|
113
|
+
*
|
|
114
|
+
* @default 6
|
|
115
|
+
*/
|
|
116
|
+
offset?: BlockHandlePositionerProps$1['offset'];
|
|
117
|
+
/**
|
|
118
|
+
* Whether the floating element can overlap the reference element to keep it
|
|
119
|
+
* in view.
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
overlap?: BlockHandlePositionerProps$1['overlap'];
|
|
124
|
+
/**
|
|
125
|
+
* Whether to constrain the floating element's width and height to not exceed
|
|
126
|
+
* the viewport.
|
|
127
|
+
*
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
fitViewport?: BlockHandlePositionerProps$1['fitViewport'];
|
|
131
|
+
/**
|
|
132
|
+
* Whether to constrain the floating element's width so that it matches the
|
|
133
|
+
* reference element.
|
|
134
|
+
*
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
137
|
+
sameWidth?: BlockHandlePositionerProps$1['sameWidth'];
|
|
138
|
+
/**
|
|
139
|
+
* Whether to constrain the floating element's height so that it matches the
|
|
140
|
+
* reference element.
|
|
141
|
+
*
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
sameHeight?: BlockHandlePositionerProps$1['sameHeight'];
|
|
145
|
+
/**
|
|
146
|
+
* Whether to improve positioning for inline reference elements that span over
|
|
147
|
+
* multiple lines.
|
|
148
|
+
*
|
|
149
|
+
* @default false
|
|
150
|
+
*/
|
|
151
|
+
inline?: BlockHandlePositionerProps$1['inline'];
|
|
152
|
+
/**
|
|
153
|
+
* Describes the clipping element(s) or area that overflow will be checked relative to.
|
|
154
|
+
* Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
|
|
155
|
+
*
|
|
156
|
+
* @default 'clippingAncestors'
|
|
157
|
+
*/
|
|
158
|
+
boundary?: BlockHandlePositionerProps$1['boundary'];
|
|
159
|
+
/**
|
|
160
|
+
* Describes the root boundary that the element will be checked for overflow relative to.
|
|
161
|
+
* Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
|
|
162
|
+
*
|
|
163
|
+
* @default 'viewport'
|
|
164
|
+
*/
|
|
165
|
+
rootBoundary?: BlockHandlePositionerProps$1['rootBoundary'];
|
|
166
|
+
/**
|
|
167
|
+
* Describes the virtual padding around the boundary to check for overflow.
|
|
168
|
+
* Please see https://floating-ui.com/docs/detectoverflow#padding for more information.
|
|
169
|
+
*
|
|
170
|
+
* @default 4
|
|
171
|
+
*/
|
|
172
|
+
overflowPadding?: BlockHandlePositionerProps$1['overflowPadding'];
|
|
173
|
+
/**
|
|
174
|
+
* The element that will be used to check for overflow. Please see
|
|
175
|
+
* https://floating-ui.com/docs/detectoverflow#elementcontext for more
|
|
176
|
+
* information.
|
|
177
|
+
*
|
|
178
|
+
* @default 'floating'
|
|
179
|
+
*/
|
|
180
|
+
elementContext?: BlockHandlePositionerProps$1['elementContext'];
|
|
181
|
+
/**
|
|
182
|
+
* Whether to check the alternate elementContext's boundary. Please see
|
|
183
|
+
* https://floating-ui.com/docs/detectoverflow#altboundary for more
|
|
184
|
+
* information.
|
|
185
|
+
*
|
|
186
|
+
* @default false
|
|
187
|
+
*/
|
|
188
|
+
altBoundary?: BlockHandlePositionerProps$1['altBoundary'];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* A Solid component that renders an `prosekit-block-handle-positioner` custom element.
|
|
192
|
+
*
|
|
193
|
+
* @public
|
|
194
|
+
*/
|
|
195
|
+
declare const BlockHandlePositioner: Component<BlockHandlePositionerProps>;
|
|
19
196
|
//#endregion
|
|
20
|
-
//#region src/components/block-handle/block-handle-
|
|
197
|
+
//#region src/components/block-handle/block-handle-root.gen.d.ts
|
|
198
|
+
/**
|
|
199
|
+
* Props for the {@link BlockHandleRoot} Solid component.
|
|
200
|
+
*
|
|
201
|
+
* @public
|
|
202
|
+
*/
|
|
203
|
+
interface BlockHandleRootProps extends JSX.HTMLAttributes<BlockHandleRootElement> {
|
|
204
|
+
/**
|
|
205
|
+
* The ProseKit editor instance.
|
|
206
|
+
*
|
|
207
|
+
* @default null
|
|
208
|
+
* @hidden
|
|
209
|
+
*/
|
|
210
|
+
editor?: BlockHandleRootProps$1['editor'];
|
|
211
|
+
/** Fired when the hovered block changes. */
|
|
212
|
+
onStateChange?: (event: BlockHandleRootEvents['stateChange']) => void;
|
|
213
|
+
}
|
|
21
214
|
/**
|
|
22
|
-
*
|
|
215
|
+
* A Solid component that renders an `prosekit-block-handle-root` custom element.
|
|
216
|
+
*
|
|
217
|
+
* @public
|
|
23
218
|
*/
|
|
24
|
-
|
|
25
|
-
declare const BlockHandlePopover: Component<PropsWithElement<BlockHandlePopoverProps, BlockHandlePopoverElement>>;
|
|
219
|
+
declare const BlockHandleRoot: Component<BlockHandleRootProps>;
|
|
26
220
|
//#endregion
|
|
27
|
-
export { BlockHandleAdd, type BlockHandleAddProps, BlockHandleDraggable, type BlockHandleDraggableProps,
|
|
221
|
+
export { BlockHandleAdd, type BlockHandleAddProps, BlockHandleDraggable, type BlockHandleDraggableProps, BlockHandlePopup, type BlockHandlePopupProps, BlockHandlePositioner, type BlockHandlePositionerProps, BlockHandleRoot, type BlockHandleRootEvents, type BlockHandleRootProps, BlockHandleStateChangeEvent };
|
|
28
222
|
//# sourceMappingURL=prosekit-solid-block-handle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-block-handle.d.ts","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-
|
|
1
|
+
{"version":3,"file":"prosekit-solid-block-handle.d.ts","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popup.gen.ts","../src/components/block-handle/block-handle-positioner.gen.ts","../src/components/block-handle/block-handle-root.gen.ts"],"mappings":";;;;;;;;;UAgBiB,mBAAA,SAA4B,GAAA,CAAI,cAAA,CAAe,qBAAA;EAAD;;;;;;EAO7D,MAAA,GAAS,qBAAA;AAAA;AAQX;;;;;AAAA,cAAa,cAAA,EAAgB,SAAA,CAAU,mBAAA;;;;;;;;UCftB,yBAAA,SAAkC,GAAA,CAAI,cAAA,CAAe,2BAAA;EDAP;;;;;;ECO7D,MAAA,GAAS,2BAAA;AAAA;ADQX;;;;;AAAA,cCAa,oBAAA,EAAsB,SAAA,CAAU,yBAAA;;;;;;;;UClB5B,qBAAA,SAA8B,GAAA,CAAI,cAAA,CAAe,uBAAA;;;;;;cAOrD,gBAAA,EAAkB,SAAA,CAAU,qBAAA;;;;;;;;UCNxB,0BAAA,SAAmC,GAAA,CAAI,cAAA,CAAe,4BAAA;EHER;;;;;EGI7D,SAAA,GAAY,4BAAA;EHGuB;;AAQrC;;;;EGJE,KAAA,GAAQ,4BAAA;;;;AFXV;EEgBE,IAAA,GAAO,4BAAA;;;;;EAKP,KAAA,GAAQ,4BAAA;EFrB2D;;;;EE0BnE,IAAA,GAAO,4BAAA;EFnBE;;;AAQX;;EEiBE,QAAA,GAAW,4BAAA;EFjBsB;;;;;AClBnC;;EC2CE,UAAA,GAAa,4BAAA;ED3CkD;;;;;ECiD/D,MAAA,GAAS,4BAAA;ED1CE;;;;;;ECiDX,OAAA,GAAU,4BAAA;;AAvDZ;;;;;EA8DE,WAAA,GAAc,4BAAA;EA5CP;;;;;;EAmDP,SAAA,GAAY,4BAAA;EAPE;;;;;;EAcd,UAAA,GAAa,4BAAA;EAoCI;;;;;;EA7BjB,MAAA,GAAS,4BAAA;EAnF4D;;;;;;EA0FrE,QAAA,GAAW,4BAAA;EAnEX;;;;;;EA0EA,YAAA,GAAe,4BAAA;EAvDF;;;;;;EA8Db,eAAA,GAAkB,4BAAA;EAnClB;;;;;;;EA2CA,cAAA,GAAiB,4BAAA;EAfjB;;;;;;;EAuBA,WAAA,GAAc,4BAAA;AAAA;;AAQhB;;;;cAAa,qBAAA,EAAuB,SAAA,CAAU,0BAAA;;;;;;;;UC9H7B,oBAAA,SAA6B,GAAA,CAAI,cAAA,CAAe,sBAAA;EJAF;;;;;;EIO7D,MAAA,GAAS,sBAAA;EJA0B;EIEnC,aAAA,IAAiB,KAAA,EAAO,qBAAA;AAAA;;;;;;cAQb,eAAA,EAAiB,SAAA,CAAU,oBAAA"}
|
|
@@ -1,14 +1,167 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as useEditorContext } from "./editor-context.js";
|
|
2
|
+
import { createEffect, createSignal, mergeProps, splitProps } from "solid-js";
|
|
3
|
+
import h from "solid-js/h";
|
|
4
|
+
import { BlockHandleStateChangeEvent, registerBlockHandleAddElement, registerBlockHandleDraggableElement, registerBlockHandlePopupElement, registerBlockHandlePositionerElement, registerBlockHandleRootElement } from "@prosekit/web/block-handle";
|
|
3
5
|
//#region src/components/block-handle/block-handle-add.gen.ts
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A Solid component that renders an `prosekit-block-handle-add` custom element.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
const BlockHandleAdd = (props) => {
|
|
15
|
+
registerBlockHandleAddElement();
|
|
16
|
+
const [getElement, setElement] = createSignal(null);
|
|
17
|
+
const [elementProps, restProps] = splitProps(props, ["editor"]);
|
|
18
|
+
const p0Fallback = useEditorContext();
|
|
19
|
+
createEffect(() => {
|
|
20
|
+
const element = getElement();
|
|
21
|
+
if (!element) return;
|
|
22
|
+
Object.assign(element, { editor: elementProps.editor ?? p0Fallback });
|
|
23
|
+
});
|
|
24
|
+
return () => h("prosekit-block-handle-add", mergeProps(restProps, { ref: (el) => {
|
|
25
|
+
setElement(el);
|
|
26
|
+
} }));
|
|
27
|
+
};
|
|
5
28
|
//#endregion
|
|
6
29
|
//#region src/components/block-handle/block-handle-draggable.gen.ts
|
|
7
|
-
|
|
30
|
+
/**
|
|
31
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* A Solid component that renders an `prosekit-block-handle-draggable` custom element.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
const BlockHandleDraggable = (props) => {
|
|
39
|
+
registerBlockHandleDraggableElement();
|
|
40
|
+
const [getElement, setElement] = createSignal(null);
|
|
41
|
+
const [elementProps, restProps] = splitProps(props, ["editor"]);
|
|
42
|
+
const p0Fallback = useEditorContext();
|
|
43
|
+
createEffect(() => {
|
|
44
|
+
const element = getElement();
|
|
45
|
+
if (!element) return;
|
|
46
|
+
Object.assign(element, { editor: elementProps.editor ?? p0Fallback });
|
|
47
|
+
});
|
|
48
|
+
return () => h("prosekit-block-handle-draggable", mergeProps(restProps, { ref: (el) => {
|
|
49
|
+
setElement(el);
|
|
50
|
+
} }));
|
|
51
|
+
};
|
|
8
52
|
//#endregion
|
|
9
|
-
//#region src/components/block-handle/block-handle-
|
|
10
|
-
|
|
53
|
+
//#region src/components/block-handle/block-handle-popup.gen.ts
|
|
54
|
+
/**
|
|
55
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* A Solid component that renders an `prosekit-block-handle-popup` custom element.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
const BlockHandlePopup = (props) => {
|
|
63
|
+
registerBlockHandlePopupElement();
|
|
64
|
+
const restProps = props;
|
|
65
|
+
return () => h("prosekit-block-handle-popup", restProps);
|
|
66
|
+
};
|
|
11
67
|
//#endregion
|
|
12
|
-
|
|
68
|
+
//#region src/components/block-handle/block-handle-positioner.gen.ts
|
|
69
|
+
/**
|
|
70
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
71
|
+
*/
|
|
72
|
+
/**
|
|
73
|
+
* A Solid component that renders an `prosekit-block-handle-positioner` custom element.
|
|
74
|
+
*
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
const BlockHandlePositioner = (props) => {
|
|
78
|
+
registerBlockHandlePositionerElement();
|
|
79
|
+
const [getElement, setElement] = createSignal(null);
|
|
80
|
+
const [elementProps, restProps] = splitProps(props, [
|
|
81
|
+
"altBoundary",
|
|
82
|
+
"autoUpdate",
|
|
83
|
+
"boundary",
|
|
84
|
+
"elementContext",
|
|
85
|
+
"fitViewport",
|
|
86
|
+
"flip",
|
|
87
|
+
"hide",
|
|
88
|
+
"hoist",
|
|
89
|
+
"inline",
|
|
90
|
+
"offset",
|
|
91
|
+
"overflowPadding",
|
|
92
|
+
"overlap",
|
|
93
|
+
"placement",
|
|
94
|
+
"rootBoundary",
|
|
95
|
+
"sameHeight",
|
|
96
|
+
"sameWidth",
|
|
97
|
+
"shift",
|
|
98
|
+
"strategy"
|
|
99
|
+
]);
|
|
100
|
+
createEffect(() => {
|
|
101
|
+
const element = getElement();
|
|
102
|
+
if (!element) return;
|
|
103
|
+
Object.assign(element, {
|
|
104
|
+
altBoundary: elementProps.altBoundary,
|
|
105
|
+
autoUpdate: elementProps.autoUpdate,
|
|
106
|
+
boundary: elementProps.boundary,
|
|
107
|
+
elementContext: elementProps.elementContext,
|
|
108
|
+
fitViewport: elementProps.fitViewport,
|
|
109
|
+
flip: elementProps.flip,
|
|
110
|
+
hide: elementProps.hide,
|
|
111
|
+
hoist: elementProps.hoist,
|
|
112
|
+
inline: elementProps.inline,
|
|
113
|
+
offset: elementProps.offset,
|
|
114
|
+
overflowPadding: elementProps.overflowPadding,
|
|
115
|
+
overlap: elementProps.overlap,
|
|
116
|
+
placement: elementProps.placement,
|
|
117
|
+
rootBoundary: elementProps.rootBoundary,
|
|
118
|
+
sameHeight: elementProps.sameHeight,
|
|
119
|
+
sameWidth: elementProps.sameWidth,
|
|
120
|
+
shift: elementProps.shift,
|
|
121
|
+
strategy: elementProps.strategy
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
return () => h("prosekit-block-handle-positioner", mergeProps(restProps, { ref: (el) => {
|
|
125
|
+
setElement(el);
|
|
126
|
+
} }));
|
|
127
|
+
};
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/components/block-handle/block-handle-root.gen.ts
|
|
130
|
+
/**
|
|
131
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
132
|
+
*/
|
|
133
|
+
/**
|
|
134
|
+
* A Solid component that renders an `prosekit-block-handle-root` custom element.
|
|
135
|
+
*
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
const BlockHandleRoot = (props) => {
|
|
139
|
+
registerBlockHandleRootElement();
|
|
140
|
+
const [getElement, setElement] = createSignal(null);
|
|
141
|
+
const handlers = [];
|
|
142
|
+
const [elementProps, eventHandlers, restProps] = splitProps(props, ["editor"], ["onStateChange"]);
|
|
143
|
+
const p0Fallback = useEditorContext();
|
|
144
|
+
createEffect(() => {
|
|
145
|
+
const element = getElement();
|
|
146
|
+
if (!element) return;
|
|
147
|
+
Object.assign(element, { editor: elementProps.editor ?? p0Fallback });
|
|
148
|
+
handlers.length = 0;
|
|
149
|
+
handlers.push(eventHandlers.onStateChange);
|
|
150
|
+
});
|
|
151
|
+
createEffect(() => {
|
|
152
|
+
const element = getElement();
|
|
153
|
+
if (!element) return;
|
|
154
|
+
const ac = new AbortController();
|
|
155
|
+
for (const [index, eventName] of ["stateChange"].entries()) element.addEventListener(eventName, (event) => {
|
|
156
|
+
handlers[index]?.(event);
|
|
157
|
+
}, { signal: ac.signal });
|
|
158
|
+
return () => ac.abort();
|
|
159
|
+
});
|
|
160
|
+
return () => h("prosekit-block-handle-root", mergeProps(restProps, { ref: (el) => {
|
|
161
|
+
setElement(el);
|
|
162
|
+
} }));
|
|
163
|
+
};
|
|
164
|
+
//#endregion
|
|
165
|
+
export { BlockHandleAdd, BlockHandleDraggable, BlockHandlePopup, BlockHandlePositioner, BlockHandleRoot, BlockHandleStateChangeEvent };
|
|
13
166
|
|
|
14
167
|
//# sourceMappingURL=prosekit-solid-block-handle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-block-handle.js","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popover.gen.ts"],"sourcesContent":["import { \n type BlockHandleAddElement,\n type BlockHandleAddProps as Props,\n type BlockHandleAddEvents as Events,\n blockHandleAddProps,\n blockHandleAddEvents,\n} from '@prosekit/web/block-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types.ts'\nimport { createComponent } from '../create-component.ts'\nimport type { CreateProps } from '../create-props.ts'\n\n/**\n * Props for the {@link BlockHandleAdd} component.\n */\nexport interface BlockHandleAddProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const BlockHandleAdd: Component<PropsWithElement<\n BlockHandleAddProps,\n BlockHandleAddElement\n>> = createComponent<\n BlockHandleAddProps,\n BlockHandleAddElement\n>(\n 'prosekit-block-handle-add', \n Object.keys(blockHandleAddProps),\n Object.keys(blockHandleAddEvents),\n)\n","import { \n type BlockHandleDraggableElement,\n type BlockHandleDraggableProps as Props,\n type BlockHandleDraggableEvents as Events,\n blockHandleDraggableProps,\n blockHandleDraggableEvents,\n} from '@prosekit/web/block-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types.ts'\nimport { createComponent } from '../create-component.ts'\nimport type { CreateProps } from '../create-props.ts'\n\n/**\n * Props for the {@link BlockHandleDraggable} component.\n */\nexport interface BlockHandleDraggableProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const BlockHandleDraggable: Component<PropsWithElement<\n BlockHandleDraggableProps,\n BlockHandleDraggableElement\n>> = createComponent<\n BlockHandleDraggableProps,\n BlockHandleDraggableElement\n>(\n 'prosekit-block-handle-draggable', \n Object.keys(blockHandleDraggableProps),\n Object.keys(blockHandleDraggableEvents),\n)\n","import { \n type BlockHandlePopoverElement,\n type BlockHandlePopoverProps as Props,\n type BlockHandlePopoverEvents as Events,\n blockHandlePopoverProps,\n blockHandlePopoverEvents,\n} from '@prosekit/web/block-handle'\nimport type { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types.ts'\nimport { createComponent } from '../create-component.ts'\nimport type { CreateProps } from '../create-props.ts'\n\n/**\n * Props for the {@link BlockHandlePopover} component.\n */\nexport interface BlockHandlePopoverProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const BlockHandlePopover: Component<PropsWithElement<\n BlockHandlePopoverProps,\n BlockHandlePopoverElement\n>> = createComponent<\n BlockHandlePopoverProps,\n BlockHandlePopoverElement\n>(\n 'prosekit-block-handle-popover', \n Object.keys(blockHandlePopoverProps),\n Object.keys(blockHandlePopoverEvents),\n)\n"],"mappings":";;;AAkBA,MAAa,iBAGR,gBAIH,6BACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC;;;ACVD,MAAa,uBAGR,gBAIH,mCACA,OAAO,KAAK,0BAA0B,EACtC,OAAO,KAAK,2BAA2B,CACxC;;;ACVD,MAAa,qBAGR,gBAIH,iCACA,OAAO,KAAK,wBAAwB,EACpC,OAAO,KAAK,yBAAyB,CACtC"}
|
|
1
|
+
{"version":3,"file":"prosekit-solid-block-handle.js","names":[],"sources":["../src/components/block-handle/block-handle-add.gen.ts","../src/components/block-handle/block-handle-draggable.gen.ts","../src/components/block-handle/block-handle-popup.gen.ts","../src/components/block-handle/block-handle-positioner.gen.ts","../src/components/block-handle/block-handle-root.gen.ts"],"sourcesContent":["/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerBlockHandleAddElement, type BlockHandleAddElement, type BlockHandleAddProps as BlockHandleAddElementProps } from '@prosekit/web/block-handle';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/**\n * Props for the {@link BlockHandleAdd} Solid component.\n *\n * @public\n */\nexport interface BlockHandleAddProps extends JSX.HTMLAttributes<BlockHandleAddElement> {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleAddElementProps['editor'];\n}\n\n/**\n * A Solid component that renders an `prosekit-block-handle-add` custom element.\n *\n * @public\n */\nexport const BlockHandleAdd: Component<BlockHandleAddProps> = (props): any => {\n registerBlockHandleAddElement();\n\n const [getElement, setElement] = createSignal<BlockHandleAddElement | null>(null);\n\n const [elementProps, restProps] = splitProps(props, ['editor']);\n\n const p0Fallback = useEditorContext();\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, { editor: elementProps.editor ?? p0Fallback });\n });\n\n return () =>\n h(\n 'prosekit-block-handle-add',\n mergeProps(restProps, {\n ref: (el: BlockHandleAddElement | null) => {\n setElement(el);\n },\n }),\n );\n};\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerBlockHandleDraggableElement, type BlockHandleDraggableElement, type BlockHandleDraggableProps as BlockHandleDraggableElementProps } from '@prosekit/web/block-handle';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/**\n * Props for the {@link BlockHandleDraggable} Solid component.\n *\n * @public\n */\nexport interface BlockHandleDraggableProps extends JSX.HTMLAttributes<BlockHandleDraggableElement> {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleDraggableElementProps['editor'];\n}\n\n/**\n * A Solid component that renders an `prosekit-block-handle-draggable` custom element.\n *\n * @public\n */\nexport const BlockHandleDraggable: Component<BlockHandleDraggableProps> = (props): any => {\n registerBlockHandleDraggableElement();\n\n const [getElement, setElement] = createSignal<BlockHandleDraggableElement | null>(null);\n\n const [elementProps, restProps] = splitProps(props, ['editor']);\n\n const p0Fallback = useEditorContext();\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, { editor: elementProps.editor ?? p0Fallback });\n });\n\n return () =>\n h(\n 'prosekit-block-handle-draggable',\n mergeProps(restProps, {\n ref: (el: BlockHandleDraggableElement | null) => {\n setElement(el);\n },\n }),\n );\n};\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerBlockHandlePopupElement, type BlockHandlePopupElement } from '@prosekit/web/block-handle';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link BlockHandlePopup} Solid component.\n *\n * @public\n */\nexport interface BlockHandlePopupProps extends JSX.HTMLAttributes<BlockHandlePopupElement> {}\n\n/**\n * A Solid component that renders an `prosekit-block-handle-popup` custom element.\n *\n * @public\n */\nexport const BlockHandlePopup: Component<BlockHandlePopupProps> = (props): any => {\n registerBlockHandlePopupElement();\n\n const restProps = props;\n\n return () => h('prosekit-block-handle-popup', restProps);\n};\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerBlockHandlePositionerElement, type BlockHandlePositionerElement, type BlockHandlePositionerProps as BlockHandlePositionerElementProps } from '@prosekit/web/block-handle';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link BlockHandlePositioner} Solid component.\n *\n * @public\n */\nexport interface BlockHandlePositionerProps extends JSX.HTMLAttributes<BlockHandlePositionerElement> {\n /**\n * The placement of the popover, relative to the hovered block.\n *\n * @default \"left\"\n */\n placement?: BlockHandlePositionerElementProps['placement'];\n /**\n * Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)\n * to place the floating element on top of other page content.\n *\n * @default false\n */\n hoist?: BlockHandlePositionerElementProps['hoist'];\n /**\n * @default false\n * @hidden\n */\n flip?: BlockHandlePositionerElementProps['flip'];\n /**\n * @default false\n * @hidden\n */\n shift?: BlockHandlePositionerElementProps['shift'];\n /**\n * @default true\n * @hidden\n */\n hide?: BlockHandlePositionerElementProps['hide'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: BlockHandlePositionerElementProps['strategy'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: BlockHandlePositionerElementProps['autoUpdate'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: BlockHandlePositionerElementProps['offset'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default false\n */\n overlap?: BlockHandlePositionerElementProps['overlap'];\n /**\n * Whether to constrain the floating element's width and height to not exceed\n * the viewport.\n *\n * @default false\n */\n fitViewport?: BlockHandlePositionerElementProps['fitViewport'];\n /**\n * Whether to constrain the floating element's width so that it matches the\n * reference element.\n *\n * @default false\n */\n sameWidth?: BlockHandlePositionerElementProps['sameWidth'];\n /**\n * Whether to constrain the floating element's height so that it matches the\n * reference element.\n *\n * @default false\n */\n sameHeight?: BlockHandlePositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: BlockHandlePositionerElementProps['inline'];\n /**\n * Describes the clipping element(s) or area that overflow will be checked relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.\n *\n * @default 'clippingAncestors'\n */\n boundary?: BlockHandlePositionerElementProps['boundary'];\n /**\n * Describes the root boundary that the element will be checked for overflow relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.\n *\n * @default 'viewport'\n */\n rootBoundary?: BlockHandlePositionerElementProps['rootBoundary'];\n /**\n * Describes the virtual padding around the boundary to check for overflow.\n * Please see https://floating-ui.com/docs/detectoverflow#padding for more information.\n *\n * @default 4\n */\n overflowPadding?: BlockHandlePositionerElementProps['overflowPadding'];\n /**\n * The element that will be used to check for overflow. Please see\n * https://floating-ui.com/docs/detectoverflow#elementcontext for more\n * information.\n *\n * @default 'floating'\n */\n elementContext?: BlockHandlePositionerElementProps['elementContext'];\n /**\n * Whether to check the alternate elementContext's boundary. Please see\n * https://floating-ui.com/docs/detectoverflow#altboundary for more\n * information.\n *\n * @default false\n */\n altBoundary?: BlockHandlePositionerElementProps['altBoundary'];\n}\n\n/**\n * A Solid component that renders an `prosekit-block-handle-positioner` custom element.\n *\n * @public\n */\nexport const BlockHandlePositioner: Component<BlockHandlePositionerProps> = (props): any => {\n registerBlockHandlePositionerElement();\n\n const [getElement, setElement] = createSignal<BlockHandlePositionerElement | null>(null);\n\n const [elementProps, restProps] = splitProps(props, ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy']);\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, {\n altBoundary: elementProps.altBoundary,\n autoUpdate: elementProps.autoUpdate,\n boundary: elementProps.boundary,\n elementContext: elementProps.elementContext,\n fitViewport: elementProps.fitViewport,\n flip: elementProps.flip,\n hide: elementProps.hide,\n hoist: elementProps.hoist,\n inline: elementProps.inline,\n offset: elementProps.offset,\n overflowPadding: elementProps.overflowPadding,\n overlap: elementProps.overlap,\n placement: elementProps.placement,\n rootBoundary: elementProps.rootBoundary,\n sameHeight: elementProps.sameHeight,\n sameWidth: elementProps.sameWidth,\n shift: elementProps.shift,\n strategy: elementProps.strategy,\n });\n });\n\n return () =>\n h(\n 'prosekit-block-handle-positioner',\n mergeProps(restProps, {\n ref: (el: BlockHandlePositionerElement | null) => {\n setElement(el);\n },\n }),\n );\n};\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerBlockHandleRootElement, type BlockHandleRootElement, type BlockHandleRootEvents, type BlockHandleRootProps as BlockHandleRootElementProps } from '@prosekit/web/block-handle';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/**\n * Props for the {@link BlockHandleRoot} Solid component.\n *\n * @public\n */\nexport interface BlockHandleRootProps extends JSX.HTMLAttributes<BlockHandleRootElement> {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: BlockHandleRootElementProps['editor'];\n /** Fired when the hovered block changes. */\n onStateChange?: (event: BlockHandleRootEvents['stateChange']) => void;\n}\n\n/**\n * A Solid component that renders an `prosekit-block-handle-root` custom element.\n *\n * @public\n */\nexport const BlockHandleRoot: Component<BlockHandleRootProps> = (props): any => {\n registerBlockHandleRootElement();\n\n const [getElement, setElement] = createSignal<BlockHandleRootElement | null>(null);\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n const [elementProps, eventHandlers, restProps] = splitProps(props, ['editor'], ['onStateChange']);\n\n const p0Fallback = useEditorContext();\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, { editor: elementProps.editor ?? p0Fallback });\n\n handlers.length = 0;\n handlers.push(eventHandlers.onStateChange);\n });\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['stateChange'].entries()) {\n element.addEventListener(\n eventName,\n (event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () =>\n h(\n 'prosekit-block-handle-root',\n mergeProps(restProps, {\n ref: (el: BlockHandleRootElement | null) => {\n setElement(el);\n },\n }),\n );\n};\n\nexport type { BlockHandleRootEvents };\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAa,kBAAkD,UAAe;AAC5E,gCAA+B;CAE/B,MAAM,CAAC,YAAY,cAAc,aAA2C,KAAK;CAEjF,MAAM,CAAC,cAAc,aAAa,WAAW,OAAO,CAAC,SAAS,CAAC;CAE/D,MAAM,aAAa,kBAAkB;AAErC,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS,EAAE,QAAQ,aAAa,UAAU,YAAY,CAAC;GACrE;AAEF,cACE,EACE,6BACA,WAAW,WAAW,EACpB,MAAM,OAAqC;AACzC,aAAW,GAAG;IAEjB,CAAC,CACH;;;;;;;;;;;;ACxBL,MAAa,wBAA8D,UAAe;AACxF,sCAAqC;CAErC,MAAM,CAAC,YAAY,cAAc,aAAiD,KAAK;CAEvF,MAAM,CAAC,cAAc,aAAa,WAAW,OAAO,CAAC,SAAS,CAAC;CAE/D,MAAM,aAAa,kBAAkB;AAErC,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS,EAAE,QAAQ,aAAa,UAAU,YAAY,CAAC;GACrE;AAEF,cACE,EACE,mCACA,WAAW,WAAW,EACpB,MAAM,OAA2C;AAC/C,aAAW,GAAG;IAEjB,CAAC,CACH;;;;;;;;;;;;ACnCL,MAAa,oBAAsD,UAAe;AAChF,kCAAiC;CAEjC,MAAM,YAAY;AAElB,cAAa,EAAE,+BAA+B,UAAU;;;;;;;;;;;;ACqH1D,MAAa,yBAAgE,UAAe;AAC1F,uCAAsC;CAEtC,MAAM,CAAC,YAAY,cAAc,aAAkD,KAAK;CAExF,MAAM,CAAC,cAAc,aAAa,WAAW,OAAO;EAAC;EAAe;EAAc;EAAY;EAAkB;EAAe;EAAQ;EAAQ;EAAS;EAAU;EAAU;EAAmB;EAAW;EAAa;EAAgB;EAAc;EAAa;EAAS;EAAW,CAAC;AAEvR,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS;GACrB,aAAa,aAAa;GAC1B,YAAY,aAAa;GACzB,UAAU,aAAa;GACvB,gBAAgB,aAAa;GAC7B,aAAa,aAAa;GAC1B,MAAM,aAAa;GACnB,MAAM,aAAa;GACnB,OAAO,aAAa;GACpB,QAAQ,aAAa;GACrB,QAAQ,aAAa;GACrB,iBAAiB,aAAa;GAC9B,SAAS,aAAa;GACtB,WAAW,aAAa;GACxB,cAAc,aAAa;GAC3B,YAAY,aAAa;GACzB,WAAW,aAAa;GACxB,OAAO,aAAa;GACpB,UAAU,aAAa;GACxB,CAAC;GACF;AAEF,cACE,EACE,oCACA,WAAW,WAAW,EACpB,MAAM,OAA4C;AAChD,aAAW,GAAG;IAEjB,CAAC,CACH;;;;;;;;;;;;ACtJL,MAAa,mBAAoD,UAAe;AAC9E,iCAAgC;CAEhC,MAAM,CAAC,YAAY,cAAc,aAA4C,KAAK;CAClF,MAAM,WAAsD,EAAE;CAE9D,MAAM,CAAC,cAAc,eAAe,aAAa,WAAW,OAAO,CAAC,SAAS,EAAE,CAAC,gBAAgB,CAAC;CAEjG,MAAM,aAAa,kBAAkB;AAErC,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS,EAAE,QAAQ,aAAa,UAAU,YAAY,CAAC;AAErE,WAAS,SAAS;AAClB,WAAS,KAAK,cAAc,cAAc;GAC1C;AAEF,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;EAEd,MAAM,KAAK,IAAI,iBAAiB;AAChC,OAAK,MAAM,CAAC,OAAO,cAAc,CAAC,cAAc,CAAC,SAAS,CACxD,SAAQ,iBACN,YACC,UAAU;AACT,YAAS,SAAS,MAAM;KAE1B,EAAE,QAAQ,GAAG,QAAQ,CACtB;AAEH,eAAa,GAAG,OAAO;GACvB;AAEF,cACE,EACE,8BACA,WAAW,WAAW,EACpB,MAAM,OAAsC;AAC1C,aAAW,GAAG;IAEjB,CAAC,CACH"}
|
|
@@ -1,14 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Component } from "solid-js";
|
|
4
|
-
import { DropIndicatorElement, DropIndicatorEvents, DropIndicatorProps as DropIndicatorProps$1 } from "@prosekit/web/drop-indicator";
|
|
1
|
+
import { Component, JSX } from "solid-js";
|
|
2
|
+
import { DropIndicatorElement, DropIndicatorProps as DropIndicatorProps$1 } from "@prosekit/web/drop-indicator";
|
|
5
3
|
|
|
6
4
|
//#region src/components/drop-indicator/drop-indicator.gen.d.ts
|
|
7
5
|
/**
|
|
8
|
-
* Props for the {@link DropIndicator} component.
|
|
6
|
+
* Props for the {@link DropIndicator} Solid component.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
9
|
*/
|
|
10
|
-
interface DropIndicatorProps extends
|
|
11
|
-
|
|
10
|
+
interface DropIndicatorProps extends JSX.HTMLAttributes<DropIndicatorElement> {
|
|
11
|
+
/**
|
|
12
|
+
* The ProseKit editor instance.
|
|
13
|
+
*
|
|
14
|
+
* @default null
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
|
+
editor?: DropIndicatorProps$1['editor'];
|
|
18
|
+
/**
|
|
19
|
+
* The line width in pixels.
|
|
20
|
+
*
|
|
21
|
+
* @default 2
|
|
22
|
+
*/
|
|
23
|
+
width?: DropIndicatorProps$1['width'];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A Solid component that renders an `prosekit-drop-indicator` custom element.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
declare const DropIndicator: Component<DropIndicatorProps>;
|
|
12
31
|
//#endregion
|
|
13
32
|
export { DropIndicator, type DropIndicatorProps };
|
|
14
33
|
//# sourceMappingURL=prosekit-solid-drop-indicator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prosekit-solid-drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"mappings":";;;;;;;;;UAgBiB,kBAAA,SAA2B,GAAA,CAAI,cAAA,CAAe,oBAAA;EAAD;;;;;;EAO5D,MAAA,GAAS,oBAAA;EAMT;;;;AAQF;EARE,KAAA,GAAQ,oBAAA;AAAA;;;;;;cAQG,aAAA,EAAe,SAAA,CAAU,kBAAA"}
|
|
@@ -1,7 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as useEditorContext } from "./editor-context.js";
|
|
2
|
+
import { createEffect, createSignal, mergeProps, splitProps } from "solid-js";
|
|
3
|
+
import h from "solid-js/h";
|
|
4
|
+
import { registerDropIndicatorElement } from "@prosekit/web/drop-indicator";
|
|
3
5
|
//#region src/components/drop-indicator/drop-indicator.gen.ts
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A Solid component that renders an `prosekit-drop-indicator` custom element.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
const DropIndicator = (props) => {
|
|
15
|
+
registerDropIndicatorElement();
|
|
16
|
+
const [getElement, setElement] = createSignal(null);
|
|
17
|
+
const [elementProps, restProps] = splitProps(props, ["editor", "width"]);
|
|
18
|
+
const p0Fallback = useEditorContext();
|
|
19
|
+
createEffect(() => {
|
|
20
|
+
const element = getElement();
|
|
21
|
+
if (!element) return;
|
|
22
|
+
Object.assign(element, {
|
|
23
|
+
editor: elementProps.editor ?? p0Fallback,
|
|
24
|
+
width: elementProps.width
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
return () => h("prosekit-drop-indicator", mergeProps(restProps, { ref: (el) => {
|
|
28
|
+
setElement(el);
|
|
29
|
+
} }));
|
|
30
|
+
};
|
|
5
31
|
//#endregion
|
|
6
32
|
export { DropIndicator };
|
|
7
33
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-drop-indicator.js","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"prosekit-solid-drop-indicator.js","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"sourcesContent":["/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerDropIndicatorElement, type DropIndicatorElement, type DropIndicatorProps as DropIndicatorElementProps } from '@prosekit/web/drop-indicator';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/**\n * Props for the {@link DropIndicator} Solid component.\n *\n * @public\n */\nexport interface DropIndicatorProps extends JSX.HTMLAttributes<DropIndicatorElement> {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: DropIndicatorElementProps['editor'];\n /**\n * The line width in pixels.\n *\n * @default 2\n */\n width?: DropIndicatorElementProps['width'];\n}\n\n/**\n * A Solid component that renders an `prosekit-drop-indicator` custom element.\n *\n * @public\n */\nexport const DropIndicator: Component<DropIndicatorProps> = (props): any => {\n registerDropIndicatorElement();\n\n const [getElement, setElement] = createSignal<DropIndicatorElement | null>(null);\n\n const [elementProps, restProps] = splitProps(props, ['editor', 'width']);\n\n const p0Fallback = useEditorContext();\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, { editor: elementProps.editor ?? p0Fallback, width: elementProps.width });\n });\n\n return () =>\n h(\n 'prosekit-drop-indicator',\n mergeProps(restProps, {\n ref: (el: DropIndicatorElement | null) => {\n setElement(el);\n },\n }),\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAqCA,MAAa,iBAAgD,UAAe;AAC1E,+BAA8B;CAE9B,MAAM,CAAC,YAAY,cAAc,aAA0C,KAAK;CAEhF,MAAM,CAAC,cAAc,aAAa,WAAW,OAAO,CAAC,UAAU,QAAQ,CAAC;CAExE,MAAM,aAAa,kBAAkB;AAErC,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS;GAAE,QAAQ,aAAa,UAAU;GAAY,OAAO,aAAa;GAAO,CAAC;GAChG;AAEF,cACE,EACE,2BACA,WAAW,WAAW,EACpB,MAAM,OAAoC;AACxC,aAAW,GAAG;IAEjB,CAAC,CACH"}
|