@prosekit/react 0.7.0-beta.3 → 0.7.0-beta.5

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 (104) hide show
  1. package/dist/editor-context.js +0 -2
  2. package/dist/editor-context.js.map +1 -1
  3. package/dist/prosekit-react-autocomplete.d.ts +10 -61
  4. package/dist/prosekit-react-autocomplete.d.ts.map +1 -1
  5. package/dist/prosekit-react-autocomplete.js +30 -49
  6. package/dist/prosekit-react-autocomplete.js.map +1 -1
  7. package/dist/prosekit-react-block-handle.d.ts +10 -61
  8. package/dist/prosekit-react-block-handle.d.ts.map +1 -1
  9. package/dist/prosekit-react-block-handle.js +30 -49
  10. package/dist/prosekit-react-block-handle.js.map +1 -1
  11. package/dist/prosekit-react-drop-indicator.d.ts +2 -13
  12. package/dist/prosekit-react-drop-indicator.d.ts.map +1 -1
  13. package/dist/prosekit-react-drop-indicator.js +13 -9
  14. package/dist/prosekit-react-drop-indicator.js.map +1 -1
  15. package/dist/prosekit-react-inline-popover.d.ts +6 -37
  16. package/dist/prosekit-react-inline-popover.d.ts.map +1 -1
  17. package/dist/prosekit-react-inline-popover.js +23 -29
  18. package/dist/prosekit-react-inline-popover.js.map +1 -1
  19. package/dist/prosekit-react-menu.d.ts +48 -88
  20. package/dist/prosekit-react-menu.d.ts.map +1 -1
  21. package/dist/prosekit-react-menu.js +72 -71
  22. package/dist/prosekit-react-menu.js.map +1 -1
  23. package/dist/prosekit-react-popover.d.ts +8 -49
  24. package/dist/prosekit-react-popover.d.ts.map +1 -1
  25. package/dist/prosekit-react-popover.js +26 -39
  26. package/dist/prosekit-react-popover.js.map +1 -1
  27. package/dist/prosekit-react-resizable.d.ts +4 -25
  28. package/dist/prosekit-react-resizable.d.ts.map +1 -1
  29. package/dist/prosekit-react-resizable.js +20 -19
  30. package/dist/prosekit-react-resizable.js.map +1 -1
  31. package/dist/prosekit-react-table-handle.d.ts +22 -133
  32. package/dist/prosekit-react-table-handle.d.ts.map +1 -1
  33. package/dist/prosekit-react-table-handle.js +67 -109
  34. package/dist/prosekit-react-table-handle.js.map +1 -1
  35. package/dist/prosekit-react-tooltip.d.ts +8 -49
  36. package/dist/prosekit-react-tooltip.d.ts.map +1 -1
  37. package/dist/prosekit-react-tooltip.js +26 -39
  38. package/dist/prosekit-react-tooltip.js.map +1 -1
  39. package/dist/prosekit-react.d.ts +0 -21
  40. package/dist/prosekit-react.d.ts.map +1 -1
  41. package/dist/prosekit-react.js +1 -26
  42. package/dist/prosekit-react.js.map +1 -1
  43. package/package.json +4 -4
  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/autocomplete/index.ts +2 -0
  51. package/src/components/block-handle/block-handle-add.gen.ts +3 -13
  52. package/src/components/block-handle/block-handle-draggable.gen.ts +3 -13
  53. package/src/components/block-handle/block-handle-popup.gen.ts +3 -13
  54. package/src/components/block-handle/block-handle-positioner.gen.ts +3 -13
  55. package/src/components/block-handle/block-handle-root.gen.ts +3 -13
  56. package/src/components/block-handle/index.gen.ts +1 -3
  57. package/src/components/block-handle/index.ts +2 -0
  58. package/src/components/drop-indicator/drop-indicator.gen.ts +3 -13
  59. package/src/components/drop-indicator/index.gen.ts +1 -3
  60. package/src/components/drop-indicator/index.ts +2 -0
  61. package/src/components/inline-popover/index.gen.ts +1 -3
  62. package/src/components/inline-popover/index.ts +2 -0
  63. package/src/components/inline-popover/inline-popover-popup.gen.ts +3 -13
  64. package/src/components/inline-popover/inline-popover-positioner.gen.ts +3 -13
  65. package/src/components/inline-popover/inline-popover-root.gen.ts +3 -13
  66. package/src/components/menu/index.gen.ts +1 -3
  67. package/src/components/menu/index.ts +2 -0
  68. package/src/components/menu/menu-item.gen.ts +3 -13
  69. package/src/components/menu/menu-popup.gen.ts +3 -13
  70. package/src/components/menu/menu-positioner.gen.ts +3 -13
  71. package/src/components/menu/menu-root.gen.ts +3 -13
  72. package/src/components/menu/menu-submenu-root.gen.ts +49 -17
  73. package/src/components/menu/menu-submenu-trigger.gen.ts +28 -19
  74. package/src/components/menu/menu-trigger.gen.ts +3 -13
  75. package/src/components/popover/index.gen.ts +1 -3
  76. package/src/components/popover/index.ts +2 -0
  77. package/src/components/popover/popover-popup.gen.ts +3 -13
  78. package/src/components/popover/popover-positioner.gen.ts +3 -13
  79. package/src/components/popover/popover-root.gen.ts +3 -13
  80. package/src/components/popover/popover-trigger.gen.ts +3 -13
  81. package/src/components/resizable/index.gen.ts +1 -3
  82. package/src/components/resizable/index.ts +2 -0
  83. package/src/components/resizable/resizable-handle.gen.ts +3 -13
  84. package/src/components/resizable/resizable-root.gen.ts +3 -13
  85. package/src/components/table-handle/index.gen.ts +1 -3
  86. package/src/components/table-handle/index.ts +2 -0
  87. package/src/components/table-handle/table-handle-column-menu-root.gen.ts +3 -13
  88. package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +3 -13
  89. package/src/components/table-handle/table-handle-column-popup.gen.ts +3 -13
  90. package/src/components/table-handle/table-handle-column-positioner.gen.ts +3 -13
  91. package/src/components/table-handle/table-handle-drag-preview.gen.ts +3 -13
  92. package/src/components/table-handle/table-handle-drop-indicator.gen.ts +3 -13
  93. package/src/components/table-handle/table-handle-root.gen.ts +3 -13
  94. package/src/components/table-handle/table-handle-row-menu-root.gen.ts +3 -13
  95. package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +3 -13
  96. package/src/components/table-handle/table-handle-row-popup.gen.ts +3 -13
  97. package/src/components/table-handle/table-handle-row-positioner.gen.ts +3 -13
  98. package/src/components/tooltip/index.gen.ts +1 -3
  99. package/src/components/tooltip/index.ts +2 -0
  100. package/src/components/tooltip/tooltip-popup.gen.ts +3 -13
  101. package/src/components/tooltip/tooltip-positioner.gen.ts +3 -13
  102. package/src/components/tooltip/tooltip-root.gen.ts +3 -13
  103. package/src/components/tooltip/tooltip-trigger.gen.ts +3 -13
  104. package/src/index.ts +2 -0
