@prosekit/react 0.7.0-beta.4 → 0.7.0-beta.6

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 (88) hide show
  1. package/dist/prosekit-react-autocomplete.d.ts +10 -50
  2. package/dist/prosekit-react-autocomplete.d.ts.map +1 -1
  3. package/dist/prosekit-react-autocomplete.js +5 -40
  4. package/dist/prosekit-react-autocomplete.js.map +1 -1
  5. package/dist/prosekit-react-block-handle.d.ts +10 -50
  6. package/dist/prosekit-react-block-handle.d.ts.map +1 -1
  7. package/dist/prosekit-react-block-handle.js +5 -40
  8. package/dist/prosekit-react-block-handle.js.map +1 -1
  9. package/dist/prosekit-react-drop-indicator.d.ts +2 -10
  10. package/dist/prosekit-react-drop-indicator.d.ts.map +1 -1
  11. package/dist/prosekit-react-drop-indicator.js +1 -8
  12. package/dist/prosekit-react-drop-indicator.js.map +1 -1
  13. package/dist/prosekit-react-inline-popover.d.ts +6 -30
  14. package/dist/prosekit-react-inline-popover.d.ts.map +1 -1
  15. package/dist/prosekit-react-inline-popover.js +3 -24
  16. package/dist/prosekit-react-inline-popover.js.map +1 -1
  17. package/dist/prosekit-react-menu.d.ts +48 -73
  18. package/dist/prosekit-react-menu.d.ts.map +1 -1
  19. package/dist/prosekit-react-menu.js +37 -58
  20. package/dist/prosekit-react-menu.js.map +1 -1
  21. package/dist/prosekit-react-popover.d.ts +8 -40
  22. package/dist/prosekit-react-popover.d.ts.map +1 -1
  23. package/dist/prosekit-react-popover.js +4 -32
  24. package/dist/prosekit-react-popover.js.map +1 -1
  25. package/dist/prosekit-react-resizable.d.ts +4 -20
  26. package/dist/prosekit-react-resizable.d.ts.map +1 -1
  27. package/dist/prosekit-react-resizable.js +2 -16
  28. package/dist/prosekit-react-resizable.js.map +1 -1
  29. package/dist/prosekit-react-table-handle.d.ts +22 -110
  30. package/dist/prosekit-react-table-handle.d.ts.map +1 -1
  31. package/dist/prosekit-react-table-handle.js +11 -88
  32. package/dist/prosekit-react-table-handle.js.map +1 -1
  33. package/dist/prosekit-react-tooltip.d.ts +8 -40
  34. package/dist/prosekit-react-tooltip.d.ts.map +1 -1
  35. package/dist/prosekit-react-tooltip.js +4 -32
  36. package/dist/prosekit-react-tooltip.js.map +1 -1
  37. package/package.json +5 -5
  38. package/src/components/autocomplete/autocomplete-empty.gen.ts +3 -13
  39. package/src/components/autocomplete/autocomplete-item.gen.ts +3 -13
  40. package/src/components/autocomplete/autocomplete-popup.gen.ts +3 -13
  41. package/src/components/autocomplete/autocomplete-positioner.gen.ts +3 -13
  42. package/src/components/autocomplete/autocomplete-root.gen.ts +3 -13
  43. package/src/components/autocomplete/index.gen.ts +1 -3
  44. package/src/components/block-handle/block-handle-add.gen.ts +3 -13
  45. package/src/components/block-handle/block-handle-draggable.gen.ts +3 -13
  46. package/src/components/block-handle/block-handle-popup.gen.ts +3 -13
  47. package/src/components/block-handle/block-handle-positioner.gen.ts +3 -13
  48. package/src/components/block-handle/block-handle-root.gen.ts +3 -13
  49. package/src/components/block-handle/index.gen.ts +1 -3
  50. package/src/components/drop-indicator/drop-indicator.gen.ts +3 -13
  51. package/src/components/drop-indicator/index.gen.ts +1 -3
  52. package/src/components/inline-popover/index.gen.ts +1 -3
  53. package/src/components/inline-popover/inline-popover-popup.gen.ts +3 -13
  54. package/src/components/inline-popover/inline-popover-positioner.gen.ts +3 -13
  55. package/src/components/inline-popover/inline-popover-root.gen.ts +3 -13
  56. package/src/components/menu/index.gen.ts +1 -3
  57. package/src/components/menu/menu-item.gen.ts +3 -13
  58. package/src/components/menu/menu-popup.gen.ts +3 -13
  59. package/src/components/menu/menu-positioner.gen.ts +3 -13
  60. package/src/components/menu/menu-root.gen.ts +3 -13
  61. package/src/components/menu/menu-submenu-root.gen.ts +49 -17
  62. package/src/components/menu/menu-submenu-trigger.gen.ts +28 -19
  63. package/src/components/menu/menu-trigger.gen.ts +3 -13
  64. package/src/components/popover/index.gen.ts +1 -3
  65. package/src/components/popover/popover-popup.gen.ts +3 -13
  66. package/src/components/popover/popover-positioner.gen.ts +3 -13
  67. package/src/components/popover/popover-root.gen.ts +3 -13
  68. package/src/components/popover/popover-trigger.gen.ts +3 -13
  69. package/src/components/resizable/index.gen.ts +1 -3
  70. package/src/components/resizable/resizable-handle.gen.ts +3 -13
  71. package/src/components/resizable/resizable-root.gen.ts +3 -13
  72. package/src/components/table-handle/index.gen.ts +1 -3
  73. package/src/components/table-handle/table-handle-column-menu-root.gen.ts +3 -13
  74. package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +3 -13
  75. package/src/components/table-handle/table-handle-column-popup.gen.ts +3 -13
  76. package/src/components/table-handle/table-handle-column-positioner.gen.ts +3 -13
  77. package/src/components/table-handle/table-handle-drag-preview.gen.ts +3 -13
  78. package/src/components/table-handle/table-handle-drop-indicator.gen.ts +3 -13
  79. package/src/components/table-handle/table-handle-root.gen.ts +3 -13
  80. package/src/components/table-handle/table-handle-row-menu-root.gen.ts +3 -13
  81. package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +3 -13
  82. package/src/components/table-handle/table-handle-row-popup.gen.ts +3 -13
  83. package/src/components/table-handle/table-handle-row-positioner.gen.ts +3 -13
  84. package/src/components/tooltip/index.gen.ts +1 -3
  85. package/src/components/tooltip/tooltip-popup.gen.ts +3 -13
  86. package/src/components/tooltip/tooltip-positioner.gen.ts +3 -13
  87. package/src/components/tooltip/tooltip-root.gen.ts +3 -13
  88. package/src/components/tooltip/tooltip-trigger.gen.ts +3 -13
