@innovastudio/contentbuilder 1.5.117 → 1.5.119
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
@@ -18071,7 +18071,8 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
18071
18071
|
// let safariAgent = false;
|
18072
18072
|
|
18073
18073
|
let activeBuilderArea;
|
18074
|
-
|
18074
|
+
|
18075
|
+
// let itemHeight;
|
18075
18076
|
|
18076
18077
|
/*
|
18077
18078
|
const isMobile = dom.detectMobileOrTablet();
|
@@ -18102,7 +18103,8 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
18102
18103
|
|
18103
18104
|
sort: false,
|
18104
18105
|
animation: 150,
|
18105
|
-
onChoose:
|
18106
|
+
onChoose: () => {
|
18107
|
+
//evt
|
18106
18108
|
// Adjust temmporary
|
18107
18109
|
const newCss = `
|
18108
18110
|
<style id="css-scale">
|
@@ -18114,7 +18116,9 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
18114
18116
|
}
|
18115
18117
|
</style>
|
18116
18118
|
`;
|
18117
|
-
|
18119
|
+
|
18120
|
+
// itemHeight = evt.item.offsetHeight;
|
18121
|
+
|
18118
18122
|
if (builder.iframe) {
|
18119
18123
|
const oldCss = builder.contentStuff.querySelector('#css-scale');
|
18120
18124
|
if (oldCss) oldCss.parentNode.removeChild(oldCss);
|
@@ -18130,16 +18134,18 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
18130
18134
|
builder.util.clearPops();
|
18131
18135
|
builder.hideElementTools();
|
18132
18136
|
},
|
18133
|
-
|
18134
|
-
|
18135
|
-
|
18136
|
-
|
18137
|
-
|
18138
|
-
|
18139
|
-
|
18140
|
-
|
18141
|
-
|
18137
|
+
/*
|
18138
|
+
onClone: (evt) =>{
|
18139
|
+
// fix broken image on cloned element
|
18140
|
+
var cloneEl = evt.clone;
|
18141
|
+
let img = cloneEl.querySelector('img');
|
18142
|
+
img.style.opacity = 0.0001;
|
18143
|
+
cloneEl.style.height = itemHeight + 'px';
|
18144
|
+
let timestamp = new Date().getTime();
|
18145
|
+
img.src = img.src+'?'+timestamp;
|
18146
|
+
img.style.opacity = '';
|
18142
18147
|
},
|
18148
|
+
*/
|
18143
18149
|
onMove: () => {
|
18144
18150
|
let emptyinfo = builder.doc.querySelector('.row-add-initial'); // if there is empty info, remove it during snippet drag drop
|
18145
18151
|
// if(emptyinfo) emptyinfo.parentNode.removeChild(emptyinfo);
|
@@ -45527,14 +45533,24 @@ class DragDropImageUploader {
|
|
45527
45533
|
this.isAttached = false;
|
45528
45534
|
}
|
45529
45535
|
_getImageUnderCursor(e) {
|
45536
|
+
const x = e.clientX;
|
45537
|
+
const y = e.clientY;
|
45530
45538
|
const doc = this.element.ownerDocument || document;
|
45531
|
-
const range = doc.caretRangeFromPoint ? doc.caretRangeFromPoint(e.clientX, e.clientY) : doc.caretPositionFromPoint(e.clientX, e.clientY);
|
45532
|
-
if (!range) return null;
|
45533
|
-
const node = range.startContainer.nodeType === 1 ? range.startContainer : range.startContainer.parentElement;
|
45534
45539
|
if (this.element.getAttribute('id') === 'divImageResizer') {
|
45535
45540
|
return this.builder.activeImage;
|
45536
45541
|
}
|
45537
|
-
|
45542
|
+
|
45543
|
+
// Use elementFromPoint for reliability across browsers
|
45544
|
+
const elementAtPoint = doc.elementFromPoint(x, y);
|
45545
|
+
if (!elementAtPoint) return null;
|
45546
|
+
|
45547
|
+
// If the element itself is an image, return it
|
45548
|
+
if (elementAtPoint.tagName === 'IMG') {
|
45549
|
+
return elementAtPoint;
|
45550
|
+
}
|
45551
|
+
|
45552
|
+
// Otherwise, check if it contains an image (e.g., inside a div, anchor, etc.)
|
45553
|
+
return elementAtPoint.querySelector && elementAtPoint.querySelector('img');
|
45538
45554
|
}
|
45539
45555
|
async _onDrop(e) {
|
45540
45556
|
e.preventDefault();
|