@innovastudio/contentbox 1.4.62 → 1.4.63

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/contentbox",
3
3
  "type": "module",
4
- "version": "1.4.62",
4
+ "version": "1.4.63",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "files": [
@@ -46,7 +46,7 @@
46
46
  "webpack-dev-server": "^4.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@innovastudio/contentbuilder": "^1.3.71",
49
+ "@innovastudio/contentbuilder": "^1.3.72",
50
50
  "js-beautify": "^1.14.0"
51
51
  }
52
52
  }
@@ -88547,6 +88547,18 @@ class ContentBuilder {
88547
88547
  lightboxArrow: true,
88548
88548
  imageRenameOnEdit: true,
88549
88549
  disableAutoEmbedVideo: false,
88550
+ sectionTemplate: `
88551
+ <div class="is-section is-box is-section-100 type-poppins">
88552
+ <div class="is-overlay"></div>
88553
+ <div class="is-boxes">
88554
+ <div class="is-box-centered">
88555
+ <div class="is-container is-content-900 v2 size-18 leading-14">
88556
+ [%CONTENT%]
88557
+ </div>
88558
+ </div>
88559
+ </div>
88560
+ </div>
88561
+ `,
88550
88562
 
88551
88563
  /*
88552
88564
  onZoomStart: () => {
@@ -92298,19 +92310,20 @@ class ContentBuilder {
92298
92310
  elms = itemEl.querySelectorAll('*');
92299
92311
  elms.forEach(elm => {
92300
92312
  elm.style.cursor = '';
92301
- });
92302
- itemEl.outerHTML = `
92303
- <div class="is-section is-box is-section-100 type-poppins">
92304
- <div class="is-overlay"></div>
92305
- <div class="is-boxes">
92306
- <div class="is-box-centered">
92307
- <div class="is-container is-content-900 v2 size-18 leading-14">
92308
- ${itemEl.outerHTML}
92309
- </div>
92310
- </div>
92311
- </div>
92312
- </div>
92313
- `;
92313
+ }); // itemEl.outerHTML = `
92314
+ // <div class="is-section is-box is-section-100 type-poppins">
92315
+ // <div class="is-overlay"></div>
92316
+ // <div class="is-boxes">
92317
+ // <div class="is-box-centered">
92318
+ // <div class="is-container is-content-900 v2 size-18 leading-14">
92319
+ // ${itemEl.outerHTML}
92320
+ // </div>
92321
+ // </div>
92322
+ // </div>
92323
+ // </div>
92324
+ // `;
92325
+
92326
+ itemEl.outerHTML = this.settings.sectionTemplate.replace('[%CONTENT%]', itemEl.outerHTML);
92314
92327
  if (this.opts.onSectionAdd) this.opts.onSectionAdd(); // //Trigger Change event
92315
92328
  // this.opts.onChange();
92316
92329
  // //Trigger Render event
@@ -92385,17 +92398,18 @@ class ContentBuilder {
92385
92398
 
92386
92399
  itemEl.removeAttribute('draggable');
92387
92400
  this.dom.removeClass(itemEl, 'snippet-item'); // itemEl.outerHTML = html;
92388
-
92389
- itemEl.outerHTML = `
92390
- <div class="is-section is-box is-section-100 type-poppins">
92391
- <div class="is-overlay"></div>
92392
- <div class="is-boxes">
92393
- <div class="is-box-centered">
92394
- <div class="is-container is-content-900 v2 size-18 leading-14">${html}</div>
92395
- </div>
92396
- </div>
92397
- </div>
92398
- `;
92401
+ // itemEl.outerHTML = `
92402
+ // <div class="is-section is-box is-section-100 type-poppins">
92403
+ // <div class="is-overlay"></div>
92404
+ // <div class="is-boxes">
92405
+ // <div class="is-box-centered">
92406
+ // <div class="is-container is-content-900 v2 size-18 leading-14">${html}</div>
92407
+ // </div>
92408
+ // </div>
92409
+ // </div>
92410
+ // `;
92411
+
92412
+ itemEl.outerHTML = this.settings.sectionTemplate.replace('[%CONTENT%]', html);
92399
92413
  } else {
92400
92414
  // Snippet is wrapped in row/colum (may contain custom code or has [data-html] attribute)
92401
92415
  // Can only be inserted after current row or last row (not on column or element).
@@ -92423,17 +92437,18 @@ class ContentBuilder {
92423
92437
  var range = document.createRange();
92424
92438
  range.setStart(itemEl, 0);
92425
92439
  itemEl.appendChild(range.createContextualFragment(html)); // itemEl.outerHTML = itemEl.innerHTML;
92426
-
92427
- itemEl.outerHTML = `
92428
- <div class="is-section is-box is-section-100 type-poppins">
92429
- <div class="is-overlay"></div>
92430
- <div class="is-boxes">
92431
- <div class="is-box-centered">
92432
- <div class="is-container is-content-900 v2 size-18 leading-14">${itemEl.innerHTML}</div>
92433
- </div>
92434
- </div>
92435
- </div>
92436
- `;
92440
+ // itemEl.outerHTML = `
92441
+ // <div class="is-section is-box is-section-100 type-poppins">
92442
+ // <div class="is-overlay"></div>
92443
+ // <div class="is-boxes">
92444
+ // <div class="is-box-centered">
92445
+ // <div class="is-container is-content-900 v2 size-18 leading-14">${itemEl.innerHTML}</div>
92446
+ // </div>
92447
+ // </div>
92448
+ // </div>
92449
+ // `;
92450
+
92451
+ itemEl.outerHTML = this.settings.sectionTemplate.replace('[%CONTENT%]', itemEl.innerHTML);
92437
92452
  } // // After snippet has been added, re-apply behavior on builder areas
92438
92453
  // this.applyBehaviorOn(builder);
92439
92454
 
@@ -96359,7 +96374,11 @@ class AnimateScroll {
96359
96374
 
96360
96375
  if (modalPagePreview.classList.contains('active')) {
96361
96376
  this.openPreview();
96362
- }
96377
+ } // Reset
96378
+
96379
+
96380
+ let elmTool = document.querySelector('.is-element-tool');
96381
+ if (elmTool) elmTool.style.display = '';
96363
96382
  }); // Checkbox touchstart is not triggered, use label:
96364
96383
 
96365
96384
  if (this.builder.isTouchSupport) {
@@ -96495,7 +96514,7 @@ class AnimateScroll {
96495
96514
  }, 1000);
96496
96515
  };
96497
96516
 
96498
- this.builder.win.addEventListener('scroll', () => {
96517
+ this.builder.win.addEventListener('scroll', this.builder.doScrollSync = () => {
96499
96518
  this.scrollSync(iframe);
96500
96519
  });
96501
96520
  }
@@ -100888,6 +100907,18 @@ class ContentBox {
100888
100907
  shortenHTML: true,
100889
100908
  advancedTimeline: true,
100890
100909
  livePreviewOpen: false,
100910
+ sectionTemplate: `
100911
+ <div class="is-section is-box is-section-100 type-poppins">
100912
+ <div class="is-overlay"></div>
100913
+ <div class="is-boxes">
100914
+ <div class="is-box-centered">
100915
+ <div class="is-container is-content-900 v2 size-18 leading-14">
100916
+ [%CONTENT%]
100917
+ </div>
100918
+ </div>
100919
+ </div>
100920
+ </div>
100921
+ `,
100891
100922
  contentStyleWithSample: false,
100892
100923
  contentSizes: [300, 320, 340, 360, 380, 400, 420, 440, 460, 480, 500, 520, 540, 560, 580, 600, 620, 640, 660, 680, 700, 720, 740, 760, 780, 800, 820, 840, 860, 880, 900, 920, 940, 960, 970, 980, 1000, 1020, 1040, 1050, 1060, 1080, 1100, 1120, 1140, 1160, 1180, 1200, 1220, 1240, 1260, 1280, 1300, 1320, 1340, 1360, 1380, 1400, 1420, 1440, 1460, 1480, 1500, 1520, 1540, 1560, 1580, 1600, 1620, 1640, 1660, 1680, 1700, 1720, 1740, 1760, 1780, 1800, 1820, 1840, 1860, 1880, 1900, 1920, 1940, 1960, 1980, 2000, 2020, 2040, 2060, 2080, 2100, 2120, 2140, 2160, 2180, 2200, 2220, 2240, 2260, 2280, 2300, 2320, 2340, 2360, 2380, 2400, 2420, 2440, 2460, 2480, 2500, 2520, 2540, 2560, 2580, 2600, 2620, 2640, 2660, 2680, 2700],
100893
100924
  contentStyles: {
@@ -103335,6 +103366,7 @@ class ContentBox {
103335
103366
  maxColumns: this.settings.maxColumns,
103336
103367
  maxEmbedImageWidth: this.settings.maxEmbedImageWidth,
103337
103368
  imageRenameOnEdit: this.settings.imageRenameOnEdit,
103369
+ sectionTemplate: this.settings.sectionTemplate,
103338
103370
  onSectionAdd: () => {
103339
103371
  this.pageSetup();
103340
103372
  },
@@ -103655,6 +103687,7 @@ class ContentBox {
103655
103687
  }
103656
103688
 
103657
103689
  /* clean UI for selection only */
103690
+ /*
103658
103691
  .selection-only:not([data-skrollrr-off]) .is-wrapper.hard-select .box-select .is-box-tool,
103659
103692
  .selection-only:not([data-skrollrr-off]) .is-wrapper .box-select .is-box-tool {
103660
103693
  display: none !important;
@@ -103672,6 +103705,7 @@ class ContentBox {
103672
103705
  .selection-only:not([data-skrollrr-off]) .is-tool {
103673
103706
  z-index: -10000 !important;
103674
103707
  }
103708
+ */
103675
103709
 
103676
103710
  /* section info */
103677
103711
  .is-wrapper .is-section-info {
@@ -104256,6 +104290,40 @@ class ContentBox {
104256
104290
  });
104257
104291
  this.editor.applyBehavior();
104258
104292
  this.addSpace();
104293
+ /* If animation enabled on page, hide some tools during scroll/animate */
104294
+
104295
+ setTimeout(() => {
104296
+ let hideOnScroll = () => {
104297
+ if (!this.doc.body.hasAttribute('data-skrollrr-off')) {
104298
+ // Anim on page enabled
104299
+ return true;
104300
+ }
104301
+ };
104302
+
104303
+ let elmTool = document.querySelector('.is-element-tool');
104304
+ let divImageTool = document.querySelector('#divImageTool');
104305
+ let divImageResizer = document.querySelector('#divImageResizer');
104306
+
104307
+ let hideSomeTools = () => {
104308
+ if (divImageTool) if (divImageTool.style.display === 'flex') {
104309
+ if (this.editor.moveable) this.editor.moveable.updateRect();
104310
+ let controlBox = this.doc.querySelector('.moveable-control-box');
104311
+ if (controlBox) controlBox.style.display = 'none';
104312
+ }
104313
+ if (elmTool) elmTool.style.display = '';
104314
+ if (divImageTool) divImageTool.style.display = '';
104315
+ if (divImageResizer) divImageResizer.style.display = '';
104316
+ };
104317
+
104318
+ if (hideOnScroll) {
104319
+ this.doc.addEventListener('wheel', this.doAnimWheel = () => {
104320
+ if (hideOnScroll()) hideSomeTools();
104321
+ });
104322
+ this.win.addEventListener('scroll', this.doAnimScroll = () => {
104323
+ if (hideOnScroll()) hideSomeTools();
104324
+ });
104325
+ }
104326
+ }, 300);
104259
104327
  } // pageSetup
104260
104328
 
104261
104329
 
@@ -105489,6 +105557,9 @@ class ContentBox {
105489
105557
  this.doc.removeEventListener('click', this.doDocumentClick, false);
105490
105558
  if (this.iframe) document.removeEventListener('click', this.doDocumentClick, false);
105491
105559
  window.removeEventListener('scroll', this.doWindowScroll, false);
105560
+ this.doc.removeEventListener('scroll', this.doAnimWheel, false);
105561
+ this.win.removeEventListener('scroll', this.doAnimScroll, false);
105562
+ this.win.removeEventListener('scroll', this.doScrollSync, false);
105492
105563
  let html = this.html(); // this.builderStuff.parentNode.removeChild(this.builderStuff);
105493
105564
 
105494
105565
  this.builderStuff.innerHTML = '';