@prosekit/preact 0.7.0-beta.3 → 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.
Files changed (94) hide show
  1. package/dist/editor-context.js +0 -2
  2. package/dist/editor-context.js.map +1 -1
  3. package/dist/prosekit-preact-autocomplete.d.ts +10 -61
  4. package/dist/prosekit-preact-autocomplete.d.ts.map +1 -1
  5. package/dist/prosekit-preact-autocomplete.js +5 -50
  6. package/dist/prosekit-preact-autocomplete.js.map +1 -1
  7. package/dist/prosekit-preact-block-handle.d.ts +10 -61
  8. package/dist/prosekit-preact-block-handle.d.ts.map +1 -1
  9. package/dist/prosekit-preact-block-handle.js +5 -50
  10. package/dist/prosekit-preact-block-handle.js.map +1 -1
  11. package/dist/prosekit-preact-drop-indicator.d.ts +2 -13
  12. package/dist/prosekit-preact-drop-indicator.d.ts.map +1 -1
  13. package/dist/prosekit-preact-drop-indicator.js +1 -10
  14. package/dist/prosekit-preact-drop-indicator.js.map +1 -1
  15. package/dist/prosekit-preact-inline-popover.d.ts +6 -37
  16. package/dist/prosekit-preact-inline-popover.d.ts.map +1 -1
  17. package/dist/prosekit-preact-inline-popover.js +3 -30
  18. package/dist/prosekit-preact-inline-popover.js.map +1 -1
  19. package/dist/prosekit-preact-menu.d.ts +48 -88
  20. package/dist/prosekit-preact-menu.d.ts.map +1 -1
  21. package/dist/prosekit-preact-menu.js +37 -72
  22. package/dist/prosekit-preact-menu.js.map +1 -1
  23. package/dist/prosekit-preact-popover.d.ts +8 -49
  24. package/dist/prosekit-preact-popover.d.ts.map +1 -1
  25. package/dist/prosekit-preact-popover.js +4 -40
  26. package/dist/prosekit-preact-popover.js.map +1 -1
  27. package/dist/prosekit-preact-resizable.d.ts +4 -25
  28. package/dist/prosekit-preact-resizable.d.ts.map +1 -1
  29. package/dist/prosekit-preact-resizable.js +2 -20
  30. package/dist/prosekit-preact-resizable.js.map +1 -1
  31. package/dist/prosekit-preact-table-handle.d.ts +22 -133
  32. package/dist/prosekit-preact-table-handle.d.ts.map +1 -1
  33. package/dist/prosekit-preact-table-handle.js +11 -110
  34. package/dist/prosekit-preact-table-handle.js.map +1 -1
  35. package/dist/prosekit-preact-tooltip.d.ts +8 -49
  36. package/dist/prosekit-preact-tooltip.d.ts.map +1 -1
  37. package/dist/prosekit-preact-tooltip.js +4 -40
  38. package/dist/prosekit-preact-tooltip.js.map +1 -1
  39. package/dist/prosekit-preact.d.ts +0 -21
  40. package/dist/prosekit-preact.d.ts.map +1 -1
  41. package/dist/prosekit-preact.js +0 -26
  42. package/dist/prosekit-preact.js.map +1 -1
  43. package/package.json +5 -5
  44. package/src/components/autocomplete/autocomplete-empty.gen.ts +3 -13
  45. package/src/components/autocomplete/autocomplete-item.gen.ts +3 -13
  46. package/src/components/autocomplete/autocomplete-popup.gen.ts +3 -13
  47. package/src/components/autocomplete/autocomplete-positioner.gen.ts +3 -13
  48. package/src/components/autocomplete/autocomplete-root.gen.ts +3 -13
  49. package/src/components/autocomplete/index.gen.ts +1 -3
  50. package/src/components/block-handle/block-handle-add.gen.ts +3 -13
  51. package/src/components/block-handle/block-handle-draggable.gen.ts +3 -13
  52. package/src/components/block-handle/block-handle-popup.gen.ts +3 -13
  53. package/src/components/block-handle/block-handle-positioner.gen.ts +3 -13
  54. package/src/components/block-handle/block-handle-root.gen.ts +3 -13
  55. package/src/components/block-handle/index.gen.ts +1 -3
  56. package/src/components/drop-indicator/drop-indicator.gen.ts +3 -13
  57. package/src/components/drop-indicator/index.gen.ts +1 -3
  58. package/src/components/inline-popover/index.gen.ts +1 -3
  59. package/src/components/inline-popover/inline-popover-popup.gen.ts +3 -13
  60. package/src/components/inline-popover/inline-popover-positioner.gen.ts +3 -13
  61. package/src/components/inline-popover/inline-popover-root.gen.ts +3 -13
  62. package/src/components/menu/index.gen.ts +1 -3
  63. package/src/components/menu/menu-item.gen.ts +3 -13
  64. package/src/components/menu/menu-popup.gen.ts +3 -13
  65. package/src/components/menu/menu-positioner.gen.ts +3 -13
  66. package/src/components/menu/menu-root.gen.ts +3 -13
  67. package/src/components/menu/menu-submenu-root.gen.ts +49 -17
  68. package/src/components/menu/menu-submenu-trigger.gen.ts +27 -18
  69. package/src/components/menu/menu-trigger.gen.ts +3 -13
  70. package/src/components/popover/index.gen.ts +1 -3
  71. package/src/components/popover/popover-popup.gen.ts +3 -13
  72. package/src/components/popover/popover-positioner.gen.ts +3 -13
  73. package/src/components/popover/popover-root.gen.ts +3 -13
  74. package/src/components/popover/popover-trigger.gen.ts +3 -13
  75. package/src/components/resizable/index.gen.ts +1 -3
  76. package/src/components/resizable/resizable-handle.gen.ts +3 -13
  77. package/src/components/resizable/resizable-root.gen.ts +3 -13
  78. package/src/components/table-handle/index.gen.ts +1 -3
  79. package/src/components/table-handle/table-handle-column-menu-root.gen.ts +3 -13
  80. package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +3 -13
  81. package/src/components/table-handle/table-handle-column-popup.gen.ts +3 -13
  82. package/src/components/table-handle/table-handle-column-positioner.gen.ts +3 -13
  83. package/src/components/table-handle/table-handle-drag-preview.gen.ts +3 -13
  84. package/src/components/table-handle/table-handle-drop-indicator.gen.ts +3 -13
  85. package/src/components/table-handle/table-handle-root.gen.ts +3 -13
  86. package/src/components/table-handle/table-handle-row-menu-root.gen.ts +3 -13
  87. package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +3 -13
  88. package/src/components/table-handle/table-handle-row-popup.gen.ts +3 -13
  89. package/src/components/table-handle/table-handle-row-positioner.gen.ts +3 -13
  90. package/src/components/tooltip/index.gen.ts +1 -3
  91. package/src/components/tooltip/tooltip-popup.gen.ts +3 -13
  92. package/src/components/tooltip/tooltip-positioner.gen.ts +3 -13
  93. package/src/components/tooltip/tooltip-root.gen.ts +3 -13
  94. package/src/components/tooltip/tooltip-trigger.gen.ts +3 -13
