@innovastudio/contentbuilder 1.4.139 → 1.4.141

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.4.139",
4
+ "version": "1.4.141",
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') {
@@ -50186,7 +50190,7 @@ class Module {
50186
50190
  iframe.srcdoc = result;
50187
50191
  setTimeout(() => {
50188
50192
  iframe.style.opacity = '';
50189
- }, 300);
50193
+ }, 1);
50190
50194
  }
50191
50195
  }
50192
50196
  click(col) {
@@ -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,14 @@ 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
+ const boxes = this.doc.querySelectorAll(this.blockContainer);
79993
+ boxes.forEach(box => {
79994
+ box.insertAdjacentHTML('afterbegin', `
79995
+ <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">
79996
+ </div>`);
79997
+ const obj = new Sortable(box, {
79987
79998
  scroll: true,
79988
79999
  group: 'shared',
79989
80000
  direction: 'horizontal',
@@ -79996,7 +80007,7 @@ class ContentBuilder {
79996
80007
 
79997
80008
  let snippetid = itemEl.getAttribute('data-id');
79998
80009
  let lastBlock;
79999
- let elements = Array.from(section.querySelectorAll('.is-block')).filter(elm => !elm.parentNode.classList.contains('is-block')); // exclude child blocks
80010
+ let elements = Array.from(box.querySelectorAll('.is-block')).filter(elm => !elm.parentNode.classList.contains('is-block')); // exclude child blocks
80000
80011
  if (elements.length > 0) {
80001
80012
  lastBlock = elements[elements.length - 1];
80002
80013
  }
@@ -80061,7 +80072,7 @@ class ContentBuilder {
80061
80072
  itemEl.removeAttribute('draggable');
80062
80073
  this.dom.removeClass(itemEl, 'snippet-item');
80063
80074
  const blockTemplate = `
80064
- <div class="is-block block-fixed" style="top: 20%; left: 20%; width: 800px;">
80075
+ <div class="is-block block-steady height-auto" style="top: 20%; left: 20%; width: 800px;">
80065
80076
  <div class="is-container container-new leading-12 size-17">
80066
80077
  [%CONTENT%]
80067
80078
  </div>
@@ -80099,7 +80110,7 @@ class ContentBuilder {
80099
80110
  range.setStart(itemEl, 0);
80100
80111
  itemEl.appendChild(range.createContextualFragment(html));
80101
80112
  const blockTemplate = `
80102
- <div class="is-block block-fixed" style="top: 20%; left: 20%; width: 800px;">
80113
+ <div class="is-block block-steady height-auto" style="top: 20%; left: 20%; width: 800px;">
80103
80114
  <div class="is-container container-new leading-12 size-17">
80104
80115
  [%CONTENT%]
80105
80116
  </div>
@@ -80108,14 +80119,14 @@ class ContentBuilder {
80108
80119
  itemEl.outerHTML = blockTemplate.replace('[%CONTENT%]', itemEl.innerHTML);
80109
80120
  }
80110
80121
  this.activeCol = null;
80111
- const builders = section.querySelectorAll('.is-container.container-new');
80122
+ const builders = box.querySelectorAll('.is-container.container-new');
80112
80123
  builders.forEach(builder => {
80113
80124
  const block = builder.parentNode;
80114
80125
  if (lastBlock) {
80115
80126
  lastBlock.insertAdjacentElement('afterend', block);
80116
80127
  } else {
80117
- const ovarlay = section.querySelector('.is-overlay');
80118
- ovarlay.insertAdjacentElement('afterend', block);
80128
+ const ovarlay = box.querySelector('.is-overlay');
80129
+ if (ovarlay) ovarlay.insertAdjacentElement('afterend', block);else box.insertAdjacentElement('afterbegin', block);
80119
80130
  }
80120
80131
 
80121
80132
  // After snippet has been added, re-apply behavior on builder areas
@@ -80128,16 +80139,24 @@ class ContentBuilder {
80128
80139
  }
80129
80140
 
80130
80141
  // destroy
80131
- if (this.sortableOnCanvas) this.sortableOnCanvas.forEach(obj => {
80132
- if (obj) {
80133
- obj.destroy();
80134
- }
80135
- });
80142
+ if (this.sortableOnCanvas) {
80143
+ this.sortableOnCanvas.forEach(obj => {
80144
+ if (obj) {
80145
+ obj.destroy();
80146
+ }
80147
+ });
80148
+ let dummies = this.doc.querySelectorAll('.block-dummy');
80149
+ dummies.forEach(elm => elm.parentNode.removeChild(elm));
80150
+ }
80136
80151
  if (this.sortableOnPage) this.sortableOnPage.destroy();
80137
80152
  }
80138
80153
  });
80139
80154
  this.sortableOnCanvas.push(obj);
80140
80155
  });
80156
+ }
80157
+ if (this.page) {
80158
+ if (this.page !== '.is-wrapper') return; // only for ContentBox
80159
+ const wrapper = this.doc.querySelector(this.page);
80141
80160
  this.sortableOnPage = new Sortable(wrapper, {
80142
80161
  scroll: true,
80143
80162
  group: 'shared',
@@ -80337,11 +80356,15 @@ class ContentBuilder {
80337
80356
  // this.sortableOnPage.option('draggable', '.dummy');
80338
80357
 
80339
80358
  // destroy
80340
- if (this.sortableOnCanvas) this.sortableOnCanvas.forEach(obj => {
80341
- if (obj) {
80342
- obj.destroy();
80343
- }
80344
- });
80359
+ if (this.sortableOnCanvas) {
80360
+ this.sortableOnCanvas.forEach(obj => {
80361
+ if (obj) {
80362
+ obj.destroy();
80363
+ }
80364
+ });
80365
+ let dummies = this.doc.querySelectorAll('.block-dummy');
80366
+ dummies.forEach(elm => elm.parentNode.removeChild(elm));
80367
+ }
80345
80368
  if (this.sortableOnPage) this.sortableOnPage.destroy();
80346
80369
  }
80347
80370
  });