@prosekit/react 0.6.9 → 0.7.0-beta.1

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 (117) hide show
  1. package/dist/prosekit-react-autocomplete.d.ts +224 -17
  2. package/dist/prosekit-react-autocomplete.d.ts.map +1 -1
  3. package/dist/prosekit-react-autocomplete.js +216 -9
  4. package/dist/prosekit-react-autocomplete.js.map +1 -1
  5. package/dist/prosekit-react-block-handle.d.ts +208 -13
  6. package/dist/prosekit-react-block-handle.d.ts.map +1 -1
  7. package/dist/prosekit-react-block-handle.js +182 -7
  8. package/dist/prosekit-react-block-handle.js.map +1 -1
  9. package/dist/prosekit-react-drop-indicator.d.ts +25 -5
  10. package/dist/prosekit-react-drop-indicator.d.ts.map +1 -1
  11. package/dist/prosekit-react-drop-indicator.js +36 -3
  12. package/dist/prosekit-react-drop-indicator.js.map +1 -1
  13. package/dist/prosekit-react-inline-popover.d.ts +202 -7
  14. package/dist/prosekit-react-inline-popover.d.ts.map +1 -1
  15. package/dist/prosekit-react-inline-popover.js +128 -5
  16. package/dist/prosekit-react-inline-popover.js.map +1 -1
  17. package/dist/prosekit-react-menu.d.ts +287 -0
  18. package/dist/prosekit-react-menu.d.ts.map +1 -0
  19. package/dist/prosekit-react-menu.js +272 -0
  20. package/dist/prosekit-react-menu.js.map +1 -0
  21. package/dist/prosekit-react-popover.d.ts +225 -13
  22. package/dist/prosekit-react-popover.d.ts.map +1 -1
  23. package/dist/prosekit-react-popover.js +168 -7
  24. package/dist/prosekit-react-popover.js.map +1 -1
  25. package/dist/prosekit-react-resizable.d.ts +54 -11
  26. package/dist/prosekit-react-resizable.d.ts.map +1 -1
  27. package/dist/prosekit-react-resizable.js +78 -7
  28. package/dist/prosekit-react-resizable.js.map +1 -1
  29. package/dist/prosekit-react-table-handle.d.ts +445 -37
  30. package/dist/prosekit-react-table-handle.d.ts.map +1 -1
  31. package/dist/prosekit-react-table-handle.js +379 -19
  32. package/dist/prosekit-react-table-handle.js.map +1 -1
  33. package/dist/prosekit-react-tooltip.d.ts +209 -13
  34. package/dist/prosekit-react-tooltip.d.ts.map +1 -1
  35. package/dist/prosekit-react-tooltip.js +155 -7
  36. package/dist/prosekit-react-tooltip.js.map +1 -1
  37. package/package.json +29 -18
  38. package/src/components/autocomplete/autocomplete-empty.gen.ts +39 -31
  39. package/src/components/autocomplete/autocomplete-item.gen.ts +82 -31
  40. package/src/components/autocomplete/autocomplete-popup.gen.ts +78 -0
  41. package/src/components/autocomplete/autocomplete-positioner.gen.ts +151 -0
  42. package/src/components/autocomplete/autocomplete-root.gen.ts +107 -0
  43. package/src/components/autocomplete/index.gen.ts +12 -4
  44. package/src/components/autocomplete/index.ts +27 -0
  45. package/src/components/block-handle/block-handle-add.gen.ts +57 -31
  46. package/src/components/block-handle/block-handle-draggable.gen.ts +57 -31
  47. package/src/components/block-handle/block-handle-popup.gen.ts +42 -0
  48. package/src/components/block-handle/block-handle-positioner.gen.ts +169 -0
  49. package/src/components/block-handle/block-handle-root.gen.ts +82 -0
  50. package/src/components/block-handle/index.gen.ts +13 -3
  51. package/src/components/block-handle/index.ts +27 -0
  52. package/src/components/drop-indicator/drop-indicator.gen.ts +63 -31
  53. package/src/components/drop-indicator/index.gen.ts +5 -1
  54. package/src/components/drop-indicator/index.ts +14 -0
  55. package/src/components/inline-popover/index.gen.ts +11 -1
  56. package/src/components/inline-popover/index.ts +22 -0
  57. package/src/components/inline-popover/inline-popover-popup.gen.ts +42 -0
  58. package/src/components/inline-popover/inline-popover-positioner.gen.ts +175 -0
  59. package/src/components/inline-popover/inline-popover-root.gen.ts +106 -0
  60. package/src/components/menu/index.gen.ts +19 -0
  61. package/src/components/menu/index.ts +37 -0
  62. package/src/components/menu/menu-item.gen.ts +89 -0
  63. package/src/components/menu/menu-popup.gen.ts +56 -0
  64. package/src/components/menu/menu-positioner.gen.ts +176 -0
  65. package/src/components/menu/menu-root.gen.ts +86 -0
  66. package/src/components/menu/menu-submenu-root.gen.ts +42 -0
  67. package/src/components/menu/menu-submenu-trigger.gen.ts +42 -0
  68. package/src/components/menu/menu-trigger.gen.ts +77 -0
  69. package/src/components/popover/index.gen.ts +11 -3
  70. package/src/components/popover/index.ts +24 -0
  71. package/src/components/popover/popover-popup.gen.ts +42 -0
  72. package/src/components/popover/popover-positioner.gen.ts +176 -0
  73. package/src/components/popover/popover-root.gen.ts +90 -31
  74. package/src/components/popover/popover-trigger.gen.ts +90 -31
  75. package/src/components/resizable/index.gen.ts +8 -2
  76. package/src/components/resizable/index.ts +20 -0
  77. package/src/components/resizable/resizable-handle.gen.ts +52 -31
  78. package/src/components/resizable/resizable-root.gen.ts +88 -31
  79. package/src/components/table-handle/index.gen.ts +17 -9
  80. package/src/components/table-handle/index.ts +58 -0
  81. package/src/components/table-handle/table-handle-column-menu-root.gen.ts +64 -0
  82. package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +58 -0
  83. package/src/components/table-handle/table-handle-column-popup.gen.ts +42 -0
  84. package/src/components/table-handle/table-handle-column-positioner.gen.ts +199 -0
  85. package/src/components/table-handle/table-handle-drag-preview.gen.ts +55 -31
  86. package/src/components/table-handle/table-handle-drop-indicator.gen.ts +55 -31
  87. package/src/components/table-handle/table-handle-root.gen.ts +57 -31
  88. package/src/components/table-handle/table-handle-row-menu-root.gen.ts +64 -0
  89. package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +58 -0
  90. package/src/components/table-handle/table-handle-row-popup.gen.ts +42 -0
  91. package/src/components/table-handle/table-handle-row-positioner.gen.ts +199 -0
  92. package/src/components/tooltip/index.gen.ts +11 -3
  93. package/src/components/tooltip/index.ts +24 -0
  94. package/src/components/tooltip/tooltip-popup.gen.ts +42 -0
  95. package/src/components/tooltip/tooltip-positioner.gen.ts +176 -0
  96. package/src/components/tooltip/tooltip-root.gen.ts +83 -31
  97. package/src/components/tooltip/tooltip-trigger.gen.ts +61 -31
  98. package/src/extensions/react-node-view.spec.ts +150 -0
  99. package/dist/create-component.js +0 -94
  100. package/dist/create-component.js.map +0 -1
  101. package/dist/create-props.d.ts +0 -6
  102. package/dist/create-props.d.ts.map +0 -1
  103. package/src/components/autocomplete/autocomplete-list.gen.ts +0 -34
  104. package/src/components/autocomplete/autocomplete-popover.gen.ts +0 -34
  105. package/src/components/block-handle/block-handle-popover.gen.ts +0 -34
  106. package/src/components/create-component.ts +0 -137
  107. package/src/components/create-props.ts +0 -13
  108. package/src/components/inline-popover/inline-popover.gen.ts +0 -34
  109. package/src/components/merge-refs.ts +0 -35
  110. package/src/components/popover/popover-content.gen.ts +0 -34
  111. package/src/components/table-handle/table-handle-column-root.gen.ts +0 -34
  112. package/src/components/table-handle/table-handle-column-trigger.gen.ts +0 -34
  113. package/src/components/table-handle/table-handle-popover-content.gen.ts +0 -34
  114. package/src/components/table-handle/table-handle-popover-item.gen.ts +0 -34
  115. package/src/components/table-handle/table-handle-row-root.gen.ts +0 -34
  116. package/src/components/table-handle/table-handle-row-trigger.gen.ts +0 -34
  117. package/src/components/tooltip/tooltip-content.gen.ts +0 -34
