@innovastudio/contentbuilder 1.4.78 → 1.4.80
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
|
@@ -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.
|
|
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(() => {
|
|
@@ -84164,7 +84166,7 @@ class Dictation {
|
|
|
84164
84166
|
<span style="margin-left:5px">${this.util.out('Abort')}</span>
|
|
84165
84167
|
`;
|
|
84166
84168
|
const ovl = this.builderStuff.querySelector('.page-command-overlay');
|
|
84167
|
-
ovl.style.display = 'flex';
|
|
84169
|
+
if (ovl) ovl.style.display = 'flex';
|
|
84168
84170
|
this.builder.isInProgress = true;
|
|
84169
84171
|
}
|
|
84170
84172
|
finish() {
|
|
@@ -84172,7 +84174,7 @@ class Dictation {
|
|
|
84172
84174
|
const btnSend = this.modalCommand.querySelector('.cmd-send-command');
|
|
84173
84175
|
btnSend.innerText = this.util.out('Send');
|
|
84174
84176
|
const ovl = this.builderStuff.querySelector('.page-command-overlay');
|
|
84175
|
-
ovl.style.display = 'none';
|
|
84177
|
+
if (ovl) ovl.style.display = 'none';
|
|
84176
84178
|
}
|
|
84177
84179
|
}
|
|
84178
84180
|
|