@innovastudio/contentbuilder 1.5.174 → 1.5.175
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
|
@@ -14439,7 +14439,14 @@ class HtmlUtil {
|
|
|
14439
14439
|
const cell = util.cellSelected();
|
|
14440
14440
|
cell.innerHTML = html;
|
|
14441
14441
|
let builderActive = this.builder.doc.querySelector('.builder-active');
|
|
14442
|
-
if (builderActive)
|
|
14442
|
+
if (builderActive) {
|
|
14443
|
+
this.builder.applyBehaviorOn(builderActive);
|
|
14444
|
+
|
|
14445
|
+
// reinit after apply html
|
|
14446
|
+
if (this.builder.win.builderRuntime && builderActive.querySelector('[data-cb-type]')) {
|
|
14447
|
+
this.builder.win.builderRuntime.reinitialize(builderActive);
|
|
14448
|
+
}
|
|
14449
|
+
}
|
|
14443
14450
|
|
|
14444
14451
|
//Trigger Change event
|
|
14445
14452
|
this.builder.opts.onChange();
|
|
@@ -14458,7 +14465,14 @@ class HtmlUtil {
|
|
|
14458
14465
|
if (!row) return;
|
|
14459
14466
|
row.innerHTML = html;
|
|
14460
14467
|
let builderActive = this.builder.doc.querySelector('.builder-active');
|
|
14461
|
-
if (builderActive)
|
|
14468
|
+
if (builderActive) {
|
|
14469
|
+
this.builder.applyBehaviorOn(builderActive);
|
|
14470
|
+
|
|
14471
|
+
// reinit after apply html
|
|
14472
|
+
if (this.builder.win.builderRuntime && builderActive.querySelector('[data-cb-type]')) {
|
|
14473
|
+
this.builder.win.builderRuntime.reinitialize(builderActive);
|
|
14474
|
+
}
|
|
14475
|
+
}
|
|
14462
14476
|
|
|
14463
14477
|
//Trigger Change event
|
|
14464
14478
|
this.builder.opts.onChange();
|
|
@@ -14493,6 +14507,12 @@ class HtmlUtil {
|
|
|
14493
14507
|
// let builderActive = this.builder.doc.querySelector('.builder-active');
|
|
14494
14508
|
// if(builderActive) this.builder.applyBehaviorOn(builderActive);
|
|
14495
14509
|
this.builder.applyBehaviorOn(area);
|
|
14510
|
+
|
|
14511
|
+
// reinit after apply html
|
|
14512
|
+
if (this.builder.win.builderRuntime && area.querySelector('[data-cb-type]')) {
|
|
14513
|
+
this.builder.win.builderRuntime.reinitialize(area);
|
|
14514
|
+
}
|
|
14515
|
+
|
|
14496
14516
|
/*else {
|
|
14497
14517
|
const builders = this.builder.doc.querySelectorAll(this.builder.opts.container);
|
|
14498
14518
|
if(builders.length > 1) {
|
|
@@ -51152,9 +51172,10 @@ class SettingsUIGenerator {
|
|
|
51152
51172
|
generateForm(pluginName, element, onChange) {
|
|
51153
51173
|
const plugin = this.runtime.getPlugin(pluginName);
|
|
51154
51174
|
if (!plugin || !plugin.settings) {
|
|
51155
|
-
console.warn(`Plugin "${pluginName}" has no settings schema`);
|
|
51175
|
+
// console.warn(`Plugin "${pluginName}" has no settings schema`);
|
|
51156
51176
|
if (!plugin.editor) return this.createEmptyForm();
|
|
51157
51177
|
}
|
|
51178
|
+
if (!plugin.settings) plugin.settings = {};
|
|
51158
51179
|
const form = document.createElement('div');
|
|
51159
51180
|
form.className = 'cb-settings-form';
|
|
51160
51181
|
|
|
@@ -51530,6 +51551,7 @@ class SettingsUIGenerator {
|
|
|
51530
51551
|
*/
|
|
51531
51552
|
getCurrentValues(element, settings) {
|
|
51532
51553
|
const values = {};
|
|
51554
|
+
if (!settings) return values;
|
|
51533
51555
|
Object.keys(settings).forEach(key => {
|
|
51534
51556
|
if (key.startsWith('_')) return;
|
|
51535
51557
|
const attrName = 'data-cb-' + key.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
@@ -63585,6 +63607,14 @@ class ElementTool {
|
|
|
63585
63607
|
let elementTool = this.elementTool;
|
|
63586
63608
|
let elm = this.builder.activeElement;
|
|
63587
63609
|
if (!elm) return;
|
|
63610
|
+
const editableArea = elm.closest('[data-edit-actions]');
|
|
63611
|
+
if (editableArea) {
|
|
63612
|
+
const editActions = editableArea.dataset.editActions || '';
|
|
63613
|
+
if (editActions.includes('no-add')) {
|
|
63614
|
+
// Adding elements is disabled
|
|
63615
|
+
return;
|
|
63616
|
+
}
|
|
63617
|
+
}
|
|
63588
63618
|
if (elm.closest('.is-dock')) return;
|
|
63589
63619
|
// if(elm.closest('[data-cb-type]')) return;
|
|
63590
63620
|
|