@innovastudio/contentbuilder 1.5.152 → 1.5.154

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.
@@ -50144,8 +50144,17 @@ class Module {
50144
50144
  let btnOk = moduleModal.querySelector('.input-ok');
50145
50145
  dom.addEventListener(btnOk, 'click', () => {
50146
50146
  let modalIframe = moduleModal.querySelector('iframe');
50147
- if (modalIframe.contentWindow.construct) modalIframe.contentWindow.construct(); // transfer module code to hidContentModuleCode & hidContentModuleSettings for saving
50148
-
50147
+ if (modalIframe.contentWindow.construct) {
50148
+ const result = modalIframe.contentWindow.construct(); // transfer module code to hidContentModuleCode & hidContentModuleSettings for saving
50149
+ if (typeof result === 'object' && result !== null) {
50150
+ if (result.error) {
50151
+ alert(result.error);
50152
+ return;
50153
+ }
50154
+ }
50155
+ } else {
50156
+ return;
50157
+ }
50149
50158
  this.builder.uo.saveForUndo();
50150
50159
  let module = this.builder.activeModule;
50151
50160
 
@@ -96000,6 +96009,13 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
96000
96009
  // Apply behavior on each row
96001
96010
  const rows = this.dom.elementChildren(builder);
96002
96011
  rows.forEach(row => {
96012
+ // Skip if not a DIV
96013
+ if (row.tagName !== 'DIV') return;
96014
+
96015
+ // Skip if it doesn't have any child DIVs
96016
+ const hasChildDiv = Array.from(row.children).some(child => child.tagName === 'DIV');
96017
+ if (!hasChildDiv) return;
96018
+
96003
96019
  // The saveForUndo also saves sortable class when start dragging. If Undo is performed, the classes are returned. Cleanup the classes here.
96004
96020
  row.classList.remove('sortable-ghost');
96005
96021
  row.classList.remove('sortable-chosen');
@@ -99598,6 +99614,11 @@ Please obtain a license at: https://innovastudio.com/contentbox`);
99598
99614
  this.elmTool.hide();
99599
99615
  }
99600
99616
  typing() {
99617
+ // Lightweight: Just mark content changed for auto-save
99618
+ if (this.opts.onType) {
99619
+ this.opts.onType();
99620
+ }
99621
+
99601
99622
  // console.log('typing');
99602
99623
  if (this.timeoutId) clearTimeout(this.timeoutId);
99603
99624
  this.timeoutId = setTimeout(() => {