@prosekit/web 0.8.0-beta.0 → 0.8.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-web-autocomplete.d.ts +112 -90
- package/dist/prosekit-web-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-web-autocomplete.js +292 -217
- package/dist/prosekit-web-autocomplete.js.map +1 -1
- package/dist/prosekit-web-block-handle.d.ts +95 -62
- package/dist/prosekit-web-block-handle.d.ts.map +1 -1
- package/dist/prosekit-web-block-handle.js +219 -114
- package/dist/prosekit-web-block-handle.js.map +1 -1
- package/dist/prosekit-web-drop-indicator.d.ts +13 -15
- package/dist/prosekit-web-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-web-drop-indicator.js +34 -30
- package/dist/prosekit-web-drop-indicator.js.map +1 -1
- package/dist/prosekit-web-inline-popover.d.ts +94 -53
- package/dist/prosekit-web-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-web-inline-popover.js +134 -79
- package/dist/prosekit-web-inline-popover.js.map +1 -1
- package/dist/prosekit-web-menu.d.ts +13 -0
- package/dist/prosekit-web-menu.d.ts.map +1 -0
- package/dist/prosekit-web-menu.js +53 -0
- package/dist/prosekit-web-menu.js.map +1 -0
- package/dist/prosekit-web-popover.d.ts +7 -26
- package/dist/prosekit-web-popover.d.ts.map +1 -1
- package/dist/prosekit-web-popover.js +31 -29
- package/dist/prosekit-web-popover.js.map +1 -1
- package/dist/prosekit-web-resizable.d.ts +92 -51
- package/dist/prosekit-web-resizable.d.ts.map +1 -1
- package/dist/prosekit-web-resizable.js +139 -131
- package/dist/prosekit-web-resizable.js.map +1 -1
- package/dist/prosekit-web-table-handle.d.ts +166 -199
- package/dist/prosekit-web-table-handle.d.ts.map +1 -1
- package/dist/prosekit-web-table-handle.js +495 -496
- package/dist/prosekit-web-table-handle.js.map +1 -1
- package/dist/prosekit-web-tooltip.d.ts +7 -26
- package/dist/prosekit-web-tooltip.d.ts.map +1 -1
- package/dist/prosekit-web-tooltip.js +31 -29
- package/dist/prosekit-web-tooltip.js.map +1 -1
- package/dist/use-editor-extension.js +2 -2
- package/dist/use-editor-extension.js.map +1 -1
- package/dist/use-scrolling.js +17 -8
- package/dist/use-scrolling.js.map +1 -1
- package/package.json +26 -21
- package/src/components/autocomplete/autocomplete-empty.ts +45 -0
- package/src/components/autocomplete/autocomplete-item.ts +65 -0
- package/src/components/autocomplete/autocomplete-popup.ts +95 -0
- package/src/components/autocomplete/autocomplete-positioner.ts +98 -0
- package/src/components/autocomplete/autocomplete-root.ts +280 -0
- package/src/components/autocomplete/context.ts +16 -14
- package/src/components/autocomplete/index.ts +65 -0
- package/src/components/block-handle/block-handle-add.ts +71 -0
- package/src/components/block-handle/block-handle-draggable.ts +158 -0
- package/src/components/block-handle/block-handle-popup.ts +43 -0
- package/src/components/block-handle/block-handle-positioner.ts +89 -0
- package/src/components/block-handle/block-handle-root.ts +116 -0
- package/src/components/block-handle/context.ts +9 -18
- package/src/components/block-handle/hover-state.ts +16 -0
- package/src/components/block-handle/index.ts +59 -0
- package/src/components/block-handle/{block-handle-popover/pointer-move.ts → pointer-move.ts} +8 -7
- package/src/components/block-handle/{block-handle-draggable/set-drag-preview.ts → set-drag-preview.ts} +4 -4
- package/src/components/block-handle/use-hover-extension.ts +65 -0
- package/src/components/drop-indicator/drop-indicator.ts +128 -0
- package/src/components/drop-indicator/index.ts +18 -0
- package/src/components/inline-popover/index.ts +41 -0
- package/src/components/inline-popover/inline-popover-popup.ts +52 -0
- package/src/components/inline-popover/inline-popover-positioner.ts +118 -0
- package/src/components/inline-popover/inline-popover-root.ts +122 -0
- package/src/components/inline-popover/store.ts +6 -0
- package/src/components/menu/index.ts +92 -0
- package/src/components/popover/index.ts +53 -0
- package/src/components/resizable/{resizable-handle/calc-resize.ts → calc-resize.ts} +1 -1
- package/src/components/resizable/context.ts +3 -6
- package/src/components/resizable/index.ts +32 -0
- package/src/components/resizable/resizable-handle.ts +134 -0
- package/src/components/resizable/resizable-root.ts +184 -0
- package/src/components/table-handle/dnd.ts +16 -27
- package/src/components/table-handle/index.ts +125 -0
- package/src/components/table-handle/{table-handle-drag-preview/render-preview.ts → render-preview.ts} +5 -5
- package/src/components/table-handle/shared.ts +61 -0
- package/src/components/table-handle/store.ts +117 -0
- package/src/components/table-handle/table-handle-column-menu-root.ts +51 -0
- package/src/components/table-handle/table-handle-column-menu-trigger.ts +107 -0
- package/src/components/table-handle/table-handle-column-popup.ts +44 -0
- package/src/components/table-handle/table-handle-column-positioner.ts +67 -0
- package/src/components/table-handle/table-handle-drag-preview.ts +169 -0
- package/src/components/table-handle/table-handle-drop-indicator.ts +166 -0
- package/src/components/table-handle/table-handle-root.ts +103 -0
- package/src/components/table-handle/table-handle-row-menu-root.ts +51 -0
- package/src/components/table-handle/table-handle-row-menu-trigger.ts +107 -0
- package/src/components/table-handle/table-handle-row-popup.ts +42 -0
- package/src/components/table-handle/table-handle-row-positioner.ts +67 -0
- package/src/components/table-handle/use-drop.ts +74 -0
- package/src/components/table-handle/{hooks/use-empty-image.ts → use-empty-image.ts} +2 -3
- package/src/components/table-handle/utils.ts +0 -11
- package/src/components/tooltip/index.ts +52 -0
- package/src/hooks/use-editor-extension.ts +4 -4
- package/src/hooks/use-editor-focus-event.ts +4 -4
- package/src/hooks/use-editor-typing.ts +12 -16
- package/src/hooks/use-editor-update-event.ts +4 -4
- package/src/hooks/use-keymap.ts +4 -4
- package/src/hooks/use-scrolling.ts +11 -10
- package/src/hooks/use-selecting.ts +8 -15
- package/src/utils/event.ts +28 -0
- package/src/utils/lazy-signal.spec.ts +68 -0
- package/src/utils/lazy-signal.ts +17 -0
- package/src/utils/prefers-reduced-motion.ts +6 -0
- package/src/utils/prevent-default.ts +3 -0
- package/src/utils/use-html-element-at.ts +17 -0
- package/src/utils/use-no-focus.ts +7 -0
- package/dist/get-default-state.js +0 -11
- package/dist/get-default-state.js.map +0 -1
- package/src/components/autocomplete/autocomplete-empty/element.gen.ts +0 -18
- package/src/components/autocomplete/autocomplete-empty/setup.ts +0 -6
- package/src/components/autocomplete/autocomplete-empty/types.ts +0 -13
- package/src/components/autocomplete/autocomplete-item/element.gen.ts +0 -18
- package/src/components/autocomplete/autocomplete-item/setup.ts +0 -30
- package/src/components/autocomplete/autocomplete-item/types.ts +0 -25
- package/src/components/autocomplete/autocomplete-list/element.gen.ts +0 -18
- package/src/components/autocomplete/autocomplete-list/setup.ts +0 -125
- package/src/components/autocomplete/autocomplete-list/types.ts +0 -22
- package/src/components/autocomplete/autocomplete-popover/element.gen.ts +0 -18
- package/src/components/autocomplete/autocomplete-popover/setup.ts +0 -169
- package/src/components/autocomplete/autocomplete-popover/types.ts +0 -100
- package/src/components/autocomplete/index.gen.ts +0 -17
- package/src/components/block-handle/block-handle-add/element.gen.ts +0 -18
- package/src/components/block-handle/block-handle-add/setup.ts +0 -33
- package/src/components/block-handle/block-handle-add/types.ts +0 -23
- package/src/components/block-handle/block-handle-draggable/element.gen.ts +0 -18
- package/src/components/block-handle/block-handle-draggable/setup.ts +0 -113
- package/src/components/block-handle/block-handle-draggable/types.ts +0 -23
- package/src/components/block-handle/block-handle-popover/element.gen.ts +0 -18
- package/src/components/block-handle/block-handle-popover/setup.ts +0 -68
- package/src/components/block-handle/block-handle-popover/types.ts +0 -81
- package/src/components/block-handle/index.gen.ts +0 -13
- package/src/components/drop-indicator/drop-indicator/element.gen.ts +0 -18
- package/src/components/drop-indicator/drop-indicator/setup.ts +0 -75
- package/src/components/drop-indicator/drop-indicator/types.ts +0 -31
- package/src/components/drop-indicator/index.gen.ts +0 -5
- package/src/components/inline-popover/index.gen.ts +0 -5
- package/src/components/inline-popover/inline-popover/element.gen.ts +0 -18
- package/src/components/inline-popover/inline-popover/setup.ts +0 -111
- package/src/components/inline-popover/inline-popover/types.ts +0 -112
- package/src/components/popover/index.gen.ts +0 -13
- package/src/components/popover/popover-content/element.gen.ts +0 -18
- package/src/components/popover/popover-content/setup.ts +0 -1
- package/src/components/popover/popover-content/types.ts +0 -6
- package/src/components/popover/popover-root/element.gen.ts +0 -18
- package/src/components/popover/popover-root/setup.ts +0 -1
- package/src/components/popover/popover-root/types.ts +0 -6
- package/src/components/popover/popover-trigger/element.gen.ts +0 -18
- package/src/components/popover/popover-trigger/setup.ts +0 -1
- package/src/components/popover/popover-trigger/types.ts +0 -6
- package/src/components/resizable/index.gen.ts +0 -9
- package/src/components/resizable/resizable-handle/element.gen.ts +0 -18
- package/src/components/resizable/resizable-handle/setup.ts +0 -106
- package/src/components/resizable/resizable-handle/types.ts +0 -29
- package/src/components/resizable/resizable-root/element.gen.ts +0 -18
- package/src/components/resizable/resizable-root/setup.ts +0 -84
- package/src/components/resizable/resizable-root/types.ts +0 -59
- package/src/components/table-handle/context.ts +0 -43
- package/src/components/table-handle/hooks/use-drop.ts +0 -85
- package/src/components/table-handle/index.gen.ts +0 -37
- package/src/components/table-handle/table-handle-column-root/element.gen.ts +0 -18
- package/src/components/table-handle/table-handle-column-root/setup.ts +0 -60
- package/src/components/table-handle/table-handle-column-root/types.ts +0 -73
- package/src/components/table-handle/table-handle-column-trigger/element.gen.ts +0 -18
- package/src/components/table-handle/table-handle-column-trigger/setup.ts +0 -64
- package/src/components/table-handle/table-handle-column-trigger/types.ts +0 -20
- package/src/components/table-handle/table-handle-drag-preview/element.gen.ts +0 -18
- package/src/components/table-handle/table-handle-drag-preview/setup.ts +0 -57
- package/src/components/table-handle/table-handle-drag-preview/types.ts +0 -14
- package/src/components/table-handle/table-handle-drag-preview/updater.ts +0 -90
- package/src/components/table-handle/table-handle-drop-indicator/element.gen.ts +0 -18
- package/src/components/table-handle/table-handle-drop-indicator/setup.ts +0 -52
- package/src/components/table-handle/table-handle-drop-indicator/types.ts +0 -15
- package/src/components/table-handle/table-handle-drop-indicator/updater.ts +0 -96
- package/src/components/table-handle/table-handle-popover-content/element.gen.ts +0 -18
- package/src/components/table-handle/table-handle-popover-content/setup.ts +0 -83
- package/src/components/table-handle/table-handle-popover-content/types.ts +0 -32
- package/src/components/table-handle/table-handle-popover-item/element.gen.ts +0 -18
- package/src/components/table-handle/table-handle-popover-item/setup.ts +0 -17
- package/src/components/table-handle/table-handle-popover-item/types.ts +0 -16
- package/src/components/table-handle/table-handle-root/element.gen.ts +0 -18
- package/src/components/table-handle/table-handle-root/setup.ts +0 -86
- package/src/components/table-handle/table-handle-root/types.ts +0 -23
- package/src/components/table-handle/table-handle-row-root/element.gen.ts +0 -18
- package/src/components/table-handle/table-handle-row-root/setup.ts +0 -70
- package/src/components/table-handle/table-handle-row-root/types.ts +0 -68
- package/src/components/table-handle/table-handle-row-trigger/element.gen.ts +0 -18
- package/src/components/table-handle/table-handle-row-trigger/setup.ts +0 -63
- package/src/components/table-handle/table-handle-row-trigger/types.ts +0 -23
- package/src/components/tooltip/index.gen.ts +0 -13
- package/src/components/tooltip/tooltip-content/element.gen.ts +0 -18
- package/src/components/tooltip/tooltip-content/setup.ts +0 -1
- package/src/components/tooltip/tooltip-content/types.ts +0 -6
- package/src/components/tooltip/tooltip-root/element.gen.ts +0 -18
- package/src/components/tooltip/tooltip-root/setup.ts +0 -1
- package/src/components/tooltip/tooltip-root/types.ts +0 -6
- package/src/components/tooltip/tooltip-trigger/element.gen.ts +0 -18
- package/src/components/tooltip/tooltip-trigger/setup.ts +0 -1
- package/src/components/tooltip/tooltip-trigger/types.ts +0 -6
- package/src/hooks/use-first-rendering.ts +0 -15
- package/src/utils/get-default-state.spec.ts +0 -42
- package/src/utils/get-default-state.ts +0 -18
- /package/src/components/autocomplete/{autocomplete-popover/helpers.spec.ts → helpers.spec.ts} +0 -0
- /package/src/components/autocomplete/{autocomplete-popover/helpers.ts → helpers.ts} +0 -0
- /package/src/components/inline-popover/{inline-popover/virtual-selection-element.ts → virtual-selection-element.ts} +0 -0
- /package/src/components/resizable/{resizable-handle/calc-resize.spec.ts → calc-resize.spec.ts} +0 -0
- /package/src/components/table-handle/{table-handle-drop-indicator/calc-drag-over.ts → calc-drag-over.ts} +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, registerCustomElement, type BaseElementConstructor } from "@aria-ui/core"
|
|
2
|
-
|
|
3
|
-
import { useTableHandlePopoverContent } from "./setup.ts"
|
|
4
|
-
import { tableHandlePopoverContentEvents, tableHandlePopoverContentProps, type TableHandlePopoverContentEvents, type TableHandlePopoverContentProps } from "./types.ts"
|
|
5
|
-
|
|
6
|
-
const TableHandlePopoverContentElementBase: BaseElementConstructor<TableHandlePopoverContentProps> = defineCustomElement<
|
|
7
|
-
TableHandlePopoverContentProps,
|
|
8
|
-
TableHandlePopoverContentEvents
|
|
9
|
-
>({
|
|
10
|
-
props: tableHandlePopoverContentProps,
|
|
11
|
-
events: tableHandlePopoverContentEvents,
|
|
12
|
-
setup: useTableHandlePopoverContent,
|
|
13
|
-
})
|
|
14
|
-
class TableHandlePopoverContentElement extends TableHandlePopoverContentElementBase {}
|
|
15
|
-
|
|
16
|
-
registerCustomElement('prosekit-table-handle-popover-content', TableHandlePopoverContentElement)
|
|
17
|
-
|
|
18
|
-
export { TableHandlePopoverContentElement }
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createComputed,
|
|
3
|
-
createSignal,
|
|
4
|
-
useEffect,
|
|
5
|
-
type ConnectableElement,
|
|
6
|
-
type ReadonlySignal,
|
|
7
|
-
type SetupOptions,
|
|
8
|
-
type SignalState,
|
|
9
|
-
type TypedEventTarget,
|
|
10
|
-
} from '@aria-ui/core'
|
|
11
|
-
import { menuContentProps, useMenuContent, type MenuContentProps } from '@aria-ui/menu/elements'
|
|
12
|
-
|
|
13
|
-
import { getStateWithDefaults } from '../../../utils/get-default-state.ts'
|
|
14
|
-
import { tableHandleRootContext } from '../context.ts'
|
|
15
|
-
|
|
16
|
-
import type { TableHandlePopoverContentEvents, TableHandlePopoverContentProps } from './types.ts'
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
export function useTableHandlePopoverContent(
|
|
22
|
-
host: ConnectableElement,
|
|
23
|
-
{
|
|
24
|
-
state,
|
|
25
|
-
emit,
|
|
26
|
-
}: SetupOptions<
|
|
27
|
-
TableHandlePopoverContentProps,
|
|
28
|
-
TableHandlePopoverContentEvents
|
|
29
|
-
>,
|
|
30
|
-
): void {
|
|
31
|
-
const rootContext = tableHandleRootContext.consume(host)
|
|
32
|
-
const open = createComputed(() => !!rootContext.get())
|
|
33
|
-
const keyDownTarget = useKeyDownTarget(host, open)
|
|
34
|
-
|
|
35
|
-
const menuContentState: SignalState<MenuContentProps> = getStateWithDefaults(
|
|
36
|
-
{
|
|
37
|
-
placement: state.placement,
|
|
38
|
-
offset: state.offset,
|
|
39
|
-
eventTarget: createSignal(keyDownTarget),
|
|
40
|
-
},
|
|
41
|
-
menuContentProps,
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
useMenuContent(host, { state: menuContentState, emit })
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function useKeyDownTarget(
|
|
48
|
-
element: ConnectableElement,
|
|
49
|
-
open: ReadonlySignal<boolean>,
|
|
50
|
-
): TypedEventTarget<'keydown'> {
|
|
51
|
-
const keydownHandlers: Array<(event: KeyboardEvent) => void> = []
|
|
52
|
-
|
|
53
|
-
useEffect(element, () => {
|
|
54
|
-
const handleKeydown = (event: KeyboardEvent) => {
|
|
55
|
-
if (event.isComposing || event.defaultPrevented || !open.get()) {
|
|
56
|
-
return false
|
|
57
|
-
}
|
|
58
|
-
keydownHandlers.forEach((handler) => handler(event))
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
document.addEventListener('keydown', handleKeydown)
|
|
62
|
-
|
|
63
|
-
return () => {
|
|
64
|
-
document.removeEventListener('keydown', handleKeydown)
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
addEventListener: (type, listener) => {
|
|
70
|
-
if (type === 'keydown') {
|
|
71
|
-
keydownHandlers.push(listener)
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
removeEventListener: (type, listener) => {
|
|
75
|
-
if (type === 'keydown') {
|
|
76
|
-
const index = keydownHandlers.indexOf(listener)
|
|
77
|
-
if (index !== -1) {
|
|
78
|
-
keydownHandlers.splice(index, 1)
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { EventDeclarations, PropDeclarations } from '@aria-ui/core'
|
|
2
|
-
import { menuContentEvents, menuContentProps, type MenuContentEvents, type MenuContentProps } from '@aria-ui/menu/elements'
|
|
3
|
-
import type { Editor } from '@prosekit/core'
|
|
4
|
-
|
|
5
|
-
export interface TableHandlePopoverContentProps extends Omit<MenuContentProps, 'placement' | 'offset'> {
|
|
6
|
-
/**
|
|
7
|
-
* @default 'bottom-start'
|
|
8
|
-
*/
|
|
9
|
-
placement: MenuContentProps['placement']
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @default {mainAxis: -4, crossAxis: 4}
|
|
13
|
-
*/
|
|
14
|
-
offset: MenuContentProps['offset']
|
|
15
|
-
|
|
16
|
-
editor: Editor | null
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** @internal */
|
|
20
|
-
export const tableHandlePopoverContentProps: PropDeclarations<TableHandlePopoverContentProps> = Object.freeze({
|
|
21
|
-
...menuContentProps,
|
|
22
|
-
placement: { default: 'right-start' },
|
|
23
|
-
offset: { default: { mainAxis: -4, crossAxis: 4 } },
|
|
24
|
-
editor: { default: null },
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
export interface TableHandlePopoverContentEvents extends MenuContentEvents {}
|
|
28
|
-
|
|
29
|
-
/** @internal */
|
|
30
|
-
export const tableHandlePopoverContentEvents: EventDeclarations<TableHandlePopoverContentEvents> = Object.freeze({
|
|
31
|
-
...menuContentEvents,
|
|
32
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, registerCustomElement, type BaseElementConstructor } from "@aria-ui/core"
|
|
2
|
-
|
|
3
|
-
import { useTableHandlePopoverItem } from "./setup.ts"
|
|
4
|
-
import { tableHandlePopoverItemEvents, tableHandlePopoverItemProps, type TableHandlePopoverItemEvents, type TableHandlePopoverItemProps } from "./types.ts"
|
|
5
|
-
|
|
6
|
-
const TableHandlePopoverItemElementBase: BaseElementConstructor<TableHandlePopoverItemProps> = defineCustomElement<
|
|
7
|
-
TableHandlePopoverItemProps,
|
|
8
|
-
TableHandlePopoverItemEvents
|
|
9
|
-
>({
|
|
10
|
-
props: tableHandlePopoverItemProps,
|
|
11
|
-
events: tableHandlePopoverItemEvents,
|
|
12
|
-
setup: useTableHandlePopoverItem,
|
|
13
|
-
})
|
|
14
|
-
class TableHandlePopoverItemElement extends TableHandlePopoverItemElementBase {}
|
|
15
|
-
|
|
16
|
-
registerCustomElement('prosekit-table-handle-popover-item', TableHandlePopoverItemElement)
|
|
17
|
-
|
|
18
|
-
export { TableHandlePopoverItemElement }
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ConnectableElement, SetupOptions } from '@aria-ui/core'
|
|
2
|
-
import { useMenuItem } from '@aria-ui/menu/elements'
|
|
3
|
-
|
|
4
|
-
import type { TableHandlePopoverItemEvents, TableHandlePopoverItemProps } from './types.ts'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export function useTableHandlePopoverItem(
|
|
10
|
-
element: ConnectableElement,
|
|
11
|
-
{
|
|
12
|
-
state,
|
|
13
|
-
emit,
|
|
14
|
-
}: SetupOptions<TableHandlePopoverItemProps, TableHandlePopoverItemEvents>,
|
|
15
|
-
): void {
|
|
16
|
-
useMenuItem(element, { state, emit })
|
|
17
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { EventDeclarations, PropDeclarations } from '@aria-ui/core'
|
|
2
|
-
import { menuItemEvents, menuItemProps, type MenuItemEvents, type MenuItemProps } from '@aria-ui/menu'
|
|
3
|
-
|
|
4
|
-
export interface TableHandlePopoverItemProps extends MenuItemProps {}
|
|
5
|
-
|
|
6
|
-
/** @internal */
|
|
7
|
-
export const tableHandlePopoverItemProps: PropDeclarations<TableHandlePopoverItemProps> = {
|
|
8
|
-
...menuItemProps,
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface TableHandlePopoverItemEvents extends MenuItemEvents {}
|
|
12
|
-
|
|
13
|
-
/** @internal */
|
|
14
|
-
export const tableHandlePopoverItemEvents: EventDeclarations<TableHandlePopoverItemEvents> = {
|
|
15
|
-
...menuItemEvents,
|
|
16
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, registerCustomElement, type BaseElementConstructor } from "@aria-ui/core"
|
|
2
|
-
|
|
3
|
-
import { useTableHandleRoot } from "./setup.ts"
|
|
4
|
-
import { tableHandleRootEvents, tableHandleRootProps, type TableHandleRootEvents, type TableHandleRootProps } from "./types.ts"
|
|
5
|
-
|
|
6
|
-
const TableHandleRootElementBase: BaseElementConstructor<TableHandleRootProps> = defineCustomElement<
|
|
7
|
-
TableHandleRootProps,
|
|
8
|
-
TableHandleRootEvents
|
|
9
|
-
>({
|
|
10
|
-
props: tableHandleRootProps,
|
|
11
|
-
events: tableHandleRootEvents,
|
|
12
|
-
setup: useTableHandleRoot,
|
|
13
|
-
})
|
|
14
|
-
class TableHandleRootElement extends TableHandleRootElementBase {}
|
|
15
|
-
|
|
16
|
-
registerCustomElement('prosekit-table-handle-root', TableHandleRootElement)
|
|
17
|
-
|
|
18
|
-
export { TableHandleRootElement }
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createComputed,
|
|
3
|
-
createSignal,
|
|
4
|
-
useEffect,
|
|
5
|
-
type ConnectableElement,
|
|
6
|
-
type ReadonlySignal,
|
|
7
|
-
type Signal,
|
|
8
|
-
type SignalState,
|
|
9
|
-
} from '@aria-ui/core'
|
|
10
|
-
import { defineDOMEventHandler, type Editor } from '@prosekit/core'
|
|
11
|
-
import type { EditorView } from '@prosekit/pm/view'
|
|
12
|
-
|
|
13
|
-
import { useEditorExtension } from '../../../hooks/use-editor-extension.ts'
|
|
14
|
-
import { useEditorTyping } from '../../../hooks/use-editor-typing.ts'
|
|
15
|
-
import { useScrolling } from '../../../hooks/use-scrolling.ts'
|
|
16
|
-
import { useSelecting } from '../../../hooks/use-selecting.ts'
|
|
17
|
-
import {
|
|
18
|
-
defaultTableHandleDndContext,
|
|
19
|
-
tableHandleDndContext,
|
|
20
|
-
tableHandleRootContext,
|
|
21
|
-
type TableHandleDndContext,
|
|
22
|
-
type TableHandleRootContext,
|
|
23
|
-
} from '../context.ts'
|
|
24
|
-
import { useDrop } from '../hooks/use-drop.ts'
|
|
25
|
-
import { getHoveringCell, isHoveringCellInfoEqual, type HoveringCellInfo } from '../utils.ts'
|
|
26
|
-
|
|
27
|
-
import type { TableHandleRootProps } from './types.ts'
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @internal
|
|
31
|
-
*/
|
|
32
|
-
export function useTableHandleRoot(
|
|
33
|
-
host: ConnectableElement,
|
|
34
|
-
{ state }: { state: SignalState<TableHandleRootProps> },
|
|
35
|
-
): void {
|
|
36
|
-
const { editor } = state
|
|
37
|
-
|
|
38
|
-
const context = createSignal<TableHandleRootContext>(null)
|
|
39
|
-
const dndContext = createSignal<TableHandleDndContext>(defaultTableHandleDndContext)
|
|
40
|
-
|
|
41
|
-
const hoveringCell = useHoveringCell(host, editor)
|
|
42
|
-
const typing = useEditorTyping(host, editor)
|
|
43
|
-
const isInTable = createComputed(() => !!hoveringCell.get())
|
|
44
|
-
const selecting = useSelecting(host, editor, isInTable)
|
|
45
|
-
const scrolling = useScrolling(host)
|
|
46
|
-
const canShow = createComputed(() => {
|
|
47
|
-
return !typing.get() && !selecting.get() && !scrolling.get()
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
useEffect(host, () => {
|
|
51
|
-
context.set(canShow.get() ? hoveringCell.get() : null)
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
tableHandleRootContext.provide(host, context)
|
|
55
|
-
tableHandleDndContext.provide(host, dndContext)
|
|
56
|
-
|
|
57
|
-
useDrop(host, editor, dndContext)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function useHoveringCell(
|
|
61
|
-
host: ConnectableElement,
|
|
62
|
-
editor: ReadonlySignal<Editor | null>,
|
|
63
|
-
): Signal<HoveringCellInfo | null> {
|
|
64
|
-
const hoveringCell = createSignal<HoveringCellInfo | null>(null)
|
|
65
|
-
|
|
66
|
-
const extension = defineCellHoverHandler((curr: HoveringCellInfo | null) => {
|
|
67
|
-
const prev = hoveringCell.peek()
|
|
68
|
-
if (!isHoveringCellInfoEqual(prev, curr)) {
|
|
69
|
-
hoveringCell.set(curr)
|
|
70
|
-
}
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
useEditorExtension(host, editor, extension)
|
|
74
|
-
|
|
75
|
-
return hoveringCell
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function defineCellHoverHandler(
|
|
79
|
-
handler: (hoveringCell: HoveringCellInfo | null) => void,
|
|
80
|
-
) {
|
|
81
|
-
const pointerHandler = (view: EditorView, event: PointerEvent) => {
|
|
82
|
-
const hoveringCell = getHoveringCell(view, event)
|
|
83
|
-
return handler(hoveringCell ?? null)
|
|
84
|
-
}
|
|
85
|
-
return defineDOMEventHandler('pointerover', pointerHandler)
|
|
86
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { EventDeclarations, PropDeclarations } from '@aria-ui/core'
|
|
2
|
-
import type { Editor } from '@prosekit/core'
|
|
3
|
-
|
|
4
|
-
export interface TableHandleRootProps {
|
|
5
|
-
/**
|
|
6
|
-
* The ProseKit editor instance.
|
|
7
|
-
*
|
|
8
|
-
* @default null
|
|
9
|
-
* @hidden
|
|
10
|
-
*/
|
|
11
|
-
editor: Editor | null
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const tableHandleRootProps: PropDeclarations<TableHandleRootProps> = {
|
|
16
|
-
editor: { default: null },
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** @internal */
|
|
20
|
-
export interface TableHandleRootEvents {}
|
|
21
|
-
|
|
22
|
-
/** @internal */
|
|
23
|
-
export const tableHandleRootEvents: EventDeclarations<TableHandleRootEvents> = {}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, registerCustomElement, type BaseElementConstructor } from "@aria-ui/core"
|
|
2
|
-
|
|
3
|
-
import { useTableHandleRowRoot } from "./setup.ts"
|
|
4
|
-
import { tableHandleRowRootEvents, tableHandleRowRootProps, type TableHandleRowRootEvents, type TableHandleRowRootProps } from "./types.ts"
|
|
5
|
-
|
|
6
|
-
const TableHandleRowRootElementBase: BaseElementConstructor<TableHandleRowRootProps> = defineCustomElement<
|
|
7
|
-
TableHandleRowRootProps,
|
|
8
|
-
TableHandleRowRootEvents
|
|
9
|
-
>({
|
|
10
|
-
props: tableHandleRowRootProps,
|
|
11
|
-
events: tableHandleRowRootEvents,
|
|
12
|
-
setup: useTableHandleRowRoot,
|
|
13
|
-
})
|
|
14
|
-
class TableHandleRowRootElement extends TableHandleRowRootElementBase {}
|
|
15
|
-
|
|
16
|
-
registerCustomElement('prosekit-table-handle-row-root', TableHandleRowRootElement)
|
|
17
|
-
|
|
18
|
-
export { TableHandleRowRootElement }
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createComputed,
|
|
3
|
-
createSignal,
|
|
4
|
-
defineEmit,
|
|
5
|
-
useAttribute,
|
|
6
|
-
useEffect,
|
|
7
|
-
type ConnectableElement,
|
|
8
|
-
type SetupOptions,
|
|
9
|
-
} from '@aria-ui/core'
|
|
10
|
-
import { menuRootEvents, menuRootProps, useMenuRoot } from '@aria-ui/menu/elements'
|
|
11
|
-
import { useOverlayPositionerState } from '@aria-ui/overlay/elements'
|
|
12
|
-
import { usePresence } from '@aria-ui/presence'
|
|
13
|
-
|
|
14
|
-
import { getStateWithDefaults } from '../../../utils/get-default-state.ts'
|
|
15
|
-
import { getSafeEditorView } from '../../../utils/get-safe-editor-view.ts'
|
|
16
|
-
import { tableHandleRootContext } from '../context.ts'
|
|
17
|
-
|
|
18
|
-
import type { TableHandleRowRootEvents, TableHandleRowRootProps } from './types.ts'
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export function useTableHandleRowRoot(
|
|
24
|
-
host: ConnectableElement,
|
|
25
|
-
{ state }: SetupOptions<TableHandleRowRootProps, TableHandleRowRootEvents>,
|
|
26
|
-
): void {
|
|
27
|
-
const { editor, ...overlayState } = state
|
|
28
|
-
|
|
29
|
-
const rootContext = tableHandleRootContext.consume(host)
|
|
30
|
-
|
|
31
|
-
const rowFirstCellPos = createComputed<number | undefined>(() => {
|
|
32
|
-
return rootContext.get()?.rowFirstCellPos
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
const referenceCell = createComputed<HTMLElement | null>(() => {
|
|
36
|
-
const pos = rowFirstCellPos.get()
|
|
37
|
-
const view = getSafeEditorView(editor.get())
|
|
38
|
-
if (!pos || !view) return null
|
|
39
|
-
return view.nodeDOM(pos) as HTMLElement | null
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
const contentOpen = createSignal(false)
|
|
43
|
-
|
|
44
|
-
// Close the menu when the hovering element is changed
|
|
45
|
-
// TODO: add a delay
|
|
46
|
-
useEffect(host, () => {
|
|
47
|
-
rowFirstCellPos.get()
|
|
48
|
-
contentOpen.set(false)
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
useOverlayPositionerState(host, overlayState, {
|
|
52
|
-
reference: referenceCell,
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
const presence = createComputed(() => !!referenceCell.get())
|
|
56
|
-
useAttribute(host, 'data-state', () => (presence.get() ? 'open' : 'closed'))
|
|
57
|
-
usePresence(host, presence)
|
|
58
|
-
|
|
59
|
-
const menuRootState = getStateWithDefaults(
|
|
60
|
-
{
|
|
61
|
-
open: contentOpen,
|
|
62
|
-
},
|
|
63
|
-
menuRootProps,
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
useMenuRoot(host, {
|
|
67
|
-
state: menuRootState,
|
|
68
|
-
emit: defineEmit(host, menuRootEvents),
|
|
69
|
-
})
|
|
70
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { EventDeclarations, PropDeclarations } from '@aria-ui/core'
|
|
2
|
-
import { overlayPositionerProps, type OverlayPositionerEvents, type OverlayPositionerProps } from '@aria-ui/overlay'
|
|
3
|
-
import type { Placement } from '@floating-ui/dom'
|
|
4
|
-
import type { Editor } from '@prosekit/core'
|
|
5
|
-
|
|
6
|
-
export interface TableHandleRowRootProps extends Omit<OverlayPositionerProps, 'placement' | 'hoist' | 'flip' | 'shift' | 'hide'> {
|
|
7
|
-
/**
|
|
8
|
-
* The ProseKit editor instance.
|
|
9
|
-
*
|
|
10
|
-
* @default null
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
editor: Editor | null
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The placement of the popover, relative to the hovered table cell.
|
|
17
|
-
*
|
|
18
|
-
* @default "left"
|
|
19
|
-
*/
|
|
20
|
-
placement: Placement
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Whether to use the browser [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
|
|
24
|
-
* to place the floating element on top of other page content.
|
|
25
|
-
*
|
|
26
|
-
* @default false
|
|
27
|
-
*/
|
|
28
|
-
hoist: boolean
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @default false
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
flip: boolean
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @default false
|
|
38
|
-
* @hidden
|
|
39
|
-
*/
|
|
40
|
-
shift: boolean
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @default true
|
|
44
|
-
* @hidden
|
|
45
|
-
*/
|
|
46
|
-
hide: boolean
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** @internal */
|
|
50
|
-
export const tableHandleRowRootProps: PropDeclarations<TableHandleRowRootProps> = {
|
|
51
|
-
...overlayPositionerProps,
|
|
52
|
-
editor: { default: null },
|
|
53
|
-
placement: { default: 'left' },
|
|
54
|
-
|
|
55
|
-
// Enabling `hoist` will cause the popover to have a small delay when
|
|
56
|
-
// scrolling the page.
|
|
57
|
-
hoist: { default: false },
|
|
58
|
-
|
|
59
|
-
flip: { default: false },
|
|
60
|
-
shift: { default: false },
|
|
61
|
-
hide: { default: true },
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** @internal */
|
|
65
|
-
export interface TableHandleRowRootEvents extends OverlayPositionerEvents {}
|
|
66
|
-
|
|
67
|
-
/** @internal */
|
|
68
|
-
export const tableHandleRowRootEvents: EventDeclarations<TableHandleRowRootEvents> = {}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, registerCustomElement, type BaseElementConstructor } from "@aria-ui/core"
|
|
2
|
-
|
|
3
|
-
import { useTableHandleRowTrigger } from "./setup.ts"
|
|
4
|
-
import { tableHandleRowTriggerEvents, tableHandleRowTriggerProps, type TableHandleRowTriggerEvents, type TableHandleRowTriggerProps } from "./types.ts"
|
|
5
|
-
|
|
6
|
-
const TableHandleRowTriggerElementBase: BaseElementConstructor<TableHandleRowTriggerProps> = defineCustomElement<
|
|
7
|
-
TableHandleRowTriggerProps,
|
|
8
|
-
TableHandleRowTriggerEvents
|
|
9
|
-
>({
|
|
10
|
-
props: tableHandleRowTriggerProps,
|
|
11
|
-
events: tableHandleRowTriggerEvents,
|
|
12
|
-
setup: useTableHandleRowTrigger,
|
|
13
|
-
})
|
|
14
|
-
class TableHandleRowTriggerElement extends TableHandleRowTriggerElementBase {}
|
|
15
|
-
|
|
16
|
-
registerCustomElement('prosekit-table-handle-row-trigger', TableHandleRowTriggerElement)
|
|
17
|
-
|
|
18
|
-
export { TableHandleRowTriggerElement }
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { useEffect, useEventListener, type ConnectableElement, type SetupOptions } from '@aria-ui/core'
|
|
2
|
-
import { useMenuTrigger } from '@aria-ui/menu/elements'
|
|
3
|
-
import { selectTableRow } from '@prosekit/extensions/table'
|
|
4
|
-
|
|
5
|
-
import { tableHandleDndContext, tableHandleRootContext } from '../context.ts'
|
|
6
|
-
import { useEmptyImage } from '../hooks/use-empty-image.ts'
|
|
7
|
-
|
|
8
|
-
import type { TableHandleRowTriggerEvents, TableHandleRowTriggerProps } from './types.ts'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export function useTableHandleRowTrigger(
|
|
14
|
-
host: ConnectableElement,
|
|
15
|
-
{ state }: SetupOptions<TableHandleRowTriggerProps, TableHandleRowTriggerEvents>,
|
|
16
|
-
): void {
|
|
17
|
-
useMenuTrigger(host)
|
|
18
|
-
|
|
19
|
-
const context = tableHandleRootContext.consume(host)
|
|
20
|
-
|
|
21
|
-
const dndContext = tableHandleDndContext.consume(host)
|
|
22
|
-
|
|
23
|
-
useEventListener(host, 'pointerdown', () => {
|
|
24
|
-
const editor = state.editor.peek()
|
|
25
|
-
const cellPos = context.peek()?.cellPos
|
|
26
|
-
if (!editor || !cellPos) return
|
|
27
|
-
editor.exec(selectTableRow({ head: cellPos }))
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
useEffect(host, () => {
|
|
31
|
-
host.draggable = true
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
const getEmptyImage = useEmptyImage(host)
|
|
35
|
-
|
|
36
|
-
useEventListener(host, 'dragstart', (event: DragEvent) => {
|
|
37
|
-
const dataTransfer = event.dataTransfer
|
|
38
|
-
if (dataTransfer) {
|
|
39
|
-
dataTransfer.effectAllowed = 'move'
|
|
40
|
-
const emptyImage = getEmptyImage()
|
|
41
|
-
if (emptyImage) {
|
|
42
|
-
dataTransfer.setDragImage(emptyImage, 0, 0)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const prev = dndContext.peek()
|
|
46
|
-
const index = context.peek()?.rowIndex
|
|
47
|
-
|
|
48
|
-
if (index == null || index < 0) {
|
|
49
|
-
console.warn('[prosekit] Invalid row index for drag operation:', index)
|
|
50
|
-
event.preventDefault()
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
dndContext.set({
|
|
55
|
-
...prev,
|
|
56
|
-
direction: 'row',
|
|
57
|
-
dragging: true,
|
|
58
|
-
draggingIndex: index,
|
|
59
|
-
startX: event.clientX,
|
|
60
|
-
startY: event.clientY,
|
|
61
|
-
})
|
|
62
|
-
})
|
|
63
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { EventDeclarations, PropDeclarations } from '@aria-ui/core'
|
|
2
|
-
import type { Editor } from '@prosekit/core'
|
|
3
|
-
import type { defineTableCommands } from '@prosekit/extensions/table'
|
|
4
|
-
|
|
5
|
-
type TableCommandsExtension = ReturnType<typeof defineTableCommands>
|
|
6
|
-
|
|
7
|
-
export interface TableHandleRowTriggerProps {
|
|
8
|
-
editor: Editor<TableCommandsExtension> | null
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** @internal */
|
|
12
|
-
export const tableHandleRowTriggerProps: PropDeclarations<TableHandleRowTriggerProps> = {
|
|
13
|
-
editor: { default: null },
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface TableHandleRowTriggerEvents {
|
|
17
|
-
select: CustomEvent<void>
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** @internal */
|
|
21
|
-
export const tableHandleRowTriggerEvents: EventDeclarations<TableHandleRowTriggerEvents> = {
|
|
22
|
-
select: {},
|
|
23
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// This file is generated by packages/dev/src/gen-components.ts
|
|
2
|
-
|
|
3
|
-
export { TooltipContentElement } from './tooltip-content/element.gen.ts'
|
|
4
|
-
export { tooltipContentEvents, tooltipContentProps, type TooltipContentEvents, type TooltipContentProps } from './tooltip-content/types.ts'
|
|
5
|
-
export { useTooltipContent } from './tooltip-content/setup.ts'
|
|
6
|
-
|
|
7
|
-
export { TooltipRootElement } from './tooltip-root/element.gen.ts'
|
|
8
|
-
export { tooltipRootEvents, tooltipRootProps, type TooltipRootEvents, type TooltipRootProps } from './tooltip-root/types.ts'
|
|
9
|
-
export { useTooltipRoot } from './tooltip-root/setup.ts'
|
|
10
|
-
|
|
11
|
-
export { TooltipTriggerElement } from './tooltip-trigger/element.gen.ts'
|
|
12
|
-
export { tooltipTriggerEvents, tooltipTriggerProps, type TooltipTriggerEvents, type TooltipTriggerProps } from './tooltip-trigger/types.ts'
|
|
13
|
-
export { useTooltipTrigger } from './tooltip-trigger/setup.ts'
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, registerCustomElement, type BaseElementConstructor } from "@aria-ui/core"
|
|
2
|
-
|
|
3
|
-
import { useTooltipContent } from "./setup.ts"
|
|
4
|
-
import { tooltipContentEvents, tooltipContentProps, type TooltipContentEvents, type TooltipContentProps } from "./types.ts"
|
|
5
|
-
|
|
6
|
-
const TooltipContentElementBase: BaseElementConstructor<TooltipContentProps> = defineCustomElement<
|
|
7
|
-
TooltipContentProps,
|
|
8
|
-
TooltipContentEvents
|
|
9
|
-
>({
|
|
10
|
-
props: tooltipContentProps,
|
|
11
|
-
events: tooltipContentEvents,
|
|
12
|
-
setup: useTooltipContent,
|
|
13
|
-
})
|
|
14
|
-
class TooltipContentElement extends TooltipContentElementBase {}
|
|
15
|
-
|
|
16
|
-
registerCustomElement('prosekit-tooltip-content', TooltipContentElement)
|
|
17
|
-
|
|
18
|
-
export { TooltipContentElement }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useTooltipContent } from '@aria-ui/tooltip/elements'
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TooltipContentEvents as Events, TooltipContentProps as Props } from '@aria-ui/tooltip/elements'
|
|
2
|
-
|
|
3
|
-
export { tooltipContentEvents, tooltipContentProps } from '@aria-ui/tooltip/elements'
|
|
4
|
-
|
|
5
|
-
export interface TooltipContentProps extends Props {}
|
|
6
|
-
export interface TooltipContentEvents extends Events {}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineCustomElement, registerCustomElement, type BaseElementConstructor } from "@aria-ui/core"
|
|
2
|
-
|
|
3
|
-
import { useTooltipRoot } from "./setup.ts"
|
|
4
|
-
import { tooltipRootEvents, tooltipRootProps, type TooltipRootEvents, type TooltipRootProps } from "./types.ts"
|
|
5
|
-
|
|
6
|
-
const TooltipRootElementBase: BaseElementConstructor<TooltipRootProps> = defineCustomElement<
|
|
7
|
-
TooltipRootProps,
|
|
8
|
-
TooltipRootEvents
|
|
9
|
-
>({
|
|
10
|
-
props: tooltipRootProps,
|
|
11
|
-
events: tooltipRootEvents,
|
|
12
|
-
setup: useTooltipRoot,
|
|
13
|
-
})
|
|
14
|
-
class TooltipRootElement extends TooltipRootElementBase {}
|
|
15
|
-
|
|
16
|
-
registerCustomElement('prosekit-tooltip-root', TooltipRootElement)
|
|
17
|
-
|
|
18
|
-
export { TooltipRootElement }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useTooltipRoot } from '@aria-ui/tooltip/elements'
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TooltipRootEvents as Events, TooltipRootProps as Props } from '@aria-ui/tooltip/elements'
|
|
2
|
-
|
|
3
|
-
export { tooltipRootEvents, tooltipRootProps } from '@aria-ui/tooltip/elements'
|
|
4
|
-
|
|
5
|
-
export interface TooltipRootProps extends Props {}
|
|
6
|
-
export interface TooltipRootEvents extends Events {}
|