@prosekit/web 0.7.0 → 0.7.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/{get-safe-editor-view-CqJWgxo1.js → get-default-state-CIEy7xrl.js} +1 -11
- package/dist/get-safe-editor-view-DENm4avv.js +11 -0
- package/dist/inject-style-RwRNoINh.js +79 -0
- package/dist/prosekit-web-autocomplete.d.ts +58 -58
- package/dist/prosekit-web-autocomplete.js +2 -1
- package/dist/prosekit-web-block-handle.d.ts +48 -33
- package/dist/prosekit-web-block-handle.js +86 -67
- package/dist/prosekit-web-drop-indicator.d.ts +11 -11
- package/dist/prosekit-web-drop-indicator.js +5 -2
- package/dist/prosekit-web-inline-popover.d.ts +49 -49
- package/dist/prosekit-web-resizable.d.ts +9 -9
- package/dist/prosekit-web-table-handle.d.ts +90 -60
- package/dist/prosekit-web-table-handle.js +110 -48
- package/dist/use-scrolling-BNfsQs3S.js +35 -0
- package/package.json +13 -12
- package/dist/assign-styles-3yY6F1UX.js +0 -10
- package/dist/clone-element-i6RFnyj4.js +0 -41
|
@@ -4,17 +4,17 @@ import { Editor } from "@prosekit/core";
|
|
|
4
4
|
//#region src/components/drop-indicator/drop-indicator/types.d.ts
|
|
5
5
|
interface DropIndicatorProps {
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
* The ProseKit editor instance.
|
|
8
|
+
*
|
|
9
|
+
* @default null
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
12
|
editor: Editor | null;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
* The line width in pixels.
|
|
15
|
+
*
|
|
16
|
+
* @default 2
|
|
17
|
+
*/
|
|
18
18
|
width: number;
|
|
19
19
|
}
|
|
20
20
|
/** @internal */
|
|
@@ -29,8 +29,8 @@ declare class DropIndicatorElement extends DropIndicatorElementBase {}
|
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/components/drop-indicator/drop-indicator/setup.d.ts
|
|
31
31
|
/**
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
34
|
declare function useDropIndicator(host: ConnectableElement, {
|
|
35
35
|
state
|
|
36
36
|
}: SetupOptions<DropIndicatorProps, DropIndicatorEvents>): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEditorExtension } from "./use-editor-extension-Cc7ZG7uj.js";
|
|
2
|
-
import { assignStyles } from "./
|
|
2
|
+
import { assignStyles, useScrolling } from "./use-scrolling-BNfsQs3S.js";
|
|
3
3
|
import { createComputed, createSignal, defineCustomElement, registerCustomElement, useEffect } from "@aria-ui/core";
|
|
4
4
|
import { usePresence } from "@aria-ui/presence";
|
|
5
5
|
import { defineDropIndicator } from "@prosekit/extensions/drop-indicator";
|
|
@@ -16,7 +16,10 @@ function useDropIndicator(host, { state }) {
|
|
|
16
16
|
});
|
|
17
17
|
useEditorExtension(host, state.editor, extension);
|
|
18
18
|
const line = createComputed(() => context.get()?.line);
|
|
19
|
-
const
|
|
19
|
+
const scrolling = useScrolling(host);
|
|
20
|
+
const presence = createComputed(() => {
|
|
21
|
+
return !!context.get() && !scrolling.get();
|
|
22
|
+
});
|
|
20
23
|
usePresence(host, presence);
|
|
21
24
|
useEffect(host, () => {
|
|
22
25
|
const lineValue = line.get();
|
|
@@ -3,72 +3,72 @@ import { Editor } from "@prosekit/core";
|
|
|
3
3
|
import { OverlayPositionerEvents, OverlayPositionerProps } from "@aria-ui/overlay";
|
|
4
4
|
|
|
5
5
|
//#region src/components/inline-popover/inline-popover/types.d.ts
|
|
6
|
-
interface InlinePopoverProps extends Omit<OverlayPositionerProps,
|
|
6
|
+
interface InlinePopoverProps extends Omit<OverlayPositionerProps, 'placement' | 'offset' | 'hide' | 'overlap' | 'inline' | 'overflowPadding'> {
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
* The ProseKit editor instance.
|
|
9
|
+
*
|
|
10
|
+
* @default null
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
13
|
editor: Editor | null;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
* Whether the popover is open by default when some inline content is
|
|
16
|
+
* selected.
|
|
17
|
+
*
|
|
18
|
+
* When `defaultOpen` is true, the popover will open or close based on the
|
|
19
|
+
* inline selection. When `defaultOpen` is false, the popover will never be
|
|
20
|
+
* opened unless the `open` prop is true.
|
|
21
|
+
*
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
24
|
defaultOpen: boolean;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
* Whether the popover is open.
|
|
27
|
+
*
|
|
28
|
+
* Notice that the popover will be always hidden if the inline selection is
|
|
29
|
+
* empty.
|
|
30
|
+
*
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
33
|
open: boolean;
|
|
34
34
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
* Whether the inline popover should be dismissed when the editor receives an
|
|
36
|
+
* Escape key press.
|
|
37
|
+
*
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
40
|
dismissOnEscape: boolean;
|
|
41
41
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
placement: OverlayPositionerProps[
|
|
42
|
+
* @default "top"
|
|
43
|
+
*/
|
|
44
|
+
placement: OverlayPositionerProps['placement'];
|
|
45
45
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
offset: OverlayPositionerProps[
|
|
46
|
+
* @default 12
|
|
47
|
+
*/
|
|
48
|
+
offset: OverlayPositionerProps['offset'];
|
|
49
49
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
hide: OverlayPositionerProps[
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
hide: OverlayPositionerProps['hide'];
|
|
53
53
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
overlap: OverlayPositionerProps[
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
overlap: OverlayPositionerProps['overlap'];
|
|
57
57
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
inline: OverlayPositionerProps[
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
inline: OverlayPositionerProps['inline'];
|
|
61
61
|
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
overflowPadding: OverlayPositionerProps[
|
|
62
|
+
* @default 8
|
|
63
|
+
*/
|
|
64
|
+
overflowPadding: OverlayPositionerProps['overflowPadding'];
|
|
65
65
|
}
|
|
66
66
|
/** @internal */
|
|
67
67
|
declare const inlinePopoverProps: PropDeclarations<InlinePopoverProps>;
|
|
68
68
|
interface InlinePopoverEvents extends OverlayPositionerEvents {
|
|
69
69
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
* Fired when the open state changes.
|
|
71
|
+
*/
|
|
72
72
|
openChange: CustomEvent<boolean>;
|
|
73
73
|
}
|
|
74
74
|
/** @internal */
|
|
@@ -80,8 +80,8 @@ declare class InlinePopoverElement extends InlinePopoverElementBase {}
|
|
|
80
80
|
//#endregion
|
|
81
81
|
//#region src/components/inline-popover/inline-popover/setup.d.ts
|
|
82
82
|
/**
|
|
83
|
-
* @internal
|
|
84
|
-
*/
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
85
|
declare function useInlinePopover(host: ConnectableElement, {
|
|
86
86
|
state,
|
|
87
87
|
emit
|
|
@@ -3,11 +3,11 @@ import { BaseElementConstructor, ConnectableElement, EventDeclarations, PropDecl
|
|
|
3
3
|
//#region src/components/resizable/resizable-handle/types.d.ts
|
|
4
4
|
interface ResizableHandleProps {
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
position:
|
|
6
|
+
* The position of the handle.
|
|
7
|
+
*
|
|
8
|
+
* @default "bottom-right"
|
|
9
|
+
*/
|
|
10
|
+
position: 'top' | 'right' | 'bottom' | 'left' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
|
11
11
|
}
|
|
12
12
|
/** @internal */
|
|
13
13
|
declare const resizableHandleProps: PropDeclarations<ResizableHandleProps>;
|
|
@@ -22,8 +22,8 @@ declare class ResizableHandleElement extends ResizableHandleElementBase {}
|
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/components/resizable/resizable-handle/setup.d.ts
|
|
24
24
|
/**
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
27
|
declare function useResizableHandle(host: ConnectableElement, {
|
|
28
28
|
state
|
|
29
29
|
}: {
|
|
@@ -57,8 +57,8 @@ declare class ResizableRootElement extends ResizableRootElementBase {}
|
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/components/resizable/resizable-root/setup.d.ts
|
|
59
59
|
/**
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
62
|
declare function useResizableRoot(host: ConnectableElement, {
|
|
63
63
|
state,
|
|
64
64
|
emit
|
|
@@ -7,27 +7,42 @@ import { Placement } from "@floating-ui/dom";
|
|
|
7
7
|
import { MenuItemEvents, MenuItemProps } from "@aria-ui/menu";
|
|
8
8
|
|
|
9
9
|
//#region src/components/table-handle/table-handle-column-root/types.d.ts
|
|
10
|
-
interface TableHandleColumnRootProps extends Omit<OverlayPositionerProps,
|
|
10
|
+
interface TableHandleColumnRootProps extends Omit<OverlayPositionerProps, 'placement' | 'hoist' | 'flip' | 'shift' | 'hide'> {
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
* The ProseKit editor instance.
|
|
13
|
+
*
|
|
14
|
+
* @default null
|
|
15
|
+
* @hidden
|
|
16
|
+
*/
|
|
17
17
|
editor: Editor | null;
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
* The placement of the popover, relative to the hovered table cell.
|
|
20
|
+
*
|
|
21
|
+
* @default "top"
|
|
22
|
+
*/
|
|
23
23
|
placement: Placement;
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
* Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
|
|
26
|
+
* to place the floating element on top of other page content.
|
|
27
|
+
*
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
30
|
hoist: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* @default false
|
|
33
|
+
* @hidden
|
|
34
|
+
*/
|
|
35
|
+
flip: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @default false
|
|
38
|
+
* @hidden
|
|
39
|
+
*/
|
|
40
|
+
shift: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @default true
|
|
43
|
+
* @hidden
|
|
44
|
+
*/
|
|
45
|
+
hide: boolean;
|
|
31
46
|
}
|
|
32
47
|
/** @internal */
|
|
33
48
|
declare const tableHandleColumnRootProps: PropDeclarations<TableHandleColumnRootProps>;
|
|
@@ -42,8 +57,8 @@ declare class TableHandleColumnRootElement extends TableHandleColumnRootElementB
|
|
|
42
57
|
//#endregion
|
|
43
58
|
//#region src/components/table-handle/table-handle-column-root/setup.d.ts
|
|
44
59
|
/**
|
|
45
|
-
* @internal
|
|
46
|
-
*/
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
47
62
|
declare function useTableHandleColumnRoot(host: ConnectableElement, {
|
|
48
63
|
state
|
|
49
64
|
}: {
|
|
@@ -68,8 +83,8 @@ declare class TableHandleColumnTriggerElement extends TableHandleColumnTriggerEl
|
|
|
68
83
|
//#endregion
|
|
69
84
|
//#region src/components/table-handle/table-handle-column-trigger/setup.d.ts
|
|
70
85
|
/**
|
|
71
|
-
* @internal
|
|
72
|
-
*/
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
73
88
|
declare function useTableHandleColumnTrigger(host: ConnectableElement, {
|
|
74
89
|
state
|
|
75
90
|
}: SetupOptions<TableHandleColumnTriggerProps, TableHandleColumnTriggerEvents>): void;
|
|
@@ -88,8 +103,8 @@ declare class TableHandleDragPreviewElement extends TableHandleDragPreviewElemen
|
|
|
88
103
|
//#endregion
|
|
89
104
|
//#region src/components/table-handle/table-handle-drag-preview/setup.d.ts
|
|
90
105
|
/**
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
93
108
|
declare function useTableHandleDragPreview(host: ConnectableElement, {
|
|
94
109
|
state
|
|
95
110
|
}: {
|
|
@@ -110,8 +125,8 @@ declare class TableHandleDropIndicatorElement extends TableHandleDropIndicatorEl
|
|
|
110
125
|
//#endregion
|
|
111
126
|
//#region src/components/table-handle/table-handle-drop-indicator/setup.d.ts
|
|
112
127
|
/**
|
|
113
|
-
* @internal
|
|
114
|
-
*/
|
|
128
|
+
* @internal
|
|
129
|
+
*/
|
|
115
130
|
declare function useTableHandleDropIndicator(host: ConnectableElement, {
|
|
116
131
|
state
|
|
117
132
|
}: {
|
|
@@ -119,15 +134,15 @@ declare function useTableHandleDropIndicator(host: ConnectableElement, {
|
|
|
119
134
|
}): void;
|
|
120
135
|
//#endregion
|
|
121
136
|
//#region src/components/table-handle/table-handle-popover-content/types.d.ts
|
|
122
|
-
interface TableHandlePopoverContentProps extends Omit<MenuContentProps,
|
|
137
|
+
interface TableHandlePopoverContentProps extends Omit<MenuContentProps, 'placement' | 'offset'> {
|
|
123
138
|
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
placement: MenuContentProps[
|
|
139
|
+
* @default 'bottom-start'
|
|
140
|
+
*/
|
|
141
|
+
placement: MenuContentProps['placement'];
|
|
127
142
|
/**
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
offset: MenuContentProps[
|
|
143
|
+
* @default {mainAxis: -4, crossAxis: 4}
|
|
144
|
+
*/
|
|
145
|
+
offset: MenuContentProps['offset'];
|
|
131
146
|
editor: Editor | null;
|
|
132
147
|
}
|
|
133
148
|
/** @internal */
|
|
@@ -142,8 +157,8 @@ declare class TableHandlePopoverContentElement extends TableHandlePopoverContent
|
|
|
142
157
|
//#endregion
|
|
143
158
|
//#region src/components/table-handle/table-handle-popover-content/setup.d.ts
|
|
144
159
|
/**
|
|
145
|
-
* @internal
|
|
146
|
-
*/
|
|
160
|
+
* @internal
|
|
161
|
+
*/
|
|
147
162
|
declare function useTableHandlePopoverContent(host: ConnectableElement, {
|
|
148
163
|
state,
|
|
149
164
|
emit
|
|
@@ -163,8 +178,8 @@ declare class TableHandlePopoverItemElement extends TableHandlePopoverItemElemen
|
|
|
163
178
|
//#endregion
|
|
164
179
|
//#region src/components/table-handle/table-handle-popover-item/setup.d.ts
|
|
165
180
|
/**
|
|
166
|
-
* @internal
|
|
167
|
-
*/
|
|
181
|
+
* @internal
|
|
182
|
+
*/
|
|
168
183
|
declare function useTableHandlePopoverItem(element: ConnectableElement, {
|
|
169
184
|
state,
|
|
170
185
|
emit
|
|
@@ -173,11 +188,11 @@ declare function useTableHandlePopoverItem(element: ConnectableElement, {
|
|
|
173
188
|
//#region src/components/table-handle/table-handle-root/types.d.ts
|
|
174
189
|
interface TableHandleRootProps {
|
|
175
190
|
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
191
|
+
* The ProseKit editor instance.
|
|
192
|
+
*
|
|
193
|
+
* @default null
|
|
194
|
+
* @hidden
|
|
195
|
+
*/
|
|
181
196
|
editor: Editor | null;
|
|
182
197
|
}
|
|
183
198
|
/** @internal */
|
|
@@ -193,8 +208,8 @@ declare class TableHandleRootElement extends TableHandleRootElementBase {}
|
|
|
193
208
|
//#endregion
|
|
194
209
|
//#region src/components/table-handle/table-handle-root/setup.d.ts
|
|
195
210
|
/**
|
|
196
|
-
* @internal
|
|
197
|
-
*/
|
|
211
|
+
* @internal
|
|
212
|
+
*/
|
|
198
213
|
declare function useTableHandleRoot(host: ConnectableElement, {
|
|
199
214
|
state
|
|
200
215
|
}: {
|
|
@@ -202,27 +217,42 @@ declare function useTableHandleRoot(host: ConnectableElement, {
|
|
|
202
217
|
}): void;
|
|
203
218
|
//#endregion
|
|
204
219
|
//#region src/components/table-handle/table-handle-row-root/types.d.ts
|
|
205
|
-
interface TableHandleRowRootProps extends Omit<OverlayPositionerProps,
|
|
220
|
+
interface TableHandleRowRootProps extends Omit<OverlayPositionerProps, 'placement' | 'hoist' | 'flip' | 'shift' | 'hide'> {
|
|
206
221
|
/**
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
222
|
+
* The ProseKit editor instance.
|
|
223
|
+
*
|
|
224
|
+
* @default null
|
|
225
|
+
* @hidden
|
|
226
|
+
*/
|
|
212
227
|
editor: Editor | null;
|
|
213
228
|
/**
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
229
|
+
* The placement of the popover, relative to the hovered table cell.
|
|
230
|
+
*
|
|
231
|
+
* @default "left"
|
|
232
|
+
*/
|
|
218
233
|
placement: Placement;
|
|
219
234
|
/**
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
235
|
+
* Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
|
|
236
|
+
* to place the floating element on top of other page content.
|
|
237
|
+
*
|
|
238
|
+
* @default false
|
|
239
|
+
*/
|
|
225
240
|
hoist: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* @default false
|
|
243
|
+
* @hidden
|
|
244
|
+
*/
|
|
245
|
+
flip: boolean;
|
|
246
|
+
/**
|
|
247
|
+
* @default false
|
|
248
|
+
* @hidden
|
|
249
|
+
*/
|
|
250
|
+
shift: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* @default true
|
|
253
|
+
* @hidden
|
|
254
|
+
*/
|
|
255
|
+
hide: boolean;
|
|
226
256
|
}
|
|
227
257
|
/** @internal */
|
|
228
258
|
declare const tableHandleRowRootProps: PropDeclarations<TableHandleRowRootProps>;
|
|
@@ -237,8 +267,8 @@ declare class TableHandleRowRootElement extends TableHandleRowRootElementBase {}
|
|
|
237
267
|
//#endregion
|
|
238
268
|
//#region src/components/table-handle/table-handle-row-root/setup.d.ts
|
|
239
269
|
/**
|
|
240
|
-
* @internal
|
|
241
|
-
*/
|
|
270
|
+
* @internal
|
|
271
|
+
*/
|
|
242
272
|
declare function useTableHandleRowRoot(host: ConnectableElement, {
|
|
243
273
|
state
|
|
244
274
|
}: SetupOptions<TableHandleRowRootProps, TableHandleRowRootEvents>): void;
|
|
@@ -262,8 +292,8 @@ declare class TableHandleRowTriggerElement extends TableHandleRowTriggerElementB
|
|
|
262
292
|
//#endregion
|
|
263
293
|
//#region src/components/table-handle/table-handle-row-trigger/setup.d.ts
|
|
264
294
|
/**
|
|
265
|
-
* @internal
|
|
266
|
-
*/
|
|
295
|
+
* @internal
|
|
296
|
+
*/
|
|
267
297
|
declare function useTableHandleRowTrigger(host: ConnectableElement, {
|
|
268
298
|
state
|
|
269
299
|
}: SetupOptions<TableHandleRowTriggerProps, TableHandleRowTriggerEvents>): void;
|