@@ -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,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
 
@@ -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
 
@@ -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);
@@ -1,23 +1,36 @@
1
- /**
2
- * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
3
- */
4
-
5
- import { registerMenuSubmenuTriggerElement, type MenuSubmenuTriggerElement } from '@prosekit/web/menu';
6
- import { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';
7
-
8
- /**
9
- * Props for the {@link MenuSubmenuTrigger} React component.
10
- *
11
- * @public
12
- */
13
- export interface MenuSubmenuTriggerProps {}
1
+ // This file is auto-generated by "@aria-ui/cli". Do not edit this file directly.
2
+
3
+ import { registerMenuSubmenuTriggerElement, type MenuSubmenuTriggerElement, type MenuSubmenuTriggerProps as MenuSubmenuTriggerElementProps } from '@prosekit/web/menu';
4
+ import { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';
5
+
6
+ /** Props for the {@link MenuSubmenuTrigger} React component. */
7
+ export interface MenuSubmenuTriggerProps {
8
+ /**
9
+ * The unique value for this submenu trigger in the parent menu.
10
+ *
11
+ * @default ""
12
+ */
13
+ value?: MenuSubmenuTriggerElementProps['value'];
14
+ /**
15
+ * Whether this submenu trigger is disabled.
16
+ *
17
+ * @default false
18
+ */
19
+ disabled?: MenuSubmenuTriggerElementProps['disabled'];
20
+ }
14
21
 
15
22
  function MenuSubmenuTriggerComponent(props: MenuSubmenuTriggerProps, forwardedRef: ForwardedRef<MenuSubmenuTriggerElement>) {
16
23
  registerMenuSubmenuTriggerElement();
17
24
 
18
25
  const elementRef = useRef<MenuSubmenuTriggerElement>(null);
19
26
 
20
- const { ...restProps } = props;
27
+ const { disabled: p0, value: p1, ...restProps } = props;
28
+
29
+ useLayoutEffect(() => {
30
+ const element = elementRef.current as Record<string, unknown> | null;
31
+ if (!element) return;
32
+ Object.assign(element, { disabled: p0, value: p1 });
33
+ });
21
34
 
22
35
  const mergedRef = useCallback(
23
36
  (element: MenuSubmenuTriggerElement | null) => {
@@ -34,9 +47,5 @@ function MenuSubmenuTriggerComponent(props: MenuSubmenuTriggerProps, forwardedRe
34
47
  return createElement('prosekit-menu-submenu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
35
48
  }
36
49
 
37
- /**
38
- * A React component that renders an `prosekit-menu-submenu-trigger` custom element.
39
- *
40
- * @public
41
- */
50
+ /** A React component that renders an `prosekit-menu-submenu-trigger` custom element. */
42
51
  export const MenuSubmenuTrigger: ForwardRefExoticComponent<MenuSubmenuTriggerProps & HTMLAttributes<MenuSubmenuTriggerElement> & RefAttributes<MenuSubmenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuTriggerComponent);
@@ -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 { registerMenuTriggerElement, type MenuTriggerElement, type MenuTriggerProps as MenuTriggerElementProps, type MenuTriggerEvents } 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 MenuTrigger} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link MenuTrigger} React component. */
13
7
  export interface MenuTriggerProps {
14
8
  /**
15
9
  * Whether the component should ignore user interaction.
@@ -67,9 +61,5 @@ function MenuTriggerComponent(props: MenuTriggerProps, forwardedRef: ForwardedRe
67
61
  return createElement('prosekit-menu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
68
62
  }
69
63
 
70
- /**
71
- * A React component that renders an `prosekit-menu-trigger` custom element.
72
- *
73
- * @public
74
- */
64
+ /** A React component that renders an `prosekit-menu-trigger` custom element. */
75
65
  export const MenuTrigger: ForwardRefExoticComponent<MenuTriggerProps & HTMLAttributes<MenuTriggerElement> & RefAttributes<MenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuTriggerComponent);
@@ -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 { PopoverPopup, type PopoverPopupProps } from './popover-popup.gen.ts';
6
4
 
@@ -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 { registerPopoverPopupElement, type PopoverPopupElement } from '@prosekit/web/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 PopoverPopup} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link PopoverPopup} React component. */
13
7
  export interface PopoverPopupProps {}
14
8
 
15
9
  function PopoverPopupComponent(props: PopoverPopupProps, forwardedRef: ForwardedRef<PopoverPopupElement>) {
@@ -34,9 +28,5 @@ function PopoverPopupComponent(props: PopoverPopupProps, forwardedRef: Forwarded
34
28
  return createElement('prosekit-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
35
29
  }
36
30
 
37
- /**
38
- * A React component that renders an `prosekit-popover-popup` custom element.
39
- *
40
- * @public
41
- */
31
+ /** A React component that renders an `prosekit-popover-popup` custom element. */
42
32
  export const PopoverPopup: ForwardRefExoticComponent<PopoverPopupProps & HTMLAttributes<PopoverPopupElement> & RefAttributes<PopoverPopupElement>> = /* @__PURE__ */ forwardRef(PopoverPopupComponent);
@@ -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 { registerPopoverPositionerElement, type PopoverPositionerElement, type PopoverPositionerProps as PopoverPositionerElementProps } from '@prosekit/web/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 PopoverPositioner} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link PopoverPositioner} React component. */
13
7
  export interface PopoverPositionerProps {
14
8
  /**
15
9
  * The strategy to use for positioning
@@ -168,9 +162,5 @@ function PopoverPositionerComponent(props: PopoverPositionerProps, forwardedRef:
168
162
  return createElement('prosekit-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
169
163
  }
170
164
 
171
- /**
172
- * A React component that renders an `prosekit-popover-positioner` custom element.
173
- *
174
- * @public
175
- */
165
+ /** A React component that renders an `prosekit-popover-positioner` custom element. */
176
166
  export const PopoverPositioner: ForwardRefExoticComponent<PopoverPositionerProps & HTMLAttributes<PopoverPositionerElement> & RefAttributes<PopoverPositionerElement>> = /* @__PURE__ */ forwardRef(PopoverPositionerComponent);
@@ -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 { registerPopoverRootElement, type PopoverRootElement, type PopoverRootProps as PopoverRootElementProps, type PopoverRootEvents } from '@prosekit/web/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 PopoverRoot} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link PopoverRoot} React component. */
13
7
  export interface PopoverRootProps {
14
8
  /**
15
9
  * Whether the popover should be modal.
@@ -83,9 +77,5 @@ function PopoverRootComponent(props: PopoverRootProps, forwardedRef: ForwardedRe
83
77
  return createElement('prosekit-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
84
78
  }
85
79
 
86
- /**
87
- * A React component that renders an `prosekit-popover-root` custom element.
88
- *
89
- * @public
90
- */
80
+ /** A React component that renders an `prosekit-popover-root` custom element. */
91
81
  export const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & HTMLAttributes<PopoverRootElement> & RefAttributes<PopoverRootElement>> = /* @__PURE__ */ forwardRef(PopoverRootComponent);
@@ -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 { registerPopoverTriggerElement, type PopoverTriggerElement, type PopoverTriggerProps as PopoverTriggerElementProps, type PopoverTriggerEvents } from '@prosekit/web/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 PopoverTrigger} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link PopoverTrigger} React component. */
13
7
  export interface PopoverTriggerProps {
14
8
  /**
15
9
  * Whether the component should ignore user interaction.
@@ -83,9 +77,5 @@ function PopoverTriggerComponent(props: PopoverTriggerProps, forwardedRef: Forwa
83
77
  return createElement('prosekit-popover-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
84
78
  }
85
79
 
86
- /**
87
- * A React component that renders an `prosekit-popover-trigger` custom element.
88
- *
89
- * @public
90
- */
80
+ /** A React component that renders an `prosekit-popover-trigger` custom element. */
91
81
  export const PopoverTrigger: ForwardRefExoticComponent<PopoverTriggerProps & HTMLAttributes<PopoverTriggerElement> & RefAttributes<PopoverTriggerElement>> = /* @__PURE__ */ forwardRef(PopoverTriggerComponent);
@@ -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 { ResizableRoot, type ResizableRootProps } from './resizable-root.gen.ts';
6
4
 
@@ -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 { registerResizableHandleElement, type ResizableHandleElement, type ResizableHandleProps as ResizableHandleElementProps } from '@prosekit/web/resizable';
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 ResizableHandle} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link ResizableHandle} React component. */
13
7
  export interface ResizableHandleProps {
14
8
  /**
15
9
  * The position of the handle.
@@ -47,9 +41,5 @@ function ResizableHandleComponent(props: ResizableHandleProps, forwardedRef: For
47
41
  return createElement('prosekit-resizable-handle', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
48
42
  }
49
43
 
50
- /**
51
- * A React component that renders an `prosekit-resizable-handle` custom element.
52
- *
53
- * @public
54
- */
44
+ /** A React component that renders an `prosekit-resizable-handle` custom element. */
55
45
  export const ResizableHandle: ForwardRefExoticComponent<ResizableHandleProps & HTMLAttributes<ResizableHandleElement> & RefAttributes<ResizableHandleElement>> = /* @__PURE__ */ forwardRef(ResizableHandleComponent);
@@ -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 { registerResizableRootElement, type ResizableRootElement, type ResizableRootProps as ResizableRootElementProps, type ResizableRootEvents } from '@prosekit/web/resizable';
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 ResizableRoot} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link ResizableRoot} React component. */
13
7
  export interface ResizableRootProps {
14
8
  /**
15
9
  * The width of the resizable element.
@@ -81,9 +75,5 @@ function ResizableRootComponent(props: ResizableRootProps, forwardedRef: Forward
81
75
  return createElement('prosekit-resizable-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
82
76
  }
83
77
 
84
- /**
85
- * A React component that renders an `prosekit-resizable-root` custom element.
86
- *
87
- * @public
88
- */
78
+ /** A React component that renders an `prosekit-resizable-root` custom element. */
89
79
  export const ResizableRoot: ForwardRefExoticComponent<ResizableRootProps & HTMLAttributes<ResizableRootElement> & RefAttributes<ResizableRootElement>> = /* @__PURE__ */ forwardRef(ResizableRootComponent);
@@ -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 { TableHandleColumnPopup, type TableHandleColumnPopupProps } from './table-handle-column-popup.gen.ts';
6
4
 
@@ -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 { registerTableHandleColumnMenuRootElement, type TableHandleColumnMenuRootElement, type TableHandleColumnMenuRootProps as TableHandleColumnMenuRootElementProps } from '@prosekit/web/table-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 TableHandleColumnMenuRoot} React component.
10
- *
11
- * @public
12
- */
6
+ /** Props for the {@link TableHandleColumnMenuRoot} React component. */
13
7
  export interface TableHandleColumnMenuRootProps {
14
8
  /**
15
9
  * Whether the overlay is initially open.
@@ -56,9 +50,5 @@ function TableHandleColumnMenuRootComponent(props: TableHandleColumnMenuRootProp
56
50
  return createElement('prosekit-table-handle-column-menu-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
57
51
  }
58
52
 
59
- /**
60
- * A React component that renders an `prosekit-table-handle-column-menu-root` custom element.
61
- *
62
- * @public
63
- */
53
+ /** A React component that renders an `prosekit-table-handle-column-menu-root` custom element. */
64
54
  export const TableHandleColumnMenuRoot: ForwardRefExoticComponent<TableHandleColumnMenuRootProps & HTMLAttributes<TableHandleColumnMenuRootElement> & RefAttributes<TableHandleColumnMenuRootElement>> = /* @__PURE__ */ forwardRef(TableHandleColumnMenuRootComponent);