@innovastudio/contentbox 1.6.99 → 1.6.101
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
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@innovastudio/contentbox",
|
3
3
|
"type": "module",
|
4
|
-
"version": "1.6.
|
4
|
+
"version": "1.6.101",
|
5
5
|
"description": "",
|
6
6
|
"main": "public/contentbox/contentbox.esm.js",
|
7
7
|
"types": "index.d.ts",
|
@@ -54,7 +54,7 @@
|
|
54
54
|
"ws": "^8.13.0"
|
55
55
|
},
|
56
56
|
"dependencies": {
|
57
|
-
"@innovastudio/contentbuilder": "^1.5.
|
57
|
+
"@innovastudio/contentbuilder": "^1.5.97",
|
58
58
|
"js-beautify": "^1.14.0",
|
59
59
|
"sortablejs": "^1.15.2"
|
60
60
|
}
|
@@ -26507,67 +26507,21 @@ class Snippets {
|
|
26507
26507
|
outline: transparent 1px solid;
|
26508
26508
|
}
|
26509
26509
|
|
26510
|
-
|
26511
|
-
|
26512
26510
|
/* Scrollbar for modal */
|
26513
|
-
|
26514
|
-
|
26515
|
-
|
26516
|
-
scrollbar-width: thin;
|
26517
|
-
scrollbar-color: rgb(78 78 78 / 62%) auto;
|
26518
|
-
}
|
26519
|
-
.dark *::-webkit-scrollbar {
|
26520
|
-
width: 12px;
|
26521
|
-
}
|
26522
|
-
.dark *::-webkit-scrollbar-track {
|
26523
|
-
background: transparent;
|
26511
|
+
.is-design-list {
|
26512
|
+
scrollbar-width: thin;
|
26513
|
+
scrollbar-color: #aaa #f0f0f0;
|
26524
26514
|
}
|
26525
|
-
.dark
|
26526
|
-
background-color:rgb(78 78 78 / 62%);
|
26527
|
-
}
|
26528
|
-
|
26529
|
-
.colored-dark * {
|
26515
|
+
.dark .is-design-list {
|
26530
26516
|
scrollbar-width: thin;
|
26531
|
-
scrollbar-color:
|
26517
|
+
scrollbar-color: #696969 #a1a1a1;
|
26518
|
+
/* scrollbar-color: rgba(255, 255, 255, 0.3) rgb(80, 80, 80); */
|
26532
26519
|
}
|
26533
|
-
.colored-dark
|
26534
|
-
width: 12px;
|
26535
|
-
}
|
26536
|
-
.colored-dark *::-webkit-scrollbar-track {
|
26537
|
-
background: transparent;
|
26538
|
-
}
|
26539
|
-
.colored-dark *::-webkit-scrollbar-thumb {
|
26540
|
-
background-color:rgb(100, 100, 100);
|
26541
|
-
}
|
26542
|
-
|
26543
|
-
.colored * {
|
26520
|
+
.colored-dark .is-design-list {
|
26544
26521
|
scrollbar-width: thin;
|
26545
|
-
scrollbar-color:
|
26546
|
-
}
|
26547
|
-
.colored *::-webkit-scrollbar {
|
26548
|
-
width: 12px;
|
26549
|
-
}
|
26550
|
-
.colored *::-webkit-scrollbar-track {
|
26551
|
-
background: transparent;
|
26522
|
+
scrollbar-color: #7a7a7a #bebebe;
|
26552
26523
|
}
|
26553
|
-
.colored *::-webkit-scrollbar-thumb {
|
26554
|
-
background-color: rgba(0, 0, 0, 0.4);
|
26555
|
-
}
|
26556
26524
|
|
26557
|
-
.light * {
|
26558
|
-
scrollbar-width: thin;
|
26559
|
-
scrollbar-color: rgba(0, 0, 0, 0.4) auto;
|
26560
|
-
}
|
26561
|
-
.light *::-webkit-scrollbar {
|
26562
|
-
width: 12px;
|
26563
|
-
}
|
26564
|
-
.light *::-webkit-scrollbar-track {
|
26565
|
-
background: transparent;
|
26566
|
-
}
|
26567
|
-
.light *::-webkit-scrollbar-thumb {
|
26568
|
-
background-color: rgba(0, 0, 0, 0.4);
|
26569
|
-
}
|
26570
|
-
|
26571
26525
|
svg {
|
26572
26526
|
fill: ${this.builder.styleSnippetColor};
|
26573
26527
|
}
|
@@ -27885,23 +27839,28 @@ const renderQuickAdd = builder => {
|
|
27885
27839
|
|
27886
27840
|
${encodeURIComponent(`
|
27887
27841
|
<div id="_style_{id}" style="display:none">
|
27888
|
-
|
27889
|
-
|
27842
|
+
#{id} {
|
27843
|
+
transition: all 0.3s ease-out;
|
27844
|
+
height: auto;
|
27890
27845
|
}
|
27891
|
-
|
27892
|
-
|
27893
|
-
|
27894
|
-
|
27895
|
-
|
27896
|
-
|
27897
|
-
|
27846
|
+
#{id}.collapsed {
|
27847
|
+
overflow: hidden;
|
27848
|
+
height: 0;
|
27849
|
+
}
|
27850
|
+
#status_{id} {
|
27851
|
+
transition: all 0.3s ease-out;
|
27852
|
+
height: auto;
|
27853
|
+
}
|
27854
|
+
#status_{id}.collapsed {
|
27855
|
+
overflow: hidden;
|
27856
|
+
height: 0;
|
27898
27857
|
}
|
27899
27858
|
</div>
|
27900
|
-
<
|
27859
|
+
<form id="form_{id}" method="POST" action="/formsubmission" style="padding: 25px 0 20px">
|
27901
27860
|
<div id="{id}"></div>
|
27902
27861
|
|
27903
|
-
<div id="status_{id}"></div>
|
27904
|
-
</
|
27862
|
+
<div id="status_{id}" class="collapsed"></div>
|
27863
|
+
</form>
|
27905
27864
|
|
27906
27865
|
<script>
|
27907
27866
|
var css = document.querySelector('#_style_{id}').innerHTML;
|
@@ -27923,11 +27882,7 @@ const renderQuickAdd = builder => {
|
|
27923
27882
|
docReady(function() {
|
27924
27883
|
|
27925
27884
|
var elm = document.getElementById('{id}');
|
27926
|
-
var viewer = new FormViewer(elm
|
27927
|
-
onChange: (json) => {
|
27928
|
-
// console.log(json);
|
27929
|
-
},
|
27930
|
-
});
|
27885
|
+
var viewer = new FormViewer(elm);
|
27931
27886
|
|
27932
27887
|
let json = {
|
27933
27888
|
"title": "Register for the Tech Conference",
|
@@ -27983,68 +27938,51 @@ const renderQuickAdd = builder => {
|
|
27983
27938
|
|
27984
27939
|
var statusInfo = document.querySelector('#status_{id}');
|
27985
27940
|
|
27986
|
-
|
27987
|
-
form.addEventListener('submit', async (event) => {
|
27988
|
-
|
27989
|
-
event.preventDefault();
|
27990
|
-
|
27991
|
-
const form = event.target;
|
27992
|
-
const formData = new FormData(form);
|
27993
|
-
|
27994
|
-
fetch('/formsubmission', {
|
27995
|
-
method: 'POST',
|
27996
|
-
body: formData,
|
27997
|
-
})
|
27998
|
-
.then(response=>response.json())
|
27999
|
-
.then(response=>{
|
28000
|
-
console.log(response);
|
28001
|
-
});
|
28002
|
-
});
|
28003
|
-
*/
|
28004
|
-
|
27941
|
+
var form = document.querySelector('#form_{id}');
|
28005
27942
|
|
28006
27943
|
async function handleSubmit(event) {
|
28007
27944
|
event.preventDefault();
|
28008
|
-
|
28009
|
-
var form = event.target;
|
28010
|
-
form.action = '/formsubmission';
|
28011
|
-
form.method = 'POST';
|
28012
27945
|
|
28013
27946
|
var btnSend = form.querySelector('.btn-submitform');
|
28014
27947
|
|
28015
27948
|
btnSend.innerHTML = '<span class="loading-icon"><svg class="animate-spin" style="margin-right:7px;width:20px;height:20px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg></span>Submit';
|
28016
27949
|
|
28017
27950
|
var data = new FormData(form);
|
27951
|
+
|
28018
27952
|
fetch(form.action, {
|
28019
27953
|
method: form.method,
|
28020
27954
|
body: data,
|
28021
27955
|
headers: {
|
28022
27956
|
'Accept': 'application/json'
|
28023
27957
|
}
|
28024
|
-
})
|
28025
|
-
|
28026
|
-
|
28027
|
-
|
27958
|
+
})
|
27959
|
+
.then(response=>response.json())
|
27960
|
+
.then(data=>{
|
27961
|
+
if(!data.error) {
|
27962
|
+
statusInfo.innerHTML = '<div class="text-center pt-4 pb-4"><i class="bi bi-send-check size-64"></i>' +
|
27963
|
+
'</div><div class="leading-14 text-center size-38 pb-4">Thanks for your submission!</div>';
|
28028
27964
|
form.reset();
|
27965
|
+
|
27966
|
+
elm.classList.add('collapsed');
|
27967
|
+
setTimeout(function(){
|
27968
|
+
statusInfo.classList.remove('collapsed');
|
27969
|
+
},300);
|
27970
|
+
|
28029
27971
|
} else {
|
28030
|
-
|
28031
|
-
|
28032
|
-
|
28033
|
-
|
28034
|
-
|
28035
|
-
|
28036
|
-
});
|
27972
|
+
statusInfo.innerHTML = '<div class="leading-14 text-center size-38 pt-4 pb-4">Oops! There was a problem submitting your form.</div>';
|
27973
|
+
|
27974
|
+
// elm.classList.toggle('collapsed');
|
27975
|
+
setTimeout(function(){
|
27976
|
+
// statusInfo.innerHTML = data.error;
|
27977
|
+
statusInfo.classList.remove('collapsed');
|
27978
|
+
},300);
|
28037
27979
|
}
|
28038
27980
|
|
28039
|
-
btnSend.innerHTML = 'Submit';
|
28040
|
-
}).catch(error => {
|
28041
|
-
statusInfo.innerHTML = '<div class="leading-11 text-center size-38 pt-4 pb-4">Oops! There was a problem submitting your form.</div>';
|
28042
|
-
|
28043
27981
|
btnSend.innerHTML = 'Submit';
|
28044
27982
|
});
|
28045
27983
|
}
|
28046
27984
|
|
28047
|
-
|
27985
|
+
form.addEventListener('submit', handleSubmit);
|
28048
27986
|
|
28049
27987
|
});
|
28050
27988
|
</script>
|
@@ -44435,26 +44373,26 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
44435
44373
|
}
|
44436
44374
|
});
|
44437
44375
|
}
|
44376
|
+
|
44377
|
+
/*
|
44438
44378
|
let snippetid;
|
44439
|
-
if
|
44440
|
-
|
44441
|
-
|
44442
|
-
|
44443
|
-
|
44444
|
-
|
44445
|
-
|
44446
|
-
|
44447
|
-
|
44448
|
-
|
44449
|
-
|
44450
|
-
}, {
|
44451
|
-
passive: false
|
44379
|
+
if(isMobile && builder.isContentBox) {
|
44380
|
+
const items = snippetlist.querySelectorAll('.snippet-item');
|
44381
|
+
items.forEach(item=>{
|
44382
|
+
if(item.classList.contains('data-click')) return;
|
44383
|
+
item.addEventListener('touchstart', ()=>{
|
44384
|
+
snippetid = item.getAttribute('data-id');
|
44385
|
+
}, { passive: false });
|
44386
|
+
item.addEventListener('touchend', ()=>{
|
44387
|
+
builder.dropSnippet(snippetid);
|
44388
|
+
}, { passive: false });
|
44389
|
+
item.classList.add('data-click');
|
44452
44390
|
});
|
44453
|
-
item.classList.add('data-click');
|
44454
|
-
});
|
44455
44391
|
}
|
44392
|
+
*/
|
44456
44393
|
}
|
44457
44394
|
});
|
44395
|
+
|
44458
44396
|
inpSnippet.setValue(defaultcatval + '');
|
44459
44397
|
inpSnippet.closeOptions();
|
44460
44398
|
if (builder.opts.snippetList === '#divSnippetList') {
|
@@ -44572,28 +44510,27 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
44572
44510
|
|
44573
44511
|
let activeBuilderArea;
|
44574
44512
|
let itemHeight;
|
44513
|
+
|
44514
|
+
/*
|
44575
44515
|
const isMobile = dom.detectMobileOrTablet();
|
44576
|
-
|
44516
|
+
let snippetid;
|
44577
44517
|
let useClick = false;
|
44578
|
-
if
|
44579
|
-
|
44580
|
-
|
44581
|
-
|
44582
|
-
|
44583
|
-
|
44584
|
-
|
44585
|
-
|
44586
|
-
|
44587
|
-
|
44588
|
-
|
44589
|
-
}
|
44590
|
-
|
44591
|
-
|
44592
|
-
|
44593
|
-
|
44594
|
-
useClick = true;
|
44595
|
-
}
|
44596
|
-
if (!useClick) new Sortable$1(snippetlist, {
|
44518
|
+
if(isMobile && builder.isContentBox) {
|
44519
|
+
const items = snippetlist.querySelectorAll('.snippet-item');
|
44520
|
+
items.forEach(item=>{
|
44521
|
+
if(item.classList.contains('data-click')) return;
|
44522
|
+
item.addEventListener('touchstart', ()=>{
|
44523
|
+
snippetid = item.getAttribute('data-id');
|
44524
|
+
}, { passive: false });
|
44525
|
+
item.addEventListener('touchend', ()=>{
|
44526
|
+
builder.dropSnippet(snippetid);
|
44527
|
+
}, { passive: false });
|
44528
|
+
item.classList.add('data-click');
|
44529
|
+
});
|
44530
|
+
useClick=true;
|
44531
|
+
}
|
44532
|
+
if(!useClick) */
|
44533
|
+
new Sortable$1(snippetlist, {
|
44597
44534
|
// forceFallback: safariAgent,
|
44598
44535
|
group: {
|
44599
44536
|
name: 'shared',
|
@@ -76432,6 +76369,12 @@ class Module {
|
|
76432
76369
|
moduleModal.querySelector('div:not(.is-modal-overlay)').style.width = '90vw';
|
76433
76370
|
moduleModal.querySelector('div:not(.is-modal-overlay)').style.maxWidth = w;
|
76434
76371
|
moduleModal.querySelector('div:not(.is-modal-overlay)').style.height = h;
|
76372
|
+
var themeLight = module.getAttribute('data-theme-light');
|
76373
|
+
if (themeLight || modulename === 'form-builder') {
|
76374
|
+
moduleModal.classList.add('theme-light');
|
76375
|
+
} else {
|
76376
|
+
moduleModal.classList.remove('theme-light');
|
76377
|
+
}
|
76435
76378
|
let btnClose = moduleModal.querySelector('.is-modal-close');
|
76436
76379
|
dom.addEventListener(btnClose, 'click', () => {
|
76437
76380
|
util.hideModal(moduleModal);
|
@@ -76485,6 +76428,17 @@ class Module {
|
|
76485
76428
|
btn.style.display = '';
|
76486
76429
|
}
|
76487
76430
|
this.repositionModuleTool();
|
76431
|
+
|
76432
|
+
// Button clicks inside a module can perform tasks that affect column size.
|
76433
|
+
// This can cause the module tool or lockIndicator to have an incorrect position,
|
76434
|
+
// so we hide these tools.
|
76435
|
+
const activeElement = this.builder.doc.activeElement;
|
76436
|
+
if (activeElement.tagName.toLowerCase() === 'button') {
|
76437
|
+
if (this.moduleTool) this.moduleTool.style.display = '';
|
76438
|
+
setTimeout(() => {
|
76439
|
+
this.builder.colTool.lockIndicator.style.display = '';
|
76440
|
+
}, 0);
|
76441
|
+
}
|
76488
76442
|
} else {
|
76489
76443
|
this.builder.activeModule = null;
|
76490
76444
|
if (this.moduleTool) this.moduleTool.style.display = '';
|