@innovastudio/contentbox 1.6.30 → 1.6.31
Sign up to get free protection for your applications and to get access to all the features.
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.31",
|
5
5
|
"description": "",
|
6
6
|
"main": "public/contentbox/contentbox.esm.js",
|
7
7
|
"files": [
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"ws": "^8.13.0"
|
53
53
|
},
|
54
54
|
"dependencies": {
|
55
|
-
"@innovastudio/contentbuilder": "^1.5.
|
55
|
+
"@innovastudio/contentbuilder": "^1.5.8",
|
56
56
|
"js-beautify": "^1.14.0"
|
57
57
|
}
|
58
58
|
}
|
@@ -8953,19 +8953,56 @@ class Text {
|
|
8953
8953
|
span.removeAttribute('data-keep');
|
8954
8954
|
}
|
8955
8955
|
}); // clean
|
8956
|
+
// let elms = activeColumn.querySelectorAll('ul,p');
|
8957
|
+
// Array.prototype.forEach.call(elms, (elm) => {
|
8958
|
+
// let text = elm.innerHTML.trim();
|
8959
|
+
// if(text==='') {
|
8960
|
+
// elm.parentNode.removeChild(elm);
|
8961
|
+
// }
|
8962
|
+
// });
|
8956
8963
|
|
8957
|
-
let
|
8958
|
-
|
8959
|
-
|
8964
|
+
let elm = this.getElm();
|
8965
|
+
const ul = elm.closest('ul,ol');
|
8966
|
+
const p = elm.closest('p,h1,h2,h3,h4,h5,h6');
|
8967
|
+
|
8968
|
+
if (ul && p) {
|
8969
|
+
/*
|
8970
|
+
Case:
|
8971
|
+
After applying list, the structure will be:
|
8972
|
+
<p style="...">
|
8973
|
+
<ul>
|
8974
|
+
<li>Lorem ipsum</li>
|
8975
|
+
</ul>
|
8976
|
+
</p>
|
8977
|
+
DOM will reformat this into:
|
8978
|
+
<p style="..."></p>
|
8979
|
+
<ul>
|
8980
|
+
<li>Lorem ipsum</li>
|
8981
|
+
</ul>
|
8982
|
+
<p></p>
|
8983
|
+
The list will lost its style
|
8984
|
+
*/
|
8985
|
+
const list = ul.querySelectorAll('li');
|
8986
|
+
list.forEach(li => {
|
8987
|
+
this.appendAttributes(p, li);
|
8988
|
+
});
|
8989
|
+
}
|
8960
8990
|
|
8961
|
-
if (text === '') {
|
8962
|
-
elm.parentNode.removeChild(elm);
|
8963
|
-
}
|
8964
|
-
});
|
8965
8991
|
onFinish();
|
8966
8992
|
}, 10);
|
8967
8993
|
}
|
8968
8994
|
|
8995
|
+
appendAttributes(sourceElement, destinationElement) {
|
8996
|
+
// Append classes
|
8997
|
+
destinationElement.classList.add(...sourceElement.classList); // Append styles
|
8998
|
+
|
8999
|
+
for (let i = 0; i < sourceElement.style.length; i++) {
|
9000
|
+
let property = sourceElement.style[i];
|
9001
|
+
let value = sourceElement.style.getPropertyValue(property);
|
9002
|
+
destinationElement.style.setProperty(property, value);
|
9003
|
+
}
|
9004
|
+
}
|
9005
|
+
|
8969
9006
|
formatText(command) {
|
8970
9007
|
if (command === 'bold') this.execCommandToggle('fontWeight');
|
8971
9008
|
if (command === 'italic') this.execCommandToggle('fontStyle');
|
@@ -12476,7 +12513,12 @@ class PanelSvg {
|
|
12476
12513
|
let currentColor = this.builder.editor.dom.getStyle(svg, 'color');
|
12477
12514
|
const colorpicker = this.builder.editor.colorpicker();
|
12478
12515
|
colorpicker.open(color => {
|
12479
|
-
svg.style.
|
12516
|
+
if (svg.style.fill) {
|
12517
|
+
svg.style.fill = color;
|
12518
|
+
} else {
|
12519
|
+
svg.style.color = color;
|
12520
|
+
}
|
12521
|
+
|
12480
12522
|
btnColorPick.style.backgroundColor = color; // preview
|
12481
12523
|
|
12482
12524
|
this.builder.editor.onChange();
|
@@ -12556,8 +12598,16 @@ class PanelSvg {
|
|
12556
12598
|
if (div.classList.contains('text-right')) panel.querySelector('[data-align="right"]').classList.add('on');
|
12557
12599
|
if (div.classList.contains('text-center')) panel.querySelector('[data-align="center"]').classList.add('on');
|
12558
12600
|
if (div.classList.contains('text-justify')) panel.querySelector('[data-align="justify"]').classList.add('on');
|
12559
|
-
const btnColorPick = panel.querySelector('.btn-color');
|
12560
|
-
|
12601
|
+
const btnColorPick = panel.querySelector('.btn-color'); // let currentColor = this.builder.editor.dom.getStyle(svg, 'color');
|
12602
|
+
|
12603
|
+
let currentColor;
|
12604
|
+
|
12605
|
+
if (svg.style.fill) {
|
12606
|
+
currentColor = svg.style.fill;
|
12607
|
+
} else {
|
12608
|
+
currentColor = svg.style.color;
|
12609
|
+
}
|
12610
|
+
|
12561
12611
|
btnColorPick.style.backgroundColor = currentColor; // panel.querySelectorAll('.fontsizes button').forEach(btn=>btn.classList.remove('on'));
|
12562
12612
|
// let currentSize = svg.getAttribute('width');
|
12563
12613
|
// panel.querySelectorAll('.fontsizes button').forEach(btn=>{
|
@@ -25193,7 +25243,7 @@ class ControlPanel {
|
|
25193
25243
|
this.title.innerHTML = titleHtml;
|
25194
25244
|
this.panelIframe.classList.add('active');
|
25195
25245
|
this.objPanelIframe.getState();
|
25196
|
-
} else if (element.tagName.toLowerCase() === 'i' && element.classList.contains('icon')) {
|
25246
|
+
} else if (element.tagName.toLowerCase() === 'i' && (element.classList.contains('icon') || element.classList.contains('bi'))) {
|
25197
25247
|
let titleHtml = out('Icon');
|
25198
25248
|
this.title.innerHTML = titleHtml;
|
25199
25249
|
this.panelIcon.classList.add('active');
|
@@ -70596,6 +70646,8 @@ class Image$1 {
|
|
70596
70646
|
try {
|
70597
70647
|
img.setAttribute('data-filename', input.files[0].name); //needed for saveimage.js |
|
70598
70648
|
|
70649
|
+
// img.crossOrigin = 'anonymous';
|
70650
|
+
|
70599
70651
|
this.processImage(input.files[0], img, () => {
|
70600
70652
|
imageProgress.style.display = 'none';
|
70601
70653
|
elm = imageTool.querySelector('#fileEmbedImage');
|
@@ -96600,7 +96652,7 @@ class Rte {
|
|
96600
96652
|
addIcon(classname) {
|
96601
96653
|
const dom = this.dom;
|
96602
96654
|
this.util.restoreSelection();
|
96603
|
-
if (this.builder.activeIcon) {
|
96655
|
+
if (this.builder.activeIcon && this.builder.doc.contains(this.builder.activeIcon)) {
|
96604
96656
|
this.builder.uo.saveForUndo();
|
96605
96657
|
|
96606
96658
|
/*
|
@@ -96632,6 +96684,12 @@ class Rte {
|
|
96632
96684
|
this.builder.uo.saveForUndo();
|
96633
96685
|
this.util.pasteHtmlAtCaret('<i class="' + classname + ' icon-active"></i>', true);
|
96634
96686
|
this.builder.activeIcon = this.builder.doc.querySelector('.icon-active');
|
96687
|
+
|
96688
|
+
// this.util.pasteHtmlAtCaret('<i class="icon-active"></i>', true);
|
96689
|
+
// const newIcon = this.builder.doc.querySelector('.icon-active');
|
96690
|
+
// newIcon.className = classname + ' icon-active';
|
96691
|
+
// this.builder.activeIcon = newIcon;
|
96692
|
+
|
96635
96693
|
dom.selectElementContents(this.builder.activeIcon);
|
96636
96694
|
this.util.saveSelection();
|
96637
96695
|
}
|
@@ -147516,7 +147574,12 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
|
|
147516
147574
|
transition: none !important;
|
147517
147575
|
z-index:1;
|
147518
147576
|
}
|
147519
|
-
|
147577
|
+
|
147578
|
+
|
147579
|
+
i.bi, i.icon { display: inline-flex; }
|
147580
|
+
|
147581
|
+
</style>`); // i.bi, i.icon { display: inline-flex; } => this makes icons more cursor friendly
|
147582
|
+
|
147520
147583
|
dom.appendHtml(document.head, `<style id="_contentboxstuff_css">
|
147521
147584
|
|
147522
147585
|
#_cbhtml .is-modal.editbox.is-modal-content {
|