@innovastudio/contentbuilder 1.4.140 → 1.4.142

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.4.140",
4
+ "version": "1.4.142",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -207,6 +207,12 @@ button:focus-visible {
207
207
  display: none !important;
208
208
  }
209
209
 
210
+ #_cbhtml {
211
+ height: 0px;
212
+ float: left;
213
+ margin-top: -100px;
214
+ }
215
+
210
216
  #_cbhtml,
211
217
  .is-ui {
212
218
  /*
@@ -219,7 +225,7 @@ button:focus-visible {
219
225
  font-family: sans-serif;
220
226
  font-size: 13px;
221
227
  letter-spacing: 1px;
222
- font-weight: 300px;
228
+ font-weight: 300;
223
229
  /* general use */
224
230
  /*
225
231
  .rte-align-options,
@@ -4994,6 +5000,7 @@ button:focus-visible {
4994
5000
  border-radius: 0px;
4995
5001
  color: #fefefe;
4996
5002
  z-index: 100005;
5003
+ -webkit-font-smoothing: auto;
4997
5004
  }
4998
5005
 
4999
5006
  /*!
@@ -18276,12 +18276,16 @@ const renderSnippetPanel = (builder, snippetOpen) => {
18276
18276
  }
18277
18277
 
18278
18278
  // destroy
18279
- if (builder.sortableOnCanvas) builder.sortableOnCanvas.forEach(obj => {
18280
- if (obj) {
18281
- obj.destroy();
18282
- }
18283
- });
18284
- if (builder.sortableOnPage) builder.sortableOnPage.destroy();
18279
+ if (builder.sortableOnCanvas) {
18280
+ builder.sortableOnCanvas.forEach(obj => {
18281
+ if (obj) {
18282
+ obj.destroy();
18283
+ }
18284
+ });
18285
+ if (builder.sortableOnPage) builder.sortableOnPage.destroy();
18286
+ }
18287
+ let dummies = builder.doc.querySelectorAll('.block-dummy');
18288
+ dummies.forEach(elm => elm.parentNode.removeChild(elm));
18285
18289
  }
18286
18290
  });
18287
18291
  if (builder.opts.snippetList === '#divSnippetList') {
@@ -70885,7 +70889,7 @@ class Resizeable {
70885
70889
  let scale = this.getScale(container);
70886
70890
  if (!scale) {
70887
70891
  const wrapper = container.closest('.is-wrapper');
70888
- scale = this.getScale(wrapper);
70892
+ if (wrapper) scale = this.getScale(wrapper);else scale = 1;
70889
70893
  }
70890
70894
 
70891
70895
  // Minimum resize
@@ -77329,11 +77333,17 @@ class ContentBuilder {
77329
77333
 
77330
77334
  // Hide element tool
77331
77335
  this.elmTool.hide();
77332
- if (this.sortableOnCanvas) this.sortableOnCanvas.forEach(obj => {
77333
- if (obj) {
77334
- obj.destroy();
77335
- }
77336
- });
77336
+
77337
+ // destroy
77338
+ if (this.sortableOnCanvas) {
77339
+ this.sortableOnCanvas.forEach(obj => {
77340
+ if (obj) {
77341
+ obj.destroy();
77342
+ }
77343
+ });
77344
+ let dummies = this.doc.querySelectorAll('.block-dummy');
77345
+ dummies.forEach(elm => elm.parentNode.removeChild(elm));
77346
+ }
77337
77347
 
77338
77348
  // if(this.sortableOnPage) this.sortableOnPage.destroy();
77339
77349
  }
@@ -79977,13 +79987,21 @@ class ContentBuilder {
79977
79987
  }
79978
79988
 
79979
79989
  sectionDropSetup() {
79980
- if (this.page) {
79981
- if (this.page !== '.is-wrapper') return; // only for ContentBox
79982
- const wrapper = this.doc.querySelector(this.page);
79990
+ if (this.blockContainer) {
79983
79991
  this.sortableOnCanvas = [];
79984
- const sections = wrapper.querySelectorAll('.is-box.box-canvas');
79985
- sections.forEach(section => {
79986
- const obj = new Sortable(section, {
79992
+ let wrapper;
79993
+ let boxes;
79994
+ if (this.page && this.page === '.is-wrapper') {
79995
+ wrapper = this.doc.querySelector(this.page);
79996
+ boxes = wrapper.querySelectorAll('.is-box.box-canvas');
79997
+ } else {
79998
+ boxes = this.doc.querySelectorAll(this.blockContainer);
79999
+ }
80000
+ boxes.forEach(box => {
80001
+ box.insertAdjacentHTML('afterbegin', `
80002
+ <div class="is-block block-dummy" style="top: calc(97.2707% - 149.797px); left: calc(50% - 222px); width: 444px; height: 154px;z-index:-1000;visibility:hidden">
80003
+ </div>`);
80004
+ const obj = new Sortable(box, {
79987
80005
  scroll: true,
79988
80006
  group: 'shared',
79989
80007
  direction: 'horizontal',
@@ -79996,7 +80014,7 @@ class ContentBuilder {
79996
80014
 
79997
80015
  let snippetid = itemEl.getAttribute('data-id');
79998
80016
  let lastBlock;
79999
- let elements = Array.from(section.querySelectorAll('.is-block')).filter(elm => !elm.parentNode.classList.contains('is-block')); // exclude child blocks
80017
+ let elements = Array.from(box.querySelectorAll('.is-block')).filter(elm => !elm.parentNode.classList.contains('is-block')); // exclude child blocks
80000
80018
  if (elements.length > 0) {
80001
80019
  lastBlock = elements[elements.length - 1];
80002
80020
  }
@@ -80108,14 +80126,14 @@ class ContentBuilder {
80108
80126
  itemEl.outerHTML = blockTemplate.replace('[%CONTENT%]', itemEl.innerHTML);
80109
80127
  }
80110
80128
  this.activeCol = null;
80111
- const builders = section.querySelectorAll('.is-container.container-new');
80129
+ const builders = box.querySelectorAll('.is-container.container-new');
80112
80130
  builders.forEach(builder => {
80113
80131
  const block = builder.parentNode;
80114
80132
  if (lastBlock) {
80115
80133
  lastBlock.insertAdjacentElement('afterend', block);
80116
80134
  } else {
80117
- const ovarlay = section.querySelector('.is-overlay');
80118
- ovarlay.insertAdjacentElement('afterend', block);
80135
+ const ovarlay = box.querySelector('.is-overlay');
80136
+ if (ovarlay) ovarlay.insertAdjacentElement('afterend', block);else box.insertAdjacentElement('afterbegin', block);
80119
80137
  }
80120
80138
 
80121
80139
  // After snippet has been added, re-apply behavior on builder areas
@@ -80128,16 +80146,24 @@ class ContentBuilder {
80128
80146
  }
80129
80147
 
80130
80148
  // destroy
80131
- if (this.sortableOnCanvas) this.sortableOnCanvas.forEach(obj => {
80132
- if (obj) {
80133
- obj.destroy();
80134
- }
80135
- });
80149
+ if (this.sortableOnCanvas) {
80150
+ this.sortableOnCanvas.forEach(obj => {
80151
+ if (obj) {
80152
+ obj.destroy();
80153
+ }
80154
+ });
80155
+ let dummies = this.doc.querySelectorAll('.block-dummy');
80156
+ dummies.forEach(elm => elm.parentNode.removeChild(elm));
80157
+ }
80136
80158
  if (this.sortableOnPage) this.sortableOnPage.destroy();
80137
80159
  }
80138
80160
  });
80139
80161
  this.sortableOnCanvas.push(obj);
80140
80162
  });
80163
+ }
80164
+ if (this.page) {
80165
+ if (this.page !== '.is-wrapper') return; // only for ContentBox
80166
+ const wrapper = this.doc.querySelector(this.page);
80141
80167
  this.sortableOnPage = new Sortable(wrapper, {
80142
80168
  scroll: true,
80143
80169
  group: 'shared',
@@ -80337,11 +80363,15 @@ class ContentBuilder {
80337
80363
  // this.sortableOnPage.option('draggable', '.dummy');
80338
80364
 
80339
80365
  // destroy
80340
- if (this.sortableOnCanvas) this.sortableOnCanvas.forEach(obj => {
80341
- if (obj) {
80342
- obj.destroy();
80343
- }
80344
- });
80366
+ if (this.sortableOnCanvas) {
80367
+ this.sortableOnCanvas.forEach(obj => {
80368
+ if (obj) {
80369
+ obj.destroy();
80370
+ }
80371
+ });
80372
+ let dummies = this.doc.querySelectorAll('.block-dummy');
80373
+ dummies.forEach(elm => elm.parentNode.removeChild(elm));
80374
+ }
80345
80375
  if (this.sortableOnPage) this.sortableOnPage.destroy();
80346
80376
  }
80347
80377
  });