@innovastudio/contentbox 1.5.66 → 1.5.67
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.
|
4
|
+
"version": "1.5.67",
|
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.
|
53
|
+
"@innovastudio/contentbuilder": "^1.4.85",
|
54
54
|
"js-beautify": "^1.14.0"
|
55
55
|
}
|
56
56
|
}
|
@@ -5840,7 +5840,7 @@ var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof w
|
|
5840
5840
|
|
5841
5841
|
var js$2 = {exports: {}};
|
5842
5842
|
|
5843
|
-
var src$
|
5843
|
+
var src$1 = {};
|
5844
5844
|
|
5845
5845
|
var javascript$1 = {exports: {}};
|
5846
5846
|
|
@@ -11024,9 +11024,9 @@ function style_html$2(html_source, options, js, css) {
|
|
11024
11024
|
}
|
11025
11025
|
style_html$2.defaultOptions = html_beautify$1.defaultOptions;
|
11026
11026
|
|
11027
|
-
src$
|
11028
|
-
src$
|
11029
|
-
src$
|
11027
|
+
src$1.js = js_beautify$2;
|
11028
|
+
src$1.css = css_beautify$2;
|
11029
|
+
src$1.html = style_html$2;
|
11030
11030
|
|
11031
11031
|
/*jshint node:true */
|
11032
11032
|
|
@@ -11069,7 +11069,7 @@ function get_beautify(js_beautify, css_beautify, html_beautify) {
|
|
11069
11069
|
|
11070
11070
|
{
|
11071
11071
|
(function(mod) {
|
11072
|
-
var beautifier = src$
|
11072
|
+
var beautifier = src$1;
|
11073
11073
|
beautifier.js_beautify = beautifier.js;
|
11074
11074
|
beautifier.css_beautify = beautifier.css;
|
11075
11075
|
beautifier.html_beautify = beautifier.html;
|
@@ -15138,10 +15138,6 @@ class EditBox {
|
|
15138
15138
|
|
15139
15139
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
15140
15140
|
|
15141
|
-
function getDefaultExportFromCjs (x) {
|
15142
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
15143
|
-
}
|
15144
|
-
|
15145
15141
|
var rangyCore = {exports: {}};
|
15146
15142
|
|
15147
15143
|
/**
|
@@ -23689,7 +23685,7 @@ class Dom {
|
|
23689
23685
|
|
23690
23686
|
var js$1 = {exports: {}};
|
23691
23687
|
|
23692
|
-
var src
|
23688
|
+
var src = {};
|
23693
23689
|
|
23694
23690
|
var javascript = {exports: {}};
|
23695
23691
|
|
@@ -28828,9 +28824,9 @@ function style_html(html_source, options, js, css) {
|
|
28828
28824
|
}
|
28829
28825
|
style_html.defaultOptions = html_beautify.defaultOptions;
|
28830
28826
|
|
28831
|
-
src
|
28832
|
-
src
|
28833
|
-
src
|
28827
|
+
src.js = js_beautify;
|
28828
|
+
src.css = css_beautify;
|
28829
|
+
src.html = style_html;
|
28834
28830
|
|
28835
28831
|
/*jshint node:true */
|
28836
28832
|
|
@@ -28873,7 +28869,7 @@ function get_beautify(js_beautify, css_beautify, html_beautify) {
|
|
28873
28869
|
|
28874
28870
|
{
|
28875
28871
|
(function(mod) {
|
28876
|
-
var beautifier = src
|
28872
|
+
var beautifier = src;
|
28877
28873
|
beautifier.js_beautify = beautifier.js;
|
28878
28874
|
beautifier.css_beautify = beautifier.css;
|
28879
28875
|
beautifier.html_beautify = beautifier.html;
|
@@ -92536,14 +92532,8 @@ class Lib$1 {
|
|
92536
92532
|
}
|
92537
92533
|
}
|
92538
92534
|
|
92539
|
-
|
92540
|
-
|
92541
|
-
(function (module, exports) {
|
92542
|
-
!function(e,t){module.exports=t();}("undefined"!=typeof self?self:commonjsGlobal,(function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n});},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){(function(t){function o(e,t){if(null==e)return {};var o,n,i=function(e,t){if(null==e)return {};var o,n,i={},r=Object.keys(e);for(n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||(i[o]=e[o]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i}var n=t.AudioContext||t.webkitAudioContext,i=function e(){var t=this,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.isRecordingSupported())throw new Error("Recording is not supported in this browser");this.state="inactive",this.config=Object.assign({bufferLength:4096,encoderApplication:2049,encoderFrameSize:20,encoderPath:"encoderWorker.min.js",encoderSampleRate:48e3,maxFramesPerPage:40,mediaTrackConstraints:!0,monitorGain:0,numberOfChannels:1,recordingGain:1,resampleQuality:3,streamPages:!1,wavBitDepth:16,sourceNode:{context:null}},o),this.encodedSamplePosition=0,this.initAudioContext(),this.initialize=this.initWorklet().then((function(){return t.initEncoder()}));};i.isRecordingSupported=function(){var e=t.navigator&&t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia;return n&&e&&t.WebAssembly},i.version="8.0.5",i.prototype.clearStream=function(){this.stream&&(this.stream.getTracks?this.stream.getTracks().forEach((function(e){return e.stop()})):this.stream.stop());},i.prototype.close=function(){return this.monitorGainNode.disconnect(),this.recordingGainNode.disconnect(),this.sourceNode&&this.sourceNode.disconnect(),this.clearStream(),this.encoder&&(this.encoderNode.disconnect(),this.encoder.postMessage({command:"close"})),this.config.sourceNode.context?Promise.resolve():this.audioContext.close()},i.prototype.encodeBuffers=function(e){if("recording"===this.state){for(var t=[],o=0;o<e.numberOfChannels;o++)t[o]=e.getChannelData(o);this.encoder.postMessage({command:"encode",buffers:t});}},i.prototype.initAudioContext=function(){this.audioContext=this.config.sourceNode.context?this.config.sourceNode.context:new n,this.monitorGainNode=this.audioContext.createGain(),this.setMonitorGain(this.config.monitorGain),this.recordingGainNode=this.audioContext.createGain(),this.setRecordingGain(this.config.recordingGain);},i.prototype.initEncoder=function(){var e=this;this.audioContext.audioWorklet?(this.encoderNode=new AudioWorkletNode(this.audioContext,"encoder-worklet",{numberOfOutputs:0}),this.encoder=this.encoderNode.port):(console.log("audioWorklet support not detected. Falling back to scriptProcessor"),this.encodeBuffers=function(){return delete e.encodeBuffers},this.encoderNode=this.audioContext.createScriptProcessor(this.config.bufferLength,this.config.numberOfChannels,this.config.numberOfChannels),this.encoderNode.onaudioprocess=function(t){var o=t.inputBuffer;return e.encodeBuffers(o)},this.encoderNode.connect(this.audioContext.destination),this.encoder=new t.Worker(this.config.encoderPath));},i.prototype.initSourceNode=function(){var e=this;return this.config.sourceNode.context?(this.sourceNode=this.config.sourceNode,Promise.resolve()):t.navigator.mediaDevices.getUserMedia({audio:this.config.mediaTrackConstraints}).then((function(t){e.stream=t,e.sourceNode=e.audioContext.createMediaStreamSource(t);}))},i.prototype.initWorker=function(){var e=this,t=(this.config.streamPages?this.streamPage:this.storePage).bind(this);return this.recordedPages=[],this.totalLength=0,new Promise((function(n){e.encoder.addEventListener("message",(function o(i){var r=i.data;switch(r.message){case"ready":n();break;case"page":e.encodedSamplePosition=r.samplePosition,t(r.page);break;case"done":e.encoder.removeEventListener("message",o),e.finish();}})),e.encoder.start&&e.encoder.start();var i=e.config,r=(i.sourceNode,o(i,["sourceNode"]));e.encoder.postMessage(Object.assign({command:"init",originalSampleRate:e.audioContext.sampleRate,wavSampleRate:e.audioContext.sampleRate},r));}))},i.prototype.initWorklet=function(){return this.audioContext.audioWorklet?this.audioContext.audioWorklet.addModule(this.config.encoderPath):Promise.resolve()},i.prototype.pause=function(e){var t=this;if("recording"===this.state)return this.state="paused",this.recordingGainNode.disconnect(),e&&this.config.streamPages?new Promise((function(e){t.encoder.addEventListener("message",(function o(n){"flushed"===n.data.message&&(t.encoder.removeEventListener("message",o),t.onpause(),e());})),t.encoder.start&&t.encoder.start(),t.encoder.postMessage({command:"flush"});})):(this.onpause(),Promise.resolve())},i.prototype.resume=function(){"paused"===this.state&&(this.state="recording",this.recordingGainNode.connect(this.encoderNode),this.onresume());},i.prototype.setRecordingGain=function(e){this.config.recordingGain=e,this.recordingGainNode&&this.audioContext&&this.recordingGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01);},i.prototype.setMonitorGain=function(e){this.config.monitorGain=e,this.monitorGainNode&&this.audioContext&&this.monitorGainNode.gain.setTargetAtTime(e,this.audioContext.currentTime,.01);},i.prototype.start=function(){var e=this;return "inactive"===this.state?(this.state="loading",this.encodedSamplePosition=0,this.audioContext.resume().then((function(){return e.initialize})).then((function(){return Promise.all([e.initSourceNode(),e.initWorker()])})).then((function(){e.state="recording",e.encoder.postMessage({command:"getHeaderPages"}),e.sourceNode.connect(e.monitorGainNode),e.sourceNode.connect(e.recordingGainNode),e.monitorGainNode.connect(e.audioContext.destination),e.recordingGainNode.connect(e.encoderNode),e.onstart();})).catch((function(t){throw e.state="inactive",t}))):Promise.resolve()},i.prototype.stop=function(){var e=this;return "paused"===this.state||"recording"===this.state?(this.state="inactive",this.recordingGainNode.connect(this.encoderNode),this.monitorGainNode.disconnect(),this.clearStream(),new Promise((function(t){e.encoder.addEventListener("message",(function o(n){"done"===n.data.message&&(e.encoder.removeEventListener("message",o),t());})),e.encoder.start&&e.encoder.start(),e.encoder.postMessage({command:"done"});}))):Promise.resolve()},i.prototype.storePage=function(e){this.recordedPages.push(e),this.totalLength+=e.length;},i.prototype.streamPage=function(e){this.ondataavailable(e);},i.prototype.finish=function(){if(!this.config.streamPages){var e=new Uint8Array(this.totalLength);this.recordedPages.reduce((function(t,o){return e.set(o,t),t+o.length}),0),this.ondataavailable(e);}this.onstop();},i.prototype.ondataavailable=function(){},i.prototype.onpause=function(){},i.prototype.onresume=function(){},i.prototype.onstart=function(){},i.prototype.onstop=function(){},e.exports=i;}).call(this,o(1));},function(e,t){var o;o=function(){return this}();try{o=o||new Function("return this")();}catch(e){"object"==typeof window&&(o=window);}e.exports=o;}])}));
|
92543
|
-
}(recorder_min));
|
92544
|
-
|
92545
|
-
var Recorder = /*@__PURE__*/getDefaultExportFromCjs(recorder_min.exports);
|
92546
|
-
|
92535
|
+
// import RecordRTC from 'recordrtc';
|
92536
|
+
// import Recorder from 'opus-recorder'; // Using Recorder
|
92547
92537
|
const dom$l = new Dom();
|
92548
92538
|
class Dictation {
|
92549
92539
|
constructor(opts = {}, builder) {
|
@@ -92983,11 +92973,11 @@ class Dictation {
|
|
92983
92973
|
this.mediaRecorder.stop();
|
92984
92974
|
this.localStream.getTracks().forEach(track => track.stop()); // Stop the tracks to release the resources
|
92985
92975
|
}
|
92986
|
-
} else {
|
92987
|
-
|
92988
|
-
|
92989
|
-
|
92990
|
-
|
92976
|
+
} /* else {
|
92977
|
+
// Using Recorder
|
92978
|
+
if(this.recorder) this.recorder.stop();
|
92979
|
+
if(this.localStream) this.localStream.getTracks().forEach(track => track.stop()); // Stop the tracks to release the resources
|
92980
|
+
} */
|
92991
92981
|
|
92992
92982
|
if (this.websocket && this.websocket.readyState === WebSocket.OPEN) {
|
92993
92983
|
this.websocket.close();
|
@@ -93060,22 +93050,23 @@ class Dictation {
|
|
93060
93050
|
}).catch(error => {
|
93061
93051
|
console.log(error);
|
93062
93052
|
});
|
93063
|
-
} else {
|
93064
|
-
|
93065
|
-
|
93066
|
-
|
93067
|
-
|
93068
|
-
|
93069
|
-
|
93070
|
-
|
93071
|
-
|
93072
|
-
|
93073
|
-
|
93074
|
-
|
93075
|
-
|
93076
|
-
|
93077
|
-
|
93078
|
-
|
93053
|
+
} /* else {
|
93054
|
+
// Using Recorder
|
93055
|
+
this.recorder = new Recorder({
|
93056
|
+
encoderPath: this.builder.encoderPath||
|
93057
|
+
'https://cdnjs.cloudflare.com/ajax/libs/opus-recorder/8.0.5/encoderWorker.min.js',
|
93058
|
+
leaveStreamOpen: true,
|
93059
|
+
numberOfChannels: 1,
|
93060
|
+
// OPUS options
|
93061
|
+
encoderSampleRate: sampleRate,
|
93062
|
+
streamPages: true,
|
93063
|
+
maxBuffersPerPage: 1,
|
93064
|
+
});
|
93065
|
+
this.recorder.ondataavailable = (e) => {
|
93066
|
+
if(this.aborted) return;
|
93067
|
+
this.websocket.send(e.buffer);
|
93068
|
+
};
|
93069
|
+
} */
|
93079
93070
|
|
93080
93071
|
/*
|
93081
93072
|
// Using RecordRTC
|
@@ -93104,6 +93095,7 @@ class Dictation {
|
|
93104
93095
|
}, 2000);
|
93105
93096
|
}
|
93106
93097
|
let finalTranscripts = '';
|
93098
|
+
let speechTimeout;
|
93107
93099
|
this.websocket.onmessage = event => {
|
93108
93100
|
const message = JSON.parse(event.data);
|
93109
93101
|
if (message.event === 'can-open-mic') {
|
@@ -93111,22 +93103,29 @@ class Dictation {
|
|
93111
93103
|
|
93112
93104
|
if (this.builder.useMediaRecorder) {
|
93113
93105
|
this.mediaRecorder.start(1000); // Using mediaRecorder
|
93114
|
-
} else {
|
93115
|
-
|
93116
|
-
|
93106
|
+
} /* else {
|
93107
|
+
this.recorder.start(); // Using Recorder
|
93108
|
+
} */
|
93117
93109
|
|
93118
93110
|
// console.log('Start Dictation');
|
93119
93111
|
this.aborted = false;
|
93120
93112
|
}
|
93121
93113
|
if (message.event === 'transcript-result') {
|
93122
|
-
const transcripts = message.data;
|
93123
93114
|
if (this.builder.isInProgress || this.aborted) {
|
93124
93115
|
return;
|
93125
93116
|
}
|
93126
|
-
|
93117
|
+
const transcript = message.data.channel.alternatives[0].transcript;
|
93118
|
+
if (transcript && message.data.is_final) {
|
93119
|
+
finalTranscripts += ' ' + transcript;
|
93120
|
+
}
|
93127
93121
|
inpCommand.value = finalTranscripts;
|
93128
|
-
clearTimeout(
|
93129
|
-
|
93122
|
+
clearTimeout(speechTimeout);
|
93123
|
+
|
93124
|
+
// console.log('Writing..');
|
93125
|
+
|
93126
|
+
speechTimeout = setTimeout(() => {
|
93127
|
+
// console.log('Clear');
|
93128
|
+
|
93130
93129
|
this.builder.commandText = '';
|
93131
93130
|
finalTranscripts = '';
|
93132
93131
|
if (this.builder.autoSendCommand) {
|
@@ -93227,72 +93226,51 @@ class Dictation {
|
|
93227
93226
|
}
|
93228
93227
|
}
|
93229
93228
|
|
93230
|
-
var
|
93231
|
-
|
93232
|
-
|
93229
|
+
var stringSimilarity = {};
|
93230
|
+
|
93231
|
+
(function (exports) {
|
93232
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
93233
|
+
exports.stringSimilarity = void 0;
|
93234
|
+
/* global exports, Map */
|
93235
|
+
/**
|
93236
|
+
* Calculate similarity between two strings
|
93237
|
+
* @param {string} str1 First string to match
|
93238
|
+
* @param {string} str2 Second string to match
|
93239
|
+
* @param {number} [substringLength=2] Optional. Length of substring to be used in calculating similarity. Default 2.
|
93240
|
+
* @param {boolean} [caseSensitive=false] Optional. Whether you want to consider case in string matching. Default false;
|
93241
|
+
* @returns Number between 0 and 1, with 0 being a low match score.
|
93242
|
+
*/
|
93243
|
+
var stringSimilarity = function (str1, str2, substringLength, caseSensitive) {
|
93244
|
+
if (substringLength === void 0) { substringLength = 2; }
|
93245
|
+
if (caseSensitive === void 0) { caseSensitive = false; }
|
93246
|
+
if (!caseSensitive) {
|
93247
|
+
str1 = str1.toLowerCase();
|
93248
|
+
str2 = str2.toLowerCase();
|
93249
|
+
}
|
93250
|
+
if (str1.length < substringLength || str2.length < substringLength)
|
93251
|
+
return 0;
|
93252
|
+
var map = new Map();
|
93253
|
+
for (var i = 0; i < str1.length - (substringLength - 1); i++) {
|
93254
|
+
var substr1 = str1.substr(i, substringLength);
|
93255
|
+
map.set(substr1, map.has(substr1) ? map.get(substr1) + 1 : 1);
|
93256
|
+
}
|
93257
|
+
var match = 0;
|
93258
|
+
for (var j = 0; j < str2.length - (substringLength - 1); j++) {
|
93259
|
+
var substr2 = str2.substr(j, substringLength);
|
93260
|
+
var count = map.has(substr2) ? map.get(substr2) : 0;
|
93261
|
+
if (count > 0) {
|
93262
|
+
map.set(substr2, count - 1);
|
93263
|
+
match++;
|
93264
|
+
}
|
93265
|
+
}
|
93266
|
+
return (match * 2) / (str1.length + str2.length - ((substringLength - 1) * 2));
|
93233
93267
|
};
|
93268
|
+
exports.stringSimilarity = stringSimilarity;
|
93269
|
+
exports.default = exports.stringSimilarity;
|
93234
93270
|
|
93235
|
-
|
93236
|
-
first = first.replace(/\s+/g, '');
|
93237
|
-
second = second.replace(/\s+/g, '');
|
93238
|
-
|
93239
|
-
if (first === second) return 1; // identical or empty
|
93240
|
-
if (first.length < 2 || second.length < 2) return 0; // if either is a 0-letter or 1-letter string
|
93241
|
-
|
93242
|
-
let firstBigrams = new Map();
|
93243
|
-
for (let i = 0; i < first.length - 1; i++) {
|
93244
|
-
const bigram = first.substring(i, i + 2);
|
93245
|
-
const count = firstBigrams.has(bigram)
|
93246
|
-
? firstBigrams.get(bigram) + 1
|
93247
|
-
: 1;
|
93248
|
-
|
93249
|
-
firstBigrams.set(bigram, count);
|
93250
|
-
}
|
93251
|
-
let intersectionSize = 0;
|
93252
|
-
for (let i = 0; i < second.length - 1; i++) {
|
93253
|
-
const bigram = second.substring(i, i + 2);
|
93254
|
-
const count = firstBigrams.has(bigram)
|
93255
|
-
? firstBigrams.get(bigram)
|
93256
|
-
: 0;
|
93257
|
-
|
93258
|
-
if (count > 0) {
|
93259
|
-
firstBigrams.set(bigram, count - 1);
|
93260
|
-
intersectionSize++;
|
93261
|
-
}
|
93262
|
-
}
|
93263
|
-
|
93264
|
-
return (2.0 * intersectionSize) / (first.length + second.length - 2);
|
93265
|
-
}
|
93266
|
-
|
93267
|
-
function findBestMatch(mainString, targetStrings) {
|
93268
|
-
if (!areArgsValid(mainString, targetStrings)) throw new Error('Bad arguments: First argument should be a string, second should be an array of strings');
|
93269
|
-
|
93270
|
-
const ratings = [];
|
93271
|
-
let bestMatchIndex = 0;
|
93272
|
-
|
93273
|
-
for (let i = 0; i < targetStrings.length; i++) {
|
93274
|
-
const currentTargetString = targetStrings[i];
|
93275
|
-
const currentRating = compareTwoStrings(mainString, currentTargetString);
|
93276
|
-
ratings.push({target: currentTargetString, rating: currentRating});
|
93277
|
-
if (currentRating > ratings[bestMatchIndex].rating) {
|
93278
|
-
bestMatchIndex = i;
|
93279
|
-
}
|
93280
|
-
}
|
93281
|
-
|
93282
|
-
|
93283
|
-
const bestMatch = ratings[bestMatchIndex];
|
93284
|
-
|
93285
|
-
return { ratings: ratings, bestMatch: bestMatch, bestMatchIndex: bestMatchIndex };
|
93286
|
-
}
|
93287
|
-
|
93288
|
-
function areArgsValid(mainString, targetStrings) {
|
93289
|
-
if (typeof mainString !== 'string') return false;
|
93290
|
-
if (!Array.isArray(targetStrings)) return false;
|
93291
|
-
if (!targetStrings.length) return false;
|
93292
|
-
if (targetStrings.find( function (s) { return typeof s !== 'string'})) return false;
|
93293
|
-
return true;
|
93294
|
-
}
|
93271
|
+
}(stringSimilarity));
|
93295
93272
|
|
93273
|
+
// import stringSimilarity from 'string-similarity';
|
93296
93274
|
class Similarity {
|
93297
93275
|
constructor(builder) {
|
93298
93276
|
this.builder = builder;
|
@@ -93322,7 +93300,7 @@ class Similarity {
|
|
93322
93300
|
const normalizedCommand = command.toLowerCase();
|
93323
93301
|
let maxSimilarity = 0;
|
93324
93302
|
for (const cmd of list) {
|
93325
|
-
const similarity =
|
93303
|
+
const similarity = stringSimilarity.stringSimilarity(normalizedCommand, cmd);
|
93326
93304
|
if (similarity > maxSimilarity) {
|
93327
93305
|
// console.log(list)
|
93328
93306
|
// console.log(similarity)
|
@@ -93947,16 +93925,18 @@ class ContentBuilder {
|
|
93947
93925
|
enableDragResize: true,
|
93948
93926
|
simpleTextSettings: false,
|
93949
93927
|
enableColumnsPerLine: true,
|
93950
|
-
/* Prompt/Command Stuff */
|
93928
|
+
/* Prompt/Command Stuff for AI Assistant */
|
93951
93929
|
isContentBox: false,
|
93952
93930
|
sendCommandUrl: 'http://localhost:8081/answer',
|
93953
93931
|
// speechTranscribeUrl: 'http://192.168.1.7:8081',
|
93954
93932
|
onlineDemo: false,
|
93955
|
-
autoSendDelay:
|
93933
|
+
autoSendDelay: 4000,
|
93956
93934
|
commandPlaceholderText: '',
|
93957
93935
|
enableShortCommands: true,
|
93958
93936
|
speechRecognitionLang: 'en-US',
|
93959
|
-
useMediaRecorder:
|
93937
|
+
useMediaRecorder: true,
|
93938
|
+
// do not change
|
93939
|
+
encoderPath: '',
|
93960
93940
|
headlineList: ['We create simple and effective designs.', 'Ultimate Experiences With Story, Emotion, And Purpose.', 'Build Anything Beautifully', 'With Less Stuff and More Compassion', 'We\'re [CompanyName]. Full stack development with a spark of creativity.', 'Transforming your digital experience with [CompanyName]. Achieve your online goals with our customized solutions.', 'Revolutionizing web development with [CompanyName]. Unleash your digital potential with our high-performance solutions.', 'Creative and Inspiring'],
|
93961
93941
|
shortCommandList: {
|
93962
93942
|
undo: ['undo'],
|
@@ -115126,14 +115106,16 @@ class ContentBox {
|
|
115126
115106
|
// http://localhost:8081/answer
|
115127
115107
|
speechTranscribeUrl: '',
|
115128
115108
|
// http://localhost:8081
|
115129
|
-
autoSendDelay:
|
115109
|
+
autoSendDelay: 4000,
|
115130
115110
|
onlineDemo: false,
|
115131
115111
|
startAIAssistant: false,
|
115132
115112
|
temperature: 0.6,
|
115133
115113
|
//0.4,
|
115134
115114
|
topP: 0.9,
|
115135
115115
|
//0.6,
|
115136
|
-
useMediaRecorder:
|
115116
|
+
useMediaRecorder: true,
|
115117
|
+
// do not change
|
115118
|
+
encoderPath: '',
|
115137
115119
|
commandPlaceholderText: 'Create a section containing a short article with ideas for outdoor activities.',
|
115138
115120
|
disclaimerAI: `The feature you're about to use utilizes AI in some of its processes.
|
115139
115121
|
It's important to understand that AI systems have limitations.
|
@@ -115637,6 +115619,7 @@ Provide an engaging headline.`, 'Create a new section showcasing a photo gallery
|
|
115637
115619
|
commandPlaceholderText: this.settings.commandPlaceholderText,
|
115638
115620
|
similarityThreshold: this.settings.similarityThreshold,
|
115639
115621
|
useMediaRecorder: this.settings.useMediaRecorder,
|
115622
|
+
encoderPath: this.settings.encoderPath,
|
115640
115623
|
container: '.is-container',
|
115641
115624
|
page: '.is-wrapper',
|
115642
115625
|
deleteConfirm: this.settings.deleteConfirm,
|