@innovastudio/contentbuilder 1.5.210 → 1.5.212
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
|
@@ -1252,7 +1252,7 @@ const renderQuickAdd = builder => {
|
|
|
1252
1252
|
let elm = quickadd.querySelector('.add-paragraph');
|
|
1253
1253
|
dom.addEventListener(elm, 'click', () => {
|
|
1254
1254
|
const mode = quickadd.getAttribute('data-mode');
|
|
1255
|
-
const html = `<p>${util.out(`Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
1255
|
+
const html = `<p>${util.out(`Lorem Ipsum is simply dummy text of the printing and typesetting industry. It is a piece of classical Latin text that has long been used to demonstrate the visual form of a document without relying on meaningful content.${''}`)}</p>`;
|
|
1256
1256
|
util.addContent(html, mode);
|
|
1257
1257
|
});
|
|
1258
1258
|
elm = quickadd.querySelector('.add-headline');
|
|
@@ -5598,8 +5598,8 @@ class Util {
|
|
|
5598
5598
|
}
|
|
5599
5599
|
let editingInsidePlugin = false;
|
|
5600
5600
|
let elm = this.builder.activeElement;
|
|
5601
|
-
const plugin = elm.closest('[data-cb-type]');
|
|
5602
|
-
const subblock = elm.closest('.is-subblock');
|
|
5601
|
+
const plugin = elm && elm.closest('[data-cb-type]');
|
|
5602
|
+
const subblock = elm && elm.closest('.is-subblock');
|
|
5603
5603
|
if (plugin && subblock) {
|
|
5604
5604
|
editingInsidePlugin = true;
|
|
5605
5605
|
}
|
|
@@ -7324,11 +7324,14 @@ class Dom {
|
|
|
7324
7324
|
addClass(element, classname) {
|
|
7325
7325
|
if (!element) return;
|
|
7326
7326
|
if (this.hasClass(element, classname)) return;
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7327
|
+
try {
|
|
7328
|
+
if (element.classList.length === 0) element.className = classname;else element.className = element.className + ' ' + classname;
|
|
7329
|
+
element.className = element.className.replace(/ +/g, ' ');
|
|
7330
|
+
//else element.classList.add(classname); //error if there is -
|
|
7331
|
+
} catch (e) {
|
|
7332
|
+
// Do Nothing
|
|
7333
|
+
}
|
|
7330
7334
|
}
|
|
7331
|
-
|
|
7332
7335
|
removeClass(element, classname) {
|
|
7333
7336
|
if (!element) return;
|
|
7334
7337
|
if (element.classList.length > 0) {
|
|
@@ -14870,6 +14873,9 @@ class HtmlUtil {
|
|
|
14870
14873
|
readHtml(content, view, multiple, excludeCustomBlock) {
|
|
14871
14874
|
//view = true (hide internal attributes). view = false (actual html)
|
|
14872
14875
|
|
|
14876
|
+
const _fx = this.builder.win && (this.builder.win.fx || this.builder.win.builderRuntime && this.builder.win.builderRuntime.fx) || null;
|
|
14877
|
+
const _cleanFx = !!(_fx && content && content.isConnected);
|
|
14878
|
+
if (_cleanFx && _fx.beginSerialize) _fx.beginSerialize();
|
|
14873
14879
|
const dom = this.builder.dom;
|
|
14874
14880
|
|
|
14875
14881
|
//Make absolute
|
|
@@ -14901,6 +14907,7 @@ class HtmlUtil {
|
|
|
14901
14907
|
// let tmp = builderStuff.querySelector('#tmp_content');
|
|
14902
14908
|
let tmp = document.createElement('div');
|
|
14903
14909
|
tmp.innerHTML = content.innerHTML;
|
|
14910
|
+
if (_cleanFx && _fx.endSerialize) _fx.endSerialize();
|
|
14904
14911
|
|
|
14905
14912
|
//Find subblocks (previously is-builder) in custom code blocks and save them to data-html-1, data-html-2, and so on.
|
|
14906
14913
|
let blocks = tmp.querySelectorAll('[data-html]');
|
|
@@ -51539,7 +51546,9 @@ class SettingsUIGenerator {
|
|
|
51539
51546
|
const label = document.createElement('label');
|
|
51540
51547
|
label.className = 'label';
|
|
51541
51548
|
label.style.fontWeight = 500;
|
|
51542
|
-
|
|
51549
|
+
|
|
51550
|
+
// const labelText = document.createTextNode((config.label || name) + ':');
|
|
51551
|
+
const labelText = document.createTextNode(config.label || name);
|
|
51543
51552
|
label.appendChild(labelText);
|
|
51544
51553
|
const select = document.createElement('select');
|
|
51545
51554
|
select.name = name;
|
|
@@ -99486,26 +99495,18 @@ Please obtain a license at: https://innovastudio.com/contentbox`);
|
|
|
99486
99495
|
}
|
|
99487
99496
|
if (!bPasteObject) {
|
|
99488
99497
|
if (this.opts.paste === 'text') {
|
|
99489
|
-
/*
|
|
99490
|
-
let elms = contentword.querySelectorAll('p,h1,h2,h3,h4,h5,h6');
|
|
99491
|
-
Array.prototype.forEach.call(elms, (elm) => {
|
|
99492
|
-
elm.innerHTML = elm.innerHTML + ' '; //add space ( )
|
|
99493
|
-
});
|
|
99494
|
-
// sPastedText = contentword.innerText;
|
|
99495
|
-
sPastedText = contentword.innerHTML;
|
|
99496
|
-
sPastedText = sPastedText.replace(/(<([^>]+)>)/ig,'<br>');
|
|
99497
|
-
sPastedText = sPastedText.replace(/(<br\s*\/?>){3,}/gi, '<br>');
|
|
99498
|
-
if(sPastedText.indexOf('<br>')===0) {
|
|
99499
|
-
sPastedText = sPastedText.substring(4);
|
|
99500
|
-
}
|
|
99501
|
-
if(sPastedText.substring(sPastedText.length-4)==='<br>'){
|
|
99502
|
-
sPastedText = sPastedText.substring(0, sPastedText.length-4);
|
|
99503
|
-
}
|
|
99504
|
-
sPastedText = sPastedText.trim();
|
|
99505
|
-
*/
|
|
99506
|
-
|
|
99507
99498
|
sPastedText = clipboardData;
|
|
99508
99499
|
// sPastedText = sPastedText.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
|
99500
|
+
|
|
99501
|
+
// 1. Escape HTML special chars so plain text isn't parsed as markup
|
|
99502
|
+
sPastedText = sPastedText.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
99503
|
+
|
|
99504
|
+
// 2. Normalize line endings
|
|
99505
|
+
sPastedText = sPastedText.replace(/\r\n|\r/g, '\n');
|
|
99506
|
+
|
|
99507
|
+
// 3. Blank lines separate paragraphs; single newlines become
|
|
99508
|
+
// soft <br> breaks within each paragraph
|
|
99509
|
+
sPastedText = sPastedText.split(/\n{2,}/).map(block => block.trim()).filter(block => block !== '').map(block => '<p>' + block.replace(/\n/g, '<br>') + '</p>').join('');
|
|
99509
99510
|
} else {
|
|
99510
99511
|
sPastedText = contentword.innerHTML;
|
|
99511
99512
|
if (this.opts.paste === 'html') {
|