@@ -1,13 +1,208 @@
1
- import { t as CreateProps } from "./create-props.js";
2
1
  import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
3
- import { InlinePopoverElement, InlinePopoverEvents, InlinePopoverProps as InlinePopoverProps$1 } from "@prosekit/web/inline-popover";
2
+ import { InlinePopoverPopupElement, InlinePopoverPositionerElement, InlinePopoverPositionerProps as InlinePopoverPositionerProps$1, InlinePopoverRootElement, InlinePopoverRootEvents, InlinePopoverRootProps as InlinePopoverRootProps$1, OpenChangeEvent } from "@prosekit/web/inline-popover";
4
3
 
5
- //#region src/components/inline-popover/inline-popover.gen.d.ts
4
+ //#region src/components/inline-popover/inline-popover-popup.gen.d.ts
6
5
  /**
7
- * Props for the {@link InlinePopover} component.
6
+ * Props for the {@link InlinePopoverPopup} React component.
7
+ *
8
+ * @public
8
9
  */
9
- interface InlinePopoverProps extends Partial<CreateProps<InlinePopoverProps$1, InlinePopoverEvents>> {}
10
- declare const InlinePopover: ForwardRefExoticComponent<InlinePopoverProps & RefAttributes<InlinePopoverElement> & HTMLAttributes<InlinePopoverElement>>;
10
+ interface InlinePopoverPopupProps extends HTMLAttributes<InlinePopoverPopupElement> {}
11
+ /**
12
+ * A React component that renders an `prosekit-inline-popover-popup` custom element.
13
+ *
14
+ * @public
15
+ */
16
+ declare const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & RefAttributes<InlinePopoverPopupElement>>;
17
+ //#endregion
18
+ //#region src/components/inline-popover/inline-popover-positioner.gen.d.ts
19
+ /**
20
+ * Props for the {@link InlinePopoverPositioner} React component.
21
+ *
22
+ * @public
23
+ */
24
+ interface InlinePopoverPositionerProps extends HTMLAttributes<InlinePopoverPositionerElement> {
25
+ /**
26
+ * The initial placement of the floating element
27
+ *
28
+ * @default "top"
29
+ */
30
+ placement?: InlinePopoverPositionerProps$1['placement'];
31
+ /**
32
+ * The distance between the reference and floating element.
33
+ *
34
+ * @default 12
35
+ */
36
+ offset?: InlinePopoverPositionerProps$1['offset'];
37
+ /**
38
+ * Whether to hide the floating element when the reference element or the
39
+ * floating element is fully clipped.
40
+ *
41
+ * @default true
42
+ */
43
+ hide?: InlinePopoverPositionerProps$1['hide'];
44
+ /**
45
+ * Whether the floating element can overlap the reference element to keep it
46
+ * in view.
47
+ *
48
+ * @default true
49
+ */
50
+ overlap?: InlinePopoverPositionerProps$1['overlap'];
51
+ /**
52
+ * Whether to improve positioning for inline reference elements that span over
53
+ * multiple lines.
54
+ *
55
+ * @default true
56
+ */
57
+ inline?: InlinePopoverPositionerProps$1['inline'];
58
+ /**
59
+ * Describes the virtual padding around the boundary to check for overflow.
60
+ *
61
+ * @default 8
62
+ */
63
+ overflowPadding?: InlinePopoverPositionerProps$1['overflowPadding'];
64
+ /**
65
+ * The strategy to use for positioning
66
+ *
67
+ * @default "absolute"
68
+ */
69
+ strategy?: InlinePopoverPositionerProps$1['strategy'];
70
+ /**
71
+ * Options to activate auto-update listeners
72
+ *
73
+ * @see https://floating-ui.com/docs/autoUpdate
74
+ *
75
+ * @default true
76
+ */
77
+ autoUpdate?: InlinePopoverPositionerProps$1['autoUpdate'];
78
+ /**
79
+ * Whether to use the browser Popover API to place the floating element on
80
+ * top of other page content.
81
+ *
82
+ * @default true
83
+ */
84
+ hoist?: InlinePopoverPositionerProps$1['hoist'];
85
+ /**
86
+ * Whether to flip the `placement` in order to keep it in view when the
87
+ * preferred placement(s) will overflow the clipping boundary. You can also
88
+ * provide an array of placements to try sequentially if the preferred
89
+ * `placement` does not fit.
90
+ *
91
+ * @default true
92
+ */
93
+ flip?: InlinePopoverPositionerProps$1['flip'];
94
+ /**
95
+ * Whether the floating element should shift to keep it in view.
96
+ *
97
+ * @default true
98
+ */
99
+ shift?: InlinePopoverPositionerProps$1['shift'];
100
+ /**
101
+ * Whether to constrain the floating element's width and height to not exceed
102
+ * the viewport.
103
+ *
104
+ * @default false
105
+ */
106
+ fitViewport?: InlinePopoverPositionerProps$1['fitViewport'];
107
+ /**
108
+ * Whether to constrain the floating element's width so that it matches the
109
+ * reference element.
110
+ *
111
+ * @default false
112
+ */
113
+ sameWidth?: InlinePopoverPositionerProps$1['sameWidth'];
114
+ /**
115
+ * Whether to constrain the floating element's height so that it matches the
116
+ * reference element.
117
+ *
118
+ * @default false
119
+ */
120
+ sameHeight?: InlinePopoverPositionerProps$1['sameHeight'];
121
+ /**
122
+ * Describes the clipping element(s) or area that overflow will be checked relative to.
123
+ * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
124
+ *
125
+ * @default 'clippingAncestors'
126
+ */
127
+ boundary?: InlinePopoverPositionerProps$1['boundary'];
128
+ /**
129
+ * Describes the root boundary that the element will be checked for overflow relative to.
130
+ * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
131
+ *
132
+ * @default 'viewport'
133
+ */
134
+ rootBoundary?: InlinePopoverPositionerProps$1['rootBoundary'];
135
+ /**
136
+ * The element that will be used to check for overflow. Please see
137
+ * https://floating-ui.com/docs/detectoverflow#elementcontext for more
138
+ * information.
139
+ *
140
+ * @default 'floating'
141
+ */
142
+ elementContext?: InlinePopoverPositionerProps$1['elementContext'];
143
+ /**
144
+ * Whether to check the alternate elementContext's boundary. Please see
145
+ * https://floating-ui.com/docs/detectoverflow#altboundary for more
146
+ * information.
147
+ *
148
+ * @default false
149
+ */
150
+ altBoundary?: InlinePopoverPositionerProps$1['altBoundary'];
151
+ }
152
+ /**
153
+ * A React component that renders an `prosekit-inline-popover-positioner` custom element.
154
+ *
155
+ * @public
156
+ */
157
+ declare const InlinePopoverPositioner: ForwardRefExoticComponent<InlinePopoverPositionerProps & RefAttributes<InlinePopoverPositionerElement>>;
158
+ //#endregion
159
+ //#region src/components/inline-popover/inline-popover-root.gen.d.ts
160
+ /**
161
+ * Props for the {@link InlinePopoverRoot} React component.
162
+ *
163
+ * @public
164
+ */
165
+ interface InlinePopoverRootProps extends HTMLAttributes<InlinePopoverRootElement> {
166
+ /**
167
+ * The ProseKit editor instance.
168
+ *
169
+ * @default null
170
+ * @hidden
171
+ */
172
+ editor?: InlinePopoverRootProps$1['editor'];
173
+ /**
174
+ * Whether the popover is open by default when some inline content is
175
+ * selected.
176
+ *
177
+ * @default true
178
+ */
179
+ defaultOpen?: InlinePopoverRootProps$1['defaultOpen'];
180
+ /**
181
+ * Whether the inline popover should be dismissed when the editor receives an
182
+ * Escape key press.
183
+ *
184
+ * @default true
185
+ */
186
+ dismissOnEscape?: InlinePopoverRootProps$1['dismissOnEscape'];
187
+ /**
188
+ * Whether the overlay is currently open.
189
+ * @default null
190
+ */
191
+ open?: InlinePopoverRootProps$1['open'];
192
+ /**
193
+ * Whether the component should ignore user interaction.
194
+ * @default false
195
+ */
196
+ disabled?: InlinePopoverRootProps$1['disabled'];
197
+ /** */
198
+ onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;
199
+ }
200
+ /**
201
+ * A React component that renders an `prosekit-inline-popover-root` custom element.
202
+ *
203
+ * @public
204
+ */
205
+ declare const InlinePopoverRoot: ForwardRefExoticComponent<InlinePopoverRootProps & RefAttributes<InlinePopoverRootElement>>;
11
206
  //#endregion
