@innovastudio/contentbuilder 1.4.78 → 1.4.79

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/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.4.78",
4
+ "version": "1.4.79",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -3932,7 +3932,7 @@ class Util {
3932
3932
  return s;
3933
3933
  }
3934
3934
  }
3935
- showMessage(message, focusOutline) {
3935
+ showMessage(message, focusOutline, callback) {
3936
3936
  const dom = this.dom;
3937
3937
  let html = '';
3938
3938
  html = `<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
@@ -3949,11 +3949,13 @@ class Util {
3949
3949
  }
3950
3950
  this.showModal(modalMessage, false, () => {
3951
3951
  modalMessage.parentNode.removeChild(modalMessage);
3952
+ if (callback) callback();
3952
3953
  });
3953
3954
  let buttonok = modalMessage.querySelector('.modalmessage .input-ok');
3954
3955
  dom.addEventListener(buttonok, 'click', () => {
3955
3956
  this.hideModal(modalMessage);
3956
3957
  if (modalMessage.parentNode) modalMessage.parentNode.removeChild(modalMessage);
3958
+ if (callback) callback();
3957
3959
  });
3958
3960
  buttonok.focus();
3959
3961
  if (focusOutline) {
@@ -83962,16 +83964,15 @@ class Dictation {
83962
83964
  }
83963
83965
  }
83964
83966
  openDictation() {
83967
+ const inpCommand = this.modalCommand.querySelector('.inp-command');
83965
83968
  if (this.modalCommand.classList.contains('active')) {
83966
83969
  setTimeout(() => {
83967
83970
  // Needed if opens programmatically on builder start (wait until all loaded)
83968
- const inpCommand = this.modalCommand.querySelector('.inp-command');
83969
83971
  inpCommand.focus();
83970
83972
  }, 600);
83971
83973
  return;
83972
83974
  }
83973
83975
  this.modalCommand.classList.add('active');
83974
- const inpCommand = this.modalCommand.querySelector('.inp-command');
83975
83976
  inpCommand.focus();
83976
83977
  localStorage.setItem('_dictation', '1');
83977
83978
  const chkAutoSend = this.builderStuff.querySelector('#chkAutoSendCommand');
@@ -83998,6 +83999,7 @@ class Dictation {
83998
83999
  });
83999
84000
  }
84000
84001
  async startDictation() {
84002
+ const inpCommand = this.modalCommand.querySelector('.inp-command');
84001
84003
  if (this.builder.onlineDemo) {
84002
84004
  setTimeout(() => {
84003
84005
  const btnDictation = this.builderStuff.querySelector('.cmd-enable-dictation');
@@ -84011,7 +84013,9 @@ class Dictation {
84011
84013
  }, 1); // to give delay from the btnDictation click
84012
84014
 
84013
84015
  //Show info
84014
- this.util.showMessage(this.util.out('Speech recognition is disabled in this online demo. Please type your command/prompt in the textbox.'), true);
84016
+ this.util.showMessage(this.util.out('Speech recognition is disabled in this online demo. You can type your command/prompt in the textbox.'), true, () => {
84017
+ inpCommand.focus();
84018
+ });
84015
84019
  return;
84016
84020
  }
84017
84021
  if (this.builder.speechTranscribeUrl) {
@@ -84058,7 +84062,6 @@ class Dictation {
84058
84062
  this.startDictation();
84059
84063
  }
84060
84064
  let finalTranscripts = '';
84061
- const inpCommand = this.modalCommand.querySelector('.inp-command');
84062
84065
  this.websocket.onmessage = event => {
84063
84066
  const message = JSON.parse(event.data);
84064
84067
  if (message.event === 'can-open-mic') {
@@ -84116,7 +84119,6 @@ class Dictation {
84116
84119
  }
84117
84120
  this.builder.commandText += finalTranscripts; // + '<i style="color:#999">' + interimTranscripts + '</i>';
84118
84121
 
84119
- const inpCommand = this.modalCommand.querySelector('.inp-command');
84120
84122
  inpCommand.value = this.builder.commandText;
84121
84123
  clearTimeout(this.speechTimeout);
84122
84124
  this.speechTimeout = setTimeout(() => {