@prosekit/web 0.5.5 → 0.5.7
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.
|
@@ -96,15 +96,17 @@ function useDraggingPreview(host, context, editor) {
|
|
|
96
96
|
if (!hoverState || !view || !event.dataTransfer) {
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
const { element, node } = hoverState;
|
|
99
|
+
const { element, node, pos } = hoverState;
|
|
100
100
|
event.dataTransfer.clearData();
|
|
101
101
|
event.dataTransfer.setData("text/html", element.outerHTML);
|
|
102
102
|
event.dataTransfer.effectAllowed = "copyMove";
|
|
103
103
|
event.dataTransfer.setDragImage(element, 0, 0);
|
|
104
|
-
|
|
104
|
+
const dragging = {
|
|
105
105
|
slice: new Slice(Fragment.from(node), 0, 0),
|
|
106
|
-
move: true
|
|
106
|
+
move: true,
|
|
107
|
+
node: NodeSelection.create(view.state.doc, pos)
|
|
107
108
|
};
|
|
109
|
+
view.dragging = dragging;
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
function useDataDraggingAttribute(host) {
|
|
@@ -247,7 +249,7 @@ function findBlockByCoordinate(view, x, y) {
|
|
|
247
249
|
let parent = view.state.doc;
|
|
248
250
|
let pos = -1;
|
|
249
251
|
while (parent) {
|
|
250
|
-
if (parent.isBlock && (parent.isTextblock || parent.isAtom)) {
|
|
252
|
+
if (parent.isBlock && (parent.isTextblock || parent.isAtom || parent.type.spec.isolating)) {
|
|
251
253
|
return { node: parent, pos };
|
|
252
254
|
}
|
|
253
255
|
const children = [];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosekit/web",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.7",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "ocavue",
|
|
@@ -27,42 +27,34 @@
|
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
29
|
"types": "./dist/prosekit-web.d.ts",
|
|
30
|
-
"import": "./dist/prosekit-web.js",
|
|
31
30
|
"default": "./dist/prosekit-web.js"
|
|
32
31
|
},
|
|
33
32
|
"./autocomplete": {
|
|
34
33
|
"types": "./dist/prosekit-web-autocomplete.d.ts",
|
|
35
|
-
"import": "./dist/prosekit-web-autocomplete.js",
|
|
36
34
|
"default": "./dist/prosekit-web-autocomplete.js"
|
|
37
35
|
},
|
|
38
36
|
"./block-handle": {
|
|
39
37
|
"types": "./dist/prosekit-web-block-handle.d.ts",
|
|
40
|
-
"import": "./dist/prosekit-web-block-handle.js",
|
|
41
38
|
"default": "./dist/prosekit-web-block-handle.js"
|
|
42
39
|
},
|
|
43
40
|
"./inline-popover": {
|
|
44
41
|
"types": "./dist/prosekit-web-inline-popover.d.ts",
|
|
45
|
-
"import": "./dist/prosekit-web-inline-popover.js",
|
|
46
42
|
"default": "./dist/prosekit-web-inline-popover.js"
|
|
47
43
|
},
|
|
48
44
|
"./popover": {
|
|
49
45
|
"types": "./dist/prosekit-web-popover.d.ts",
|
|
50
|
-
"import": "./dist/prosekit-web-popover.js",
|
|
51
46
|
"default": "./dist/prosekit-web-popover.js"
|
|
52
47
|
},
|
|
53
48
|
"./resizable": {
|
|
54
49
|
"types": "./dist/prosekit-web-resizable.d.ts",
|
|
55
|
-
"import": "./dist/prosekit-web-resizable.js",
|
|
56
50
|
"default": "./dist/prosekit-web-resizable.js"
|
|
57
51
|
},
|
|
58
52
|
"./table-handle": {
|
|
59
53
|
"types": "./dist/prosekit-web-table-handle.d.ts",
|
|
60
|
-
"import": "./dist/prosekit-web-table-handle.js",
|
|
61
54
|
"default": "./dist/prosekit-web-table-handle.js"
|
|
62
55
|
},
|
|
63
56
|
"./tooltip": {
|
|
64
57
|
"types": "./dist/prosekit-web-tooltip.d.ts",
|
|
65
|
-
"import": "./dist/prosekit-web-tooltip.js",
|
|
66
58
|
"default": "./dist/prosekit-web-tooltip.js"
|
|
67
59
|
}
|
|
68
60
|
},
|
|
@@ -70,27 +62,27 @@
|
|
|
70
62
|
"dist"
|
|
71
63
|
],
|
|
72
64
|
"dependencies": {
|
|
73
|
-
"@aria-ui/collection": "^0.0.
|
|
74
|
-
"@aria-ui/core": "^0.0.
|
|
75
|
-
"@aria-ui/listbox": "^0.0.
|
|
76
|
-
"@aria-ui/menu": "^0.0.
|
|
77
|
-
"@aria-ui/overlay": "^0.0.
|
|
78
|
-
"@aria-ui/popover": "^0.0.
|
|
79
|
-
"@aria-ui/presence": "^0.0.
|
|
80
|
-
"@aria-ui/tooltip": "^0.0.
|
|
65
|
+
"@aria-ui/collection": "^0.0.5",
|
|
66
|
+
"@aria-ui/core": "^0.0.21",
|
|
67
|
+
"@aria-ui/listbox": "^0.0.24",
|
|
68
|
+
"@aria-ui/menu": "^0.0.19",
|
|
69
|
+
"@aria-ui/overlay": "^0.0.24",
|
|
70
|
+
"@aria-ui/popover": "^0.0.27",
|
|
71
|
+
"@aria-ui/presence": "^0.0.19",
|
|
72
|
+
"@aria-ui/tooltip": "^0.0.29",
|
|
81
73
|
"@floating-ui/dom": "^1.6.13",
|
|
82
|
-
"@zag-js/dom-query": "^
|
|
74
|
+
"@zag-js/dom-query": "^1.5.0",
|
|
83
75
|
"just-map-values": "^3.2.0",
|
|
84
76
|
"just-omit": "^2.2.0",
|
|
85
|
-
"prosemirror-tables": "^1.6.
|
|
86
|
-
"@prosekit/core": "^0.
|
|
87
|
-
"@prosekit/
|
|
88
|
-
"@prosekit/
|
|
77
|
+
"prosemirror-tables": "^1.6.4",
|
|
78
|
+
"@prosekit/core": "^0.8.0",
|
|
79
|
+
"@prosekit/extensions": "^0.8.0",
|
|
80
|
+
"@prosekit/pm": "^0.1.9"
|
|
89
81
|
},
|
|
90
82
|
"devDependencies": {
|
|
91
|
-
"tsup": "^8.
|
|
92
|
-
"typescript": "~5.7.
|
|
93
|
-
"vitest": "^3.0.
|
|
83
|
+
"tsup": "^8.4.0",
|
|
84
|
+
"typescript": "~5.7.3",
|
|
85
|
+
"vitest": "^3.0.9",
|
|
94
86
|
"@prosekit/dev": "0.0.0"
|
|
95
87
|
},
|
|
96
88
|
"scripts": {
|