12
- export { InlinePopover, type InlinePopoverProps };
207
+ export { InlinePopoverPopup, type InlinePopoverPopupProps, InlinePopoverPositioner, type InlinePopoverPositionerProps, InlinePopoverRoot, type InlinePopoverRootEvents, type InlinePopoverRootProps, OpenChangeEvent };
13
208
  //# sourceMappingURL=prosekit-react-inline-popover.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-react-inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover.gen.ts"],"mappings":";;;;;;;AAmBA;UAAiB,kBAAA,SAA2B,OAAA,CAAQ,WAAA,CAAY,oBAAA,EAAO,mBAAA;AAAA,cAE1D,aAAA,EAAe,yBAAA,CAC1B,kBAAA,GACA,aAAA,CAAc,oBAAA,IACd,cAAA,CAAe,oBAAA"}
1
+ {"version":3,"file":"prosekit-react-inline-popover.d.ts","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"mappings":";;;;;;;;AAyCA;UA7BiB,uBAAA,SAAgC,cAAA,CAAe,yBAAA;;;;;;cA6BnD,kBAAA,EAAoB,yBAAA,CAA0B,uBAAA,GAA0B,aAAA,CAAc,yBAAA;;;;;;;AAAnG;UC7BiB,4BAAA,SAAqC,cAAA,CAAe,8BAAA;;;;;;EAMnE,SAAA,GAAY,8BAAA;EDuB4C;;;;;ECjBxD,MAAA,GAAS,8BAAA;EDiBiH;;;;AC7B5H;;EAmBE,IAAA,GAAO,8BAAA;EAnB4D;;;;;;EA0BnE,OAAA,GAAU,8BAAA;EAmBC;;;;;;EAZX,MAAA,GAAS,8BAAA;EA+DI;;;;;EAzDb,eAAA,GAAkB,8BAAA;EAvCgD;;;;;EA6ClE,QAAA,GAAW,8BAAA;EAjCX;;;;;;;EAyCA,UAAA,GAAa,8BAAA;EAdb;;;;;;EAqBA,KAAA,GAAQ,8BAAA;EAAA;;;;;;;;EASR,IAAA,GAAO,8BAAA;EA2BP;;;;;EArBA,KAAA,GAAQ,8BAAA;EA2CR;;;;;;EApCA,WAAA,GAAc,8BAAA;EAgF4L;;;;;;EAzE1M,SAAA,GAAY,8BAAA;EAyEiD;;;;;;EAlE7D,UAAA,GAAa,8BAAA;;;;AC9Ff;;;EDqGE,QAAA,GAAW,8BAAA;EC9FF;;;;;;EDqGT,YAAA,GAAe,8BAAA;EC5G6C;;;;;;;EDoH5D,cAAA,GAAiB,8BAAA;EC/FjB;;;;;;;EDuGA,WAAA,GAAc,8BAAA;AAAA;;;ACnChB;;;cDuEa,uBAAA,EAAyB,yBAAA,CAA0B,4BAAA,GAA+B,aAAA,CAAc,8BAAA;;;;;;;ADrI7G;UE3BiB,sBAAA,SAA+B,cAAA,CAAe,wBAAA;;;;;;;EAO7D,MAAA,GAAS,wBAAA;EFoBsB;;;;;;EEb/B,WAAA,GAAc,wBAAA;;;ADhBhB;;;;ECuBE,eAAA,GAAkB,wBAAA;EDXT;;;;ECgBT,IAAA,GAAO,wBAAA;EDiBI;;;;ECZX,QAAA,GAAW,wBAAA;EDiDG;EC/Cd,YAAA,IAAgB,KAAA,EAAO,uBAAA;AAAA;;;;;;cAwDZ,iBAAA,EAAmB,yBAAA,CAA0B,sBAAA,GAAyB,aAAA,CAAc,wBAAA"}
@@ -1,8 +1,131 @@
1
- import { t as createComponent } from "./create-component.js";
2
- import { inlinePopoverEvents, inlinePopoverProps } from "@prosekit/web/inline-popover";
3
- //#region src/components/inline-popover/inline-popover.gen.ts
4
- const InlinePopover = createComponent("prosekit-inline-popover", "InlinePopover", Object.keys(inlinePopoverProps), Object.keys(inlinePopoverEvents));
1
+ import { n as useEditorContext } from "./editor-context.js";
2
+ import { createElement, forwardRef, useCallback, useLayoutEffect, useRef } from "react";
3
+ import { OpenChangeEvent, registerInlinePopoverPopupElement, registerInlinePopoverPositionerElement, registerInlinePopoverRootElement } from "@prosekit/web/inline-popover";
4
+ //#region src/components/inline-popover/inline-popover-popup.gen.ts
5
+ /**
6
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
7
+ */
8
+ function InlinePopoverPopupComponent(props, forwardedRef) {
9
+ registerInlinePopoverPopupElement();
10
+ const elementRef = useRef(null);
11
+ const { ...restProps } = props;
12
+ const mergedRef = useCallback((element) => {
13
+ elementRef.current = element;
14
+ if (typeof forwardedRef === "function") forwardedRef(element);
15
+ else if (forwardedRef) forwardedRef.current = element;
16
+ }, [forwardedRef]);
17
+ return createElement("prosekit-inline-popover-popup", {
18
+ ...restProps,
19
+ ref: mergedRef,
20
+ suppressHydrationWarning: true
21
+ });
22
+ }
23
+ /**
24
+ * A React component that renders an `prosekit-inline-popover-popup` custom element.
25
+ *
26
+ * @public
27
+ */
28
+ const InlinePopoverPopup = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);
5
29
  //#endregion
