@prosekit/preact 0.7.0-beta.2 → 0.7.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +22 -73
  4. package/dist/prosekit-preact-autocomplete.d.ts.map +1 -1
  5. package/dist/prosekit-preact-autocomplete.js +7 -52
  6. package/dist/prosekit-preact-autocomplete.js.map +1 -1
  7. package/dist/prosekit-preact-block-handle.d.ts +22 -73
  8. package/dist/prosekit-preact-block-handle.d.ts.map +1 -1
  9. package/dist/prosekit-preact-block-handle.js +7 -52
  10. package/dist/prosekit-preact-block-handle.js.map +1 -1
  11. package/dist/prosekit-preact-drop-indicator.d.ts +4 -15
  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 +15 -46
  16. package/dist/prosekit-preact-inline-popover.d.ts.map +1 -1
  17. package/dist/prosekit-preact-inline-popover.js +5 -32
  18. package/dist/prosekit-preact-inline-popover.js.map +1 -1
  19. package/dist/prosekit-preact-menu.d.ts +61 -101
  20. package/dist/prosekit-preact-menu.d.ts.map +1 -1
  21. package/dist/prosekit-preact-menu.js +39 -74
  22. package/dist/prosekit-preact-menu.js.map +1 -1
  23. package/dist/prosekit-preact-popover.d.ts +18 -59
  24. package/dist/prosekit-preact-popover.d.ts.map +1 -1
  25. package/dist/prosekit-preact-popover.js +6 -42
  26. package/dist/prosekit-preact-popover.js.map +1 -1
  27. package/dist/prosekit-preact-resizable.d.ts +10 -31
  28. package/dist/prosekit-preact-resizable.d.ts.map +1 -1
  29. package/dist/prosekit-preact-resizable.js +4 -22
  30. package/dist/prosekit-preact-resizable.js.map +1 -1
  31. package/dist/prosekit-preact-table-handle.d.ts +44 -155
  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 +18 -59
  36. package/dist/prosekit-preact-tooltip.d.ts.map +1 -1
  37. package/dist/prosekit-preact-tooltip.js +6 -42
  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 +5 -15
  45. package/src/components/autocomplete/autocomplete-item.gen.ts +5 -17
  46. package/src/components/autocomplete/autocomplete-popup.gen.ts +5 -17
  47. package/src/components/autocomplete/autocomplete-positioner.gen.ts +5 -15
  48. package/src/components/autocomplete/autocomplete-root.gen.ts +5 -17
  49. package/src/components/autocomplete/index.gen.ts +4 -8
  50. package/src/components/block-handle/block-handle-add.gen.ts +5 -15
  51. package/src/components/block-handle/block-handle-draggable.gen.ts +5 -15
  52. package/src/components/block-handle/block-handle-popup.gen.ts +5 -15
  53. package/src/components/block-handle/block-handle-positioner.gen.ts +5 -15
  54. package/src/components/block-handle/block-handle-root.gen.ts +5 -17
  55. package/src/components/block-handle/index.gen.ts +2 -6
  56. package/src/components/drop-indicator/drop-indicator.gen.ts +5 -15
  57. package/src/components/drop-indicator/index.gen.ts +1 -3
  58. package/src/components/inline-popover/index.gen.ts +2 -6
  59. package/src/components/inline-popover/inline-popover-popup.gen.ts +5 -15
  60. package/src/components/inline-popover/inline-popover-positioner.gen.ts +5 -15
  61. package/src/components/inline-popover/inline-popover-root.gen.ts +6 -18
  62. package/src/components/menu/index.gen.ts +4 -8
  63. package/src/components/menu/menu-item.gen.ts +5 -17
  64. package/src/components/menu/menu-popup.gen.ts +5 -15
  65. package/src/components/menu/menu-positioner.gen.ts +5 -15
  66. package/src/components/menu/menu-root.gen.ts +5 -17
  67. package/src/components/menu/menu-submenu-root.gen.ts +50 -18
  68. package/src/components/menu/menu-submenu-trigger.gen.ts +28 -19
  69. package/src/components/menu/menu-trigger.gen.ts +5 -17
  70. package/src/components/popover/index.gen.ts +3 -7
  71. package/src/components/popover/popover-popup.gen.ts +5 -15
  72. package/src/components/popover/popover-positioner.gen.ts +5 -15
  73. package/src/components/popover/popover-root.gen.ts +5 -17
  74. package/src/components/popover/popover-trigger.gen.ts +5 -17
  75. package/src/components/resizable/index.gen.ts +2 -6
  76. package/src/components/resizable/resizable-handle.gen.ts +5 -15
  77. package/src/components/resizable/resizable-root.gen.ts +5 -17
  78. package/src/components/table-handle/index.gen.ts +1 -3
  79. package/src/components/table-handle/table-handle-column-menu-root.gen.ts +5 -15
  80. package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +5 -15
  81. package/src/components/table-handle/table-handle-column-popup.gen.ts +5 -15
  82. package/src/components/table-handle/table-handle-column-positioner.gen.ts +5 -15
  83. package/src/components/table-handle/table-handle-drag-preview.gen.ts +5 -15
  84. package/src/components/table-handle/table-handle-drop-indicator.gen.ts +5 -15
  85. package/src/components/table-handle/table-handle-root.gen.ts +5 -15
  86. package/src/components/table-handle/table-handle-row-menu-root.gen.ts +5 -15
  87. package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +5 -15
  88. package/src/components/table-handle/table-handle-row-popup.gen.ts +5 -15
  89. package/src/components/table-handle/table-handle-row-positioner.gen.ts +5 -15
  90. package/src/components/tooltip/index.gen.ts +2 -6
  91. package/src/components/tooltip/tooltip-popup.gen.ts +5 -15
  92. package/src/components/tooltip/tooltip-positioner.gen.ts +5 -15
  93. package/src/components/tooltip/tooltip-root.gen.ts +5 -17
  94. package/src/components/tooltip/tooltip-trigger.gen.ts +5 -15
