@innovastudio/contentbuilder 1.5.201 → 1.5.203

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.201",
4
+ "version": "1.5.203",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -4693,12 +4693,12 @@ class Util {
4693
4693
  dom.appendHtml(builderStuff, html);
4694
4694
  confirmmodal = builderStuff.querySelector('.is-confirm');
4695
4695
  }
4696
- this.showModal(confirmmodal, false, () => {
4696
+ this.showModal(confirmmodal, false, e => {
4697
4697
  //this function runs when overlay is clicked. Remove modal.
4698
4698
  confirmmodal.parentNode.removeChild(confirmmodal);
4699
4699
 
4700
4700
  //do task
4701
- callback(false);
4701
+ callback(false, e);
4702
4702
  }, true);
4703
4703
  let buttonok = confirmmodal.querySelector('.is-confirm .input-ok');
4704
4704
  dom.addEventListener(buttonok, 'click', () => {
@@ -5022,7 +5022,7 @@ class Util {
5022
5022
  modal.removeEventListener('keydown', handleKeyDown);
5023
5023
  const btnClose = modal.querySelector('.is-modal-close');
5024
5024
  if (btnClose) btnClose.removeEventListener('click', close);
5025
- if (cancelCallback) cancelCallback();
5025
+ if (cancelCallback) cancelCallback(e);
5026
5026
  }
5027
5027
  };
5028
5028
  modal.addEventListener('keydown', handleKeyDown);
@@ -18207,7 +18207,7 @@ const renderSnippetPanel = (builder, snippetOpen) => {
18207
18207
  builder.opts.snippetJSON.snippets.forEach(item => {
18208
18208
  item.id = index; //Give id to each record
18209
18209
  if (item.category === builder.opts.defaultSnippetCategory + '') {
18210
- dom.appendHtml(snippetlist, '<div class="snippet-item" data-id="' + item.id + '" data-cat="' + item.category + '"><img alt="' + util.out('Snippet') + '" src="' + snippetPath + item.thumbnail + '"><span class="is-overlay"></span></div>');
18210
+ dom.appendHtml(snippetlist, '<div data-drag-id="' + (index - 1) + '" class="snippet-item" data-id="' + item.id + '" data-cat="' + item.category + '"><img alt="' + util.out('Snippet') + '" src="' + snippetPath + item.thumbnail + '"><span class="is-overlay"></span></div>');
18211
18211
  }
18212
18212
  index++;
18213
18213
  });
@@ -18242,8 +18242,9 @@ const renderSnippetPanel = (builder, snippetOpen) => {
18242
18242
  });
18243
18243
  useClick=true;
18244
18244
  }
18245
- if(!useClick) */
18246
- new Sortable(snippetlist, {
18245
+
18246
+ if(!useClick) */
18247
+ if (!builder.iframeDragDrop) new Sortable(snippetlist, {
18247
18248
  // forceFallback: safariAgent,
18248
18249
  group: {
18249
18250
  name: 'shared',
@@ -92589,6 +92590,7 @@ The frameworks provide utility classes for structure and typography. To create r
92589
92590
  class ContentBuilder {
92590
92591
  constructor(opts = {}) {
92591
92592
  let defaults = {
92593
+ iframeDragDrop: false,
92592
92594
  page: '',
92593
92595
  container: '.is-container',
92594
92596
  siteToken: '',
@@ -99844,6 +99846,7 @@ Please obtain a license at: https://innovastudio.com/contentbox`);
99844
99846
  return visibleHeight / rect.height > 0.5;
99845
99847
  }
99846
99848
  sectionDropSetup() {
99849
+ if (this.iframeDragDrop) return;
99847
99850
  if (this.blockContainer) {
99848
99851
  this.sortableOnCanvas = [];
99849
99852
  let wrapper;