svelte-dnd-action 0.9.32 → 0.9.34
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/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +18 -13
- package/src/helpers/svelteNodeClone.js +2 -3
- package/src/pointerAction.js +2 -2
package/dist/index.js
CHANGED
|
@@ -1679,8 +1679,8 @@
|
|
|
1679
1679
|
var currentIdx = elToIdx.get(originalDragTarget);
|
|
1680
1680
|
originIndex = currentIdx;
|
|
1681
1681
|
originDropZone = originalDragTarget.parentElement;
|
|
1682
|
-
/** @type {ShadowRoot | HTMLDocument} */
|
|
1683
|
-
var rootNode = originDropZone.getRootNode();
|
|
1682
|
+
/** @type {ShadowRoot | HTMLDocument | Element } */
|
|
1683
|
+
var rootNode = originDropZone.closest("dialog") || originDropZone.getRootNode();
|
|
1684
1684
|
var originDropZoneRoot = rootNode.body || rootNode;
|
|
1685
1685
|
var items = config.items,
|
|
1686
1686
|
type = config.type,
|
package/dist/index.mjs
CHANGED
|
@@ -1673,8 +1673,8 @@ function dndzone(node, options) {
|
|
|
1673
1673
|
var currentIdx = elToIdx.get(originalDragTarget);
|
|
1674
1674
|
originIndex = currentIdx;
|
|
1675
1675
|
originDropZone = originalDragTarget.parentElement;
|
|
1676
|
-
/** @type {ShadowRoot | HTMLDocument} */
|
|
1677
|
-
var rootNode = originDropZone.getRootNode();
|
|
1676
|
+
/** @type {ShadowRoot | HTMLDocument | Element } */
|
|
1677
|
+
var rootNode = originDropZone.closest("dialog") || originDropZone.getRootNode();
|
|
1678
1678
|
var originDropZoneRoot = rootNode.body || rootNode;
|
|
1679
1679
|
var items = config.items,
|
|
1680
1680
|
type = config.type,
|
package/package.json
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-dnd-action",
|
|
3
|
-
"
|
|
3
|
+
"description": "*An awesome drag and drop library for Svelte 3 and 4 (not using the browser's built-in dnd, thanks god): Rich animations, nested containers, touch support and more *",
|
|
4
|
+
"version": "0.9.34",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/isaacHagoel/svelte-dnd-action.git"
|
|
8
|
+
},
|
|
9
|
+
"author": "Isaac Hagoel",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/isaacHagoel/svelte-dnd-action/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/isaacHagoel/svelte-dnd-action#readme",
|
|
4
15
|
"module": "dist/index.mjs",
|
|
5
16
|
"main": "dist/index.js",
|
|
6
17
|
"types": "dist/index.d.ts",
|
|
18
|
+
"svelte": "src/index.js",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"svelte": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
7
24
|
"scripts": {
|
|
8
25
|
"test": "cypress run",
|
|
9
26
|
"lint": "eslint .",
|
|
@@ -42,18 +59,6 @@
|
|
|
42
59
|
"src",
|
|
43
60
|
"dist"
|
|
44
61
|
],
|
|
45
|
-
"description": "*An awesome drag and drop library for Svelte 3 and 4 (not using the browser's built-in dnd, thanks god): Rich animations, nested containers, touch support and more *",
|
|
46
|
-
"version": "0.9.32",
|
|
47
|
-
"repository": {
|
|
48
|
-
"type": "git",
|
|
49
|
-
"url": "git+https://github.com/isaacHagoel/svelte-dnd-action.git"
|
|
50
|
-
},
|
|
51
|
-
"author": "Isaac Hagoel",
|
|
52
|
-
"license": "MIT",
|
|
53
|
-
"bugs": {
|
|
54
|
-
"url": "https://github.com/isaacHagoel/svelte-dnd-action/issues"
|
|
55
|
-
},
|
|
56
|
-
"homepage": "https://github.com/isaacHagoel/svelte-dnd-action#readme",
|
|
57
62
|
"husky": {
|
|
58
63
|
"hooks": {
|
|
59
64
|
"pre-commit": "lint-staged"
|
|
@@ -31,15 +31,14 @@ export function svelteNodeClone(el) {
|
|
|
31
31
|
|
|
32
32
|
const elIsCanvas = el.tagName === "CANVAS";
|
|
33
33
|
const canvases = elIsCanvas ? [el] : [...el.querySelectorAll("canvas")];
|
|
34
|
-
if(canvases.length > 0)
|
|
35
|
-
{
|
|
34
|
+
if (canvases.length > 0) {
|
|
36
35
|
const clonedCanvases = elIsCanvas ? [cloned] : [...cloned.querySelectorAll("canvas")];
|
|
37
36
|
for (let i = 0; i < clonedCanvases.length; i++) {
|
|
38
37
|
const canvas = canvases[i];
|
|
39
38
|
const clonedCanvas = clonedCanvases[i];
|
|
40
39
|
clonedCanvas.width = canvas.width;
|
|
41
40
|
clonedCanvas.height = canvas.height;
|
|
42
|
-
clonedCanvas.getContext("2d").drawImage(canvas,0,0);
|
|
41
|
+
clonedCanvas.getContext("2d").drawImage(canvas, 0, 0);
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
44
|
|
package/src/pointerAction.js
CHANGED
|
@@ -383,8 +383,8 @@ export function dndzone(node, options) {
|
|
|
383
383
|
const currentIdx = elToIdx.get(originalDragTarget);
|
|
384
384
|
originIndex = currentIdx;
|
|
385
385
|
originDropZone = originalDragTarget.parentElement;
|
|
386
|
-
/** @type {ShadowRoot | HTMLDocument} */
|
|
387
|
-
const rootNode = originDropZone.getRootNode();
|
|
386
|
+
/** @type {ShadowRoot | HTMLDocument | Element } */
|
|
387
|
+
const rootNode = originDropZone.closest("dialog") || originDropZone.getRootNode();
|
|
388
388
|
const originDropZoneRoot = rootNode.body || rootNode;
|
|
389
389
|
const {items, type, centreDraggedOnCursor} = config;
|
|
390
390
|
draggedElData = {...items[currentIdx]};
|