@prosekit/react 0.7.0-beta.4 → 0.7.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/prosekit-react-autocomplete.d.ts +10 -50
- package/dist/prosekit-react-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-react-autocomplete.js +5 -40
- package/dist/prosekit-react-autocomplete.js.map +1 -1
- package/dist/prosekit-react-block-handle.d.ts +10 -50
- package/dist/prosekit-react-block-handle.d.ts.map +1 -1
- package/dist/prosekit-react-block-handle.js +5 -40
- package/dist/prosekit-react-block-handle.js.map +1 -1
- package/dist/prosekit-react-drop-indicator.d.ts +2 -10
- package/dist/prosekit-react-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-react-drop-indicator.js +1 -8
- package/dist/prosekit-react-drop-indicator.js.map +1 -1
- package/dist/prosekit-react-inline-popover.d.ts +6 -30
- package/dist/prosekit-react-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-react-inline-popover.js +3 -24
- package/dist/prosekit-react-inline-popover.js.map +1 -1
- package/dist/prosekit-react-menu.d.ts +48 -73
- package/dist/prosekit-react-menu.d.ts.map +1 -1
- package/dist/prosekit-react-menu.js +37 -58
- package/dist/prosekit-react-menu.js.map +1 -1
- package/dist/prosekit-react-popover.d.ts +8 -40
- package/dist/prosekit-react-popover.d.ts.map +1 -1
- package/dist/prosekit-react-popover.js +4 -32
- package/dist/prosekit-react-popover.js.map +1 -1
- package/dist/prosekit-react-resizable.d.ts +4 -20
- package/dist/prosekit-react-resizable.d.ts.map +1 -1
- package/dist/prosekit-react-resizable.js +2 -16
- package/dist/prosekit-react-resizable.js.map +1 -1
- package/dist/prosekit-react-table-handle.d.ts +22 -110
- package/dist/prosekit-react-table-handle.d.ts.map +1 -1
- package/dist/prosekit-react-table-handle.js +11 -88
- package/dist/prosekit-react-table-handle.js.map +1 -1
- package/dist/prosekit-react-tooltip.d.ts +8 -40
- package/dist/prosekit-react-tooltip.d.ts.map +1 -1
- package/dist/prosekit-react-tooltip.js +4 -32
- package/dist/prosekit-react-tooltip.js.map +1 -1
- package/package.json +4 -4
- package/src/components/autocomplete/autocomplete-empty.gen.ts +3 -13
- package/src/components/autocomplete/autocomplete-item.gen.ts +3 -13
- package/src/components/autocomplete/autocomplete-popup.gen.ts +3 -13
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +3 -13
- package/src/components/autocomplete/autocomplete-root.gen.ts +3 -13
- package/src/components/autocomplete/index.gen.ts +1 -3
- package/src/components/block-handle/block-handle-add.gen.ts +3 -13
- package/src/components/block-handle/block-handle-draggable.gen.ts +3 -13
- package/src/components/block-handle/block-handle-popup.gen.ts +3 -13
- package/src/components/block-handle/block-handle-positioner.gen.ts +3 -13
- package/src/components/block-handle/block-handle-root.gen.ts +3 -13
- package/src/components/block-handle/index.gen.ts +1 -3
- package/src/components/drop-indicator/drop-indicator.gen.ts +3 -13
- package/src/components/drop-indicator/index.gen.ts +1 -3
- package/src/components/inline-popover/index.gen.ts +1 -3
- package/src/components/inline-popover/inline-popover-popup.gen.ts +3 -13
- package/src/components/inline-popover/inline-popover-positioner.gen.ts +3 -13
- package/src/components/inline-popover/inline-popover-root.gen.ts +3 -13
- package/src/components/menu/index.gen.ts +1 -3
- package/src/components/menu/menu-item.gen.ts +3 -13
- package/src/components/menu/menu-popup.gen.ts +3 -13
- package/src/components/menu/menu-positioner.gen.ts +3 -13
- package/src/components/menu/menu-root.gen.ts +3 -13
- package/src/components/menu/menu-submenu-root.gen.ts +49 -17
- package/src/components/menu/menu-submenu-trigger.gen.ts +28 -19
- package/src/components/menu/menu-trigger.gen.ts +3 -13
- package/src/components/popover/index.gen.ts +1 -3
- package/src/components/popover/popover-popup.gen.ts +3 -13
- package/src/components/popover/popover-positioner.gen.ts +3 -13
- package/src/components/popover/popover-root.gen.ts +3 -13
- package/src/components/popover/popover-trigger.gen.ts +3 -13
- package/src/components/resizable/index.gen.ts +1 -3
- package/src/components/resizable/resizable-handle.gen.ts +3 -13
- package/src/components/resizable/resizable-root.gen.ts +3 -13
- package/src/components/table-handle/index.gen.ts +1 -3
- package/src/components/table-handle/table-handle-column-menu-root.gen.ts +3 -13
- package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +3 -13
- package/src/components/table-handle/table-handle-column-popup.gen.ts +3 -13
- package/src/components/table-handle/table-handle-column-positioner.gen.ts +3 -13
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +3 -13
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +3 -13
- package/src/components/table-handle/table-handle-root.gen.ts +3 -13
- package/src/components/table-handle/table-handle-row-menu-root.gen.ts +3 -13
- package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +3 -13
- package/src/components/table-handle/table-handle-row-popup.gen.ts +3 -13
- package/src/components/table-handle/table-handle-row-positioner.gen.ts +3 -13
- package/src/components/tooltip/index.gen.ts +1 -3
- package/src/components/tooltip/tooltip-popup.gen.ts +3 -13
- package/src/components/tooltip/tooltip-positioner.gen.ts +3 -13
- package/src/components/tooltip/tooltip-root.gen.ts +3 -13
- package/src/components/tooltip/tooltip-trigger.gen.ts +3 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-react-drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prosekit-react-drop-indicator.d.ts","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts"],"mappings":";;;UAQiB,kBAAA;EAAkB;;;;;;EAOjC,MAAA,GAAS,oBAAA;EAMwB;;AAkCnC;;;EAlCE,KAAA,GAAQ,oBAAA;AAAA;;cAkCG,aAAA,EAAe,yBAAA,CAA0B,kBAAA,GAAqB,cAAA,CAAe,oBAAA,IAAwB,aAAA,CAAc,oBAAA"}
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
import { n as useEditorContext } from "./editor-context.js";
|
|
3
3
|
import { createElement, forwardRef, useCallback, useLayoutEffect, useRef } from "react";
|
|
4
4
|
import { registerDropIndicatorElement } from "@prosekit/web/drop-indicator";
|
|
5
|
-
/**
|
|
6
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
7
|
-
*/
|
|
8
5
|
function DropIndicatorComponent(props, forwardedRef) {
|
|
9
6
|
registerDropIndicatorElement();
|
|
10
7
|
const elementRef = useRef(null);
|
|
@@ -29,11 +26,7 @@ function DropIndicatorComponent(props, forwardedRef) {
|
|
|
29
26
|
suppressHydrationWarning: true
|
|
30
27
|
});
|
|
31
28
|
}
|
|
32
|
-
/**
|
|
33
|
-
* A React component that renders an `prosekit-drop-indicator` custom element.
|
|
34
|
-
*
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
29
|
+
/** A React component that renders an `prosekit-drop-indicator` custom element. */
|
|
37
30
|
const DropIndicator = /* @__PURE__ */ forwardRef(DropIndicatorComponent);
|
|
38
31
|
/**
|
|
39
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-react-drop-indicator.js","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts","../src/components/drop-indicator/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"prosekit-react-drop-indicator.js","names":[],"sources":["../src/components/drop-indicator/drop-indicator.gen.ts","../src/components/drop-indicator/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\n\nimport { registerDropIndicatorElement, type DropIndicatorElement, type DropIndicatorProps as DropIndicatorElementProps } from '@prosekit/web/drop-indicator';\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/** Props for the {@link DropIndicator} React component. */\nexport interface DropIndicatorProps {\n /**\n * The ProseKit editor instance.\n *\n * @default null\n * @hidden\n */\n editor?: DropIndicatorElementProps['editor'];\n /**\n * The line width in pixels.\n *\n * @default 2\n */\n width?: DropIndicatorElementProps['width'];\n}\n\nfunction DropIndicatorComponent(props: DropIndicatorProps, forwardedRef: ForwardedRef<DropIndicatorElement>) {\n registerDropIndicatorElement();\n\n const elementRef = useRef<DropIndicatorElement>(null);\n\n const p0Fallback = useEditorContext();\n\n const { editor: p0, width: p1, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { editor: p0 ?? p0Fallback, width: p1 });\n });\n\n const mergedRef = useCallback(\n (element: DropIndicatorElement | 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-drop-indicator', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/** A React component that renders an `prosekit-drop-indicator` custom element. */\nexport const DropIndicator: ForwardRefExoticComponent<DropIndicatorProps & HTMLAttributes<DropIndicatorElement> & RefAttributes<DropIndicatorElement>> = /* @__PURE__ */ forwardRef(DropIndicatorComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport { DropIndicator } from 'prosekit/react/drop-indicator'\n\n<DropIndicator />\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;;AAwBA,SAAS,uBAAuB,OAA2B,cAAkD;AAC3G,+BAA8B;CAE9B,MAAM,aAAa,OAA6B,KAAK;CAErD,MAAM,aAAa,kBAAkB;CAErC,MAAM,EAAE,QAAQ,IAAI,OAAO,IAAI,GAAG,cAAc;AAEhD,uBAAsB;EACpB,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;AACd,SAAO,OAAO,SAAS;GAAE,QAAQ,MAAM;GAAY,OAAO;GAAI,CAAC;GAC/D;CAEF,MAAM,YAAY,aACf,YAAyC;AACxC,aAAW,UAAU;AACrB,MAAI,OAAO,iBAAiB,WAC1B,cAAa,QAAQ;WACZ,aACT,cAAa,UAAU;IAG3B,CAAC,aAAa,CACf;AAED,QAAO,cAAc,2BAA2B;EAAE,GAAG;EAAW,KAAK;EAAW,0BAA0B;EAAM,CAAC;;;AAInH,MAAa,gBAA4J,2BAAW,uBAAuB"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
|
|
2
2
|
import { InlinePopoverPopupElement, InlinePopoverPositionerElement, InlinePopoverPositionerProps as InlinePopoverPositionerProps$1, InlinePopoverRootElement, InlinePopoverRootEvents, InlinePopoverRootProps as InlinePopoverRootProps$1 } from "@prosekit/web/inline-popover";
|
|
3
|
-
/**
|
|
4
|
-
* Props for the {@link InlinePopoverPopup} React component.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
3
|
+
/** Props for the {@link InlinePopoverPopup} React component. */
|
|
8
4
|
interface InlinePopoverPopupProps {}
|
|
9
|
-
/**
|
|
10
|
-
* A React component that renders an `prosekit-inline-popover-popup` custom element.
|
|
11
|
-
*
|
|
12
|
-
* @public
|
|
13
|
-
*/
|
|
5
|
+
/** A React component that renders an `prosekit-inline-popover-popup` custom element. */
|
|
14
6
|
declare const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & HTMLAttributes<InlinePopoverPopupElement> & RefAttributes<InlinePopoverPopupElement>>;
|
|
15
|
-
/**
|
|
16
|
-
* Props for the {@link InlinePopoverPositioner} React component.
|
|
17
|
-
*
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
7
|
+
/** Props for the {@link InlinePopoverPositioner} React component. */
|
|
20
8
|
interface InlinePopoverPositionerProps {
|
|
21
9
|
/**
|
|
22
10
|
* The initial placement of the floating element
|
|
@@ -145,17 +133,9 @@ interface InlinePopoverPositionerProps {
|
|
|
145
133
|
*/
|
|
146
134
|
altBoundary?: InlinePopoverPositionerProps$1['altBoundary'];
|
|
147
135
|
}
|
|
148
|
-
/**
|
|
149
|
-
* A React component that renders an `prosekit-inline-popover-positioner` custom element.
|
|
150
|
-
*
|
|
151
|
-
* @public
|
|
152
|
-
*/
|
|
136
|
+
/** A React component that renders an `prosekit-inline-popover-positioner` custom element. */
|
|
153
137
|
declare const InlinePopoverPositioner: ForwardRefExoticComponent<InlinePopoverPositionerProps & HTMLAttributes<InlinePopoverPositionerElement> & RefAttributes<InlinePopoverPositionerElement>>;
|
|
154
|
-
/**
|
|
155
|
-
* Props for the {@link InlinePopoverRoot} React component.
|
|
156
|
-
*
|
|
157
|
-
* @public
|
|
158
|
-
*/
|
|
138
|
+
/** Props for the {@link InlinePopoverRoot} React component. */
|
|
159
139
|
interface InlinePopoverRootProps {
|
|
160
140
|
/**
|
|
161
141
|
* The ProseKit editor instance.
|
|
@@ -191,11 +171,7 @@ interface InlinePopoverRootProps {
|
|
|
191
171
|
/** Emitted when the open state of the popover changes. */
|
|
192
172
|
onOpenChange?: (event: InlinePopoverRootEvents['openChange']) => void;
|
|
193
173
|
}
|
|
194
|
-
/**
|
|
195
|
-
* A React component that renders an `prosekit-inline-popover-root` custom element.
|
|
196
|
-
*
|
|
197
|
-
* @public
|
|
198
|
-
*/
|
|
174
|
+
/** A React component that renders an `prosekit-inline-popover-root` custom element. */
|
|
199
175
|
declare const InlinePopoverRoot: ForwardRefExoticComponent<InlinePopoverRootProps & HTMLAttributes<InlinePopoverRootElement> & RefAttributes<InlinePopoverRootElement>>;
|
|
200
176
|
export { InlinePopoverPopup, type InlinePopoverPopupProps, InlinePopoverPositioner, type InlinePopoverPositionerProps, InlinePopoverRoot, type InlinePopoverRootProps };
|
|
201
177
|
//# 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-popup.gen.ts","../src/components/inline-popover/inline-popover-positioner.gen.ts","../src/components/inline-popover/inline-popover-root.gen.ts"],"mappings":"
|
|
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":";;;UAMiB,uBAAA;;cAyBJ,kBAAA,EAAoB,yBAAA,CAA0B,uBAAA,GAA0B,cAAA,CAAe,yBAAA,IAA6B,aAAA,CAAc,yBAAA;;UCzB9H,4BAAA;EDAuB;;;;AAyBxC;ECnBE,SAAA,GAAY,8BAAA;;;;;;EAMZ,MAAA,GAAS,8BAAA;EDasB;;;;;;ECN/B,IAAA,GAAO,8BAAA;EDMwH;;;;;ACzBjI;EA0BE,KAAA,GAAQ,8BAAA;;;;;;;EAOR,OAAA,GAAU,8BAAA;EAaQ;;;;;;EANlB,MAAA,GAAS,8BAAA;EAwDI;;;;;EAlDb,eAAA,GAAkB,8BAAA;EAgF+B;;;;;EA1EjD,QAAA,GAAW,8BAAA;EAjCJ;;;;;;;EAyCP,UAAA,GAAa,8BAAA;EAdK;;;;;;;;EAuBlB,IAAA,GAAO,8BAAA;EAaP;;;;;EAPA,KAAA,GAAQ,8BAAA;EA4BR;;;;;;EArBA,WAAA,GAAc,8BAAA;EA4CA;;;AAgChB;;;EArEE,SAAA,GAAY,8BAAA;EAqEgG;;;;;;EA9D5G,UAAA,GAAa,8BAAA;EA8DuB;;;;;;EAvDpC,QAAA,GAAW,8BAAA;EAuD+K;;AC5J5L;;;;ED4GE,YAAA,GAAe,8BAAA;ECvFG;;;;;;;ED+FlB,cAAA,GAAiB,8BAAA;ECtGjB;;;;;;;ED8GA,WAAA,GAAc,8BAAA;AAAA;;cAgCH,uBAAA,EAAyB,yBAAA,CAA0B,4BAAA,GAA+B,cAAA,CAAe,8BAAA,IAAkC,aAAA,CAAc,8BAAA;;UC5J7I,sBAAA;EFFuB;;;;AAyBxC;;EEhBE,MAAA,GAAS,wBAAA;EFgBgD;;;;;;EETzD,WAAA,GAAc,wBAAA;EFS0C;;;;;;EEFxD,eAAA,GAAkB,wBAAA;EFEoJ;;;ACzBxK;EC4BE,IAAA,GAAO,wBAAA;;;;;EAKP,QAAA,GAAW,wBAAA;EDAD;ECEV,YAAA,IAAgB,KAAA,EAAO,uBAAA;AAAA;;cAoDZ,iBAAA,EAAmB,yBAAA,CAA0B,sBAAA,GAAyB,cAAA,CAAe,wBAAA,IAA4B,aAAA,CAAc,wBAAA"}
|
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
import { n as useEditorContext } from "./editor-context.js";
|
|
3
3
|
import { createElement, forwardRef, useCallback, useLayoutEffect, useRef } from "react";
|
|
4
4
|
import { registerInlinePopoverPopupElement, registerInlinePopoverPositionerElement, registerInlinePopoverRootElement } from "@prosekit/web/inline-popover";
|
|
5
|
-
/**
|
|
6
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
7
|
-
*/
|
|
8
5
|
function InlinePopoverPopupComponent(props, forwardedRef) {
|
|
9
6
|
registerInlinePopoverPopupElement();
|
|
10
7
|
const elementRef = useRef(null);
|
|
@@ -20,15 +17,8 @@ function InlinePopoverPopupComponent(props, forwardedRef) {
|
|
|
20
17
|
suppressHydrationWarning: true
|
|
21
18
|
});
|
|
22
19
|
}
|
|
23
|
-
/**
|
|
24
|
-
* A React component that renders an `prosekit-inline-popover-popup` custom element.
|
|
25
|
-
*
|
|
26
|
-
* @public
|
|
27
|
-
*/
|
|
20
|
+
/** A React component that renders an `prosekit-inline-popover-popup` custom element. */
|
|
28
21
|
const InlinePopoverPopup = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);
|
|
29
|
-
/**
|
|
30
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
31
|
-
*/
|
|
32
22
|
function InlinePopoverPositionerComponent(props, forwardedRef) {
|
|
33
23
|
registerInlinePopoverPositionerElement();
|
|
34
24
|
const elementRef = useRef(null);
|
|
@@ -68,15 +58,8 @@ function InlinePopoverPositionerComponent(props, forwardedRef) {
|
|
|
68
58
|
suppressHydrationWarning: true
|
|
69
59
|
});
|
|
70
60
|
}
|
|
71
|
-
/**
|
|
72
|
-
* A React component that renders an `prosekit-inline-popover-positioner` custom element.
|
|
73
|
-
*
|
|
74
|
-
* @public
|
|
75
|
-
*/
|
|
61
|
+
/** A React component that renders an `prosekit-inline-popover-positioner` custom element. */
|
|
76
62
|
const InlinePopoverPositioner = /* @__PURE__ */ forwardRef(InlinePopoverPositionerComponent);
|
|
77
|
-
/**
|
|
78
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
79
|
-
*/
|
|
80
63
|
function InlinePopoverRootComponent(props, forwardedRef) {
|
|
81
64
|
registerInlinePopoverRootElement();
|
|
82
65
|
const elementRef = useRef(null);
|
|
@@ -115,11 +98,7 @@ function InlinePopoverRootComponent(props, forwardedRef) {
|
|
|
115
98
|
suppressHydrationWarning: true
|
|
116
99
|
});
|
|
117
100
|
}
|
|
118
|
-
/**
|
|
119
|
-
* A React component that renders an `prosekit-inline-popover-root` custom element.
|
|
120
|
-
*
|
|
121
|
-
* @public
|
|
122
|
-
*/
|
|
101
|
+
/** A React component that renders an `prosekit-inline-popover-root` custom element. */
|
|
123
102
|
const InlinePopoverRoot = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);
|
|
124
103
|
/**
|
|
125
104
|
|
|
@@ -1 +1 @@
|
|
|
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","../src/components/inline-popover/index.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 {}\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 & HTMLAttributes<InlinePopoverPopupElement> & 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 {\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 to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)\n * to place the floating element on top of other page content.\n *\n * @default false\n */\n hoist?: InlinePopoverPositionerElementProps['hoist'];\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 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 & HTMLAttributes<InlinePopoverPositionerElement> & 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 {\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 /** Emitted when the open state of the popover changes. */\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 & HTMLAttributes<InlinePopoverRootElement> & RefAttributes<InlinePopoverRootElement>> = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n InlinePopoverPopup,\n InlinePopoverPositioner,\n InlinePopoverRoot,\n} from 'prosekit/react/inline-popover'\n\n<InlinePopoverRoot>\n <InlinePopoverPositioner>\n <InlinePopoverPopup>...</InlinePopoverPopup>\n </InlinePopoverPositioner>\n</InlinePopoverRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\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,qBAAgL,2BAAW,4BAA4B;;;;ACoGpO,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,0BAAoM,2BAAW,iCAAiC;;;;AC5H7P,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,oBAA4K,2BAAW,2BAA2B"}
|
|
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","../src/components/inline-popover/index.ts"],"sourcesContent":["// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\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/** Props for the {@link InlinePopoverPopup} React component. */\nexport interface InlinePopoverPopupProps {}\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/** A React component that renders an `prosekit-inline-popover-popup` custom element. */\nexport const InlinePopoverPopup: ForwardRefExoticComponent<InlinePopoverPopupProps & HTMLAttributes<InlinePopoverPopupElement> & RefAttributes<InlinePopoverPopupElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPopupComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\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/** Props for the {@link InlinePopoverPositioner} React component. */\nexport interface InlinePopoverPositionerProps {\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 to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)\n * to place the floating element on top of other page content.\n *\n * @default false\n */\n hoist?: InlinePopoverPositionerElementProps['hoist'];\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 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/** A React component that renders an `prosekit-inline-popover-positioner` custom element. */\nexport const InlinePopoverPositioner: ForwardRefExoticComponent<InlinePopoverPositionerProps & HTMLAttributes<InlinePopoverPositionerElement> & RefAttributes<InlinePopoverPositionerElement>> = /* @__PURE__ */ forwardRef(InlinePopoverPositionerComponent);\n","// This file is auto-generated by \"@aria-ui/cli\". Do not edit this file directly.\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/** Props for the {@link InlinePopoverRoot} React component. */\nexport interface InlinePopoverRootProps {\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 /** Emitted when the open state of the popover changes. */\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/** A React component that renders an `prosekit-inline-popover-root` custom element. */\nexport const InlinePopoverRoot: ForwardRefExoticComponent<InlinePopoverRootProps & HTMLAttributes<InlinePopoverRootElement> & RefAttributes<InlinePopoverRootElement>> = /* @__PURE__ */ forwardRef(InlinePopoverRootComponent);\n","/**\n\n@module\n\n## Anatomy\n\n```jsx\nimport {\n InlinePopoverPopup,\n InlinePopoverPositioner,\n InlinePopoverRoot,\n} from 'prosekit/react/inline-popover'\n\n<InlinePopoverRoot>\n <InlinePopoverPositioner>\n <InlinePopoverPopup>...</InlinePopoverPopup>\n </InlinePopoverPositioner>\n</InlinePopoverRoot>\n```\n*/\n\n'use client'\n\nexport * from './index.gen.ts'\n"],"mappings":";;;;AAQA,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;;;AAIzH,MAAa,qBAAgL,2BAAW,4BAA4B;ACwGpO,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;;;AAI9H,MAAa,0BAAoM,2BAAW,iCAAiC;ACxH7P,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;;;AAIxH,MAAa,oBAA4K,2BAAW,2BAA2B"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
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 } from "@prosekit/web/menu";
|
|
3
|
-
/**
|
|
4
|
-
* Props for the {@link MenuItem} React component.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
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, MenuSubmenuRootEvents, MenuSubmenuRootProps as MenuSubmenuRootProps$1, MenuSubmenuTriggerElement, MenuSubmenuTriggerProps as MenuSubmenuTriggerProps$1, MenuTriggerElement, MenuTriggerEvents, MenuTriggerProps as MenuTriggerProps$1 } from "@prosekit/web/menu";
|
|
3
|
+
/** Props for the {@link MenuItem} React component. */
|
|
8
4
|
interface MenuItemProps {
|
|
9
5
|
/**
|
|
10
6
|
* The unique value for this menu item.
|
|
@@ -27,17 +23,9 @@ interface MenuItemProps {
|
|
|
27
23
|
/** Emitted when the the item is selected. */
|
|
28
24
|
onSelect?: (event: MenuItemEvents['select']) => void;
|
|
29
25
|
}
|
|
30
|
-
/**
|
|
31
|
-
* A React component that renders an `prosekit-menu-item` custom element.
|
|
32
|
-
*
|
|
33
|
-
* @public
|
|
34
|
-
*/
|
|
26
|
+
/** A React component that renders an `prosekit-menu-item` custom element. */
|
|
35
27
|
declare const MenuItem: ForwardRefExoticComponent<MenuItemProps & Omit<HTMLAttributes<MenuItemElement>, 'onSelect'> & RefAttributes<MenuItemElement>>;
|
|
36
|
-
/**
|
|
37
|
-
* Props for the {@link MenuPopup} React component.
|
|
38
|
-
*
|
|
39
|
-
* @public
|
|
40
|
-
*/
|
|
28
|
+
/** Props for the {@link MenuPopup} React component. */
|
|
41
29
|
interface MenuPopupProps {
|
|
42
30
|
/**
|
|
43
31
|
* By default, the MenuPopup element will listen for keydown events.
|
|
@@ -47,17 +35,9 @@ interface MenuPopupProps {
|
|
|
47
35
|
*/
|
|
48
36
|
eventTarget?: MenuPopupProps$1['eventTarget'];
|
|
49
37
|
}
|
|
50
|
-
/**
|
|
51
|
-
* A React component that renders an `prosekit-menu-popup` custom element.
|
|
52
|
-
*
|
|
53
|
-
* @public
|
|
54
|
-
*/
|
|
38
|
+
/** A React component that renders an `prosekit-menu-popup` custom element. */
|
|
55
39
|
declare const MenuPopup: ForwardRefExoticComponent<MenuPopupProps & HTMLAttributes<MenuPopupElement> & RefAttributes<MenuPopupElement>>;
|
|
56
|
-
/**
|
|
57
|
-
* Props for the {@link MenuPositioner} React component.
|
|
58
|
-
*
|
|
59
|
-
* @public
|
|
60
|
-
*/
|
|
40
|
+
/** Props for the {@link MenuPositioner} React component. */
|
|
61
41
|
interface MenuPositionerProps {
|
|
62
42
|
/**
|
|
63
43
|
* The initial placement of the floating element
|
|
@@ -187,17 +167,9 @@ interface MenuPositionerProps {
|
|
|
187
167
|
*/
|
|
188
168
|
altBoundary?: MenuPositionerProps$1['altBoundary'];
|
|
189
169
|
}
|
|
190
|
-
/**
|
|
191
|
-
* A React component that renders an `prosekit-menu-positioner` custom element.
|
|
192
|
-
*
|
|
193
|
-
* @public
|
|
194
|
-
*/
|
|
170
|
+
/** A React component that renders an `prosekit-menu-positioner` custom element. */
|
|
195
171
|
declare const MenuPositioner: ForwardRefExoticComponent<MenuPositionerProps & HTMLAttributes<MenuPositionerElement> & RefAttributes<MenuPositionerElement>>;
|
|
196
|
-
/**
|
|
197
|
-
* Props for the {@link MenuRoot} React component.
|
|
198
|
-
*
|
|
199
|
-
* @public
|
|
200
|
-
*/
|
|
172
|
+
/** Props for the {@link MenuRoot} React component. */
|
|
201
173
|
interface MenuRootProps {
|
|
202
174
|
/**
|
|
203
175
|
* Whether the overlay is initially open.
|
|
@@ -217,41 +189,48 @@ interface MenuRootProps {
|
|
|
217
189
|
/** Emitted when the menu is opened or closed. */
|
|
218
190
|
onOpenChange?: (event: MenuRootEvents['openChange']) => void;
|
|
219
191
|
}
|
|
220
|
-
/**
|
|
221
|
-
* A React component that renders an `prosekit-menu-root` custom element.
|
|
222
|
-
*
|
|
223
|
-
* @public
|
|
224
|
-
*/
|
|
192
|
+
/** A React component that renders an `prosekit-menu-root` custom element. */
|
|
225
193
|
declare const MenuRoot: ForwardRefExoticComponent<MenuRootProps & HTMLAttributes<MenuRootElement> & RefAttributes<MenuRootElement>>;
|
|
226
|
-
/**
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
194
|
+
/** Props for the {@link MenuSubmenuRoot} React component. */
|
|
195
|
+
interface MenuSubmenuRootProps {
|
|
196
|
+
/**
|
|
197
|
+
* Whether the overlay is initially open.
|
|
198
|
+
* @default false
|
|
199
|
+
*/
|
|
200
|
+
defaultOpen?: MenuSubmenuRootProps$1['defaultOpen'];
|
|
201
|
+
/**
|
|
202
|
+
* Whether the overlay is currently open.
|
|
203
|
+
* @default null
|
|
204
|
+
*/
|
|
205
|
+
open?: MenuSubmenuRootProps$1['open'];
|
|
206
|
+
/**
|
|
207
|
+
* Whether the component should ignore user interaction.
|
|
208
|
+
* @default false
|
|
209
|
+
*/
|
|
210
|
+
disabled?: MenuSubmenuRootProps$1['disabled'];
|
|
211
|
+
/** Emitted when the submenu is opened or closed. */
|
|
212
|
+
onOpenChange?: (event: MenuSubmenuRootEvents['openChange']) => void;
|
|
213
|
+
}
|
|
214
|
+
/** A React component that renders an `prosekit-menu-submenu-root` custom element. */
|
|
237
215
|
declare const MenuSubmenuRoot: ForwardRefExoticComponent<MenuSubmenuRootProps & HTMLAttributes<MenuSubmenuRootElement> & RefAttributes<MenuSubmenuRootElement>>;
|
|
238
|
-
/**
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
216
|
+
/** Props for the {@link MenuSubmenuTrigger} React component. */
|
|
217
|
+
interface MenuSubmenuTriggerProps {
|
|
218
|
+
/**
|
|
219
|
+
* The unique value for this submenu trigger in the parent menu.
|
|
220
|
+
*
|
|
221
|
+
* @default ""
|
|
222
|
+
*/
|
|
223
|
+
value?: MenuSubmenuTriggerProps$1['value'];
|
|
224
|
+
/**
|
|
225
|
+
* Whether this submenu trigger is disabled.
|
|
226
|
+
*
|
|
227
|
+
* @default false
|
|
228
|
+
*/
|
|
229
|
+
disabled?: MenuSubmenuTriggerProps$1['disabled'];
|
|
230
|
+
}
|
|
231
|
+
/** A React component that renders an `prosekit-menu-submenu-trigger` custom element. */
|
|
249
232
|
declare const MenuSubmenuTrigger: ForwardRefExoticComponent<MenuSubmenuTriggerProps & HTMLAttributes<MenuSubmenuTriggerElement> & RefAttributes<MenuSubmenuTriggerElement>>;
|
|
250
|
-
/**
|
|
251
|
-
* Props for the {@link MenuTrigger} React component.
|
|
252
|
-
*
|
|
253
|
-
* @public
|
|
254
|
-
*/
|
|
233
|
+
/** Props for the {@link MenuTrigger} React component. */
|
|
255
234
|
interface MenuTriggerProps {
|
|
256
235
|
/**
|
|
257
236
|
* Whether the component should ignore user interaction.
|
|
@@ -262,11 +241,7 @@ interface MenuTriggerProps {
|
|
|
262
241
|
/** Emitted when the menu is opened or closed. */
|
|
263
242
|
onOpenChange?: (event: MenuTriggerEvents['openChange']) => void;
|
|
264
243
|
}
|
|
265
|
-
/**
|
|
266
|
-
* A React component that renders an `prosekit-menu-trigger` custom element.
|
|
267
|
-
*
|
|
268
|
-
* @public
|
|
269
|
-
*/
|
|
244
|
+
/** A React component that renders an `prosekit-menu-trigger` custom element. */
|
|
270
245
|
declare const MenuTrigger: ForwardRefExoticComponent<MenuTriggerProps & HTMLAttributes<MenuTriggerElement> & RefAttributes<MenuTriggerElement>>;
|
|
271
246
|
export { MenuItem, type MenuItemProps, MenuPopup, type MenuPopupProps, MenuPositioner, type MenuPositionerProps, MenuRoot, type MenuRootProps, MenuSubmenuRoot, type MenuSubmenuRootProps, MenuSubmenuTrigger, type MenuSubmenuTriggerProps, MenuTrigger, type MenuTriggerProps };
|
|
272
247
|
//# sourceMappingURL=prosekit-react-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-react-menu.d.ts","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.gen.ts","../src/components/menu/menu-submenu-root.gen.ts","../src/components/menu/menu-submenu-trigger.gen.ts","../src/components/menu/menu-trigger.gen.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prosekit-react-menu.d.ts","names":[],"sources":["../src/components/menu/menu-item.gen.ts","../src/components/menu/menu-popup.gen.ts","../src/components/menu/menu-positioner.gen.ts","../src/components/menu/menu-root.gen.ts","../src/components/menu/menu-submenu-root.gen.ts","../src/components/menu/menu-submenu-trigger.gen.ts","../src/components/menu/menu-trigger.gen.ts"],"mappings":";;;UAMiB,aAAA;EAAa;;;;;EAM5B,KAAA,GAAQ,eAAA;EAcyB;;;;;EARjC,QAAA,GAAW,eAAA;EAMX;;;;;EAAA,aAAA,GAAgB,eAAA;EAE2B;EAA3C,QAAA,IAAY,KAAA,EAAO,cAAA;AAAA;;cAkDR,QAAA,EAAU,yBAAA,CAA0B,aAAA,GAAgB,IAAA,CAAK,cAAA,CAAe,eAAA,iBAAgC,aAAA,CAAc,eAAA;;UCtElH,cAAA;EDAa;;;;;;ECO5B,WAAA,GAAc,gBAAA;AAAA;;cAgCH,SAAA,EAAW,yBAAA,CAA0B,cAAA,GAAiB,cAAA,CAAe,gBAAA,IAAoB,aAAA,CAAc,gBAAA;;UCvCnG,mBAAA;EFAa;;;;;EEM5B,SAAA,GAAY,qBAAA;EFcqB;;;;;EERjC,QAAA,GAAW,qBAAA;EFMX;;;;;;;EEEA,UAAA,GAAa,qBAAA;EFkDqL;;;;;;EE3ClM,KAAA,GAAQ,qBAAA;EF2C2G;;;;;EErCnH,MAAA,GAAS,qBAAA;EFqCsD;;;;;;;;EE5B/D,IAAA,GAAO,qBAAA;ED1CsB;;;;AAuC/B;ECSE,KAAA,GAAQ,qBAAA;;;;;;;EAOR,OAAA,GAAU,qBAAA;EDhBqC;;;;;;ECuB/C,WAAA,GAAc,qBAAA;EDvBoG;;;;ACvCpH;;EAqEE,SAAA,GAAY,qBAAA;EA/DA;;;;;;EAsEZ,UAAA,GAAa,qBAAA;EArBH;;;;;;EA4BV,MAAA,GAAS,qBAAA;EAqBM;;;;;;EAdf,IAAA,GAAO,qBAAA;EApFK;;;;;;EA2FZ,QAAA,GAAW,qBAAA;EAhEX;;;;;;EAuEA,YAAA,GAAe,qBAAA;EAjDL;;;;;;EAwDV,eAAA,GAAkB,qBAAA;EA5BlB;;;;;;;EAoCA,cAAA,GAAiB,qBAAA;EARjB;;;;;;;EAgBA,WAAA,GAAc,qBAAA;AAAA;;cAgCH,cAAA,EAAgB,yBAAA,CAA0B,mBAAA,GAAsB,cAAA,CAAe,qBAAA,IAAyB,aAAA,CAAc,qBAAA;;UC/JlH,aAAA;EHAa;;;;EGK5B,WAAA,GAAc,eAAA;EHeK;;;;EGVnB,IAAA,GAAO,eAAA;EHEP;;;;EGGA,QAAA,GAAW,eAAA;EHKQ;EGHnB,YAAA,IAAgB,KAAA,EAAO,cAAA;AAAA;;cAkDZ,QAAA,EAAU,yBAAA,CAA0B,aAAA,GAAgB,cAAA,CAAe,eAAA,IAAmB,aAAA,CAAc,eAAA;;UCnEhG,oBAAA;EJAa;;;;EIK5B,WAAA,GAAc,sBAAA;EJeK;;;;EIVnB,IAAA,GAAO,sBAAA;EJEP;;;;EIGA,QAAA,GAAW,sBAAA;EJKQ;EIHnB,YAAA,IAAgB,KAAA,EAAO,qBAAA;AAAA;;cAkDZ,eAAA,EAAiB,yBAAA,CAA0B,oBAAA,GAAuB,cAAA,CAAe,sBAAA,IAA0B,aAAA,CAAc,sBAAA;;UCnErH,uBAAA;ELAa;;;;;EKM5B,KAAA,GAAQ,yBAAA;ELcyB;;;;;EKRjC,QAAA,GAAW,yBAAA;AAAA;;cAgCA,kBAAA,EAAoB,yBAAA,CAA0B,uBAAA,GAA0B,cAAA,CAAe,yBAAA,IAA6B,aAAA,CAAc,yBAAA;;UC5C9H,gBAAA;ENAa;;;;;EMM5B,QAAA,GAAW,kBAAA;ENcsB;EMZjC,YAAA,IAAgB,KAAA,EAAO,iBAAA;AAAA;;cAkDZ,WAAA,EAAa,yBAAA,CAA0B,gBAAA,GAAmB,cAAA,CAAe,kBAAA,IAAsB,aAAA,CAAc,kBAAA"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createElement, forwardRef, useCallback, useLayoutEffect, useRef } from "react";
|
|
3
3
|
import { registerMenuItemElement, registerMenuPopupElement, registerMenuPositionerElement, registerMenuRootElement, registerMenuSubmenuRootElement, registerMenuSubmenuTriggerElement, registerMenuTriggerElement } from "@prosekit/web/menu";
|
|
4
|
-
/**
|
|
5
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
6
|
-
*/
|
|
7
4
|
function MenuItemComponent(props, forwardedRef) {
|
|
8
5
|
registerMenuItemElement();
|
|
9
6
|
const elementRef = useRef(null);
|
|
@@ -39,15 +36,8 @@ function MenuItemComponent(props, forwardedRef) {
|
|
|
39
36
|
suppressHydrationWarning: true
|
|
40
37
|
});
|
|
41
38
|
}
|
|
42
|
-
/**
|
|
43
|
-
* A React component that renders an `prosekit-menu-item` custom element.
|
|
44
|
-
*
|
|
45
|
-
* @public
|
|
46
|
-
*/
|
|
39
|
+
/** A React component that renders an `prosekit-menu-item` custom element. */
|
|
47
40
|
const MenuItem = /* @__PURE__ */ forwardRef(MenuItemComponent);
|
|
48
|
-
/**
|
|
49
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
50
|
-
*/
|
|
51
41
|
function MenuPopupComponent(props, forwardedRef) {
|
|
52
42
|
registerMenuPopupElement();
|
|
53
43
|
const elementRef = useRef(null);
|
|
@@ -68,15 +58,8 @@ function MenuPopupComponent(props, forwardedRef) {
|
|
|
68
58
|
suppressHydrationWarning: true
|
|
69
59
|
});
|
|
70
60
|
}
|
|
71
|
-
/**
|
|
72
|
-
* A React component that renders an `prosekit-menu-popup` custom element.
|
|
73
|
-
*
|
|
74
|
-
* @public
|
|
75
|
-
*/
|
|
61
|
+
/** A React component that renders an `prosekit-menu-popup` custom element. */
|
|
76
62
|
const MenuPopup = /* @__PURE__ */ forwardRef(MenuPopupComponent);
|
|
77
|
-
/**
|
|
78
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
79
|
-
*/
|
|
80
63
|
function MenuPositionerComponent(props, forwardedRef) {
|
|
81
64
|
registerMenuPositionerElement();
|
|
82
65
|
const elementRef = useRef(null);
|
|
@@ -116,15 +99,8 @@ function MenuPositionerComponent(props, forwardedRef) {
|
|
|
116
99
|
suppressHydrationWarning: true
|
|
117
100
|
});
|
|
118
101
|
}
|
|
119
|
-
/**
|
|
120
|
-
* A React component that renders an `prosekit-menu-positioner` custom element.
|
|
121
|
-
*
|
|
122
|
-
* @public
|
|
123
|
-
*/
|
|
102
|
+
/** A React component that renders an `prosekit-menu-positioner` custom element. */
|
|
124
103
|
const MenuPositioner = /* @__PURE__ */ forwardRef(MenuPositionerComponent);
|
|
125
|
-
/**
|
|
126
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
127
|
-
*/
|
|
128
104
|
function MenuRootComponent(props, forwardedRef) {
|
|
129
105
|
registerMenuRootElement();
|
|
130
106
|
const elementRef = useRef(null);
|
|
@@ -160,19 +136,32 @@ function MenuRootComponent(props, forwardedRef) {
|
|
|
160
136
|
suppressHydrationWarning: true
|
|
161
137
|
});
|
|
162
138
|
}
|
|
163
|
-
/**
|
|
164
|
-
* A React component that renders an `prosekit-menu-root` custom element.
|
|
165
|
-
*
|
|
166
|
-
* @public
|
|
167
|
-
*/
|
|
139
|
+
/** A React component that renders an `prosekit-menu-root` custom element. */
|
|
168
140
|
const MenuRoot = /* @__PURE__ */ forwardRef(MenuRootComponent);
|
|
169
|
-
/**
|
|
170
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
171
|
-
*/
|
|
172
141
|
function MenuSubmenuRootComponent(props, forwardedRef) {
|
|
173
142
|
registerMenuSubmenuRootElement();
|
|
174
143
|
const elementRef = useRef(null);
|
|
175
|
-
const
|
|
144
|
+
const handlersRef = useRef([]);
|
|
145
|
+
const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;
|
|
146
|
+
useLayoutEffect(() => {
|
|
147
|
+
const element = elementRef.current;
|
|
148
|
+
if (!element) return;
|
|
149
|
+
Object.assign(element, {
|
|
150
|
+
defaultOpen: p0,
|
|
151
|
+
disabled: p1,
|
|
152
|
+
open: p2
|
|
153
|
+
});
|
|
154
|
+
handlersRef.current = [e0];
|
|
155
|
+
});
|
|
156
|
+
useLayoutEffect(() => {
|
|
157
|
+
const element = elementRef.current;
|
|
158
|
+
if (!element) return;
|
|
159
|
+
const ac = new AbortController();
|
|
160
|
+
for (const [index, eventName] of ["openChange"].entries()) element.addEventListener(eventName, (event) => {
|
|
161
|
+
handlersRef.current[index]?.(event);
|
|
162
|
+
}, { signal: ac.signal });
|
|
163
|
+
return () => ac.abort();
|
|
164
|
+
}, []);
|
|
176
165
|
const mergedRef = useCallback((element) => {
|
|
177
166
|
elementRef.current = element;
|
|
178
167
|
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
@@ -184,19 +173,20 @@ function MenuSubmenuRootComponent(props, forwardedRef) {
|
|
|
184
173
|
suppressHydrationWarning: true
|
|
185
174
|
});
|
|
186
175
|
}
|
|
187
|
-
/**
|
|
188
|
-
* A React component that renders an `prosekit-menu-submenu-root` custom element.
|
|
189
|
-
*
|
|
190
|
-
* @public
|
|
191
|
-
*/
|
|
176
|
+
/** A React component that renders an `prosekit-menu-submenu-root` custom element. */
|
|
192
177
|
const MenuSubmenuRoot = /* @__PURE__ */ forwardRef(MenuSubmenuRootComponent);
|
|
193
|
-
/**
|
|
194
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
195
|
-
*/
|
|
196
178
|
function MenuSubmenuTriggerComponent(props, forwardedRef) {
|
|
197
179
|
registerMenuSubmenuTriggerElement();
|
|
198
180
|
const elementRef = useRef(null);
|
|
199
|
-
const { ...restProps } = props;
|
|
181
|
+
const { disabled: p0, value: p1, ...restProps } = props;
|
|
182
|
+
useLayoutEffect(() => {
|
|
183
|
+
const element = elementRef.current;
|
|
184
|
+
if (!element) return;
|
|
185
|
+
Object.assign(element, {
|
|
186
|
+
disabled: p0,
|
|
187
|
+
value: p1
|
|
188
|
+
});
|
|
189
|
+
});
|
|
200
190
|
const mergedRef = useCallback((element) => {
|
|
201
191
|
elementRef.current = element;
|
|
202
192
|
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
@@ -208,15 +198,8 @@ function MenuSubmenuTriggerComponent(props, forwardedRef) {
|
|
|
208
198
|
suppressHydrationWarning: true
|
|
209
199
|
});
|
|
210
200
|
}
|
|
211
|
-
/**
|
|
212
|
-
* A React component that renders an `prosekit-menu-submenu-trigger` custom element.
|
|
213
|
-
*
|
|
214
|
-
* @public
|
|
215
|
-
*/
|
|
201
|
+
/** A React component that renders an `prosekit-menu-submenu-trigger` custom element. */
|
|
216
202
|
const MenuSubmenuTrigger = /* @__PURE__ */ forwardRef(MenuSubmenuTriggerComponent);
|
|
217
|
-
/**
|
|
218
|
-
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
219
|
-
*/
|
|
220
203
|
function MenuTriggerComponent(props, forwardedRef) {
|
|
221
204
|
registerMenuTriggerElement();
|
|
222
205
|
const elementRef = useRef(null);
|
|
@@ -248,11 +231,7 @@ function MenuTriggerComponent(props, forwardedRef) {
|
|
|
248
231
|
suppressHydrationWarning: true
|
|
249
232
|
});
|
|
250
233
|
}
|
|
251
|
-
/**
|
|
252
|
-
* A React component that renders an `prosekit-menu-trigger` custom element.
|
|
253
|
-
*
|
|
254
|
-
* @public
|
|
255
|
-
*/
|
|
234
|
+
/** A React component that renders an `prosekit-menu-trigger` custom element. */
|
|
256
235
|
const MenuTrigger = /* @__PURE__ */ forwardRef(MenuTriggerComponent);
|
|
257
236
|
/**
|
|
258
237
|
|