@@ -2,10 +2,6 @@ import { createElement } from "preact";
2
2
  import { useCallback, useLayoutEffect, useRef } from "preact/hooks";
3
3
  import { forwardRef } from "preact/compat";
4
4
  import { registerMenuItemElement, registerMenuPopupElement, registerMenuPositionerElement, registerMenuRootElement, registerMenuSubmenuRootElement, registerMenuSubmenuTriggerElement, registerMenuTriggerElement } from "@prosekit/web/menu";
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
- */
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 { ...restProps } = props;
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
- //#endregion
272
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 {\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 & Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> & RefAttributes<MenuItemElement>> = /* @__PURE__ */ forwardRef(MenuItemComponent);\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 {\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 & HTMLAttributes<MenuPopupElement> & 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 {\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 & HTMLAttributes<MenuPositionerElement> & 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 {\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 & HTMLAttributes<MenuRootElement> & RefAttributes<MenuRootElement>> = /* @__PURE__ */ forwardRef(MenuRootComponent);\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 {}\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 & HTMLAttributes<MenuSubmenuRootElement> & 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 {}\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 & HTMLAttributes<MenuSubmenuTriggerElement> & 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 {\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 & HTMLAttributes<MenuTriggerElement> & RefAttributes<MenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuTriggerComponent);\n"],"mappings":";;;;;;;;AAqCA,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;GA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iC;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;;;;;AAQzH,MAAa,qBAAgL,2BAAW,4BAA4B;;;;;;AClBpO,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;;;;;;;AAQjH,MAAa,cAAoJ,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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1B;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,27 +1,11 @@
1
1
  import { HTMLAttributes } from "preact";
2
2
  import { ForwardRefExoticComponent, RefAttributes } from "preact/compat";
3
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
-
5
- //#region src/components/popover/popover-popup.gen.d.ts
6
- /**
7
- * Props for the {@link PopoverPopup} Preact component.
8
- *
9
- * @public
10
- */
4
+ /** Props for the {@link PopoverPopup} Preact component. */
11
5
  interface PopoverPopupProps {}
12
- /**
13
- * A Preact component that renders an `prosekit-popover-popup` custom element.
14
- *
15
- * @public
16
- */
6
+ /** A Preact component that renders an `prosekit-popover-popup` custom element. */
17
7
  declare const PopoverPopup: ForwardRefExoticComponent<PopoverPopupProps & HTMLAttributes<PopoverPopupElement> & 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
- */
8
+ /** Props for the {@link PopoverPositioner} Preact component. */
25
9
  interface PopoverPositionerProps {
26
10
  /**
27
11
  * The strategy to use for positioning
@@ -151,19 +135,9 @@ interface PopoverPositionerProps {
151
135
  */
152
136
  altBoundary?: PopoverPositionerProps$1['altBoundary'];
153
137
  }
154
- /**
155
- * A Preact component that renders an `prosekit-popover-positioner` custom element.
156
- *
157
- * @public
158
- */
138
+ /** A Preact component that renders an `prosekit-popover-positioner` custom element. */
159
139
  declare const PopoverPositioner: ForwardRefExoticComponent<PopoverPositionerProps & HTMLAttributes<PopoverPositionerElement> & 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
- */
140
+ /** Props for the {@link PopoverRoot} Preact component. */
167
141
  interface PopoverRootProps {
168
142
  /**
169
143
  * Whether the popover should be modal.
@@ -190,19 +164,9 @@ interface PopoverRootProps {
190
164
  /** Emitted when the popover is opened or closed. */
191
165
  onOpenChange?: (event: PopoverRootEvents['openChange']) => void;
192
166
  }
193
- /**
194
- * A Preact component that renders an `prosekit-popover-root` custom element.
195
- *
196
- * @public
197
- */
167
+ /** A Preact component that renders an `prosekit-popover-root` custom element. */
198
168
  declare const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & HTMLAttributes<PopoverRootElement> & 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
- */
169
+ /** Props for the {@link PopoverTrigger} Preact component. */
206
170
  interface PopoverTriggerProps {
207
171
  /**
208
172
  * Whether the component should ignore user interaction.
@@ -229,12 +193,7 @@ interface PopoverTriggerProps {
229
193
  /** Emitted when the popover is opened or closed. */
230
194
  onOpenChange?: (event: PopoverTriggerEvents['openChange']) => void;
231
195
  }
232
- /**
233
- * A Preact component that renders an `prosekit-popover-trigger` custom element.
234
- *
235
- * @public
236
- */
196
+ /** A Preact component that renders an `prosekit-popover-trigger` custom element. */
237
197
  declare const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & HTMLAttributes<PopoverTriggerElement> & RefAttributes<PopoverTriggerElement>>;
238
- //#endregion
239
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":";;;;;;;;;AA2CA;UA7BiB,iBAAA;;;;;;cA6BJ,YAAA,EAAc,yBAAA,CAA0B,iBAAA,GAAoB,cAAA,CAAe,mBAAA,IAAuB,aAAA,CAAc,mBAAA;;;;;;;AAA7H;UC7BiB,sBAAA;;;;;;EAMf,QAAA,GAAW,wBAAA;EDuBc;;;;;ECjBzB,SAAA,GAAY,wBAAA;EDiB0E;;;;;;;ECTtF,UAAA,GAAa,wBAAA;EApBE;;;;;;EA2Bf,KAAA,GAAQ,wBAAA;EAMC;;;;;EAAT,MAAA,GAAS,wBAAA;EA2CI;;;;;;;;EAlCb,IAAA,GAAO,wBAAA;EAqFoC;;;;;EA/E3C,KAAA,GAAQ,wBAAA;EA5BK;;;;;;EAmCb,OAAA,GAAU,wBAAA;EAPV;;;;;;EAcA,WAAA,GAAc,wBAAA;EAOF;;;;;;EAAZ,SAAA,GAAY,wBAAA;EA4BZ;;;;;;EArBA,UAAA,GAAa,wBAAA;EA2CI;;;;;AA4CnB;EAhFE,MAAA,GAAS,wBAAA;;;;;;;EAOT,IAAA,GAAO,wBAAA;EAyEgD;;;;;;EAlEvD,QAAA,GAAW,wBAAA;EAkE+H;;;;;;EA3D1I,YAAA,GAAe,wBAAA;ECxGgB;;;;;;ED+G/B,eAAA,GAAkB,wBAAA;ECvFsB;;;;;;;ED+FxC,cAAA,GAAiB,wBAAA;ECjGjB;;;;;;;EDyGA,WAAA,GAAc,wBAAA;AAAA;;;;;;cAoCH,iBAAA,EAAmB,yBAAA,CAA0B,sBAAA,GAAyB,cAAA,CAAe,wBAAA,IAA4B,aAAA,CAAc,wBAAA;;;;;;;ADtI5I;UE7BiB,gBAAA;;;;;;;EAOf,KAAA,GAAQ,kBAAA;EFsB0C;;;;EEjBlD,WAAA,GAAc,kBAAA;EFiBwE;;;;EEZtF,IAAA,GAAO,kBAAA;;;;ADjBT;ECsBE,QAAA,GAAW,kBAAA;;EAEX,YAAA,IAAgB,KAAA,EAAO,iBAAA;AAAA;;;;;;cAsDZ,WAAA,EAAa,yBAAA,CAA0B,gBAAA,GAAmB,cAAA,CAAe,kBAAA,IAAsB,aAAA,CAAc,kBAAA;;;;;;;AFjD1H;UG7BiB,mBAAA;;;;;EAKf,QAAA,GAAW,qBAAA;EHwBkG;;;;EGnB7G,WAAA,GAAc,qBAAA;EHmBqC;;;;;EGbnD,KAAA,GAAQ,qBAAA;EHasI;;;;AC7BhJ;EEsBE,UAAA,GAAa,qBAAA;;EAEb,YAAA,IAAgB,KAAA,EAAO,oBAAA;AAAA;;;;;;cAsDZ,cAAA,EAAgB,yBAAA,CAA0B,mBAAA,GAAsB,cAAA,CAAe,qBAAA,IAAyB,aAAA,CAAc,qBAAA"}
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,CAAe,mBAAA,IAAuB,aAAA,CAAc,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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"}
@@ -2,10 +2,6 @@ import { createElement } from "preact";
2
2
  import { useCallback, useLayoutEffect, useRef } from "preact/hooks";
3
3
  import { forwardRef } from "preact/compat";
4
4
  import { registerPopoverPopupElement, registerPopoverPositionerElement, registerPopoverRootElement, registerPopoverTriggerElement } from "@prosekit/web/popover";
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
- */
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
- //#endregion
175
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 {}\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 & HTMLAttributes<PopoverPopupElement> & 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 {\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 & HTMLAttributes<PopoverPositionerElement> & 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 {\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 & HTMLAttributes<PopoverRootElement> & RefAttributes<PopoverRootElement>> = /* @__PURE__ */ forwardRef(PopoverRootComponent);\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 {\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 & HTMLAttributes<PopoverTriggerElement> & RefAttributes<PopoverTriggerElement>> = /* @__PURE__ */ forwardRef(PopoverTriggerComponent);\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,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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,YAA0C;AACzC,aAAW,UAAU;AACrB,MAAI,OAAO,iBAAiB,WAC1B,cAAa,QAAQ;WACZ,aACT,cAAa,UAAU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,4BAA4B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;;;;;AAQpH,MAAa,iBAAgK,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;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;;;AAIlH,MAAa,eAAwJ,2BAAW,sBAAsB;ACyGtM,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,KAAK,WAAW,KAAK,cAAc,KAAK,YAAY,KAAK,WAAW,KAAK,OAAO,KAAK,UAAU,KAAK,GAAG,cAAc;AAEvS,uBAAsB;EACpB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;AACd,SAAO,OAAO,SAAS;GAAE,aAAa;GAAI,YAAY;GAAI,UAAU;GAAI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
  import { ResizableHandleElement, ResizableHandleProps as ResizableHandleProps$1, ResizableRootElement, ResizableRootEvents, ResizableRootProps as ResizableRootProps$1 } from "@prosekit/web/resizable";
4
-
5
- //#region src/components/resizable/resizable-root.gen.d.ts
6
- /**
7
- * Props for the {@link ResizableRoot} Preact component.
8
- *
9
- * @public
10
- */
4
+ /** Props for the {@link ResizableRoot} Preact component. */
11
5
  interface ResizableRootProps {
12
6
  /**
13
7
  * The width of the resizable element.
@@ -32,19 +26,9 @@ interface ResizableRootProps {
32
26
  /** Emitted when a resize operation ends. */
33
27
  onResizeEnd?: (event: ResizableRootEvents['resizeEnd']) => void;
34
28
  }
35
- /**
36
- * A Preact component that renders an `prosekit-resizable-root` custom element.
37
- *
38
- * @public
39
- */
29
+ /** A Preact component that renders an `prosekit-resizable-root` custom element. */
40
30
  declare const ResizableRoot: ForwardRefExoticComponent<ResizableRootProps & HTMLAttributes<ResizableRootElement> & RefAttributes<ResizableRootElement>>;
41
- //#endregion
42
- //#region src/components/resizable/resizable-handle.gen.d.ts
43
- /**
44
- * Props for the {@link ResizableHandle} Preact component.
45
- *
46
- * @public
47
- */
31
+ /** Props for the {@link ResizableHandle} Preact component. */
48
32
  interface ResizableHandleProps {
49
33
  /**
50
34
  * The position of the handle.
@@ -53,12 +37,7 @@ interface ResizableHandleProps {
53
37
  */
54
38
  position?: ResizableHandleProps$1['position'];
55
39
  }
56
- /**
57
- * A Preact component that renders an `prosekit-resizable-handle` custom element.
58
- *
59
- * @public
60
- */
40
+ /** A Preact component that renders an `prosekit-resizable-handle` custom element. */
61
41
  declare const ResizableHandle: ForwardRefExoticComponent<ResizableHandleProps & HTMLAttributes<ResizableHandleElement> & RefAttributes<ResizableHandleElement>>;
62
- //#endregion
63
42
  export { ResizableHandle, type ResizableHandleProps, ResizableRoot, type ResizableRootProps };
64
43
  //# sourceMappingURL=prosekit-preact-resizable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-preact-resizable.d.ts","names":[],"sources":["../src/components/resizable/resizable-root.gen.ts","../src/components/resizable/resizable-handle.gen.ts"],"mappings":";;;;;;;;;;UAciB,kBAAA;EAsBO;;;;;EAhBtB,KAAA,GAAQ,oBAAA;EAMC;;;;;EAAT,MAAA,GAAS,oBAAA;EAUT;;;;;EAJA,WAAA,GAAc,oBAAA;EA0D2L;EAxDzM,aAAA,IAAiB,KAAA,EAAO,mBAAA;EAwD4B;EAtDpD,WAAA,IAAe,KAAA,EAAO,mBAAA;AAAA;;;;;;cAsDX,aAAA,EAAe,yBAAA,CAA0B,kBAAA,GAAqB,cAAA,CAAe,oBAAA,IAAwB,aAAA,CAAc,oBAAA;;;;;;;;UC5E/G,oBAAA;EDsBO;;;;;EChBtB,QAAA,GAAW,sBAAA;AAAA;;;;;;cAoCA,eAAA,EAAiB,yBAAA,CAA0B,oBAAA,GAAuB,cAAA,CAAe,sBAAA,IAA0B,aAAA,CAAc,sBAAA"}
1
+ {"version":3,"file":"prosekit-preact-resizable.d.ts","names":[],"sources":["../src/components/resizable/resizable-root.gen.ts","../src/components/resizable/resizable-handle.gen.ts"],"mappings":";;;;UAQiB,kBAAA;EAAkB;;;;;EAMjC,KAAA,GAAQ,oBAAA;EAgBc;;;;;EAVtB,MAAA,GAAS,oBAAA;EAAA;;;;;EAMT,WAAA,GAAc,oBAAA;EAId;EAFA,aAAA,IAAiB,KAAA,EAAO,mBAAA;EAET;EAAf,WAAA,IAAe,KAAA,EAAO,mBAAA;AAAA;AAkDxB;AAAA,cAAa,aAAA,EAAe,yBAAA,CAA0B,kBAAA,GAAqB,cAAA,CAAe,oBAAA,IAAwB,aAAA,CAAc,oBAAA;;UCxE/G,oBAAA;EDAkB;;;;;ECMjC,QAAA,GAAW,sBAAA;AAAA;;cAgCA,eAAA,EAAiB,yBAAA,CAA0B,oBAAA,GAAuB,cAAA,CAAe,sBAAA,IAA0B,aAAA,CAAc,sBAAA"}