@innovastudio/contentbox 1.2.8 → 1.2.11
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 +2 -2
- package/public/contentbox/contentbox.esm.js +36 -4
- package/public/contentbox/contentbox.min.js +3 -3
- package/public/contentbox/lang/en.js +466 -466
- package/readme.txt +25 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@innovastudio/contentbox",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "public/contentbox/contentbox.esm.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"webpack-dev-server": "^4.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@innovastudio/contentbuilder": "^1.1.
|
|
43
|
+
"@innovastudio/contentbuilder": "^1.1.13",
|
|
44
44
|
"axios": "^0.21.4",
|
|
45
45
|
"cors": "^2.8.5",
|
|
46
46
|
"express": "^4.17.1",
|
|
@@ -17115,6 +17115,7 @@ class Dom {
|
|
|
17115
17115
|
|
|
17116
17116
|
|
|
17117
17117
|
hasClass(element, className) {
|
|
17118
|
+
if (!element) return false;
|
|
17118
17119
|
if (!element.className) return false;
|
|
17119
17120
|
return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
|
|
17120
17121
|
}
|
|
@@ -57218,6 +57219,12 @@ class Image {
|
|
|
57218
57219
|
elm = imageTool.querySelector('.image-edit');
|
|
57219
57220
|
dom$A.addEventListener(elm, 'click', () => {
|
|
57220
57221
|
let img = this.builder.activeImage;
|
|
57222
|
+
|
|
57223
|
+
if (this.builder.onImageEditClick) {
|
|
57224
|
+
let result = this.builder.onImageEditClick(img);
|
|
57225
|
+
if (!result) return;
|
|
57226
|
+
}
|
|
57227
|
+
|
|
57221
57228
|
util.showModal(modalImageEdit, true);
|
|
57222
57229
|
let preview = modalImageEdit.querySelector('.imageedit-preview');
|
|
57223
57230
|
const maxW = 800;
|
|
@@ -57240,9 +57247,15 @@ class Image {
|
|
|
57240
57247
|
preview.innerHTML = '<img src="" style="max-width:100%;object-fit:contain;height:100%;"/>';
|
|
57241
57248
|
let imagePreview = modalImageEdit.querySelector('img');
|
|
57242
57249
|
imagePreview.src = img.src;
|
|
57243
|
-
|
|
57244
|
-
|
|
57245
|
-
|
|
57250
|
+
|
|
57251
|
+
if (this.builder.setCropperConfig) {
|
|
57252
|
+
this.cropper = new Cropper(imagePreview, this.builder.setCropperConfig);
|
|
57253
|
+
} else {
|
|
57254
|
+
this.cropper = new Cropper(imagePreview, {
|
|
57255
|
+
zoomable: false
|
|
57256
|
+
});
|
|
57257
|
+
}
|
|
57258
|
+
|
|
57246
57259
|
document.querySelector('.moveable-control-box').style.display = 'none'; //needed by Safari (prevent z-index problem)
|
|
57247
57260
|
}); // Set crop proportion
|
|
57248
57261
|
|
|
@@ -76570,6 +76583,22 @@ class ContentBuilder {
|
|
|
76570
76583
|
// onPluginsLoaded: function () { },
|
|
76571
76584
|
// onImageBrowseClick: function () { },
|
|
76572
76585
|
// onImageSettingClick: function () { },
|
|
76586
|
+
|
|
76587
|
+
/*
|
|
76588
|
+
// onImageEditClick: function () { }, // used in elementimage.js
|
|
76589
|
+
// Example:
|
|
76590
|
+
onImageEditClick: (activeImage)=>{
|
|
76591
|
+
activeImage.setAttribute('crossorigin', 'anonymous');
|
|
76592
|
+
const cropperConfig = {
|
|
76593
|
+
checkCrossOrigin:false,
|
|
76594
|
+
checkOrientation:false,
|
|
76595
|
+
crossOrigin:'anonymous'
|
|
76596
|
+
};
|
|
76597
|
+
builder.setCropperConfig = cropperConfig;
|
|
76598
|
+
return true;
|
|
76599
|
+
},
|
|
76600
|
+
*/
|
|
76601
|
+
// setCropperConfig: {}, // used in elementimage.js
|
|
76573
76602
|
imageEmbed: true,
|
|
76574
76603
|
imageselect: '',
|
|
76575
76604
|
fileselect: '',
|
|
@@ -77228,7 +77257,8 @@ class ContentBuilder {
|
|
|
77228
77257
|
e = e || window.event;
|
|
77229
77258
|
let target = e.target || e.srcElement;
|
|
77230
77259
|
if (!target) return;
|
|
77231
|
-
let rowClicked
|
|
77260
|
+
let rowClicked;
|
|
77261
|
+
if (target.parentNode) rowClicked = dom$J.hasClass(target.parentNode, 'is-builder');
|
|
77232
77262
|
let containerClicked = dom$J.hasClass(target, 'is-builder');
|
|
77233
77263
|
let a = false,
|
|
77234
77264
|
b = false,
|
|
@@ -83433,6 +83463,8 @@ class ContentBox {
|
|
|
83433
83463
|
onVideoSelectClick: this.settings.onVideoSelectClick,
|
|
83434
83464
|
onImageBrowseClick: this.settings.onImageBrowseClick,
|
|
83435
83465
|
onImageSettingClick: this.settings.onImageSettingClick,
|
|
83466
|
+
onImageEditClick: this.settings.onImageEditClick,
|
|
83467
|
+
setCropperConfig: this.settings.setCropperConfig,
|
|
83436
83468
|
onPluginsLoaded: this.settings.onPluginsLoaded,
|
|
83437
83469
|
imageselect: this.settings.imageselect,
|
|
83438
83470
|
fileselect: this.settings.fileselect,
|