@prosekit/preact 0.6.8 → 0.7.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/prosekit-preact-autocomplete.d.ts +226 -18
- package/dist/prosekit-preact-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-preact-autocomplete.js +218 -9
- package/dist/prosekit-preact-autocomplete.js.map +1 -1
- package/dist/prosekit-preact-block-handle.d.ts +210 -14
- package/dist/prosekit-preact-block-handle.d.ts.map +1 -1
- package/dist/prosekit-preact-block-handle.js +184 -7
- package/dist/prosekit-preact-block-handle.js.map +1 -1
- package/dist/prosekit-preact-drop-indicator.d.ts +27 -6
- package/dist/prosekit-preact-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-preact-drop-indicator.js +38 -3
- package/dist/prosekit-preact-drop-indicator.js.map +1 -1
- package/dist/prosekit-preact-inline-popover.d.ts +204 -8
- package/dist/prosekit-preact-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-preact-inline-popover.js +130 -5
- package/dist/prosekit-preact-inline-popover.js.map +1 -1
- package/dist/prosekit-preact-menu.d.ts +288 -0
- package/dist/prosekit-preact-menu.d.ts.map +1 -0
- package/dist/prosekit-preact-menu.js +274 -0
- package/dist/prosekit-preact-menu.js.map +1 -0
- package/dist/prosekit-preact-popover.d.ts +227 -14
- package/dist/prosekit-preact-popover.d.ts.map +1 -1
- package/dist/prosekit-preact-popover.js +170 -7
- package/dist/prosekit-preact-popover.js.map +1 -1
- package/dist/prosekit-preact-resizable.d.ts +56 -12
- package/dist/prosekit-preact-resizable.d.ts.map +1 -1
- package/dist/prosekit-preact-resizable.js +80 -7
- package/dist/prosekit-preact-resizable.js.map +1 -1
- package/dist/prosekit-preact-table-handle.d.ts +447 -38
- package/dist/prosekit-preact-table-handle.d.ts.map +1 -1
- package/dist/prosekit-preact-table-handle.js +381 -19
- package/dist/prosekit-preact-table-handle.js.map +1 -1
- package/dist/prosekit-preact-tooltip.d.ts +211 -14
- package/dist/prosekit-preact-tooltip.d.ts.map +1 -1
- package/dist/prosekit-preact-tooltip.js +157 -7
- package/dist/prosekit-preact-tooltip.js.map +1 -1
- package/package.json +27 -16
- package/src/components/autocomplete/autocomplete-empty.gen.ts +41 -31
- package/src/components/autocomplete/autocomplete-item.gen.ts +84 -31
- package/src/components/autocomplete/autocomplete-popup.gen.ts +80 -0
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +153 -0
- package/src/components/autocomplete/autocomplete-root.gen.ts +109 -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 +59 -31
- package/src/components/block-handle/block-handle-draggable.gen.ts +59 -31
- package/src/components/block-handle/block-handle-popup.gen.ts +44 -0
- package/src/components/block-handle/block-handle-positioner.gen.ts +171 -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 +65 -31
- 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 +44 -0
- package/src/components/inline-popover/inline-popover-positioner.gen.ts +177 -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 +58 -0
- package/src/components/menu/menu-positioner.gen.ts +178 -0
- package/src/components/menu/menu-root.gen.ts +88 -0
- package/src/components/menu/menu-submenu-root.gen.ts +44 -0
- package/src/components/menu/menu-submenu-trigger.gen.ts +44 -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 +44 -0
- package/src/components/popover/popover-positioner.gen.ts +178 -0
- package/src/components/popover/popover-root.gen.ts +92 -31
- package/src/components/popover/popover-trigger.gen.ts +92 -31
- 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 +54 -31
- package/src/components/resizable/resizable-root.gen.ts +90 -31
- 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 +66 -0
- package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +60 -0
- package/src/components/table-handle/table-handle-column-popup.gen.ts +44 -0
- package/src/components/table-handle/table-handle-column-positioner.gen.ts +201 -0
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +57 -31
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +57 -31
- package/src/components/table-handle/table-handle-root.gen.ts +59 -31
- package/src/components/table-handle/table-handle-row-menu-root.gen.ts +66 -0
- package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +60 -0
- package/src/components/table-handle/table-handle-row-popup.gen.ts +44 -0
- package/src/components/table-handle/table-handle-row-positioner.gen.ts +201 -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 +44 -0
- package/src/components/tooltip/tooltip-positioner.gen.ts +178 -0
- package/src/components/tooltip/tooltip-root.gen.ts +85 -31
- package/src/components/tooltip/tooltip-trigger.gen.ts +63 -31
- package/src/extensions/preact-node-view.spec.ts +151 -0
- package/dist/create-component.js +0 -95
- 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/src/components/autocomplete/autocomplete-list.gen.ts +0 -34
- package/src/components/autocomplete/autocomplete-popover.gen.ts +0 -34
- package/src/components/block-handle/block-handle-popover.gen.ts +0 -34
- package/src/components/create-component.ts +0 -123
- package/src/components/create-props.ts +0 -13
- package/src/components/inline-popover/inline-popover.gen.ts +0 -34
- package/src/components/merge-refs.ts +0 -35
- package/src/components/popover/popover-content.gen.ts +0 -34
- package/src/components/table-handle/table-handle-column-root.gen.ts +0 -34
- package/src/components/table-handle/table-handle-column-trigger.gen.ts +0 -34
- package/src/components/table-handle/table-handle-popover-content.gen.ts +0 -34
- package/src/components/table-handle/table-handle-popover-item.gen.ts +0 -34
- package/src/components/table-handle/table-handle-row-root.gen.ts +0 -34
- package/src/components/table-handle/table-handle-row-trigger.gen.ts +0 -34
- package/src/components/tooltip/tooltip-content.gen.ts +0 -34
|
@@ -1,34 +1,242 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ForwardRefExoticComponent,
|
|
3
|
-
import { AutocompleteEmptyElement,
|
|
1
|
+
import { HTMLAttributes } from "preact";
|
|
2
|
+
import { ForwardRefExoticComponent, RefAttributes } from "preact/compat";
|
|
3
|
+
import { AutocompleteEmptyElement, AutocompleteItemElement, AutocompleteItemEvents, AutocompleteItemProps as AutocompleteItemProps$1, AutocompletePopupElement, AutocompletePopupEvents, AutocompletePositionerElement, AutocompletePositionerProps as AutocompletePositionerProps$1, AutocompleteRootElement, AutocompleteRootEvents, AutocompleteRootProps as AutocompleteRootProps$1, OpenChangeEvent, QueryChangeEvent, SelectEvent, ValueChangeEvent, ValuesChangeEvent } from "@prosekit/web/autocomplete";
|
|
4
4
|
|
|
5
5
|
//#region src/components/autocomplete/autocomplete-empty.gen.d.ts
|
|
6
6
|
/**
|
|
7
|
-
* Props for the {@link AutocompleteEmpty} component.
|
|
7
|
+
* Props for the {@link AutocompleteEmpty} Preact component.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
8
10
|
*/
|
|
9
|
-
interface AutocompleteEmptyProps extends
|
|
10
|
-
|
|
11
|
+
interface AutocompleteEmptyProps extends HTMLAttributes<AutocompleteEmptyElement> {}
|
|
12
|
+
/**
|
|
13
|
+
* A Preact component that renders an `prosekit-autocomplete-empty` custom element.
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
declare const AutocompleteEmpty: ForwardRefExoticComponent<AutocompleteEmptyProps & RefAttributes<AutocompleteEmptyElement>>;
|
|
11
18
|
//#endregion
|
|
12
19
|
//#region src/components/autocomplete/autocomplete-item.gen.d.ts
|
|
13
20
|
/**
|
|
14
|
-
* Props for the {@link AutocompleteItem} component.
|
|
21
|
+
* Props for the {@link AutocompleteItem} Preact component.
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
interface AutocompleteItemProps extends Omit<HTMLAttributes<AutocompleteItemElement>, 'onSelect'> {
|
|
26
|
+
/**
|
|
27
|
+
* The value of the item, which will be matched against the query.
|
|
28
|
+
*
|
|
29
|
+
* If not provided, the value is the item's text content.
|
|
30
|
+
*
|
|
31
|
+
* @default ""
|
|
32
|
+
*/
|
|
33
|
+
value?: AutocompleteItemProps$1['value'];
|
|
34
|
+
/**
|
|
35
|
+
* Whether this option is disabled.
|
|
36
|
+
*
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
disabled?: AutocompleteItemProps$1['disabled'];
|
|
40
|
+
/** Emitted when the the item is selected. */
|
|
41
|
+
onSelect?: (event: AutocompleteItemEvents['select']) => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A Preact component that renders an `prosekit-autocomplete-item` custom element.
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
15
47
|
*/
|
|
16
|
-
|
|
17
|
-
declare const AutocompleteItem: ForwardRefExoticComponent<Partial<AutocompleteItemProps> & RefAttributes<AutocompleteItemElement> & HTMLAttributes<AutocompleteItemElement>>;
|
|
48
|
+
declare const AutocompleteItem: ForwardRefExoticComponent<AutocompleteItemProps & RefAttributes<AutocompleteItemElement>>;
|
|
18
49
|
//#endregion
|
|
19
|
-
//#region src/components/autocomplete/autocomplete-
|
|
50
|
+
//#region src/components/autocomplete/autocomplete-popup.gen.d.ts
|
|
20
51
|
/**
|
|
21
|
-
* Props for the {@link
|
|
52
|
+
* Props for the {@link AutocompletePopup} Preact component.
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
22
55
|
*/
|
|
23
|
-
interface
|
|
24
|
-
|
|
56
|
+
interface AutocompletePopupProps extends HTMLAttributes<AutocompletePopupElement> {
|
|
57
|
+
/**
|
|
58
|
+
* Emitted when the selected value changes. Only available when multiple is
|
|
59
|
+
* false.
|
|
60
|
+
*/
|
|
61
|
+
onValueChange?: (event: AutocompletePopupEvents['valueChange']) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Emitted when the selected values change. Only available when multiple is
|
|
64
|
+
* true.
|
|
65
|
+
*/
|
|
66
|
+
onValuesChange?: (event: AutocompletePopupEvents['valuesChange']) => void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A Preact component that renders an `prosekit-autocomplete-popup` custom element.
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
declare const AutocompletePopup: ForwardRefExoticComponent<AutocompletePopupProps & RefAttributes<AutocompletePopupElement>>;
|
|
25
74
|
//#endregion
|
|
26
|
-
//#region src/components/autocomplete/autocomplete-
|
|
75
|
+
//#region src/components/autocomplete/autocomplete-positioner.gen.d.ts
|
|
76
|
+
/**
|
|
77
|
+
* Props for the {@link AutocompletePositioner} Preact component.
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
interface AutocompletePositionerProps extends HTMLAttributes<AutocompletePositionerElement> {
|
|
82
|
+
/**
|
|
83
|
+
* The placement of the popover, relative to the text cursor.
|
|
84
|
+
*
|
|
85
|
+
* @default "bottom-start"
|
|
86
|
+
*/
|
|
87
|
+
placement?: AutocompletePositionerProps$1['placement'];
|
|
88
|
+
/**
|
|
89
|
+
* The distance between the popover and the hovered block.
|
|
90
|
+
*
|
|
91
|
+
* @default 4
|
|
92
|
+
*/
|
|
93
|
+
offset?: AutocompletePositionerProps$1['offset'];
|
|
94
|
+
/** @default true */
|
|
95
|
+
inline?: AutocompletePositionerProps$1['inline'];
|
|
96
|
+
/** @default true */
|
|
97
|
+
hoist?: AutocompletePositionerProps$1['hoist'];
|
|
98
|
+
/** @default true */
|
|
99
|
+
fitViewport?: AutocompletePositionerProps$1['fitViewport'];
|
|
100
|
+
/** @default "The body element" */
|
|
101
|
+
boundary?: AutocompletePositionerProps$1['boundary'];
|
|
102
|
+
/** @default 8 */
|
|
103
|
+
overflowPadding?: AutocompletePositionerProps$1['overflowPadding'];
|
|
104
|
+
/**
|
|
105
|
+
* The strategy to use for positioning
|
|
106
|
+
*
|
|
107
|
+
* @default "absolute"
|
|
108
|
+
*/
|
|
109
|
+
strategy?: AutocompletePositionerProps$1['strategy'];
|
|
110
|
+
/**
|
|
111
|
+
* Options to activate auto-update listeners
|
|
112
|
+
*
|
|
113
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
114
|
+
*
|
|
115
|
+
* @default true
|
|
116
|
+
*/
|
|
117
|
+
autoUpdate?: AutocompletePositionerProps$1['autoUpdate'];
|
|
118
|
+
/**
|
|
119
|
+
* Whether to flip the `placement` in order to keep it in view when the
|
|
120
|
+
* preferred placement(s) will overflow the clipping boundary. You can also
|
|
121
|
+
* provide an array of placements to try sequentially if the preferred
|
|
122
|
+
* `placement` does not fit.
|
|
123
|
+
*
|
|
124
|
+
* @default true
|
|
125
|
+
*/
|
|
126
|
+
flip?: AutocompletePositionerProps$1['flip'];
|
|
127
|
+
/**
|
|
128
|
+
* Whether the floating element should shift to keep it in view.
|
|
129
|
+
*
|
|
130
|
+
* @default true
|
|
131
|
+
*/
|
|
132
|
+
shift?: AutocompletePositionerProps$1['shift'];
|
|
133
|
+
/**
|
|
134
|
+
* Whether the floating element can overlap the reference element to keep it
|
|
135
|
+
* in view.
|
|
136
|
+
*
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
139
|
+
overlap?: AutocompletePositionerProps$1['overlap'];
|
|
140
|
+
/**
|
|
141
|
+
* Whether to constrain the floating element's width so that it matches the
|
|
142
|
+
* reference element.
|
|
143
|
+
*
|
|
144
|
+
* @default false
|
|
145
|
+
*/
|
|
146
|
+
sameWidth?: AutocompletePositionerProps$1['sameWidth'];
|
|
147
|
+
/**
|
|
148
|
+
* Whether to constrain the floating element's height so that it matches the
|
|
149
|
+
* reference element.
|
|
150
|
+
*
|
|
151
|
+
* @default false
|
|
152
|
+
*/
|
|
153
|
+
sameHeight?: AutocompletePositionerProps$1['sameHeight'];
|
|
154
|
+
/**
|
|
155
|
+
* Whether to hide the floating element when the reference element or the
|
|
156
|
+
* floating element is fully clipped.
|
|
157
|
+
*
|
|
158
|
+
* @default false
|
|
159
|
+
*/
|
|
160
|
+
hide?: AutocompletePositionerProps$1['hide'];
|
|
161
|
+
/**
|
|
162
|
+
* Describes the root boundary that the element will be checked for overflow relative to.
|
|
163
|
+
* Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
|
|
164
|
+
*
|
|
165
|
+
* @default 'viewport'
|
|
166
|
+
*/
|
|
167
|
+
rootBoundary?: AutocompletePositionerProps$1['rootBoundary'];
|
|
168
|
+
/**
|
|
169
|
+
* The element that will be used to check for overflow. Please see
|
|
170
|
+
* https://floating-ui.com/docs/detectoverflow#elementcontext for more
|
|
171
|
+
* information.
|
|
172
|
+
*
|
|
173
|
+
* @default 'floating'
|
|
174
|
+
*/
|
|
175
|
+
elementContext?: AutocompletePositionerProps$1['elementContext'];
|
|
176
|
+
/**
|
|
177
|
+
* Whether to check the alternate elementContext's boundary. Please see
|
|
178
|
+
* https://floating-ui.com/docs/detectoverflow#altboundary for more
|
|
179
|
+
* information.
|
|
180
|
+
*
|
|
181
|
+
* @default false
|
|
182
|
+
*/
|
|
183
|
+
altBoundary?: AutocompletePositionerProps$1['altBoundary'];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* A Preact component that renders an `prosekit-autocomplete-positioner` custom element.
|
|
187
|
+
*
|
|
188
|
+
* @public
|
|
189
|
+
*/
|
|
190
|
+
declare const AutocompletePositioner: ForwardRefExoticComponent<AutocompletePositionerProps & RefAttributes<AutocompletePositionerElement>>;
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/components/autocomplete/autocomplete-root.gen.d.ts
|
|
193
|
+
/**
|
|
194
|
+
* Props for the {@link AutocompleteRoot} Preact component.
|
|
195
|
+
*
|
|
196
|
+
* @public
|
|
197
|
+
*/
|
|
198
|
+
interface AutocompleteRootProps extends HTMLAttributes<AutocompleteRootElement> {
|
|
199
|
+
/**
|
|
200
|
+
* The ProseKit editor instance.
|
|
201
|
+
*
|
|
202
|
+
* @default null
|
|
203
|
+
* @hidden
|
|
204
|
+
*/
|
|
205
|
+
editor?: AutocompleteRootProps$1['editor'];
|
|
206
|
+
/**
|
|
207
|
+
* The regular expression to match the query text to autocomplete.
|
|
208
|
+
*
|
|
209
|
+
* @default null
|
|
210
|
+
*/
|
|
211
|
+
regex?: AutocompleteRootProps$1['regex'];
|
|
212
|
+
/**
|
|
213
|
+
* The filter function to determine if an item should be shown in the
|
|
214
|
+
* listbox.
|
|
215
|
+
*
|
|
216
|
+
* @default defaultItemFilter
|
|
217
|
+
*/
|
|
218
|
+
filter?: AutocompleteRootProps$1['filter'];
|
|
219
|
+
/** Fired when the open state changes. */
|
|
220
|
+
onOpenChange?: (event: AutocompleteRootEvents['openChange']) => void;
|
|
221
|
+
/** Fired when the query changes. */
|
|
222
|
+
onQueryChange?: (event: AutocompleteRootEvents['queryChange']) => void;
|
|
223
|
+
/**
|
|
224
|
+
* Emitted when the selected value changes. Only available when multiple is
|
|
225
|
+
* false.
|
|
226
|
+
*/
|
|
227
|
+
onValueChange?: (event: AutocompleteRootEvents['valueChange']) => void;
|
|
228
|
+
/**
|
|
229
|
+
* Emitted when the selected values change. Only available when multiple is
|
|
230
|
+
* true.
|
|
231
|
+
*/
|
|
232
|
+
onValuesChange?: (event: AutocompleteRootEvents['valuesChange']) => void;
|
|
233
|
+
}
|
|
27
234
|
/**
|
|
28
|
-
*
|
|
235
|
+
* A Preact component that renders an `prosekit-autocomplete-root` custom element.
|
|
236
|
+
*
|
|
237
|
+
* @public
|
|
29
238
|
*/
|
|
30
|
-
|
|
31
|
-
declare const AutocompletePopover: ForwardRefExoticComponent<Partial<AutocompletePopoverProps> & RefAttributes<AutocompletePopoverElement> & HTMLAttributes<AutocompletePopoverElement>>;
|
|
239
|
+
declare const AutocompleteRoot: ForwardRefExoticComponent<AutocompleteRootProps & RefAttributes<AutocompleteRootElement>>;
|
|
32
240
|
//#endregion
|
|
33
|
-
export { AutocompleteEmpty, type AutocompleteEmptyProps, AutocompleteItem, type AutocompleteItemProps,
|
|
241
|
+
export { AutocompleteEmpty, type AutocompleteEmptyProps, AutocompleteItem, type AutocompleteItemEvents, type AutocompleteItemProps, AutocompletePopup, type AutocompletePopupEvents, type AutocompletePopupProps, AutocompletePositioner, type AutocompletePositionerProps, AutocompleteRoot, type AutocompleteRootEvents, type AutocompleteRootProps, OpenChangeEvent, QueryChangeEvent, SelectEvent, ValueChangeEvent, ValuesChangeEvent };
|
|
34
242
|
//# sourceMappingURL=prosekit-preact-autocomplete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-preact-autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-
|
|
1
|
+
{"version":3,"file":"prosekit-preact-autocomplete.d.ts","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-root.gen.ts"],"mappings":";;;;;;;;;AA2CA;UA7BiB,sBAAA,SAA+B,cAAA,CAAe,wBAAA;;;;;;cA6BlD,iBAAA,EAAmB,yBAAA,CAA0B,sB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AA,GAAiB,6BAAA;EA9FF;;;;;;;EAsGf,WAAA,GAAc,6BAAA;AAAA;;;;;;cAoCH,sBAAA,EAAwB,yBAAA,CAA0B,2BAAA,GAA8B,aAAA,CAAc,6BAAA;;;;;;;AH7G3G;UI3BiB,qBAAA,SAA8B,cAAA,CAAe,uBAAA;;;;;;;EAO5D,MAAA,GAAS,uBAAA;EJoBqB;;;;;EId9B,KAAA,GAAQ,uBAAA;;;;AHfV;;;EGsBE,MAAA,GAAS,uBAAA;EHtByC;EGwBlD,YAAA,IAAgB,KAAA,EAAO,sBAAA;EHVZ;EGYX,aAAA,IAAiB,KAAA,EAAO,sBAAA;EH1BqB;;;;EG+B7C,aAAA,IAAiB,KAAA,EAAO,sBAAA;EH/ByC;;;;EGoCjE,cAAA,IAAkB,KAAA,EAAO,sBAAA;AAAA;;;;;AHkC3B;cGsBa,gBAAA,EAAkB,yBAAA,CAA0B,qBAAA,GAAwB,aAAA,CAAc,uBAAA"}
|
|
@@ -1,17 +1,226 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as useEditorContext } from "./editor-context.js";
|
|
2
|
+
import { createElement } from "preact";
|
|
3
|
+
import { useCallback, useLayoutEffect, useRef } from "preact/hooks";
|
|
4
|
+
import { forwardRef } from "preact/compat";
|
|
5
|
+
import { OpenChangeEvent, QueryChangeEvent, SelectEvent, ValueChangeEvent, ValuesChangeEvent, registerAutocompleteEmptyElement, registerAutocompleteItemElement, registerAutocompletePopupElement, registerAutocompletePositionerElement, registerAutocompleteRootElement } from "@prosekit/web/autocomplete";
|
|
3
6
|
//#region src/components/autocomplete/autocomplete-empty.gen.ts
|
|
4
|
-
|
|
7
|
+
/**
|
|
8
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
9
|
+
*/
|
|
10
|
+
function AutocompleteEmptyComponent(props, forwardedRef) {
|
|
11
|
+
registerAutocompleteEmptyElement();
|
|
12
|
+
const elementRef = useRef(null);
|
|
13
|
+
const { ...restProps } = props;
|
|
14
|
+
const mergedRef = useCallback((element) => {
|
|
15
|
+
elementRef.current = element;
|
|
16
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
17
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
18
|
+
}, [forwardedRef]);
|
|
19
|
+
return createElement("prosekit-autocomplete-empty", {
|
|
20
|
+
...restProps,
|
|
21
|
+
ref: mergedRef,
|
|
22
|
+
suppressHydrationWarning: true
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A Preact component that renders an `prosekit-autocomplete-empty` custom element.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
30
|
+
const AutocompleteEmpty = /* @__PURE__ */ forwardRef(AutocompleteEmptyComponent);
|
|
5
31
|
//#endregion
|
|
6
32
|
//#region src/components/autocomplete/autocomplete-item.gen.ts
|
|
7
|
-
|
|
33
|
+
/**
|
|
34
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
35
|
+
*/
|
|
36
|
+
function AutocompleteItemComponent(props, forwardedRef) {
|
|
37
|
+
registerAutocompleteItemElement();
|
|
38
|
+
const elementRef = useRef(null);
|
|
39
|
+
const handlersRef = useRef([]);
|
|
40
|
+
const { disabled: p0, value: p1, onSelect: e0, ...restProps } = props;
|
|
41
|
+
useLayoutEffect(() => {
|
|
42
|
+
const element = elementRef.current;
|
|
43
|
+
if (!element) return;
|
|
44
|
+
Object.assign(element, {
|
|
45
|
+
disabled: p0,
|
|
46
|
+
value: p1
|
|
47
|
+
});
|
|
48
|
+
handlersRef.current = [e0];
|
|
49
|
+
});
|
|
50
|
+
useLayoutEffect(() => {
|
|
51
|
+
const element = elementRef.current;
|
|
52
|
+
if (!element) return;
|
|
53
|
+
const ac = new AbortController();
|
|
54
|
+
for (const [index, eventName] of ["select"].entries()) element.addEventListener(eventName, (event) => {
|
|
55
|
+
handlersRef.current[index]?.(event);
|
|
56
|
+
}, { signal: ac.signal });
|
|
57
|
+
return () => ac.abort();
|
|
58
|
+
}, []);
|
|
59
|
+
const mergedRef = useCallback((element) => {
|
|
60
|
+
elementRef.current = element;
|
|
61
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
62
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
63
|
+
}, [forwardedRef]);
|
|
64
|
+
return createElement("prosekit-autocomplete-item", {
|
|
65
|
+
...restProps,
|
|
66
|
+
ref: mergedRef,
|
|
67
|
+
suppressHydrationWarning: true
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A Preact component that renders an `prosekit-autocomplete-item` custom element.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
const AutocompleteItem = /* @__PURE__ */ forwardRef(AutocompleteItemComponent);
|
|
8
76
|
//#endregion
|
|
9
|
-
//#region src/components/autocomplete/autocomplete-
|
|
10
|
-
|
|
77
|
+
//#region src/components/autocomplete/autocomplete-popup.gen.ts
|
|
78
|
+
/**
|
|
79
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
80
|
+
*/
|
|
81
|
+
function AutocompletePopupComponent(props, forwardedRef) {
|
|
82
|
+
registerAutocompletePopupElement();
|
|
83
|
+
const elementRef = useRef(null);
|
|
84
|
+
const handlersRef = useRef([]);
|
|
85
|
+
const { onValueChange: e0, onValuesChange: e1, ...restProps } = props;
|
|
86
|
+
useLayoutEffect(() => {
|
|
87
|
+
if (!elementRef.current) return;
|
|
88
|
+
handlersRef.current = [e0, e1];
|
|
89
|
+
});
|
|
90
|
+
useLayoutEffect(() => {
|
|
91
|
+
const element = elementRef.current;
|
|
92
|
+
if (!element) return;
|
|
93
|
+
const ac = new AbortController();
|
|
94
|
+
for (const [index, eventName] of ["valueChange", "valuesChange"].entries()) element.addEventListener(eventName, (event) => {
|
|
95
|
+
handlersRef.current[index]?.(event);
|
|
96
|
+
}, { signal: ac.signal });
|
|
97
|
+
return () => ac.abort();
|
|
98
|
+
}, []);
|
|
99
|
+
const mergedRef = useCallback((element) => {
|
|
100
|
+
elementRef.current = element;
|
|
101
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
102
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
103
|
+
}, [forwardedRef]);
|
|
104
|
+
return createElement("prosekit-autocomplete-popup", {
|
|
105
|
+
...restProps,
|
|
106
|
+
ref: mergedRef,
|
|
107
|
+
suppressHydrationWarning: true
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A Preact component that renders an `prosekit-autocomplete-popup` custom element.
|
|
112
|
+
*
|
|
113
|
+
* @public
|
|
114
|
+
*/
|
|
115
|
+
const AutocompletePopup = /* @__PURE__ */ forwardRef(AutocompletePopupComponent);
|
|
11
116
|
//#endregion
|
|
12
|
-
//#region src/components/autocomplete/autocomplete-
|
|
13
|
-
|
|
117
|
+
//#region src/components/autocomplete/autocomplete-positioner.gen.ts
|
|
118
|
+
/**
|
|
119
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
120
|
+
*/
|
|
121
|
+
function AutocompletePositionerComponent(props, forwardedRef) {
|
|
122
|
+
registerAutocompletePositionerElement();
|
|
123
|
+
const elementRef = useRef(null);
|
|
124
|
+
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;
|
|
125
|
+
useLayoutEffect(() => {
|
|
126
|
+
const element = elementRef.current;
|
|
127
|
+
if (!element) return;
|
|
128
|
+
Object.assign(element, {
|
|
129
|
+
altBoundary: p0,
|
|
130
|
+
autoUpdate: p1,
|
|
131
|
+
boundary: p2,
|
|
132
|
+
elementContext: p3,
|
|
133
|
+
fitViewport: p4,
|
|
134
|
+
flip: p5,
|
|
135
|
+
hide: p6,
|
|
136
|
+
hoist: p7,
|
|
137
|
+
inline: p8,
|
|
138
|
+
offset: p9,
|
|
139
|
+
overflowPadding: p10,
|
|
140
|
+
overlap: p11,
|
|
141
|
+
placement: p12,
|
|
142
|
+
rootBoundary: p13,
|
|
143
|
+
sameHeight: p14,
|
|
144
|
+
sameWidth: p15,
|
|
145
|
+
shift: p16,
|
|
146
|
+
strategy: p17
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
const mergedRef = useCallback((element) => {
|
|
150
|
+
elementRef.current = element;
|
|
151
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
152
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
153
|
+
}, [forwardedRef]);
|
|
154
|
+
return createElement("prosekit-autocomplete-positioner", {
|
|
155
|
+
...restProps,
|
|
156
|
+
ref: mergedRef,
|
|
157
|
+
suppressHydrationWarning: true
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* A Preact component that renders an `prosekit-autocomplete-positioner` custom element.
|
|
162
|
+
*
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
const AutocompletePositioner = /* @__PURE__ */ forwardRef(AutocompletePositionerComponent);
|
|
14
166
|
//#endregion
|
|
15
|
-
|
|
167
|
+
//#region src/components/autocomplete/autocomplete-root.gen.ts
|
|
168
|
+
/**
|
|
169
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
170
|
+
*/
|
|
171
|
+
function AutocompleteRootComponent(props, forwardedRef) {
|
|
172
|
+
registerAutocompleteRootElement();
|
|
173
|
+
const elementRef = useRef(null);
|
|
174
|
+
const handlersRef = useRef([]);
|
|
175
|
+
const p0Fallback = useEditorContext();
|
|
176
|
+
const { editor: p0, filter: p1, regex: p2, onOpenChange: e0, onQueryChange: e1, onValueChange: e2, onValuesChange: e3, ...restProps } = props;
|
|
177
|
+
useLayoutEffect(() => {
|
|
178
|
+
const element = elementRef.current;
|
|
179
|
+
if (!element) return;
|
|
180
|
+
Object.assign(element, {
|
|
181
|
+
editor: p0 ?? p0Fallback,
|
|
182
|
+
filter: p1,
|
|
183
|
+
regex: p2
|
|
184
|
+
});
|
|
185
|
+
handlersRef.current = [
|
|
186
|
+
e0,
|
|
187
|
+
e1,
|
|
188
|
+
e2,
|
|
189
|
+
e3
|
|
190
|
+
];
|
|
191
|
+
});
|
|
192
|
+
useLayoutEffect(() => {
|
|
193
|
+
const element = elementRef.current;
|
|
194
|
+
if (!element) return;
|
|
195
|
+
const ac = new AbortController();
|
|
196
|
+
for (const [index, eventName] of [
|
|
197
|
+
"openChange",
|
|
198
|
+
"queryChange",
|
|
199
|
+
"valueChange",
|
|
200
|
+
"valuesChange"
|
|
201
|
+
].entries()) element.addEventListener(eventName, (event) => {
|
|
202
|
+
handlersRef.current[index]?.(event);
|
|
203
|
+
}, { signal: ac.signal });
|
|
204
|
+
return () => ac.abort();
|
|
205
|
+
}, []);
|
|
206
|
+
const mergedRef = useCallback((element) => {
|
|
207
|
+
elementRef.current = element;
|
|
208
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
209
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
210
|
+
}, [forwardedRef]);
|
|
211
|
+
return createElement("prosekit-autocomplete-root", {
|
|
212
|
+
...restProps,
|
|
213
|
+
ref: mergedRef,
|
|
214
|
+
suppressHydrationWarning: true
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* A Preact component that renders an `prosekit-autocomplete-root` custom element.
|
|
219
|
+
*
|
|
220
|
+
* @public
|
|
221
|
+
*/
|
|
222
|
+
const AutocompleteRoot = /* @__PURE__ */ forwardRef(AutocompleteRootComponent);
|
|
223
|
+
//#endregion
|
|
224
|
+
export { AutocompleteEmpty, AutocompleteItem, AutocompletePopup, AutocompletePositioner, AutocompleteRoot, OpenChangeEvent, QueryChangeEvent, SelectEvent, ValueChangeEvent, ValuesChangeEvent };
|
|
16
225
|
|
|
17
226
|
//# sourceMappingURL=prosekit-preact-autocomplete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-preact-autocomplete.js","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-list.gen.ts","../src/components/autocomplete/autocomplete-popover.gen.ts"],"sourcesContent":["import {\n type AutocompleteEmptyElement,\n type AutocompleteEmptyProps as Props,\n type AutocompleteEmptyEvents as Events,\n autocompleteEmptyProps,\n autocompleteEmptyEvents,\n} from '@prosekit/web/autocomplete'\nimport type {\n ForwardRefExoticComponent,\n HTMLAttributes,\n RefAttributes,\n} from 'preact/compat'\n\nimport { createComponent } from '../create-component.ts'\nimport type { CreateProps } from '../create-props.ts'\n\n/**\n * Props for the {@link AutocompleteEmpty} component.\n */\nexport interface AutocompleteEmptyProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const AutocompleteEmpty: ForwardRefExoticComponent<\n Partial<AutocompleteEmptyProps> &\n RefAttributes<AutocompleteEmptyElement> &\n HTMLAttributes<AutocompleteEmptyElement>\n> = createComponent<\n AutocompleteEmptyProps,\n AutocompleteEmptyElement\n>(\n 'prosekit-autocomplete-empty',\n 'AutocompleteEmpty',\n Object.keys(autocompleteEmptyProps),\n Object.keys(autocompleteEmptyEvents),\n)\n","import {\n type AutocompleteItemElement,\n type AutocompleteItemProps as Props,\n type AutocompleteItemEvents as Events,\n autocompleteItemProps,\n autocompleteItemEvents,\n} from '@prosekit/web/autocomplete'\nimport type {\n ForwardRefExoticComponent,\n HTMLAttributes,\n RefAttributes,\n} from 'preact/compat'\n\nimport { createComponent } from '../create-component.ts'\nimport type { CreateProps } from '../create-props.ts'\n\n/**\n * Props for the {@link AutocompleteItem} component.\n */\nexport interface AutocompleteItemProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const AutocompleteItem: ForwardRefExoticComponent<\n Partial<AutocompleteItemProps> &\n RefAttributes<AutocompleteItemElement> &\n HTMLAttributes<AutocompleteItemElement>\n> = createComponent<\n AutocompleteItemProps,\n AutocompleteItemElement\n>(\n 'prosekit-autocomplete-item',\n 'AutocompleteItem',\n Object.keys(autocompleteItemProps),\n Object.keys(autocompleteItemEvents),\n)\n","import {\n type AutocompleteListElement,\n type AutocompleteListProps as Props,\n type AutocompleteListEvents as Events,\n autocompleteListProps,\n autocompleteListEvents,\n} from '@prosekit/web/autocomplete'\nimport type {\n ForwardRefExoticComponent,\n HTMLAttributes,\n RefAttributes,\n} from 'preact/compat'\n\nimport { createComponent } from '../create-component.ts'\nimport type { CreateProps } from '../create-props.ts'\n\n/**\n * Props for the {@link AutocompleteList} component.\n */\nexport interface AutocompleteListProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const AutocompleteList: ForwardRefExoticComponent<\n Partial<AutocompleteListProps> &\n RefAttributes<AutocompleteListElement> &\n HTMLAttributes<AutocompleteListElement>\n> = createComponent<\n AutocompleteListProps,\n AutocompleteListElement\n>(\n 'prosekit-autocomplete-list',\n 'AutocompleteList',\n Object.keys(autocompleteListProps),\n Object.keys(autocompleteListEvents),\n)\n","import {\n type AutocompletePopoverElement,\n type AutocompletePopoverProps as Props,\n type AutocompletePopoverEvents as Events,\n autocompletePopoverProps,\n autocompletePopoverEvents,\n} from '@prosekit/web/autocomplete'\nimport type {\n ForwardRefExoticComponent,\n HTMLAttributes,\n RefAttributes,\n} from 'preact/compat'\n\nimport { createComponent } from '../create-component.ts'\nimport type { CreateProps } from '../create-props.ts'\n\n/**\n * Props for the {@link AutocompletePopover} component.\n */\nexport interface AutocompletePopoverProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const AutocompletePopover: ForwardRefExoticComponent<\n Partial<AutocompletePopoverProps> &\n RefAttributes<AutocompletePopoverElement> &\n HTMLAttributes<AutocompletePopoverElement>\n> = createComponent<\n AutocompletePopoverProps,\n AutocompletePopoverElement\n>(\n 'prosekit-autocomplete-popover',\n 'AutocompletePopover',\n Object.keys(autocompletePopoverProps),\n Object.keys(autocompletePopoverEvents),\n)\n"],"mappings":";;;AAqBA,MAAa,oBAIT,gBAIF,+BACA,qBACA,OAAO,KAAK,uBAAuB,EACnC,OAAO,KAAK,wBAAwB,CACrC;;;ACZD,MAAa,mBAIT,gBAIF,8BACA,oBACA,OAAO,KAAK,sBAAsB,EAClC,OAAO,KAAK,uBAAuB,CACpC;;;ACZD,MAAa,mBAIT,gBAIF,8BACA,oBACA,OAAO,KAAK,sBAAsB,EAClC,OAAO,KAAK,uBAAuB,CACpC;;;ACZD,MAAa,sBAIT,gBAIF,iCACA,uBACA,OAAO,KAAK,yBAAyB,EACrC,OAAO,KAAK,0BAA0B,CACvC"}
|
|
1
|
+
{"version":3,"file":"prosekit-preact-autocomplete.js","names":[],"sources":["../src/components/autocomplete/autocomplete-empty.gen.ts","../src/components/autocomplete/autocomplete-item.gen.ts","../src/components/autocomplete/autocomplete-popup.gen.ts","../src/components/autocomplete/autocomplete-positioner.gen.ts","../src/components/autocomplete/autocomplete-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 { registerAutocompleteEmptyElement, type AutocompleteEmptyElement } from '@prosekit/web/autocomplete';\nimport { createElement, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef } from 'preact/hooks';\n\n/**\n * Props for the {@link AutocompleteEmpty} Preact component.\n *\n * @public\n */\nexport interface AutocompleteEmptyProps extends HTMLAttributes<AutocompleteEmptyElement> {}\n\nfunction AutocompleteEmptyComponent(props: AutocompleteEmptyProps, forwardedRef: Ref<AutocompleteEmptyElement>) {\n registerAutocompleteEmptyElement();\n\n const elementRef = useRef<AutocompleteEmptyElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: AutocompleteEmptyElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-empty', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-autocomplete-empty` custom element.\n *\n * @public\n */\nexport const AutocompleteEmpty: ForwardRefExoticComponent<AutocompleteEmptyProps & RefAttributes<AutocompleteEmptyElement>> = /* @__PURE__ */ forwardRef(AutocompleteEmptyComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerAutocompleteItemElement, type AutocompleteItemElement, type AutocompleteItemProps as AutocompleteItemElementProps, type AutocompleteItemEvents } from '@prosekit/web/autocomplete';\nimport { createElement, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\n/**\n * Props for the {@link AutocompleteItem} Preact component.\n *\n * @public\n */\nexport interface AutocompleteItemProps extends Omit<HTMLAttributes<AutocompleteItemElement>, 'onSelect'> {\n /**\n * The value of the item, which will be matched against the query.\n *\n * If not provided, the value is the item's text content.\n *\n * @default \"\"\n */\n value?: AutocompleteItemElementProps['value'];\n /**\n * Whether this option is disabled.\n *\n * @default false\n */\n disabled?: AutocompleteItemElementProps['disabled'];\n /** Emitted when the the item is selected. */\n onSelect?: (event: AutocompleteItemEvents['select']) => void;\n}\n\nfunction AutocompleteItemComponent(props: AutocompleteItemProps, forwardedRef: Ref<AutocompleteItemElement>) {\n registerAutocompleteItemElement();\n\n const elementRef = useRef<AutocompleteItemElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { disabled: p0, value: p1, onSelect: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { disabled: p0, value: p1 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['select'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: AutocompleteItemElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-item', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-autocomplete-item` custom element.\n *\n * @public\n */\nexport const AutocompleteItem: ForwardRefExoticComponent<AutocompleteItemProps & RefAttributes<AutocompleteItemElement>> = /* @__PURE__ */ forwardRef(AutocompleteItemComponent);\n\nexport type { AutocompleteItemEvents };\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerAutocompletePopupElement, type AutocompletePopupElement, type AutocompletePopupEvents } from '@prosekit/web/autocomplete';\nimport { createElement, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\n/**\n * Props for the {@link AutocompletePopup} Preact component.\n *\n * @public\n */\nexport interface AutocompletePopupProps extends HTMLAttributes<AutocompletePopupElement> {\n /**\n * Emitted when the selected value changes. Only available when multiple is\n * false.\n */\n onValueChange?: (event: AutocompletePopupEvents['valueChange']) => void;\n /**\n * Emitted when the selected values change. Only available when multiple is\n * true.\n */\n onValuesChange?: (event: AutocompletePopupEvents['valuesChange']) => void;\n}\n\nfunction AutocompletePopupComponent(props: AutocompletePopupProps, forwardedRef: Ref<AutocompletePopupElement>) {\n registerAutocompletePopupElement();\n\n const elementRef = useRef<AutocompletePopupElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { onValueChange: e0, onValuesChange: e1, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n handlersRef.current = [e0, e1] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['valueChange', 'valuesChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: AutocompletePopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-autocomplete-popup` custom element.\n *\n * @public\n */\nexport const AutocompletePopup: ForwardRefExoticComponent<AutocompletePopupProps & RefAttributes<AutocompletePopupElement>> = /* @__PURE__ */ forwardRef(AutocompletePopupComponent);\n\nexport type { AutocompletePopupEvents };\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerAutocompletePositionerElement, type AutocompletePositionerElement, type AutocompletePositionerProps as AutocompletePositionerElementProps } from '@prosekit/web/autocomplete';\nimport { createElement, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\n/**\n * Props for the {@link AutocompletePositioner} Preact component.\n *\n * @public\n */\nexport interface AutocompletePositionerProps extends HTMLAttributes<AutocompletePositionerElement> {\n /**\n * The placement of the popover, relative to the text cursor.\n *\n * @default \"bottom-start\"\n */\n placement?: AutocompletePositionerElementProps['placement'];\n /**\n * The distance between the popover and the hovered block.\n *\n * @default 4\n */\n offset?: AutocompletePositionerElementProps['offset'];\n /** @default true */\n inline?: AutocompletePositionerElementProps['inline'];\n /** @default true */\n hoist?: AutocompletePositionerElementProps['hoist'];\n /** @default true */\n fitViewport?: AutocompletePositionerElementProps['fitViewport'];\n /** @default \"The body element\" */\n boundary?: AutocompletePositionerElementProps['boundary'];\n /** @default 8 */\n overflowPadding?: AutocompletePositionerElementProps['overflowPadding'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: AutocompletePositionerElementProps['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?: AutocompletePositionerElementProps['autoUpdate'];\n /**\n * Whether to flip the `placement` in order to keep it in view when the\n * preferred placement(s) will overflow the clipping boundary. You can also\n * provide an array of placements to try sequentially if the preferred\n * `placement` does not fit.\n *\n * @default true\n */\n flip?: AutocompletePositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: AutocompletePositionerElementProps['shift'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default false\n */\n overlap?: AutocompletePositionerElementProps['overlap'];\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?: AutocompletePositionerElementProps['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?: AutocompletePositionerElementProps['sameHeight'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default false\n */\n hide?: AutocompletePositionerElementProps['hide'];\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?: AutocompletePositionerElementProps['rootBoundary'];\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?: AutocompletePositionerElementProps['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?: AutocompletePositionerElementProps['altBoundary'];\n}\n\nfunction AutocompletePositionerComponent(props: AutocompletePositionerProps, forwardedRef: Ref<AutocompletePositionerElement>) {\n registerAutocompletePositionerElement();\n\n const elementRef = useRef<AutocompletePositionerElement>(null);\n\n 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;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n 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 });\n });\n\n const mergedRef = useCallback(\n (element: AutocompletePositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-autocomplete-positioner` custom element.\n *\n * @public\n */\nexport const AutocompletePositioner: ForwardRefExoticComponent<AutocompletePositionerProps & RefAttributes<AutocompletePositionerElement>> = /* @__PURE__ */ forwardRef(AutocompletePositionerComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerAutocompleteRootElement, type AutocompleteRootElement, type AutocompleteRootProps as AutocompleteRootElementProps, type AutocompleteRootEvents } from '@prosekit/web/autocomplete';\nimport { createElement, type HTMLAttributes, type Ref } from 'preact';\nimport { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';\nimport { useCallback, useRef, useLayoutEffect } from 'preact/hooks';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/**\n * Props for the {@link AutocompleteRoot} Preact component.\n *\n * @public\n */\nexport interface AutocompleteRootProps extends HTMLAttributes<AutocompleteRootElement> {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: AutocompleteRootElementProps['editor'];\n /**\n * The regular expression to match the query text to autocomplete.\n *\n * @default null\n */\n regex?: AutocompleteRootElementProps['regex'];\n /**\n * The filter function to determine if an item should be shown in the\n * listbox.\n *\n * @default defaultItemFilter\n */\n filter?: AutocompleteRootElementProps['filter'];\n /** Fired when the open state changes. */\n onOpenChange?: (event: AutocompleteRootEvents['openChange']) => void;\n /** Fired when the query changes. */\n onQueryChange?: (event: AutocompleteRootEvents['queryChange']) => void;\n /**\n * Emitted when the selected value changes. Only available when multiple is\n * false.\n */\n onValueChange?: (event: AutocompleteRootEvents['valueChange']) => void;\n /**\n * Emitted when the selected values change. Only available when multiple is\n * true.\n */\n onValuesChange?: (event: AutocompleteRootEvents['valuesChange']) => void;\n}\n\nfunction AutocompleteRootComponent(props: AutocompleteRootProps, forwardedRef: Ref<AutocompleteRootElement>) {\n registerAutocompleteRootElement();\n\n const elementRef = useRef<AutocompleteRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const p0Fallback = useEditorContext();\n\n const { editor: p0, filter: p1, regex: p2, onOpenChange: e0, onQueryChange: e1, onValueChange: e2, onValuesChange: e3, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { editor: p0 ?? p0Fallback, filter: p1, regex: p2 });\n handlersRef.current = [e0, e1, e2, e3] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange', 'queryChange', 'valueChange', 'valuesChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: AutocompleteRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-autocomplete-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-autocomplete-root` custom element.\n *\n * @public\n */\nexport const AutocompleteRoot: ForwardRefExoticComponent<AutocompleteRootProps & RefAttributes<AutocompleteRootElement>> = /* @__PURE__ */ forwardRef(AutocompleteRootComponent);\n\nexport type { AutocompleteRootEvents };\n"],"mappings":";;;;;;;;;AAgBA,SAAS,2BAA2B,OAA+B,cAA6C;AAC9G,mCAAkC;CAElC,MAAM,aAAa,OAAiC,KAAK;CAEzD,MAAM,EAAE,GAAG,cAAc;CAEzB,MAAM,YAAY,aACf,YAA6C;AAC5C,aAAW,UAAU;AACrB,MAAI,OAAO,iBAAiB,WAC1B,cAAa,QAAQ;WACZ,aACT,cAAa,UAAU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,+BAA+B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;;;;;AAQvH,MAAa,oBAAiI,2BAAW,2BAA2B;;;;;;ACVpL,SAAS,0BAA0B,OAA8B,cAA4C;AAC3G,kCAAiC;CAEjC,MAAM,aAAa,OAAgC,KAAK;CACxD,MAAM,cAAc,OAAoD,EAAE,CAAC;CAE3E,MAAM,E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