@@ -1,6 +1,4 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerBlockHandleAddElement, type BlockHandleAddElement, type BlockHandleAddProps as BlockHandleAddElementProps } from '@prosekit/web/block-handle';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
@@ -9,12 +7,8 @@ import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
8
  import { useEditorContext } from '../../contexts/editor-context.ts';
11
9
 
12
- /**
13
- * Props for the {@link BlockHandleAdd} Preact component.
14
- *
15
- * @public
16
- */
17
- export interface BlockHandleAddProps extends HTMLAttributes<BlockHandleAddElement> {
10
+ /** Props for the {@link BlockHandleAdd} Preact component. */
11
+ export interface BlockHandleAddProps {
18
12
  /**
19
13
  * The ProseKit editor instance.
20
14
  *
@@ -54,9 +48,5 @@ function BlockHandleAddComponent(props: BlockHandleAddProps, forwardedRef: Ref<B
54
48
  return createElement('prosekit-block-handle-add', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
55
49
  }
56
50
 
57
- /**
58
- * A Preact component that renders an `prosekit-block-handle-add` custom element.
59
- *
60
- * @public
61
- */
62
- export const BlockHandleAdd: ForwardRefExoticComponent<BlockHandleAddProps & RefAttributes<BlockHandleAddElement>> = /* @__PURE__ */ forwardRef(BlockHandleAddComponent);
51
+ /** A Preact component that renders an `prosekit-block-handle-add` custom element. */
52
+ export const BlockHandleAdd: ForwardRefExoticComponent<BlockHandleAddProps & HTMLAttributes<BlockHandleAddElement> & RefAttributes<BlockHandleAddElement>> = /* @__PURE__ */ forwardRef(BlockHandleAddComponent);
@@ -1,6 +1,4 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerBlockHandleDraggableElement, type BlockHandleDraggableElement, type BlockHandleDraggableProps as BlockHandleDraggableElementProps } from '@prosekit/web/block-handle';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
@@ -9,12 +7,8 @@ import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
8
  import { useEditorContext } from '../../contexts/editor-context.ts';
11
9
 
12
- /**
13
- * Props for the {@link BlockHandleDraggable} Preact component.
14
- *
15
- * @public
16
- */
17
- export interface BlockHandleDraggableProps extends HTMLAttributes<BlockHandleDraggableElement> {
10
+ /** Props for the {@link BlockHandleDraggable} Preact component. */
11
+ export interface BlockHandleDraggableProps {
18
12
  /**
19
13
  * The ProseKit editor instance.
20
14
  *
@@ -54,9 +48,5 @@ function BlockHandleDraggableComponent(props: BlockHandleDraggableProps, forward
54
48
  return createElement('prosekit-block-handle-draggable', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
55
49
  }
56
50
 
57
- /**
58
- * A Preact component that renders an `prosekit-block-handle-draggable` custom element.
59
- *
60
- * @public
61
- */
62
- export const BlockHandleDraggable: ForwardRefExoticComponent<BlockHandleDraggableProps & RefAttributes<BlockHandleDraggableElement>> = /* @__PURE__ */ forwardRef(BlockHandleDraggableComponent);
51
+ /** A Preact component that renders an `prosekit-block-handle-draggable` custom element. */
52
+ export const BlockHandleDraggable: ForwardRefExoticComponent<BlockHandleDraggableProps & HTMLAttributes<BlockHandleDraggableElement> & RefAttributes<BlockHandleDraggableElement>> = /* @__PURE__ */ forwardRef(BlockHandleDraggableComponent);
@@ -1,18 +1,12 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerBlockHandlePopupElement, type BlockHandlePopupElement } from '@prosekit/web/block-handle';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
7
5
  import { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';
8
6
  import { useCallback, useRef } from 'preact/hooks';
9
7
 
10
- /**
11
- * Props for the {@link BlockHandlePopup} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface BlockHandlePopupProps extends HTMLAttributes<BlockHandlePopupElement> {}
8
+ /** Props for the {@link BlockHandlePopup} Preact component. */
9
+ export interface BlockHandlePopupProps {}
16
10
 
17
11
  function BlockHandlePopupComponent(props: BlockHandlePopupProps, forwardedRef: Ref<BlockHandlePopupElement>) {
18
12
  registerBlockHandlePopupElement();
@@ -36,9 +30,5 @@ function BlockHandlePopupComponent(props: BlockHandlePopupProps, forwardedRef: R
36
30
  return createElement('prosekit-block-handle-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
37
31
  }
38
32
 
39
- /**
40
- * A Preact component that renders an `prosekit-block-handle-popup` custom element.
41
- *
42
- * @public
43
- */
44
- export const BlockHandlePopup: ForwardRefExoticComponent<BlockHandlePopupProps & RefAttributes<BlockHandlePopupElement>> = /* @__PURE__ */ forwardRef(BlockHandlePopupComponent);
33
+ /** A Preact component that renders an `prosekit-block-handle-popup` custom element. */
34
+ export const BlockHandlePopup: ForwardRefExoticComponent<BlockHandlePopupProps & HTMLAttributes<BlockHandlePopupElement> & RefAttributes<BlockHandlePopupElement>> = /* @__PURE__ */ forwardRef(BlockHandlePopupComponent);
@@ -1,18 +1,12 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerBlockHandlePositionerElement, type BlockHandlePositionerElement, type BlockHandlePositionerProps as BlockHandlePositionerElementProps } from '@prosekit/web/block-handle';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
7
5
  import { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';
8
6
  import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
- /**
11
- * Props for the {@link BlockHandlePositioner} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface BlockHandlePositionerProps extends HTMLAttributes<BlockHandlePositionerElement> {
8
+ /** Props for the {@link BlockHandlePositioner} Preact component. */
9
+ export interface BlockHandlePositionerProps {
16
10
  /**
17
11
  * The placement of the popover, relative to the hovered block.
18
12
  *
@@ -163,9 +157,5 @@ function BlockHandlePositionerComponent(props: BlockHandlePositionerProps, forwa
163
157
  return createElement('prosekit-block-handle-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
164
158
  }
165
159
 
166
- /**
167
- * A Preact component that renders an `prosekit-block-handle-positioner` custom element.
168
- *
169
- * @public
170
- */
171
- export const BlockHandlePositioner: ForwardRefExoticComponent<BlockHandlePositionerProps & RefAttributes<BlockHandlePositionerElement>> = /* @__PURE__ */ forwardRef(BlockHandlePositionerComponent);
160
+ /** A Preact component that renders an `prosekit-block-handle-positioner` custom element. */
161
+ export const BlockHandlePositioner: ForwardRefExoticComponent<BlockHandlePositionerProps & HTMLAttributes<BlockHandlePositionerElement> & RefAttributes<BlockHandlePositionerElement>> = /* @__PURE__ */ forwardRef(BlockHandlePositionerComponent);
@@ -1,6 +1,4 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerBlockHandleRootElement, type BlockHandleRootElement, type BlockHandleRootProps as BlockHandleRootElementProps, type BlockHandleRootEvents } from '@prosekit/web/block-handle';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
@@ -9,12 +7,8 @@ import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
8
  import { useEditorContext } from '../../contexts/editor-context.ts';
11
9
 
12
- /**
13
- * Props for the {@link BlockHandleRoot} Preact component.
14
- *
15
- * @public
16
- */
17
- export interface BlockHandleRootProps extends HTMLAttributes<BlockHandleRootElement> {
10
+ /** Props for the {@link BlockHandleRoot} Preact component. */
11
+ export interface BlockHandleRootProps {
18
12
  /**
19
13
  * The ProseKit editor instance.
20
14
  *
@@ -74,11 +68,5 @@ function BlockHandleRootComponent(props: BlockHandleRootProps, forwardedRef: Ref
74
68
  return createElement('prosekit-block-handle-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
75
69
  }
76
70
 
77
- /**
78
- * A Preact component that renders an `prosekit-block-handle-root` custom element.
79
- *
80
- * @public
81
- */
82
- export const BlockHandleRoot: ForwardRefExoticComponent<BlockHandleRootProps & RefAttributes<BlockHandleRootElement>> = /* @__PURE__ */ forwardRef(BlockHandleRootComponent);
83
-
84
- export type { BlockHandleRootEvents };
71
+ /** A Preact component that renders an `prosekit-block-handle-root` custom element. */
72
+ export const BlockHandleRoot: ForwardRefExoticComponent<BlockHandleRootProps & HTMLAttributes<BlockHandleRootElement> & RefAttributes<BlockHandleRootElement>> = /* @__PURE__ */ forwardRef(BlockHandleRootComponent);
@@ -1,6 +1,4 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  export { BlockHandleAdd, type BlockHandleAddProps } from './block-handle-add.gen.ts';
6
4
 
@@ -10,6 +8,4 @@ export { BlockHandlePopup, type BlockHandlePopupProps } from './block-handle-pop
10
8
 
11
9
  export { BlockHandlePositioner, type BlockHandlePositionerProps } from './block-handle-positioner.gen.ts';
12
10
 
13
- export { BlockHandleRoot, type BlockHandleRootProps, type BlockHandleRootEvents } from './block-handle-root.gen.ts';
14
-
15
- export { BlockHandleStateChangeEvent } from '@prosekit/web/block-handle';
11
+ export { BlockHandleRoot, type BlockHandleRootProps } from './block-handle-root.gen.ts';
@@ -1,6 +1,4 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerDropIndicatorElement, type DropIndicatorElement, type DropIndicatorProps as DropIndicatorElementProps } from '@prosekit/web/drop-indicator';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
@@ -9,12 +7,8 @@ import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
8
  import { useEditorContext } from '../../contexts/editor-context.ts';
11
9
 
12
- /**
13
- * Props for the {@link DropIndicator} Preact component.
14
- *
15
- * @public
16
- */
17
- export interface DropIndicatorProps extends HTMLAttributes<DropIndicatorElement> {
10
+ /** Props for the {@link DropIndicator} Preact component. */
11
+ export interface DropIndicatorProps {
18
12
  /**
19
13
  * The ProseKit editor instance.
20
14
  *
@@ -60,9 +54,5 @@ function DropIndicatorComponent(props: DropIndicatorProps, forwardedRef: Ref<Dro
60
54
  return createElement('prosekit-drop-indicator', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
61
55
  }
62
56
 
63
- /**
64
- * A Preact component that renders an `prosekit-drop-indicator` custom element.
65
- *
66
- * @public
67
- */
68
- export const DropIndicator: ForwardRefExoticComponent<DropIndicatorProps & RefAttributes<DropIndicatorElement>> = /* @__PURE__ */ forwardRef(DropIndicatorComponent);
57
+ /** A Preact component that renders an `prosekit-drop-indicator` custom element. */
58
+ export const DropIndicator: ForwardRefExoticComponent<DropIndicatorProps & HTMLAttributes<DropIndicatorElement> & RefAttributes<DropIndicatorElement>> = /* @__PURE__ */ forwardRef(DropIndicatorComponent);
@@ -1,5 +1,3 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  export { DropIndicator, type DropIndicatorProps } from './drop-indicator.gen.ts';
@@ -1,11 +1,7 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  export { InlinePopoverPopup, type InlinePopoverPopupProps } from './inline-popover-popup.gen.ts';
6
4
 
7
5
  export { InlinePopoverPositioner, type InlinePopoverPositionerProps } from './inline-popover-positioner.gen.ts';
8
6
 
9
- export { InlinePopoverRoot, type InlinePopoverRootProps, type InlinePopoverRootEvents } from './inline-popover-root.gen.ts';
10
-
11
- export { OpenChangeEvent } from '@prosekit/web/inline-popover';
7
+ export { InlinePopoverRoot, type InlinePopoverRootProps } from './inline-popover-root.gen.ts';
@@ -1,18 +1,12 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerInlinePopoverPopupElement, type InlinePopoverPopupElement } from '@prosekit/web/inline-popover';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
7
5
  import { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';
8
6
  import { useCallback, useRef } from 'preact/hooks';
9
7
 
10
- /**
11
- * Props for the {@link InlinePopoverPopup} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface InlinePopoverPopupProps extends HTMLAttributes<InlinePopoverPopupElement> {}
8
+ /** Props for the {@link InlinePopoverPopup} Preact component. */
9
+ export interface InlinePopoverPopupProps {}
16
10
 
17
11
  function InlinePopoverPopupComponent(props: InlinePopoverPopupProps, forwardedRef: Ref<InlinePopoverPopupElement>) {
18
12
  registerInlinePopoverPopupElement();
@@ -36,9 +30,5 @@ function InlinePopoverPopupComponent(props: InlinePopoverPopupProps, forwardedRe
36
30
  return createElement('prosekit-inline-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
37
31
  }
38
32
 
39
- /**
40
- * A Preact component that renders an `prosekit-inline-popover-popup` custom element.
41
- *
42
- * @public
43
- */
44
- export const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & RefAttributes<InlinePopoverPopupElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);
33
+ /** A Preact component that renders an `prosekit-inline-popover-popup` custom element. */
34
+ export const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & HTMLAttributes<InlinePopoverPopupElement> & RefAttributes<InlinePopoverPopupElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);
@@ -1,18 +1,12 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerInlinePopoverPositionerElement, type InlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
7
5
  import { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';
8
6
  import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
- /**
11
- * Props for the {@link InlinePopoverPositioner} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface InlinePopoverPositionerProps extends HTMLAttributes<InlinePopoverPositionerElement> {
8
+ /** Props for the {@link InlinePopoverPositioner} Preact component. */
9
+ export interface InlinePopoverPositionerProps {
16
10
  /**
17
11
  * The initial placement of the floating element
18
12
  *
@@ -169,9 +163,5 @@ function InlinePopoverPositionerComponent(props: InlinePopoverPositionerProps, f
169
163
  return createElement('prosekit-inline-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
170
164
  }
171
165
 
172
- /**
173
- * A Preact component that renders an `prosekit-inline-popover-positioner` custom element.
174
- *
175
- * @public
176
- */
177
- export const InlinePopoverPositioner: ForwardRefExoticComponent<InlinePopoverPositionerProps & RefAttributes<InlinePopoverPositionerElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPositionerComponent);
166
+ /** A Preact component that renders an `prosekit-inline-popover-positioner` custom element. */
167
+ export const InlinePopoverPositioner: ForwardRefExoticComponent<InlinePopoverPositionerProps & HTMLAttributes<InlinePopoverPositionerElement> & RefAttributes<InlinePopoverPositionerElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPositionerComponent);
@@ -1,6 +1,4 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerInlinePopoverRootElement, type InlinePopoverRootElement, type InlinePopoverRootProps as InlinePopoverRootElementProps, type InlinePopoverRootEvents } from '@prosekit/web/inline-popover';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
@@ -9,12 +7,8 @@ import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
8
  import { useEditorContext } from '../../contexts/editor-context.ts';
11
9
 
12
- /**
13
- * Props for the {@link InlinePopoverRoot} Preact component.
14
- *
15
- * @public
16
- */
17
- export interface InlinePopoverRootProps extends HTMLAttributes<InlinePopoverRootElement> {
10
+ /** Props for the {@link InlinePopoverRoot} Preact component. */
11
+ export interface InlinePopoverRootProps {
18
12
  /**
19
13
  * The ProseKit editor instance.
20
14
  *
@@ -46,7 +40,7 @@ export interface InlinePopoverRootProps extends HTMLAttributes<InlinePopoverRoot
46
40
  * @default false
47
41
  */
48
42
  disabled?: InlinePopoverRootElementProps['disabled'];
49
- /** */
43
+ /** Emitted when the open state of the popover changes. */
50
44
  onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;
51
45
  }
52
46
 
@@ -98,11 +92,5 @@ function InlinePopoverRootComponent(props: InlinePopoverRootProps, forwardedRef:
98
92
  return createElement('prosekit-inline-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
99
93
  }
100
94
 
101
- /**
102
- * A Preact component that renders an `prosekit-inline-popover-root` custom element.
103
- *
104
- * @public
105
- */
106
- export const InlinePopoverRoot: ForwardRefExoticComponent<InlinePopoverRootProps & RefAttributes<InlinePopoverRootElement>> = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);
107
-
108
- export type { InlinePopoverRootEvents };
95
+ /** A Preact component that renders an `prosekit-inline-popover-root` custom element. */
96
+ export const InlinePopoverRoot: ForwardRefExoticComponent<InlinePopoverRootProps & HTMLAttributes<InlinePopoverRootElement> & RefAttributes<InlinePopoverRootElement>> = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);
@@ -1,19 +1,15 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
- export { MenuItem, type MenuItemProps, type MenuItemEvents } from './menu-item.gen.ts';
3
+ export { MenuItem, type MenuItemProps } from './menu-item.gen.ts';
6
4
 
7
5
  export { MenuPopup, type MenuPopupProps } from './menu-popup.gen.ts';
8
6
 
9
7
  export { MenuPositioner, type MenuPositionerProps } from './menu-positioner.gen.ts';
10
8
 
11
- export { MenuRoot, type MenuRootProps, type MenuRootEvents } from './menu-root.gen.ts';
9
+ export { MenuRoot, type MenuRootProps } from './menu-root.gen.ts';
12
10
 
13
11
  export { MenuSubmenuRoot, type MenuSubmenuRootProps } from './menu-submenu-root.gen.ts';
14
12
 
15
13
  export { MenuSubmenuTrigger, type MenuSubmenuTriggerProps } from './menu-submenu-trigger.gen.ts';
16
14
 
17
- export { MenuTrigger, type MenuTriggerProps, type MenuTriggerEvents } from './menu-trigger.gen.ts';
18
-
19
- export { OpenChangeEvent, SelectEvent } from '@prosekit/web/menu';
15
+ export { MenuTrigger, type MenuTriggerProps } from './menu-trigger.gen.ts';
@@ -1,18 +1,12 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerMenuItemElement, type MenuItemElement, type MenuItemProps as MenuItemElementProps, type MenuItemEvents } from '@prosekit/web/menu';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
7
5
  import { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';
8
6
  import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
- /**
11
- * Props for the {@link MenuItem} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface MenuItemProps extends Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> {
8
+ /** Props for the {@link MenuItem} Preact component. */
9
+ export interface MenuItemProps {
16
10
  /**
17
11
  * The unique value for this menu item.
18
12
  *
@@ -81,11 +75,5 @@ function MenuItemComponent(props: MenuItemProps, forwardedRef: Ref<MenuItemEleme
81
75
  return createElement('prosekit-menu-item', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
82
76
  }
83
77
 
84
- /**
85
- * A Preact component that renders an `prosekit-menu-item` custom element.
86
- *
87
- * @public
88
- */
89
- export const MenuItem: ForwardRefExoticComponent<MenuItemProps & RefAttributes<MenuItemElement>> = /* @__PURE__ */ forwardRef(MenuItemComponent);
90
-
91
- export type { MenuItemEvents };
78
+ /** A Preact component that renders an `prosekit-menu-item` custom element. */
79
+ export const MenuItem: ForwardRefExoticComponent<MenuItemProps & Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> & RefAttributes<MenuItemElement>> = /* @__PURE__ */ forwardRef(MenuItemComponent);
@@ -1,18 +1,12 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerMenuPopupElement, type MenuPopupElement, type MenuPopupProps as MenuPopupElementProps } from '@prosekit/web/menu';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
7
5
  import { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';
8
6
  import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
- /**
11
- * Props for the {@link MenuPopup} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface MenuPopupProps extends HTMLAttributes<MenuPopupElement> {
8
+ /** Props for the {@link MenuPopup} Preact component. */
9
+ export interface MenuPopupProps {
16
10
  /**
17
11
  * By default, the MenuPopup element will listen for keydown events.
18
12
  * You can pass a different element to listen for keydown events.
@@ -50,9 +44,5 @@ function MenuPopupComponent(props: MenuPopupProps, forwardedRef: Ref<MenuPopupEl
50
44
  return createElement('prosekit-menu-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
51
45
  }
52
46
 
53
- /**
54
- * A Preact component that renders an `prosekit-menu-popup` custom element.
55
- *
56
- * @public
57
- */
58
- export const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & RefAttributes<MenuPopupElement>> = /* @__PURE__ */ forwardRef(MenuPopupComponent);
47
+ /** A Preact component that renders an `prosekit-menu-popup` custom element. */
48
+ export const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & HTMLAttributes<MenuPopupElement> & RefAttributes<MenuPopupElement>> = /* @__PURE__ */ forwardRef(MenuPopupComponent);
@@ -1,18 +1,12 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerMenuPositionerElement, type MenuPositionerElement, type MenuPositionerProps as MenuPositionerElementProps } from '@prosekit/web/menu';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
7
5
  import { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';
8
6
  import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
- /**
11
- * Props for the {@link MenuPositioner} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface MenuPositionerProps extends HTMLAttributes<MenuPositionerElement> {
8
+ /** Props for the {@link MenuPositioner} Preact component. */
9
+ export interface MenuPositionerProps {
16
10
  /**
17
11
  * The initial placement of the floating element
18
12
  *
@@ -170,9 +164,5 @@ function MenuPositionerComponent(props: MenuPositionerProps, forwardedRef: Ref<M
170
164
  return createElement('prosekit-menu-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
171
165
  }
172
166
 
173
- /**
174
- * A Preact component that renders an `prosekit-menu-positioner` custom element.
175
- *
176
- * @public
177
- */
178
- export const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & RefAttributes<MenuPositionerElement>> = /* @__PURE__ */ forwardRef(MenuPositionerComponent);
167
+ /** A Preact component that renders an `prosekit-menu-positioner` custom element. */
168
+ export const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & HTMLAttributes<MenuPositionerElement> & RefAttributes<MenuPositionerElement>> = /* @__PURE__ */ forwardRef(MenuPositionerComponent);
@@ -1,18 +1,12 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
3
  import { registerMenuRootElement, type MenuRootElement, type MenuRootProps as MenuRootElementProps, type MenuRootEvents } from '@prosekit/web/menu';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
7
5
  import { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';
8
6
  import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
- /**
11
- * Props for the {@link MenuRoot} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface MenuRootProps extends HTMLAttributes<MenuRootElement> {
8
+ /** Props for the {@link MenuRoot} Preact component. */
9
+ export interface MenuRootProps {
16
10
  /**
17
11
  * Whether the overlay is initially open.
18
12
  * @default false
@@ -78,11 +72,5 @@ function MenuRootComponent(props: MenuRootProps, forwardedRef: Ref<MenuRootEleme
78
72
  return createElement('prosekit-menu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
79
73
  }
80
74
 
81
- /**
82
- * A Preact component that renders an `prosekit-menu-root` custom element.
83
- *
84
- * @public
85
- */
86
- export const MenuRoot: ForwardRefExoticComponent<MenuRootProps & RefAttributes<MenuRootElement>> = /* @__PURE__ */ forwardRef(MenuRootComponent);
87
-
88
- export type { MenuRootEvents };
75
+ /** A Preact component that renders an `prosekit-menu-root` custom element. */
76
+ export const MenuRoot: ForwardRefExoticComponent<MenuRootProps & HTMLAttributes<MenuRootElement> & RefAttributes<MenuRootElement>> = /* @__PURE__ */ forwardRef(MenuRootComponent);
@@ -1,25 +1,61 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
4
2
 
5
- import { registerMenuSubmenuRootElement, type MenuSubmenuRootElement } from '@prosekit/web/menu';
3
+ import { registerMenuSubmenuRootElement, type MenuSubmenuRootElement, type MenuSubmenuRootProps as MenuSubmenuRootElementProps, type MenuSubmenuRootEvents } from '@prosekit/web/menu';
6
4
  import { createElement, type HTMLAttributes, type Ref } from 'preact';
7
5
  import { forwardRef, type ForwardRefExoticComponent, type RefAttributes } from 'preact/compat';
8
- import { useCallback, useRef } from 'preact/hooks';
6
+ import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
9
7
 
10
- /**
11
- * Props for the {@link MenuSubmenuRoot} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface MenuSubmenuRootProps extends HTMLAttributes<MenuSubmenuRootElement> {}
8
+ /** Props for the {@link MenuSubmenuRoot} Preact component. */
9
+ export interface MenuSubmenuRootProps {
10
+ /**
11
+ * Whether the overlay is initially open.
12
+ * @default false
13
+ */
14
+ defaultOpen?: MenuSubmenuRootElementProps['defaultOpen'];
15
+ /**
16
+ * Whether the overlay is currently open.
17
+ * @default null
18
+ */
19
+ open?: MenuSubmenuRootElementProps['open'];
20
+ /**
21
+ * Whether the component should ignore user interaction.
22
+ * @default false
23
+ */
24
+ disabled?: MenuSubmenuRootElementProps['disabled'];
25
+ /** Emitted when the submenu is opened or closed. */
26
+ onOpenChange?: (event: MenuSubmenuRootEvents['openChange']) => void;
27
+ }
16
28
 
17
29
  function MenuSubmenuRootComponent(props: MenuSubmenuRootProps, forwardedRef: Ref<MenuSubmenuRootElement>) {
18
30
  registerMenuSubmenuRootElement();
19
31
 
20
32
  const elementRef = useRef<MenuSubmenuRootElement>(null);
33
+ const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);
34
+
35
+ const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;
36
+
37
+ useLayoutEffect(() => {
38
+ const element = elementRef.current as Record<string, unknown> | null;
39
+ if (!element) return;
40
+ Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });
41
+ handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;
42
+ });
21
43
 
22
- const { ...restProps } = props;
44
+ useLayoutEffect(() => {
45
+ const element = elementRef.current;
46
+ if (!element) return;
47
+ const ac = new AbortController();
48
+ for (const [index, eventName] of ['openChange'].entries()) {
49
+ element.addEventListener(
50
+ eventName,
51
+ (event: Event) => {
52
+ handlersRef.current[index]?.(event);
53
+ },
54
+ { signal: ac.signal },
55
+ );
56
+ }
57
+ return () => ac.abort();
58
+ }, []);
23
59
 
24
60
  const mergedRef = useCallback(
25
61
  (element: MenuSubmenuRootElement | null) => {
@@ -36,9 +72,5 @@ function MenuSubmenuRootComponent(props: MenuSubmenuRootProps, forwardedRef: Ref
36
72
  return createElement('prosekit-menu-submenu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
37
73
  }
38
74
 
39
- /**
40
- * A Preact component that renders an `prosekit-menu-submenu-root` custom element.
41
- *
42
- * @public
43
- */
44
- export const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & RefAttributes<MenuSubmenuRootElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);
75
+ /** A Preact component that renders an `prosekit-menu-submenu-root` custom element. */
76
+ export const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & HTMLAttributes<MenuSubmenuRootElement> & RefAttributes<MenuSubmenuRootElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);