6
- export { InlinePopover };
30
+ //#region src/components/inline-popover/inline-popover-positioner.gen.ts
31
+ /**
32
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
33
+ */
34
+ function InlinePopoverPositionerComponent(props, forwardedRef) {
35
+ registerInlinePopoverPositionerElement();
36
+ const elementRef = useRef(null);
37
+ const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;
38
+ useLayoutEffect(() => {
39
+ const element = elementRef.current;
40
+ if (!element) return;
41
+ Object.assign(element, {
42
+ altBoundary: p0,
43
+ autoUpdate: p1,
44
+ boundary: p2,
45
+ elementContext: p3,
46
+ fitViewport: p4,
47
+ flip: p5,
48
+ hide: p6,
49
+ hoist: p7,
50
+ inline: p8,
51
+ offset: p9,
52
+ overflowPadding: p10,
53
+ overlap: p11,
54
+ placement: p12,
55
+ rootBoundary: p13,
56
+ sameHeight: p14,
57
+ sameWidth: p15,
58
+ shift: p16,
59
+ strategy: p17
60
+ });
61
+ });
62
+ const mergedRef = useCallback((element) => {
63
+ elementRef.current = element;
64
+ if (typeof forwardedRef === "function") forwardedRef(element);
65
+ else if (forwardedRef) forwardedRef.current = element;
66
+ }, [forwardedRef]);
67
+ return createElement("prosekit-inline-popover-positioner", {
68
+ ...restProps,
69
+ ref: mergedRef,
70
+ suppressHydrationWarning: true
71
+ });
72
+ }
73
+ /**
74
+ * A React component that renders an `prosekit-inline-popover-positioner` custom element.
75
+ *
76
+ * @public
77
+ */
78
+ const InlinePopoverPositioner = /* @__PURE__ */ forwardRef(InlinePopoverPositionerComponent);
79
+ //#endregion
80
+ //#region src/components/inline-popover/inline-popover-root.gen.ts
81
+ /**
82
+ * This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
83
+ */
84
+ function InlinePopoverRootComponent(props, forwardedRef) {
85
+ registerInlinePopoverRootElement();
86
+ const elementRef = useRef(null);
87
+ const handlersRef = useRef([]);
88
+ const p3Fallback = useEditorContext();
89
+ const { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3, open: p4, onOpenChange: e0, ...restProps } = props;
90
+ useLayoutEffect(() => {
91
+ const element = elementRef.current;
92
+ if (!element) return;
93
+ Object.assign(element, {
94
+ defaultOpen: p0,
95
+ disabled: p1,
96
+ dismissOnEscape: p2,
97
+ editor: p3 ?? p3Fallback,
98
+ open: p4
99
+ });
100
+ handlersRef.current = [e0];
101
+ });
102
+ useLayoutEffect(() => {
103
+ const element = elementRef.current;
104
+ if (!element) return;
105
+ const ac = new AbortController();
106
+ for (const [index, eventName] of ["openChange"].entries()) element.addEventListener(eventName, (event) => {
107
+ handlersRef.current[index]?.(event);
108
+ }, { signal: ac.signal });
109
+ return () => ac.abort();
110
+ }, []);
111
+ const mergedRef = useCallback((element) => {
112
+ elementRef.current = element;
113
+ if (typeof forwardedRef === "function") forwardedRef(element);
114
+ else if (forwardedRef) forwardedRef.current = element;
115
+ }, [forwardedRef]);
116
+ return createElement("prosekit-inline-popover-root", {
117
+ ...restProps,
118
+ ref: mergedRef,
119
+ suppressHydrationWarning: true
120
+ });
121
+ }
122
+ /**
123
+ * A React component that renders an `prosekit-inline-popover-root` custom element.
124
+ *
125
+ * @public
126
+ */
127
+ const InlinePopoverRoot = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);
128
+ //#endregion
129
+ export { InlinePopoverPopup, InlinePopoverPositioner, InlinePopoverRoot, OpenChangeEvent };
7
130
 
