@prosekit/preact 0.7.0-beta.2 → 0.7.0-beta.4
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/editor-context.js +0 -2
- package/dist/editor-context.js.map +1 -1
- package/dist/prosekit-preact-autocomplete.d.ts +22 -73
- package/dist/prosekit-preact-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-preact-autocomplete.js +7 -52
- package/dist/prosekit-preact-autocomplete.js.map +1 -1
- package/dist/prosekit-preact-block-handle.d.ts +22 -73
- package/dist/prosekit-preact-block-handle.d.ts.map +1 -1
- package/dist/prosekit-preact-block-handle.js +7 -52
- package/dist/prosekit-preact-block-handle.js.map +1 -1
- package/dist/prosekit-preact-drop-indicator.d.ts +4 -15
- package/dist/prosekit-preact-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-preact-drop-indicator.js +1 -10
- package/dist/prosekit-preact-drop-indicator.js.map +1 -1
- package/dist/prosekit-preact-inline-popover.d.ts +15 -46
- package/dist/prosekit-preact-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-preact-inline-popover.js +5 -32
- package/dist/prosekit-preact-inline-popover.js.map +1 -1
- package/dist/prosekit-preact-menu.d.ts +61 -101
- package/dist/prosekit-preact-menu.d.ts.map +1 -1
- package/dist/prosekit-preact-menu.js +39 -74
- package/dist/prosekit-preact-menu.js.map +1 -1
- package/dist/prosekit-preact-popover.d.ts +18 -59
- package/dist/prosekit-preact-popover.d.ts.map +1 -1
- package/dist/prosekit-preact-popover.js +6 -42
- package/dist/prosekit-preact-popover.js.map +1 -1
- package/dist/prosekit-preact-resizable.d.ts +10 -31
- package/dist/prosekit-preact-resizable.d.ts.map +1 -1
- package/dist/prosekit-preact-resizable.js +4 -22
- package/dist/prosekit-preact-resizable.js.map +1 -1
- package/dist/prosekit-preact-table-handle.d.ts +44 -155
- package/dist/prosekit-preact-table-handle.d.ts.map +1 -1
- package/dist/prosekit-preact-table-handle.js +11 -110
- package/dist/prosekit-preact-table-handle.js.map +1 -1
- package/dist/prosekit-preact-tooltip.d.ts +18 -59
- package/dist/prosekit-preact-tooltip.d.ts.map +1 -1
- package/dist/prosekit-preact-tooltip.js +6 -42
- package/dist/prosekit-preact-tooltip.js.map +1 -1
- package/dist/prosekit-preact.d.ts +0 -21
- package/dist/prosekit-preact.d.ts.map +1 -1
- package/dist/prosekit-preact.js +0 -26
- package/dist/prosekit-preact.js.map +1 -1
- package/package.json +5 -5
- package/src/components/autocomplete/autocomplete-empty.gen.ts +5 -15
- package/src/components/autocomplete/autocomplete-item.gen.ts +5 -17
- package/src/components/autocomplete/autocomplete-popup.gen.ts +5 -17
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +5 -15
- package/src/components/autocomplete/autocomplete-root.gen.ts +5 -17
- package/src/components/autocomplete/index.gen.ts +4 -8
- package/src/components/block-handle/block-handle-add.gen.ts +5 -15
- package/src/components/block-handle/block-handle-draggable.gen.ts +5 -15
- package/src/components/block-handle/block-handle-popup.gen.ts +5 -15
- package/src/components/block-handle/block-handle-positioner.gen.ts +5 -15
- package/src/components/block-handle/block-handle-root.gen.ts +5 -17
- package/src/components/block-handle/index.gen.ts +2 -6
- package/src/components/drop-indicator/drop-indicator.gen.ts +5 -15
- package/src/components/drop-indicator/index.gen.ts +1 -3
- package/src/components/inline-popover/index.gen.ts +2 -6
- package/src/components/inline-popover/inline-popover-popup.gen.ts +5 -15
- package/src/components/inline-popover/inline-popover-positioner.gen.ts +5 -15
- package/src/components/inline-popover/inline-popover-root.gen.ts +6 -18
- package/src/components/menu/index.gen.ts +4 -8
- package/src/components/menu/menu-item.gen.ts +5 -17
- package/src/components/menu/menu-popup.gen.ts +5 -15
- package/src/components/menu/menu-positioner.gen.ts +5 -15
- package/src/components/menu/menu-root.gen.ts +5 -17
- package/src/components/menu/menu-submenu-root.gen.ts +50 -18
- package/src/components/menu/menu-submenu-trigger.gen.ts +28 -19
- package/src/components/menu/menu-trigger.gen.ts +5 -17
- package/src/components/popover/index.gen.ts +3 -7
- package/src/components/popover/popover-popup.gen.ts +5 -15
- package/src/components/popover/popover-positioner.gen.ts +5 -15
- package/src/components/popover/popover-root.gen.ts +5 -17
- package/src/components/popover/popover-trigger.gen.ts +5 -17
- package/src/components/resizable/index.gen.ts +2 -6
- package/src/components/resizable/resizable-handle.gen.ts +5 -15
- package/src/components/resizable/resizable-root.gen.ts +5 -17
- package/src/components/table-handle/index.gen.ts +1 -3
- package/src/components/table-handle/table-handle-column-menu-root.gen.ts +5 -15
- package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +5 -15
- package/src/components/table-handle/table-handle-column-popup.gen.ts +5 -15
- package/src/components/table-handle/table-handle-column-positioner.gen.ts +5 -15
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +5 -15
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +5 -15
- package/src/components/table-handle/table-handle-root.gen.ts +5 -15
- package/src/components/table-handle/table-handle-row-menu-root.gen.ts +5 -15
- package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +5 -15
- package/src/components/table-handle/table-handle-row-popup.gen.ts +5 -15
- package/src/components/table-handle/table-handle-row-positioner.gen.ts +5 -15
- package/src/components/tooltip/index.gen.ts +2 -6
- package/src/components/tooltip/tooltip-popup.gen.ts +5 -15
- package/src/components/tooltip/tooltip-positioner.gen.ts +5 -15
- package/src/components/tooltip/tooltip-root.gen.ts +5 -17
- package/src/components/tooltip/tooltip-trigger.gen.ts +5 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-preact-menu.d.ts","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.gen.ts","../src/components/menu/menu-submenu-root.gen.ts","../src/components/menu/menu-submenu-trigger.gen.ts","../src/components/menu/menu-trigger.gen.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prosekit-preact-menu.d.ts","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.gen.ts","../src/components/menu/menu-submenu-root.gen.ts","../src/components/menu/menu-submenu-trigger.gen.ts","../src/components/menu/menu-trigger.gen.ts"],"mappings":";;;;UAQiB,aAAA;EAAa;;;;;EAM5B,KAAA,GAAQ,eAAA;EAcyB;;;;;EARjC,QAAA,GAAW,eAAA;EAMX;;;;;EAAA,aAAA,GAAgB,eAAA;EAE2B;EAA3C,QAAA,IAAY,KAAA,EAAO,cAAA;AAAA;;cAkDR,QAAA,EAAU,yBAAA,CAA0B,aAAA,GAAgB,IAAA,CAAK,cAAA,CAAe,eAAA,iBAAgC,aAAA,CAAc,eAAA;;UCtElH,cAAA;EDAa;;;;;;ECO5B,WAAA,GAAc,gBAAA;AAAA;;cAgCH,SAAA,EAAW,yBAAA,CAA0B,cAAA,GAAiB,cAAA,CAAe,gBAAA,IAAoB,aAAA,CAAc,gBAAA;;UCvCnG,mBAAA;EFAa;;;;;EEM5B,SAAA,GAAY,qBAAA;EFcqB;;;;;EERjC,QAAA,GAAW,qBAAA;EFMX;;;;;;;EEEA,UAAA,GAAa,qBAAA;EFkDqL;;;;;;EE3ClM,KAAA,GAAQ,qBAAA;EF2C2G;;;;;EErCnH,MAAA,GAAS,qBAAA;EFqCsD;;;;;;;;EE5B/D,IAAA,GAAO,qBAAA;ED1CsB;;;;AAuC/B;ECSE,KAAA,GAAQ,qBAAA;;;;;;;EAOR,OAAA,GAAU,qBAAA;EDhBqC;;;;;;ECuB/C,WAAA,GAAc,qBAAA;EDvBoG;;;;ACvCpH;;EAqEE,SAAA,GAAY,qBAAA;EA/DA;;;;;;EAsEZ,UAAA,GAAa,qBAAA;EArBH;;;;;;EA4BV,MAAA,GAAS,qBAAA;EAqBM;;;;;;EAdf,IAAA,GAAO,qBAAA;EApFK;;;;;;EA2FZ,QAAA,GAAW,qBAAA;EAhEX;;;;;;EAuEA,YAAA,GAA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
2
2
|
import { useCallback, useLayoutEffect, useRef } from "preact/hooks";
|
|
3
3
|
import { forwardRef } from "preact/compat";
|
|
4
|
-
import {
|
|
5
|
-
//#region src/components/menu/menu-item.gen.ts
|
|
6
|
-
/**
|
|
7
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
8
|
-
*/
|
|
4
|
+
import { registerMenuItemElement, registerMenuPopupElement, registerMenuPositionerElement, registerMenuRootElement, registerMenuSubmenuRootElement, registerMenuSubmenuTriggerElement, registerMenuTriggerElement } from "@prosekit/web/menu";
|
|
9
5
|
function MenuItemComponent(props, forwardedRef) {
|
|
10
6
|
registerMenuItemElement();
|
|
11
7
|
const elementRef = useRef(null);
|
|
@@ -41,17 +37,8 @@ function MenuItemComponent(props, forwardedRef) {
|
|
|
41
37
|
suppressHydrationWarning: true
|
|
42
38
|
});
|
|
43
39
|
}
|
|
44
|
-
/**
|
|
45
|
-
* A Preact component that renders an `prosekit-menu-item` custom element.
|
|
46
|
-
*
|
|
47
|
-
* @public
|
|
48
|
-
*/
|
|
40
|
+
/** A Preact component that renders an `prosekit-menu-item` custom element. */
|
|
49
41
|
const MenuItem = /* @__PURE__ */ forwardRef(MenuItemComponent);
|
|
50
|
-
//#endregion
|
|
51
|
-
//#region src/components/menu/menu-popup.gen.ts
|
|
52
|
-
/**
|
|
53
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
54
|
-
*/
|
|
55
42
|
function MenuPopupComponent(props, forwardedRef) {
|
|
56
43
|
registerMenuPopupElement();
|
|
57
44
|
const elementRef = useRef(null);
|
|
@@ -72,17 +59,8 @@ function MenuPopupComponent(props, forwardedRef) {
|
|
|
72
59
|
suppressHydrationWarning: true
|
|
73
60
|
});
|
|
74
61
|
}
|
|
75
|
-
/**
|
|
76
|
-
* A Preact component that renders an `prosekit-menu-popup` custom element.
|
|
77
|
-
*
|
|
78
|
-
* @public
|
|
79
|
-
*/
|
|
62
|
+
/** A Preact component that renders an `prosekit-menu-popup` custom element. */
|
|
80
63
|
const MenuPopup = /* @__PURE__ */ forwardRef(MenuPopupComponent);
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/components/menu/menu-positioner.gen.ts
|
|
83
|
-
/**
|
|
84
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
85
|
-
*/
|
|
86
64
|
function MenuPositionerComponent(props, forwardedRef) {
|
|
87
65
|
registerMenuPositionerElement();
|
|
88
66
|
const elementRef = useRef(null);
|
|
@@ -122,17 +100,8 @@ function MenuPositionerComponent(props, forwardedRef) {
|
|
|
122
100
|
suppressHydrationWarning: true
|
|
123
101
|
});
|
|
124
102
|
}
|
|
125
|
-
/**
|
|
126
|
-
* A Preact component that renders an `prosekit-menu-positioner` custom element.
|
|
127
|
-
*
|
|
128
|
-
* @public
|
|
129
|
-
*/
|
|
103
|
+
/** A Preact component that renders an `prosekit-menu-positioner` custom element. */
|
|
130
104
|
const MenuPositioner = /* @__PURE__ */ forwardRef(MenuPositionerComponent);
|
|
131
|
-
//#endregion
|
|
132
|
-
//#region src/components/menu/menu-root.gen.ts
|
|
133
|
-
/**
|
|
134
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
135
|
-
*/
|
|
136
105
|
function MenuRootComponent(props, forwardedRef) {
|
|
137
106
|
registerMenuRootElement();
|
|
138
107
|
const elementRef = useRef(null);
|
|
@@ -168,21 +137,32 @@ function MenuRootComponent(props, forwardedRef) {
|
|
|
168
137
|
suppressHydrationWarning: true
|
|
169
138
|
});
|
|
170
139
|
}
|
|
171
|
-
/**
|
|
172
|
-
* A Preact component that renders an `prosekit-menu-root` custom element.
|
|
173
|
-
*
|
|
174
|
-
* @public
|
|
175
|
-
*/
|
|
140
|
+
/** A Preact component that renders an `prosekit-menu-root` custom element. */
|
|
176
141
|
const MenuRoot = /* @__PURE__ */ forwardRef(MenuRootComponent);
|
|
177
|
-
//#endregion
|
|
178
|
-
//#region src/components/menu/menu-submenu-root.gen.ts
|
|
179
|
-
/**
|
|
180
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
181
|
-
*/
|
|
182
142
|
function MenuSubmenuRootComponent(props, forwardedRef) {
|
|
183
143
|
registerMenuSubmenuRootElement();
|
|
184
144
|
const elementRef = useRef(null);
|
|
185
|
-
const
|
|
145
|
+
const handlersRef = useRef([]);
|
|
146
|
+
const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;
|
|
147
|
+
useLayoutEffect(() => {
|
|
148
|
+
const element = elementRef.current;
|
|
149
|
+
if (!element) return;
|
|
150
|
+
Object.assign(element, {
|
|
151
|
+
defaultOpen: p0,
|
|
152
|
+
disabled: p1,
|
|
153
|
+
open: p2
|
|
154
|
+
});
|
|
155
|
+
handlersRef.current = [e0];
|
|
156
|
+
});
|
|
157
|
+
useLayoutEffect(() => {
|
|
158
|
+
const element = elementRef.current;
|
|
159
|
+
if (!element) return;
|
|
160
|
+
const ac = new AbortController();
|
|
161
|
+
for (const [index, eventName] of ["openChange"].entries()) element.addEventListener(eventName, (event) => {
|
|
162
|
+
handlersRef.current[index]?.(event);
|
|
163
|
+
}, { signal: ac.signal });
|
|
164
|
+
return () => ac.abort();
|
|
165
|
+
}, []);
|
|
186
166
|
const mergedRef = useCallback((element) => {
|
|
187
167
|
elementRef.current = element;
|
|
188
168
|
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
@@ -194,21 +174,20 @@ function MenuSubmenuRootComponent(props, forwardedRef) {
|
|
|
194
174
|
suppressHydrationWarning: true
|
|
195
175
|
});
|
|
196
176
|
}
|
|
197
|
-
/**
|
|
198
|
-
* A Preact component that renders an `prosekit-menu-submenu-root` custom element.
|
|
199
|
-
*
|
|
200
|
-
* @public
|
|
201
|
-
*/
|
|
177
|
+
/** A Preact component that renders an `prosekit-menu-submenu-root` custom element. */
|
|
202
178
|
const MenuSubmenuRoot = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);
|
|
203
|
-
//#endregion
|
|
204
|
-
//#region src/components/menu/menu-submenu-trigger.gen.ts
|
|
205
|
-
/**
|
|
206
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
207
|
-
*/
|
|
208
179
|
function MenuSubmenuTriggerComponent(props, forwardedRef) {
|
|
209
180
|
registerMenuSubmenuTriggerElement();
|
|
210
181
|
const elementRef = useRef(null);
|
|
211
|
-
const { ...restProps } = props;
|
|
182
|
+
const { disabled: p0, value: p1, ...restProps } = props;
|
|
183
|
+
useLayoutEffect(() => {
|
|
184
|
+
const element = elementRef.current;
|
|
185
|
+
if (!element) return;
|
|
186
|
+
Object.assign(element, {
|
|
187
|
+
disabled: p0,
|
|
188
|
+
value: p1
|
|
189
|
+
});
|
|
190
|
+
});
|
|
212
191
|
const mergedRef = useCallback((element) => {
|
|
213
192
|
elementRef.current = element;
|
|
214
193
|
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
@@ -220,17 +199,8 @@ function MenuSubmenuTriggerComponent(props, forwardedRef) {
|
|
|
220
199
|
suppressHydrationWarning: true
|
|
221
200
|
});
|
|
222
201
|
}
|
|
223
|
-
/**
|
|
224
|
-
* A Preact component that renders an `prosekit-menu-submenu-trigger` custom element.
|
|
225
|
-
*
|
|
226
|
-
* @public
|
|
227
|
-
*/
|
|
202
|
+
/** A Preact component that renders an `prosekit-menu-submenu-trigger` custom element. */
|
|
228
203
|
const MenuSubmenuTrigger = /* @__PURE__ */ forwardRef(MenuSubmenuTriggerComponent);
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region src/components/menu/menu-trigger.gen.ts
|
|
231
|
-
/**
|
|
232
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
233
|
-
*/
|
|
234
204
|
function MenuTriggerComponent(props, forwardedRef) {
|
|
235
205
|
registerMenuTriggerElement();
|
|
236
206
|
const elementRef = useRef(null);
|
|
@@ -262,13 +232,8 @@ function MenuTriggerComponent(props, forwardedRef) {
|
|
|
262
232
|
suppressHydrationWarning: true
|
|
263
233
|
});
|
|
264
234
|
}
|
|
265
|
-
/**
|
|
266
|
-
* A Preact component that renders an `prosekit-menu-trigger` custom element.
|
|
267
|
-
*
|
|
268
|
-
* @public
|
|
269
|
-
*/
|
|
235
|
+
/** A Preact component that renders an `prosekit-menu-trigger` custom element. */
|
|
270
236
|
const MenuTrigger = /* @__PURE__ */ forwardRef(MenuTriggerComponent);
|
|
271
|
-
|
|
272
|
-
export { MenuItem, MenuPopup, MenuPositioner, MenuRoot, MenuSubmenuRoot, MenuSubmenuTrigger, MenuTrigger, OpenChangeEvent, SelectEvent };
|
|
237
|
+
export { MenuItem, MenuPopup, MenuPositioner, MenuRoot, MenuSubmenuRoot, MenuSubmenuTrigger, MenuTrigger };
|
|
273
238
|
|
|
274
239
|
//# sourceMappingURL=prosekit-preact-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-preact-menu.js","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.gen.ts","../src/components/menu/menu-submenu-root.gen.ts","../src/components/menu/menu-submenu-trigger.gen.ts","../src/components/menu/menu-trigger.gen.ts"],"sourcesContent":["/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerMenuItemElement, type MenuItemElement, type MenuItemProps as MenuItemElementProps, type MenuItemEvents } from '@prosekit/web/menu';\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 MenuItem} Preact component.\n *\n * @public\n */\nexport interface MenuItemProps extends Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> {\n /**\n * The unique value for this menu item.\n *\n * @default \"\"\n */\n value?: MenuItemElementProps['value'];\n /**\n * Whether this menu item is disabled.\n *\n * @default false\n */\n disabled?: MenuItemElementProps['disabled'];\n /**\n * Whether to close the menu when the item is pressed.\n *\n * @default true\n */\n closeOnSelect?: MenuItemElementProps['closeOnSelect'];\n /** Emitted when the the item is selected. */\n onSelect?: (event: MenuItemEvents['select']) => void;\n}\n\nfunction MenuItemComponent(props: MenuItemProps, forwardedRef: Ref<MenuItemElement>) {\n registerMenuItemElement();\n\n const elementRef = useRef<MenuItemElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { closeOnSelect: p0, disabled: p1, value: p2, 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, { closeOnSelect: p0, disabled: p1, value: p2 });\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: MenuItemElement | 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-menu-item', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-menu-item` custom element.\n *\n * @public\n */\nexport const MenuItem: ForwardRefExoticComponent<MenuItemProps & RefAttributes<MenuItemElement>> = /* @__PURE__ */ forwardRef(MenuItemComponent);\n\nexport type { MenuItemEvents };\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerMenuPopupElement, type MenuPopupElement, type MenuPopupProps as MenuPopupElementProps } from '@prosekit/web/menu';\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 MenuPopup} Preact component.\n *\n * @public\n */\nexport interface MenuPopupProps extends HTMLAttributes<MenuPopupElement> {\n /**\n * By default, the MenuPopup element will listen for keydown events.\n * You can pass a different element to listen for keydown events.\n *\n * @default null\n */\n eventTarget?: MenuPopupElementProps['eventTarget'];\n}\n\nfunction MenuPopupComponent(props: MenuPopupProps, forwardedRef: Ref<MenuPopupElement>) {\n registerMenuPopupElement();\n\n const elementRef = useRef<MenuPopupElement>(null);\n\n const { eventTarget: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { eventTarget: p0 });\n });\n\n const mergedRef = useCallback(\n (element: MenuPopupElement | 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-menu-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-menu-popup` custom element.\n *\n * @public\n */\nexport const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & RefAttributes<MenuPopupElement>> = /* @__PURE__ */ forwardRef(MenuPopupComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerMenuPositionerElement, type MenuPositionerElement, type MenuPositionerProps as MenuPositionerElementProps } from '@prosekit/web/menu';\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 MenuPositioner} Preact component.\n *\n * @public\n */\nexport interface MenuPositionerProps extends HTMLAttributes<MenuPositionerElement> {\n /**\n * The initial placement of the floating element\n *\n * @default \"bottom-start\"\n */\n placement?: MenuPositionerElementProps['placement'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: MenuPositionerElementProps['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?: MenuPositionerElementProps['autoUpdate'];\n /**\n * Whether to use the browser Popover API to place the floating element on\n * top of other page content.\n *\n * @default true\n */\n hoist?: MenuPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: MenuPositionerElementProps['offset'];\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?: MenuPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: MenuPositionerElementProps['inline'];\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?: MenuPositionerElementProps['hide'];\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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['altBoundary'];\n}\n\nfunction MenuPositionerComponent(props: MenuPositionerProps, forwardedRef: Ref<MenuPositionerElement>) {\n registerMenuPositionerElement();\n\n const elementRef = useRef<MenuPositionerElement>(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: MenuPositionerElement | 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-menu-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-menu-positioner` custom element.\n *\n * @public\n */\nexport const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & RefAttributes<MenuPositionerElement>> = /* @__PURE__ */ forwardRef(MenuPositionerComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerMenuRootElement, type MenuRootElement, type MenuRootProps as MenuRootElementProps, type MenuRootEvents } from '@prosekit/web/menu';\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 MenuRoot} Preact component.\n *\n * @public\n */\nexport interface MenuRootProps extends HTMLAttributes<MenuRootElement> {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: MenuRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: MenuRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: MenuRootElementProps['disabled'];\n /** Emitted when the menu is opened or closed. */\n onOpenChange?: (event: MenuRootEvents['openChange']) => void;\n}\n\nfunction MenuRootComponent(props: MenuRootProps, forwardedRef: Ref<MenuRootElement>) {\n registerMenuRootElement();\n\n const elementRef = useRef<MenuRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });\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 ['openChange'].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: MenuRootElement | 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-menu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-menu-root` custom element.\n *\n * @public\n */\nexport const MenuRoot: ForwardRefExoticComponent<MenuRootProps & RefAttributes<MenuRootElement>> = /* @__PURE__ */ forwardRef(MenuRootComponent);\n\nexport type { MenuRootEvents };\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerMenuSubmenuRootElement, type MenuSubmenuRootElement } from '@prosekit/web/menu';\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 MenuSubmenuRoot} Preact component.\n *\n * @public\n */\nexport interface MenuSubmenuRootProps extends HTMLAttributes<MenuSubmenuRootElement> {}\n\nfunction MenuSubmenuRootComponent(props: MenuSubmenuRootProps, forwardedRef: Ref<MenuSubmenuRootElement>) {\n registerMenuSubmenuRootElement();\n\n const elementRef = useRef<MenuSubmenuRootElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: MenuSubmenuRootElement | 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-menu-submenu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-menu-submenu-root` custom element.\n *\n * @public\n */\nexport const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & RefAttributes<MenuSubmenuRootElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerMenuSubmenuTriggerElement, type MenuSubmenuTriggerElement } from '@prosekit/web/menu';\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 MenuSubmenuTrigger} Preact component.\n *\n * @public\n */\nexport interface MenuSubmenuTriggerProps extends HTMLAttributes<MenuSubmenuTriggerElement> {}\n\nfunction MenuSubmenuTriggerComponent(props: MenuSubmenuTriggerProps, forwardedRef: Ref<MenuSubmenuTriggerElement>) {\n registerMenuSubmenuTriggerElement();\n\n const elementRef = useRef<MenuSubmenuTriggerElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: MenuSubmenuTriggerElement | 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-menu-submenu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-menu-submenu-trigger` custom element.\n *\n * @public\n */\nexport const MenuSubmenuTrigger: ForwardRefExoticComponent<MenuSubmenuTriggerProps & RefAttributes<MenuSubmenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuTriggerComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerMenuTriggerElement, type MenuTriggerElement, type MenuTriggerProps as MenuTriggerElementProps, type MenuTriggerEvents } from '@prosekit/web/menu';\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 MenuTrigger} Preact component.\n *\n * @public\n */\nexport interface MenuTriggerProps extends HTMLAttributes<MenuTriggerElement> {\n /**\n * Whether the component should ignore user interaction.\n *\n * @default false\n */\n disabled?: MenuTriggerElementProps['disabled'];\n /** Emitted when the menu is opened or closed. */\n onOpenChange?: (event: MenuTriggerEvents['openChange']) => void;\n}\n\nfunction MenuTriggerComponent(props: MenuTriggerProps, forwardedRef: Ref<MenuTriggerElement>) {\n registerMenuTriggerElement();\n\n const elementRef = useRef<MenuTriggerElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { disabled: p0, onOpenChange: 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 });\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 ['openChange'].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: MenuTriggerElement | 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-menu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-menu-trigger` custom element.\n *\n * @public\n */\nexport const MenuTrigger: ForwardRefExoticComponent<MenuTriggerProps & RefAttributes<MenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuTriggerComponent);\n\nexport type { MenuTriggerEvents };\n"],"mappings":";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AK;EAAW,0BAA0B;EAAM,CAAC;;;;;;;AAQjH,MAAa,cAA+G,2BAAW,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"prosekit-preact-menu.js","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.gen.ts","../src/components/menu/menu-submenu-root.gen.ts","../src/components/menu/menu-submenu-trigger.gen.ts","../src/components/menu/menu-trigger.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuItemElement, type MenuItemElement, type MenuItemProps as MenuItemElementProps, type MenuItemEvents } from '@prosekit/web/menu';\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/** Props for the {@link MenuItem} Preact component. */\nexport interface MenuItemProps {\n /**\n * The unique value for this menu item.\n *\n * @default \"\"\n */\n value?: MenuItemElementProps['value'];\n /**\n * Whether this menu item is disabled.\n *\n * @default false\n */\n disabled?: MenuItemElementProps['disabled'];\n /**\n * Whether to close the menu when the item is pressed.\n *\n * @default true\n */\n closeOnSelect?: MenuItemElementProps['closeOnSelect'];\n /** Emitted when the the item is selected. */\n onSelect?: (event: MenuItemEvents['select']) => void;\n}\n\nfunction MenuItemComponent(props: MenuItemProps, forwardedRef: Ref<MenuItemElement>) {\n registerMenuItemElement();\n\n const elementRef = useRef<MenuItemElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { closeOnSelect: p0, disabled: p1, value: p2, 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, { closeOnSelect: p0, disabled: p1, value: p2 });\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: MenuItemElement | 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-menu-item', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-menu-item` custom element. */\nexport const MenuItem: ForwardRefExoticComponent<MenuItemProps & Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> & RefAttributes<MenuItemElement>> = /* @__PURE__ */ forwardRef(MenuItemComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuPopupElement, type MenuPopupElement, type MenuPopupProps as MenuPopupElementProps } from '@prosekit/web/menu';\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/** Props for the {@link MenuPopup} Preact component. */\nexport interface MenuPopupProps {\n /**\n * By default, the MenuPopup element will listen for keydown events.\n * You can pass a different element to listen for keydown events.\n *\n * @default null\n */\n eventTarget?: MenuPopupElementProps['eventTarget'];\n}\n\nfunction MenuPopupComponent(props: MenuPopupProps, forwardedRef: Ref<MenuPopupElement>) {\n registerMenuPopupElement();\n\n const elementRef = useRef<MenuPopupElement>(null);\n\n const { eventTarget: p0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { eventTarget: p0 });\n });\n\n const mergedRef = useCallback(\n (element: MenuPopupElement | 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-menu-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-menu-popup` custom element. */\nexport const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & HTMLAttributes<MenuPopupElement> & RefAttributes<MenuPopupElement>> = /* @__PURE__ */ forwardRef(MenuPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuPositionerElement, type MenuPositionerElement, type MenuPositionerProps as MenuPositionerElementProps } from '@prosekit/web/menu';\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/** Props for the {@link MenuPositioner} Preact component. */\nexport interface MenuPositionerProps {\n /**\n * The initial placement of the floating element\n *\n * @default \"bottom-start\"\n */\n placement?: MenuPositionerElementProps['placement'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: MenuPositionerElementProps['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?: MenuPositionerElementProps['autoUpdate'];\n /**\n * Whether to use the browser Popover API to place the floating element on\n * top of other page content.\n *\n * @default true\n */\n hoist?: MenuPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: MenuPositionerElementProps['offset'];\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?: MenuPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: MenuPositionerElementProps['inline'];\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?: MenuPositionerElementProps['hide'];\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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['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?: MenuPositionerElementProps['altBoundary'];\n}\n\nfunction MenuPositionerComponent(props: MenuPositionerProps, forwardedRef: Ref<MenuPositionerElement>) {\n registerMenuPositionerElement();\n\n const elementRef = useRef<MenuPositionerElement>(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: MenuPositionerElement | 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-menu-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-menu-positioner` custom element. */\nexport const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & HTMLAttributes<MenuPositionerElement> & RefAttributes<MenuPositionerElement>> = /* @__PURE__ */ forwardRef(MenuPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuRootElement, type MenuRootElement, type MenuRootProps as MenuRootElementProps, type MenuRootEvents } from '@prosekit/web/menu';\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/** Props for the {@link MenuRoot} Preact component. */\nexport interface MenuRootProps {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: MenuRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: MenuRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: MenuRootElementProps['disabled'];\n /** Emitted when the menu is opened or closed. */\n onOpenChange?: (event: MenuRootEvents['openChange']) => void;\n}\n\nfunction MenuRootComponent(props: MenuRootProps, forwardedRef: Ref<MenuRootElement>) {\n registerMenuRootElement();\n\n const elementRef = useRef<MenuRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });\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 ['openChange'].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: MenuRootElement | 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-menu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-menu-root` custom element. */\nexport const MenuRoot: ForwardRefExoticComponent<MenuRootProps & HTMLAttributes<MenuRootElement> & RefAttributes<MenuRootElement>> = /* @__PURE__ */ forwardRef(MenuRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuSubmenuRootElement, type MenuSubmenuRootElement, type MenuSubmenuRootProps as MenuSubmenuRootElementProps, type MenuSubmenuRootEvents } from '@prosekit/web/menu';\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/** Props for the {@link MenuSubmenuRoot} Preact component. */\nexport interface MenuSubmenuRootProps {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: MenuSubmenuRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: MenuSubmenuRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: MenuSubmenuRootElementProps['disabled'];\n /** Emitted when the submenu is opened or closed. */\n onOpenChange?: (event: MenuSubmenuRootEvents['openChange']) => void;\n}\n\nfunction MenuSubmenuRootComponent(props: MenuSubmenuRootProps, forwardedRef: Ref<MenuSubmenuRootElement>) {\n registerMenuSubmenuRootElement();\n\n const elementRef = useRef<MenuSubmenuRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });\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 ['openChange'].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: MenuSubmenuRootElement | 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-menu-submenu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-menu-submenu-root` custom element. */\nexport const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & HTMLAttributes<MenuSubmenuRootElement> & RefAttributes<MenuSubmenuRootElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuSubmenuTriggerElement, type MenuSubmenuTriggerElement, type MenuSubmenuTriggerProps as MenuSubmenuTriggerElementProps } from '@prosekit/web/menu';\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/** Props for the {@link MenuSubmenuTrigger} Preact component. */\nexport interface MenuSubmenuTriggerProps {\n /**\n * The unique value for this submenu trigger in the parent menu.\n *\n * @default \"\"\n */\n value?: MenuSubmenuTriggerElementProps['value'];\n /**\n * Whether this submenu trigger is disabled.\n *\n * @default false\n */\n disabled?: MenuSubmenuTriggerElementProps['disabled'];\n}\n\nfunction MenuSubmenuTriggerComponent(props: MenuSubmenuTriggerProps, forwardedRef: Ref<MenuSubmenuTriggerElement>) {\n registerMenuSubmenuTriggerElement();\n\n const elementRef = useRef<MenuSubmenuTriggerElement>(null);\n\n const { disabled: p0, value: p1, ...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 });\n\n const mergedRef = useCallback(\n (element: MenuSubmenuTriggerElement | 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-menu-submenu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-menu-submenu-trigger` custom element. */\nexport const MenuSubmenuTrigger: ForwardRefExoticComponent<MenuSubmenuTriggerProps & HTMLAttributes<MenuSubmenuTriggerElement> & RefAttributes<MenuSubmenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuTriggerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerMenuTriggerElement, type MenuTriggerElement, type MenuTriggerProps as MenuTriggerElementProps, type MenuTriggerEvents } from '@prosekit/web/menu';\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/** Props for the {@link MenuTrigger} Preact component. */\nexport interface MenuTriggerProps {\n /**\n * Whether the component should ignore user interaction.\n *\n * @default false\n */\n disabled?: MenuTriggerElementProps['disabled'];\n /** Emitted when the menu is opened or closed. */\n onOpenChange?: (event: MenuTriggerEvents['openChange']) => void;\n}\n\nfunction MenuTriggerComponent(props: MenuTriggerProps, forwardedRef: Ref<MenuTriggerElement>) {\n registerMenuTriggerElement();\n\n const elementRef = useRef<MenuTriggerElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { disabled: p0, onOpenChange: 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 });\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 ['openChange'].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: MenuTriggerElement | 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-menu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-menu-trigger` custom element. */\nexport const MenuTrigger: ForwardRefExoticComponent<MenuTriggerProps & HTMLAttributes<MenuTriggerElement> & RefAttributes<MenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuTriggerComponent);\n"],"mappings":";;;;AA+BA,SAAS,kBAAkB,OAAsB,cAAoC;AACnF,0BAAyB;CAEzB,MAAM,aAAa,OAAwB,KAAK;CAChD,MAAM,cAAc,OAAoD,EAAE,CAAC;CAE3E,MAAM,EAAE,eAAe,IAAI,UAAU,IAAI,OAAO,IAAI,UAAU,IAAI,GAAG,cAAc;AAEnF,uBAAsB;EACpB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;AACd,SAAO,OAAO,SAAS;GAAE,eAAe;GAAI,UAAU;GAAI,OAAO;GAAI,CAAC;AACtE,cAAY,UAAU,CAAC,GAAG;GAC1B;AAEF,uBAAsB;EACpB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;EACd,MAAM,KAAK,IAAI,iBAAiB;AAChC,OAAK,MAAM,CAAC,OAAO,cAAc,CAAC,SAAS,CAAC,SAAS,CACnD,SAAQ,iBACN,YACC,UAAiB;AAChB,eAAY,QAAQ,SAAS,MAAM;KAErC,EAAE,QAAQ,GAAG,QAAQ,CACtB;AAEH,eAAa,GAAG,OAAO;IACtB,EAAE,CAAC;CAEN,MAAM,YAAY,aACf,YAAoC;AACnC,aAAW,UAAU;AACrB,MAAI,OAAO,iBAAiB,WAC1B,cAAa,QAAQ;WACZ,aACT,cAAa,UAAU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,sBAAsB;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;AAI9G,MAAa,WAA0J,2BAAW,kBAAkB;AC5DpM,SAAS,mBAAmB,OAAuB,cAAqC;AACtF,2BAA0B;CAE1B,MAAM,aAAa,OAAyB,KAAK;CAEjD,MAAM,EAAE,aAAa,IAAI,GAAG,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jCpO,SAAS,qBAAqB,OAAyB,cAAuC;AAC5F,6BAA4B;CAE5B,MAAM,aAAa,OAA2B,KAAK;CACnD,MAAM,cAAc,OAAoD,EAAE,CAAC;CAE3E,MAAM,EAAE,UAAU,IAAI,cAAc,IAAI,GAAG,cAAc;AAEzD,uBAAsB;EACpB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;AACd,SAAO,OAAO,SAAS,EAAE,UAAU,IAAI,CAAC;AACxC,cAAY,UAAU,CAAC,GAAG;GAC1B;AAEF,uBAAsB;EACpB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;EACd,MAAM,KAAK,IAAI,iBAAiB;AAChC,OAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,CAAC,SAAS,CACvD,SAAQ,iBACN,YACC,UAAiB;AAChB,eAAY,QAAQ,SAAS,MAAM;KAErC,EAAE,QAAQ,GAAG,QAAQ,CACtB;AAEH,eAAa,GAAG,OAAO;IACtB,EAAE,CAAC;CAEN,MAAM,YAAY,aACf,YAAuC;AACtC,aAAW,UAAU;AACrB,MAAI,OAAO,iBAAiB,WAC1B,cAAa,QAAQ;WACZ,aACT,cAAa,UAAU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,yBAAyB;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;AAIjH,MAAa,cAAoJ,2BAAW,qBAAqB"}
|
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
import { HTMLAttributes } from "preact";
|
|
2
2
|
import { ForwardRefExoticComponent, RefAttributes } from "preact/compat";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
interface PopoverPopupProps extends HTMLAttributes<PopoverPopupElement> {}
|
|
12
|
-
/**
|
|
13
|
-
* A Preact component that renders an `prosekit-popover-popup` custom element.
|
|
14
|
-
*
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
declare const PopoverPopup: ForwardRefExoticComponent<PopoverPopupProps & RefAttributes<PopoverPopupElement>>;
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/components/popover/popover-positioner.gen.d.ts
|
|
20
|
-
/**
|
|
21
|
-
* Props for the {@link PopoverPositioner} Preact component.
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
interface PopoverPositionerProps extends HTMLAttributes<PopoverPositionerElement> {
|
|
3
|
+
import { PopoverPopupElement, PopoverPositionerElement, PopoverPositionerProps as PopoverPositionerProps$1, PopoverRootElement, PopoverRootEvents, PopoverRootProps as PopoverRootProps$1, PopoverTriggerElement, PopoverTriggerEvents, PopoverTriggerProps as PopoverTriggerProps$1 } from "@prosekit/web/popover";
|
|
4
|
+
/** Props for the {@link PopoverPopup} Preact component. */
|
|
5
|
+
interface PopoverPopupProps {}
|
|
6
|
+
/** A Preact component that renders an `prosekit-popover-popup` custom element. */
|
|
7
|
+
declare const PopoverPopup: ForwardRefExoticComponent<PopoverPopupProps & HTMLAttributes<PopoverPopupElement> & RefAttributes<PopoverPopupElement>>;
|
|
8
|
+
/** Props for the {@link PopoverPositioner} Preact component. */
|
|
9
|
+
interface PopoverPositionerProps {
|
|
26
10
|
/**
|
|
27
11
|
* The strategy to use for positioning
|
|
28
12
|
*
|
|
@@ -151,20 +135,10 @@ interface PopoverPositionerProps extends HTMLAttributes<PopoverPositionerElement
|
|
|
151
135
|
*/
|
|
152
136
|
altBoundary?: PopoverPositionerProps$1['altBoundary'];
|
|
153
137
|
}
|
|
154
|
-
/**
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
*/
|
|
159
|
-
declare const PopoverPositioner: ForwardRefExoticComponent<PopoverPositionerProps & RefAttributes<PopoverPositionerElement>>;
|
|
160
|
-
//#endregion
|
|
161
|
-
//#region src/components/popover/popover-root.gen.d.ts
|
|
162
|
-
/**
|
|
163
|
-
* Props for the {@link PopoverRoot} Preact component.
|
|
164
|
-
*
|
|
165
|
-
* @public
|
|
166
|
-
*/
|
|
167
|
-
interface PopoverRootProps extends HTMLAttributes<PopoverRootElement> {
|
|
138
|
+
/** A Preact component that renders an `prosekit-popover-positioner` custom element. */
|
|
139
|
+
declare const PopoverPositioner: ForwardRefExoticComponent<PopoverPositionerProps & HTMLAttributes<PopoverPositionerElement> & RefAttributes<PopoverPositionerElement>>;
|
|
140
|
+
/** Props for the {@link PopoverRoot} Preact component. */
|
|
141
|
+
interface PopoverRootProps {
|
|
168
142
|
/**
|
|
169
143
|
* Whether the popover should be modal.
|
|
170
144
|
* When true, the popover will trap focus and prevent interaction with the rest of the page.
|
|
@@ -190,20 +164,10 @@ interface PopoverRootProps extends HTMLAttributes<PopoverRootElement> {
|
|
|
190
164
|
/** Emitted when the popover is opened or closed. */
|
|
191
165
|
onOpenChange?: (event: PopoverRootEvents['openChange']) => void;
|
|
192
166
|
}
|
|
193
|
-
/**
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
*/
|
|
198
|
-
declare const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & RefAttributes<PopoverRootElement>>;
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region src/components/popover/popover-trigger.gen.d.ts
|
|
201
|
-
/**
|
|
202
|
-
* Props for the {@link PopoverTrigger} Preact component.
|
|
203
|
-
*
|
|
204
|
-
* @public
|
|
205
|
-
*/
|
|
206
|
-
interface PopoverTriggerProps extends HTMLAttributes<PopoverTriggerElement> {
|
|
167
|
+
/** A Preact component that renders an `prosekit-popover-root` custom element. */
|
|
168
|
+
declare const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & HTMLAttributes<PopoverRootElement> & RefAttributes<PopoverRootElement>>;
|
|
169
|
+
/** Props for the {@link PopoverTrigger} Preact component. */
|
|
170
|
+
interface PopoverTriggerProps {
|
|
207
171
|
/**
|
|
208
172
|
* Whether the component should ignore user interaction.
|
|
209
173
|
* @default false
|
|
@@ -229,12 +193,7 @@ interface PopoverTriggerProps extends HTMLAttributes<PopoverTriggerElement> {
|
|
|
229
193
|
/** Emitted when the popover is opened or closed. */
|
|
230
194
|
onOpenChange?: (event: PopoverTriggerEvents['openChange']) => void;
|
|
231
195
|
}
|
|
232
|
-
/**
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
* @public
|
|
236
|
-
*/
|
|
237
|
-
declare const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & RefAttributes<PopoverTriggerElement>>;
|
|
238
|
-
//#endregion
|
|
239
|
-
export { OpenChangeEvent, PopoverPopup, type PopoverPopupProps, PopoverPositioner, type PopoverPositionerProps, PopoverRoot, type PopoverRootEvents, type PopoverRootProps, PopoverTrigger, type PopoverTriggerEvents, type PopoverTriggerProps };
|
|
196
|
+
/** A Preact component that renders an `prosekit-popover-trigger` custom element. */
|
|
197
|
+
declare const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & HTMLAttributes<PopoverTriggerElement> & RefAttributes<PopoverTriggerElement>>;
|
|
198
|
+
export { PopoverPopup, type PopoverPopupProps, PopoverPositioner, type PopoverPositionerProps, PopoverRoot, type PopoverRootProps, PopoverTrigger, type PopoverTriggerProps };
|
|
240
199
|
//# sourceMappingURL=prosekit-preact-popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-preact-popover.d.ts","names":[],"sources":["../src/components/popover/popover-popup.gen.ts","../src/components/popover/popover-positioner.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prosekit-preact-popover.d.ts","names":[],"sources":["../src/components/popover/popover-popup.gen.ts","../src/components/popover/popover-positioner.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts"],"mappings":";;;;UAQiB,iBAAA;;cAyBJ,YAAA,EAAc,yBAAA,CAA0B,iBAAA,GAAoB,cAAA,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C1EzG,mBAAA;EHAiB;;;;EGKhC,QAAA,GAAW,qBAAA;EHoByL;;;;EGfpM,WAAA,GAAc,qBAAA;EHe6G;;;;;EGT3H,KAAA,GAAQ,qBAAA;EHS2C;;;;;EGHnD,UAAA,GAAa,qBAAA;EHGiI;EGD9I,YAAA,IAAgB,KAAA,EAAO,oBAAA;AAAA;;cAkDZ,cAAA,EAAgB,yBAAA,CAA0B,mBAAA,GAAsB,cAAA,CAAe,qBAAA,IAAyB,aAAA,CAAc,qBAAA"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { createElement } from "preact";
|
|
2
2
|
import { useCallback, useLayoutEffect, useRef } from "preact/hooks";
|
|
3
3
|
import { forwardRef } from "preact/compat";
|
|
4
|
-
import {
|
|
5
|
-
//#region src/components/popover/popover-popup.gen.ts
|
|
6
|
-
/**
|
|
7
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
8
|
-
*/
|
|
4
|
+
import { registerPopoverPopupElement, registerPopoverPositionerElement, registerPopoverRootElement, registerPopoverTriggerElement } from "@prosekit/web/popover";
|
|
9
5
|
function PopoverPopupComponent(props, forwardedRef) {
|
|
10
6
|
registerPopoverPopupElement();
|
|
11
7
|
const elementRef = useRef(null);
|
|
@@ -21,17 +17,8 @@ function PopoverPopupComponent(props, forwardedRef) {
|
|
|
21
17
|
suppressHydrationWarning: true
|
|
22
18
|
});
|
|
23
19
|
}
|
|
24
|
-
/**
|
|
25
|
-
* A Preact component that renders an `prosekit-popover-popup` custom element.
|
|
26
|
-
*
|
|
27
|
-
* @public
|
|
28
|
-
*/
|
|
20
|
+
/** A Preact component that renders an `prosekit-popover-popup` custom element. */
|
|
29
21
|
const PopoverPopup = /* @__PURE__ */ forwardRef(PopoverPopupComponent);
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/components/popover/popover-positioner.gen.ts
|
|
32
|
-
/**
|
|
33
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
34
|
-
*/
|
|
35
22
|
function PopoverPositionerComponent(props, forwardedRef) {
|
|
36
23
|
registerPopoverPositionerElement();
|
|
37
24
|
const elementRef = useRef(null);
|
|
@@ -71,17 +58,8 @@ function PopoverPositionerComponent(props, forwardedRef) {
|
|
|
71
58
|
suppressHydrationWarning: true
|
|
72
59
|
});
|
|
73
60
|
}
|
|
74
|
-
/**
|
|
75
|
-
* A Preact component that renders an `prosekit-popover-positioner` custom element.
|
|
76
|
-
*
|
|
77
|
-
* @public
|
|
78
|
-
*/
|
|
61
|
+
/** A Preact component that renders an `prosekit-popover-positioner` custom element. */
|
|
79
62
|
const PopoverPositioner = /* @__PURE__ */ forwardRef(PopoverPositionerComponent);
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/components/popover/popover-root.gen.ts
|
|
82
|
-
/**
|
|
83
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
84
|
-
*/
|
|
85
63
|
function PopoverRootComponent(props, forwardedRef) {
|
|
86
64
|
registerPopoverRootElement();
|
|
87
65
|
const elementRef = useRef(null);
|
|
@@ -118,17 +96,8 @@ function PopoverRootComponent(props, forwardedRef) {
|
|
|
118
96
|
suppressHydrationWarning: true
|
|
119
97
|
});
|
|
120
98
|
}
|
|
121
|
-
/**
|
|
122
|
-
* A Preact component that renders an `prosekit-popover-root` custom element.
|
|
123
|
-
*
|
|
124
|
-
* @public
|
|
125
|
-
*/
|
|
99
|
+
/** A Preact component that renders an `prosekit-popover-root` custom element. */
|
|
126
100
|
const PopoverRoot = /* @__PURE__ */ forwardRef(PopoverRootComponent);
|
|
127
|
-
//#endregion
|
|
128
|
-
//#region src/components/popover/popover-trigger.gen.ts
|
|
129
|
-
/**
|
|
130
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
131
|
-
*/
|
|
132
101
|
function PopoverTriggerComponent(props, forwardedRef) {
|
|
133
102
|
registerPopoverTriggerElement();
|
|
134
103
|
const elementRef = useRef(null);
|
|
@@ -165,13 +134,8 @@ function PopoverTriggerComponent(props, forwardedRef) {
|
|
|
165
134
|
suppressHydrationWarning: true
|
|
166
135
|
});
|
|
167
136
|
}
|
|
168
|
-
/**
|
|
169
|
-
* A Preact component that renders an `prosekit-popover-trigger` custom element.
|
|
170
|
-
*
|
|
171
|
-
* @public
|
|
172
|
-
*/
|
|
137
|
+
/** A Preact component that renders an `prosekit-popover-trigger` custom element. */
|
|
173
138
|
const PopoverTrigger = /* @__PURE__ */ forwardRef(PopoverTriggerComponent);
|
|
174
|
-
|
|
175
|
-
export { OpenChangeEvent, PopoverPopup, PopoverPositioner, PopoverRoot, PopoverTrigger };
|
|
139
|
+
export { PopoverPopup, PopoverPositioner, PopoverRoot, PopoverTrigger };
|
|
176
140
|
|
|
177
141
|
//# sourceMappingURL=prosekit-preact-popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-preact-popover.js","names":[],"sources":["../src/components/popover/popover-popup.gen.ts","../src/components/popover/popover-positioner.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts"],"sourcesContent":["/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerPopoverPopupElement, type PopoverPopupElement } from '@prosekit/web/popover';\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 PopoverPopup} Preact component.\n *\n * @public\n */\nexport interface PopoverPopupProps extends HTMLAttributes<PopoverPopupElement> {}\n\nfunction PopoverPopupComponent(props: PopoverPopupProps, forwardedRef: Ref<PopoverPopupElement>) {\n registerPopoverPopupElement();\n\n const elementRef = useRef<PopoverPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: PopoverPopupElement | 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-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-popover-popup` custom element.\n *\n * @public\n */\nexport const PopoverPopup: ForwardRefExoticComponent<PopoverPopupProps & RefAttributes<PopoverPopupElement>> = /* @__PURE__ */ forwardRef(PopoverPopupComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerPopoverPositionerElement, type PopoverPositionerElement, type PopoverPositionerProps as PopoverPositionerElementProps } from '@prosekit/web/popover';\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 PopoverPositioner} Preact component.\n *\n * @public\n */\nexport interface PopoverPositionerProps extends HTMLAttributes<PopoverPositionerElement> {\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: PopoverPositionerElementProps['strategy'];\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: PopoverPositionerElementProps['placement'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: PopoverPositionerElementProps['autoUpdate'];\n /**\n * Whether to use the browser Popover API to place the floating element on\n * top of other page content.\n *\n * @default true\n */\n hoist?: PopoverPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: PopoverPositionerElementProps['offset'];\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?: PopoverPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: PopoverPositionerElementProps['inline'];\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?: PopoverPositionerElementProps['hide'];\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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['altBoundary'];\n}\n\nfunction PopoverPositionerComponent(props: PopoverPositionerProps, forwardedRef: Ref<PopoverPositionerElement>) {\n registerPopoverPositionerElement();\n\n const elementRef = useRef<PopoverPositionerElement>(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: PopoverPositionerElement | 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-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-popover-positioner` custom element.\n *\n * @public\n */\nexport const PopoverPositioner: ForwardRefExoticComponent<PopoverPositionerProps & RefAttributes<PopoverPositionerElement>> = /* @__PURE__ */ forwardRef(PopoverPositionerComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerPopoverRootElement, type PopoverRootElement, type PopoverRootProps as PopoverRootElementProps, type PopoverRootEvents } from '@prosekit/web/popover';\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 PopoverRoot} Preact component.\n *\n * @public\n */\nexport interface PopoverRootProps extends HTMLAttributes<PopoverRootElement> {\n /**\n * Whether the popover should be modal.\n * When true, the popover will trap focus and prevent interaction with the rest of the page.\n *\n * @default false\n */\n modal?: PopoverRootElementProps['modal'];\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: PopoverRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: PopoverRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: PopoverRootElementProps['disabled'];\n /** Emitted when the popover is opened or closed. */\n onOpenChange?: (event: PopoverRootEvents['openChange']) => void;\n}\n\nfunction PopoverRootComponent(props: PopoverRootProps, forwardedRef: Ref<PopoverRootElement>) {\n registerPopoverRootElement();\n\n const elementRef = useRef<PopoverRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, modal: p2, open: p3, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, modal: p2, open: p3 });\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 ['openChange'].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: PopoverRootElement | 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-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-popover-root` custom element.\n *\n * @public\n */\nexport const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & RefAttributes<PopoverRootElement>> = /* @__PURE__ */ forwardRef(PopoverRootComponent);\n\nexport type { PopoverRootEvents };\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerPopoverTriggerElement, type PopoverTriggerElement, type PopoverTriggerProps as PopoverTriggerElementProps, type PopoverTriggerEvents } from '@prosekit/web/popover';\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 PopoverTrigger} Preact component.\n *\n * @public\n */\nexport interface PopoverTriggerProps extends HTMLAttributes<PopoverTriggerElement> {\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: PopoverTriggerElementProps['disabled'];\n /**\n * Whether the popover should also open when the trigger is hovered.\n * @default false\n */\n openOnHover?: PopoverTriggerElementProps['openOnHover'];\n /**\n * The delay in milliseconds before opening the popover when hovering.\n * Only applies when `openOnHover` is true.\n * @default 300\n */\n delay?: PopoverTriggerElementProps['delay'];\n /**\n * The delay in milliseconds before closing the popover when hover ends.\n * Only applies when `openOnHover` is true.\n * @default 0\n */\n closeDelay?: PopoverTriggerElementProps['closeDelay'];\n /** Emitted when the popover is opened or closed. */\n onOpenChange?: (event: PopoverTriggerEvents['openChange']) => void;\n}\n\nfunction PopoverTriggerComponent(props: PopoverTriggerProps, forwardedRef: Ref<PopoverTriggerElement>) {\n registerPopoverTriggerElement();\n\n const elementRef = useRef<PopoverTriggerElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3 });\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 ['openChange'].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: PopoverTriggerElement | 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-popover-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A Preact component that renders an `prosekit-popover-trigger` custom element.\n *\n * @public\n */\nexport const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & RefAttributes<PopoverTriggerElement>> = /* @__PURE__ */ forwardRef(PopoverTriggerComponent);\n\nexport type { PopoverTriggerEvents };\n"],"mappings":";;;;;;;;AAgBA,SAAS,sBAAsB,OAA0B,cAAwC;AAC/F,8BAA6B;CAE7B,MAAM,aAAa,OAA4B,KAAK;CAEpD,MAAM,EAAE,GAAG,cAAc;CAEzB,MAAM,YAAY,aACf,YAAwC;AACvC,aAAW,UAAU;AACrB,MAAI,OAAO,iBAAiB,WAC1B,cAAa,QAAQ;WACZ,aACT,cAAa,UAAU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,0BAA0B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;;;;;AAQlH,MAAa,eAAkH,2BAAW,sBAAsB;;;;;;ACqGhK,SAAS,2BAA2B,OAA+B,cAA6C;AAC9G,mCAAkC;CAElC,MAAM,aAAa,OAAiC,KAAK;CAEzD,MAAM,EAAE,aAAa,IAAI,YAAY,IAAI,UAAU,IAAI,gBAAgB,IAAI,aAAa,IAAI,MAAM,IAAI,MAAM,IAAI,OAAO,IAAI,QAAQ,IAAI,QAAQ,IAAI,iBAAiB,KAAK,SAAS,K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AU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,4BAA4B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;;;;;AAQpH,MAAa,iBAAwH,2BAAW,wBAAwB"}
|
|
1
|
+
{"version":3,"file":"prosekit-preact-popover.js","names":[],"sources":["../src/components/popover/popover-popup.gen.ts","../src/components/popover/popover-positioner.gen.ts","../src/components/popover/popover-root.gen.ts","../src/components/popover/popover-trigger.gen.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverPopupElement, type PopoverPopupElement } from '@prosekit/web/popover';\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/** Props for the {@link PopoverPopup} Preact component. */\nexport interface PopoverPopupProps {}\n\nfunction PopoverPopupComponent(props: PopoverPopupProps, forwardedRef: Ref<PopoverPopupElement>) {\n registerPopoverPopupElement();\n\n const elementRef = useRef<PopoverPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: PopoverPopupElement | 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-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-popover-popup` custom element. */\nexport const PopoverPopup: ForwardRefExoticComponent<PopoverPopupProps & HTMLAttributes<PopoverPopupElement> & RefAttributes<PopoverPopupElement>> = /* @__PURE__ */ forwardRef(PopoverPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverPositionerElement, type PopoverPositionerElement, type PopoverPositionerProps as PopoverPositionerElementProps } from '@prosekit/web/popover';\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/** Props for the {@link PopoverPositioner} Preact component. */\nexport interface PopoverPositionerProps {\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: PopoverPositionerElementProps['strategy'];\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: PopoverPositionerElementProps['placement'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: PopoverPositionerElementProps['autoUpdate'];\n /**\n * Whether to use the browser Popover API to place the floating element on\n * top of other page content.\n *\n * @default true\n */\n hoist?: PopoverPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: PopoverPositionerElementProps['offset'];\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?: PopoverPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: PopoverPositionerElementProps['inline'];\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?: PopoverPositionerElementProps['hide'];\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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['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?: PopoverPositionerElementProps['altBoundary'];\n}\n\nfunction PopoverPositionerComponent(props: PopoverPositionerProps, forwardedRef: Ref<PopoverPositionerElement>) {\n registerPopoverPositionerElement();\n\n const elementRef = useRef<PopoverPositionerElement>(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: PopoverPositionerElement | 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-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-popover-positioner` custom element. */\nexport const PopoverPositioner: ForwardRefExoticComponent<PopoverPositionerProps & HTMLAttributes<PopoverPositionerElement> & RefAttributes<PopoverPositionerElement>> = /* @__PURE__ */ forwardRef(PopoverPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverRootElement, type PopoverRootElement, type PopoverRootProps as PopoverRootElementProps, type PopoverRootEvents } from '@prosekit/web/popover';\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/** Props for the {@link PopoverRoot} Preact component. */\nexport interface PopoverRootProps {\n /**\n * Whether the popover should be modal.\n * When true, the popover will trap focus and prevent interaction with the rest of the page.\n *\n * @default false\n */\n modal?: PopoverRootElementProps['modal'];\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: PopoverRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: PopoverRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: PopoverRootElementProps['disabled'];\n /** Emitted when the popover is opened or closed. */\n onOpenChange?: (event: PopoverRootEvents['openChange']) => void;\n}\n\nfunction PopoverRootComponent(props: PopoverRootProps, forwardedRef: Ref<PopoverRootElement>) {\n registerPopoverRootElement();\n\n const elementRef = useRef<PopoverRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, modal: p2, open: p3, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, modal: p2, open: p3 });\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 ['openChange'].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: PopoverRootElement | 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-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-popover-root` custom element. */\nexport const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & HTMLAttributes<PopoverRootElement> & RefAttributes<PopoverRootElement>> = /* @__PURE__ */ forwardRef(PopoverRootComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerPopoverTriggerElement, type PopoverTriggerElement, type PopoverTriggerProps as PopoverTriggerElementProps, type PopoverTriggerEvents } from '@prosekit/web/popover';\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/** Props for the {@link PopoverTrigger} Preact component. */\nexport interface PopoverTriggerProps {\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: PopoverTriggerElementProps['disabled'];\n /**\n * Whether the popover should also open when the trigger is hovered.\n * @default false\n */\n openOnHover?: PopoverTriggerElementProps['openOnHover'];\n /**\n * The delay in milliseconds before opening the popover when hovering.\n * Only applies when `openOnHover` is true.\n * @default 300\n */\n delay?: PopoverTriggerElementProps['delay'];\n /**\n * The delay in milliseconds before closing the popover when hover ends.\n * Only applies when `openOnHover` is true.\n * @default 0\n */\n closeDelay?: PopoverTriggerElementProps['closeDelay'];\n /** Emitted when the popover is opened or closed. */\n onOpenChange?: (event: PopoverTriggerEvents['openChange']) => void;\n}\n\nfunction PopoverTriggerComponent(props: PopoverTriggerProps, forwardedRef: Ref<PopoverTriggerElement>) {\n registerPopoverTriggerElement();\n\n const elementRef = useRef<PopoverTriggerElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { closeDelay: p0, delay: p1, disabled: p2, openOnHover: p3 });\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 ['openChange'].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: PopoverTriggerElement | 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-popover-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A Preact component that renders an `prosekit-popover-trigger` custom element. */\nexport const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & HTMLAttributes<PopoverTriggerElement> & RefAttributes<PopoverTriggerElement>> = /* @__PURE__ */ forwardRef(PopoverTriggerComponent);\n"],"mappings":";;;;AAUA,SAAS,sBAAsB,OAA0B,cAAwC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