@innovastudio/contentbox 1.6.120 → 1.6.121
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
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@innovastudio/contentbox",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.6.
|
4
|
+
"version": "1.6.121",
|
5
5
|
"description": "",
|
6
6
|
"main": "public/contentbox/contentbox.esm.js",
|
7
7
|
"types": "index.d.ts",
|
@@ -59,7 +59,7 @@
|
|
59
59
|
"ws": "^8.13.0"
|
60
60
|
},
|
61
61
|
"dependencies": {
|
62
|
-
"@innovastudio/contentbuilder": "^1.5.
|
62
|
+
"@innovastudio/contentbuilder": "^1.5.118",
|
63
63
|
"js-beautify": "^1.14.0",
|
64
64
|
"sortablejs": "^1.15.2"
|
65
65
|
}
|
@@ -1,4 +1,8 @@
|
|
1
|
-
/*
|
1
|
+
/*
|
2
|
+
@import url("../ionicons/css/ionicons.min.css");
|
3
|
+
@import url("../icons/bootstrap-icons.min.css");
|
4
|
+
*/
|
5
|
+
@import url("https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.0/css/ionicons.min.css");
|
2
6
|
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");
|
3
7
|
/* IFRAME */
|
4
8
|
.is-content-view.desktop-lg {
|
@@ -72038,14 +72038,24 @@ class DragDropImageUploader {
|
|
72038
72038
|
this.isAttached = false;
|
72039
72039
|
}
|
72040
72040
|
_getImageUnderCursor(e) {
|
72041
|
+
const x = e.clientX;
|
72042
|
+
const y = e.clientY;
|
72041
72043
|
const doc = this.element.ownerDocument || document;
|
72042
|
-
const range = doc.caretRangeFromPoint ? doc.caretRangeFromPoint(e.clientX, e.clientY) : doc.caretPositionFromPoint(e.clientX, e.clientY);
|
72043
|
-
if (!range) return null;
|
72044
|
-
const node = range.startContainer.nodeType === 1 ? range.startContainer : range.startContainer.parentElement;
|
72045
72044
|
if (this.element.getAttribute('id') === 'divImageResizer') {
|
72046
72045
|
return this.builder.activeImage;
|
72047
72046
|
}
|
72048
|
-
|
72047
|
+
|
72048
|
+
// Use elementFromPoint for reliability across browsers
|
72049
|
+
const elementAtPoint = doc.elementFromPoint(x, y);
|
72050
|
+
if (!elementAtPoint) return null;
|
72051
|
+
|
72052
|
+
// If the element itself is an image, return it
|
72053
|
+
if (elementAtPoint.tagName === 'IMG') {
|
72054
|
+
return elementAtPoint;
|
72055
|
+
}
|
72056
|
+
|
72057
|
+
// Otherwise, check if it contains an image (e.g., inside a div, anchor, etc.)
|
72058
|
+
return elementAtPoint.querySelector && elementAtPoint.querySelector('img');
|
72049
72059
|
}
|
72050
72060
|
async _onDrop(e) {
|
72051
72061
|
e.preventDefault();
|