@nordcraft/runtime 1.0.6 → 1.0.8

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/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.6",
8
- "@nordcraft/std-lib": "1.0.6",
7
+ "@nordcraft/core": "1.0.8",
8
+ "@nordcraft/std-lib": "1.0.8",
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.6"
24
+ "version": "1.0.8"
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 {