@innovastudio/contentbox 1.5.60 → 1.5.62

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.5.60",
4
+ "version": "1.5.62",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "files": [
@@ -50,7 +50,7 @@
50
50
  "ws": "^8.13.0"
51
51
  },
52
52
  "dependencies": {
53
- "@innovastudio/contentbuilder": "^1.4.79",
53
+ "@innovastudio/contentbuilder": "^1.4.80",
54
54
  "js-beautify": "^1.14.0"
55
55
  }
56
56
  }
@@ -99304,7 +99304,7 @@ class Dictation {
99304
99304
  <span style="margin-left:5px">${this.util.out('Abort')}</span>
99305
99305
  `;
99306
99306
  const ovl = this.builderStuff.querySelector('.page-command-overlay');
99307
- ovl.style.display = 'flex';
99307
+ if (ovl) ovl.style.display = 'flex';
99308
99308
  this.builder.isInProgress = true;
99309
99309
  }
99310
99310
  finish() {
@@ -99312,7 +99312,7 @@ class Dictation {
99312
99312
  const btnSend = this.modalCommand.querySelector('.cmd-send-command');
99313
99313
  btnSend.innerText = this.util.out('Send');
99314
99314
  const ovl = this.builderStuff.querySelector('.page-command-overlay');
99315
- ovl.style.display = 'none';
99315
+ if (ovl) ovl.style.display = 'none';
99316
99316
  }
99317
99317
  }
99318
99318
 
@@ -115741,6 +115741,16 @@ class Command {
115741
115741
  if (activeSection.classList.contains('is-box')) sectionBox = true; // A single box section
115742
115742
  }
115743
115743
 
115744
+ if (!activeBox) {
115745
+ this.builder.selectSection();
115746
+ activeBox = this.builder.activeBox;
115747
+ activeSection = this.builder.activeSection;
115748
+
115749
+ if (activeSection) {
115750
+ if (activeSection.classList.contains('is-box')) sectionBox = true; // A single box section
115751
+ }
115752
+ }
115753
+
115744
115754
  if (this.builder.enableShortCommands) {
115745
115755
  // Process Short Commands
115746
115756
  question = this.builder.editor.lib.processShortCommand(question); // Process the shortCommandList
@@ -116006,6 +116016,8 @@ class Command {
116006
116016
  if (val === 'remove') {
116007
116017
  const activeSection = this.builder.activeSection;
116008
116018
  activeSection.parentNode.removeChild(activeSection);
116019
+ this.builder.activeSection = null;
116020
+ this.builder.activeBox = null;
116009
116021
  }
116010
116022
 
116011
116023
  this.builder.sectionStack();
@@ -116624,6 +116636,7 @@ ${currentHtml}`;
116624
116636
 
116625
116637
  processPrompt(intent, question) {
116626
116638
  const activeBox = this.builder.activeBox;
116639
+ if (!activeBox) return question;
116627
116640
 
116628
116641
  const selectElement = row => {
116629
116642
  if (!row) return;
@@ -116838,6 +116851,8 @@ ${currentHtml}`;
116838
116851
  this.builder.editor.saveForUndo();
116839
116852
  const activeSection = this.builder.activeSection;
116840
116853
  activeSection.parentNode.removeChild(activeSection);
116854
+ this.builder.activeSection = null;
116855
+ this.builder.activeBox = null;
116841
116856
  this.builder.settings.onChange();
116842
116857
  return false;
116843
116858
  } else if (intent === 'add_content') {
@@ -118306,7 +118321,9 @@ ${currentHtml}`;
118306
118321
 
118307
118322
  if (data.error) {
118308
118323
  // Error response from OpenAI goes here.
118309
- console.log('Error:\n' + data.error);
118324
+ console.log('Error:\n' + data.error); // ex. wrong API Key => Request failed with status code 401
118325
+
118326
+ this.builder.showMessage(out('Request failed.'));
118310
118327
  this.dictation.finish(); // Must be called after finished
118311
118328
 
118312
118329
  return;
@@ -118367,6 +118384,8 @@ ${currentHtml}`;
118367
118384
  const data = await response.text();
118368
118385
  console.log('Response:\n' + data); // Shows code error
118369
118386
  }
118387
+
118388
+ this.builder.showMessage(out('Service Unavailable.'));
118370
118389
  }
118371
118390
  }
118372
118391
  }