@innovastudio/contentbuilder 1.3.63 → 1.3.65
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
@@ -57438,6 +57438,10 @@ class ColumnTool {
|
|
57438
57438
|
<input type="range" min="0" max="100" value="0" class="image-vert-slider is-rangeslider">
|
57439
57439
|
</div>
|
57440
57440
|
|
57441
|
+
<div style="padding-bottom:3px;padding-top: 10px;display:flex;justify-content:right;align-items:center;">
|
57442
|
+
<button title="${util.out('Reset')}" class="image-reset" style="display:flex;width:30px;height:30px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>
|
57443
|
+
</div>
|
57444
|
+
|
57441
57445
|
</div>
|
57442
57446
|
|
57443
57447
|
</div>
|
@@ -57902,12 +57906,56 @@ class ColumnTool {
|
|
57902
57906
|
//val: 100 - 500
|
57903
57907
|
let val = inpImageScaleSlider.value;
|
57904
57908
|
let cell = this.builder.elementSelected; //util.cellSelected();
|
57909
|
+
// cell.style.backgroundSize = val + '%';
|
57910
|
+
|
57911
|
+
if (document.querySelector('.page-preview.is-screen-375.active') && this.useTarget) {
|
57912
|
+
let dataBg = cell.getAttribute('data-bg-xs');
|
57913
|
+
if (!dataBg) dataBg = '';
|
57914
|
+
let div = document.createElement('div');
|
57915
|
+
div.style.cssText = dataBg; // div.style.backgroundSize = val + '%';
|
57916
|
+
|
57917
|
+
div.style.backgroundSize = 'cover';
|
57918
|
+
cell.setAttribute('data-bg-xs', div.style.cssText);
|
57919
|
+
} else if (document.querySelector('.page-preview.is-screen-768.active') && this.useTarget) {
|
57920
|
+
let dataBg = cell.getAttribute('data-bg-sm');
|
57921
|
+
if (!dataBg) dataBg = '';
|
57922
|
+
let div = document.createElement('div');
|
57923
|
+
div.style.cssText = dataBg; // div.style.backgroundSize = val + '%';
|
57924
|
+
|
57925
|
+
div.style.backgroundSize = 'cover';
|
57926
|
+
cell.setAttribute('data-bg-sm', div.style.cssText);
|
57927
|
+
} else if (document.querySelector('.page-preview.is-screen-1024.active') && this.useTarget) {
|
57928
|
+
let dataBg = cell.getAttribute('data-bg-md');
|
57929
|
+
if (!dataBg) dataBg = '';
|
57930
|
+
let div = document.createElement('div');
|
57931
|
+
div.style.cssText = dataBg; // div.style.backgroundSize = val + '%';
|
57932
|
+
|
57933
|
+
div.style.backgroundSize = 'cover';
|
57934
|
+
cell.setAttribute('data-bg-md', div.style.cssText);
|
57935
|
+
} else {
|
57936
|
+
cell.style.backgroundSize = val + '%';
|
57937
|
+
} // Clean unused
|
57905
57938
|
|
57906
|
-
|
57939
|
+
|
57940
|
+
cell.style.left = '';
|
57941
|
+
cell.style.top = '';
|
57942
|
+
cell.style.width = '';
|
57943
|
+
cell.style.height = '';
|
57944
|
+
cell.removeAttribute('data-x');
|
57945
|
+
cell.removeAttribute('data-y');
|
57946
|
+
cell.removeAttribute('data-scale');
|
57907
57947
|
};
|
57908
57948
|
|
57909
57949
|
inpImageScaleSlider.onchange = () => {
|
57910
|
-
|
57950
|
+
if (document.querySelector('.page-preview.is-screen-375.active')) {
|
57951
|
+
inpImageScaleSlider.value = 0;
|
57952
|
+
} else if (document.querySelector('.page-preview.is-screen-768.active')) {
|
57953
|
+
inpImageScaleSlider.value = 0;
|
57954
|
+
} else if (document.querySelector('.page-preview.is-screen-1024.active')) {
|
57955
|
+
inpImageScaleSlider.value = 0;
|
57956
|
+
} //Trigger Change event
|
57957
|
+
|
57958
|
+
|
57911
57959
|
this.builder.opts.onChange();
|
57912
57960
|
}; // Scale 2
|
57913
57961
|
|
@@ -57956,8 +58004,44 @@ class ColumnTool {
|
|
57956
58004
|
//val: 0 - 100
|
57957
58005
|
let val = inpImageHorSlider.value;
|
57958
58006
|
let cell = this.builder.elementSelected; //util.cellSelected();
|
58007
|
+
// cell.style.backgroundPositionX = val + '%';
|
58008
|
+
|
58009
|
+
if (document.querySelector('.page-preview.is-screen-375.active') && this.useTarget) {
|
58010
|
+
let dataBg = cell.getAttribute('data-bg-xs');
|
58011
|
+
if (!dataBg) dataBg = '';
|
58012
|
+
let div = document.createElement('div');
|
58013
|
+
div.style.cssText = dataBg;
|
58014
|
+
div.style.backgroundPositionX = val + '%';
|
58015
|
+
div.style.backgroundSize = 'cover';
|
58016
|
+
cell.setAttribute('data-bg-xs', div.style.cssText);
|
58017
|
+
} else if (document.querySelector('.page-preview.is-screen-768.active') && this.useTarget) {
|
58018
|
+
let dataBg = cell.getAttribute('data-bg-sm');
|
58019
|
+
if (!dataBg) dataBg = '';
|
58020
|
+
let div = document.createElement('div');
|
58021
|
+
div.style.cssText = dataBg;
|
58022
|
+
div.style.backgroundPositionX = val + '%';
|
58023
|
+
div.style.backgroundSize = 'cover';
|
58024
|
+
cell.setAttribute('data-bg-sm', div.style.cssText);
|
58025
|
+
} else if (document.querySelector('.page-preview.is-screen-1024.active') && this.useTarget) {
|
58026
|
+
let dataBg = cell.getAttribute('data-bg-md');
|
58027
|
+
if (!dataBg) dataBg = '';
|
58028
|
+
let div = document.createElement('div');
|
58029
|
+
div.style.cssText = dataBg;
|
58030
|
+
div.style.backgroundPositionX = val + '%';
|
58031
|
+
div.style.backgroundSize = 'cover';
|
58032
|
+
cell.setAttribute('data-bg-md', div.style.cssText);
|
58033
|
+
} else {
|
58034
|
+
cell.style.backgroundPositionX = val + '%';
|
58035
|
+
} // Clean unused
|
58036
|
+
|
57959
58037
|
|
57960
|
-
cell.style.
|
58038
|
+
cell.style.left = '';
|
58039
|
+
cell.style.top = '';
|
58040
|
+
cell.style.width = '';
|
58041
|
+
cell.style.height = '';
|
58042
|
+
cell.removeAttribute('data-x');
|
58043
|
+
cell.removeAttribute('data-y');
|
58044
|
+
cell.removeAttribute('data-scale');
|
57961
58045
|
};
|
57962
58046
|
|
57963
58047
|
inpImageHorSlider.onchange = () => {
|
@@ -58001,8 +58085,44 @@ class ColumnTool {
|
|
58001
58085
|
//val: 0 - 100
|
58002
58086
|
let val = inpImageVertSlider.value;
|
58003
58087
|
let cell = this.builder.elementSelected; //util.cellSelected();
|
58088
|
+
// cell.style.backgroundPositionY = val + '%';
|
58089
|
+
|
58090
|
+
if (document.querySelector('.page-preview.is-screen-375.active') && this.useTarget) {
|
58091
|
+
let dataBg = cell.getAttribute('data-bg-xs');
|
58092
|
+
if (!dataBg) dataBg = '';
|
58093
|
+
let div = document.createElement('div');
|
58094
|
+
div.style.cssText = dataBg;
|
58095
|
+
div.style.backgroundPositionY = val + '%';
|
58096
|
+
div.style.backgroundSize = 'cover';
|
58097
|
+
cell.setAttribute('data-bg-xs', div.style.cssText);
|
58098
|
+
} else if (document.querySelector('.page-preview.is-screen-768.active') && this.useTarget) {
|
58099
|
+
let dataBg = cell.getAttribute('data-bg-sm');
|
58100
|
+
if (!dataBg) dataBg = '';
|
58101
|
+
let div = document.createElement('div');
|
58102
|
+
div.style.cssText = dataBg;
|
58103
|
+
div.style.backgroundPositionY = val + '%';
|
58104
|
+
div.style.backgroundSize = 'cover';
|
58105
|
+
cell.setAttribute('data-bg-sm', div.style.cssText);
|
58106
|
+
} else if (document.querySelector('.page-preview.is-screen-1024.active') && this.useTarget) {
|
58107
|
+
let dataBg = cell.getAttribute('data-bg-md');
|
58108
|
+
if (!dataBg) dataBg = '';
|
58109
|
+
let div = document.createElement('div');
|
58110
|
+
div.style.cssText = dataBg;
|
58111
|
+
div.style.backgroundPositionY = val + '%';
|
58112
|
+
div.style.backgroundSize = 'cover';
|
58113
|
+
cell.setAttribute('data-bg-md', div.style.cssText);
|
58114
|
+
} else {
|
58115
|
+
cell.style.backgroundPositionY = val + '%';
|
58116
|
+
} // Clean unused
|
58117
|
+
|
58004
58118
|
|
58005
|
-
cell.style.
|
58119
|
+
cell.style.left = '';
|
58120
|
+
cell.style.top = '';
|
58121
|
+
cell.style.width = '';
|
58122
|
+
cell.style.height = '';
|
58123
|
+
cell.removeAttribute('data-x');
|
58124
|
+
cell.removeAttribute('data-y');
|
58125
|
+
cell.removeAttribute('data-scale');
|
58006
58126
|
};
|
58007
58127
|
|
58008
58128
|
inpImageVertSlider.onchange = () => {
|
@@ -58031,14 +58151,23 @@ class ColumnTool {
|
|
58031
58151
|
inpImageVertSlider2.onchange = () => {
|
58032
58152
|
//Trigger Change event
|
58033
58153
|
this.builder.opts.onChange();
|
58034
|
-
};
|
58154
|
+
}; //Reset
|
58155
|
+
|
58035
58156
|
|
58036
|
-
const btnImageReset =
|
58157
|
+
const btnImageReset = imageAdjust.querySelector('.image-reset');
|
58037
58158
|
btnImageReset.addEventListener('click', () => {
|
58038
58159
|
this.builder.uo.saveForUndo();
|
58039
58160
|
let cell = this.builder.elementSelected;
|
58040
58161
|
this.resetImage(cell); //Trigger Change event
|
58041
58162
|
|
58163
|
+
this.builder.opts.onChange();
|
58164
|
+
});
|
58165
|
+
const btnImageReset2 = imageAdjust2.querySelector('.image-reset');
|
58166
|
+
btnImageReset2.addEventListener('click', () => {
|
58167
|
+
this.builder.uo.saveForUndo();
|
58168
|
+
let cell = this.builder.elementSelected;
|
58169
|
+
this.resetImage2(cell); //Trigger Change event
|
58170
|
+
|
58042
58171
|
this.builder.opts.onChange();
|
58043
58172
|
}); // Row Enlarge (Currently not used)
|
58044
58173
|
|
@@ -58966,8 +59095,9 @@ class ColumnTool {
|
|
58966
59095
|
if (btn) btn.setAttribute('data-focus', true);
|
58967
59096
|
}
|
58968
59097
|
|
58969
|
-
openImageAdjust(elm, btn) {
|
58970
|
-
//Current value
|
59098
|
+
openImageAdjust(elm, btn, useTarget) {
|
59099
|
+
if (useTarget) this.useTarget = true;else this.useTarget = false; //Current value
|
59100
|
+
|
58971
59101
|
const imageAdjust = this.imageAdjust;
|
58972
59102
|
const inpImageScaleSlider = imageAdjust.querySelector('.image-scale-slider');
|
58973
59103
|
const inpImageHorSlider = imageAdjust.querySelector('.image-hor-slider');
|
@@ -58976,9 +59106,32 @@ class ColumnTool {
|
|
58976
59106
|
inpImageHorSlider.value = 0;
|
58977
59107
|
inpImageVertSlider.value = 0;
|
58978
59108
|
|
58979
|
-
if (
|
59109
|
+
if (useTarget) {
|
59110
|
+
inpImageHorSlider.value = 50;
|
59111
|
+
inpImageVertSlider.value = 60;
|
59112
|
+
}
|
59113
|
+
|
59114
|
+
let div = document.createElement('div');
|
59115
|
+
|
59116
|
+
if (document.querySelector('.page-preview.is-screen-375.active') && useTarget) {
|
59117
|
+
let dataBg = elm.getAttribute('data-bg-xs');
|
59118
|
+
if (!dataBg) dataBg = '';
|
59119
|
+
div.style.cssText = dataBg;
|
59120
|
+
} else if (document.querySelector('.page-preview.is-screen-768.active') && useTarget) {
|
59121
|
+
let dataBg = elm.getAttribute('data-bg-sm');
|
59122
|
+
if (!dataBg) dataBg = '';
|
59123
|
+
div.style.cssText = dataBg;
|
59124
|
+
} else if (document.querySelector('.page-preview.is-screen-1024.active') && useTarget) {
|
59125
|
+
let dataBg = elm.getAttribute('data-bg-md');
|
59126
|
+
if (!dataBg) dataBg = '';
|
59127
|
+
div.style.cssText = dataBg;
|
59128
|
+
} else {
|
59129
|
+
div.style.cssText = elm.style.cssText;
|
59130
|
+
}
|
59131
|
+
|
59132
|
+
if (div.style.backgroundSize) {
|
58980
59133
|
let val;
|
58981
|
-
let bgSize =
|
59134
|
+
let bgSize = div.style.backgroundSize;
|
58982
59135
|
|
58983
59136
|
if (isNaN(parseInt(bgSize))) {
|
58984
59137
|
val = 100;
|
@@ -58991,9 +59144,9 @@ class ColumnTool {
|
|
58991
59144
|
}
|
58992
59145
|
}
|
58993
59146
|
|
58994
|
-
if (
|
59147
|
+
if (div.style.backgroundPositionX) {
|
58995
59148
|
let val;
|
58996
|
-
let bgPosX =
|
59149
|
+
let bgPosX = div.style.backgroundPositionX;
|
58997
59150
|
|
58998
59151
|
if (isNaN(parseInt(bgPosX))) {
|
58999
59152
|
val = 0;
|
@@ -59006,9 +59159,9 @@ class ColumnTool {
|
|
59006
59159
|
}
|
59007
59160
|
}
|
59008
59161
|
|
59009
|
-
if (
|
59162
|
+
if (div.style.backgroundPositionY) {
|
59010
59163
|
let val;
|
59011
|
-
let bgPosY =
|
59164
|
+
let bgPosY = div.style.backgroundPositionY;
|
59012
59165
|
|
59013
59166
|
if (isNaN(parseInt(bgPosY))) {
|
59014
59167
|
val = 0;
|
@@ -59035,6 +59188,28 @@ class ColumnTool {
|
|
59035
59188
|
}
|
59036
59189
|
|
59037
59190
|
resetImage(elm) {
|
59191
|
+
//Current value
|
59192
|
+
const imageAdjust = this.imageAdjust;
|
59193
|
+
const inpImageScaleSlider = imageAdjust.querySelector('.image-scale-slider');
|
59194
|
+
const inpImageHorSlider = imageAdjust.querySelector('.image-hor-slider');
|
59195
|
+
const inpImageVertSlider = imageAdjust.querySelector('.image-vert-slider');
|
59196
|
+
inpImageHorSlider.value = 50;
|
59197
|
+
inpImageVertSlider.value = 60;
|
59198
|
+
inpImageScaleSlider.value = 0;
|
59199
|
+
elm.style.backgroundPositionX = '';
|
59200
|
+
elm.style.backgroundPositionY = '';
|
59201
|
+
elm.style.backgroundSize = ''; // Clean unused
|
59202
|
+
|
59203
|
+
elm.style.left = '';
|
59204
|
+
elm.style.top = '';
|
59205
|
+
elm.style.width = '';
|
59206
|
+
elm.style.height = '';
|
59207
|
+
elm.removeAttribute('data-x');
|
59208
|
+
elm.removeAttribute('data-y');
|
59209
|
+
elm.removeAttribute('data-scale');
|
59210
|
+
}
|
59211
|
+
|
59212
|
+
resetImage2(elm) {
|
59038
59213
|
//Current value
|
59039
59214
|
const imageAdjust2 = this.imageAdjust2;
|
59040
59215
|
const inpImageScaleSlider = imageAdjust2.querySelector('.image-scale-slider');
|
@@ -76049,11 +76224,11 @@ class ContentBuilder {
|
|
76049
76224
|
this.colTool.openImagePicker(currentUrl, callback, btn);
|
76050
76225
|
}
|
76051
76226
|
|
76052
|
-
openImageAdjust(elm, btn) {
|
76227
|
+
openImageAdjust(elm, btn, useTarget) {
|
76053
76228
|
if (this.opts.imageAdjust === 2) {
|
76054
76229
|
this.colTool.openImageAdjust2(elm, btn);
|
76055
76230
|
} else {
|
76056
|
-
this.colTool.openImageAdjust(elm, btn);
|
76231
|
+
this.colTool.openImageAdjust(elm, btn, useTarget);
|
76057
76232
|
}
|
76058
76233
|
}
|
76059
76234
|
|