@innovastudio/contentbuilder 1.5.35 → 1.5.37

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.5.35",
4
+ "version": "1.5.37",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -17269,8 +17269,10 @@ const renderSnippetPanel = (builder, snippetOpen) => {
17269
17269
  // evt.related.getBoundingClientRect().top>window.innerHeight) {
17270
17270
  // return false;
17271
17271
  // }
17272
- },
17273
17272
 
17273
+ const wrapper = builder.doc.querySelector(builder.page);
17274
+ if (wrapper) wrapper.style.marginLeft = '';
17275
+ },
17274
17276
  onSort: evt => {
17275
17277
  if (!builder.canvas) return;
17276
17278
  let snippetX = evt.originalEvent.clientX;
@@ -17286,6 +17288,12 @@ const renderSnippetPanel = (builder, snippetOpen) => {
17286
17288
  block.style.left = x + '%';
17287
17289
  block.removeAttribute('data-new-dummy');
17288
17290
  }
17291
+
17292
+ // to prevent flicker caused by snippet panel above wrapper (see contentbuilder.js sectionDropSetup)
17293
+ if (builder.page && builder.page === '.is-wrapper') {
17294
+ const wrapper = builder.doc.querySelector(builder.page);
17295
+ if (wrapper) wrapper.style.marginLeft = '';
17296
+ }
17289
17297
  },
17290
17298
  onStart: () => {
17291
17299
  // Remove .builder-active during dragging (because this class makes rows have border-right/left 120px)
@@ -17334,6 +17342,12 @@ const renderSnippetPanel = (builder, snippetOpen) => {
17334
17342
  }
17335
17343
  let dummies = builder.doc.querySelectorAll('.block-dummy');
17336
17344
  dummies.forEach(elm => elm.parentNode.removeChild(elm));
17345
+
17346
+ // to prevent flicker caused by snippet panel above wrapper (see contentbuilder.js sectionDropSetup)
17347
+ if (builder.page && builder.page === '.is-wrapper') {
17348
+ const wrapper = builder.doc.querySelector(builder.page);
17349
+ if (wrapper) wrapper.style.marginLeft = '';
17350
+ }
17337
17351
  }, 10);
17338
17352
  }
17339
17353
  });
@@ -82842,7 +82856,6 @@ class Resizable {
82842
82856
  }
82843
82857
 
82844
82858
  this.target = event.target.parentNode; // block
82845
-
82846
82859
  this.clonedTarget = this.doc.querySelector(this.selector + '.cloned');
82847
82860
  event.preventDefault();
82848
82861
  event.stopPropagation();
@@ -82861,6 +82874,8 @@ class Resizable {
82861
82874
  this.startX = touch.clientX;
82862
82875
  this.startY = touch.clientY;
82863
82876
  }
82877
+ this.target.style.transition = ''; // prevent anim/delay while dragging (in case a block has animation transition)
82878
+ if (this.clonedTarget) this.clonedTarget.style.transition = '';
82864
82879
 
82865
82880
  //Initial
82866
82881
  this.initialWidth = parseFloat(getComputedStyle(this.target).width);
