@nordcraft/runtime 1.0.6 → 1.0.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.
- package/dist/custom-element.main.esm.js +1 -1
- package/dist/custom-element.main.esm.js.map +4 -4
- package/dist/editor-preview.main.js +6 -0
- package/dist/editor-preview.main.js.map +1 -1
- package/dist/page.main.esm.js +1 -1
- package/dist/page.main.esm.js.map +4 -4
- package/package.json +3 -3
- package/src/editor-preview.main.ts +8 -0
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://github.com/nordcraftengine/nordcraft",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@nordcraft/core": "1.0.
|
|
8
|
-
"@nordcraft/std-lib": "1.0.
|
|
7
|
+
"@nordcraft/core": "1.0.7",
|
|
8
|
+
"@nordcraft/std-lib": "1.0.7",
|
|
9
9
|
"fast-deep-equal": "3.1.3",
|
|
10
10
|
"path-to-regexp": "6.3.0"
|
|
11
11
|
},
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"files": ["dist", "src"],
|
|
22
22
|
"main": "dist/page.main.js",
|
|
23
23
|
"types": "dist/page.main.d.ts",
|
|
24
|
-
"version": "1.0.
|
|
24
|
+
"version": "1.0.7"
|
|
25
25
|
}
|
|
@@ -533,6 +533,14 @@ export const createRoot = (
|
|
|
533
533
|
dragState.initialContainer.getBoundingClientRect(),
|
|
534
534
|
{ x, y },
|
|
535
535
|
)
|
|
536
|
+
|
|
537
|
+
// Move the element towards the cursor when out of bounds
|
|
538
|
+
const rect = dragState.element.getBoundingClientRect()
|
|
539
|
+
if (!rectHasPoint(rect, { x, y })) {
|
|
540
|
+
dragState.offset.x -= (x - (rect.left + rect.width / 2)) * 0.1
|
|
541
|
+
dragState.offset.y -= (y - (rect.top + rect.height / 2)) * 0.1
|
|
542
|
+
}
|
|
543
|
+
|
|
536
544
|
if (draggingInsideContainer && !metaKey) {
|
|
537
545
|
dragReorder(dragState)
|
|
538
546
|
} else {
|