8
131
  //# sourceMappingURL=prosekit-react-inline-popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prosekit-react-inline-popover.js","names":[],"sources":["../src/components/inline-popover/inline-popover.gen.ts"],"sourcesContent":["import {\n type InlinePopoverElement,\n type InlinePopoverProps as Props,\n type InlinePopoverEvents as Events,\n inlinePopoverProps,\n inlinePopoverEvents,\n} from '@prosekit/web/inline-popover'\nimport type {\n ForwardRefExoticComponent,\n HTMLAttributes,\n RefAttributes,\n} from 'react'\n\nimport { createComponent } from '../create-component.ts'\nimport type { CreateProps } from '../create-props.ts'\n\n/**\n * Props for the {@link InlinePopover} component.\n */\nexport interface InlinePopoverProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const InlinePopover: ForwardRefExoticComponent<\n InlinePopoverProps &\n RefAttributes<InlinePopoverElement> &\n HTMLAttributes<InlinePopoverElement>\n> = createComponent<\n InlinePopoverProps,\n InlinePopoverElement\n>(\n 'prosekit-inline-popover',\n 'InlinePopover',\n Object.keys(inlinePopoverProps),\n Object.keys(inlinePopoverEvents),\n)\n"],"mappings":";;;AAqBA,MAAa,gBAIT,gBAIF,2BACA,iBACA,OAAO,KAAK,mBAAmB,EAC/B,OAAO,KAAK,oBAAoB,CACjC"}
