@innovastudio/contentbox 1.5.45 → 1.5.47

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/contentbox",
3
3
  "type": "module",
4
- "version": "1.5.45",
4
+ "version": "1.5.47",
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.4.33",
49
+ "@innovastudio/contentbuilder": "^1.4.36",
50
50
  "js-beautify": "^1.14.0"
51
51
  }
52
52
  }
@@ -19403,6 +19403,7 @@ class Util$1 {
19403
19403
  // Render custom code block
19404
19404
  html = decodeURIComponent(block.getAttribute('data-html'));
19405
19405
  html = html.replace(/{id}/g, this.makeId());
19406
+ html = html.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
19406
19407
 
19407
19408
  for (var i = 1; i <= 20; i++) {
19408
19409
  html = html.replace('[%HTML' + i + '%]', block.getAttribute('data-html-' + i) === undefined ? '' : decodeURIComponent(block.getAttribute('data-html-' + i))); //render editable area
@@ -21360,7 +21361,7 @@ class Util$1 {
21360
21361
  ${this.getFontPreview()}
21361
21362
  </ul>
21362
21363
 
21363
- <script>
21364
+ <script${this.builder.nonce ? ` nonce="${this.builder.nonce}"` : ''}>
21364
21365
 
21365
21366
  const close = () => {
21366
21367
  parent.focus();
@@ -31242,7 +31243,7 @@ class Snippets {
31242
31243
  <ul class="is-design-list" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
31243
31244
  </ul>
31244
31245
 
31245
- <script>
31246
+ <script${this.builder.nonce ? ` nonce="${this.builder.nonce}"` : ''}>
31246
31247
 
31247
31248
  var snippetPath = '${snippetPath}';
31248
31249
  var snippetCategories = ${snippetCategoriesString};
@@ -67249,6 +67250,11 @@ class ButtonEditor {
67249
67250
  }
67250
67251
 
67251
67252
  activeButton.classList.remove('active');
67253
+
67254
+ if (activeButton.tagName.toLowerCase() === 'a') {
67255
+ activeButton.setAttribute('role', 'button');
67256
+ }
67257
+
67252
67258
  this.realtime();
67253
67259
  this.builder.opts.onChange();
67254
67260
  e.preventDefault();
@@ -67314,6 +67320,11 @@ class ButtonEditor {
67314
67320
  }
67315
67321
 
67316
67322
  activeButton.classList.remove('active');
67323
+
67324
+ if (activeButton.tagName.toLowerCase() === 'a') {
67325
+ activeButton.setAttribute('role', 'button');
67326
+ }
67327
+
67317
67328
  this.builder.opts.onChange();
67318
67329
  this.realtime();
67319
67330
  e.preventDefault();
@@ -67386,6 +67397,10 @@ class ButtonEditor {
67386
67397
  link.removeAttribute('data-hover-color');
67387
67398
  link.removeAttribute('data-hover-bordercolor');
67388
67399
  dom.addClass(link, 'whitespace-nowrap');
67400
+
67401
+ if (link.tagName.toLowerCase() === 'a') {
67402
+ link.setAttribute('role', 'button');
67403
+ }
67389
67404
  }
67390
67405
 
67391
67406
  cleanupOldClasses(link) {
@@ -68608,6 +68623,7 @@ class Module {
68608
68623
  const iframe = moduleModal.querySelector('iframe');
68609
68624
  let result = await fetch(this.builder.opts.modulePath + modulename + '.html');
68610
68625
  result = await result.text();
68626
+ result = result.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
68611
68627
  let doc = iframe.contentWindow.document;
68612
68628
  doc.open();
68613
68629
  doc.write(result);
@@ -68629,6 +68645,7 @@ class Module {
68629
68645
 
68630
68646
  let html = this.builderStuff.querySelector('#hidContentModuleCode').value;
68631
68647
  html = html.replace(/{id}/g, this.util.makeId());
68648
+ html = html.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
68632
68649
  /* OLD
68633
68650
  for(var i=1;i<=20;i++){ // OLD
68634
68651
  html = html.replace('[%HTML'+i+'%]', (module.getAttribute('data-html-'+i) === undefined ? '' : decodeURIComponent(module.getAttribute('data-html-'+i))));//render editable area
@@ -68805,6 +68822,7 @@ class Code {
68805
68822
  });
68806
68823
  let html = decodeURIComponent(codeblock.getAttribute('data-html')); //html = html.replace(/{id}/g, this.util.makeId());
68807
68824
 
68825
+ html = html.replace(/<script>/g, `${this.builder.nonce ? `<script nonce="${this.builder.nonce}">` : '<script>'}`);
68808
68826
  tmpbuilder.parentNode.removeChild(tmpbuilder); // Use existing modal
68809
68827
 
68810
68828
  let viewhtml;
@@ -87831,7 +87849,7 @@ class Rte {
87831
87849
  ${this.getIcons()}
87832
87850
  </div>
87833
87851
 
87834
- <script>
87852
+ <script${this.builder.nonce ? ` nonce="${this.builder.nonce}"` : ''}>
87835
87853
  const setValue = (elm) => {
87836
87854
  if(!elm.className) elm = elm.childNodes[0];
87837
87855
  parent._cb.addIcon(elm.className);
@@ -93758,6 +93776,7 @@ class ContentBuilder {
93758
93776
  // Render custom code block
93759
93777
  html = decodeURIComponent(block.getAttribute('data-html'));
93760
93778
  html = html.replace(/{id}/g, util.makeId());
93779
+ html = html.replace(/<script>/g, `${this.nonce ? `<script nonce="${this.nonce}">` : '<script>'}`);
93761
93780
 
93762
93781
  for (var i = 1; i <= 20; i++) {
93763
93782
  html = html.replace('[%HTML' + i + '%]', block.getAttribute('data-html-' + i) === undefined ? '' : decodeURIComponent(block.getAttribute('data-html-' + i))); //render editable area
@@ -96386,6 +96405,7 @@ class ContentBuilder {
96386
96405
  // Render custom code block
96387
96406
  html = decodeURIComponent(block.getAttribute('data-html'));
96388
96407
  html = html.replace(/{id}/g, this.util.makeId());
96408
+ html = html.replace(/<script>/g, `${this.nonce ? `<script nonce="${this.nonce}">` : '<script>'}`);
96389
96409
 
96390
96410
  for (var i = 1; i <= 20; i++) {
96391
96411
  html = html.replace('[%HTML' + i + '%]', block.getAttribute('data-html-' + i) === undefined ? '' : decodeURIComponent(block.getAttribute('data-html-' + i))); //render editable area