@prosekit/web 0.7.9 → 0.7.10
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-default-state-Bqluw34o.js → get-default-state-BzBimBWi.js} +1 -1
- package/dist/get-default-state-BzBimBWi.js.map +1 -0
- package/dist/{get-safe-editor-view-DJlcheeV.js → get-safe-editor-view-Dt9Amrcn.js} +1 -1
- package/dist/{get-safe-editor-view-DJlcheeV.js.map → get-safe-editor-view-Dt9Amrcn.js.map} +1 -1
- package/dist/{inject-style-DYQXx-cE.js → inject-style-BaFaVQvj.js} +7 -7
- package/dist/inject-style-BaFaVQvj.js.map +1 -0
- package/dist/prosekit-web-autocomplete.d.ts.map +1 -1
- package/dist/prosekit-web-autocomplete.js +3 -3
- package/dist/prosekit-web-autocomplete.js.map +1 -1
- package/dist/prosekit-web-block-handle.d.ts.map +1 -1
- package/dist/prosekit-web-block-handle.js +4 -4
- package/dist/prosekit-web-block-handle.js.map +1 -1
- package/dist/prosekit-web-drop-indicator.d.ts.map +1 -1
- package/dist/prosekit-web-drop-indicator.js +2 -2
- package/dist/prosekit-web-drop-indicator.js.map +1 -1
- package/dist/prosekit-web-inline-popover.d.ts.map +1 -1
- package/dist/prosekit-web-inline-popover.js +1 -1
- package/dist/prosekit-web-inline-popover.js.map +1 -1
- package/dist/prosekit-web-popover.d.ts.map +1 -1
- package/dist/prosekit-web-popover.js.map +1 -1
- package/dist/prosekit-web-resizable.d.ts.map +1 -1
- package/dist/prosekit-web-resizable.js.map +1 -1
- package/dist/prosekit-web-table-handle.d.ts.map +1 -1
- package/dist/prosekit-web-table-handle.js +22 -22
- package/dist/prosekit-web-table-handle.js.map +1 -1
- package/dist/prosekit-web-tooltip.d.ts.map +1 -1
- package/dist/prosekit-web-tooltip.js.map +1 -1
- package/dist/prosekit-web.d.ts +80 -1
- package/dist/prosekit-web.d.ts.map +1 -0
- package/dist/prosekit-web.js +95 -1
- package/dist/prosekit-web.js.map +1 -0
- package/dist/{use-editor-extension-B_5BbYvf.js → use-editor-extension-B2WuUfnd.js} +1 -1
- package/dist/use-editor-extension-B2WuUfnd.js.map +1 -0
- package/dist/{use-scrolling-BjI3cuLt.js → use-scrolling-BjVzAkiZ.js} +3 -1
- package/dist/use-scrolling-BjVzAkiZ.js.map +1 -0
- package/package.json +11 -11
- package/src/components/autocomplete/autocomplete-empty/types.ts +1 -4
- package/src/components/autocomplete/autocomplete-item/setup.ts +2 -10
- package/src/components/autocomplete/autocomplete-item/types.ts +2 -8
- package/src/components/autocomplete/autocomplete-list/setup.ts +5 -21
- package/src/components/autocomplete/autocomplete-list/types.ts +2 -10
- package/src/components/autocomplete/autocomplete-popover/helpers.spec.ts +1 -5
- package/src/components/autocomplete/autocomplete-popover/setup.ts +4 -20
- package/src/components/autocomplete/autocomplete-popover/types.ts +1 -4
- package/src/components/autocomplete/context.ts +1 -4
- package/src/components/block-handle/block-handle-add/setup.ts +1 -5
- package/src/components/block-handle/block-handle-add/types.ts +1 -4
- package/src/components/block-handle/block-handle-draggable/setup.ts +3 -18
- package/src/components/block-handle/block-handle-draggable/types.ts +1 -4
- package/src/components/block-handle/block-handle-popover/pointer-move.ts +2 -10
- package/src/components/block-handle/block-handle-popover/setup.ts +4 -22
- package/src/components/block-handle/block-handle-popover/types.ts +1 -4
- package/src/components/block-handle/context.ts +1 -4
- package/src/components/drop-indicator/drop-indicator/setup.ts +3 -15
- package/src/components/drop-indicator/drop-indicator/types.ts +1 -4
- package/src/components/inline-popover/inline-popover/setup.ts +1 -4
- package/src/components/inline-popover/inline-popover/types.ts +1 -4
- package/src/components/inline-popover/inline-popover/virtual-selection-element.ts +1 -5
- package/src/components/popover/popover-content/types.ts +2 -8
- package/src/components/popover/popover-root/types.ts +2 -8
- package/src/components/popover/popover-trigger/types.ts +2 -8
- package/src/components/resizable/context.ts +1 -4
- package/src/components/resizable/resizable-handle/calc-resize.spec.ts +1 -4
- package/src/components/resizable/resizable-handle/setup.ts +2 -15
- package/src/components/resizable/resizable-handle/types.ts +1 -4
- package/src/components/resizable/resizable-root/setup.ts +4 -20
- package/src/components/resizable/resizable-root/types.ts +1 -4
- package/src/components/table-handle/context.ts +2 -8
- package/src/components/table-handle/dnd.ts +9 -15
- package/src/components/table-handle/hooks/use-drop.ts +2 -11
- package/src/components/table-handle/table-handle-column-root/setup.ts +2 -13
- package/src/components/table-handle/table-handle-column-root/types.ts +1 -4
- package/src/components/table-handle/table-handle-column-trigger/setup.ts +3 -14
- package/src/components/table-handle/table-handle-column-trigger/types.ts +1 -4
- package/src/components/table-handle/table-handle-drag-preview/render-preview.ts +1 -4
- package/src/components/table-handle/table-handle-drag-preview/setup.ts +3 -13
- package/src/components/table-handle/table-handle-drag-preview/types.ts +1 -4
- package/src/components/table-handle/table-handle-drag-preview/updater.ts +3 -14
- package/src/components/table-handle/table-handle-drop-indicator/setup.ts +6 -10
- package/src/components/table-handle/table-handle-drop-indicator/types.ts +1 -4
- package/src/components/table-handle/table-handle-drop-indicator/updater.ts +5 -19
- package/src/components/table-handle/table-handle-popover-content/setup.ts +2 -9
- package/src/components/table-handle/table-handle-popover-content/types.ts +2 -10
- package/src/components/table-handle/table-handle-popover-item/setup.ts +2 -8
- package/src/components/table-handle/table-handle-popover-item/types.ts +2 -10
- package/src/components/table-handle/table-handle-root/setup.ts +2 -9
- package/src/components/table-handle/table-handle-root/types.ts +1 -4
- package/src/components/table-handle/table-handle-row-root/setup.ts +2 -9
- package/src/components/table-handle/table-handle-row-root/types.ts +2 -9
- package/src/components/table-handle/table-handle-row-trigger/setup.ts +3 -14
- package/src/components/table-handle/table-handle-row-trigger/types.ts +1 -4
- package/src/components/table-handle/utils.ts +1 -4
- package/src/components/tooltip/tooltip-content/types.ts +2 -8
- package/src/components/tooltip/tooltip-root/types.ts +2 -8
- package/src/components/tooltip/tooltip-trigger/types.ts +2 -8
- package/src/hooks/use-editor-extension.ts +2 -9
- package/src/hooks/use-editor-focus-event.ts +2 -9
- package/src/hooks/use-editor-typing.ts +2 -10
- package/src/hooks/use-editor-update-event.ts +2 -9
- package/src/hooks/use-first-rendering.ts +1 -6
- package/src/hooks/use-keymap.ts +2 -9
- package/src/hooks/use-scrolling.ts +3 -6
- package/src/hooks/use-selecting.ts +1 -5
- package/src/index.ts +1 -1
- package/src/queue-extension.ts +93 -0
- package/src/utils/get-default-state.spec.ts +2 -10
- package/src/utils/get-default-state.ts +1 -5
- package/dist/get-default-state-Bqluw34o.js.map +0 -1
- package/dist/inject-style-DYQXx-cE.js.map +0 -1
- package/dist/use-editor-extension-B_5BbYvf.js.map +0 -1
- package/dist/use-scrolling-BjI3cuLt.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-web.js","names":[],"sources":["../src/queue-extension.ts"],"sourcesContent":["import type { Editor, Extension } from '@prosekit/core'\n\n/**\n\n @internal\n\n Queues an extension to be added to the editor in the next task. Returns a\n dispose function that can be used to remove the extension in the next task.\n\n Why?\n\n Let's take React as an example.\n\n `editor.use(extension)` is synchronous. If the extension adds a node view that\n is controlled by `@prosemirror-adapter/react`, adding this extension will\n cause `prosemirror-adapter` to set UI state synchronously (e.g. `setState`\n returned by `useState` in React).\n\n ProseMirror is a sync-based framework. When updating node view, ProseMirror\n will first stop DOMObserver, then update the DOM, then resume DOMObserver.\n `prosemirror-adapter` needs to call `React.flushSync()` to update the DOM\n synchronously right after React state is updated, before ProseMirror resumes\n DOMObserver.\n\n If we call `editor.use(extension)` directly in `useEffect`, we eventually are\n doing something like this:\n\n ```ts\n React.useEffect(() => {\n React.flushSync(() => {\n setState(newState)\n })\n }, [])\n ```\n\n This breaks the async nature of React, and causes the following React\n warning:\n\n ```\n flushSync was called from inside a lifecycle method. React cannot flush when\n React is already rendering. Consider moving this call to a scheduler task or\n micro task.\n ```\n\n To fix this, we need to queue the extension addition to the editor in the next\n task or in the next microtask.\n\n ```ts\n // In the next microtask\n React.useEffect(() => {\n queueMicrotask(() => {\n React.flushSync(() => {\n setState(newState)\n })\n })\n }, [])\n\n // In the next task\n React.useEffect(() => {\n setTimeout(() => {\n React.flushSync(() => {\n setState(newState)\n })\n })\n }, [])\n ```\n\n I chose to use `setTimeout` instead of `queueMicrotask` because\n `queueMicrotask` causes another React act warning `An update to %s inside a\n test was not wrapped in act(...)` during testing.\n\n Although the example above is based on React, this is a general pattern for\n any async based UI framework, including Svelte.\n\n */\nexport function queueExtension(editor: Editor, extension: Extension): VoidFunction {\n let canceled = false\n let dispose: VoidFunction | undefined\n const timeout = setTimeout(() => {\n if (canceled) return\n dispose?.()\n dispose = editor.use(extension)\n })\n\n return () => {\n canceled = true\n clearTimeout(timeout)\n setTimeout(() => {\n dispose?.()\n dispose = undefined\n })\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,SAAgB,eAAe,QAAgB,WAAoC;CACjF,IAAI,WAAW;CACf,IAAI;CACJ,MAAM,UAAU,iBAAiB;AAC/B,MAAI,SAAU;AACd,aAAW;AACX,YAAU,OAAO,IAAI,UAAU;GAC/B;AAEF,cAAa;AACX,aAAW;AACX,eAAa,QAAQ;AACrB,mBAAiB;AACf,cAAW;AACX,aAAU;IACV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-editor-extension-B2WuUfnd.js","names":[],"sources":["../src/hooks/use-editor-extension.ts"],"sourcesContent":["import { useEffect, type ConnectableElement, type ReadonlySignal } from '@aria-ui/core'\nimport type { Editor, Extension } from '@prosekit/core'\n\nexport function useEditorExtension(\n host: ConnectableElement,\n editor: ReadonlySignal<Editor | null>,\n extension: Extension,\n): void {\n useEffect(host, () => {\n return editor.get()?.use(extension)\n })\n}\n"],"mappings":";;;AAGA,SAAgB,mBACd,MACA,QACA,WACM;AACN,WAAU,YAAY;AACpB,SAAO,OAAO,KAAK,EAAE,IAAI,UAAU;GACnC"}
|
|
@@ -23,9 +23,11 @@ function useScrolling(host) {
|
|
|
23
23
|
};
|
|
24
24
|
scrollableParent.addEventListener("scroll", handleScroll, { passive: true });
|
|
25
25
|
window.addEventListener("mousemove", handleMouseMove, { passive: true });
|
|
26
|
+
window.addEventListener("pointermove", handleMouseMove, { passive: true });
|
|
26
27
|
return () => {
|
|
27
28
|
scrollableParent.removeEventListener("scroll", handleScroll);
|
|
28
29
|
window.removeEventListener("mousemove", handleMouseMove);
|
|
30
|
+
window.removeEventListener("pointermove", handleMouseMove);
|
|
29
31
|
};
|
|
30
32
|
});
|
|
31
33
|
return scrolling;
|
|
@@ -33,4 +35,4 @@ function useScrolling(host) {
|
|
|
33
35
|
|
|
34
36
|
//#endregion
|
|
35
37
|
export { assignStyles as n, useScrolling as t };
|
|
36
|
-
//# sourceMappingURL=use-scrolling-
|
|
38
|
+
//# sourceMappingURL=use-scrolling-BjVzAkiZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scrolling-BjVzAkiZ.js","names":[],"sources":["../src/utils/assign-styles.ts","../src/hooks/use-scrolling.ts"],"sourcesContent":["import type { ConditionalPick } from 'type-fest'\n\n// Only include CSS properties whose value type is `string`\ntype StringStyleDeclaration = Partial<ConditionalPick<CSSStyleDeclaration, string>>\n\n/**\n * A type-safe version of `Object.assign` for `element.style`.\n */\nexport function assignStyles(\n element: HTMLElement | SVGElement | MathMLElement,\n styles: StringStyleDeclaration,\n): void {\n Object.assign(element.style, styles)\n}\n","import { createSignal, useEffect, type ConnectableElement, type ReadonlySignal } from '@aria-ui/core'\nimport { getNearestOverflowAncestor } from '@zag-js/dom-query'\n\nexport function useScrolling(host: ConnectableElement): ReadonlySignal<boolean> {\n const scrolling = createSignal(false)\n\n useEffect(host, () => {\n const scrollableParent = getNearestOverflowAncestor(host)\n\n const handleScroll = () => {\n scrolling.set(true)\n }\n\n const handleMouseMove = () => {\n scrolling.set(false)\n }\n\n scrollableParent.addEventListener('scroll', handleScroll, { passive: true })\n window.addEventListener('mousemove', handleMouseMove, { passive: true })\n window.addEventListener('pointermove', handleMouseMove, { passive: true })\n\n return () => {\n scrollableParent.removeEventListener('scroll', handleScroll)\n window.removeEventListener('mousemove', handleMouseMove)\n window.removeEventListener('pointermove', handleMouseMove)\n }\n })\n\n return scrolling\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,aACd,SACA,QACM;AACN,QAAO,OAAO,QAAQ,OAAO,OAAO;;;;;ACTtC,SAAgB,aAAa,MAAmD;CAC9E,MAAM,YAAY,aAAa,MAAM;AAErC,WAAU,YAAY;EACpB,MAAM,mBAAmB,2BAA2B,KAAK;EAEzD,MAAM,qBAAqB;AACzB,aAAU,IAAI,KAAK;;EAGrB,MAAM,wBAAwB;AAC5B,aAAU,IAAI,MAAM;;AAGtB,mBAAiB,iBAAiB,UAAU,cAAc,EAAE,SAAS,MAAM,CAAC;AAC5E,SAAO,iBAAiB,aAAa,iBAAiB,EAAE,SAAS,MAAM,CAAC;AACxE,SAAO,iBAAiB,eAAe,iBAAiB,EAAE,SAAS,MAAM,CAAC;AAE1E,eAAa;AACX,oBAAiB,oBAAoB,UAAU,aAAa;AAC5D,UAAO,oBAAoB,aAAa,gBAAgB;AACxD,UAAO,oBAAoB,eAAe,gBAAgB;;GAE5D;AAEF,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/web",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.10",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "A collection of web components for ProseKit",
|
|
7
7
|
"author": {
|
|
@@ -75,19 +75,19 @@
|
|
|
75
75
|
"@aria-ui/popover": "^0.0.28",
|
|
76
76
|
"@aria-ui/presence": "^0.0.20",
|
|
77
77
|
"@aria-ui/tooltip": "^0.0.30",
|
|
78
|
-
"@floating-ui/dom": "^1.7.
|
|
79
|
-
"@ocavue/utils": "^1.
|
|
80
|
-
"@zag-js/dom-query": "^1.
|
|
81
|
-
"prosemirror-tables": "^1.8.
|
|
82
|
-
"@prosekit/
|
|
83
|
-
"@prosekit/extensions": "^0.
|
|
84
|
-
"@prosekit/
|
|
78
|
+
"@floating-ui/dom": "^1.7.5",
|
|
79
|
+
"@ocavue/utils": "^1.4.0",
|
|
80
|
+
"@zag-js/dom-query": "^1.33.1",
|
|
81
|
+
"prosemirror-tables": "^1.8.5",
|
|
82
|
+
"@prosekit/core": "^0.10.0",
|
|
83
|
+
"@prosekit/extensions": "^0.14.0",
|
|
84
|
+
"@prosekit/pm": "^0.1.15"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"tsdown": "^0.
|
|
88
|
-
"type-fest": "^5.3
|
|
87
|
+
"tsdown": "^0.20.1",
|
|
88
|
+
"type-fest": "^5.4.3",
|
|
89
89
|
"typescript": "~5.9.3",
|
|
90
|
-
"vitest": "^4.0.
|
|
90
|
+
"vitest": "^4.0.18",
|
|
91
91
|
"@prosekit/config-tsdown": "0.0.0",
|
|
92
92
|
"@prosekit/config-vitest": "0.0.0"
|
|
93
93
|
},
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useEffect,
|
|
3
|
-
useEventListener,
|
|
4
|
-
type ConnectableElement,
|
|
5
|
-
type SetupOptions,
|
|
6
|
-
} from '@aria-ui/core'
|
|
1
|
+
import { useEffect, useEventListener, type ConnectableElement, type SetupOptions } from '@aria-ui/core'
|
|
7
2
|
import { useListboxItem } from '@aria-ui/listbox/elements'
|
|
8
3
|
|
|
9
4
|
import { openContext } from '../context'
|
|
10
5
|
|
|
11
|
-
import type {
|
|
12
|
-
AutocompleteItemEvents,
|
|
13
|
-
AutocompleteItemProps,
|
|
14
|
-
} from './types'
|
|
6
|
+
import type { AutocompleteItemEvents, AutocompleteItemProps } from './types'
|
|
15
7
|
|
|
16
8
|
/**
|
|
17
9
|
* @internal
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
PropDeclarations,
|
|
4
|
-
} from '@aria-ui/core'
|
|
5
|
-
import {
|
|
6
|
-
listboxItemEvents,
|
|
7
|
-
type ListboxItemEvents,
|
|
8
|
-
} from '@aria-ui/listbox'
|
|
1
|
+
import type { EventDeclarations, PropDeclarations } from '@aria-ui/core'
|
|
2
|
+
import { listboxItemEvents, type ListboxItemEvents } from '@aria-ui/listbox'
|
|
9
3
|
|
|
10
4
|
export interface AutocompleteItemProps {
|
|
11
5
|
/**
|
|
@@ -6,29 +6,13 @@ import {
|
|
|
6
6
|
type SetupOptions,
|
|
7
7
|
type TypedEventTarget,
|
|
8
8
|
} from '@aria-ui/core'
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
useListbox,
|
|
12
|
-
type ListboxProps,
|
|
13
|
-
} from '@aria-ui/listbox/elements'
|
|
14
|
-
import {
|
|
15
|
-
defineDOMEventHandler,
|
|
16
|
-
Priority,
|
|
17
|
-
withPriority,
|
|
18
|
-
type Editor,
|
|
19
|
-
} from '@prosekit/core'
|
|
9
|
+
import { listboxProps, useListbox, type ListboxProps } from '@aria-ui/listbox/elements'
|
|
10
|
+
import { defineDOMEventHandler, Priority, withPriority, type Editor } from '@prosekit/core'
|
|
20
11
|
|
|
21
12
|
import { getStateWithDefaults } from '../../../utils/get-default-state'
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
queryContext,
|
|
26
|
-
} from '../context'
|
|
27
|
-
|
|
28
|
-
import type {
|
|
29
|
-
AutocompleteListEvents,
|
|
30
|
-
AutocompleteListProps,
|
|
31
|
-
} from './types'
|
|
13
|
+
import { onSubmitContext, openContext, queryContext } from '../context'
|
|
14
|
+
|
|
15
|
+
import type { AutocompleteListEvents, AutocompleteListProps } from './types'
|
|
32
16
|
|
|
33
17
|
/**
|
|
34
18
|
* @internal
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
PropDeclarations,
|
|
4
|
-
} from '@aria-ui/core'
|
|
5
|
-
import {
|
|
6
|
-
listboxEvents,
|
|
7
|
-
listboxProps,
|
|
8
|
-
type ListboxEvents,
|
|
9
|
-
type ListboxProps,
|
|
10
|
-
} from '@aria-ui/listbox'
|
|
1
|
+
import type { EventDeclarations, PropDeclarations } from '@aria-ui/core'
|
|
2
|
+
import { listboxEvents, listboxProps, type ListboxEvents, type ListboxProps } from '@aria-ui/listbox'
|
|
11
3
|
import type { Editor } from '@prosekit/core'
|
|
12
4
|
|
|
13
5
|
export interface AutocompleteListProps extends Pick<ListboxProps, 'filter'> {
|
|
@@ -11,32 +11,16 @@ import {
|
|
|
11
11
|
} from '@aria-ui/core'
|
|
12
12
|
import { useOverlayPositionerState } from '@aria-ui/overlay/elements'
|
|
13
13
|
import { usePresence } from '@aria-ui/presence'
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
Priority,
|
|
17
|
-
withPriority,
|
|
18
|
-
type Editor,
|
|
19
|
-
} from '@prosekit/core'
|
|
20
|
-
import {
|
|
21
|
-
AutocompleteRule,
|
|
22
|
-
defineAutocomplete,
|
|
23
|
-
type MatchHandler,
|
|
24
|
-
} from '@prosekit/extensions/autocomplete'
|
|
14
|
+
import { defineKeymap, Priority, withPriority, type Editor } from '@prosekit/core'
|
|
15
|
+
import { AutocompleteRule, defineAutocomplete, type MatchHandler } from '@prosekit/extensions/autocomplete'
|
|
25
16
|
|
|
26
17
|
import { useEditorExtension } from '../../../hooks/use-editor-extension'
|
|
27
18
|
import { useFirstRendering } from '../../../hooks/use-first-rendering'
|
|
28
19
|
import { getSafeEditorView } from '../../../utils/get-safe-editor-view'
|
|
29
|
-
import {
|
|
30
|
-
onSubmitContext,
|
|
31
|
-
openContext,
|
|
32
|
-
queryContext,
|
|
33
|
-
} from '../context'
|
|
20
|
+
import { onSubmitContext, openContext, queryContext } from '../context'
|
|
34
21
|
|
|
35
22
|
import { defaultQueryBuilder } from './helpers'
|
|
36
|
-
import type {
|
|
37
|
-
AutocompletePopoverEvents,
|
|
38
|
-
AutocompletePopoverProps,
|
|
39
|
-
} from './types'
|
|
23
|
+
import type { AutocompletePopoverEvents, AutocompletePopoverProps } from './types'
|
|
40
24
|
|
|
41
25
|
/**
|
|
42
26
|
* @internal
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useEventListener,
|
|
3
|
-
type ConnectableElement,
|
|
4
|
-
type SignalState,
|
|
5
|
-
} from '@aria-ui/core'
|
|
1
|
+
import { useEventListener, type ConnectableElement, type SignalState } from '@aria-ui/core'
|
|
6
2
|
import { insertDefaultBlock } from '@prosekit/core'
|
|
7
3
|
|
|
8
4
|
import { blockPopoverContext } from '../context'
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useAttribute,
|
|
3
|
-
useEffect,
|
|
4
|
-
useEventListener,
|
|
5
|
-
type ConnectableElement,
|
|
6
|
-
type ReadonlySignal,
|
|
7
|
-
type SignalState,
|
|
8
|
-
} from '@aria-ui/core'
|
|
1
|
+
import { useAttribute, useEffect, useEventListener, type ConnectableElement, type ReadonlySignal, type SignalState } from '@aria-ui/core'
|
|
9
2
|
import { isHTMLElement } from '@ocavue/utils'
|
|
10
3
|
import type { Editor } from '@prosekit/core'
|
|
11
4
|
import type { ViewDragging } from '@prosekit/extensions/drop-indicator'
|
|
12
|
-
import {
|
|
13
|
-
Fragment,
|
|
14
|
-
Slice,
|
|
15
|
-
} from '@prosekit/pm/model'
|
|
5
|
+
import { Fragment, Slice } from '@prosekit/pm/model'
|
|
16
6
|
import { NodeSelection } from '@prosekit/pm/state'
|
|
17
7
|
import type { EditorView } from '@prosekit/pm/view'
|
|
18
8
|
|
|
19
9
|
import { getBoxElement } from '../../../utils/get-box-element'
|
|
20
10
|
import { getSafeEditorView } from '../../../utils/get-safe-editor-view'
|
|
21
|
-
import {
|
|
22
|
-
blockPopoverContext,
|
|
23
|
-
draggingContext,
|
|
24
|
-
type BlockPopoverContext,
|
|
25
|
-
type HoverState,
|
|
26
|
-
} from '../context'
|
|
11
|
+
import { blockPopoverContext, draggingContext, type BlockPopoverContext, type HoverState } from '../context'
|
|
27
12
|
|
|
28
13
|
import { setDragPreview } from './set-drag-preview'
|
|
29
14
|
import type { BlockHandleDraggableProps } from './types'
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import type { VirtualElement } from '@floating-ui/dom'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
isHTMLElement,
|
|
5
|
-
isTextNode,
|
|
6
|
-
} from '@ocavue/utils'
|
|
7
|
-
import {
|
|
8
|
-
defineDOMEventHandler,
|
|
9
|
-
union,
|
|
10
|
-
type PlainExtension,
|
|
11
|
-
} from '@prosekit/core'
|
|
2
|
+
import { isElement, isHTMLElement, isTextNode } from '@ocavue/utils'
|
|
3
|
+
import { defineDOMEventHandler, union, type PlainExtension } from '@prosekit/core'
|
|
12
4
|
import type { ProseMirrorNode } from '@prosekit/pm/model'
|
|
13
5
|
import type { EditorView } from '@prosekit/pm/view'
|
|
14
6
|
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createComputed,
|
|
3
|
-
createSignal,
|
|
4
|
-
useAttribute,
|
|
5
|
-
type ConnectableElement,
|
|
6
|
-
type ReadonlySignal,
|
|
7
|
-
type SetupOptions,
|
|
8
|
-
} from '@aria-ui/core'
|
|
1
|
+
import { createComputed, createSignal, useAttribute, type ConnectableElement, type ReadonlySignal, type SetupOptions } from '@aria-ui/core'
|
|
9
2
|
import { useOverlayPositionerState } from '@aria-ui/overlay/elements'
|
|
10
3
|
import { usePresence } from '@aria-ui/presence'
|
|
11
4
|
import type { VirtualElement } from '@floating-ui/dom'
|
|
@@ -13,21 +6,10 @@ import type { Editor } from '@prosekit/core'
|
|
|
13
6
|
|
|
14
7
|
import { useEditorExtension } from '../../../hooks/use-editor-extension'
|
|
15
8
|
import { useScrolling } from '../../../hooks/use-scrolling'
|
|
16
|
-
import {
|
|
17
|
-
blockPopoverContext,
|
|
18
|
-
draggingContext,
|
|
19
|
-
type BlockPopoverContext,
|
|
20
|
-
type HoverState,
|
|
21
|
-
} from '../context'
|
|
9
|
+
import { blockPopoverContext, draggingContext, type BlockPopoverContext, type HoverState } from '../context'
|
|
22
10
|
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
type ElementHoverHandler,
|
|
26
|
-
} from './pointer-move'
|
|
27
|
-
import type {
|
|
28
|
-
BlockHandlePopoverEvents,
|
|
29
|
-
BlockHandlePopoverProps,
|
|
30
|
-
} from './types'
|
|
11
|
+
import { defineElementHoverHandler, type ElementHoverHandler } from './pointer-move'
|
|
12
|
+
import type { BlockHandlePopoverEvents, BlockHandlePopoverProps } from './types'
|
|
31
13
|
|
|
32
14
|
/**
|
|
33
15
|
* @internal
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createComputed,
|
|
3
|
-
createSignal,
|
|
4
|
-
useEffect,
|
|
5
|
-
type ConnectableElement,
|
|
6
|
-
type SetupOptions,
|
|
7
|
-
} from '@aria-ui/core'
|
|
1
|
+
import { createComputed, createSignal, useEffect, type ConnectableElement, type SetupOptions } from '@aria-ui/core'
|
|
8
2
|
import { usePresence } from '@aria-ui/presence'
|
|
9
|
-
import {
|
|
10
|
-
defineDropIndicator,
|
|
11
|
-
type ShowHandlerOptions,
|
|
12
|
-
} from '@prosekit/extensions/drop-indicator'
|
|
3
|
+
import { defineDropIndicator, type ShowHandlerOptions } from '@prosekit/extensions/drop-indicator'
|
|
13
4
|
|
|
14
5
|
import { useEditorExtension } from '../../../hooks/use-editor-extension'
|
|
15
6
|
import { useScrolling } from '../../../hooks/use-scrolling'
|
|
16
7
|
import { assignStyles } from '../../../utils/assign-styles'
|
|
17
8
|
|
|
18
|
-
import type {
|
|
19
|
-
DropIndicatorEvents,
|
|
20
|
-
DropIndicatorProps,
|
|
21
|
-
} from './types'
|
|
9
|
+
import type { DropIndicatorEvents, DropIndicatorProps } from './types'
|
|
22
10
|
|
|
23
11
|
/**
|
|
24
12
|
* @internal
|
|
@@ -17,10 +17,7 @@ import { useEditorFocusChangeEvent } from '../../../hooks/use-editor-focus-event
|
|
|
17
17
|
import { useEditorUpdateEvent } from '../../../hooks/use-editor-update-event'
|
|
18
18
|
import { useKeymap } from '../../../hooks/use-keymap'
|
|
19
19
|
|
|
20
|
-
import type {
|
|
21
|
-
InlinePopoverEvents,
|
|
22
|
-
InlinePopoverProps,
|
|
23
|
-
} from './types'
|
|
20
|
+
import type { InlinePopoverEvents, InlinePopoverProps } from './types'
|
|
24
21
|
import { getVirtualSelectionElement } from './virtual-selection-element'
|
|
25
22
|
|
|
26
23
|
/**
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { ReferenceElement } from '@floating-ui/dom'
|
|
2
|
-
import {
|
|
3
|
-
containsInlineNode,
|
|
4
|
-
isInCodeBlock,
|
|
5
|
-
isTextSelection,
|
|
6
|
-
} from '@prosekit/core'
|
|
2
|
+
import { containsInlineNode, isInCodeBlock, isTextSelection } from '@prosekit/core'
|
|
7
3
|
import type { EditorView } from '@prosekit/pm/view'
|
|
8
4
|
|
|
9
5
|
export function getVirtualSelectionElement(
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
PopoverContentEvents as Events,
|
|
3
|
-
PopoverContentProps as Props,
|
|
4
|
-
} from '@aria-ui/popover/elements'
|
|
1
|
+
import type { PopoverContentEvents as Events, PopoverContentProps as Props } from '@aria-ui/popover/elements'
|
|
5
2
|
|
|
6
|
-
export {
|
|
7
|
-
popoverContentEvents,
|
|
8
|
-
popoverContentProps,
|
|
9
|
-
} from '@aria-ui/popover/elements'
|
|
3
|
+
export { popoverContentEvents, popoverContentProps } from '@aria-ui/popover/elements'
|
|
10
4
|
|
|
11
5
|
export interface PopoverContentProps extends Props {}
|
|
12
6
|
export interface PopoverContentEvents extends Events {}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
PopoverRootEvents as Events,
|
|
3
|
-
PopoverRootProps as Props,
|
|
4
|
-
} from '@aria-ui/popover/elements'
|
|
1
|
+
import type { PopoverRootEvents as Events, PopoverRootProps as Props } from '@aria-ui/popover/elements'
|
|
5
2
|
|
|
6
|
-
export {
|
|
7
|
-
popoverRootEvents,
|
|
8
|
-
popoverRootProps,
|
|
9
|
-
} from '@aria-ui/popover/elements'
|
|
3
|
+
export { popoverRootEvents, popoverRootProps } from '@aria-ui/popover/elements'
|
|
10
4
|
|
|
11
5
|
export interface PopoverRootProps extends Props {}
|
|
12
6
|
export interface PopoverRootEvents extends Events {}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
PopoverTriggerEvents as Events,
|
|
3
|
-
PopoverTriggerProps as Props,
|
|
4
|
-
} from '@aria-ui/popover/elements'
|
|
1
|
+
import type { PopoverTriggerEvents as Events, PopoverTriggerProps as Props } from '@aria-ui/popover/elements'
|
|
5
2
|
|
|
6
|
-
export {
|
|
7
|
-
popoverTriggerEvents,
|
|
8
|
-
popoverTriggerProps,
|
|
9
|
-
} from '@aria-ui/popover/elements'
|
|
3
|
+
export { popoverTriggerEvents, popoverTriggerProps } from '@aria-ui/popover/elements'
|
|
10
4
|
|
|
11
5
|
export interface PopoverTriggerProps extends Props {}
|
|
12
6
|
export interface PopoverTriggerEvents extends Events {}
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createSignal,
|
|
3
|
-
useEffect,
|
|
4
|
-
type ConnectableElement,
|
|
5
|
-
type ReadonlySignal,
|
|
6
|
-
type SignalState,
|
|
7
|
-
} from '@aria-ui/core'
|
|
1
|
+
import { createSignal, useEffect, type ConnectableElement, type ReadonlySignal, type SignalState } from '@aria-ui/core'
|
|
8
2
|
import { getWindow } from '@ocavue/utils'
|
|
9
3
|
|
|
10
|
-
import {
|
|
11
|
-
onResizeContext,
|
|
12
|
-
onResizeEndContext,
|
|
13
|
-
onResizeStartContext,
|
|
14
|
-
type OnResize,
|
|
15
|
-
type OnResizeEnd,
|
|
16
|
-
type OnResizeStart,
|
|
17
|
-
} from '../context'
|
|
4
|
+
import { onResizeContext, onResizeEndContext, onResizeStartContext, type OnResize, type OnResizeEnd, type OnResizeStart } from '../context'
|
|
18
5
|
|
|
19
6
|
import { calcResize } from './calc-resize'
|
|
20
7
|
import type { ResizableHandleProps } from './types'
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createSignal,
|
|
3
|
-
useAttribute,
|
|
4
|
-
useEffect,
|
|
5
|
-
type ConnectableElement,
|
|
6
|
-
type SetupOptions,
|
|
7
|
-
} from '@aria-ui/core'
|
|
1
|
+
import { createSignal, useAttribute, useEffect, type ConnectableElement, type SetupOptions } from '@aria-ui/core'
|
|
8
2
|
|
|
9
3
|
import { isFinitePositiveNumber } from '../../../utils/is-finite-positive-number'
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
onResizeStartContext,
|
|
14
|
-
type OnResize,
|
|
15
|
-
type OnResizeEnd,
|
|
16
|
-
type OnResizeStart,
|
|
17
|
-
} from '../context'
|
|
18
|
-
|
|
19
|
-
import type {
|
|
20
|
-
ResizableRootEvents,
|
|
21
|
-
ResizableRootProps,
|
|
22
|
-
} from './types'
|
|
4
|
+
import { onResizeContext, onResizeEndContext, onResizeStartContext, type OnResize, type OnResizeEnd, type OnResizeStart } from '../context'
|
|
5
|
+
|
|
6
|
+
import type { ResizableRootEvents, ResizableRootProps } from './types'
|
|
23
7
|
|
|
24
8
|
/**
|
|
25
9
|
* @internal
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createContext,
|
|
3
|
-
type Context,
|
|
4
|
-
} from '@aria-ui/core'
|
|
1
|
+
import { createContext, type Context } from '@aria-ui/core'
|
|
5
2
|
|
|
6
|
-
import type {
|
|
7
|
-
DndInfo,
|
|
8
|
-
HoveringCellInfo,
|
|
9
|
-
} from './utils'
|
|
3
|
+
import type { DndInfo, HoveringCellInfo } from './utils'
|
|
10
4
|
|
|
11
5
|
/**
|
|
12
6
|
* @internal
|