1
+ {"version":3,"file":"prosekit-react-inline-popover.js","names":[],"sources":["../src/components/inline-popover/inline-popover-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"sourcesContent":["/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerInlinePopoverPopupElement, type InlinePopoverPopupElement } from '@prosekit/web/inline-popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/**\n * Props for the {@link InlinePopoverPopup} React component.\n *\n * @public\n */\nexport interface InlinePopoverPopupProps extends HTMLAttributes<InlinePopoverPopupElement> {}\n\nfunction InlinePopoverPopupComponent(props: InlinePopoverPopupProps, forwardedRef: ForwardedRef<InlinePopoverPopupElement>) {\n registerInlinePopoverPopupElement();\n\n const elementRef = useRef<InlinePopoverPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: InlinePopoverPopupElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-inline-popover-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A React component that renders an `prosekit-inline-popover-popup` custom element.\n *\n * @public\n */\nexport const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & RefAttributes<InlinePopoverPopupElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerInlinePopoverPositionerElement, type InlinePopoverPositionerElement, type InlinePopoverPositionerProps as InlinePopoverPositionerElementProps } from '@prosekit/web/inline-popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/**\n * Props for the {@link InlinePopoverPositioner} React component.\n *\n * @public\n */\nexport interface InlinePopoverPositionerProps extends HTMLAttributes<InlinePopoverPositionerElement> {\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: InlinePopoverPositionerElementProps['placement'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 12\n */\n offset?: InlinePopoverPositionerElementProps['offset'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default true\n */\n hide?: InlinePopoverPositionerElementProps['hide'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default true\n */\n overlap?: InlinePopoverPositionerElementProps['overlap'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default true\n */\n inline?: InlinePopoverPositionerElementProps['inline'];\n /**\n * Describes the virtual padding around the boundary to check for overflow.\n *\n * @default 8\n */\n overflowPadding?: InlinePopoverPositionerElementProps['overflowPadding'];\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: InlinePopoverPositionerElementProps['strategy'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: InlinePopoverPositionerElementProps['autoUpdate'];\n /**\n * Whether to use the browser Popover API to place the floating element on\n * top of other page content.\n *\n * @default true\n */\n hoist?: InlinePopoverPositionerElementProps['hoist'];\n /**\n * Whether to flip the `placement` in order to keep it in view when the\n * preferred placement(s) will overflow the clipping boundary. You can also\n * provide an array of placements to try sequentially if the preferred\n * `placement` does not fit.\n *\n * @default true\n */\n flip?: InlinePopoverPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: InlinePopoverPositionerElementProps['shift'];\n /**\n * Whether to constrain the floating element's width and height to not exceed\n * the viewport.\n *\n * @default false\n */\n fitViewport?: InlinePopoverPositionerElementProps['fitViewport'];\n /**\n * Whether to constrain the floating element's width so that it matches the\n * reference element.\n *\n * @default false\n */\n sameWidth?: InlinePopoverPositionerElementProps['sameWidth'];\n /**\n * Whether to constrain the floating element's height so that it matches the\n * reference element.\n *\n * @default false\n */\n sameHeight?: InlinePopoverPositionerElementProps['sameHeight'];\n /**\n * Describes the clipping element(s) or area that overflow will be checked relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.\n *\n * @default 'clippingAncestors'\n */\n boundary?: InlinePopoverPositionerElementProps['boundary'];\n /**\n * Describes the root boundary that the element will be checked for overflow relative to.\n * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.\n *\n * @default 'viewport'\n */\n rootBoundary?: InlinePopoverPositionerElementProps['rootBoundary'];\n /**\n * The element that will be used to check for overflow. Please see\n * https://floating-ui.com/docs/detectoverflow#elementcontext for more\n * information.\n *\n * @default 'floating'\n */\n elementContext?: InlinePopoverPositionerElementProps['elementContext'];\n /**\n * Whether to check the alternate elementContext's boundary. Please see\n * https://floating-ui.com/docs/detectoverflow#altboundary for more\n * information.\n *\n * @default false\n */\n altBoundary?: InlinePopoverPositionerElementProps['altBoundary'];\n}\n\nfunction InlinePopoverPositionerComponent(props: InlinePopoverPositionerProps, forwardedRef: ForwardedRef<InlinePopoverPositionerElement>) {\n registerInlinePopoverPositionerElement();\n\n const elementRef = useRef<InlinePopoverPositionerElement>(null);\n\n const { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { altBoundary: p0, autoUpdate: p1, boundary: p2, elementContext: p3, fitViewport: p4, flip: p5, hide: p6, hoist: p7, inline: p8, offset: p9, overflowPadding: p10, overlap: p11, placement: p12, rootBoundary: p13, sameHeight: p14, sameWidth: p15, shift: p16, strategy: p17 });\n });\n\n const mergedRef = useCallback(\n (element: InlinePopoverPositionerElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-inline-popover-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A React component that renders an `prosekit-inline-popover-positioner` custom element.\n *\n * @public\n */\nexport const InlinePopoverPositioner: ForwardRefExoticComponent<InlinePopoverPositionerProps & RefAttributes<InlinePopoverPositionerElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPositionerComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerInlinePopoverRootElement, type InlinePopoverRootElement, type InlinePopoverRootProps as InlinePopoverRootElementProps, type InlinePopoverRootEvents } from '@prosekit/web/inline-popover';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\nimport { useEditorContext } from '../../contexts/editor-context.ts';\n\n/**\n * Props for the {@link InlinePopoverRoot} React component.\n *\n * @public\n */\nexport interface InlinePopoverRootProps extends HTMLAttributes<InlinePopoverRootElement> {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: InlinePopoverRootElementProps['editor'];\n /**\n * Whether the popover is open by default when some inline content is\n * selected.\n *\n * @default true\n */\n defaultOpen?: InlinePopoverRootElementProps['defaultOpen'];\n /**\n * Whether the inline popover should be dismissed when the editor receives an\n * Escape key press.\n *\n * @default true\n */\n dismissOnEscape?: InlinePopoverRootElementProps['dismissOnEscape'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: InlinePopoverRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: InlinePopoverRootElementProps['disabled'];\n /** */\n onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;\n}\n\nfunction InlinePopoverRootComponent(props: InlinePopoverRootProps, forwardedRef: ForwardedRef<InlinePopoverRootElement>) {\n registerInlinePopoverRootElement();\n\n const elementRef = useRef<InlinePopoverRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const p3Fallback = useEditorContext();\n\n const { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3, open: p4, onOpenChange: e0, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { defaultOpen: p0, disabled: p1, dismissOnEscape: p2, editor: p3 ?? p3Fallback, open: p4 });\n handlersRef.current = [e0] as Array<((event: Event) => void) | undefined>;\n });\n\n useLayoutEffect(() => {\n const element = elementRef.current;\n if (!element) return;\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event: Event) => {\n handlersRef.current[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n }, []);\n\n const mergedRef = useCallback(\n (element: InlinePopoverRootElement | null) => {\n elementRef.current = element;\n if (typeof forwardedRef === 'function') {\n forwardedRef(element);\n } else if (forwardedRef) {\n forwardedRef.current = element;\n }\n },\n [forwardedRef],\n );\n\n return createElement('prosekit-inline-popover-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A React component that renders an `prosekit-inline-popover-root` custom element.\n *\n * @public\n */\nexport const InlinePopoverRoot: ForwardRefExoticComponent<InlinePopoverRootProps & RefAttributes<InlinePopoverRootElement>> = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);\n\nexport type { InlinePopoverRootEvents };\n"],"mappings":";;;;;;;AAcA,SAAS,4BAA4B,OAAgC,cAAuD;AAC1H,oCAAmC;CAEnC,MAAM,aAAa,OAAkC,KAAK;CAE1D,MAAM,EAAE,GAAG,cAAc;CAEzB,MAAM,YAAY,aACf,YAA8C;AAC7C,aAAW,UAAU;AACrB,MAAI,OAAO,iBAAiB,WAC1B,cAAa,QAAQ;WACZ,aACT,cAAa,UAAU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,iCAAiC;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;;;;;AAQzH,MAAa,qBAAoI,2BAAW,4BAA4B;;;;;;ACoGxL,SAAS,iCAAiC,OAAqC,cAA4D;AACzI,yCAAwC;CAExC,MAAM,aAAa,OAAuC,KAAK;CAE/D,MAAM,EAAE,aAAa,IAAI,YAAY,IAAI,UAAU,IAAI,gBAAgB,IAAI,aAAa,IAAI,MAAM,IAAI,MAAM,IAAI,OAAO,IAAI,QAAQ,IAAI,QAAQ,IAAI,iBAAiB,KAAK,SAAS,KAAK,WAAW,KAAK,cAAc,KAAK,YAAY,KAAK,WAAW,KAAK,OAAO,KAAK,UAAU,KAAK,GAAG,cAAc;AAEvS,uBAAsB;EACpB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;AACd,SAAO,OAAO,SAAS;GAAE,aAAa;GAAI,YAAY;GAAI,UAAU;GAAI,gBAAgB;GAAI,aAAa;GAAI,MAAM;GAAI,MAAM;GAAI,OAAO;GAAI,QAAQ;GAAI,QAAQ;GAAI,iBAAiB;GAAK,SAAS;GAAK,WAAW;GAAK,cAAc;GAAK,YAAY;GAAK,WAAW;GAAK,OAAO;GAAK,UAAU;GAAK,CAAC;GACxS;CAEF,MAAM,YAAY,aACf,YAAmD;AAClD,aAAW,UAAU;AACrB,MAAI,OAAO,iBAAiB,WAC1B,cAAa,QAAQ;WACZ,aACT,cAAa,UAAU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,sCAAsC;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;;;;;AAQ9H,MAAa,0BAAmJ,2BAAW,iCAAiC;;;;;;AC5H5M,SAAS,2BAA2B,OAA+B,cAAsD;AACvH,mCAAkC;CAElC,MAAM,aAAa,OAAiC,KAAK;CACzD,MAAM,cAAc,OAAoD,EAAE,CAAC;CAE3E,MAAM,aAAa,kBAAkB;CAErC,MAAM,EAAE,aAAa,IAAI,UAAU,IAAI,iBAAiB,IAAI,QAAQ,IAAI,MAAM,IAAI,cAAc,IAAI,GAAG,cAAc;AAErH,uBAAsB;EACpB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;AACd,SAAO,OAAO,SAAS;GAAE,aAAa;GAAI,UAAU;GAAI,iBAAiB;GAAI,QAAQ,MAAM;GAAY,MAAM;GAAI,CAAC;AAClH,cAAY,UAAU,CAAC,GAAG;GAC1B;AAEF,uBAAsB;EACpB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;EACd,MAAM,KAAK,IAAI,iBAAiB;AAChC,OAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,CAAC,SAAS,CACvD,SAAQ,iBACN,YACC,UAAiB;AAChB,eAAY,QAAQ,SAAS,MAAM;KAErC,EAAE,QAAQ,GAAG,QAAQ,CACtB;AAEH,eAAa,GAAG,OAAO;IACtB,EAAE,CAAC;CAEN,MAAM,YAAY,aACf,YAA6C;AAC5C,aAAW,UAAU;AACrB,MAAI,OAAO,iBAAiB,WAC1B,cAAa,QAAQ;WACZ,aACT,cAAa,UAAU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,gCAAgC;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;;;;;AAQxH,MAAa,oBAAiI,2BAAW,2BAA2B"}
@@ -0,0 +1,287 @@
1
+ import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
2
+ import { MenuItemElement, MenuItemEvents, MenuItemProps as MenuItemProps$1, MenuPopupElement, MenuPopupProps as MenuPopupProps$1, MenuPositionerElement, MenuPositionerProps as MenuPositionerProps$1, MenuRootElement, MenuRootEvents, MenuRootProps as MenuRootProps$1, MenuSubmenuRootElement, MenuSubmenuTriggerElement, MenuTriggerElement, MenuTriggerEvents, MenuTriggerProps as MenuTriggerProps$1, OpenChangeEvent, SelectEvent } from "@prosekit/web/menu";
3
+
4
+ //#region src/components/menu/menu-item.gen.d.ts
5
+ /**
6
+ * Props for the {@link MenuItem} React component.
7
+ *
8
+ * @public
9
+ */
10
+ interface MenuItemProps extends Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> {
11
+ /**
12
+ * The unique value for this menu item.
13
+ *
14
+ * @default ""
15
+ */
16
+ value?: MenuItemProps$1['value'];
17
+ /**
18
+ * Whether this menu item is disabled.
19
+ *
20
+ * @default false
21
+ */
22
+ disabled?: MenuItemProps$1['disabled'];
23
+ /**
24
+ * Whether to close the menu when the item is pressed.
25
+ *
26
+ * @default true
27
+ */
28
+ closeOnSelect?: MenuItemProps$1['closeOnSelect'];
29
+ /** Emitted when the the item is selected. */
30
+ onSelect?: (event: MenuItemEvents['select']) => void;
31
+ }
32
+ /**
33
+ * A React component that renders an `prosekit-menu-item` custom element.
34
+ *
35
+ * @public
36
+ */
37
+ declare const MenuItem: ForwardRefExoticComponent<MenuItemProps & RefAttributes<MenuItemElement>>;
38
+ //#endregion
39
+ //#region src/components/menu/menu-popup.gen.d.ts
40
+ /**
41
+ * Props for the {@link MenuPopup} React component.
42
+ *
43
+ * @public
44
+ */
45
+ interface MenuPopupProps extends HTMLAttributes<MenuPopupElement> {
46
+ /**
47
+ * By default, the MenuPopup element will listen for keydown events.
48
+ * You can pass a different element to listen for keydown events.
49
+ *
50
+ * @default null
51
+ */
52
+ eventTarget?: MenuPopupProps$1['eventTarget'];
53
+ }
54
+ /**
55
+ * A React component that renders an `prosekit-menu-popup` custom element.
56
+ *
57
+ * @public
58
+ */
59
+ declare const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & RefAttributes<MenuPopupElement>>;
60
+ //#endregion
61
+ //#region src/components/menu/menu-positioner.gen.d.ts
62
+ /**
63
+ * Props for the {@link MenuPositioner} React component.
64
+ *
65
+ * @public
66
+ */
67
+ interface MenuPositionerProps extends HTMLAttributes<MenuPositionerElement> {
68
+ /**
69
+ * The initial placement of the floating element
70
+ *
71
+ * @default "bottom-start"
72
+ */
73
+ placement?: MenuPositionerProps$1['placement'];
74
+ /**
75
+ * The strategy to use for positioning
76
+ *
77
+ * @default "absolute"
78
+ */
79
+ strategy?: MenuPositionerProps$1['strategy'];
80
+ /**
81
+ * Options to activate auto-update listeners
82
+ *
83
+ * @see https://floating-ui.com/docs/autoUpdate
84
+ *
85
+ * @default true
86
+ */
87
+ autoUpdate?: MenuPositionerProps$1['autoUpdate'];
88
+ /**
89
+ * Whether to use the browser Popover API to place the floating element on
90
+ * top of other page content.
91
+ *
92
+ * @default true
93
+ */
94
+ hoist?: MenuPositionerProps$1['hoist'];
95
+ /**
96
+ * The distance between the reference and floating element.
97
+ *
98
+ * @default 6
99
+ */
100
+ offset?: MenuPositionerProps$1['offset'];
101
+ /**
102
+ * Whether to flip the `placement` in order to keep it in view when the
103
+ * preferred placement(s) will overflow the clipping boundary. You can also
104
+ * provide an array of placements to try sequentially if the preferred
105
+ * `placement` does not fit.
106
+ *
107
+ * @default true
108
+ */
109
+ flip?: MenuPositionerProps$1['flip'];
110
+ /**
111
+ * Whether the floating element should shift to keep it in view.
112
+ *
113
+ * @default true
114
+ */
115
+ shift?: MenuPositionerProps$1['shift'];
116
+ /**
117
+ * Whether the floating element can overlap the reference element to keep it
118
+ * in view.
119
+ *
120
+ * @default false
121
+ */
122
+ overlap?: MenuPositionerProps$1['overlap'];
123
+ /**
124
+ * Whether to constrain the floating element's width and height to not exceed
125
+ * the viewport.
126
+ *
127
+ * @default false
128
+ */
129
+ fitViewport?: MenuPositionerProps$1['fitViewport'];
130
+ /**
131
+ * Whether to constrain the floating element's width so that it matches the
132
+ * reference element.
133
+ *
134
+ * @default false
135
+ */
136
+ sameWidth?: MenuPositionerProps$1['sameWidth'];
137
+ /**
138
+ * Whether to constrain the floating element's height so that it matches the
139
+ * reference element.
140
+ *
141
+ * @default false
142
+ */
143
+ sameHeight?: MenuPositionerProps$1['sameHeight'];
144
+ /**
145
+ * Whether to improve positioning for inline reference elements that span over
146
+ * multiple lines.
147
+ *
148
+ * @default false
149
+ */
150
+ inline?: MenuPositionerProps$1['inline'];
151
+ /**
152
+ * Whether to hide the floating element when the reference element or the
153
+ * floating element is fully clipped.
154
+ *
155
+ * @default false
156
+ */
157
+ hide?: MenuPositionerProps$1['hide'];
158
+ /**
159
+ * Describes the clipping element(s) or area that overflow will be checked relative to.
160
+ * Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
161
+ *
162
+ * @default 'clippingAncestors'
163
+ */
164
+ boundary?: MenuPositionerProps$1['boundary'];
165
+ /**
166
+ * Describes the root boundary that the element will be checked for overflow relative to.
167
+ * Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
168
+ *
169
+ * @default 'viewport'
170
+ */
171
+ rootBoundary?: MenuPositionerProps$1['rootBoundary'];
172
+ /**
173
+ * Describes the virtual padding around the boundary to check for overflow.
174
+ * Please see https://floating-ui.com/docs/detectoverflow#padding for more information.
175
+ *
176
+ * @default 4
177
+ */
178
+ overflowPadding?: MenuPositionerProps$1['overflowPadding'];
179
+ /**
180
+ * The element that will be used to check for overflow. Please see
181
+ * https://floating-ui.com/docs/detectoverflow#elementcontext for more
182
+ * information.
183
+ *
184
+ * @default 'floating'
185
+ */
186
+ elementContext?: MenuPositionerProps$1['elementContext'];
187
+ /**
188
+ * Whether to check the alternate elementContext's boundary. Please see
189
+ * https://floating-ui.com/docs/detectoverflow#altboundary for more
190
+ * information.
191
+ *
192
+ * @default false
193
+ */
194
+ altBoundary?: MenuPositionerProps$1['altBoundary'];
195
+ }
196
+ /**
197
+ * A React component that renders an `prosekit-menu-positioner` custom element.
198
+ *
199
+ * @public
200
+ */
201
+ declare const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & RefAttributes<MenuPositionerElement>>;
202
+ //#endregion
203
+ //#region src/components/menu/menu-root.gen.d.ts
204
+ /**
205
+ * Props for the {@link MenuRoot} React component.
206
+ *
207
+ * @public
208
+ */
209
+ interface MenuRootProps extends HTMLAttributes<MenuRootElement> {
210
+ /**
211
+ * Whether the overlay is initially open.
212
+ * @default false
213
+ */
214
+ defaultOpen?: MenuRootProps$1['defaultOpen'];
215
+ /**
216
+ * Whether the overlay is currently open.
217
+ * @default null
218
+ */
219
+ open?: MenuRootProps$1['open'];
220
+ /**
221
+ * Whether the component should ignore user interaction.
222
+ * @default false
223
+ */
224
+ disabled?: MenuRootProps$1['disabled'];
225
+ /** Emitted when the menu is opened or closed. */
226
+ onOpenChange?: (event: MenuRootEvents['openChange']) => void;
227
+ }
228
+ /**
229
+ * A React component that renders an `prosekit-menu-root` custom element.
230
+ *
231
+ * @public
232
+ */
233
+ declare const MenuRoot: ForwardRefExoticComponent<MenuRootProps & RefAttributes<MenuRootElement>>;
234
+ //#endregion
235
+ //#region src/components/menu/menu-submenu-root.gen.d.ts
236
+ /**
237
+ * Props for the {@link MenuSubmenuRoot} React component.
238
+ *
239
+ * @public
240
+ */
241
+ interface MenuSubmenuRootProps extends HTMLAttributes<MenuSubmenuRootElement> {}
242
+ /**
243
+ * A React component that renders an `prosekit-menu-submenu-root` custom element.
244
+ *
245
+ * @public
246
+ */
247
+ declare const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & RefAttributes<MenuSubmenuRootElement>>;
248
+ //#endregion
249
+ //#region src/components/menu/menu-submenu-trigger.gen.d.ts
250
+ /**
251
+ * Props for the {@link MenuSubmenuTrigger} React component.
252
+ *
253
+ * @public
254
+ */
255
+ interface MenuSubmenuTriggerProps extends HTMLAttributes<MenuSubmenuTriggerElement> {}
256
+ /**
257
+ * A React component that renders an `prosekit-menu-submenu-trigger` custom element.
258
+ *
259
+ * @public
260
+ */
261
+ declare const MenuSubmenuTrigger: ForwardRefExoticComponent<MenuSubmenuTriggerProps & RefAttributes<MenuSubmenuTriggerElement>>;
262
+ //#endregion
263
+ //#region src/components/menu/menu-trigger.gen.d.ts
264
+ /**
265
+ * Props for the {@link MenuTrigger} React component.
266
+ *
267
+ * @public
268
+ */
269
+ interface MenuTriggerProps extends HTMLAttributes<MenuTriggerElement> {
270
+ /**
271
+ * Whether the component should ignore user interaction.
272
+ *
273
+ * @default false
274
+ */
275
+ disabled?: MenuTriggerProps$1['disabled'];
276
+ /** Emitted when the menu is opened or closed. */
277
+ onOpenChange?: (event: MenuTriggerEvents['openChange']) => void;
278
+ }
279
+ /**
280
+ * A React component that renders an `prosekit-menu-trigger` custom element.
281
+ *
282
+ * @public
283
+ */
284
+ declare const MenuTrigger: ForwardRefExoticComponent<MenuTriggerProps & RefAttributes<MenuTriggerElement>>;
285
+ //#endregion
286
+ export { MenuItem, type MenuItemEvents, type MenuItemProps, MenuPopup, type MenuPopupProps, MenuPositioner, type MenuPositionerProps, MenuRoot, type MenuRootEvents, type MenuRootProps, MenuSubmenuRoot, type MenuSubmenuRootProps, MenuSubmenuTrigger, type MenuSubmenuTriggerProps, MenuTrigger, type MenuTriggerEvents, type MenuTriggerProps, OpenChangeEvent, SelectEvent };
287
+ //# sourceMappingURL=prosekit-react-menu.d.ts.map