@innovastudio/contentbox 1.6.120 → 1.6.122
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.122",
|
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.119",
|
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 {
|
@@ -44582,7 +44582,8 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
44582
44582
|
// let safariAgent = false;
|
44583
44583
|
|
44584
44584
|
let activeBuilderArea;
|
44585
|
-
|
44585
|
+
|
44586
|
+
// let itemHeight;
|
44586
44587
|
|
44587
44588
|
/*
|
44588
44589
|
const isMobile = dom.detectMobileOrTablet();
|
@@ -44613,7 +44614,8 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
44613
44614
|
|
44614
44615
|
sort: false,
|
44615
44616
|
animation: 150,
|
44616
|
-
onChoose:
|
44617
|
+
onChoose: () => {
|
44618
|
+
//evt
|
44617
44619
|
// Adjust temmporary
|
44618
44620
|
const newCss = `
|
44619
44621
|
<style id="css-scale">
|
@@ -44625,7 +44627,9 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
44625
44627
|
}
|
44626
44628
|
</style>
|
44627
44629
|
`;
|
44628
|
-
|
44630
|
+
|
44631
|
+
// itemHeight = evt.item.offsetHeight;
|
44632
|
+
|
44629
44633
|
if (builder.iframe) {
|
44630
44634
|
const oldCss = builder.contentStuff.querySelector('#css-scale');
|
44631
44635
|
if (oldCss) oldCss.parentNode.removeChild(oldCss);
|
@@ -44641,16 +44645,18 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
44641
44645
|
builder.util.clearPops();
|
44642
44646
|
builder.hideElementTools();
|
44643
44647
|
},
|
44644
|
-
|
44645
|
-
|
44646
|
-
|
44647
|
-
|
44648
|
-
|
44649
|
-
|
44650
|
-
|
44651
|
-
|
44652
|
-
|
44648
|
+
/*
|
44649
|
+
onClone: (evt) =>{
|
44650
|
+
// fix broken image on cloned element
|
44651
|
+
var cloneEl = evt.clone;
|
44652
|
+
let img = cloneEl.querySelector('img');
|
44653
|
+
img.style.opacity = 0.0001;
|
44654
|
+
cloneEl.style.height = itemHeight + 'px';
|
44655
|
+
let timestamp = new Date().getTime();
|
44656
|
+
img.src = img.src+'?'+timestamp;
|
44657
|
+
img.style.opacity = '';
|
44653
44658
|
},
|
44659
|
+
*/
|
44654
44660
|
onMove: () => {
|
44655
44661
|
let emptyinfo = builder.doc.querySelector('.row-add-initial'); // if there is empty info, remove it during snippet drag drop
|
44656
44662
|
// if(emptyinfo) emptyinfo.parentNode.removeChild(emptyinfo);
|
@@ -72038,14 +72044,24 @@ class DragDropImageUploader {
|
|
72038
72044
|
this.isAttached = false;
|
72039
72045
|
}
|
72040
72046
|
_getImageUnderCursor(e) {
|
72047
|
+
const x = e.clientX;
|
72048
|
+
const y = e.clientY;
|
72041
72049
|
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
72050
|
if (this.element.getAttribute('id') === 'divImageResizer') {
|
72046
72051
|
return this.builder.activeImage;
|
72047
72052
|
}
|
72048
|
-
|
72053
|
+
|
72054
|
+
// Use elementFromPoint for reliability across browsers
|
72055
|
+
const elementAtPoint = doc.elementFromPoint(x, y);
|
72056
|
+
if (!elementAtPoint) return null;
|
72057
|
+
|
72058
|
+
// If the element itself is an image, return it
|
72059
|
+
if (elementAtPoint.tagName === 'IMG') {
|
72060
|
+
return elementAtPoint;
|
72061
|
+
}
|
72062
|
+
|
72063
|
+
// Otherwise, check if it contains an image (e.g., inside a div, anchor, etc.)
|
72064
|
+
return elementAtPoint.querySelector && elementAtPoint.querySelector('img');
|
72049
72065
|
}
|
72050
72066
|
async _onDrop(e) {
|
72051
72067
|
e.preventDefault();
|