@@ -1,17 +1,11 @@
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 { registerAutocompleteRootElement, type AutocompleteRootElement, type AutocompleteRootProps as AutocompleteRootElementProps, type AutocompleteRootEvents } from '@prosekit/web/autocomplete';
6
4
  import { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
6
  import { useEditorContext } from '../../contexts/editor-context.ts';
9
7
 
10
- /**
11
- * Props for the {@link AutocompleteRoot} React component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link AutocompleteRoot} React component. */
15
9
  export interface AutocompleteRootProps {
16
10
  /**
17
11
  * The ProseKit editor instance.
@@ -97,9 +91,5 @@ function AutocompleteRootComponent(props: AutocompleteRootProps, forwardedRef: F
97
91
  return createElement('prosekit-autocomplete-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
98
92
  }
99
93
 
100
- /**
101
- * A React component that renders an `prosekit-autocomplete-root` custom element.
102
- *
103
- * @public
104
- */
94
+ /** A React component that renders an `prosekit-autocomplete-root` custom element. */
105
95
  export const AutocompleteRoot: ForwardRefExoticComponent<AutocompleteRootProps & HTMLAttributes<AutocompleteRootElement> & RefAttributes<AutocompleteRootElement>> = /* @__PURE__ */ forwardRef(AutocompleteRootComponent);
@@ -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 { AutocompleteEmpty, type AutocompleteEmptyProps } from './autocomplete-empty.gen.ts';
6
4
 
@@ -24,4 +24,6 @@ import {
24
24
  ```
25
25
  */
26
26
 
27
+ 'use client'
28
+
27
29
  export * from './index.gen.ts'
@@ -1,17 +1,11 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
6
  import { useEditorContext } from '../../contexts/editor-context.ts';
9
7
 
10
- /**
11
- * Props for the {@link BlockHandleAdd} React component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link BlockHandleAdd} React component. */
15
9
  export interface BlockHandleAddProps {
16
10
  /**
17
11
  * The ProseKit editor instance.
@@ -52,9 +46,5 @@ function BlockHandleAddComponent(props: BlockHandleAddProps, forwardedRef: Forwa
52
46
  return createElement('prosekit-block-handle-add', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
53
47
  }
54
48
 
55
- /**
56
- * A React component that renders an `prosekit-block-handle-add` custom element.
57
- *
58
- * @public
59
- */
49
+ /** A React component that renders an `prosekit-block-handle-add` custom element. */
60
50
  export const BlockHandleAdd: ForwardRefExoticComponent<BlockHandleAddProps & HTMLAttributes<BlockHandleAddElement> & RefAttributes<BlockHandleAddElement>> = /* @__PURE__ */ forwardRef(BlockHandleAddComponent);
@@ -1,17 +1,11 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
6
  import { useEditorContext } from '../../contexts/editor-context.ts';
9
7
 
10
- /**
11
- * Props for the {@link BlockHandleDraggable} React component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link BlockHandleDraggable} React component. */
15
9
  export interface BlockHandleDraggableProps {
16
10
  /**
17
11
  * The ProseKit editor instance.
@@ -52,9 +46,5 @@ function BlockHandleDraggableComponent(props: BlockHandleDraggableProps, forward
52
46
  return createElement('prosekit-block-handle-draggable', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
53
47
  }
54
48
 
55
- /**
56
- * A React component that renders an `prosekit-block-handle-draggable` custom element.
57
- *
58
- * @public
59
- */
49
+ /** A React component that renders an `prosekit-block-handle-draggable` custom element. */
60
50
  export const BlockHandleDraggable: ForwardRefExoticComponent<BlockHandleDraggableProps & HTMLAttributes<BlockHandleDraggableElement> & RefAttributes<BlockHandleDraggableElement>> = /* @__PURE__ */ forwardRef(BlockHandleDraggableComponent);
@@ -1,15 +1,9 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';
7
5
 
8
- /**
9
- * Props for the {@link BlockHandlePopup} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link BlockHandlePopup} React component. */
13
7
  export interface BlockHandlePopupProps {}
14
8
 
15
9
  function BlockHandlePopupComponent(props: BlockHandlePopupProps, forwardedRef: ForwardedRef<BlockHandlePopupElement>) {
@@ -34,9 +28,5 @@ function BlockHandlePopupComponent(props: BlockHandlePopupProps, forwardedRef: F
34
28
  return createElement('prosekit-block-handle-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
35
29
  }
36
30
 
37
- /**
38
- * A React component that renders an `prosekit-block-handle-popup` custom element.
39
- *
40
- * @public
41
- */
31
+ /** A React component that renders an `prosekit-block-handle-popup` custom element. */
42
32
  export const BlockHandlePopup: ForwardRefExoticComponent<BlockHandlePopupProps & HTMLAttributes<BlockHandlePopupElement> & RefAttributes<BlockHandlePopupElement>> = /* @__PURE__ */ forwardRef(BlockHandlePopupComponent);
@@ -1,15 +1,9 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
- /**
9
- * Props for the {@link BlockHandlePositioner} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link BlockHandlePositioner} React component. */
13
7
  export interface BlockHandlePositionerProps {
14
8
  /**
15
9
  * The placement of the popover, relative to the hovered block.
@@ -161,9 +155,5 @@ function BlockHandlePositionerComponent(props: BlockHandlePositionerProps, forwa
161
155
  return createElement('prosekit-block-handle-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
162
156
  }
163
157
 
164
- /**
165
- * A React component that renders an `prosekit-block-handle-positioner` custom element.
166
- *
167
- * @public
168
- */
158
+ /** A React component that renders an `prosekit-block-handle-positioner` custom element. */
169
159
  export const BlockHandlePositioner: ForwardRefExoticComponent<BlockHandlePositionerProps & HTMLAttributes<BlockHandlePositionerElement> & RefAttributes<BlockHandlePositionerElement>> = /* @__PURE__ */ forwardRef(BlockHandlePositionerComponent);
@@ -1,17 +1,11 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
6
  import { useEditorContext } from '../../contexts/editor-context.ts';
9
7
 
10
- /**
11
- * Props for the {@link BlockHandleRoot} React component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link BlockHandleRoot} React component. */
15
9
  export interface BlockHandleRootProps {
16
10
  /**
17
11
  * The ProseKit editor instance.
@@ -72,9 +66,5 @@ function BlockHandleRootComponent(props: BlockHandleRootProps, forwardedRef: For
72
66
  return createElement('prosekit-block-handle-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
73
67
  }
74
68
 
75
- /**
76
- * A React component that renders an `prosekit-block-handle-root` custom element.
77
- *
78
- * @public
79
- */
69
+ /** A React component that renders an `prosekit-block-handle-root` custom element. */
80
70
  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
 
@@ -24,4 +24,6 @@ import {
24
24
  ```
25
25
  */
26
26
 
27
+ 'use client'
28
+
27
29
  export * from './index.gen.ts'
@@ -1,17 +1,11 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
6
  import { useEditorContext } from '../../contexts/editor-context.ts';
9
7
 
10
- /**
11
- * Props for the {@link DropIndicator} React component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link DropIndicator} React component. */
15
9
  export interface DropIndicatorProps {
16
10
  /**
17
11
  * The ProseKit editor instance.
@@ -58,9 +52,5 @@ function DropIndicatorComponent(props: DropIndicatorProps, forwardedRef: Forward
58
52
  return createElement('prosekit-drop-indicator', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
59
53
  }
60
54
 
61
- /**
62
- * A React component that renders an `prosekit-drop-indicator` custom element.
63
- *
64
- * @public
65
- */
55
+ /** A React component that renders an `prosekit-drop-indicator` custom element. */
66
56
  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';
@@ -11,4 +11,6 @@ import { DropIndicator } from 'prosekit/react/drop-indicator'
11
11
  ```
12
12
  */
13
13
 
14
+ 'use client'
15
+
14
16
  export * from './index.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
  export { InlinePopoverPopup, type InlinePopoverPopupProps } from './inline-popover-popup.gen.ts';
6
4
 
@@ -19,4 +19,6 @@ import {
19
19
  ```
20
20
  */
21
21
 
22
+ 'use client'
23
+
22
24
  export * from './index.gen.ts'
@@ -1,15 +1,9 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';
7
5
 
8
- /**
9
- * Props for the {@link InlinePopoverPopup} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link InlinePopoverPopup} React component. */
13
7
  export interface InlinePopoverPopupProps {}
14
8
 
15
9
  function InlinePopoverPopupComponent(props: InlinePopoverPopupProps, forwardedRef: ForwardedRef<InlinePopoverPopupElement>) {
@@ -34,9 +28,5 @@ function InlinePopoverPopupComponent(props: InlinePopoverPopupProps, forwardedRe
34
28
  return createElement('prosekit-inline-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
35
29
  }
36
30
 
37
- /**
38
- * A React component that renders an `prosekit-inline-popover-popup` custom element.
39
- *
40
- * @public
41
- */
31
+ /** A React component that renders an `prosekit-inline-popover-popup` custom element. */
42
32
  export const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & HTMLAttributes<InlinePopoverPopupElement> & RefAttributes<InlinePopoverPopupElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);
@@ -1,15 +1,9 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
- /**
9
- * Props for the {@link InlinePopoverPositioner} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link InlinePopoverPositioner} React component. */
13
7
  export interface InlinePopoverPositionerProps {
14
8
  /**
15
9
  * The initial placement of the floating element
@@ -167,9 +161,5 @@ function InlinePopoverPositionerComponent(props: InlinePopoverPositionerProps, f
167
161
  return createElement('prosekit-inline-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
168
162
  }
169
163
 
170
- /**
171
- * A React component that renders an `prosekit-inline-popover-positioner` custom element.
172
- *
173
- * @public
174
- */
164
+ /** A React component that renders an `prosekit-inline-popover-positioner` custom element. */
175
165
  export const InlinePopoverPositioner: ForwardRefExoticComponent<InlinePopoverPositionerProps & HTMLAttributes<InlinePopoverPositionerElement> & RefAttributes<InlinePopoverPositionerElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPositionerComponent);
@@ -1,17 +1,11 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
6
  import { useEditorContext } from '../../contexts/editor-context.ts';
9
7
 
10
- /**
11
- * Props for the {@link InlinePopoverRoot} React component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link InlinePopoverRoot} React component. */
15
9
  export interface InlinePopoverRootProps {
16
10
  /**
17
11
  * The ProseKit editor instance.
@@ -96,9 +90,5 @@ function InlinePopoverRootComponent(props: InlinePopoverRootProps, forwardedRef:
96
90
  return createElement('prosekit-inline-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
97
91
  }
98
92
 
99
- /**
100
- * A React component that renders an `prosekit-inline-popover-root` custom element.
101
- *
102
- * @public
103
- */
93
+ /** A React component that renders an `prosekit-inline-popover-root` custom element. */
104
94
  export const InlinePopoverRoot: ForwardRefExoticComponent<InlinePopoverRootProps & HTMLAttributes<InlinePopoverRootElement> & RefAttributes<InlinePopoverRootElement>> = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);
@@ -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 { MenuItem, type MenuItemProps } from './menu-item.gen.ts';
6
4
 
@@ -34,4 +34,6 @@ import {
34
34
  ```
35
35
  */
36
36
 
37
+ 'use client'
38
+
37
39
  export * from './index.gen.ts'
@@ -1,15 +1,9 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
- /**
9
- * Props for the {@link MenuItem} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link MenuItem} React component. */
13
7
  export interface MenuItemProps {
14
8
  /**
15
9
  * The unique value for this menu item.
@@ -79,9 +73,5 @@ function MenuItemComponent(props: MenuItemProps, forwardedRef: ForwardedRef<Menu
79
73
  return createElement('prosekit-menu-item', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
80
74
  }
81
75
 
82
- /**
83
- * A React component that renders an `prosekit-menu-item` custom element.
84
- *
85
- * @public
86
- */
76
+ /** A React component that renders an `prosekit-menu-item` custom element. */
87
77
  export const MenuItem: ForwardRefExoticComponent<MenuItemProps & Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> & RefAttributes<MenuItemElement>> = /* @__PURE__ */ forwardRef(MenuItemComponent);
@@ -1,15 +1,9 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
- /**
9
- * Props for the {@link MenuPopup} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link MenuPopup} React component. */
13
7
  export interface MenuPopupProps {
14
8
  /**
15
9
  * By default, the MenuPopup element will listen for keydown events.
@@ -48,9 +42,5 @@ function MenuPopupComponent(props: MenuPopupProps, forwardedRef: ForwardedRef<Me
48
42
  return createElement('prosekit-menu-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
49
43
  }
50
44
 
51
- /**
52
- * A React component that renders an `prosekit-menu-popup` custom element.
53
- *
54
- * @public
55
- */
45
+ /** A React component that renders an `prosekit-menu-popup` custom element. */
56
46
  export const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & HTMLAttributes<MenuPopupElement> & RefAttributes<MenuPopupElement>> = /* @__PURE__ */ forwardRef(MenuPopupComponent);
@@ -1,15 +1,9 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
- /**
9
- * Props for the {@link MenuPositioner} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link MenuPositioner} React component. */
13
7
  export interface MenuPositionerProps {
14
8
  /**
15
9
  * The initial placement of the floating element
@@ -168,9 +162,5 @@ function MenuPositionerComponent(props: MenuPositionerProps, forwardedRef: Forwa
168
162
  return createElement('prosekit-menu-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
169
163
  }
170
164
 
171
- /**
172
- * A React component that renders an `prosekit-menu-positioner` custom element.
173
- *
174
- * @public
175
- */
165
+ /** A React component that renders an `prosekit-menu-positioner` custom element. */
176
166
  export const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & HTMLAttributes<MenuPositionerElement> & RefAttributes<MenuPositionerElement>> = /* @__PURE__ */ forwardRef(MenuPositionerComponent);
@@ -1,15 +1,9 @@
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, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
- /**
9
- * Props for the {@link MenuRoot} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link MenuRoot} React component. */
13
7
  export interface MenuRootProps {
14
8
  /**
15
9
  * Whether the overlay is initially open.
@@ -76,9 +70,5 @@ function MenuRootComponent(props: MenuRootProps, forwardedRef: ForwardedRef<Menu
76
70
  return createElement('prosekit-menu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
77
71
  }
78
72
 
79
- /**
80
- * A React component that renders an `prosekit-menu-root` custom element.
81
- *
82
- * @public
83
- */
73
+ /** A React component that renders an `prosekit-menu-root` custom element. */
84
74
  export const MenuRoot: ForwardRefExoticComponent<MenuRootProps & HTMLAttributes<MenuRootElement> & RefAttributes<MenuRootElement>> = /* @__PURE__ */ forwardRef(MenuRootComponent);
@@ -1,23 +1,59 @@
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';
6
- import { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';
3
+ import { registerMenuSubmenuRootElement, type MenuSubmenuRootElement, type MenuSubmenuRootProps as MenuSubmenuRootElementProps, type MenuSubmenuRootEvents } from '@prosekit/web/menu';
4
+ import { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
7
5
 
8
- /**
9
- * Props for the {@link MenuSubmenuRoot} React component.
10
- *
11
- * @public
12
- */
13
- export interface MenuSubmenuRootProps {}
6
+ /** Props for the {@link MenuSubmenuRoot} React component. */
7
+ export interface MenuSubmenuRootProps {
8
+ /**
9
+ * Whether the overlay is initially open.
10
+ * @default false
11
+ */
12
+ defaultOpen?: MenuSubmenuRootElementProps['defaultOpen'];
13
+ /**
14
+ * Whether the overlay is currently open.
15
+ * @default null
16
+ */
17
+ open?: MenuSubmenuRootElementProps['open'];
18
+ /**
19
+ * Whether the component should ignore user interaction.
20
+ * @default false
21
+ */
22
+ disabled?: MenuSubmenuRootElementProps['disabled'];
23
+ /** Emitted when the submenu is opened or closed. */
24
+ onOpenChange?: (event: MenuSubmenuRootEvents['openChange']) => void;
25
+ }
14
26
 
15
27
  function MenuSubmenuRootComponent(props: MenuSubmenuRootProps, forwardedRef: ForwardedRef<MenuSubmenuRootElement>) {
16
28
  registerMenuSubmenuRootElement();
17
29
 
18
30
  const elementRef = useRef<MenuSubmenuRootElement>(null);
31
+ const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);
32
+
33
+ const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;
34
+
35
+ useLayoutEffect(() => {
36
+ const element = elementRef.current as Record<string, unknown> | null;
37
+ if (!element) return;
38
+ Object.assign(element, { defaultOpen: p0, disabled: p1, open: p2 });
39
+ handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;
40
+ });
19
41
 
20
- const { ...restProps } = props;
42
+ useLayoutEffect(() => {
43
+ const element = elementRef.current;
44
+ if (!element) return;
45
+ const ac = new AbortController();
46
+ for (const [index, eventName] of ['openChange'].entries()) {
47
+ element.addEventListener(
48
+ eventName,
49
+ (event: Event) => {
50
+ handlersRef.current[index]?.(event);
51
+ },
52
+ { signal: ac.signal },
53
+ );
54
+ }
55
+ return () => ac.abort();
56
+ }, []);
21
57
 
22
58
  const mergedRef = useCallback(
23
59
  (element: MenuSubmenuRootElement | null) => {
@@ -34,9 +70,5 @@ function MenuSubmenuRootComponent(props: MenuSubmenuRootProps, forwardedRef: For
34
70
  return createElement('prosekit-menu-submenu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
35
71
  }
36
72
 
37
- /**
38
- * A React component that renders an `prosekit-menu-submenu-root` custom element.
39
- *
40
- * @public
41
- */
73
+ /** A React component that renders an `prosekit-menu-submenu-root` custom element. */
42
74
  export const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & HTMLAttributes<MenuSubmenuRootElement> & RefAttributes<MenuSubmenuRootElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);