@prosekit/solid 0.7.0-beta.0 → 0.7.0-beta.2
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-solid-autocomplete.d.ts +225 -19
- package/dist/prosekit-solid-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-solid-autocomplete.js +204 -9
- package/dist/prosekit-solid-autocomplete.js.map +1 -1
- package/dist/prosekit-solid-block-handle.d.ts +209 -15
- package/dist/prosekit-solid-block-handle.d.ts.map +1 -1
- package/dist/prosekit-solid-block-handle.js +160 -7
- package/dist/prosekit-solid-block-handle.js.map +1 -1
- package/dist/prosekit-solid-drop-indicator.d.ts +26 -7
- package/dist/prosekit-solid-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-solid-drop-indicator.js +29 -3
- package/dist/prosekit-solid-drop-indicator.js.map +1 -1
- package/dist/prosekit-solid-inline-popover.d.ts +203 -9
- package/dist/prosekit-solid-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-solid-inline-popover.js +128 -5
- package/dist/prosekit-solid-inline-popover.js.map +1 -1
- package/dist/prosekit-solid-menu.d.ts +287 -0
- package/dist/prosekit-solid-menu.d.ts.map +1 -0
- package/dist/prosekit-solid-menu.js +241 -0
- package/dist/prosekit-solid-menu.js.map +1 -0
- package/dist/prosekit-solid-popover.d.ts +226 -15
- package/dist/prosekit-solid-popover.d.ts.map +1 -1
- package/dist/prosekit-solid-popover.js +165 -7
- package/dist/prosekit-solid-popover.js.map +1 -1
- package/dist/prosekit-solid-resizable.d.ts +55 -13
- package/dist/prosekit-solid-resizable.d.ts.map +1 -1
- package/dist/prosekit-solid-resizable.js +69 -7
- package/dist/prosekit-solid-resizable.js.map +1 -1
- package/dist/prosekit-solid-table-handle.d.ts +446 -39
- package/dist/prosekit-solid-table-handle.d.ts.map +1 -1
- package/dist/prosekit-solid-table-handle.js +334 -19
- package/dist/prosekit-solid-table-handle.js.map +1 -1
- package/dist/prosekit-solid-tooltip.d.ts +210 -15
- package/dist/prosekit-solid-tooltip.d.ts.map +1 -1
- package/dist/prosekit-solid-tooltip.js +149 -7
- package/dist/prosekit-solid-tooltip.js.map +1 -1
- package/dist/prosekit-solid.d.ts +23 -2
- package/dist/prosekit-solid.d.ts.map +1 -1
- package/dist/prosekit-solid.js +37 -6
- package/dist/prosekit-solid.js.map +1 -1
- package/package.json +28 -16
- package/src/components/autocomplete/autocomplete-empty.gen.ts +22 -24
- package/src/components/autocomplete/autocomplete-item.gen.ts +82 -26
- package/src/components/autocomplete/autocomplete-popup.gen.ts +78 -0
- package/src/components/autocomplete/autocomplete-positioner.gen.ts +167 -0
- package/src/components/autocomplete/autocomplete-root.gen.ts +110 -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 +54 -26
- package/src/components/block-handle/block-handle-draggable.gen.ts +54 -26
- package/src/components/block-handle/block-handle-popup.gen.ts +27 -0
- package/src/components/block-handle/block-handle-positioner.gen.ts +185 -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 +60 -26
- 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 +27 -0
- package/src/components/inline-popover/inline-popover-positioner.gen.ts +191 -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 +53 -0
- package/src/components/menu/menu-positioner.gen.ts +192 -0
- package/src/components/menu/menu-root.gen.ts +86 -0
- package/src/components/menu/menu-submenu-root.gen.ts +27 -0
- package/src/components/menu/menu-submenu-trigger.gen.ts +27 -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 +27 -0
- package/src/components/popover/popover-positioner.gen.ts +192 -0
- package/src/components/popover/popover-root.gen.ts +90 -26
- package/src/components/popover/popover-trigger.gen.ts +90 -26
- 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 +49 -26
- package/src/components/resizable/resizable-root.gen.ts +89 -26
- 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 +61 -0
- package/src/components/table-handle/table-handle-column-menu-trigger.gen.ts +55 -0
- package/src/components/table-handle/table-handle-column-popup.gen.ts +27 -0
- package/src/components/table-handle/table-handle-column-positioner.gen.ts +196 -0
- package/src/components/table-handle/table-handle-drag-preview.gen.ts +52 -26
- package/src/components/table-handle/table-handle-drop-indicator.gen.ts +52 -26
- package/src/components/table-handle/table-handle-root.gen.ts +54 -26
- package/src/components/table-handle/table-handle-row-menu-root.gen.ts +61 -0
- package/src/components/table-handle/table-handle-row-menu-trigger.gen.ts +55 -0
- package/src/components/table-handle/table-handle-row-popup.gen.ts +27 -0
- package/src/components/table-handle/table-handle-row-positioner.gen.ts +196 -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 +27 -0
- package/src/components/tooltip/tooltip-positioner.gen.ts +192 -0
- package/src/components/tooltip/tooltip-root.gen.ts +83 -26
- package/src/components/tooltip/tooltip-trigger.gen.ts +58 -26
- package/src/extensions/solid-mark-view.ts +13 -5
- package/src/extensions/solid-node-view.spec.tsx +141 -0
- package/src/extensions/solid-node-view.ts +28 -5
- package/dist/create-component.js +0 -41
- 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/dist/types.d.ts +0 -26
- package/dist/types.d.ts.map +0 -1
- package/src/components/autocomplete/autocomplete-list.gen.ts +0 -29
- package/src/components/autocomplete/autocomplete-popover.gen.ts +0 -29
- package/src/components/block-handle/block-handle-popover.gen.ts +0 -29
- package/src/components/create-component.ts +0 -60
- package/src/components/create-props.ts +0 -13
- package/src/components/inline-popover/inline-popover.gen.ts +0 -29
- package/src/components/popover/popover-content.gen.ts +0 -29
- package/src/components/table-handle/table-handle-column-root.gen.ts +0 -29
- package/src/components/table-handle/table-handle-column-trigger.gen.ts +0 -29
- package/src/components/table-handle/table-handle-popover-content.gen.ts +0 -29
- package/src/components/table-handle/table-handle-popover-item.gen.ts +0 -29
- package/src/components/table-handle/table-handle-row-root.gen.ts +0 -29
- package/src/components/table-handle/table-handle-row-trigger.gen.ts +0 -29
- package/src/components/tooltip/tooltip-content.gen.ts +0 -29
|
@@ -1,28 +1,223 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Component } from "solid-js";
|
|
4
|
-
import { TooltipContentElement, TooltipContentEvents, TooltipContentProps as TooltipContentProps$1, TooltipRootElement, TooltipRootEvents, TooltipRootProps as TooltipRootProps$1, TooltipTriggerElement, TooltipTriggerEvents, TooltipTriggerProps as TooltipTriggerProps$1 } from "@prosekit/web/tooltip";
|
|
1
|
+
import { Component, JSX } from "solid-js";
|
|
2
|
+
import { OpenChangeEvent, TooltipPopupElement, TooltipPositionerElement, TooltipPositionerProps as TooltipPositionerProps$1, TooltipRootElement, TooltipRootEvents, TooltipRootProps as TooltipRootProps$1, TooltipTriggerElement, TooltipTriggerProps as TooltipTriggerProps$1 } from "@prosekit/web/tooltip";
|
|
5
3
|
|
|
6
|
-
//#region src/components/tooltip/tooltip-
|
|
4
|
+
//#region src/components/tooltip/tooltip-popup.gen.d.ts
|
|
7
5
|
/**
|
|
8
|
-
* Props for the {@link
|
|
6
|
+
* Props for the {@link TooltipPopup} Solid component.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
9
|
*/
|
|
10
|
-
interface
|
|
11
|
-
|
|
10
|
+
interface TooltipPopupProps extends JSX.HTMLAttributes<TooltipPopupElement> {}
|
|
11
|
+
/**
|
|
12
|
+
* A Solid component that renders an `prosekit-tooltip-popup` custom element.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
declare const TooltipPopup: Component<TooltipPopupProps>;
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/tooltip/tooltip-positioner.gen.d.ts
|
|
19
|
+
/**
|
|
20
|
+
* Props for the {@link TooltipPositioner} Solid component.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
interface TooltipPositionerProps extends JSX.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 Solid component that renders an `prosekit-tooltip-positioner` custom element.
|
|
155
|
+
*
|
|
156
|
+
* @public
|
|
157
|
+
*/
|
|
158
|
+
declare const TooltipPositioner: Component<TooltipPositionerProps>;
|
|
12
159
|
//#endregion
|
|
13
160
|
//#region src/components/tooltip/tooltip-root.gen.d.ts
|
|
14
161
|
/**
|
|
15
|
-
* Props for the {@link TooltipRoot} component.
|
|
162
|
+
* Props for the {@link TooltipRoot} Solid component.
|
|
163
|
+
*
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
166
|
+
interface TooltipRootProps extends JSX.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 Solid component that renders an `prosekit-tooltip-root` custom element.
|
|
187
|
+
*
|
|
188
|
+
* @public
|
|
16
189
|
*/
|
|
17
|
-
|
|
18
|
-
declare const TooltipRoot: Component<PropsWithElement<TooltipRootProps, TooltipRootElement>>;
|
|
190
|
+
declare const TooltipRoot: Component<TooltipRootProps>;
|
|
19
191
|
//#endregion
|
|
20
192
|
//#region src/components/tooltip/tooltip-trigger.gen.d.ts
|
|
21
193
|
/**
|
|
22
|
-
* Props for the {@link TooltipTrigger} component.
|
|
194
|
+
* Props for the {@link TooltipTrigger} Solid component.
|
|
195
|
+
*
|
|
196
|
+
* @public
|
|
197
|
+
*/
|
|
198
|
+
interface TooltipTriggerProps extends JSX.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 Solid component that renders an `prosekit-tooltip-trigger` custom element.
|
|
217
|
+
*
|
|
218
|
+
* @public
|
|
23
219
|
*/
|
|
24
|
-
|
|
25
|
-
declare const TooltipTrigger: Component<PropsWithElement<TooltipTriggerProps, TooltipTriggerElement>>;
|
|
220
|
+
declare const TooltipTrigger: Component<TooltipTriggerProps>;
|
|
26
221
|
//#endregion
|
|
27
|
-
export {
|
|
222
|
+
export { OpenChangeEvent, TooltipPopup, type TooltipPopupProps, TooltipPositioner, type TooltipPositionerProps, TooltipRoot, type TooltipRootEvents, type TooltipRootProps, TooltipTrigger, type TooltipTriggerProps };
|
|
28
223
|
//# sourceMappingURL=prosekit-solid-tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-tooltip.d.ts","names":[],"sources":["../src/components/tooltip/tooltip-
|
|
1
|
+
{"version":3,"file":"prosekit-solid-tooltip.d.ts","names":[],"sources":["../src/components/tooltip/tooltip-popup.gen.ts","../src/components/tooltip/t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AA,EAAO,iBAAA;AAAA;;;;;;cAQZ,WAAA,EAAa,SAAA,CAAU,gBAAA;;;;;;;;UCzBnB,mBAAA,SAA4B,GAAA,CAAI,cAAA,CAAe,qBAAA;EHDiB;;AAOjF;;EGDE,QAAA,GAAW,qBAAA;EHCc;;;;EGIzB,SAAA,GAAY,qBAAA;EFVG;;;;EEef,UAAA,GAAa,qBAAA;AAAA;;;;;;cAQF,cAAA,EAAgB,SAAA,CAAU,mBAAA"}
|
|
@@ -1,14 +1,156 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { createEffect, createSignal, mergeProps, splitProps } from "solid-js";
|
|
2
|
+
import h from "solid-js/h";
|
|
3
|
+
import { OpenChangeEvent, registerTooltipPopupElement, registerTooltipPositionerElement, registerTooltipRootElement, registerTooltipTriggerElement } from "@prosekit/web/tooltip";
|
|
4
|
+
//#region src/components/tooltip/tooltip-popup.gen.ts
|
|
5
|
+
/**
|
|
6
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A Solid component that renders an `prosekit-tooltip-popup` custom element.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
const TooltipPopup = (props) => {
|
|
14
|
+
registerTooltipPopupElement();
|
|
15
|
+
const restProps = props;
|
|
16
|
+
return () => h("prosekit-tooltip-popup", restProps);
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/tooltip/tooltip-positioner.gen.ts
|
|
20
|
+
/**
|
|
21
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* A Solid component that renders an `prosekit-tooltip-positioner` custom element.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
const TooltipPositioner = (props) => {
|
|
29
|
+
registerTooltipPositionerElement();
|
|
30
|
+
const [getElement, setElement] = createSignal(null);
|
|
31
|
+
const [elementProps, restProps] = splitProps(props, [
|
|
32
|
+
"altBoundary",
|
|
33
|
+
"autoUpdate",
|
|
34
|
+
"boundary",
|
|
35
|
+
"elementContext",
|
|
36
|
+
"fitViewport",
|
|
37
|
+
"flip",
|
|
38
|
+
"hide",
|
|
39
|
+
"hoist",
|
|
40
|
+
"inline",
|
|
41
|
+
"offset",
|
|
42
|
+
"overflowPadding",
|
|
43
|
+
"overlap",
|
|
44
|
+
"placement",
|
|
45
|
+
"rootBoundary",
|
|
46
|
+
"sameHeight",
|
|
47
|
+
"sameWidth",
|
|
48
|
+
"shift",
|
|
49
|
+
"strategy"
|
|
50
|
+
]);
|
|
51
|
+
createEffect(() => {
|
|
52
|
+
const element = getElement();
|
|
53
|
+
if (!element) return;
|
|
54
|
+
Object.assign(element, {
|
|
55
|
+
altBoundary: elementProps.altBoundary,
|
|
56
|
+
autoUpdate: elementProps.autoUpdate,
|
|
57
|
+
boundary: elementProps.boundary,
|
|
58
|
+
elementContext: elementProps.elementContext,
|
|
59
|
+
fitViewport: elementProps.fitViewport,
|
|
60
|
+
flip: elementProps.flip,
|
|
61
|
+
hide: elementProps.hide,
|
|
62
|
+
hoist: elementProps.hoist,
|
|
63
|
+
inline: elementProps.inline,
|
|
64
|
+
offset: elementProps.offset,
|
|
65
|
+
overflowPadding: elementProps.overflowPadding,
|
|
66
|
+
overlap: elementProps.overlap,
|
|
67
|
+
placement: elementProps.placement,
|
|
68
|
+
rootBoundary: elementProps.rootBoundary,
|
|
69
|
+
sameHeight: elementProps.sameHeight,
|
|
70
|
+
sameWidth: elementProps.sameWidth,
|
|
71
|
+
shift: elementProps.shift,
|
|
72
|
+
strategy: elementProps.strategy
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
return () => h("prosekit-tooltip-positioner", mergeProps(restProps, { ref: (el) => {
|
|
76
|
+
setElement(el);
|
|
77
|
+
} }));
|
|
78
|
+
};
|
|
5
79
|
//#endregion
|
|
6
80
|
//#region src/components/tooltip/tooltip-root.gen.ts
|
|
7
|
-
|
|
81
|
+
/**
|
|
82
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
83
|
+
*/
|
|
84
|
+
/**
|
|
85
|
+
* A Solid component that renders an `prosekit-tooltip-root` custom element.
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
const TooltipRoot = (props) => {
|
|
90
|
+
registerTooltipRootElement();
|
|
91
|
+
const [getElement, setElement] = createSignal(null);
|
|
92
|
+
const handlers = [];
|
|
93
|
+
const [elementProps, eventHandlers, restProps] = splitProps(props, [
|
|
94
|
+
"defaultOpen",
|
|
95
|
+
"disabled",
|
|
96
|
+
"open"
|
|
97
|
+
], ["onOpenChange"]);
|
|
98
|
+
createEffect(() => {
|
|
99
|
+
const element = getElement();
|
|
100
|
+
if (!element) return;
|
|
101
|
+
Object.assign(element, {
|
|
102
|
+
defaultOpen: elementProps.defaultOpen,
|
|
103
|
+
disabled: elementProps.disabled,
|
|
104
|
+
open: elementProps.open
|
|
105
|
+
});
|
|
106
|
+
handlers.length = 0;
|
|
107
|
+
handlers.push(eventHandlers.onOpenChange);
|
|
108
|
+
});
|
|
109
|
+
createEffect(() => {
|
|
110
|
+
const element = getElement();
|
|
111
|
+
if (!element) return;
|
|
112
|
+
const ac = new AbortController();
|
|
113
|
+
for (const [index, eventName] of ["openChange"].entries()) element.addEventListener(eventName, (event) => {
|
|
114
|
+
handlers[index]?.(event);
|
|
115
|
+
}, { signal: ac.signal });
|
|
116
|
+
return () => ac.abort();
|
|
117
|
+
});
|
|
118
|
+
return () => h("prosekit-tooltip-root", mergeProps(restProps, { ref: (el) => {
|
|
119
|
+
setElement(el);
|
|
120
|
+
} }));
|
|
121
|
+
};
|
|
8
122
|
//#endregion
|
|
9
123
|
//#region src/components/tooltip/tooltip-trigger.gen.ts
|
|
10
|
-
|
|
124
|
+
/**
|
|
125
|
+
* This file is auto-generated by the "@aria-ui/cli" tool. Do not edit this file directly.
|
|
126
|
+
*/
|
|
127
|
+
/**
|
|
128
|
+
* A Solid component that renders an `prosekit-tooltip-trigger` custom element.
|
|
129
|
+
*
|
|
130
|
+
* @public
|
|
131
|
+
*/
|
|
132
|
+
const TooltipTrigger = (props) => {
|
|
133
|
+
registerTooltipTriggerElement();
|
|
134
|
+
const [getElement, setElement] = createSignal(null);
|
|
135
|
+
const [elementProps, restProps] = splitProps(props, [
|
|
136
|
+
"closeDelay",
|
|
137
|
+
"disabled",
|
|
138
|
+
"openDelay"
|
|
139
|
+
]);
|
|
140
|
+
createEffect(() => {
|
|
141
|
+
const element = getElement();
|
|
142
|
+
if (!element) return;
|
|
143
|
+
Object.assign(element, {
|
|
144
|
+
closeDelay: elementProps.closeDelay,
|
|
145
|
+
disabled: elementProps.disabled,
|
|
146
|
+
openDelay: elementProps.openDelay
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
return () => h("prosekit-tooltip-trigger", mergeProps(restProps, { ref: (el) => {
|
|
150
|
+
setElement(el);
|
|
151
|
+
} }));
|
|
152
|
+
};
|
|
11
153
|
//#endregion
|
|
12
|
-
export {
|
|
154
|
+
export { OpenChangeEvent, TooltipPopup, TooltipPositioner, TooltipRoot, TooltipTrigger };
|
|
13
155
|
|
|
14
156
|
//# sourceMappingURL=prosekit-solid-tooltip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid-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 { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types.ts'\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: Component<PropsWithElement<\n TooltipContentProps,\n TooltipContentElement\n>> = createComponent<\n TooltipContentProps,\n TooltipContentElement\n>(\n 'prosekit-tooltip-content', \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 { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types.ts'\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: Component<PropsWithElement<\n TooltipRootProps,\n TooltipRootElement\n>> = createComponent<\n TooltipRootProps,\n TooltipRootElement\n>(\n 'prosekit-tooltip-root', \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 { Component } from 'solid-js'\n\nimport type { PropsWithElement } from '../../types.ts'\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: Component<PropsWithElement<\n TooltipTriggerProps,\n TooltipTriggerElement\n>> = createComponent<\n TooltipTriggerProps,\n TooltipTriggerElement\n>(\n 'prosekit-tooltip-trigger', \n Object.keys(tooltipTriggerProps),\n Object.keys(tooltipTriggerEvents),\n)\n"],"mappings":";;;AAkBA,MAAa,iBAGR,gBAIH,4BACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC;;;ACVD,MAAa,cAGR,gBAIH,yBACA,OAAO,KAAK,iBAAiB,EAC7B,OAAO,KAAK,kBAAkB,CAC/B;;;ACVD,MAAa,iBAGR,gBAIH,4BACA,OAAO,KAAK,oBAAoB,EAChC,OAAO,KAAK,qBAAqB,CAClC"}
|
|
1
|
+
{"version":3,"file":"prosekit-solid-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 type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link TooltipPopup} Solid component.\n *\n * @public\n */\nexport interface TooltipPopupProps extends JSX.HTMLAttributes<TooltipPopupElement> {}\n\n/**\n * A Solid component that renders an `prosekit-tooltip-popup` custom element.\n *\n * @public\n */\nexport const TooltipPopup: Component<TooltipPopupProps> = (props): any => {\n registerTooltipPopupElement();\n\n const restProps = props;\n\n return () => h('prosekit-tooltip-popup', restProps);\n};\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 { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link TooltipPositioner} Solid component.\n *\n * @public\n */\nexport interface TooltipPositionerProps extends JSX.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\n/**\n * A Solid component that renders an `prosekit-tooltip-positioner` custom element.\n *\n * @public\n */\nexport const TooltipPositioner: Component<TooltipPositionerProps> = (props): any => {\n registerTooltipPositionerElement();\n\n const [getElement, setElement] = createSignal<TooltipPositionerElement | null>(null);\n\n const [elementProps, restProps] = splitProps(props, ['altBoundary', 'autoUpdate', 'boundary', 'elementContext', 'fitViewport', 'flip', 'hide', 'hoist', 'inline', 'offset', 'overflowPadding', 'overlap', 'placement', 'rootBoundary', 'sameHeight', 'sameWidth', 'shift', 'strategy']);\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, {\n altBoundary: elementProps.altBoundary,\n autoUpdate: elementProps.autoUpdate,\n boundary: elementProps.boundary,\n elementContext: elementProps.elementContext,\n fitViewport: elementProps.fitViewport,\n flip: elementProps.flip,\n hide: elementProps.hide,\n hoist: elementProps.hoist,\n inline: elementProps.inline,\n offset: elementProps.offset,\n overflowPadding: elementProps.overflowPadding,\n overlap: elementProps.overlap,\n placement: elementProps.placement,\n rootBoundary: elementProps.rootBoundary,\n sameHeight: elementProps.sameHeight,\n sameWidth: elementProps.sameWidth,\n shift: elementProps.shift,\n strategy: elementProps.strategy,\n });\n });\n\n return () =>\n h(\n 'prosekit-tooltip-positioner',\n mergeProps(restProps, {\n ref: (el: TooltipPositionerElement | null) => {\n setElement(el);\n },\n }),\n );\n};\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 TooltipRootEvents, type TooltipRootProps as TooltipRootElementProps } from '@prosekit/web/tooltip';\nimport { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link TooltipRoot} Solid component.\n *\n * @public\n */\nexport interface TooltipRootProps extends JSX.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\n/**\n * A Solid component that renders an `prosekit-tooltip-root` custom element.\n *\n * @public\n */\nexport const TooltipRoot: Component<TooltipRootProps> = (props): any => {\n registerTooltipRootElement();\n\n const [getElement, setElement] = createSignal<TooltipRootElement | null>(null);\n const handlers: Array<((event: any) => void) | undefined> = [];\n\n const [elementProps, eventHandlers, restProps] = splitProps(props, ['defaultOpen', 'disabled', 'open'], ['onOpenChange']);\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, { defaultOpen: elementProps.defaultOpen, disabled: elementProps.disabled, open: elementProps.open });\n\n handlers.length = 0;\n handlers.push(eventHandlers.onOpenChange);\n });\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n const ac = new AbortController();\n for (const [index, eventName] of ['openChange'].entries()) {\n element.addEventListener(\n eventName,\n (event) => {\n handlers[index]?.(event);\n },\n { signal: ac.signal },\n );\n }\n return () => ac.abort();\n });\n\n return () =>\n h(\n 'prosekit-tooltip-root',\n mergeProps(restProps, {\n ref: (el: TooltipRootElement | null) => {\n setElement(el);\n },\n }),\n );\n};\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 { createEffect, createSignal, mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX } from 'solid-js';\nimport h from 'solid-js/h';\n\n/**\n * Props for the {@link TooltipTrigger} Solid component.\n *\n * @public\n */\nexport interface TooltipTriggerProps extends JSX.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\n/**\n * A Solid component that renders an `prosekit-tooltip-trigger` custom element.\n *\n * @public\n */\nexport const TooltipTrigger: Component<TooltipTriggerProps> = (props): any => {\n registerTooltipTriggerElement();\n\n const [getElement, setElement] = createSignal<TooltipTriggerElement | null>(null);\n\n const [elementProps, restProps] = splitProps(props, ['closeDelay', 'disabled', 'openDelay']);\n\n createEffect(() => {\n const element = getElement();\n if (!element) return;\n\n Object.assign(element, { closeDelay: elementProps.closeDelay, disabled: elementProps.disabled, openDelay: elementProps.openDelay });\n });\n\n return () =>\n h(\n 'prosekit-tooltip-trigger',\n mergeProps(restProps, {\n ref: (el: TooltipTriggerElement | null) => {\n setElement(el);\n },\n }),\n );\n};\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAa,gBAA8C,UAAe;AACxE,8BAA6B;CAE7B,MAAM,YAAY;AAElB,cA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AAS,KAAK,cAAc,aAAa;GACzC;AAEF,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;EAEd,MAAM,KAAK,IAAI,iBAAiB;AAChC,OAAK,MAAM,CAAC,OAAO,cAAc,CAAC,aAAa,CAAC,SAAS,CACvD,SAAQ,iBACN,YACC,UAAU;AACT,YAAS,SAAS,MAAM;KAE1B,EAAE,QAAQ,GAAG,QAAQ,CACtB;AAEH,eAAa,GAAG,OAAO;GACvB;AAEF,cACE,EACE,yBACA,WAAW,WAAW,EACpB,MAAM,OAAkC;AACtC,aAAW,GAAG;IAEjB,CAAC,CACH;;;;;;;;;;;;AC7CL,MAAa,kBAAkD,UAAe;AAC5E,gCAA+B;CAE/B,MAAM,CAAC,YAAY,cAAc,aAA2C,KAAK;CAEjF,MAAM,CAAC,cAAc,aAAa,WAAW,OAAO;EAAC;EAAc;EAAY;EAAY,CAAC;AAE5F,oBAAmB;EACjB,MAAM,UAAU,YAAY;AAC5B,MAAI,CAAC,QAAS;AAEd,SAAO,OAAO,SAAS;GAAE,YAAY,aAAa;GAAY,UAAU,aAAa;GAAU,WAAW,aAAa;GAAW,CAAC;GACnI;AAEF,cACE,EACE,4BACA,WAAW,WAAW,EACpB,MAAM,OAAqC;AACzC,aAAW,GAAG;IAEjB,CAAC,CACH"}
|
package/dist/prosekit-solid.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Accessor, Component, ParentProps } from "solid-js";
|
|
1
|
+
import { Accessor, Component, JSX, JSXElement, ParentProps } from "solid-js";
|
|
3
2
|
import { Editor, Extension, Keymap, Priority } from "@prosekit/core";
|
|
4
3
|
import { MarkViewContextProps, NodeViewContextProps } from "@prosemirror-adapter/solid";
|
|
5
4
|
import { CoreMarkViewUserOptions, CoreNodeViewUserOptions } from "@prosemirror-adapter/core";
|
|
@@ -71,6 +70,28 @@ interface SolidNodeViewOptions extends CoreNodeViewUserOptions<SolidNodeViewComp
|
|
|
71
70
|
*/
|
|
72
71
|
declare function defineSolidNodeView(options: SolidNodeViewOptions): Extension;
|
|
73
72
|
//#endregion
|
|
73
|
+
//#region src/types.d.ts
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
type PropsWithClass<P = unknown> = P & {
|
|
78
|
+
class?: string | undefined;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
type PropsWithChildren<P = unknown> = P & {
|
|
84
|
+
children?: JSXElement | undefined;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
type PropsWithElement<Props extends object, CustomElement extends HTMLElement> = Props & JSX.HTMLAttributes<CustomElement>;
|
|
90
|
+
/**
|
|
91
|
+
* T or a reactive/non-reactive function returning T
|
|
92
|
+
*/
|
|
93
|
+
type MaybeAccessor<T> = T | Accessor<T>;
|
|
94
|
+
//#endregion
|
|
74
95
|
//#region src/hooks/use-extension.d.ts
|
|
75
96
|
interface UseExtensionOptions {
|
|
76
97
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid.d.ts","names":[],"sources":["../src/components/prosekit.ts","../src/extensions/solid-mark-view.ts","../src/extensions/solid-node-view.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-editor.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"prosekit-solid.d.ts","names":[],"sources":["../src/components/prosekit.ts","../src/extensions/solid-mark-view.ts","../src/extensions/solid-node-view.ts","../src/types.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-editor.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"mappings":";;;;;;;;KAOY,aAAA,GAAgB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AAA,GAAS,MAAA,EAAQ,MAAA,CAAO,CAAA,MAAO,OAAA,EAC/B,OAAA,GAAU,uBAAA,CAAwB,CAAA,IACjC,QAAA,CAAS,OAAA;;;;;;;;iBC3BI,SAAA,WAAoB,SAAA,OAAA,CAAiB,OAAA;;APHrD;;;;;EOUE,MAAA;AAAA,UACQ,MAAA,CAAO,CAAA;;;iBCdD,SAAA,CAAU,MAAA,QAAc,MAAA,EAAQ,OAAA,GAAU,mBAAA;;;;;;;;iBCM1C,cAAA,CACd,OAAA,GAAU,KAAA,EAAO,WAAA,WACjB,OAAA,GAAU,mBAAA"}
|
package/dist/prosekit-solid.js
CHANGED
|
@@ -18,9 +18,17 @@ var ProseKitSolidMarkView = class extends AbstractSolidMarkView {
|
|
|
18
18
|
const getProps = this.context;
|
|
19
19
|
return createComponent(Portal, {
|
|
20
20
|
mount: this.dom,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
children: createComponent(UserComponent, {
|
|
22
|
+
get contentRef() {
|
|
23
|
+
return getProps().contentRef;
|
|
24
|
+
},
|
|
25
|
+
get view() {
|
|
26
|
+
return getProps().view;
|
|
27
|
+
},
|
|
28
|
+
get mark() {
|
|
29
|
+
return getProps().mark;
|
|
30
|
+
}
|
|
31
|
+
}),
|
|
24
32
|
ref: hidePortalDiv
|
|
25
33
|
});
|
|
26
34
|
};
|
|
@@ -57,9 +65,32 @@ var ProseKitSolidNodeView = class extends AbstractSolidNodeView {
|
|
|
57
65
|
const getProps = this.context;
|
|
58
66
|
return createComponent(Portal, {
|
|
59
67
|
mount: this.dom,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
68
|
+
children: createComponent(UserComponent, {
|
|
69
|
+
get contentRef() {
|
|
70
|
+
return getProps().contentRef;
|
|
71
|
+
},
|
|
72
|
+
get view() {
|
|
73
|
+
return getProps().view;
|
|
74
|
+
},
|
|
75
|
+
get getPos() {
|
|
76
|
+
return getProps().getPos;
|
|
77
|
+
},
|
|
78
|
+
get setAttrs() {
|
|
79
|
+
return getProps().setAttrs;
|
|
80
|
+
},
|
|
81
|
+
get node() {
|
|
82
|
+
return getProps().node;
|
|
83
|
+
},
|
|
84
|
+
get selected() {
|
|
85
|
+
return getProps().selected;
|
|
86
|
+
},
|
|
87
|
+
get decorations() {
|
|
88
|
+
return getProps().decorations;
|
|
89
|
+
},
|
|
90
|
+
get innerDecorations() {
|
|
91
|
+
return getProps().innerDecorations;
|
|
92
|
+
}
|
|
93
|
+
}),
|
|
63
94
|
ref: hidePortalDiv
|
|
64
95
|
});
|
|
65
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prosekit-solid.js","names":[],"sources":["../src/extensions/helpers.ts","../src/extensions/solid-mark-view.ts","../src/extensions/solid-node-view.ts","../src/utils/to-value.ts","../src/hooks/use-editor-extension.ts","../src/components/view-renderer.ts","../src/components/prosekit.ts","../src/hooks/use-priority-extension.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"sourcesContent":["export function hidePortalDiv(el: HTMLElement): void {\n el.style.display = 'contents'\n el.dataset.solidPortal = 'true'\n}\n","import { defineMarkViewComponent, defineMarkViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractSolidMarkView,\n buildSolidMarkViewCreator,\n type MarkViewContextProps,\n type SolidRendererResult,\n} from '@prosemirror-adapter/solid'\nimport { createComponent, type Component, type JSX } from 'solid-js'\nimport { Portal } from 'solid-js/web'\n\nimport { hidePortalDiv } from './helpers.ts'\n\n/**\n * @public\n */\nexport interface SolidMarkViewProps extends MarkViewContextProps {}\n\n/**\n * @public\n */\nexport type SolidMarkViewComponent = Component<SolidMarkViewProps>\n\n/**\n * Options for {@link defineSolidMarkView}.\n *\n * @public\n */\nexport interface SolidMarkViewOptions extends CoreMarkViewUserOptions<SolidMarkViewComponent> {\n /**\n * The name of the mark type.\n */\n name: string\n}\n\nclass ProseKitSolidMarkView extends AbstractSolidMarkView<SolidMarkViewComponent> {\n render = (): JSX.Element => {\n const UserComponent = this.component\n const getProps = this.context\n return createComponent(Portal, {\n mount: this.dom,\n get children() {\n const props: MarkViewContextProps = getProps()\n return createComponent(UserComponent, props)\n },\n ref: hidePortalDiv,\n })\n }\n}\n\n/**\n * @internal\n */\nexport function defineSolidMarkViewFactory(\n renderSolidRenderer: SolidRendererResult['renderSolidRenderer'],\n removeSolidRenderer: SolidRendererResult['removeSolidRenderer'],\n): Extension {\n const factory = buildSolidMarkViewCreator(renderSolidRenderer, removeSolidRenderer, ProseKitSolidMarkView)\n return defineMarkViewFactory<SolidMarkViewOptions>({\n group: 'solid',\n factory,\n })\n}\n\n/**\n * Defines a mark view using a Solid component.\n *\n * @public\n */\nexport function defineSolidMarkView(options: SolidMarkViewOptions): Extension {\n return defineMarkViewComponent<SolidMarkViewOptions>({\n group: 'solid',\n name: options.name,\n args: options,\n })\n}\n","import { defineNodeViewComponent, defineNodeViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractSolidNodeView,\n buildSolidNodeViewCreator,\n type NodeViewContextProps,\n type SolidRendererResult,\n} from '@prosemirror-adapter/solid'\nimport { createComponent, type Component, type JSX } from 'solid-js'\nimport { Portal } from 'solid-js/web'\n\nimport { hidePortalDiv } from './helpers.ts'\n\n/**\n * @public\n */\nexport interface SolidNodeViewProps extends NodeViewContextProps {}\n\n/**\n * @public\n */\nexport type SolidNodeViewComponent = Component<SolidNodeViewProps>\n\n/**\n * Options for {@link defineSolidNodeView}.\n *\n * @public\n */\nexport interface SolidNodeViewOptions extends CoreNodeViewUserOptions<SolidNodeViewComponent> {\n /**\n * The name of the node type.\n */\n name: string\n}\n\nclass ProseKitSolidNodeView extends AbstractSolidNodeView<SolidNodeViewComponent> {\n render = (): JSX.Element => {\n const UserComponent = this.component\n const getProps = this.context\n return createComponent(Portal, {\n mount: this.dom,\n get children() {\n const props: SolidNodeViewProps = getProps()\n return createComponent(UserComponent, props)\n },\n ref: hidePortalDiv,\n })\n }\n}\n\n/**\n * @internal\n */\nexport function defineSolidNodeViewFactory(\n renderSolidRenderer: SolidRendererResult['renderSolidRenderer'],\n removeSolidRenderer: SolidRendererResult['removeSolidRenderer'],\n): Extension {\n const factory = buildSolidNodeViewCreator(renderSolidRenderer, removeSolidRenderer, ProseKitSolidNodeView)\n return defineNodeViewFactory<SolidNodeViewOptions>({\n group: 'solid',\n factory,\n })\n}\n\n/**\n * Defines a node view using a Solid component.\n *\n * @public\n */\nexport function defineSolidNodeView(options: SolidNodeViewOptions): Extension {\n return defineNodeViewComponent<SolidNodeViewOptions>({\n group: 'solid',\n name: options.name,\n args: options,\n })\n}\n","/**\n * Accesses the value of a MaybeAccessor\n *\n * @example\n * ```ts\n * access(\"foo\") // => \"foo\"\n * access(() => \"foo\") // => \"foo\"\n * ```\n */\nexport function toValue<T>(\n v: (() => T) | T,\n): T {\n return (typeof v === 'function') ? (v as () => T)() : v\n}\n","import { EditorNotFoundError, type Editor, type Extension } from '@prosekit/core'\nimport { createEffect, onCleanup, type Accessor } from 'solid-js'\n\nimport { useEditorContext } from '../contexts/editor-context.ts'\nimport type { MaybeAccessor } from '../types.ts'\nimport { toValue } from '../utils/to-value.ts'\n\n/**\n * @internal\n */\nexport function useEditorExtension(\n editorAccessor: MaybeAccessor<Editor> | undefined | null,\n extensionAccessor: Accessor<Extension | null>,\n): void {\n const editorContext = useEditorContext()\n\n createEffect(() => {\n const editor = toValue(editorAccessor) || toValue(editorContext)\n const extension = extensionAccessor()\n\n if (!editor) {\n throw new EditorNotFoundError()\n }\n if (extension) {\n onCleanup(editor.use(extension))\n }\n })\n}\n","import { union, type Editor } from '@prosekit/core'\nimport { useSolidRenderer } from '@prosemirror-adapter/solid'\nimport type { Component, JSX, ParentProps } from 'solid-js'\n\nimport { defineSolidMarkViewFactory } from '../extensions/solid-mark-view.ts'\nimport { defineSolidNodeViewFactory } from '../extensions/solid-node-view.ts'\nimport { useEditorExtension } from '../hooks/use-editor-extension.ts'\n\ntype ViewRendererProps = ParentProps<{\n editor: Editor\n}>\n\nexport const ViewRenderer: Component<ViewRendererProps> = (props): JSX.Element => {\n const { renderSolidRenderer, removeSolidRenderer, render } = useSolidRenderer()\n\n const extension = union([\n defineSolidMarkViewFactory(renderSolidRenderer, removeSolidRenderer),\n defineSolidNodeViewFactory(renderSolidRenderer, removeSolidRenderer),\n ])\n\n useEditorExtension(() => props.editor, () => extension)\n\n return [props.children, render] as unknown as JSX.Element\n}\n","import type { Editor } from '@prosekit/core'\nimport { createComponent, type Component, type ParentProps } from 'solid-js'\n\nimport { EditorContextProvider } from '../contexts/editor-context.ts'\n\nimport { ViewRenderer } from './view-renderer.ts'\n\nexport type ProseKitProps = ParentProps<{\n editor: Editor\n}>\n\n/**\n * The root component for a ProseKit editor.\n *\n * @public\n */\nexport const ProseKit: Component<ProseKitProps> = (props) => {\n return createComponent(EditorContextProvider, {\n get value() {\n return props.editor\n },\n get children() {\n return createComponent(ViewRenderer, {\n get editor() {\n return props.editor\n },\n get children() {\n return props.children\n },\n })\n },\n })\n}\n","import { withPriority, type Extension, type Priority } from '@prosekit/core'\n\n/**\n * @internal\n */\nexport function usePriorityExtension<T extends Extension = Extension>(\n extension: () => T | null,\n priority?: Priority | null,\n): () => T | null {\n return () => {\n const ext = extension()\n return ext && priority ? withPriority(ext, priority) : ext\n }\n}\n","import type { Editor, Extension, Priority } from '@prosekit/core'\nimport type { Accessor } from 'solid-js'\n\nimport type { MaybeAccessor } from '../types.ts'\n\nimport { useEditorExtension } from './use-editor-extension.ts'\nimport { usePriorityExtension } from './use-priority-extension.ts'\n\nexport interface UseExtensionOptions {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeAccessor<Editor>\n\n /**\n * Optional priority to add the extension with.\n */\n priority?: Priority\n}\n\n/**\n * Add an extension to the editor.\n */\nexport function useExtension(\n /**\n * The accessor to an extension to add to the editor. If it changes, the previous\n * extension will be removed and the new one (if not null) will be added.\n */\n extension: Accessor<Extension | null>,\n options?: UseExtensionOptions,\n): void {\n useEditorExtension(\n options?.editor,\n usePriorityExtension(extension, options?.priority),\n )\n}\n","import { defineDocChangeHandler } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor document changes.\n *\n * @public\n */\nexport function useDocChange(\n handler: (doc: ProseMirrorNode) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineDocChangeHandler((view) => handler(view.state.doc))\n useExtension(() => extension, options)\n}\n","import { defineMountHandler, defineUpdateHandler, ProseKitError, union, type Editor, type Extension } from '@prosekit/core'\nimport { createEffect, createSignal } from 'solid-js'\n\nimport { useEditorContext } from '../contexts/editor-context.ts'\n\n/**\n * Retrieves the editor instance from the nearest ProseKit component.\n *\n * @public\n */\nexport function useEditor<E extends Extension = any>(options?: {\n /**\n * Whether to update the component when the editor is mounted or editor state\n * is updated.\n *\n * @default false\n */\n update?: boolean\n}): () => Editor<E> {\n const update = options?.update ?? false\n\n const editor = useEditorContext<E>()\n if (!editor) {\n throw new ProseKitError(\n 'useEditor must be used within the ProseKit component',\n )\n }\n\n const [depend, forceUpdate] = useForceUpdate()\n\n createEffect(() => {\n if (update) {\n const extension = union(\n defineMountHandler(forceUpdate),\n defineUpdateHandler(forceUpdate),\n )\n return editor.use(extension)\n }\n }, [editor, update, forceUpdate])\n\n return () => {\n depend()\n return editor\n }\n}\n\nfunction useForceUpdate() {\n return createSignal(undefined, { equals: false })\n}\n","import type { Editor, Extension } from '@prosekit/core'\nimport { createMemo, type Accessor } from 'solid-js'\n\nimport type { MaybeAccessor } from '../types.ts'\nimport { toValue } from '../utils/to-value.ts'\n\nimport { useEditor } from './use-editor.ts'\n\nexport interface UseEditorDerivedOptions<E extends Extension = any> {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeAccessor<Editor<E>>\n}\n\n/**\n * Runs a function to derive a value from the editor instance after editor state\n * changes.\n *\n * This is useful when you need to render something based on the editor state,\n * for example, whether the selected text is wrapped in an italic mark.\n *\n * It returns an accessor of the derived value that updates whenever the editor\n * state changes.\n *\n * @public\n */\nexport function useEditorDerivedValue<E extends Extension, Derived>(\n /**\n * A function that receives the editor instance and returns a derived value.\n *\n * It will be called whenever the editor's document state changes, or when it\n * mounts.\n */\n derive: (editor: Editor<E>) => Derived,\n options?: UseEditorDerivedOptions<E>,\n): Accessor<Derived> {\n const initialEditor = options?.editor\n const editorAccessor: Accessor<Editor<E>> = initialEditor\n ? () => toValue(initialEditor)\n : useEditor<E>({ update: true })\n\n return createMemo(() => derive(editorAccessor()))\n}\n","import { defineKeymap, type Keymap } from '@prosekit/core'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\nexport function useKeymap(keymap: () => Keymap, options?: UseExtensionOptions): void {\n const extension = () => defineKeymap(keymap())\n useExtension(extension, options)\n}\n","import { defineUpdateHandler } from '@prosekit/core'\nimport type { EditorState } from '@prosekit/pm/state'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor state changes.\n *\n * @public\n */\nexport function useStateUpdate(\n handler: (state: EditorState) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineUpdateHandler((view) => handler(view.state))\n useExtension(() => extension, options)\n}\n"],"mappings":";;;;;;AAAA,SAAgB,cAAc,IAAuB;AACnD,IAAG,MAAM,UAAU;AACnB,IAAG,QAAQ,cAAc;;;;ACiC3B,IAAM,wBAAN,cAAoC,sBAA8C;;;sBACpD;GAC1B,MAAM,gBAAgB,KAAK;GAC3B,MAAM,WAAW,KAAK;AACtB,UAAO,gBAAgB,QAAQ;IAC7B,O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BnD,SAAgB,sBAOd,QACA,SACmB;CACnB,MAAM,gBAAgB,SAAS;CAC/B,MAAM,iBAAsC,sBAClC,QAAQ,cAAc,GAC5B,UAAa,EAAE,QAAQ,MAAM,CAAC;AAElC,QAAO,iBAAiB,OAAO,gBAAgB,CAAC,CAAC;;;;ACvCnD,SAAgB,UAAU,QAAsB,SAAqC;CACnF,MAAM,kBAAkB,aAAa,QAAQ,CAAC;AAC9C,cAAa,WAAW,QAAQ;;;;;;;;;ACIlC,SAAgB,eACd,SACA,SACM;CACN,MAAM,YAAY,qBAAqB,SAAS,QAAQ,KAAK,MAAM,CAAC;AACpE,oBAAmB,WAAW,QAAQ"}
|
|
1
|
+
{"version":3,"file":"prosekit-solid.js","names":[],"sources":["../src/extensions/helpers.ts","../src/extensions/solid-mark-view.ts","../src/extensions/solid-node-view.ts","../src/utils/to-value.ts","../src/hooks/use-editor-extension.ts","../src/components/view-renderer.ts","../src/components/prosekit.ts","../src/hooks/use-priority-extension.ts","../src/hooks/use-extension.ts","../src/hooks/use-doc-change.ts","../src/hooks/use-editor.ts","../src/hooks/use-editor-derived-value.ts","../src/hooks/use-keymap.ts","../src/hooks/use-state-update.ts"],"sourcesContent":["export function hidePortalDiv(el: HTMLElement): void {\n el.style.display = 'contents'\n el.dataset.solidPortal = 'true'\n}\n","import { defineMarkViewComponent, defineMarkViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreMarkViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractSolidMarkView,\n buildSolidMarkViewCreator,\n type MarkViewContextProps,\n type SolidRendererResult,\n} from '@prosemirror-adapter/solid'\nimport { createComponent, type Component, type JSX } from 'solid-js'\nimport { Portal } from 'solid-js/web'\n\nimport { hidePortalDiv } from './helpers.ts'\n\n/**\n * @public\n */\nexport interface SolidMarkViewProps extends MarkViewContextProps {}\n\n/**\n * @public\n */\nexport type SolidMarkViewComponent = Component<SolidMarkViewProps>\n\n/**\n * Options for {@link defineSolidMarkView}.\n *\n * @public\n */\nexport interface SolidMarkViewOptions extends CoreMarkViewUserOptions<SolidMarkViewComponent> {\n /**\n * The name of the mark type.\n */\n name: string\n}\n\nclass ProseKitSolidMarkView extends AbstractSolidMarkView<SolidMarkViewComponent> {\n render = (): JSX.Element => {\n const UserComponent = this.component\n const getProps: () => SolidMarkViewProps = this.context\n const props: SolidMarkViewProps = {\n get contentRef() {\n return getProps().contentRef\n },\n get view() {\n return getProps().view\n },\n get mark() {\n return getProps().mark\n },\n }\n return createComponent(Portal, {\n mount: this.dom,\n children: createComponent(UserComponent, props),\n ref: hidePortalDiv,\n })\n }\n}\n\n/**\n * @internal\n */\nexport function defineSolidMarkViewFactory(\n renderSolidRenderer: SolidRendererResult['renderSolidRenderer'],\n removeSolidRenderer: SolidRendererResult['removeSolidRenderer'],\n): Extension {\n const factory = buildSolidMarkViewCreator(renderSolidRenderer, removeSolidRenderer, ProseKitSolidMarkView)\n return defineMarkViewFactory<SolidMarkViewOptions>({\n group: 'solid',\n factory,\n })\n}\n\n/**\n * Defines a mark view using a Solid component.\n *\n * @public\n */\nexport function defineSolidMarkView(options: SolidMarkViewOptions): Extension {\n return defineMarkViewComponent<SolidMarkViewOptions>({\n group: 'solid',\n name: options.name,\n args: options,\n })\n}\n","import { defineNodeViewComponent, defineNodeViewFactory, type Extension } from '@prosekit/core'\nimport type { CoreNodeViewUserOptions } from '@prosemirror-adapter/core'\nimport {\n AbstractSolidNodeView,\n buildSolidNodeViewCreator,\n type NodeViewContextProps,\n type SolidRendererResult,\n} from '@prosemirror-adapter/solid'\nimport { createComponent, type Component, type JSX } from 'solid-js'\nimport { Portal } from 'solid-js/web'\n\nimport { hidePortalDiv } from './helpers.ts'\n\n/**\n * @public\n */\nexport interface SolidNodeViewProps extends NodeViewContextProps {}\n\n/**\n * @public\n */\nexport type SolidNodeViewComponent = Component<SolidNodeViewProps>\n\n/**\n * Options for {@link defineSolidNodeView}.\n *\n * @public\n */\nexport interface SolidNodeViewOptions extends CoreNodeViewUserOptions<SolidNodeViewComponent> {\n /**\n * The name of the node type.\n */\n name: string\n}\n\nclass ProseKitSolidNodeView extends AbstractSolidNodeView<SolidNodeViewComponent> {\n render = (): JSX.Element => {\n const UserComponent = this.component\n const getProps: () => SolidNodeViewProps = this.context\n const props: SolidNodeViewProps = {\n get contentRef() {\n return getProps().contentRef\n },\n get view() {\n return getProps().view\n },\n get getPos() {\n return getProps().getPos\n },\n get setAttrs() {\n return getProps().setAttrs\n },\n get node() {\n return getProps().node\n },\n get selected() {\n return getProps().selected\n },\n get decorations() {\n return getProps().decorations\n },\n get innerDecorations() {\n return getProps().innerDecorations\n },\n }\n return createComponent(Portal, {\n mount: this.dom,\n children: createComponent(UserComponent, props),\n ref: hidePortalDiv,\n })\n }\n}\n\n/**\n * @internal\n */\nexport function defineSolidNodeViewFactory(\n renderSolidRenderer: SolidRendererResult['renderSolidRenderer'],\n removeSolidRenderer: SolidRendererResult['removeSolidRenderer'],\n): Extension {\n const factory = buildSolidNodeViewCreator(renderSolidRenderer, removeSolidRenderer, ProseKitSolidNodeView)\n return defineNodeViewFactory<SolidNodeViewOptions>({\n group: 'solid',\n factory,\n })\n}\n\n/**\n * Defines a node view using a Solid component.\n *\n * @public\n */\nexport function defineSolidNodeView(options: SolidNodeViewOptions): Extension {\n return defineNodeViewComponent<SolidNodeViewOptions>({\n group: 'solid',\n name: options.name,\n args: options,\n })\n}\n","/**\n * Accesses the value of a MaybeAccessor\n *\n * @example\n * ```ts\n * access(\"foo\") // => \"foo\"\n * access(() => \"foo\") // => \"foo\"\n * ```\n */\nexport function toValue<T>(\n v: (() => T) | T,\n): T {\n return (typeof v === 'function') ? (v as () => T)() : v\n}\n","import { EditorNotFoundError, type Editor, type Extension } from '@prosekit/core'\nimport { createEffect, onCleanup, type Accessor } from 'solid-js'\n\nimport { useEditorContext } from '../contexts/editor-context.ts'\nimport type { MaybeAccessor } from '../types.ts'\nimport { toValue } from '../utils/to-value.ts'\n\n/**\n * @internal\n */\nexport function useEditorExtension(\n editorAccessor: MaybeAccessor<Editor> | undefined | null,\n extensionAccessor: Accessor<Extension | null>,\n): void {\n const editorContext = useEditorContext()\n\n createEffect(() => {\n const editor = toValue(editorAccessor) || toValue(editorContext)\n const extension = extensionAccessor()\n\n if (!editor) {\n throw new EditorNotFoundError()\n }\n if (extension) {\n onCleanup(editor.use(extension))\n }\n })\n}\n","import { union, type Editor } from '@prosekit/core'\nimport { useSolidRenderer } from '@prosemirror-adapter/solid'\nimport type { Component, JSX, ParentProps } from 'solid-js'\n\nimport { defineSolidMarkViewFactory } from '../extensions/solid-mark-view.ts'\nimport { defineSolidNodeViewFactory } from '../extensions/solid-node-view.ts'\nimport { useEditorExtension } from '../hooks/use-editor-extension.ts'\n\ntype ViewRendererProps = ParentProps<{\n editor: Editor\n}>\n\nexport const ViewRenderer: Component<ViewRendererProps> = (props): JSX.Element => {\n const { renderSolidRenderer, removeSolidRenderer, render } = useSolidRenderer()\n\n const extension = union([\n defineSolidMarkViewFactory(renderSolidRenderer, removeSolidRenderer),\n defineSolidNodeViewFactory(renderSolidRenderer, removeSolidRenderer),\n ])\n\n useEditorExtension(() => props.editor, () => extension)\n\n return [props.children, render] as unknown as JSX.Element\n}\n","import type { Editor } from '@prosekit/core'\nimport { createComponent, type Component, type ParentProps } from 'solid-js'\n\nimport { EditorContextProvider } from '../contexts/editor-context.ts'\n\nimport { ViewRenderer } from './view-renderer.ts'\n\nexport type ProseKitProps = ParentProps<{\n editor: Editor\n}>\n\n/**\n * The root component for a ProseKit editor.\n *\n * @public\n */\nexport const ProseKit: Component<ProseKitProps> = (props) => {\n return createComponent(EditorContextProvider, {\n get value() {\n return props.editor\n },\n get children() {\n return createComponent(ViewRenderer, {\n get editor() {\n return props.editor\n },\n get children() {\n return props.children\n },\n })\n },\n })\n}\n","import { withPriority, type Extension, type Priority } from '@prosekit/core'\n\n/**\n * @internal\n */\nexport function usePriorityExtension<T extends Extension = Extension>(\n extension: () => T | null,\n priority?: Priority | null,\n): () => T | null {\n return () => {\n const ext = extension()\n return ext && priority ? withPriority(ext, priority) : ext\n }\n}\n","import type { Editor, Extension, Priority } from '@prosekit/core'\nimport type { Accessor } from 'solid-js'\n\nimport type { MaybeAccessor } from '../types.ts'\n\nimport { useEditorExtension } from './use-editor-extension.ts'\nimport { usePriorityExtension } from './use-priority-extension.ts'\n\nexport interface UseExtensionOptions {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeAccessor<Editor>\n\n /**\n * Optional priority to add the extension with.\n */\n priority?: Priority\n}\n\n/**\n * Add an extension to the editor.\n */\nexport function useExtension(\n /**\n * The accessor to an extension to add to the editor. If it changes, the previous\n * extension will be removed and the new one (if not null) will be added.\n */\n extension: Accessor<Extension | null>,\n options?: UseExtensionOptions,\n): void {\n useEditorExtension(\n options?.editor,\n usePriorityExtension(extension, options?.priority),\n )\n}\n","import { defineDocChangeHandler } from '@prosekit/core'\nimport type { ProseMirrorNode } from '@prosekit/pm/model'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor document changes.\n *\n * @public\n */\nexport function useDocChange(\n handler: (doc: ProseMirrorNode) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineDocChangeHandler((view) => handler(view.state.doc))\n useExtension(() => extension, options)\n}\n","import { defineMountHandler, defineUpdateHandler, ProseKitError, union, type Editor, type Extension } from '@prosekit/core'\nimport { createEffect, createSignal } from 'solid-js'\n\nimport { useEditorContext } from '../contexts/editor-context.ts'\n\n/**\n * Retrieves the editor instance from the nearest ProseKit component.\n *\n * @public\n */\nexport function useEditor<E extends Extension = any>(options?: {\n /**\n * Whether to update the component when the editor is mounted or editor state\n * is updated.\n *\n * @default false\n */\n update?: boolean\n}): () => Editor<E> {\n const update = options?.update ?? false\n\n const editor = useEditorContext<E>()\n if (!editor) {\n throw new ProseKitError(\n 'useEditor must be used within the ProseKit component',\n )\n }\n\n const [depend, forceUpdate] = useForceUpdate()\n\n createEffect(() => {\n if (update) {\n const extension = union(\n defineMountHandler(forceUpdate),\n defineUpdateHandler(forceUpdate),\n )\n return editor.use(extension)\n }\n }, [editor, update, forceUpdate])\n\n return () => {\n depend()\n return editor\n }\n}\n\nfunction useForceUpdate() {\n return createSignal(undefined, { equals: false })\n}\n","import type { Editor, Extension } from '@prosekit/core'\nimport { createMemo, type Accessor } from 'solid-js'\n\nimport type { MaybeAccessor } from '../types.ts'\nimport { toValue } from '../utils/to-value.ts'\n\nimport { useEditor } from './use-editor.ts'\n\nexport interface UseEditorDerivedOptions<E extends Extension = any> {\n /**\n * The editor to add the extension to. If not provided, it will use the\n * editor from the nearest `<ProseKit>` component.\n */\n editor?: MaybeAccessor<Editor<E>>\n}\n\n/**\n * Runs a function to derive a value from the editor instance after editor state\n * changes.\n *\n * This is useful when you need to render something based on the editor state,\n * for example, whether the selected text is wrapped in an italic mark.\n *\n * It returns an accessor of the derived value that updates whenever the editor\n * state changes.\n *\n * @public\n */\nexport function useEditorDerivedValue<E extends Extension, Derived>(\n /**\n * A function that receives the editor instance and returns a derived value.\n *\n * It will be called whenever the editor's document state changes, or when it\n * mounts.\n */\n derive: (editor: Editor<E>) => Derived,\n options?: UseEditorDerivedOptions<E>,\n): Accessor<Derived> {\n const initialEditor = options?.editor\n const editorAccessor: Accessor<Editor<E>> = initialEditor\n ? () => toValue(initialEditor)\n : useEditor<E>({ update: true })\n\n return createMemo(() => derive(editorAccessor()))\n}\n","import { defineKeymap, type Keymap } from '@prosekit/core'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\nexport function useKeymap(keymap: () => Keymap, options?: UseExtensionOptions): void {\n const extension = () => defineKeymap(keymap())\n useExtension(extension, options)\n}\n","import { defineUpdateHandler } from '@prosekit/core'\nimport type { EditorState } from '@prosekit/pm/state'\n\nimport { useExtension, type UseExtensionOptions } from './use-extension.ts'\n\n/**\n * Calls the given handler whenever the editor state changes.\n *\n * @public\n */\nexport function useStateUpdate(\n handler: (state: EditorState) => void,\n options?: UseExtensionOptions,\n): void {\n const extension = defineUpdateHandler((view) => handler(view.state))\n useExtension(() => extension, options)\n}\n"],"mappings":";;;;;;AAAA,SAAgB,cAAc,IAAuB;AACnD,IAAG,MAAM,UAAU;AACnB,IAAG,QAAQ,cAAc;;;;ACiC3B,IAAM,wBAAN,cAAoC,sBAA8C;;;sBACpD;GAC1B,MAAM,gBAAgB,KAAK;GAC3B,MAAM,WAAqC,KAAK;AAYhD,UAAO,gBAAgB,QAAQ;IAC7B,OAAO,KAAK;IACZ,UAAU,gBAAgB,eAbM;KAChC,IAAI,aAAa;AACf,aAAO,UAAU,CAAC;;KAEpB,IAAI,OAAO;AACT,aAAO,UAAU,CAAC;;KAEpB,IAAI,OAAO;AACT,aAAO,UAAU,CAAC;;KAErB,CAGgD;IAC/C,KAAK;IACN,CAAC;;;;;;;AAON,SAAgB,2BACd,qBACA,qBACW;AAEX,QAAO,sBAA4C;EACjD,OAAO;EACP,SAHc,0BAA0B,qBAAqB,qBAAqB,sBAAsB;EAIzG,CAAC;;;;;;;AAQJ,SAAgB,oBAAoB,SAA0C;AAC5E,QAAO,wBAA8C;EACnD,OAAO;EACP,MAAM,QAAQ;EACd,MAAM;EACP,CAAC;;;;AC/CJ,IAAM,wBAAN,cAAoC,sBAA8C;;;sBACpD;GAC1B,MAAM,gBAAgB,KAAK;GAC3B,MAAM,WAAqC,KAAK;AA2BhD,UAAO,gBAAgB,QAAQ;IAC7B,OAAO,KAAK;IACZ,UAAU,gBAAgB,eA5BM;KAChC,IAAI,aAAa;AACf,aAAO,UAAU,CAAC;;KAEpB,IAAI,OAAO;AACT,aAAO,UAAU,CAAC;;KAEpB,IAAI,SAAS;AACX,aAAO,UAAU,CAAC;;KAEpB,IAAI,WAAW;AACb,aAAO,UAAU,CAAC;;KAEpB,IAAI,OAAO;AACT,aAAO,UAAU,CAAC;;KAEpB,IAAI,WAAW;AACb,aAAO,UAAU,CAAC;;KAEpB,IAAI,cAAc;AAChB,aAAO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