@@ -83347,6 +83362,7 @@ class Draggable {
83347
83362
  const y = startY - rect.top + containerRect.top;
83348
83363
  target.setAttribute('data-startx', x);
83349
83364
  target.setAttribute('data-starty', y);
83365
+ target.style.transition = ''; // prevent anim/delay while dragging (in case a block has animation transition)
83350
83366
 
83351
83367
  // reset (from applyPercentage bottomTouched)
83352
83368
  if (target.style.bottom) {
@@ -83423,33 +83439,35 @@ class Draggable {
83423
83439
  updateBlockStyle(target) {
83424
83440
  // Block placement should must not 50% outside the container
83425
83441
  const container = target.closest('.box-canvas');
83426
- let containerHeight = container.offsetHeight;
83427
- let containerWidth = container.offsetWidth;
83428
- /*
83429
- if(target.offsetTop + target.offsetHeight>=containerHeight) {
83430
- target.style.top = containerHeight-target.offsetHeight +'px';
83431
- }
83432
- if(target.offsetTop<=0) {
83442
+ if (!target.parentNode.closest('.is-group')) {
83443
+ let containerHeight = container.offsetHeight;
83444
+ let containerWidth = container.offsetWidth;
83445
+ /*
83446
+ if(target.offsetTop + target.offsetHeight>=containerHeight) {
83447
+ target.style.top = containerHeight-target.offsetHeight +'px';
83448
+ }
83449
+ if(target.offsetTop<=0) {
83450
+ target.style.top = '0px';
83451
+ }
83452
+ if(target.offsetLeft + target.offsetWidth>=åcontainerWidth) {
83453
+ target.style.left = (containerWidth-target.offsetWidth) +'px';
83454
+ }
83455
+ if(target.offsetLeft<=0) {
83456
+ target.style.left = '0px';
83457
+ }
83458
+ */
83459
+ if (target.offsetTop + target.offsetHeight <= target.offsetHeight / 2) {
83433
83460
  target.style.top = '0px';
83434
- }
83435
- if(target.offsetLeft + target.offsetWidth>=åcontainerWidth) {
83436
- target.style.left = (containerWidth-target.offsetWidth) +'px';
83437
- }
83438
- if(target.offsetLeft<=0) {
83461
+ }
83462
+ if (containerHeight - target.offsetTop <= target.offsetHeight / 2) {
83463
+ target.style.top = containerHeight - target.offsetHeight + 'px';
83464
+ }
83465
+ if (target.offsetLeft + target.offsetWidth <= target.offsetWidth / 2) {
83439
83466
  target.style.left = '0px';
83440
- }
83441
- */
83442
- if (target.offsetTop + target.offsetHeight <= target.offsetHeight / 2) {
83443
- target.style.top = '0px';
83444
- }
83445
- if (containerHeight - target.offsetTop <= target.offsetHeight / 2) {
83446
- target.style.top = containerHeight - target.offsetHeight + 'px';
83447
- }
83448
- if (target.offsetLeft + target.offsetWidth <= target.offsetWidth / 2) {
83449
- target.style.left = '0px';
83450
- }
83451
- if (containerWidth - target.offsetLeft <= target.offsetWidth / 2) {
83452
- target.style.left = containerWidth - target.offsetWidth + 'px';
83467
+ }
83468
+ if (containerWidth - target.offsetLeft <= target.offsetWidth / 2) {
83469
+ target.style.left = containerWidth - target.offsetWidth + 'px';
83470
+ }
83453
83471
  }
83454
83472
 
83455
83473
  // Replace with ruler's alignment
@@ -86369,7 +86387,7 @@ class ContentBuilder {
86369
86387
  deleteConfirm: false,
86370
86388
  disableBootstrapIcons: false,
86371
86389
  sectionTemplate: `
86372
- <div class="is-section is-box is-section-100 type-opensans">
86390
+ <div class="is-section is-box is-section-100 type-system-ui">
86373
86391
  <div class="is-overlay"></div>
86374
86392
  <div class="is-boxes">
86375
86393
  <div class="is-box-centered">
@@ -87821,6 +87839,9 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
87821
87839
  let clonedDiv = block.cloneNode(true);
87822
87840
  clonedDiv.style.top = '20%';
87823
87841
  clonedDiv.style.left = '20%';
87842
+ clonedDiv.style.transform = ''; // clear anim
87843
+ clonedDiv.style.transition = '';
87844
+ clonedDiv.style.opacity = '';
87824
87845
  if (builder) {
87825
87846
  const cloneBuilder = clonedDiv.querySelector(this.container);
87826
87847
  cloneBuilder.innerHTML = '';
@@ -87830,7 +87851,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
87830
87851
  this.applyBehaviorOn(cloneBuilder);
87831
87852
  cloneBuilder.click();
87832
87853
  } else {
87833
- block.parentNode.appendChild(clonedDiv);
87854
+ box.appendChild(clonedDiv);
87834
87855
  }
87835
87856
  block.classList.remove('active');
87836
87857
  this.doc.querySelectorAll('.clone').forEach(elm => elm.parentNode.removeChild(elm));
@@ -92493,6 +92514,11 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
92493
92514
  if (this.page) {
92494
92515
  if (this.page !== '.is-wrapper') return; // only for ContentBox
92495
92516
  const wrapper = this.doc.querySelector(this.page);
92517
+
92518
+ // to prevent flicker caused by snippet panel above wrapper
92519
+ if (!wrapper.querySelector('.is-section')) {
92520
+ wrapper.style.marginLeft = '300px';
92521
+ }
92496
92522
  this.sortableOnPage = new Sortable(wrapper, {
92497
92523
  scroll: true,
92498
92524
  group: 'shared',
@@ -92586,6 +92612,13 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
92586
92612
 
92587
92613
  if (this.opts.emailMode) bSnippet = false;
92588
92614
 
92615
+ // check if is block
92616
+ let isBlock = false;
92617
+ if (html.includes('"is-block')) {
92618
+ isBlock = true;
92619
+ bSnippet = false;
92620
+ }
92621
+
92589
92622
  // Convert snippet into your defined 12 columns grid
92590
92623
  var rowClass = this.opts.row; //row
92591
92624
  var colClass = this.opts.cols; //['col s1', 'col s2', 'col s3', 'col s4', 'col s5', 'col s6', 'col s7', 'col s8', 'col s9', 'col s10', 'col s11', 'col s12']
@@ -92643,6 +92676,14 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
92643
92676
  // </div>
92644
92677
  // `;
92645
92678
  itemEl.outerHTML = this.settings.sectionTemplate.replace('[%CONTENT%]', html);
92679
+ } else if (isBlock) {
92680
+ let canvasTemplate = `
92681
+ <div class="is-section is-box is-section-100 type-system-ui box-canvas autolayout last-box">
92682
+ <div class="is-overlay"></div>
92683
+ [%CONTENT%]
92684
+ </div>
92685
+ `;
92686
+ itemEl.outerHTML = canvasTemplate.replace('[%CONTENT%]', html);
92646
92687
  } else {
92647
92688
  // Snippet is wrapped in row/colum (may contain custom code or has [data-html] attribute)
92648
92689
  // Can only be inserted after current row or last row (not on column or element).