@innovastudio/contentbuilder 1.5.95 → 1.5.96
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
@@ -1464,23 +1464,28 @@ const renderQuickAdd = builder => {
|
|
1464
1464
|
|
1465
1465
|
${encodeURIComponent(`
|
1466
1466
|
<div id="_style_{id}" style="display:none">
|
1467
|
-
|
1468
|
-
|
1467
|
+
#{id} {
|
1468
|
+
transition: all 0.3s ease-out;
|
1469
|
+
height: auto;
|
1469
1470
|
}
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1471
|
+
#{id}.collapsed {
|
1472
|
+
overflow: hidden;
|
1473
|
+
height: 0;
|
1474
|
+
}
|
1475
|
+
#status_{id} {
|
1476
|
+
transition: all 0.3s ease-out;
|
1477
|
+
height: auto;
|
1478
|
+
}
|
1479
|
+
#status_{id}.collapsed {
|
1480
|
+
overflow: hidden;
|
1481
|
+
height: 0;
|
1477
1482
|
}
|
1478
1483
|
</div>
|
1479
|
-
<
|
1484
|
+
<form id="form_{id}" method="POST" action="/formsubmission" style="padding: 25px 0 20px">
|
1480
1485
|
<div id="{id}"></div>
|
1481
1486
|
|
1482
|
-
<div id="status_{id}"></div>
|
1483
|
-
</
|
1487
|
+
<div id="status_{id}" class="collapsed"></div>
|
1488
|
+
</form>
|
1484
1489
|
|
1485
1490
|
<script>
|
1486
1491
|
var css = document.querySelector('#_style_{id}').innerHTML;
|
@@ -1502,11 +1507,7 @@ const renderQuickAdd = builder => {
|
|
1502
1507
|
docReady(function() {
|
1503
1508
|
|
1504
1509
|
var elm = document.getElementById('{id}');
|
1505
|
-
var viewer = new FormViewer(elm
|
1506
|
-
onChange: (json) => {
|
1507
|
-
// console.log(json);
|
1508
|
-
},
|
1509
|
-
});
|
1510
|
+
var viewer = new FormViewer(elm);
|
1510
1511
|
|
1511
1512
|
let json = {
|
1512
1513
|
"title": "Register for the Tech Conference",
|
@@ -1562,68 +1563,51 @@ const renderQuickAdd = builder => {
|
|
1562
1563
|
|
1563
1564
|
var statusInfo = document.querySelector('#status_{id}');
|
1564
1565
|
|
1565
|
-
|
1566
|
-
form.addEventListener('submit', async (event) => {
|
1567
|
-
|
1568
|
-
event.preventDefault();
|
1569
|
-
|
1570
|
-
const form = event.target;
|
1571
|
-
const formData = new FormData(form);
|
1572
|
-
|
1573
|
-
fetch('/formsubmission', {
|
1574
|
-
method: 'POST',
|
1575
|
-
body: formData,
|
1576
|
-
})
|
1577
|
-
.then(response=>response.json())
|
1578
|
-
.then(response=>{
|
1579
|
-
console.log(response);
|
1580
|
-
});
|
1581
|
-
});
|
1582
|
-
*/
|
1583
|
-
|
1566
|
+
var form = document.querySelector('#form_{id}');
|
1584
1567
|
|
1585
1568
|
async function handleSubmit(event) {
|
1586
1569
|
event.preventDefault();
|
1587
|
-
|
1588
|
-
var form = event.target;
|
1589
|
-
form.action = '/formsubmission';
|
1590
|
-
form.method = 'POST';
|
1591
1570
|
|
1592
1571
|
var btnSend = form.querySelector('.btn-submitform');
|
1593
1572
|
|
1594
1573
|
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';
|
1595
1574
|
|
1596
1575
|
var data = new FormData(form);
|
1576
|
+
|
1597
1577
|
fetch(form.action, {
|
1598
1578
|
method: form.method,
|
1599
1579
|
body: data,
|
1600
1580
|
headers: {
|
1601
1581
|
'Accept': 'application/json'
|
1602
1582
|
}
|
1603
|
-
})
|
1604
|
-
|
1605
|
-
|
1606
|
-
|
1583
|
+
})
|
1584
|
+
.then(response=>response.json())
|
1585
|
+
.then(data=>{
|
1586
|
+
if(!data.error) {
|
1587
|
+
statusInfo.innerHTML = '<div class="text-center pt-4 pb-4"><i class="bi bi-send-check size-64"></i>' +
|
1588
|
+
'</div><div class="leading-14 text-center size-38 pb-4">Thanks for your submission!</div>';
|
1607
1589
|
form.reset();
|
1590
|
+
|
1591
|
+
elm.classList.add('collapsed');
|
1592
|
+
setTimeout(function(){
|
1593
|
+
statusInfo.classList.remove('collapsed');
|
1594
|
+
},300);
|
1595
|
+
|
1608
1596
|
} else {
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1614
|
-
|
1615
|
-
});
|
1597
|
+
statusInfo.innerHTML = '<div class="leading-14 text-center size-38 pt-4 pb-4">Oops! There was a problem submitting your form.</div>';
|
1598
|
+
|
1599
|
+
// elm.classList.toggle('collapsed');
|
1600
|
+
setTimeout(function(){
|
1601
|
+
// statusInfo.innerHTML = data.error;
|
1602
|
+
statusInfo.classList.remove('collapsed');
|
1603
|
+
},300);
|
1616
1604
|
}
|
1617
1605
|
|
1618
|
-
btnSend.innerHTML = 'Submit';
|
1619
|
-
}).catch(error => {
|
1620
|
-
statusInfo.innerHTML = '<div class="leading-11 text-center size-38 pt-4 pb-4">Oops! There was a problem submitting your form.</div>';
|
1621
|
-
|
1622
1606
|
btnSend.innerHTML = 'Submit';
|
1623
1607
|
});
|
1624
1608
|
}
|
1625
1609
|
|
1626
|
-
|
1610
|
+
form.addEventListener('submit', handleSubmit);
|
1627
1611
|
|
1628
1612
|
});
|
1629
1613
|
</script>
|
@@ -18014,26 +17998,26 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
18014
17998
|
}
|
18015
17999
|
});
|
18016
18000
|
}
|
18001
|
+
|
18002
|
+
/*
|
18017
18003
|
let snippetid;
|
18018
|
-
if
|
18019
|
-
|
18020
|
-
|
18021
|
-
|
18022
|
-
|
18023
|
-
|
18024
|
-
|
18025
|
-
|
18026
|
-
|
18027
|
-
|
18028
|
-
|
18029
|
-
}, {
|
18030
|
-
passive: false
|
18004
|
+
if(isMobile && builder.isContentBox) {
|
18005
|
+
const items = snippetlist.querySelectorAll('.snippet-item');
|
18006
|
+
items.forEach(item=>{
|
18007
|
+
if(item.classList.contains('data-click')) return;
|
18008
|
+
item.addEventListener('touchstart', ()=>{
|
18009
|
+
snippetid = item.getAttribute('data-id');
|
18010
|
+
}, { passive: false });
|
18011
|
+
item.addEventListener('touchend', ()=>{
|
18012
|
+
builder.dropSnippet(snippetid);
|
18013
|
+
}, { passive: false });
|
18014
|
+
item.classList.add('data-click');
|
18031
18015
|
});
|
18032
|
-
item.classList.add('data-click');
|
18033
|
-
});
|
18034
18016
|
}
|
18017
|
+
*/
|
18035
18018
|
}
|
18036
18019
|
});
|
18020
|
+
|
18037
18021
|
inpSnippet.setValue(defaultcatval + '');
|
18038
18022
|
inpSnippet.closeOptions();
|
18039
18023
|
if (builder.opts.snippetList === '#divSnippetList') {
|
@@ -18151,28 +18135,27 @@ const renderSnippetPanel = (builder, snippetOpen) => {
|
|
18151
18135
|
|
18152
18136
|
let activeBuilderArea;
|
18153
18137
|
let itemHeight;
|
18138
|
+
|
18139
|
+
/*
|
18154
18140
|
const isMobile = dom.detectMobileOrTablet();
|
18155
|
-
|
18141
|
+
let snippetid;
|
18156
18142
|
let useClick = false;
|
18157
|
-
if
|
18158
|
-
|
18159
|
-
|
18160
|
-
|
18161
|
-
|
18162
|
-
|
18163
|
-
|
18164
|
-
|
18165
|
-
|
18166
|
-
|
18167
|
-
|
18168
|
-
}
|
18169
|
-
|
18170
|
-
|
18171
|
-
|
18172
|
-
|
18173
|
-
useClick = true;
|
18174
|
-
}
|
18175
|
-
if (!useClick) new Sortable(snippetlist, {
|
18143
|
+
if(isMobile && builder.isContentBox) {
|
18144
|
+
const items = snippetlist.querySelectorAll('.snippet-item');
|
18145
|
+
items.forEach(item=>{
|
18146
|
+
if(item.classList.contains('data-click')) return;
|
18147
|
+
item.addEventListener('touchstart', ()=>{
|
18148
|
+
snippetid = item.getAttribute('data-id');
|
18149
|
+
}, { passive: false });
|
18150
|
+
item.addEventListener('touchend', ()=>{
|
18151
|
+
builder.dropSnippet(snippetid);
|
18152
|
+
}, { passive: false });
|
18153
|
+
item.classList.add('data-click');
|
18154
|
+
});
|
18155
|
+
useClick=true;
|
18156
|
+
}
|
18157
|
+
if(!useClick) */
|
18158
|
+
new Sortable(snippetlist, {
|
18176
18159
|
// forceFallback: safariAgent,
|
18177
18160
|
group: {
|
18178
18161
|
name: 'shared',
|
@@ -50064,6 +50047,17 @@ class Module {
|
|
50064
50047
|
btn.style.display = '';
|
50065
50048
|
}
|
50066
50049
|
this.repositionModuleTool();
|
50050
|
+
|
50051
|
+
// Button clicks inside a module can perform tasks that affect column size.
|
50052
|
+
// This can cause the module tool or lockIndicator to have an incorrect position,
|
50053
|
+
// so we hide these tools.
|
50054
|
+
const activeElement = this.builder.doc.activeElement;
|
50055
|
+
if (activeElement.tagName.toLowerCase() === 'button') {
|
50056
|
+
if (this.moduleTool) this.moduleTool.style.display = '';
|
50057
|
+
setTimeout(() => {
|
50058
|
+
this.builder.colTool.lockIndicator.style.display = '';
|
50059
|
+
}, 0);
|
50060
|
+
}
|
50067
50061
|
} else {
|
50068
50062
|
this.builder.activeModule = null;
|
50069
50063
|
if (this.moduleTool) this.moduleTool.style.display = '';
|