@innovastudio/contentbuilder 1.5.86 → 1.5.87

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/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.86",
4
+ "version": "1.5.87",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -1456,14 +1456,13 @@ const renderQuickAdd = builder => {
1456
1456
  let html = `
1457
1457
  <div class="row">
1458
1458
  <div class="column" data-noedit
1459
- data-dialog-width="1220px"
1459
+ data-dialog-width="1600px"
1460
1460
  data-dialog-height="85vh"
1461
1461
  data-module="form-builder"
1462
1462
  data-module-desc="Form Builder"
1463
1463
  data-html="
1464
1464
 
1465
1465
  ${encodeURIComponent(`
1466
-
1467
1466
  <div id="_style_{id}" style="display:none">
1468
1467
  .animate-spin {
1469
1468
  animation: spin 1s linear infinite;
@@ -1480,8 +1479,6 @@ const renderQuickAdd = builder => {
1480
1479
  <form id="form_{id}" method="POST" action="/formsubmission" style="padding: 25px 0 20px">
1481
1480
  <div id="{id}"></div>
1482
1481
 
1483
- <button id="btn_send_{id}" type="submit" class="transition-all inline-flex items-center whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-6 mb-1 py-2 size-18 px-8 text-black leading-relaxed rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Submit</button>
1484
-
1485
1482
  <div id="status_{id}"></div>
1486
1483
  </form>
1487
1484
 
@@ -1491,12 +1488,14 @@ const renderQuickAdd = builder => {
1491
1488
  var s = document.createElement('style');
1492
1489
  s.appendChild(document.createTextNode(css));
1493
1490
  head.appendChild(s);
1494
-
1491
+
1495
1492
  var docReady = function(fn) {
1496
1493
  var stateCheck = setInterval(function() {
1497
1494
  if (document.readyState !== "complete") return;
1498
1495
  clearInterval(stateCheck);
1499
- fn();
1496
+ try {
1497
+ fn()
1498
+ } catch (e) {}
1500
1499
  }, 1);
1501
1500
  };
1502
1501
 
@@ -1507,7 +1506,7 @@ const renderQuickAdd = builder => {
1507
1506
  onChange: (json) => {
1508
1507
  // console.log(json);
1509
1508
  },
1510
- // formHeader: false,
1509
+ formHeader: true,
1511
1510
  });
1512
1511
 
1513
1512
  let json = {
@@ -1539,8 +1538,7 @@ const renderQuickAdd = builder => {
1539
1538
  "choices": [
1540
1539
  "Keynote Speech",
1541
1540
  "AI Workshop",
1542
- "Networking Session",
1543
- "Panel Discussion"
1541
+ "Networking Session"
1544
1542
  ]
1545
1543
  },
1546
1544
  {
@@ -1555,22 +1553,22 @@ const renderQuickAdd = builder => {
1555
1553
  "isRequired": true,
1556
1554
  "placeholder": "Enter your email"
1557
1555
  }
1558
- ]
1556
+ ],
1557
+ "useSubmitButton": true,
1558
+ "submitText": "Submit"
1559
1559
  };
1560
1560
 
1561
1561
  viewer.view(json); // Render form
1562
1562
 
1563
1563
  const form = document.querySelector('#form_{id}');
1564
1564
 
1565
- var btnSend = document.querySelector('#btn_send_{id}');
1566
-
1567
1565
  var statusInfo = document.querySelector('#status_{id}');
1568
1566
 
1569
1567
  /*
1570
1568
  form.addEventListener('submit', async (event) => {
1571
1569
 
1572
1570
  event.preventDefault();
1573
-
1571
+
1574
1572
  const form = event.target;
1575
1573
  const formData = new FormData(form);
1576
1574
 
@@ -1588,6 +1586,8 @@ const renderQuickAdd = builder => {
1588
1586
  async function handleSubmit(event) {
1589
1587
  event.preventDefault();
1590
1588
 
1589
+ const btnSend = event.target;
1590
+
1591
1591
  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';
1592
1592
 
1593
1593
  var data = new FormData(event.target);
@@ -1619,7 +1619,8 @@ const renderQuickAdd = builder => {
1619
1619
  btnSend.innerHTML = 'Submit';
1620
1620
  });
1621
1621
  }
1622
- form.addEventListener('submit', handleSubmit);
1622
+
1623
+ viewer.settings.onSubmit = handleSubmit;
1623
1624
 
1624
1625
  });
1625
1626
  </script>
@@ -1661,8 +1662,7 @@ const renderQuickAdd = builder => {
1661
1662
  "choices": [
1662
1663
  "Keynote Speech",
1663
1664
  "AI Workshop",
1664
- "Networking Session",
1665
- "Panel Discussion"
1665
+ "Networking Session"
1666
1666
  ]
1667
1667
  },
1668
1668
  {
@@ -1677,7 +1677,9 @@ const renderQuickAdd = builder => {
1677
1677
  "isRequired": true,
1678
1678
  "placeholder": "Enter your email"
1679
1679
  }
1680
- ]
1680
+ ],
1681
+ "useSubmitButton": true,
1682
+ "submitText": "Submit"
1681
1683
  },
1682
1684
  "thankYouMessage": "Thanks for your submission!",
1683
1685
  "errorMessage": "Oops! There was a problem submitting your form.",
@@ -5897,6 +5899,10 @@ class Util {
5897
5899
  cellElement = rowElement.querySelector('div');
5898
5900
  if (cellElement) cellElement.click(); //change active block to the newly created
5899
5901
 
5902
+ const builderStuff = this.builder.builderStuff;
5903
+ let quickadd = builderStuff.querySelector('.quickadd');
5904
+ if (quickadd) this.hidePop(quickadd); // hide pop
5905
+
5900
5906
  // On Add Snippet from Modal
5901
5907
  const modules = this.builder.doc.querySelectorAll('.dummy-module');
5902
5908
  modules.forEach(module => {
@@ -49995,6 +50001,11 @@ class Module {
49995
50001
  w = '1500px';
49996
50002
  h = '80vh';
49997
50003
  }
50004
+
50005
+ // if(modulename==='form-builder') {
50006
+ // moduleModal.querySelector('div:not(.is-modal-overlay)').style.width = '90vw';
50007
+ // }
50008
+ moduleModal.querySelector('div:not(.is-modal-overlay)').style.width = '90vw';
49998
50009
  moduleModal.querySelector('div:not(.is-modal-overlay)').style.maxWidth = w;
49999
50010
  moduleModal.querySelector('div:not(.is-modal-overlay)').style.height = h;
50000
50011
  let btnClose = moduleModal.querySelector('.is-modal-close');