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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/editor-context.js +0 -2
  2. package/dist/editor-context.js.map +1 -1
  3. package/dist/prosekit-preact-autocomplete.d.ts +10 -61
  4. package/dist/prosekit-preact-autocomplete.d.ts.map +1 -1
  5. package/dist/prosekit-preact-autocomplete.js +5 -50
  6. package/dist/prosekit-preact-autocomplete.js.map +1 -1
  7. package/dist/prosekit-preact-block-handle.d.ts +10 -61
  8. package/dist/prosekit-preact-block-handle.d.ts.map +1 -1
  9. package/dist/prosekit-preact-block-handle.js +5 -50
  10. package/dist/prosekit-preact-block-handle.js.map +1 -1
  11. package/dist/prosekit-preact-drop-indicator.d.ts +2 -13
  12. package/dist/prosekit-preact-drop-indicator.d.ts.map +1 -1
  13. package/dist/prosekit-preact-drop-indicator.js +1 -10
  14. package/dist/prosekit-preact-drop-indicator.js.map +1 -1
  15. package/dist/prosekit-preact-inline-popover.d.ts +6 -37
  16. package/dist/prosekit-preact-inline-popover.d.ts.map +1 -1
  17. package/dist/prosekit-preact-inline-popover.js +3 -30
  18. package/dist/prosekit-preact-inline-popover.js.map +1 -1
  19. package/dist/prosekit-preact-menu.d.ts +48 -88
  20. package/dist/prosekit-preact-menu.d.ts.map +1 -1
  21. package/dist/prosekit-preact-menu.js +37 -72
  22. package/dist/prosekit-preact-menu.js.map +1 -1
  23. package/dist/prosekit-preact-popover.d.ts +8 -49
  24. package/dist/prosekit-preact-popover.d.ts.map +1 -1
  25. package/dist/prosekit-preact-popover.js +4 -40
  26. package/dist/prosekit-preact-popover.js.map +1 -1
  27. package/dist/prosekit-preact-resizable.d.ts +4 -25
  28. package/dist/prosekit-preact-resizable.d.ts.map +1 -1
  29. package/dist/prosekit-preact-resizable.js +2 -20
  30. package/dist/prosekit-preact-resizable.js.map +1 -1
  31. package/dist/prosekit-preact-table-handle.d.ts +22 -133
  32. package/dist/prosekit-preact-table-handle.d.ts.map +1 -1
  33. package/dist/prosekit-preact-table-handle.js +11 -110
  34. package/dist/prosekit-preact-table-handle.js.map +1 -1
  35. package/dist/prosekit-preact-tooltip.d.ts +8 -49
  36. package/dist/prosekit-preact-tooltip.d.ts.map +1 -1
  37. package/dist/prosekit-preact-tooltip.js +4 -40
  38. package/dist/prosekit-preact-tooltip.js.map +1 -1
  39. package/dist/prosekit-preact.d.ts +0 -21
  40. package/dist/prosekit-preact.d.ts.map +1 -1
  41. package/dist/prosekit-preact.js +0 -26
  42. package/dist/prosekit-preact.js.map +1 -1
  43. package/package.json +5 -5
  44. package/src/components/autocomplete/autocomplete-empty.gen.ts +3 -13
  45. package/src/components/autocomplete/autocomplete-item.gen.ts +3 -13
  46. package/src/components/autocomplete/autocomplete-popup.gen.ts +3 -13
  47. package/src/components/autocomplete/autocomplete-positioner.gen.ts +3 -13
  48. package/src/components/autocomplete/autocomplete-root.gen.ts +3 -13
  49. package/src/components/autocomplete/index.gen.ts +1 -3
  50. package/src/components/block-handle/block-handle-add.gen.ts +3 -13
  51. package/src/components/block-handle/block-handle-draggable.gen.ts +3 -13
  52. package/src/components/block-handle/block-handle-popup.gen.ts +3 -13
  53. package/src/components/block-handle/block-handle-positioner.gen.ts +3 -13
  54. package/src/components/block-handle/block-handle-root.gen.ts +3 -13
  55. package/src/components/block-handle/index.gen.ts +1 -3
  56. package/src/components/drop-indicator/drop-indicator.gen.ts +3 -13
  57. package/src/components/drop-indicator/index.gen.ts +1 -3
  58. package/src/components/inline-popover/index.gen.ts +1 -3
  59. package/src/components/inline-popover/inline-popover-popup.gen.ts +3 -13
  60. package/src/components/inline-popover/inline-popover-positioner.gen.ts +3 -13
  61. package/src/components/inline-popover/inline-popover-root.gen.ts +3 -13
  62. package/src/components/menu/index.gen.ts +1 -3
  63. package/src/components/menu/menu-item.gen.ts +3 -13
  64. package/src/components/menu/menu-popup.gen.ts +3 -13
  65. package/src/components/menu/menu-positioner.gen.ts +3 -13
  66. package/src/components/menu/menu-root.gen.ts +3 -13
  67. package/src/components/menu/menu-submenu-root.gen.ts +49 -17
  68. package/src/components/menu/menu-submenu-trigger.gen.ts +27 -18
  69. package/src/components/menu/menu-trigger.gen.ts +3 -13
  70. package/src/components/popover/index.gen.ts +1 -3
  71. package/src/components/popover/popover-popup.gen.ts +3 -13
  72. package/src/components/popover/popover-positioner.gen.ts +3 -13
  73. package/src/components/popover/popover-root.gen.ts +3 -13
  74. package/src/components/popover/popover-trigger.gen.ts +3 -13
  75. package/src/components/resizable/index.gen.ts +1 -3
  76. package/src/components/resizable/resizable-handle.gen.ts +3 -13
  77. package/src/components/resizable/resizable-root.gen.ts +3 -13
  78. package/src/components/table-handle/index.gen.ts +1 -3
  79. package/src/components/table-handle/table-handle-column-menu-root.gen.ts +3 -13
  80. package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +3 -13
  81. package/src/components/table-handle/table-handle-column-popup.gen.ts +3 -13
  82. package/src/components/table-handle/table-handle-column-positioner.gen.ts +3 -13
  83. package/src/components/table-handle/table-handle-drag-preview.gen.ts +3 -13
  84. package/src/components/table-handle/table-handle-drop-indicator.gen.ts +3 -13
  85. package/src/components/table-handle/table-handle-root.gen.ts +3 -13
  86. package/src/components/table-handle/table-handle-row-menu-root.gen.ts +3 -13
  87. package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +3 -13
  88. package/src/components/table-handle/table-handle-row-popup.gen.ts +3 -13
  89. package/src/components/table-handle/table-handle-row-positioner.gen.ts +3 -13
  90. package/src/components/tooltip/index.gen.ts +1 -3
  91. package/src/components/tooltip/tooltip-popup.gen.ts +3 -13
  92. package/src/components/tooltip/tooltip-positioner.gen.ts +3 -13
  93. package/src/components/tooltip/tooltip-root.gen.ts +3 -13
  94. package/src/components/tooltip/tooltip-trigger.gen.ts +3 -13
