@prosekit/react 0.7.0-beta.0 → 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.
- package/dist/prosekit-react-autocomplete.d.ts +224 -17
- package/dist/prosekit-react-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-react-autocomplete.js +216 -9
- package/dist/prosekit-react-autocomplete.js.map +1 -1
- package/dist/prosekit-react-block-handle.d.ts +208 -13
- package/dist/prosekit-react-block-handle.d.ts.map +1 -1
- package/dist/prosekit-react-block-handle.js +182 -7
- package/dist/prosekit-react-block-handle.js.map +1 -1
- package/dist/prosekit-react-drop-indicator.d.ts +25 -5
- package/dist/prosekit-react-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-react-drop-indicator.js +36 -3
- package/dist/prosekit-react-drop-indicator.js.map +1 -1
- package/dist/prosekit-react-inline-popover.d.ts +202 -7
- package/dist/prosekit-react-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-react-inline-popover.js +128 -5
- package/dist/prosekit-react-inline-popover.js.map +1 -1
- package/dist/prosekit-react-menu.d.ts +287 -0
- package/dist/prosekit-react-menu.d.ts.map +1 -0
- package/dist/prosekit-react-menu.js +272 -0
- package/dist/prosekit-react-menu.js.map +1 -0
- package/dist/prosekit-react-popover.d.ts +225 -13
- package/dist/prosekit-react-popover.d.ts.map +1 -1
- package/dist/prosekit-react-popover.js +168 -7
- package/dist/prosekit-react-popover.js.map +1 -1
- package/dist/prosekit-react-resizable.d.ts +54 -11
- package/dist/prosekit-react-resizable.d.ts.map +1 -1
- package/dist/prosekit-react-resizable.js +78 -7
- package/dist/prosekit-react-resizable.js.map +1 -1
- package/dist/prosekit-react-table-handle.d.ts +445 -37
- package/dist/prosekit-react-table-handle.d.ts.map +1 -1
- package/dist/prosekit-react-table-handle.js +379 -19
- package/dist/prosekit-react-table-handle.js.map +1 -1
- package/dist/prosekit-react-tooltip.d.ts +209 -13
- package/dist/prosekit-react-tooltip.d.ts.map +1 -1
- package/dist/prosekit-react-tooltip.js +155 -7
- package/dist/prosekit-react-tooltip.js.map +1 -1
- package/package.json +28 -17
- package/src/components/autocomplete/autocomplete-empty.gen.ts +39 -31
- package/src/components/autocomplete/autocomplete-item.gen.ts +82 -31
- package/src/components/autocomplete/autocomplete-popup.gen.ts +78 -0
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +151 -0
- package/src/components/autocomplete/autocomplete-root.gen.ts +107 -0
- package/src/components/autocomplete/index.gen.ts +12 -4
- package/src/components/autocomplete/index.ts +27 -0
- package/src/components/block-handle/block-handle-add.gen.ts +57 -31
- package/src/components/block-handle/block-handle-draggable.gen.ts +57 -31
- package/src/components/block-handle/block-handle-popup.gen.ts +42 -0
- package/src/components/block-handle/block-handle-positioner.gen.ts +169 -0
- package/src/components/block-handle/block-handle-root.gen.ts +82 -0
- package/src/components/block-handle/index.gen.ts +13 -3
- package/src/components/block-handle/index.ts +27 -0
- package/src/components/drop-indicator/drop-indicator.gen.ts +63 -31
- package/src/components/drop-indicator/index.gen.ts +5 -1
- package/src/components/drop-indicator/index.ts +14 -0
- package/src/components/inline-popover/index.gen.ts +11 -1
- package/src/components/inline-popover/index.ts +22 -0
- package/src/components/inline-popover/inline-popover-popup.gen.ts +42 -0
- package/src/components/inline-popover/inline-popover-positioner.gen.ts +175 -0
- package/src/components/inline-popover/inline-popover-root.gen.ts +106 -0
- package/src/components/menu/index.gen.ts +19 -0
- package/src/components/menu/index.ts +37 -0
- package/src/components/menu/menu-item.gen.ts +89 -0
- package/src/components/menu/menu-popup.gen.ts +56 -0
- package/src/components/menu/menu-positioner.gen.ts +176 -0
- package/src/components/menu/menu-root.gen.ts +86 -0
- package/src/components/menu/menu-submenu-root.gen.ts +42 -0
- package/src/components/menu/menu-submenu-trigger.gen.ts +42 -0
- package/src/components/menu/menu-trigger.gen.ts +77 -0
- package/src/components/popover/index.gen.ts +11 -3
- package/src/components/popover/index.ts +24 -0
- package/src/components/popover/popover-popup.gen.ts +42 -0
- package/src/components/popover/popover-positioner.gen.ts +176 -0
- package/src/components/popover/popover-root.gen.ts +90 -31
- package/src/components/popover/popover-trigger.gen.ts +90 -31
- package/src/components/resizable/index.gen.ts +8 -2
- package/src/components/resizable/index.ts +20 -0
- package/src/components/resizable/resizable-handle.gen.ts +52 -31
- package/src/components/resizable/resizable-root.gen.ts +88 -31
- package/src/components/table-handle/index.gen.ts +17 -9
- package/src/components/table-handle/index.ts +58 -0
- package/src/components/table-handle/table-handle-column-menu-root.gen.ts +64 -0
- package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +58 -0
- package/src/components/table-handle/table-handle-column-popup.gen.ts +42 -0
- package/src/components/table-handle/table-handle-column-positioner.gen.ts +199 -0
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +55 -31
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +55 -31
- package/src/components/table-handle/table-handle-root.gen.ts +57 -31
- package/src/components/table-handle/table-handle-row-menu-root.gen.ts +64 -0
- package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +58 -0
- package/src/components/table-handle/table-handle-row-popup.gen.ts +42 -0
- package/src/components/table-handle/table-handle-row-positioner.gen.ts +199 -0
- package/src/components/tooltip/index.gen.ts +11 -3
- package/src/components/tooltip/index.ts +24 -0
- package/src/components/tooltip/tooltip-popup.gen.ts +42 -0
- package/src/components/tooltip/tooltip-positioner.gen.ts +176 -0
- package/src/components/tooltip/tooltip-root.gen.ts +83 -31
- package/src/components/tooltip/tooltip-trigger.gen.ts +61 -31
- package/src/extensions/react-node-view.spec.ts +150 -0
- package/dist/create-component.js +0 -94
- package/dist/create-component.js.map +0 -1
- package/dist/create-props.d.ts +0 -6
- package/dist/create-props.d.ts.map +0 -1
- package/src/components/autocomplete/autocomplete-list.gen.ts +0 -34
- package/src/components/autocomplete/autocomplete-popover.gen.ts +0 -34
- package/src/components/block-handle/block-handle-popover.gen.ts +0 -34
- package/src/components/create-component.ts +0 -137
- package/src/components/create-props.ts +0 -13
- package/src/components/inline-popover/inline-popover.gen.ts +0 -34
- package/src/components/merge-refs.ts +0 -35
- package/src/components/popover/popover-content.gen.ts +0 -34
- package/src/components/table-handle/table-handle-column-root.gen.ts +0 -34
- package/src/components/table-handle/table-handle-column-trigger.gen.ts +0 -34
- package/src/components/table-handle/table-handle-popover-content.gen.ts +0 -34
- package/src/components/table-handle/table-handle-popover-item.gen.ts +0 -34
- package/src/components/table-handle/table-handle-row-root.gen.ts +0 -34
- package/src/components/table-handle/table-handle-row-trigger.gen.ts +0 -34
- package/src/components/tooltip/tooltip-content.gen.ts +0 -34
|
@@ -1,27 +1,223 @@
|
|
|
1
|
-
import { t as CreateProps } from "./create-props.js";
|
|
2
1
|
import { ForwardRefExoticComponent, HTMLAttributes, RefAttributes } from "react";
|
|
3
|
-
import {
|
|
2
|
+
import { OpenChangeEvent, TooltipPopupElement, TooltipPositionerElement, TooltipPositionerProps as TooltipPositionerProps$1, TooltipRootElement, TooltipRootEvents, TooltipRootProps as TooltipRootProps$1, TooltipTriggerElement, TooltipTriggerProps as TooltipTriggerProps$1 } from "@prosekit/web/tooltip";
|
|
4
3
|
|
|
5
|
-
//#region src/components/tooltip/tooltip-
|
|
4
|
+
//#region src/components/tooltip/tooltip-popup.gen.d.ts
|
|
6
5
|
/**
|
|
7
|
-
* Props for the {@link
|
|
6
|
+
* Props for the {@link TooltipPopup} React component.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
8
9
|
*/
|
|
9
|
-
interface
|
|
10
|
-
|
|
10
|
+
interface TooltipPopupProps extends HTMLAttributes<TooltipPopupElement> {}
|
|
11
|
+
/**
|
|
12
|
+
* A React component that renders an `prosekit-tooltip-popup` custom element.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
declare const TooltipPopup: ForwardRefExoticComponent<TooltipPopupProps & RefAttributes<TooltipPopupElement>>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/tooltip/tooltip-positioner.gen.d.ts
|
|
19
|
+
/**
|
|
20
|
+
* Props for the {@link TooltipPositioner} React component.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
interface TooltipPositionerProps extends HTMLAttributes<TooltipPositionerElement> {
|
|
25
|
+
/**
|
|
26
|
+
* The strategy to use for positioning
|
|
27
|
+
*
|
|
28
|
+
* @default "absolute"
|
|
29
|
+
*/
|
|
30
|
+
strategy?: TooltipPositionerProps$1['strategy'];
|
|
31
|
+
/**
|
|
32
|
+
* The initial placement of the floating element
|
|
33
|
+
*
|
|
34
|
+
* @default "top"
|
|
35
|
+
*/
|
|
36
|
+
placement?: TooltipPositionerProps$1['placement'];
|
|
37
|
+
/**
|
|
38
|
+
* Options to activate auto-update listeners
|
|
39
|
+
*
|
|
40
|
+
* @see https://floating-ui.com/docs/autoUpdate
|
|
41
|
+
*
|
|
42
|
+
* @default true
|
|
43
|
+
*/
|
|
44
|
+
autoUpdate?: TooltipPositionerProps$1['autoUpdate'];
|
|
45
|
+
/**
|
|
46
|
+
* Whether to use the browser Popover API to place the floating element on
|
|
47
|
+
* top of other page content.
|
|
48
|
+
*
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
hoist?: TooltipPositionerProps$1['hoist'];
|
|
52
|
+
/**
|
|
53
|
+
* The distance between the reference and floating element.
|
|
54
|
+
*
|
|
55
|
+
* @default 6
|
|
56
|
+
*/
|
|
57
|
+
offset?: TooltipPositionerProps$1['offset'];
|
|
58
|
+
/**
|
|
59
|
+
* Whether to flip the `placement` in order to keep it in view when the
|
|
60
|
+
* preferred placement(s) will overflow the clipping boundary. You can also
|
|
61
|
+
* provide an array of placements to try sequentially if the preferred
|
|
62
|
+
* `placement` does not fit.
|
|
63
|
+
*
|
|
64
|
+
* @default true
|
|
65
|
+
*/
|
|
66
|
+
flip?: TooltipPositionerProps$1['flip'];
|
|
67
|
+
/**
|
|
68
|
+
* Whether the floating element should shift to keep it in view.
|
|
69
|
+
*
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
shift?: TooltipPositionerProps$1['shift'];
|
|
73
|
+
/**
|
|
74
|
+
* Whether the floating element can overlap the reference element to keep it
|
|
75
|
+
* in view.
|
|
76
|
+
*
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
overlap?: TooltipPositionerProps$1['overlap'];
|
|
80
|
+
/**
|
|
81
|
+
* Whether to constrain the floating element's width and height to not exceed
|
|
82
|
+
* the viewport.
|
|
83
|
+
*
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
fitViewport?: TooltipPositionerProps$1['fitViewport'];
|
|
87
|
+
/**
|
|
88
|
+
* Whether to constrain the floating element's width so that it matches the
|
|
89
|
+
* reference element.
|
|
90
|
+
*
|
|
91
|
+
* @default false
|
|
92
|
+
*/
|
|
93
|
+
sameWidth?: TooltipPositionerProps$1['sameWidth'];
|
|
94
|
+
/**
|
|
95
|
+
* Whether to constrain the floating element's height so that it matches the
|
|
96
|
+
* reference element.
|
|
97
|
+
*
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
sameHeight?: TooltipPositionerProps$1['sameHeight'];
|
|
101
|
+
/**
|
|
102
|
+
* Whether to improve positioning for inline reference elements that span over
|
|
103
|
+
* multiple lines.
|
|
104
|
+
*
|
|
105
|
+
* @default false
|
|
106
|
+
*/
|
|
107
|
+
inline?: TooltipPositionerProps$1['inline'];
|
|
108
|
+
/**
|
|
109
|
+
* Whether to hide the floating element when the reference element or the
|
|
110
|
+
* floating element is fully clipped.
|
|
111
|
+
*
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
hide?: TooltipPositionerProps$1['hide'];
|
|
115
|
+
/**
|
|
116
|
+
* Describes the clipping element(s) or area that overflow will be checked relative to.
|
|
117
|
+
* Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
|
|
118
|
+
*
|
|
119
|
+
* @default 'clippingAncestors'
|
|
120
|
+
*/
|
|
121
|
+
boundary?: TooltipPositionerProps$1['boundary'];
|
|
122
|
+
/**
|
|
123
|
+
* Describes the root boundary that the element will be checked for overflow relative to.
|
|
124
|
+
* Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
|
|
125
|
+
*
|
|
126
|
+
* @default 'viewport'
|
|
127
|
+
*/
|
|
128
|
+
rootBoundary?: TooltipPositionerProps$1['rootBoundary'];
|
|
129
|
+
/**
|
|
130
|
+
* Describes the virtual padding around the boundary to check for overflow.
|
|
131
|
+
* Please see https://floating-ui.com/docs/detectoverflow#padding for more information.
|
|
132
|
+
*
|
|
133
|
+
* @default 4
|
|
134
|
+
*/
|
|
135
|
+
overflowPadding?: TooltipPositionerProps$1['overflowPadding'];
|
|
136
|
+
/**
|
|
137
|
+
* The element that will be used to check for overflow. Please see
|
|
138
|
+
* https://floating-ui.com/docs/detectoverflow#elementcontext for more
|
|
139
|
+
* information.
|
|
140
|
+
*
|
|
141
|
+
* @default 'floating'
|
|
142
|
+
*/
|
|
143
|
+
elementContext?: TooltipPositionerProps$1['elementContext'];
|
|
144
|
+
/**
|
|
145
|
+
* Whether to check the alternate elementContext's boundary. Please see
|
|
146
|
+
* https://floating-ui.com/docs/detectoverflow#altboundary for more
|
|
147
|
+
* information.
|
|
148
|
+
*
|
|
149
|
+
* @default false
|
|
150
|
+
*/
|
|
151
|
+
altBoundary?: TooltipPositionerProps$1['altBoundary'];
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* A React component that renders an `prosekit-tooltip-positioner` custom element.
|
|
155
|
+
*
|
|
156
|
+
* @public
|
|
157
|
+
*/
|
|
158
|
+
declare const TooltipPositioner: ForwardRefExoticComponent<TooltipPositionerProps & RefAttributes<TooltipPositionerElement>>;
|
|
11
159
|
//#endregion
|
|
12
160
|
//#region src/components/tooltip/tooltip-root.gen.d.ts
|
|
13
161
|
/**
|
|
14
|
-
* Props for the {@link TooltipRoot} component.
|
|
162
|
+
* Props for the {@link TooltipRoot} React component.
|
|
163
|
+
*
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
166
|
+
interface TooltipRootProps extends HTMLAttributes<TooltipRootElement> {
|
|
167
|
+
/**
|
|
168
|
+
* Whether the overlay is initially open.
|
|
169
|
+
* @default false
|
|
170
|
+
*/
|
|
171
|
+
defaultOpen?: TooltipRootProps$1['defaultOpen'];
|
|
172
|
+
/**
|
|
173
|
+
* Whether the overlay is currently open.
|
|
174
|
+
* @default null
|
|
175
|
+
*/
|
|
176
|
+
open?: TooltipRootProps$1['open'];
|
|
177
|
+
/**
|
|
178
|
+
* Whether the component should ignore user interaction.
|
|
179
|
+
* @default false
|
|
180
|
+
*/
|
|
181
|
+
disabled?: TooltipRootProps$1['disabled'];
|
|
182
|
+
/** Emitted when the tooltip is opened or closed. */
|
|
183
|
+
onOpenChange?: (event: TooltipRootEvents['openChange']) => void;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* A React component that renders an `prosekit-tooltip-root` custom element.
|
|
187
|
+
*
|
|
188
|
+
* @public
|
|
15
189
|
*/
|
|
16
|
-
|
|
17
|
-
declare const TooltipRoot: ForwardRefExoticComponent<TooltipRootProps & RefAttributes<TooltipRootElement> & HTMLAttributes<TooltipRootElement>>;
|
|
190
|
+
declare const TooltipRoot: ForwardRefExoticComponent<TooltipRootProps & RefAttributes<TooltipRootElement>>;
|
|
18
191
|
//#endregion
|
|
19
192
|
//#region src/components/tooltip/tooltip-trigger.gen.d.ts
|
|
20
193
|
/**
|
|
21
|
-
* Props for the {@link TooltipTrigger} component.
|
|
194
|
+
* Props for the {@link TooltipTrigger} React component.
|
|
195
|
+
*
|
|
196
|
+
* @public
|
|
197
|
+
*/
|
|
198
|
+
interface TooltipTriggerProps extends HTMLAttributes<TooltipTriggerElement> {
|
|
199
|
+
/**
|
|
200
|
+
* Whether the component should ignore user interaction.
|
|
201
|
+
* @default false
|
|
202
|
+
*/
|
|
203
|
+
disabled?: TooltipTriggerProps$1['disabled'];
|
|
204
|
+
/**
|
|
205
|
+
* The delay in milliseconds before opening the tooltip on hover.
|
|
206
|
+
* @default 600
|
|
207
|
+
*/
|
|
208
|
+
openDelay?: TooltipTriggerProps$1['openDelay'];
|
|
209
|
+
/**
|
|
210
|
+
* The delay in milliseconds before closing the tooltip when hover/focus ends.
|
|
211
|
+
* @default 0
|
|
212
|
+
*/
|
|
213
|
+
closeDelay?: TooltipTriggerProps$1['closeDelay'];
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* A React component that renders an `prosekit-tooltip-trigger` custom element.
|
|
217
|
+
*
|
|
218
|
+
* @public
|
|
22
219
|
*/
|
|
23
|
-
|
|
24
|
-
declare const TooltipTrigger: ForwardRefExoticComponent<TooltipTriggerProps & RefAttributes<TooltipTriggerElement> & HTMLAttributes<TooltipTriggerElement>>;
|
|
220
|
+
declare const TooltipTrigger: ForwardRefExoticComponent<TooltipTriggerProps & RefAttributes<TooltipTriggerElement>>;
|
|
25
221
|
//#endregion
|
|
26
|
-
export {
|
|
222
|
+
export { OpenChangeEvent, TooltipPopup, type TooltipPopupProps, TooltipPositioner, type TooltipPositionerProps, TooltipRoot, type TooltipRootEvents, type TooltipRootProps, TooltipTrigger, type TooltipTriggerProps };
|
|
27
223
|
//# sourceMappingURL=prosekit-react-tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-react-tooltip.d.ts","names":[],"sources":["../src/components/tooltip/tooltip-
|
|
1
|
+
{"version":3,"file":"prosekit-react-tooltip.d.ts","names":[],"sources":["../src/components/tooltip/tooltip-popup.gen.ts","../src/components/tooltip/tooltip-positioner.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts"],"mappings":";;;;;;;;AAyCA;UA7BiB,iBAAA,SAA0B,cAAA,CAAe,mBAAA;;;;;;cA6B7C,YAAA,EAAc,yBAAA,CAA0B,iBAAA,GAAoB,aAAA,CAAc,mBAAA;;;;;;;AAAvF;UC7BiB,sBAAA,SAA+B,cAAA,CAAe,wBAAA;;;;;;EAM7D,QAAA,GAAW,wBAAA;EDuBuC;;;;;ECjBlD,SAAA,GAAY,wBAAA;EDiB4F;;;;AC7B1G;;;EAoBE,UAAA,GAAa,wBAAA;EAdF;;;;;;EAqBX,KAAA,GAAQ,wBAAA;EA4BE;;;;;EAtBV,MAAA,GAAS,wBAAA;EAgEE;;;;;;;;EAvDX,IAAA,GAAO,wBAAA;EA1CsD;;;;;EAgD7D,KAAA,GAAQ,wBAAA;EA5BK;;;;;;EAmCb,OAAA,GAAU,wBAAA;EAPV;;;;;;EAcA,WAAA,GAAc,wBAAA;EAOF;;;;;;EAAZ,SAAA,GAAY,wBAAA;EA4BZ;;;;;;EArBA,UAAA,GAAa,wBAAA;EA2CI;;;;;AA4CnB;EAhFE,MAAA,GAAS,wBAAA;;;;;;;EAOT,IAAA,GAAO,wBAAA;EAyEuB;;;;;;EAlE9B,QAAA,GAAW,wBAAA;;;ACjGb;;;;EDwGE,YAAA,GAAe,wBAAA;EC9FR;;;;;;EDqGP,eAAA,GAAkB,wBAAA;EC/GqC;;;;;;;EDuHvD,cAAA,GAAiB,wBAAA;ECtGM;;;;AAsDzB;;;EDwDE,WAAA,GAAc,wBAAA;AAAA;;;;;;cAoCH,iBAAA,EAAmB,yBAAA,CAA0B,sBAAA,GAAyB,aAAA,CAAc,wBAAA;;;;;;;ADtIjG;UE7BiB,gBAAA,SAAyB,cAAA,CAAe,kBAAA;;;;;EAKvD,WAAA,GAAc,kBAAA;EFwBoC;;;;EEnBlD,IAAA,GAAO,kBAAA;EFmB8E;;;;EEdrF,QAAA,GAAW,kBAAA;;EAEX,YAAA,IAAgB,KAAA,EAAO,iBAAA;AAAA;;;;;;cAsDZ,WAAA,EAAa,yBAAA,CAA0B,gBAAA,GAAmB,aAAA,CAAc,kBAAA;;;;;;;AF1CrF;UG7BiB,mBAAA,SAA4B,cAAA,CAAe,qBAAA;;;;;EAK1D,QAAA,GAAW,qBAAA;EHwBuC;;;;EGnBlD,SAAA,GAAY,qBAAA;EHmByE;;;;EGdrF,UAAA,GAAa,qBAAA;AAAA;AFff;;;;;AAAA,cEmDa,cAAA,EAAgB,yBAAA,CAA0B,mBAAA,GAAsB,aAAA,CAAc,qBAAA"}
|
|
@@ -1,14 +1,162 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region src/components/tooltip/tooltip-
|
|
4
|
-
|
|
1
|
+
import { createElement, forwardRef, useCallback, useLayoutEffect, useRef } from "react";
|
|
2
|
+
import { OpenChangeEvent, registerTooltipPopupElement, registerTooltipPositionerElement, registerTooltipRootElement, registerTooltipTriggerElement } from "@prosekit/web/tooltip";
|
|
3
|
+
//#region src/components/tooltip/tooltip-popup.gen.ts
|
|
4
|
+
/**
|
|
5
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
6
|
+
*/
|
|
7
|
+
function TooltipPopupComponent(props, forwardedRef) {
|
|
8
|
+
registerTooltipPopupElement();
|
|
9
|
+
const elementRef = useRef(null);
|
|
10
|
+
const { ...restProps } = props;
|
|
11
|
+
const mergedRef = useCallback((element) => {
|
|
12
|
+
elementRef.current = element;
|
|
13
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
14
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
15
|
+
}, [forwardedRef]);
|
|
16
|
+
return createElement("prosekit-tooltip-popup", {
|
|
17
|
+
...restProps,
|
|
18
|
+
ref: mergedRef,
|
|
19
|
+
suppressHydrationWarning: true
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A React component that renders an `prosekit-tooltip-popup` custom element.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
const TooltipPopup = /* @__PURE__ */ forwardRef(TooltipPopupComponent);
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/tooltip/tooltip-positioner.gen.ts
|
|
30
|
+
/**
|
|
31
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
32
|
+
*/
|
|
33
|
+
function TooltipPositionerComponent(props, forwardedRef) {
|
|
34
|
+
registerTooltipPositionerElement();
|
|
35
|
+
const elementRef = useRef(null);
|
|
36
|
+
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;
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
const element = elementRef.current;
|
|
39
|
+
if (!element) return;
|
|
40
|
+
Object.assign(element, {
|
|
41
|
+
altBoundary: p0,
|
|
42
|
+
autoUpdate: p1,
|
|
43
|
+
boundary: p2,
|
|
44
|
+
elementContext: p3,
|
|
45
|
+
fitViewport: p4,
|
|
46
|
+
flip: p5,
|
|
47
|
+
hide: p6,
|
|
48
|
+
hoist: p7,
|
|
49
|
+
inline: p8,
|
|
50
|
+
offset: p9,
|
|
51
|
+
overflowPadding: p10,
|
|
52
|
+
overlap: p11,
|
|
53
|
+
placement: p12,
|
|
54
|
+
rootBoundary: p13,
|
|
55
|
+
sameHeight: p14,
|
|
56
|
+
sameWidth: p15,
|
|
57
|
+
shift: p16,
|
|
58
|
+
strategy: p17
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
const mergedRef = useCallback((element) => {
|
|
62
|
+
elementRef.current = element;
|
|
63
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
64
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
65
|
+
}, [forwardedRef]);
|
|
66
|
+
return createElement("prosekit-tooltip-positioner", {
|
|
67
|
+
...restProps,
|
|
68
|
+
ref: mergedRef,
|
|
69
|
+
suppressHydrationWarning: true
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A React component that renders an `prosekit-tooltip-positioner` custom element.
|
|
74
|
+
*
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
const TooltipPositioner = /* @__PURE__ */ forwardRef(TooltipPositionerComponent);
|
|
5
78
|
//#endregion
|
|
6
79
|
//#region src/components/tooltip/tooltip-root.gen.ts
|
|
7
|
-
|
|
80
|
+
/**
|
|
81
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
82
|
+
*/
|
|
83
|
+
function TooltipRootComponent(props, forwardedRef) {
|
|
84
|
+
registerTooltipRootElement();
|
|
85
|
+
const elementRef = useRef(null);
|
|
86
|
+
const handlersRef = useRef([]);
|
|
87
|
+
const { defaultOpen: p0, disabled: p1, open: p2, onOpenChange: e0, ...restProps } = props;
|
|
88
|
+
useLayoutEffect(() => {
|
|
89
|
+
const element = elementRef.current;
|
|
90
|
+
if (!element) return;
|
|
91
|
+
Object.assign(element, {
|
|
92
|
+
defaultOpen: p0,
|
|
93
|
+
disabled: p1,
|
|
94
|
+
open: p2
|
|
95
|
+
});
|
|
96
|
+
handlersRef.current = [e0];
|
|
97
|
+
});
|
|
98
|
+
useLayoutEffect(() => {
|
|
99
|
+
const element = elementRef.current;
|
|
100
|
+
if (!element) return;
|
|
101
|
+
const ac = new AbortController();
|
|
102
|
+
for (const [index, eventName] of ["openChange"].entries()) element.addEventListener(eventName, (event) => {
|
|
103
|
+
handlersRef.current[index]?.(event);
|
|
104
|
+
}, { signal: ac.signal });
|
|
105
|
+
return () => ac.abort();
|
|
106
|
+
}, []);
|
|
107
|
+
const mergedRef = useCallback((element) => {
|
|
108
|
+
elementRef.current = element;
|
|
109
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
110
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
111
|
+
}, [forwardedRef]);
|
|
112
|
+
return createElement("prosekit-tooltip-root", {
|
|
113
|
+
...restProps,
|
|
114
|
+
ref: mergedRef,
|
|
115
|
+
suppressHydrationWarning: true
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A React component that renders an `prosekit-tooltip-root` custom element.
|
|
120
|
+
*
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
const TooltipRoot = /* @__PURE__ */ forwardRef(TooltipRootComponent);
|
|
8
124
|
//#endregion
|
|
9
125
|
//#region src/components/tooltip/tooltip-trigger.gen.ts
|
|
10
|
-
|
|
126
|
+
/**
|
|
127
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
128
|
+
*/
|
|
129
|
+
function TooltipTriggerComponent(props, forwardedRef) {
|
|
130
|
+
registerTooltipTriggerElement();
|
|
131
|
+
const elementRef = useRef(null);
|
|
132
|
+
const { closeDelay: p0, disabled: p1, openDelay: p2, ...restProps } = props;
|
|
133
|
+
useLayoutEffect(() => {
|
|
134
|
+
const element = elementRef.current;
|
|
135
|
+
if (!element) return;
|
|
136
|
+
Object.assign(element, {
|
|
137
|
+
closeDelay: p0,
|
|
138
|
+
disabled: p1,
|
|
139
|
+
openDelay: p2
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
const mergedRef = useCallback((element) => {
|
|
143
|
+
elementRef.current = element;
|
|
144
|
+
if (typeof forwardedRef === "function") forwardedRef(element);
|
|
145
|
+
else if (forwardedRef) forwardedRef.current = element;
|
|
146
|
+
}, [forwardedRef]);
|
|
147
|
+
return createElement("prosekit-tooltip-trigger", {
|
|
148
|
+
...restProps,
|
|
149
|
+
ref: mergedRef,
|
|
150
|
+
suppressHydrationWarning: true
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* A React component that renders an `prosekit-tooltip-trigger` custom element.
|
|
155
|
+
*
|
|
156
|
+
* @public
|
|
157
|
+
*/
|
|
158
|
+
const TooltipTrigger = /* @__PURE__ */ forwardRef(TooltipTriggerComponent);
|
|
11
159
|
//#endregion
|
|
12
|
-
export {
|
|
160
|
+
export { OpenChangeEvent, TooltipPopup, TooltipPositioner, TooltipRoot, TooltipTrigger };
|
|
13
161
|
|
|
14
162
|
//# sourceMappingURL=prosekit-react-tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-react-tooltip.js","names":[],"sources":["../src/components/tooltip/tooltip-content.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts"],"sourcesContent":["import {\n type TooltipContentElement,\n type TooltipContentProps as Props,\n type TooltipContentEvents as Events,\n tooltipContentProps,\n tooltipContentEvents,\n} from '@prosekit/web/tooltip'\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 TooltipContent} component.\n */\nexport interface TooltipContentProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TooltipContent: ForwardRefExoticComponent<\n TooltipContentProps &\n RefAttributes<TooltipContentElement> &\n HTMLAttributes<TooltipContentElement>\n> = createComponent<\n TooltipContentProps,\n TooltipContentElement\n>(\n 'prosekit-tooltip-content',\n 'TooltipContent',\n Object.keys(tooltipContentProps),\n Object.keys(tooltipContentEvents),\n)\n","import {\n type TooltipRootElement,\n type TooltipRootProps as Props,\n type TooltipRootEvents as Events,\n tooltipRootProps,\n tooltipRootEvents,\n} from '@prosekit/web/tooltip'\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 TooltipRoot} component.\n */\nexport interface TooltipRootProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TooltipRoot: ForwardRefExoticComponent<\n TooltipRootProps &\n RefAttributes<TooltipRootElement> &\n HTMLAttributes<TooltipRootElement>\n> = createComponent<\n TooltipRootProps,\n TooltipRootElement\n>(\n 'prosekit-tooltip-root',\n 'TooltipRoot',\n Object.keys(tooltipRootProps),\n Object.keys(tooltipRootEvents),\n)\n","import {\n type TooltipTriggerElement,\n type TooltipTriggerProps as Props,\n type TooltipTriggerEvents as Events,\n tooltipTriggerProps,\n tooltipTriggerEvents,\n} from '@prosekit/web/tooltip'\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 TooltipTrigger} component.\n */\nexport interface TooltipTriggerProps extends Partial<CreateProps<Props, Events>> {}\n\nexport const TooltipTrigger: ForwardRefExoticComponent<\n TooltipTriggerProps &\n RefAttributes<TooltipTriggerElement> &\n HTMLAttributes<TooltipTriggerElement>\n> = createComponent<\n TooltipTriggerProps,\n TooltipTriggerElement\n>(\n 'prosekit-tooltip-trigger',\n 'TooltipTrigger',\n Object.keys(tooltipTriggerProps),\n Object.keys(tooltipTriggerEvents),\n)\n"],"mappings":";;;AAqBA,MAAa,iBAIT,gBAIF,4BACA,kBACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC;;;ACZD,MAAa,cAIT,gBAIF,yBACA,eACA,OAAO,KAAK,iBAAiB,EAC7B,OAAO,KAAK,kBAAkB,CAC/B;;;ACZD,MAAa,iBAIT,gBAIF,4BACA,kBACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC"}
|
|
1
|
+
{"version":3,"file":"prosekit-react-tooltip.js","names":[],"sources":["../src/components/tooltip/tooltip-popup.gen.ts","../src/components/tooltip/tooltip-positioner.gen.ts","../src/components/tooltip/tooltip-root.gen.ts","../src/components/tooltip/tooltip-trigger.gen.ts"],"sourcesContent":["/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerTooltipPopupElement, type TooltipPopupElement } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';\n\n/**\n * Props for the {@link TooltipPopup} React component.\n *\n * @public\n */\nexport interface TooltipPopupProps extends HTMLAttributes<TooltipPopupElement> {}\n\nfunction TooltipPopupComponent(props: TooltipPopupProps, forwardedRef: ForwardedRef<TooltipPopupElement>) {\n registerTooltipPopupElement();\n\n const elementRef = useRef<TooltipPopupElement>(null);\n\n const { ...restProps } = props;\n\n const mergedRef = useCallback(\n (element: TooltipPopupElement | 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-tooltip-popup', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A React component that renders an `prosekit-tooltip-popup` custom element.\n *\n * @public\n */\nexport const TooltipPopup: ForwardRefExoticComponent<TooltipPopupProps & RefAttributes<TooltipPopupElement>> = /* @__PURE__ */ forwardRef(TooltipPopupComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerTooltipPositionerElement, type TooltipPositionerElement, type TooltipPositionerProps as TooltipPositionerElementProps } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/**\n * Props for the {@link TooltipPositioner} React component.\n *\n * @public\n */\nexport interface TooltipPositionerProps extends HTMLAttributes<TooltipPositionerElement> {\n /**\n * The strategy to use for positioning\n *\n * @default \"absolute\"\n */\n strategy?: TooltipPositionerElementProps['strategy'];\n /**\n * The initial placement of the floating element\n *\n * @default \"top\"\n */\n placement?: TooltipPositionerElementProps['placement'];\n /**\n * Options to activate auto-update listeners\n *\n * @see https://floating-ui.com/docs/autoUpdate\n *\n * @default true\n */\n autoUpdate?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['hoist'];\n /**\n * The distance between the reference and floating element.\n *\n * @default 6\n */\n offset?: TooltipPositionerElementProps['offset'];\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?: TooltipPositionerElementProps['flip'];\n /**\n * Whether the floating element should shift to keep it in view.\n *\n * @default true\n */\n shift?: TooltipPositionerElementProps['shift'];\n /**\n * Whether the floating element can overlap the reference element to keep it\n * in view.\n *\n * @default false\n */\n overlap?: TooltipPositionerElementProps['overlap'];\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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['sameHeight'];\n /**\n * Whether to improve positioning for inline reference elements that span over\n * multiple lines.\n *\n * @default false\n */\n inline?: TooltipPositionerElementProps['inline'];\n /**\n * Whether to hide the floating element when the reference element or the\n * floating element is fully clipped.\n *\n * @default false\n */\n hide?: TooltipPositionerElementProps['hide'];\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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['rootBoundary'];\n /**\n * Describes the virtual padding around the boundary to check for overflow.\n * Please see https://floating-ui.com/docs/detectoverflow#padding for more information.\n *\n * @default 4\n */\n overflowPadding?: TooltipPositionerElementProps['overflowPadding'];\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?: TooltipPositionerElementProps['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?: TooltipPositionerElementProps['altBoundary'];\n}\n\nfunction TooltipPositionerComponent(props: TooltipPositionerProps, forwardedRef: ForwardedRef<TooltipPositionerElement>) {\n registerTooltipPositionerElement();\n\n const elementRef = useRef<TooltipPositionerElement>(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: TooltipPositionerElement | 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-tooltip-positioner', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A React component that renders an `prosekit-tooltip-positioner` custom element.\n *\n * @public\n */\nexport const TooltipPositioner: ForwardRefExoticComponent<TooltipPositionerProps & RefAttributes<TooltipPositionerElement>> = /* @__PURE__ */ forwardRef(TooltipPositionerComponent);\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerTooltipRootElement, type TooltipRootElement, type TooltipRootProps as TooltipRootElementProps, type TooltipRootEvents } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/**\n * Props for the {@link TooltipRoot} React component.\n *\n * @public\n */\nexport interface TooltipRootProps extends HTMLAttributes<TooltipRootElement> {\n /**\n * Whether the overlay is initially open.\n * @default false\n */\n defaultOpen?: TooltipRootElementProps['defaultOpen'];\n /**\n * Whether the overlay is currently open.\n * @default null\n */\n open?: TooltipRootElementProps['open'];\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: TooltipRootElementProps['disabled'];\n /** Emitted when the tooltip is opened or closed. */\n onOpenChange?: (event: TooltipRootEvents['openChange']) => void;\n}\n\nfunction TooltipRootComponent(props: TooltipRootProps, forwardedRef: ForwardedRef<TooltipRootElement>) {\n registerTooltipRootElement();\n\n const elementRef = useRef<TooltipRootElement>(null);\n const handlersRef = useRef<Array<((event: Event) => void) | undefined>>([]);\n\n const { defaultOpen: p0, disabled: p1, open: p2, 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, open: p2 });\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: TooltipRootElement | 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-tooltip-root', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A React component that renders an `prosekit-tooltip-root` custom element.\n *\n * @public\n */\nexport const TooltipRoot: ForwardRefExoticComponent<TooltipRootProps & RefAttributes<TooltipRootElement>> = /* @__PURE__ */ forwardRef(TooltipRootComponent);\n\nexport type { TooltipRootEvents };\n","/**\n * This file is auto-generated by the \"@aria-ui/cli\" tool. Do not edit this file directly.\n */\n\nimport { registerTooltipTriggerElement, type TooltipTriggerElement, type TooltipTriggerProps as TooltipTriggerElementProps } from '@prosekit/web/tooltip';\nimport { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes, useLayoutEffect } from 'react';\n\n/**\n * Props for the {@link TooltipTrigger} React component.\n *\n * @public\n */\nexport interface TooltipTriggerProps extends HTMLAttributes<TooltipTriggerElement> {\n /**\n * Whether the component should ignore user interaction.\n * @default false\n */\n disabled?: TooltipTriggerElementProps['disabled'];\n /**\n * The delay in milliseconds before opening the tooltip on hover.\n * @default 600\n */\n openDelay?: TooltipTriggerElementProps['openDelay'];\n /**\n * The delay in milliseconds before closing the tooltip when hover/focus ends.\n * @default 0\n */\n closeDelay?: TooltipTriggerElementProps['closeDelay'];\n}\n\nfunction TooltipTriggerComponent(props: TooltipTriggerProps, forwardedRef: ForwardedRef<TooltipTriggerElement>) {\n registerTooltipTriggerElement();\n\n const elementRef = useRef<TooltipTriggerElement>(null);\n\n const { closeDelay: p0, disabled: p1, openDelay: p2, ...restProps } = props;\n\n useLayoutEffect(() => {\n const element = elementRef.current as Record<string, unknown> | null;\n if (!element) return;\n Object.assign(element, { closeDelay: p0, disabled: p1, openDelay: p2 });\n });\n\n const mergedRef = useCallback(\n (element: TooltipTriggerElement | 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-tooltip-trigger', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });\n}\n\n/**\n * A React component that renders an `prosekit-tooltip-trigger` custom element.\n *\n * @public\n */\nexport const TooltipTrigger: ForwardRefExoticComponent<TooltipTriggerProps & RefAttributes<TooltipTriggerElement>> = /* @__PURE__ */ forwardRef(TooltipTriggerComponent);\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.0-beta.
|
|
4
|
+
"version": "0.7.0-beta.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "React components and utilities for ProseKit",
|
|
7
7
|
"author": {
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"types": "./dist/prosekit-react-inline-popover.d.ts",
|
|
47
47
|
"default": "./dist/prosekit-react-inline-popover.js"
|
|
48
48
|
},
|
|
49
|
+
"./menu": {
|
|
50
|
+
"types": "./dist/prosekit-react-menu.d.ts",
|
|
51
|
+
"default": "./dist/prosekit-react-menu.js"
|
|
52
|
+
},
|
|
49
53
|
"./popover": {
|
|
50
54
|
"types": "./dist/prosekit-react-popover.d.ts",
|
|
51
55
|
"default": "./dist/prosekit-react-popover.js"
|
|
@@ -68,11 +72,11 @@
|
|
|
68
72
|
"src"
|
|
69
73
|
],
|
|
70
74
|
"dependencies": {
|
|
71
|
-
"@prosemirror-adapter/core": "^0.5.
|
|
72
|
-
"@prosemirror-adapter/react": "^0.5.
|
|
75
|
+
"@prosemirror-adapter/core": "^0.5.3",
|
|
76
|
+
"@prosemirror-adapter/react": "^0.5.3",
|
|
77
|
+
"@prosekit/pm": "^0.1.15",
|
|
73
78
|
"@prosekit/core": "^0.12.0-beta.0",
|
|
74
|
-
"@prosekit/web": "^0.8.0-beta.
|
|
75
|
-
"@prosekit/pm": "^0.1.15"
|
|
79
|
+
"@prosekit/web": "^0.8.0-beta.1"
|
|
76
80
|
},
|
|
77
81
|
"peerDependencies": {
|
|
78
82
|
"react": ">= 18.2.0",
|
|
@@ -89,13 +93,16 @@
|
|
|
89
93
|
"devDependencies": {
|
|
90
94
|
"@types/react": "^19.2.14",
|
|
91
95
|
"@types/react-dom": "^19.2.3",
|
|
92
|
-
"react": "^19.2.
|
|
93
|
-
"react-dom": "^19.2.
|
|
94
|
-
"tsdown": "^0.21.
|
|
96
|
+
"react": "^19.2.5",
|
|
97
|
+
"react-dom": "^19.2.5",
|
|
98
|
+
"tsdown": "^0.21.7",
|
|
95
99
|
"typescript": "~5.9.3",
|
|
100
|
+
"vitest": "^4.1.4",
|
|
101
|
+
"vitest-browser-react": "^2.2.0",
|
|
96
102
|
"@prosekit/config-ts": "0.0.0",
|
|
97
103
|
"@prosekit/config-tsdown": "0.0.0",
|
|
98
|
-
"@prosekit/config-vitest": "0.0.0"
|
|
104
|
+
"@prosekit/config-vitest": "0.0.0",
|
|
105
|
+
"@prosekit/testing": "0.0.0"
|
|
99
106
|
},
|
|
100
107
|
"publishConfig": {
|
|
101
108
|
"dev": {}
|
|
@@ -103,14 +110,15 @@
|
|
|
103
110
|
"dev": {
|
|
104
111
|
"entry": {
|
|
105
112
|
"prosekit-react": "./src/index.ts",
|
|
106
|
-
"prosekit-react-autocomplete": "./src/components/autocomplete/index.
|
|
107
|
-
"prosekit-react-block-handle": "./src/components/block-handle/index.
|
|
108
|
-
"prosekit-react-drop-indicator": "./src/components/drop-indicator/index.
|
|
109
|
-
"prosekit-react-inline-popover": "./src/components/inline-popover/index.
|
|
110
|
-
"prosekit-react-
|
|
111
|
-
"prosekit-react-
|
|
112
|
-
"prosekit-react-
|
|
113
|
-
"prosekit-react-
|
|
113
|
+
"prosekit-react-autocomplete": "./src/components/autocomplete/index.ts",
|
|
114
|
+
"prosekit-react-block-handle": "./src/components/block-handle/index.ts",
|
|
115
|
+
"prosekit-react-drop-indicator": "./src/components/drop-indicator/index.ts",
|
|
116
|
+
"prosekit-react-inline-popover": "./src/components/inline-popover/index.ts",
|
|
117
|
+
"prosekit-react-menu": "./src/components/menu/index.ts",
|
|
118
|
+
"prosekit-react-popover": "./src/components/popover/index.ts",
|
|
119
|
+
"prosekit-react-resizable": "./src/components/resizable/index.ts",
|
|
120
|
+
"prosekit-react-table-handle": "./src/components/table-handle/index.ts",
|
|
121
|
+
"prosekit-react-tooltip": "./src/components/tooltip/index.ts"
|
|
114
122
|
}
|
|
115
123
|
},
|
|
116
124
|
"scripts": {
|
|
@@ -135,6 +143,9 @@
|
|
|
135
143
|
"inline-popover": [
|
|
136
144
|
"./dist/prosekit-react-inline-popover.d.ts"
|
|
137
145
|
],
|
|
146
|
+
"menu": [
|
|
147
|
+
"./dist/prosekit-react-menu.d.ts"
|
|
148
|
+
],
|
|
138
149
|
"popover": [
|
|
139
150
|
"./dist/prosekit-react-popover.d.ts"
|
|
140
151
|
],
|
|
@@ -1,34 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { registerAutocompleteEmptyElement, type AutocompleteEmptyElement } from '@prosekit/web/autocomplete';
|
|
6
|
+
import { createElement, forwardRef, useCallback, useRef, type ForwardedRef, type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from 'react';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props for the {@link AutocompleteEmpty} React component.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface AutocompleteEmptyProps extends HTMLAttributes<AutocompleteEmptyElement> {}
|
|
14
|
+
|
|
15
|
+
function AutocompleteEmptyComponent(props: AutocompleteEmptyProps, forwardedRef: ForwardedRef<AutocompleteEmptyElement>) {
|
|
16
|
+
registerAutocompleteEmptyElement();
|
|
17
|
+
|
|
18
|
+
const elementRef = useRef<AutocompleteEmptyElement>(null);
|
|
19
|
+
|
|
20
|
+
const { ...restProps } = props;
|
|
21
|
+
|
|
22
|
+
const mergedRef = useCallback(
|
|
23
|
+
(element: AutocompleteEmptyElement | null) => {
|
|
24
|
+
elementRef.current = element;
|
|
25
|
+
if (typeof forwardedRef === 'function') {
|
|
26
|
+
forwardedRef(element);
|
|
27
|
+
} else if (forwardedRef) {
|
|
28
|
+
forwardedRef.current = element;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
[forwardedRef],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return createElement('prosekit-autocomplete-empty', { ...restProps, ref: mergedRef, suppressHydrationWarning: true });
|
|
35
|
+
}
|
|
16
36
|
|
|
17
37
|
/**
|
|
18
|
-
*
|
|
38
|
+
* A React component that renders an `prosekit-autocomplete-empty` custom element.
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
19
41
|
*/
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
export const AutocompleteEmpty: ForwardRefExoticComponent<
|
|
23
|
-
AutocompleteEmptyProps &
|
|
24
|
-
RefAttributes<AutocompleteEmptyElement> &
|
|
25
|
-
HTMLAttributes<AutocompleteEmptyElement>
|
|
26
|
-
> = createComponent<
|
|
27
|
-
AutocompleteEmptyProps,
|
|
28
|
-
AutocompleteEmptyElement
|
|
29
|
-
>(
|
|
30
|
-
'prosekit-autocomplete-empty',
|
|
31
|
-
'AutocompleteEmpty',
|
|
32
|
-
Object.keys(autocompleteEmptyProps),
|
|
33
|
-
Object.keys(autocompleteEmptyEvents),
|
|
34
|
-
)
|
|
42
|
+
export const AutocompleteEmpty: ForwardRefExoticComponent<AutocompleteEmptyProps & RefAttributes<AutocompleteEmptyElement>> = /* @__PURE__ */ forwardRef(AutocompleteEmptyComponent);
|