@innovastudio/contentbox 1.5.64 → 1.5.66
Sign up to get free protection for your applications and to get access to all the features.
@@ -13799,7 +13799,7 @@ class EditBox {
|
|
13799
13799
|
} else if (s === 'video') {
|
13800
13800
|
const chooseVideoBg = currentVideo => {
|
13801
13801
|
// Choose random video
|
13802
|
-
let videoList = this.builder.media.
|
13802
|
+
let videoList = this.builder.media.videos;
|
13803
13803
|
let randomIndex;
|
13804
13804
|
|
13805
13805
|
if (currentVideo) {
|
@@ -13810,13 +13810,13 @@ class EditBox {
|
|
13810
13810
|
randomIndex = Math.floor(Math.random() * videoList.length);
|
13811
13811
|
}
|
13812
13812
|
|
13813
|
-
return videoList[randomIndex];
|
13813
|
+
return this.builder.mediaPath + videoList[randomIndex];
|
13814
13814
|
};
|
13815
13815
|
|
13816
13816
|
let video = chooseVideoBg();
|
13817
13817
|
code = `
|
13818
13818
|
<video id="{id}" class="is-video-bg" muted loop playsinline autoplay>
|
13819
|
-
<source src="${this.builder.media.blank_video}" data-default="${video}">
|
13819
|
+
<source src="${this.builder.mediaPath + this.builder.media.blank_video}" data-default="${video}">
|
13820
13820
|
</video>
|
13821
13821
|
<div class="is-overlay-video" style="opacity:0.05"></div>
|
13822
13822
|
<script>
|
@@ -15138,6 +15138,10 @@ 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
|
+
|
15141
15145
|
var rangyCore = {exports: {}};
|
15142
15146
|
|
15143
15147
|
/**
|
@@ -92532,7 +92536,13 @@ class Lib$1 {
|
|
92532
92536
|
}
|
92533
92537
|
}
|
92534
92538
|
|
92535
|
-
|
92539
|
+
var recorder_min = {exports: {}};
|
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);
|
92536
92546
|
|
92537
92547
|
const dom$l = new Dom();
|
92538
92548
|
class Dictation {
|
@@ -92967,10 +92977,16 @@ class Dictation {
|
|
92967
92977
|
// track.stop();
|
92968
92978
|
// });
|
92969
92979
|
|
92970
|
-
|
92971
|
-
|
92972
|
-
this.mediaRecorder.
|
92973
|
-
|
92980
|
+
if (this.builder.useMediaRecorder) {
|
92981
|
+
// Using mediaRecorder
|
92982
|
+
if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {
|
92983
|
+
this.mediaRecorder.stop();
|
92984
|
+
this.localStream.getTracks().forEach(track => track.stop()); // Stop the tracks to release the resources
|
92985
|
+
}
|
92986
|
+
} else {
|
92987
|
+
// Using Recorder
|
92988
|
+
if (this.recorder) this.recorder.stop();
|
92989
|
+
if (this.localStream) this.localStream.getTracks().forEach(track => track.stop()); // Stop the tracks to release the resources
|
92974
92990
|
}
|
92975
92991
|
|
92976
92992
|
if (this.websocket && this.websocket.readyState === WebSocket.OPEN) {
|
@@ -93020,30 +93036,46 @@ class Dictation {
|
|
93020
93036
|
return;
|
93021
93037
|
}
|
93022
93038
|
const sampleRate = 16000;
|
93039
|
+
if (this.builder.useMediaRecorder) {
|
93040
|
+
// Using mediaRecorder
|
93041
|
+
navigator.mediaDevices.getUserMedia({
|
93042
|
+
audio: {
|
93043
|
+
sampleSize: 16,
|
93044
|
+
channelCount: 1,
|
93045
|
+
sampleRate: sampleRate
|
93046
|
+
}
|
93047
|
+
}).then(stream => {
|
93048
|
+
this.localStream = stream;
|
93049
|
+
this.mediaRecorder = new MediaRecorder(stream);
|
93050
|
+
this.mediaRecorder.addEventListener('dataavailable', event => {
|
93051
|
+
if (this.aborted) return;
|
93052
|
+
|
93053
|
+
// console.log(event.data);
|
93054
|
+
// if (event.data.size > 0) {
|
93055
|
+
// }
|
93056
|
+
this.websocket.send(event.data);
|
93057
|
+
});
|
93023
93058
|
|
93024
|
-
|
93025
|
-
|
93026
|
-
|
93027
|
-
sampleSize: 16,
|
93028
|
-
channelCount: 1,
|
93029
|
-
sampleRate: sampleRate
|
93030
|
-
}
|
93031
|
-
}).then(stream => {
|
93032
|
-
this.localStream = stream;
|
93033
|
-
this.mediaRecorder = new MediaRecorder(stream);
|
93034
|
-
this.mediaRecorder.addEventListener('dataavailable', event => {
|
93035
|
-
if (this.aborted) return;
|
93036
|
-
|
93037
|
-
// console.log(event.data);
|
93038
|
-
// if (event.data.size > 0) {
|
93039
|
-
// }
|
93040
|
-
this.websocket.send(event.data);
|
93059
|
+
// this.mediaRecorder.start(1000);
|
93060
|
+
}).catch(error => {
|
93061
|
+
console.log(error);
|
93041
93062
|
});
|
93042
|
-
|
93043
|
-
//
|
93044
|
-
|
93045
|
-
|
93046
|
-
|
93063
|
+
} else {
|
93064
|
+
// Using Recorder
|
93065
|
+
this.recorder = new Recorder({
|
93066
|
+
encoderPath: 'https://cdnjs.cloudflare.com/ajax/libs/opus-recorder/8.0.5/encoderWorker.min.js',
|
93067
|
+
leaveStreamOpen: true,
|
93068
|
+
numberOfChannels: 1,
|
93069
|
+
// OPUS options
|
93070
|
+
encoderSampleRate: sampleRate,
|
93071
|
+
streamPages: true,
|
93072
|
+
maxBuffersPerPage: 1
|
93073
|
+
});
|
93074
|
+
this.recorder.ondataavailable = e => {
|
93075
|
+
if (this.aborted) return;
|
93076
|
+
this.websocket.send(e.buffer);
|
93077
|
+
};
|
93078
|
+
}
|
93047
93079
|
|
93048
93080
|
/*
|
93049
93081
|
// Using RecordRTC
|
@@ -93077,7 +93109,11 @@ class Dictation {
|
|
93077
93109
|
if (message.event === 'can-open-mic') {
|
93078
93110
|
//this.recorder.startRecording(); // Using RecordRTC
|
93079
93111
|
|
93080
|
-
this.
|
93112
|
+
if (this.builder.useMediaRecorder) {
|
93113
|
+
this.mediaRecorder.start(1000); // Using mediaRecorder
|
93114
|
+
} else {
|
93115
|
+
this.recorder.start(); // Using Recorder
|
93116
|
+
}
|
93081
93117
|
|
93082
93118
|
// console.log('Start Dictation');
|
93083
93119
|
this.aborted = false;
|
@@ -93920,6 +93956,7 @@ class ContentBuilder {
|
|
93920
93956
|
commandPlaceholderText: '',
|
93921
93957
|
enableShortCommands: true,
|
93922
93958
|
speechRecognitionLang: 'en-US',
|
93959
|
+
useMediaRecorder: false,
|
93923
93960
|
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'],
|
93924
93961
|
shortCommandList: {
|
93925
93962
|
undo: ['undo'],
|
@@ -108593,6 +108630,10 @@ class Lib {
|
|
108593
108630
|
description: 'If requested to add a list with numbering.'
|
108594
108631
|
},
|
108595
108632
|
//-----
|
108633
|
+
change_color_individual_text: {
|
108634
|
+
type: 'boolean',
|
108635
|
+
description: 'User requests to change the color of a headline, paragraph of specific element/text.'
|
108636
|
+
},
|
108596
108637
|
change_content_dark: {
|
108597
108638
|
type: 'boolean',
|
108598
108639
|
description: 'If requested to change text/content color to dark/black.'
|
@@ -109162,7 +109203,7 @@ Important: Do not change the 'div.is-container' element!
|
|
109162
109203
|
|
109163
109204
|
let newMedia = mediaList[randomIndex];
|
109164
109205
|
this.builder.currentMedia = newMedia;
|
109165
|
-
return newMedia;
|
109206
|
+
return this.builder.mediaPath + newMedia;
|
109166
109207
|
}
|
109167
109208
|
|
109168
109209
|
getTypographyClass(html) {
|
@@ -109673,7 +109714,7 @@ class Command {
|
|
109673
109714
|
return;
|
109674
109715
|
}
|
109675
109716
|
|
109676
|
-
if (args.change_content_light) {
|
109717
|
+
if (args.change_content_light && !args.change_color_individual_text) {
|
109677
109718
|
this.builder.editor.saveForUndo();
|
109678
109719
|
this.builder.editor.lib.updateContentColor(activeBox, 'light');
|
109679
109720
|
this.builder.settings.onChange();
|
@@ -109681,7 +109722,7 @@ class Command {
|
|
109681
109722
|
return false;
|
109682
109723
|
}
|
109683
109724
|
|
109684
|
-
if (args.change_content_dark) {
|
109725
|
+
if (args.change_content_dark && !args.change_color_individual_text) {
|
109685
109726
|
this.builder.editor.saveForUndo();
|
109686
109727
|
this.builder.editor.lib.updateContentColor(activeBox, 'dark');
|
109687
109728
|
this.builder.settings.onChange();
|
@@ -109970,10 +110011,12 @@ class Command {
|
|
109970
110011
|
} // Replace {{_IMAGEURL}}
|
109971
110012
|
|
109972
110013
|
|
109973
|
-
|
109974
|
-
|
109975
|
-
|
109976
|
-
|
110014
|
+
if (context.includes('{{_IMAGEURL}}')) {
|
110015
|
+
const gallery = this.builder.media.images;
|
110016
|
+
const imageList = gallery.square;
|
110017
|
+
const imageUrl = this.lib.chooseMedia(imageList);
|
110018
|
+
context = context.replaceAll('{{_IMAGEURL}}', imageUrl);
|
110019
|
+
}
|
109977
110020
|
} else if (args.new_section_two_boxes || args.new_section_three_boxes || args.new_section_four_boxes) {
|
109978
110021
|
if (args.new_section_two_boxes) {
|
109979
110022
|
context = cl.new_section_two_boxes;
|
@@ -110000,13 +110043,15 @@ class Command {
|
|
110000
110043
|
context += '\n\n' + cl.update_section_article_with_image;
|
110001
110044
|
} else if (args.add_article) {
|
110002
110045
|
context += '\n\n' + cl.update_section_article_with_image;
|
110003
|
-
} else ;
|
110004
|
-
|
110046
|
+
} else ;
|
110005
110047
|
|
110006
|
-
|
110007
|
-
|
110008
|
-
|
110009
|
-
|
110048
|
+
if (context.includes('{{_IMAGEURL}}')) {
|
110049
|
+
//Replace {{_IMAGEURL}}
|
110050
|
+
const gallery = this.builder.media.images;
|
110051
|
+
const imageList = gallery.square;
|
110052
|
+
const imageUrl = this.lib.chooseMedia(imageList);
|
110053
|
+
context = context.replaceAll('{{_IMAGEURL}}', imageUrl);
|
110054
|
+
}
|
110010
110055
|
}
|
110011
110056
|
} else {
|
110012
110057
|
//if(args.redesign_layout || args.change_text || args.change_style) {
|
@@ -110085,13 +110130,15 @@ ${currentHtml}
|
|
110085
110130
|
} else if (args.add_article) {
|
110086
110131
|
context += '\n' + cl.update_section_article_with_image;
|
110087
110132
|
} else ;
|
110088
|
-
}
|
110089
|
-
|
110133
|
+
}
|
110090
110134
|
|
110091
|
-
|
110092
|
-
|
110093
|
-
|
110094
|
-
|
110135
|
+
if (context.includes('{{_IMAGEURL}}')) {
|
110136
|
+
//Replace {{_IMAGEURL}}
|
110137
|
+
const gallery = this.builder.media.images;
|
110138
|
+
const imageList = gallery.square;
|
110139
|
+
const imageUrl = this.lib.chooseMedia(imageList);
|
110140
|
+
context = context.replaceAll('{{_IMAGEURL}}', imageUrl);
|
110141
|
+
}
|
110095
110142
|
} // Check elements and add relevant context
|
110096
110143
|
|
110097
110144
|
|
@@ -110151,7 +110198,7 @@ ${currentHtml}
|
|
110151
110198
|
// New Section
|
110152
110199
|
// html = this.fixIcons(html);
|
110153
110200
|
html = this.fixButtons(html);
|
110154
|
-
html = this.fixBgImage(html);
|
110201
|
+
html = this.fixBgImage(html); // only if box has inline bg image, which is incorrect
|
110155
110202
|
|
110156
110203
|
if (args.section_background && args.section_background === 'image') {
|
110157
110204
|
html = this.setBgImage(html, true); // Change the bg image (also fix incorrect structure)
|
@@ -111247,99 +111294,132 @@ ${currentHtml}`;
|
|
111247
111294
|
|
111248
111295
|
this.builder.settings.onChange();
|
111249
111296
|
return false;
|
111250
|
-
}
|
111297
|
+
}
|
111298
|
+
/*else if(intent==='move_content_left') {
|
111299
|
+
|
111251
111300
|
this.builder.editor.saveForUndo();
|
111252
|
-
|
111253
|
-
|
111301
|
+
this.builder.editor.lib.moveContent(activeBox, 'left');
|
111302
|
+
this.builder.settings.onChange();
|
111254
111303
|
return false;
|
111255
|
-
|
111304
|
+
|
111305
|
+
} else if(intent==='move_content_center') {
|
111306
|
+
|
111256
111307
|
this.builder.editor.saveForUndo();
|
111257
|
-
|
111258
|
-
|
111259
|
-
|
111308
|
+
this.builder.editor.lib.moveContent(activeBox, 'center');
|
111309
|
+
// this.builder.editor.lib.moveContent(activeBox, 'middle');
|
111310
|
+
this.builder.settings.onChange();
|
111260
111311
|
return false;
|
111261
|
-
|
111312
|
+
|
111313
|
+
} else if(intent==='move_content_right') {
|
111314
|
+
|
111262
111315
|
this.builder.editor.saveForUndo();
|
111263
|
-
|
111264
|
-
|
111316
|
+
this.builder.editor.lib.moveContent(activeBox, 'right');
|
111317
|
+
this.builder.settings.onChange();
|
111265
111318
|
return false;
|
111266
|
-
|
111319
|
+
|
111320
|
+
} else if(intent==='move_content_top') {
|
111321
|
+
|
111267
111322
|
this.builder.editor.saveForUndo();
|
111268
|
-
|
111269
|
-
|
111323
|
+
this.builder.editor.lib.moveContent(activeBox, 'top');
|
111324
|
+
this.builder.settings.onChange();
|
111270
111325
|
return false;
|
111271
|
-
|
111326
|
+
|
111327
|
+
} else if(intent==='move_content_middle') {
|
111328
|
+
|
111272
111329
|
this.builder.editor.saveForUndo();
|
111273
|
-
|
111274
|
-
|
111330
|
+
this.builder.editor.lib.moveContent(activeBox, 'middle');
|
111331
|
+
this.builder.settings.onChange();
|
111275
111332
|
return false;
|
111276
|
-
|
111333
|
+
|
111334
|
+
} else if(intent==='move_content_bottom') {
|
111335
|
+
|
111277
111336
|
this.builder.editor.saveForUndo();
|
111278
|
-
|
111279
|
-
|
111337
|
+
this.builder.editor.lib.moveContent(activeBox, 'bottom');
|
111338
|
+
this.builder.settings.onChange();
|
111280
111339
|
return false;
|
111281
|
-
|
111282
|
-
|
111340
|
+
|
111341
|
+
} else if(intent==='make_content_center') { // This
|
111342
|
+
|
111283
111343
|
this.builder.editor.saveForUndo();
|
111284
|
-
|
111344
|
+
this.builder.editor.lib.moveContent(activeBox, 'center');
|
111285
111345
|
this.builder.editor.lib.moveContent(activeBox, 'middle');
|
111286
|
-
|
111346
|
+
this.builder.settings.onChange();
|
111287
111347
|
return false;
|
111288
|
-
|
111348
|
+
|
111349
|
+
} else if(intent==='align_content_top_left') {
|
111350
|
+
|
111289
111351
|
this.builder.editor.saveForUndo();
|
111290
|
-
|
111352
|
+
this.builder.editor.lib.moveContent(activeBox, 'top');
|
111291
111353
|
this.builder.editor.lib.moveContent(activeBox, 'left');
|
111292
|
-
|
111354
|
+
this.builder.settings.onChange();
|
111293
111355
|
return false;
|
111294
|
-
|
111356
|
+
|
111357
|
+
} else if(intent==='align_content_top_center') {
|
111358
|
+
|
111295
111359
|
this.builder.editor.saveForUndo();
|
111296
|
-
|
111360
|
+
this.builder.editor.lib.moveContent(activeBox, 'top');
|
111297
111361
|
this.builder.editor.lib.moveContent(activeBox, 'center');
|
111298
|
-
|
111362
|
+
this.builder.settings.onChange();
|
111299
111363
|
return false;
|
111300
|
-
|
111364
|
+
|
111365
|
+
} else if(intent==='align_content_top_right') {
|
111366
|
+
|
111301
111367
|
this.builder.editor.saveForUndo();
|
111302
|
-
|
111368
|
+
this.builder.editor.lib.moveContent(activeBox, 'top');
|
111303
111369
|
this.builder.editor.lib.moveContent(activeBox, 'right');
|
111304
|
-
|
111370
|
+
this.builder.settings.onChange();
|
111305
111371
|
return false;
|
111306
|
-
|
111372
|
+
|
111373
|
+
} else if(intent==='align_content_middle_left') {
|
111374
|
+
|
111307
111375
|
this.builder.editor.saveForUndo();
|
111308
|
-
|
111376
|
+
this.builder.editor.lib.moveContent(activeBox, 'middle');
|
111309
111377
|
this.builder.editor.lib.moveContent(activeBox, 'left');
|
111310
|
-
|
111378
|
+
this.builder.settings.onChange();
|
111311
111379
|
return false;
|
111312
|
-
|
111380
|
+
|
111381
|
+
} else if(intent==='align_content_middle_center') {
|
111382
|
+
|
111313
111383
|
this.builder.editor.saveForUndo();
|
111314
|
-
|
111384
|
+
this.builder.editor.lib.moveContent(activeBox, 'middle');
|
111315
111385
|
this.builder.editor.lib.moveContent(activeBox, 'center');
|
111316
|
-
|
111386
|
+
this.builder.settings.onChange();
|
111317
111387
|
return false;
|
111318
|
-
|
111388
|
+
|
111389
|
+
} else if(intent==='align_content_middle_right') {
|
111390
|
+
|
111319
111391
|
this.builder.editor.saveForUndo();
|
111320
|
-
|
111392
|
+
this.builder.editor.lib.moveContent(activeBox, 'middle');
|
111321
111393
|
this.builder.editor.lib.moveContent(activeBox, 'right');
|
111322
|
-
|
111394
|
+
this.builder.settings.onChange();
|
111323
111395
|
return false;
|
111324
|
-
|
111396
|
+
|
111397
|
+
} else if(intent==='align_content_bottom_left') {
|
111398
|
+
|
111325
111399
|
this.builder.editor.saveForUndo();
|
111326
|
-
|
111400
|
+
this.builder.editor.lib.moveContent(activeBox, 'bottom');
|
111327
111401
|
this.builder.editor.lib.moveContent(activeBox, 'left');
|
111328
|
-
|
111402
|
+
this.builder.settings.onChange();
|
111329
111403
|
return false;
|
111330
|
-
|
111404
|
+
|
111405
|
+
} else if(intent==='align_content_bottom_center') {
|
111406
|
+
|
111331
111407
|
this.builder.editor.saveForUndo();
|
111332
|
-
|
111408
|
+
this.builder.editor.lib.moveContent(activeBox, 'bottom');
|
111333
111409
|
this.builder.editor.lib.moveContent(activeBox, 'center');
|
111334
|
-
|
111410
|
+
this.builder.settings.onChange();
|
111335
111411
|
return false;
|
111336
|
-
|
111412
|
+
|
111413
|
+
} else if(intent==='align_content_bottom_right') {
|
111414
|
+
|
111337
111415
|
this.builder.editor.saveForUndo();
|
111338
|
-
|
111416
|
+
this.builder.editor.lib.moveContent(activeBox, 'bottom');
|
111339
111417
|
this.builder.editor.lib.moveContent(activeBox, 'right');
|
111340
|
-
|
111418
|
+
this.builder.settings.onChange();
|
111341
111419
|
return false;
|
111342
|
-
|
111420
|
+
|
111421
|
+
} */
|
111422
|
+
else if (intent === 'increase_space') {
|
111343
111423
|
let elm = this.builder.editor.activeElement;
|
111344
111424
|
|
111345
111425
|
if (elm) {
|
@@ -111471,7 +111551,7 @@ ${currentHtml}`;
|
|
111471
111551
|
randomIndex = Math.floor(Math.random() * imageList.length);
|
111472
111552
|
}
|
111473
111553
|
|
111474
|
-
return imageList[randomIndex];
|
111554
|
+
return this.builder.mediaPath + imageList[randomIndex];
|
111475
111555
|
} // Not Used
|
111476
111556
|
|
111477
111557
|
|
@@ -111686,31 +111766,7 @@ ${currentHtml}`;
|
|
111686
111766
|
let overlayCode = overlay.querySelector('.is-overlay-content');
|
111687
111767
|
if (overlayCode) overlayCode.parentNode.removeChild(overlayCode);
|
111688
111768
|
let sectionBox = false;
|
111689
|
-
if (box.classList.contains('is-section')) sectionBox = true; //
|
111690
|
-
|
111691
|
-
let bgImageUrl;
|
111692
|
-
let imageList;
|
111693
|
-
|
111694
|
-
if (sectionBox) {
|
111695
|
-
const gallery = this.builder.media.bg_images;
|
111696
|
-
imageList = gallery.section_text_left;
|
111697
|
-
const container = box.querySelector('.is-container');
|
111698
|
-
|
111699
|
-
if (container) {
|
111700
|
-
if (container.classList.contains('is-content-left')) {
|
111701
|
-
imageList = gallery.section_text_left;
|
111702
|
-
} else if (container.classList.contains('is-content-right')) {
|
111703
|
-
imageList = gallery.section_text_right;
|
111704
|
-
} else {
|
111705
|
-
imageList = gallery.section_text_center;
|
111706
|
-
}
|
111707
|
-
}
|
111708
|
-
} else {
|
111709
|
-
const gallery = this.builder.media.bg_images;
|
111710
|
-
imageList = gallery.box;
|
111711
|
-
}
|
111712
|
-
|
111713
|
-
bgImageUrl = this.lib.chooseMedia(imageList); // Check/fix if container misplaced
|
111769
|
+
if (box.classList.contains('is-section')) sectionBox = true; // Check/fix if container misplaced
|
111714
111770
|
|
111715
111771
|
const container = overlay.querySelector('.is-container');
|
111716
111772
|
|
@@ -111721,6 +111777,30 @@ ${currentHtml}`;
|
|
111721
111777
|
}
|
111722
111778
|
|
111723
111779
|
if (overlayBg) {
|
111780
|
+
// Choose random image
|
111781
|
+
let bgImageUrl;
|
111782
|
+
let imageList;
|
111783
|
+
|
111784
|
+
if (sectionBox) {
|
111785
|
+
const gallery = this.builder.media.bg_images;
|
111786
|
+
imageList = gallery.section_text_left;
|
111787
|
+
const container = box.querySelector('.is-container');
|
111788
|
+
|
111789
|
+
if (container) {
|
111790
|
+
if (container.classList.contains('is-content-left')) {
|
111791
|
+
imageList = gallery.section_text_left;
|
111792
|
+
} else if (container.classList.contains('is-content-right')) {
|
111793
|
+
imageList = gallery.section_text_right;
|
111794
|
+
} else {
|
111795
|
+
imageList = gallery.section_text_center;
|
111796
|
+
}
|
111797
|
+
}
|
111798
|
+
} else {
|
111799
|
+
const gallery = this.builder.media.bg_images;
|
111800
|
+
imageList = gallery.box;
|
111801
|
+
}
|
111802
|
+
|
111803
|
+
bgImageUrl = this.lib.chooseMedia(imageList);
|
111724
111804
|
overlayBg.style.backgroundImage = `url('${bgImageUrl}')`;
|
111725
111805
|
overlayBg.style.backgroundImage = `url('${bgImageUrl}')`;
|
111726
111806
|
overlayBg.style.backgroundPosition = '50% 60%';
|
@@ -112013,12 +112093,16 @@ ${currentHtml}`;
|
|
112013
112093
|
fixHtml(html) {
|
112014
112094
|
// Fix overlay structure when "is-overlay" containing background image in the style attribute
|
112015
112095
|
let regex = /<div class="is-overlay"([^>]*)style="([^"]*background-image:[^;"]+;)([^"]*)"([^>]*)>/g;
|
112016
|
-
html = html.replace(regex, '<div class="is-overlay"$1$4>\n <div class="is-overlay-bg" style="$2"></div>');
|
112096
|
+
html = html.replace(regex, '<div class="is-overlay"$1$4>\n <div class="is-overlay-bg" style="$2"></div>');
|
112097
|
+
|
112098
|
+
if (html.includes('{{_IMAGEURL}}')) {
|
112099
|
+
// Fix {{IMAGEURL}} that failed to replace
|
112100
|
+
const gallery = this.builder.media.images;
|
112101
|
+
const imageList = gallery.square;
|
112102
|
+
const imageUrl = this.lib.chooseMedia(imageList);
|
112103
|
+
html = html.replaceAll('{{IMAGEURL}}', imageUrl);
|
112104
|
+
} // Fix {{ICONCLASS}} that failed to replace
|
112017
112105
|
|
112018
|
-
const gallery = this.builder.media.images;
|
112019
|
-
const imageList = gallery.square;
|
112020
|
-
const imageUrl = this.lib.chooseMedia(imageList);
|
112021
|
-
html = html.replaceAll('{{IMAGEURL}}', imageUrl); // Fix {{ICONCLASS}} that failed to replace
|
112022
112106
|
|
112023
112107
|
html = html.replaceAll('{{ICONCLASS}}', 'ion-checkmark');
|
112024
112108
|
html = this.replaceButtonsWithAnchorTags(html);
|
@@ -115049,6 +115133,7 @@ class ContentBox {
|
|
115049
115133
|
//0.4,
|
115050
115134
|
topP: 0.9,
|
115051
115135
|
//0.6,
|
115136
|
+
useMediaRecorder: false,
|
115052
115137
|
commandPlaceholderText: 'Create a section containing a short article with ideas for outdoor activities.',
|
115053
115138
|
disclaimerAI: `The feature you're about to use utilizes AI in some of its processes.
|
115054
115139
|
It's important to understand that AI systems have limitations.
|
@@ -115061,42 +115146,42 @@ class ContentBox {
|
|
115061
115146
|
similarityThreshold: 0.65,
|
115062
115147
|
// for commandList similarity checking
|
115063
115148
|
headlineList: ['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.'],
|
115149
|
+
mediaPath: 'assets/gallery/',
|
115064
115150
|
media: {
|
115065
|
-
slider: ['
|
115066
|
-
blank_video: '
|
115067
|
-
|
115068
|
-
videos: ['assets/templates-simple/videos/beach1.mp4', 'assets/templates-simple/videos/beach2.mp4'],
|
115151
|
+
slider: ['slide-01.jpg', 'slide-02.jpg'],
|
115152
|
+
blank_video: 'blank.mp4',
|
115153
|
+
videos: ['beach1.mp4', 'beach2.mp4'],
|
115069
115154
|
youtube_videos: ['https://www.youtube.com/embed/P5yHEKqx86U?rel=0'],
|
115070
115155
|
maps: ['https://www.youtube.com/embed/P5yHEKqx86U?rel=0'],
|
115071
|
-
audios: ['
|
115156
|
+
audios: ['example.mp3'],
|
115072
115157
|
images: {
|
115073
|
-
square: ['
|
115158
|
+
square: ['person-01.jpg', 'person-02.jpg', 'person-03.jpg', 'person-04.jpg', 'person-05.jpg', 'person-06.jpg', 'person-08.jpg']
|
115074
115159
|
},
|
115075
115160
|
bg_images: {
|
115076
|
-
box: ['
|
115077
|
-
small_box: ['
|
115161
|
+
box: ['person-01.jpg', 'person-02.jpg', 'person-03.jpg', 'person-04.jpg', 'person-05.jpg', 'person-06.jpg', 'person-07.jpg', 'person-08.jpg', 'person-09.jpg', 'person-10.jpg', 'building.jpg', 'desk.jpg', 'chair.jpg', 'coffee.jpg', 'product.jpg', 'table.jpg'],
|
115162
|
+
small_box: ['person-01.jpg', 'person-03.jpg', 'person-04.jpg', 'person-05.jpg', 'person-10.jpg', 'chair.jpg', 'coffee.jpg', 'product.jpg', 'table.jpg'],
|
115078
115163
|
// section: [
|
115079
|
-
// '
|
115080
|
-
// '
|
115081
|
-
// '
|
115082
|
-
// '
|
115083
|
-
// '
|
115084
|
-
// '
|
115085
|
-
// '
|
115086
|
-
// '
|
115087
|
-
// '
|
115088
|
-
// '
|
115089
|
-
// '
|
115090
|
-
// '
|
115091
|
-
// '
|
115092
|
-
// '
|
115093
|
-
// '
|
115164
|
+
// 'header-01.jpg',
|
115165
|
+
// 'header-02.jpg',
|
115166
|
+
// 'header-03.jpg',
|
115167
|
+
// 'header-04.jpg',
|
115168
|
+
// 'header-05.jpg',
|
115169
|
+
// 'header-06.jpg',
|
115170
|
+
// 'header-07.jpg',
|
115171
|
+
// 'header-08.jpg',
|
115172
|
+
// 'header-09.jpg',
|
115173
|
+
// 'header-10.jpg',
|
115174
|
+
// 'header-11.jpg',
|
115175
|
+
// 'header-12.jpg',
|
115176
|
+
// 'header-13.jpg',
|
115177
|
+
// 'header-14.jpg',
|
115178
|
+
// 'header-15.jpg',
|
115094
115179
|
// ],
|
115095
|
-
section_text_left: ['
|
115096
|
-
'
|
115180
|
+
section_text_left: ['header-01.jpg', 'header-02.jpg', 'header-03.jpg', 'header-05.jpg', 'header-08.jpg', 'header-10b.jpg', // 'header-13.jpg',
|
115181
|
+
'header-14.jpg' // 'header-15b.jpg',
|
115097
115182
|
],
|
115098
|
-
section_text_center: ['
|
115099
|
-
section_text_right: ['
|
115183
|
+
section_text_center: ['header-07.jpg', 'header-11.jpg', 'header-12.jpg', 'header-13.jpg'],
|
115184
|
+
section_text_right: ['header-04.jpg', 'header-05b.jpg', 'header-06.jpg', 'header-08b.jpg', 'header-09.jpg', 'header-10.jpg', 'header-14b.jpg', 'header-15.jpg']
|
115100
115185
|
}
|
115101
115186
|
},
|
115102
115187
|
shortCommandList: {
|
@@ -115551,6 +115636,7 @@ Provide an engaging headline.`, 'Create a new section showcasing a photo gallery
|
|
115551
115636
|
commandInfo: this.settings.commandInfo,
|
115552
115637
|
commandPlaceholderText: this.settings.commandPlaceholderText,
|
115553
115638
|
similarityThreshold: this.settings.similarityThreshold,
|
115639
|
+
useMediaRecorder: this.settings.useMediaRecorder,
|
115554
115640
|
container: '.is-container',
|
115555
115641
|
page: '.is-wrapper',
|
115556
115642
|
deleteConfirm: this.settings.deleteConfirm,
|