@prosekit/web 0.6.1 → 0.7.0
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/assign-styles-3yY6F1UX.js +10 -0
- package/dist/{clone-element-B55UD54E.js → clone-element-i6RFnyj4.js} +1 -10
- package/dist/prosekit-web-autocomplete.d.ts +1 -1
- package/dist/prosekit-web-block-handle.d.ts +1 -1
- package/dist/prosekit-web-block-handle.js +16 -13
- package/dist/prosekit-web-drop-indicator.d.ts +38 -0
- package/dist/prosekit-web-drop-indicator.js +75 -0
- package/dist/prosekit-web-inline-popover.d.ts +1 -1
- package/dist/prosekit-web-popover.d.ts +1 -1
- package/dist/prosekit-web-resizable.d.ts +1 -1
- package/dist/prosekit-web-table-handle.d.ts +17 -3
- package/dist/prosekit-web-table-handle.js +6 -3
- package/dist/prosekit-web-tooltip.d.ts +1 -1
- package/package.json +15 -7
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
//#region src/utils/assign-styles.ts
|
|
2
|
-
/**
|
|
3
|
-
* A type-safe version of `Object.assign` for `element.style`.
|
|
4
|
-
*/
|
|
5
|
-
function assignStyles(element, styles) {
|
|
6
|
-
Object.assign(element.style, styles);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
1
|
//#region src/utils/clone-element.ts
|
|
11
2
|
/**
|
|
12
3
|
* Creates a deep clone of an Element, including all computed styles so that
|
|
@@ -47,4 +38,4 @@ function copyStyles(source, target) {
|
|
|
47
38
|
}
|
|
48
39
|
|
|
49
40
|
//#endregion
|
|
50
|
-
export {
|
|
41
|
+
export { cloneElement, deepCloneElement };
|
|
@@ -157,4 +157,4 @@ declare function useAutocompletePopover(host: ConnectableElement, {
|
|
|
157
157
|
emit
|
|
158
158
|
}: SetupOptions<AutocompletePopoverProps, AutocompletePopoverEvents>): void;
|
|
159
159
|
//#endregion
|
|
160
|
-
export { AutocompleteEmptyElement, AutocompleteEmptyEvents, AutocompleteEmptyProps, AutocompleteItemElement, AutocompleteItemEvents, AutocompleteItemProps, AutocompleteListElement, AutocompleteListEvents, AutocompleteListProps, AutocompletePopoverElement, AutocompletePopoverEvents, AutocompletePopoverProps, autocompleteEmptyEvents, autocompleteEmptyProps, autocompleteItemEvents, autocompleteItemProps, autocompleteListEvents, autocompleteListProps, autocompletePopoverEvents, autocompletePopoverProps, useAutocompleteEmpty, useAutocompleteItem, useAutocompleteList, useAutocompletePopover };
|
|
160
|
+
export { AutocompleteEmptyElement, type AutocompleteEmptyEvents, type AutocompleteEmptyProps, AutocompleteItemElement, type AutocompleteItemEvents, type AutocompleteItemProps, AutocompleteListElement, type AutocompleteListEvents, type AutocompleteListProps, AutocompletePopoverElement, type AutocompletePopoverEvents, type AutocompletePopoverProps, autocompleteEmptyEvents, autocompleteEmptyProps, autocompleteItemEvents, autocompleteItemProps, autocompleteListEvents, autocompleteListProps, autocompletePopoverEvents, autocompletePopoverProps, useAutocompleteEmpty, useAutocompleteItem, useAutocompleteList, useAutocompletePopover };
|
|
@@ -116,4 +116,4 @@ declare function useBlockHandlePopover(host: ConnectableElement, {
|
|
|
116
116
|
emit
|
|
117
117
|
}: SetupOptions<BlockHandlePopoverProps, BlockHandlePopoverEvents>): void;
|
|
118
118
|
//#endregion
|
|
119
|
-
export { BlockHandleAddElement, BlockHandleAddEvents, BlockHandleAddProps, BlockHandleDraggableElement, BlockHandleDraggableEvents, BlockHandleDraggableProps, BlockHandlePopoverElement, BlockHandlePopoverEvents, BlockHandlePopoverProps, blockHandleAddEvents, blockHandleAddProps, blockHandleDraggableEvents, blockHandleDraggableProps, blockHandlePopoverEvents, blockHandlePopoverProps, useBlockHandleAdd, useBlockHandleDraggable, useBlockHandlePopover };
|
|
119
|
+
export { BlockHandleAddElement, type BlockHandleAddEvents, type BlockHandleAddProps, BlockHandleDraggableElement, type BlockHandleDraggableEvents, type BlockHandleDraggableProps, BlockHandlePopoverElement, type BlockHandlePopoverEvents, type BlockHandlePopoverProps, blockHandleAddEvents, blockHandleAddProps, blockHandleDraggableEvents, blockHandleDraggableProps, blockHandlePopoverEvents, blockHandlePopoverProps, useBlockHandleAdd, useBlockHandleDraggable, useBlockHandlePopover };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEditorExtension } from "./use-editor-extension-Cc7ZG7uj.js";
|
|
2
|
-
import { assignStyles
|
|
3
|
-
import {
|
|
2
|
+
import { assignStyles } from "./assign-styles-3yY6F1UX.js";
|
|
3
|
+
import { deepCloneElement } from "./clone-element-i6RFnyj4.js";
|
|
4
|
+
import { createComputed, createContext, createSignal, defineCustomElement, registerCustomElement, useAttribute, useEffect, useEventListener } from "@aria-ui/core";
|
|
4
5
|
import { defineDOMEventHandler, insertDefaultBlock, union } from "@prosekit/core";
|
|
5
6
|
import { overlayPositionerEvents, overlayPositionerProps, useOverlayPositionerState } from "@aria-ui/overlay/elements";
|
|
6
7
|
import { usePresence } from "@aria-ui/presence";
|
|
@@ -13,6 +14,10 @@ import { NodeSelection } from "@prosekit/pm/state";
|
|
|
13
14
|
* @internal
|
|
14
15
|
*/
|
|
15
16
|
const blockPopoverContext = createContext("prosekit-block-popover-context", null);
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
const draggingContext = createContext("prosekit-block-handle-dragging-context", false);
|
|
16
21
|
|
|
17
22
|
//#endregion
|
|
18
23
|
//#region src/components/block-handle/block-handle-add/setup.ts
|
|
@@ -151,7 +156,7 @@ function useDataDraggingAttribute(host) {
|
|
|
151
156
|
useAttribute(host, "data-dragging", () => dragging.get() ? "" : void 0);
|
|
152
157
|
}
|
|
153
158
|
function useDragging(host) {
|
|
154
|
-
const dragging =
|
|
159
|
+
const dragging = draggingContext.consume(host);
|
|
155
160
|
useEventListener(host, "dragstart", () => {
|
|
156
161
|
dragging.set(true);
|
|
157
162
|
});
|
|
@@ -188,7 +193,7 @@ function getClientRect(element) {
|
|
|
188
193
|
if (rect.width === 0 && rect.height === 0 && rect.x === 0 && rect.y === 0) {
|
|
189
194
|
if (element.getClientRects().length === 0) {
|
|
190
195
|
const children = Array.from(element.children);
|
|
191
|
-
const rects = children.map((child) => getClientRect(child))
|
|
196
|
+
const rects = children.map((child) => getClientRect(child));
|
|
192
197
|
if (rects.length === 0) return rect;
|
|
193
198
|
if (rects.length === 1) return rects[0];
|
|
194
199
|
return {
|
|
@@ -236,7 +241,7 @@ function defineElementHoverHandler(handler) {
|
|
|
236
241
|
};
|
|
237
242
|
const handlePointerEvent = (view, event) => {
|
|
238
243
|
const { x, y } = event;
|
|
239
|
-
const block =
|
|
244
|
+
const block = findBlockByCoords(view, x, y);
|
|
240
245
|
if (!block) {
|
|
241
246
|
handler(null, null);
|
|
242
247
|
return;
|
|
@@ -257,9 +262,8 @@ function defineElementHoverHandler(handler) {
|
|
|
257
262
|
};
|
|
258
263
|
return union(defineDOMEventHandler("pointermove", throttle(handlePointerEvent, 200)), defineDOMEventHandler("pointerout", handlePointerEvent), defineDOMEventHandler("keypress", () => handler(null, null)));
|
|
259
264
|
}
|
|
260
|
-
function
|
|
261
|
-
const
|
|
262
|
-
const rect = getClientRect(dom);
|
|
265
|
+
function findBlockByCoords(view, x, y) {
|
|
266
|
+
const rect = getClientRect(view.dom);
|
|
263
267
|
if (!isWithinRect(rect, x, y)) return;
|
|
264
268
|
let parent = view.state.doc;
|
|
265
269
|
let pos = -1;
|
|
@@ -281,7 +285,7 @@ function findBlockByCoordinate(view, x, y) {
|
|
|
281
285
|
const childDOM = view.nodeDOM(positions[i]);
|
|
282
286
|
const childRect = getNodeRect(childDOM);
|
|
283
287
|
if (!childRect) {
|
|
284
|
-
console.warn(
|
|
288
|
+
console.warn(`[prosekit] Unable to get rect at position: ${positions[i]}`);
|
|
285
289
|
return;
|
|
286
290
|
}
|
|
287
291
|
if (childRect.top > y) hi = i - 1;
|
|
@@ -403,10 +407,9 @@ function useBlockHandlePopover(host, { state, emit }) {
|
|
|
403
407
|
useOverlayPositionerState(host, overlayState, { reference });
|
|
404
408
|
const context = createSignal(null);
|
|
405
409
|
blockPopoverContext.provide(host, context);
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
});
|
|
410
|
+
const dragging = createSignal(false);
|
|
411
|
+
draggingContext.provide(host, dragging);
|
|
412
|
+
const open = createComputed(() => !!context.get());
|
|
410
413
|
useHoverExtension(host, editor, (referenceValue, hoverState) => {
|
|
411
414
|
reference.set(referenceValue);
|
|
412
415
|
context.set(hoverState);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BaseElementConstructor, ConnectableElement, EventDeclarations, PropDeclarations, SetupOptions } from "@aria-ui/core";
|
|
2
|
+
import { Editor } from "@prosekit/core";
|
|
3
|
+
|
|
4
|
+
//#region src/components/drop-indicator/drop-indicator/types.d.ts
|
|
5
|
+
interface DropIndicatorProps {
|
|
6
|
+
/**
|
|
7
|
+
* The ProseKit editor instance.
|
|
8
|
+
*
|
|
9
|
+
* @default null
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
editor: Editor | null;
|
|
13
|
+
/**
|
|
14
|
+
* The line width in pixels.
|
|
15
|
+
*
|
|
16
|
+
* @default 2
|
|
17
|
+
*/
|
|
18
|
+
width: number;
|
|
19
|
+
}
|
|
20
|
+
/** @internal */
|
|
21
|
+
declare const dropIndicatorProps: PropDeclarations<DropIndicatorProps>;
|
|
22
|
+
interface DropIndicatorEvents {}
|
|
23
|
+
/** @internal */
|
|
24
|
+
declare const dropIndicatorEvents: EventDeclarations<DropIndicatorEvents>;
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/components/drop-indicator/drop-indicator/element.gen.d.ts
|
|
27
|
+
declare const DropIndicatorElementBase: BaseElementConstructor<DropIndicatorProps>;
|
|
28
|
+
declare class DropIndicatorElement extends DropIndicatorElementBase {}
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/components/drop-indicator/drop-indicator/setup.d.ts
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
declare function useDropIndicator(host: ConnectableElement, {
|
|
35
|
+
state
|
|
36
|
+
}: SetupOptions<DropIndicatorProps, DropIndicatorEvents>): void;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { DropIndicatorElement, type DropIndicatorEvents, type DropIndicatorProps, dropIndicatorEvents, dropIndicatorProps, useDropIndicator };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useEditorExtension } from "./use-editor-extension-Cc7ZG7uj.js";
|
|
2
|
+
import { assignStyles } from "./assign-styles-3yY6F1UX.js";
|
|
3
|
+
import { createComputed, createSignal, defineCustomElement, registerCustomElement, useEffect } from "@aria-ui/core";
|
|
4
|
+
import { usePresence } from "@aria-ui/presence";
|
|
5
|
+
import { defineDropIndicator } from "@prosekit/extensions/drop-indicator";
|
|
6
|
+
|
|
7
|
+
//#region src/components/drop-indicator/drop-indicator/setup.ts
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
function useDropIndicator(host, { state }) {
|
|
12
|
+
const context = createSignal(null);
|
|
13
|
+
const extension = defineDropIndicator({
|
|
14
|
+
onShow: (options) => context.set(options),
|
|
15
|
+
onHide: () => context.set(null)
|
|
16
|
+
});
|
|
17
|
+
useEditorExtension(host, state.editor, extension);
|
|
18
|
+
const line = createComputed(() => context.get()?.line);
|
|
19
|
+
const presence = createComputed(() => !!line.get());
|
|
20
|
+
usePresence(host, presence);
|
|
21
|
+
useEffect(host, () => {
|
|
22
|
+
const lineValue = line.get();
|
|
23
|
+
const lineWidth = state.width.get();
|
|
24
|
+
if (!lineValue) return;
|
|
25
|
+
const { p1: { x: x1, y: y1 }, p2: { x: x2, y: y2 } } = lineValue;
|
|
26
|
+
const horizontal = y1 === y2;
|
|
27
|
+
let width;
|
|
28
|
+
let height;
|
|
29
|
+
let top = y1;
|
|
30
|
+
let left = x1;
|
|
31
|
+
if (horizontal) {
|
|
32
|
+
width = x2 - x1;
|
|
33
|
+
height = lineWidth;
|
|
34
|
+
top -= lineWidth / 2;
|
|
35
|
+
} else {
|
|
36
|
+
width = lineWidth;
|
|
37
|
+
height = y2 - y1;
|
|
38
|
+
left -= lineWidth / 2;
|
|
39
|
+
}
|
|
40
|
+
top = Math.round(top);
|
|
41
|
+
left = Math.round(left);
|
|
42
|
+
assignStyles(host, {
|
|
43
|
+
position: "fixed",
|
|
44
|
+
pointerEvents: "none",
|
|
45
|
+
width: `${width}px`,
|
|
46
|
+
height: `${height}px`,
|
|
47
|
+
transform: `translate(${left}px, ${top}px)`,
|
|
48
|
+
left: "0px",
|
|
49
|
+
top: "0px"
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/components/drop-indicator/drop-indicator/types.ts
|
|
56
|
+
/** @internal */
|
|
57
|
+
const dropIndicatorProps = Object.freeze({
|
|
58
|
+
editor: { default: null },
|
|
59
|
+
width: { default: 2 }
|
|
60
|
+
});
|
|
61
|
+
/** @internal */
|
|
62
|
+
const dropIndicatorEvents = {};
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/components/drop-indicator/drop-indicator/element.gen.ts
|
|
66
|
+
const DropIndicatorElementBase = defineCustomElement({
|
|
67
|
+
props: dropIndicatorProps,
|
|
68
|
+
events: dropIndicatorEvents,
|
|
69
|
+
setup: useDropIndicator
|
|
70
|
+
});
|
|
71
|
+
var DropIndicatorElement = class extends DropIndicatorElementBase {};
|
|
72
|
+
registerCustomElement("prosekit-drop-indicator", DropIndicatorElement);
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
export { DropIndicatorElement, dropIndicatorEvents, dropIndicatorProps, useDropIndicator };
|
|
@@ -87,4 +87,4 @@ declare function useInlinePopover(host: ConnectableElement, {
|
|
|
87
87
|
emit
|
|
88
88
|
}: SetupOptions<InlinePopoverProps, InlinePopoverEvents>): void;
|
|
89
89
|
//#endregion
|
|
90
|
-
export { InlinePopoverElement, InlinePopoverEvents, InlinePopoverProps, inlinePopoverEvents, inlinePopoverProps, useInlinePopover };
|
|
90
|
+
export { InlinePopoverElement, type InlinePopoverEvents, type InlinePopoverProps, inlinePopoverEvents, inlinePopoverProps, useInlinePopover };
|
|
@@ -25,4 +25,4 @@ interface PopoverTriggerEvents extends PopoverTriggerEvents$1 {}
|
|
|
25
25
|
declare const PopoverTriggerElementBase: BaseElementConstructor<PopoverTriggerProps>;
|
|
26
26
|
declare class PopoverTriggerElement extends PopoverTriggerElementBase {}
|
|
27
27
|
//#endregion
|
|
28
|
-
export { PopoverContentElement, PopoverContentEvents, PopoverContentProps, PopoverRootElement, PopoverRootEvents, PopoverRootProps, PopoverTriggerElement, PopoverTriggerEvents, PopoverTriggerProps, popoverContentEvents, popoverContentProps, popoverRootEvents, popoverRootProps, popoverTriggerEvents, popoverTriggerProps, usePopoverContent, usePopoverRoot, usePopoverTrigger };
|
|
28
|
+
export { PopoverContentElement, type PopoverContentEvents, type PopoverContentProps, PopoverRootElement, type PopoverRootEvents, type PopoverRootProps, PopoverTriggerElement, type PopoverTriggerEvents, type PopoverTriggerProps, popoverContentEvents, popoverContentProps, popoverRootEvents, popoverRootProps, popoverTriggerEvents, popoverTriggerProps, usePopoverContent, usePopoverRoot, usePopoverTrigger };
|
|
@@ -64,4 +64,4 @@ declare function useResizableRoot(host: ConnectableElement, {
|
|
|
64
64
|
emit
|
|
65
65
|
}: SetupOptions<ResizableRootProps, ResizableRootEvents>): void;
|
|
66
66
|
//#endregion
|
|
67
|
-
export { ResizableHandleElement, ResizableHandleEvents, ResizableHandleProps, ResizableRootElement, ResizableRootEvents, ResizableRootProps, resizableHandleEvents, resizableHandleProps, resizableRootEvents, resizableRootProps, useResizableHandle, useResizableRoot };
|
|
67
|
+
export { ResizableHandleElement, type ResizableHandleEvents, type ResizableHandleProps, ResizableRootElement, type ResizableRootEvents, type ResizableRootProps, resizableHandleEvents, resizableHandleProps, resizableRootEvents, resizableRootProps, useResizableHandle, useResizableRoot };
|
|
@@ -7,7 +7,7 @@ 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, "placement"> {
|
|
10
|
+
interface TableHandleColumnRootProps extends Omit<OverlayPositionerProps, "placement" | "hoist"> {
|
|
11
11
|
/**
|
|
12
12
|
* The ProseKit editor instance.
|
|
13
13
|
*
|
|
@@ -21,6 +21,13 @@ interface TableHandleColumnRootProps extends Omit<OverlayPositionerProps, "place
|
|
|
21
21
|
* @default "top"
|
|
22
22
|
*/
|
|
23
23
|
placement: Placement;
|
|
24
|
+
/**
|
|
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
|
+
hoist: boolean;
|
|
24
31
|
}
|
|
25
32
|
/** @internal */
|
|
26
33
|
declare const tableHandleColumnRootProps: PropDeclarations<TableHandleColumnRootProps>;
|
|
@@ -195,7 +202,7 @@ declare function useTableHandleRoot(host: ConnectableElement, {
|
|
|
195
202
|
}): void;
|
|
196
203
|
//#endregion
|
|
197
204
|
//#region src/components/table-handle/table-handle-row-root/types.d.ts
|
|
198
|
-
interface TableHandleRowRootProps extends Omit<OverlayPositionerProps, "placement"> {
|
|
205
|
+
interface TableHandleRowRootProps extends Omit<OverlayPositionerProps, "placement" | "hoist"> {
|
|
199
206
|
/**
|
|
200
207
|
* The ProseKit editor instance.
|
|
201
208
|
*
|
|
@@ -209,6 +216,13 @@ interface TableHandleRowRootProps extends Omit<OverlayPositionerProps, "placemen
|
|
|
209
216
|
* @default "left"
|
|
210
217
|
*/
|
|
211
218
|
placement: Placement;
|
|
219
|
+
/**
|
|
220
|
+
* Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
|
|
221
|
+
* to place the floating element on top of other page content.
|
|
222
|
+
*
|
|
223
|
+
* @default false
|
|
224
|
+
*/
|
|
225
|
+
hoist: boolean;
|
|
212
226
|
}
|
|
213
227
|
/** @internal */
|
|
214
228
|
declare const tableHandleRowRootProps: PropDeclarations<TableHandleRowRootProps>;
|
|
@@ -254,4 +268,4 @@ declare function useTableHandleRowTrigger(host: ConnectableElement, {
|
|
|
254
268
|
state
|
|
255
269
|
}: SetupOptions<TableHandleRowTriggerProps, TableHandleRowTriggerEvents>): void;
|
|
256
270
|
//#endregion
|
|
257
|
-
export { TableHandleColumnRootElement, TableHandleColumnRootEvents, TableHandleColumnRootProps, TableHandleColumnTriggerElement, TableHandleColumnTriggerEvents, TableHandleColumnTriggerProps, TableHandleDragPreviewElement, TableHandleDragPreviewEvents, TableHandleDragPreviewProps, TableHandleDropIndicatorElement, TableHandleDropIndicatorEvents, TableHandleDropIndicatorProps, TableHandlePopoverContentElement, TableHandlePopoverContentEvents, TableHandlePopoverContentProps, TableHandlePopoverItemElement, TableHandlePopoverItemEvents, TableHandlePopoverItemProps, TableHandleRootElement, TableHandleRootEvents, TableHandleRootProps, TableHandleRowRootElement, TableHandleRowRootEvents, TableHandleRowRootProps, TableHandleRowTriggerElement, TableHandleRowTriggerEvents, TableHandleRowTriggerProps, tableHandleColumnRootEvents, tableHandleColumnRootProps, tableHandleColumnTriggerEvents, tableHandleColumnTriggerProps, tableHandleDragPreviewEvents, tableHandleDragPreviewProps, tableHandleDropIndicatorEvents, tableHandleDropIndicatorProps, tableHandlePopoverContentEvents, tableHandlePopoverContentProps, tableHandlePopoverItemEvents, tableHandlePopoverItemProps, tableHandleRootEvents, tableHandleRootProps, tableHandleRowRootEvents, tableHandleRowRootProps, tableHandleRowTriggerEvents, tableHandleRowTriggerProps, useTableHandleColumnRoot, useTableHandleColumnTrigger, useTableHandleDragPreview, useTableHandleDropIndicator, useTableHandlePopoverContent, useTableHandlePopoverItem, useTableHandleRoot, useTableHandleRowRoot, useTableHandleRowTrigger };
|
|
271
|
+
export { TableHandleColumnRootElement, type TableHandleColumnRootEvents, type TableHandleColumnRootProps, TableHandleColumnTriggerElement, type TableHandleColumnTriggerEvents, type TableHandleColumnTriggerProps, TableHandleDragPreviewElement, type TableHandleDragPreviewEvents, type TableHandleDragPreviewProps, TableHandleDropIndicatorElement, type TableHandleDropIndicatorEvents, type TableHandleDropIndicatorProps, TableHandlePopoverContentElement, type TableHandlePopoverContentEvents, type TableHandlePopoverContentProps, TableHandlePopoverItemElement, type TableHandlePopoverItemEvents, type TableHandlePopoverItemProps, TableHandleRootElement, type TableHandleRootEvents, type TableHandleRootProps, TableHandleRowRootElement, type TableHandleRowRootEvents, type TableHandleRowRootProps, TableHandleRowTriggerElement, type TableHandleRowTriggerEvents, type TableHandleRowTriggerProps, tableHandleColumnRootEvents, tableHandleColumnRootProps, tableHandleColumnTriggerEvents, tableHandleColumnTriggerProps, tableHandleDragPreviewEvents, tableHandleDragPreviewProps, tableHandleDropIndicatorEvents, tableHandleDropIndicatorProps, tableHandlePopoverContentEvents, tableHandlePopoverContentProps, tableHandlePopoverItemEvents, tableHandlePopoverItemProps, tableHandleRootEvents, tableHandleRootProps, tableHandleRowRootEvents, tableHandleRowRootProps, tableHandleRowTriggerEvents, tableHandleRowTriggerProps, useTableHandleColumnRoot, useTableHandleColumnTrigger, useTableHandleDragPreview, useTableHandleDropIndicator, useTableHandlePopoverContent, useTableHandlePopoverItem, useTableHandleRoot, useTableHandleRowRoot, useTableHandleRowTrigger };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getSafeEditorView, getStateWithDefaults } from "./get-safe-editor-view-CqJWgxo1.js";
|
|
2
2
|
import { useEditorExtension } from "./use-editor-extension-Cc7ZG7uj.js";
|
|
3
|
-
import { assignStyles
|
|
3
|
+
import { assignStyles } from "./assign-styles-3yY6F1UX.js";
|
|
4
|
+
import { cloneElement, deepCloneElement } from "./clone-element-i6RFnyj4.js";
|
|
4
5
|
import { createComputed, createContext, createSignal, defineCustomElement, defineEmit, registerCustomElement, useAttribute, useEffect, useEventListener } from "@aria-ui/core";
|
|
5
6
|
import { defineDOMEventHandler, union } from "@prosekit/core";
|
|
6
7
|
import { useOverlayPositionerState } from "@aria-ui/overlay/elements";
|
|
@@ -75,7 +76,8 @@ function useTableHandleColumnRoot(host, { state }) {
|
|
|
75
76
|
const tableHandleColumnRootProps = Object.freeze({
|
|
76
77
|
...overlayPositionerProps$1,
|
|
77
78
|
editor: { default: null },
|
|
78
|
-
placement: { default: "top" }
|
|
79
|
+
placement: { default: "top" },
|
|
80
|
+
hoist: { default: false }
|
|
79
81
|
});
|
|
80
82
|
/** @internal */
|
|
81
83
|
const tableHandleColumnRootEvents = overlayPositionerEvents$1;
|
|
@@ -924,7 +926,8 @@ function useTableHandleRowRoot(host, { state }) {
|
|
|
924
926
|
const tableHandleRowRootProps = {
|
|
925
927
|
...overlayPositionerProps$1,
|
|
926
928
|
editor: { default: null },
|
|
927
|
-
placement: { default: "left" }
|
|
929
|
+
placement: { default: "left" },
|
|
930
|
+
hoist: { default: false }
|
|
928
931
|
};
|
|
929
932
|
/** @internal */
|
|
930
933
|
const tableHandleRowRootEvents = {};
|
|
@@ -25,4 +25,4 @@ interface TooltipTriggerEvents extends TooltipTriggerEvents$1 {}
|
|
|
25
25
|
declare const TooltipTriggerElementBase: BaseElementConstructor<TooltipTriggerProps>;
|
|
26
26
|
declare class TooltipTriggerElement extends TooltipTriggerElementBase {}
|
|
27
27
|
//#endregion
|
|
28
|
-
export { TooltipContentElement, TooltipContentEvents, TooltipContentProps, TooltipRootElement, TooltipRootEvents, TooltipRootProps, TooltipTriggerElement, TooltipTriggerEvents, TooltipTriggerProps, tooltipContentEvents, tooltipContentProps, tooltipRootEvents, tooltipRootProps, tooltipTriggerEvents, tooltipTriggerProps, useTooltipContent, useTooltipRoot, useTooltipTrigger };
|
|
28
|
+
export { TooltipContentElement, type TooltipContentEvents, type TooltipContentProps, TooltipRootElement, type TooltipRootEvents, type TooltipRootProps, TooltipTriggerElement, type TooltipTriggerEvents, type TooltipTriggerProps, tooltipContentEvents, tooltipContentProps, tooltipRootEvents, tooltipRootProps, tooltipTriggerEvents, tooltipTriggerProps, useTooltipContent, useTooltipRoot, useTooltipTrigger };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/web",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "A collection of web components for ProseKit",
|
|
7
7
|
"author": {
|
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
"types": "./dist/prosekit-web-block-handle.d.ts",
|
|
39
39
|
"default": "./dist/prosekit-web-block-handle.js"
|
|
40
40
|
},
|
|
41
|
+
"./drop-indicator": {
|
|
42
|
+
"types": "./dist/prosekit-web-drop-indicator.d.ts",
|
|
43
|
+
"default": "./dist/prosekit-web-drop-indicator.js"
|
|
44
|
+
},
|
|
41
45
|
"./inline-popover": {
|
|
42
46
|
"types": "./dist/prosekit-web-inline-popover.d.ts",
|
|
43
47
|
"default": "./dist/prosekit-web-inline-popover.js"
|
|
@@ -71,15 +75,15 @@
|
|
|
71
75
|
"@aria-ui/popover": "^0.0.27",
|
|
72
76
|
"@aria-ui/presence": "^0.0.19",
|
|
73
77
|
"@aria-ui/tooltip": "^0.0.29",
|
|
74
|
-
"@floating-ui/dom": "^1.7.
|
|
75
|
-
"@ocavue/utils": "^0.
|
|
78
|
+
"@floating-ui/dom": "^1.7.3",
|
|
79
|
+
"@ocavue/utils": "^0.6.0",
|
|
76
80
|
"prosemirror-tables": "^1.7.1",
|
|
77
81
|
"@prosekit/core": "^0.8.3",
|
|
78
|
-
"@prosekit/
|
|
79
|
-
"@prosekit/
|
|
82
|
+
"@prosekit/pm": "^0.1.11",
|
|
83
|
+
"@prosekit/extensions": "^0.11.0"
|
|
80
84
|
},
|
|
81
85
|
"devDependencies": {
|
|
82
|
-
"tsdown": "^0.
|
|
86
|
+
"tsdown": "^0.13.1",
|
|
83
87
|
"typescript": "~5.8.3",
|
|
84
88
|
"vitest": "^3.2.4",
|
|
85
89
|
"@prosekit/config-tsdown": "0.0.0",
|
|
@@ -97,7 +101,8 @@
|
|
|
97
101
|
"prosekit-web-popover": "./src/components/popover/index.gen.ts",
|
|
98
102
|
"prosekit-web-resizable": "./src/components/resizable/index.gen.ts",
|
|
99
103
|
"prosekit-web-table-handle": "./src/components/table-handle/index.gen.ts",
|
|
100
|
-
"prosekit-web-tooltip": "./src/components/tooltip/index.gen.ts"
|
|
104
|
+
"prosekit-web-tooltip": "./src/components/tooltip/index.gen.ts",
|
|
105
|
+
"prosekit-web-drop-indicator": "./src/components/drop-indicator/index.gen.ts"
|
|
101
106
|
}
|
|
102
107
|
},
|
|
103
108
|
"scripts": {
|
|
@@ -116,6 +121,9 @@
|
|
|
116
121
|
"block-handle": [
|
|
117
122
|
"./dist/prosekit-web-block-handle.d.ts"
|
|
118
123
|
],
|
|
124
|
+
"drop-indicator": [
|
|
125
|
+
"./dist/prosekit-web-drop-indicator.d.ts"
|
|
126
|
+
],
|
|
119
127
|
"inline-popover": [
|
|
120
128
|
"./dist/prosekit-web-inline-popover.d.ts"
|
|
121
129
|
],
|