@@ -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 { 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
- */
8
+ /** Props for the {@link InlinePopoverPopup} Preact component. */
15
9
  export interface InlinePopoverPopupProps {}
16
10
 
17
11
  function InlinePopoverPopupComponent(props: InlinePopoverPopupProps, forwardedRef: Ref<InlinePopoverPopupElement>) {
@@ -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
- */
33
+ /** A Preact component that renders an `prosekit-inline-popover-popup` custom element. */
44
34
  export const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & HTMLAttributes<InlinePopoverPopupElement> & RefAttributes<InlinePopoverPopupElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);
@@ -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 { 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
- */
8
+ /** Props for the {@link InlinePopoverPositioner} Preact component. */
15
9
  export interface InlinePopoverPositionerProps {
16
10
  /**
17
11
  * The initial placement of the floating element
@@ -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
- */
166
+ /** A Preact component that renders an `prosekit-inline-popover-positioner` custom element. */
177
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,11 +7,7 @@ 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
- */
10
+ /** Props for the {@link InlinePopoverRoot} Preact component. */
17
11
  export interface InlinePopoverRootProps {
18
12
  /**
19
13
  * The ProseKit editor instance.
@@ -98,9 +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
- */
95
+ /** A Preact component that renders an `prosekit-inline-popover-root` custom element. */
106
96
  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,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 { 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
- */
8
+ /** Props for the {@link MenuItem} Preact component. */
15
9
  export interface MenuItemProps {
16
10
  /**
17
11
  * The unique value for this menu item.
@@ -81,9 +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
- */
78
+ /** A Preact component that renders an `prosekit-menu-item` custom element. */
89
79
  export const MenuItem: ForwardRefExoticComponent<MenuItemProps & Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> & RefAttributes<MenuItemElement>> = /* @__PURE__ */ forwardRef(MenuItemComponent);
@@ -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 { 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
- */
8
+ /** Props for the {@link MenuPopup} Preact component. */
15
9
  export interface MenuPopupProps {
16
10
  /**
17
11
  * By default, the MenuPopup element will 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
- */
47
+ /** A Preact component that renders an `prosekit-menu-popup` custom element. */
58
48
  export const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & HTMLAttributes<MenuPopupElement> & RefAttributes<MenuPopupElement>> = /* @__PURE__ */ forwardRef(MenuPopupComponent);
@@ -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 { 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
- */
8
+ /** Props for the {@link MenuPositioner} Preact component. */
15
9
  export interface MenuPositionerProps {
16
10
  /**
17
11
  * The initial placement of the floating element
@@ -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
- */
167
+ /** A Preact component that renders an `prosekit-menu-positioner` custom element. */
178
168
  export const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & HTMLAttributes<MenuPositionerElement> & RefAttributes<MenuPositionerElement>> = /* @__PURE__ */ forwardRef(MenuPositionerComponent);
@@ -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 { 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
- */
8
+ /** Props for the {@link MenuRoot} Preact component. */
15
9
  export interface MenuRootProps {
16
10
  /**
17
11
  * Whether the overlay is initially open.
@@ -78,9 +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
- */
75
+ /** A Preact component that renders an `prosekit-menu-root` custom element. */
86
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 {}
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
- */
75
+ /** A Preact component that renders an `prosekit-menu-submenu-root` custom element. */
44
76
  export const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & HTMLAttributes<MenuSubmenuRootElement> & RefAttributes<MenuSubmenuRootElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);
@@ -1,25 +1,38 @@
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 { registerMenuSubmenuTriggerElement, type MenuSubmenuTriggerElement } from '@prosekit/web/menu';
3
+ import { registerMenuSubmenuTriggerElement, type MenuSubmenuTriggerElement, type MenuSubmenuTriggerProps as MenuSubmenuTriggerElementProps } 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';
9
-
10
- /**
11
- * Props for the {@link MenuSubmenuTrigger} Preact component.
12
- *
13
- * @public
14
- */
15
- export interface MenuSubmenuTriggerProps {}
6
+ import { useCallback, useRef, useLayoutEffect } from 'preact/hooks';
7
+
8
+ /** Props for the {@link MenuSubmenuTrigger} Preact component. */
9
+ export interface MenuSubmenuTriggerProps {
10
+ /**
11
+ * The unique value for this submenu trigger in the parent menu.
12
+ *
13
+ * @default ""
14
+ */
15
+ value?: MenuSubmenuTriggerElementProps['value'];
16
+ /**
17
+ * Whether this submenu trigger is disabled.
18
+ *
19
+ * @default false
20
+ */
21
+ disabled?: MenuSubmenuTriggerElementProps['disabled'];
22
+ }
16
23
 
17
24
  function MenuSubmenuTriggerComponent(props: MenuSubmenuTriggerProps, forwardedRef: Ref<MenuSubmenuTriggerElement>) {
18
25
  registerMenuSubmenuTriggerElement();
19
26
 
20
27
  const elementRef = useRef<MenuSubmenuTriggerElement>(null);
21
28
 
22
- const { ...restProps } = props;
29
+ const { disabled: p0, value: p1, ...restProps } = props;
30
+
31
+ useLayoutEffect(() => {
32
+ const element = elementRef.current as Record<string, unknown> | null;
33
+ if (!element) return;
34
+ Object.assign(element, { disabled: p0, value: p1 });
35
+ });
23
36
 
24
37
  const mergedRef = useCallback(
25
38
  (element: MenuSubmenuTriggerElement | null) => {
@@ -36,9 +49,5 @@ function MenuSubmenuTriggerComponent(props: MenuSubmenuTriggerProps, forwardedRe
36
49
  return createElement('prosekit-menu-submenu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
37
50
  }
38
51
 
39
- /**
40
- * A Preact component that renders an `prosekit-menu-submenu-trigger` custom element.
41
- *
42
- * @public
43
- */
52
+ /** A Preact component that renders an `prosekit-menu-submenu-trigger` custom element. */
44
53
  export const MenuSubmenuTrigger: ForwardRefExoticComponent<MenuSubmenuTriggerProps & HTMLAttributes<MenuSubmenuTriggerElement> & RefAttributes<MenuSubmenuTriggerElement>> = /* @__PURE__ */ forwardRef(MenuSubmenuTriggerComponent);
@@ -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 { registerMenuTriggerElement, type MenuTriggerElement, type MenuTriggerProps as MenuTriggerElementProps, type MenuTriggerEvents } 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 MenuTrigger} Preact component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link MenuTrigger} Preact component. */
15
9
  export interface MenuTriggerProps {
16
10
  /**
17
11
  * Whether the component should ignore user interaction.
@@ -69,9 +63,5 @@ function MenuTriggerComponent(props: MenuTriggerProps, forwardedRef: Ref<MenuTri
69
63
  return createElement('prosekit-menu-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
70
64
  }
71
65
 
72
- /**
73
- * A Preact component that renders an `prosekit-menu-trigger` custom element.
74
- *
75
- * @public
76
- */
66
+ /** A Preact component that renders an `prosekit-menu-trigger` custom element. */
77
67
  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,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 { registerPopoverPopupElement, type PopoverPopupElement } from '@prosekit/web/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 PopoverPopup} Preact component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link PopoverPopup} Preact component. */
15
9
  export interface PopoverPopupProps {}
16
10
 
17
11
  function PopoverPopupComponent(props: PopoverPopupProps, forwardedRef: Ref<PopoverPopupElement>) {
@@ -36,9 +30,5 @@ function PopoverPopupComponent(props: PopoverPopupProps, forwardedRef: Ref<Popov
36
30
  return createElement('prosekit-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
37
31
  }
38
32
 
39
- /**
40
- * A Preact component that renders an `prosekit-popover-popup` custom element.
41
- *
42
- * @public
43
- */
33
+ /** A Preact component that renders an `prosekit-popover-popup` custom element. */
44
34
  export const PopoverPopup: ForwardRefExoticComponent<PopoverPopupProps & HTMLAttributes<PopoverPopupElement> & RefAttributes<PopoverPopupElement>> = /* @__PURE__ */ forwardRef(PopoverPopupComponent);
@@ -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 { registerPopoverPositionerElement, type PopoverPositionerElement, type PopoverPositionerProps as PopoverPositionerElementProps } from '@prosekit/web/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 PopoverPositioner} Preact component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link PopoverPositioner} Preact component. */
15
9
  export interface PopoverPositionerProps {
16
10
  /**
17
11
  * The strategy to use for positioning
@@ -170,9 +164,5 @@ function PopoverPositionerComponent(props: PopoverPositionerProps, forwardedRef:
170
164
  return createElement('prosekit-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
171
165
  }
172
166
 
173
- /**
174
- * A Preact component that renders an `prosekit-popover-positioner` custom element.
175
- *
176
- * @public
177
- */
167
+ /** A Preact component that renders an `prosekit-popover-positioner` custom element. */
178
168
  export const PopoverPositioner: ForwardRefExoticComponent<PopoverPositionerProps & HTMLAttributes<PopoverPositionerElement> & RefAttributes<PopoverPositionerElement>> = /* @__PURE__ */ forwardRef(PopoverPositionerComponent);
@@ -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 { registerPopoverRootElement, type PopoverRootElement, type PopoverRootProps as PopoverRootElementProps, type PopoverRootEvents } from '@prosekit/web/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 PopoverRoot} Preact component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link PopoverRoot} Preact component. */
15
9
  export interface PopoverRootProps {
16
10
  /**
17
11
  * Whether the popover should be modal.
@@ -85,9 +79,5 @@ function PopoverRootComponent(props: PopoverRootProps, forwardedRef: Ref<Popover
85
79
  return createElement('prosekit-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
86
80
  }
87
81
 
88
- /**
89
- * A Preact component that renders an `prosekit-popover-root` custom element.
90
- *
91
- * @public
92
- */
82
+ /** A Preact component that renders an `prosekit-popover-root` custom element. */
93
83
  export const PopoverRoot: ForwardRefExoticComponent<PopoverRootProps & HTMLAttributes<PopoverRootElement> & RefAttributes<PopoverRootElement>> = /* @__PURE__ */ forwardRef(PopoverRootComponent);
@@ -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 { registerPopoverTriggerElement, type PopoverTriggerElement, type PopoverTriggerProps as PopoverTriggerElementProps, type PopoverTriggerEvents } from '@prosekit/web/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 PopoverTrigger} Preact component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link PopoverTrigger} Preact component. */
15
9
  export interface PopoverTriggerProps {
16
10
  /**
17
11
  * Whether the component should ignore user interaction.
@@ -85,9 +79,5 @@ function PopoverTriggerComponent(props: PopoverTriggerProps, forwardedRef: Ref<P
85
79
  return createElement('prosekit-popover-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
86
80
  }
87
81
 
88
- /**
89
- * A Preact component that renders an `prosekit-popover-trigger` custom element.
90
- *
91
- * @public
92
- */
82
+ /** A Preact component that renders an `prosekit-popover-trigger` custom element. */
93
83
  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,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 { registerResizableHandleElement, type ResizableHandleElement, type ResizableHandleProps as ResizableHandleElementProps } from '@prosekit/web/resizable';
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 ResizableHandle} Preact component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link ResizableHandle} Preact component. */
15
9
  export interface ResizableHandleProps {
16
10
  /**
17
11
  * The position of the handle.
@@ -49,9 +43,5 @@ function ResizableHandleComponent(props: ResizableHandleProps, forwardedRef: Ref
49
43
  return createElement('prosekit-resizable-handle', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
50
44
  }
51
45
 
52
- /**
53
- * A Preact component that renders an `prosekit-resizable-handle` custom element.
54
- *
55
- * @public
56
- */
46
+ /** A Preact component that renders an `prosekit-resizable-handle` custom element. */
57
47
  export const ResizableHandle: ForwardRefExoticComponent<ResizableHandleProps & HTMLAttributes<ResizableHandleElement> & RefAttributes<ResizableHandleElement>> = /* @__PURE__ */ forwardRef(ResizableHandleComponent);
@@ -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 { registerResizableRootElement, type ResizableRootElement, type ResizableRootProps as ResizableRootElementProps, type ResizableRootEvents } from '@prosekit/web/resizable';
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 ResizableRoot} Preact component.
12
- *
13
- * @public
14
- */
8
+ /** Props for the {@link ResizableRoot} Preact component. */
15
9
  export interface ResizableRootProps {
16
10
  /**
17
11
  * The width of the resizable element.
@@ -83,9 +77,5 @@ function ResizableRootComponent(props: ResizableRootProps, forwardedRef: Ref<Res
83
77
  return createElement('prosekit-resizable-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
84
78
  }
85
79
 
86
- /**
87
- * A Preact component that renders an `prosekit-resizable-root` custom element.
88
- *
89
- * @public
90
- */
80
+ /** A Preact component that renders an `prosekit-resizable-root` custom element. */
91
81
  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