@innovastudio/contentbuilder 1.5.134 → 1.5.136

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.
@@ -3688,6 +3688,10 @@ button:focus-visible {
3688
3688
  fill: #111 !important;
3689
3689
  color: #111 !important;
3690
3690
  }
3691
+ #_cbhtml #divImageResizer,
3692
+ .is-ui #divImageResizer {
3693
+ z-index: -1;
3694
+ }
3691
3695
  #_cbhtml .dot,
3692
3696
  .is-ui .dot {
3693
3697
  height: 7px;
@@ -4935,7 +4935,11 @@ class Util {
4935
4935
  // this.builder.doc.activeElement.blur();
4936
4936
  // document.activeElement.blur();
4937
4937
  this.builder.doc.body.focus();
4938
- pop.setAttribute('aria-hidden', true);
4938
+
4939
+ // pop.setAttribute('aria-hidden', true);
4940
+ setTimeout(() => {
4941
+ pop.setAttribute('aria-hidden', true);
4942
+ }, 0);
4939
4943
 
4940
4944
  // pop.removeEventListener('keydown', this.handlePopKeyDown);
4941
4945
  // document.removeEventListener('click', this.handlePopClickOut);
@@ -96213,8 +96217,28 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
96213
96217
  itemEl.outerHTML = itemEl.innerHTML;
96214
96218
  }
96215
96219
 
96220
+ // Get newly added row
96221
+ let rows = builder.children;
96222
+ let newRows = [];
96223
+ for (let i = 0; i < rows.length; i++) {
96224
+ const row = rows[i];
96225
+ const tool = row.querySelector('.is-tool');
96226
+ if (!tool) {
96227
+ newRows.push(row);
96228
+ }
96229
+ }
96230
+
96216
96231
  // After snippet has been added, re-apply behavior on builder areas
96217
96232
  this.applyBehaviorOn(builder);
96233
+ if (newRows.length > 0) {
96234
+ let newRow = newRows[0]; // get first added row
96235
+ if (newRow.children.length > 0) {
96236
+ const newCol = newRow.children[0];
96237
+ if (newCol.children.length > 0) {
96238
+ newCol.children[0].click(); // Focus on first element
96239
+ }
96240
+ }
96241
+ }
96218
96242
 
96219
96243
  //Trigger Change event
96220
96244
  this.opts.onChange();
@@ -96745,6 +96769,8 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
96745
96769
  destroy() {
96746
96770
  const snippetData = document.querySelector('#_snippet_data');
96747
96771
  if (snippetData) snippetData.remove();
96772
+ const linkStyle = document.head.querySelector('#_snippet_style');
96773
+ if (linkStyle) linkStyle.remove();
96748
96774
  if (this.eb) this.eb.destroy();
96749
96775
  this.doc.body.classList.remove('data-editor');
96750
96776
  document.removeEventListener('click', this.doDocumentClick, false);
@@ -97845,32 +97871,32 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
97845
97871
  } else {
97846
97872
  snippetFile = source.snippets;
97847
97873
  let linkStyle = document.head.querySelector('#_snippet_style');
97848
- if (!linkStyle) {
97849
- const link = document.createElement('link');
97850
- link.id = '_snippet_style';
97851
- link.rel = 'stylesheet';
97852
- link.href = source.style;
97853
-
97854
- // Find the last stylesheet <link> in <head>
97855
- const lastCss = [...document.head.querySelectorAll('link[rel="stylesheet"]')].pop();
97856
- if (lastCss) {
97857
- lastCss.after(link);
97874
+ if (linkStyle) linkStyle.remove();
97875
+ const link = document.createElement('link');
97876
+ link.id = '_snippet_style';
97877
+ link.rel = 'stylesheet';
97878
+ // link.href = source.style;
97879
+ link.href = source.style || source.snippets.replace(/\.js$/, '.css');
97880
+
97881
+ // Find the last stylesheet <link> in <head>
97882
+ const lastCss = [...document.head.querySelectorAll('link[rel="stylesheet"]')].pop();
97883
+ if (lastCss) {
97884
+ lastCss.after(link);
97885
+ } else {
97886
+ // No linked CSS → look for first embedded <style>
97887
+ const firstStyle = document.head.querySelector('style');
97888
+ if (firstStyle) {
97889
+ document.head.insertBefore(link, firstStyle);
97858
97890
  } else {
97859
- // No linked CSS → look for first embedded <style>
97860
- const firstStyle = document.head.querySelector('style');
97861
- if (firstStyle) {
97862
- document.head.insertBefore(link, firstStyle);
97863
- } else {
97864
- document.head.appendChild(link);
97865
- }
97891
+ document.head.appendChild(link);
97866
97892
  }
97867
-
97868
- // Then wait for it to load
97869
- await new Promise((resolve, reject) => {
97870
- link.onload = resolve;
97871
- link.onerror = reject;
97872
- });
97873
97893
  }
97894
+
97895
+ // Then wait for it to load
97896
+ await new Promise((resolve, reject) => {
97897
+ link.onload = resolve;
97898
+ link.onerror = reject;
97899
+ });
97874
97900
  }
97875
97901
  let includeScript = document.body.querySelector('#_snippet_data');
97876
97902
  if (!includeScript) {
@@ -97897,16 +97923,12 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
97897
97923
  }
97898
97924
 
97899
97925
  if (this.opts.snippetJSON.target === 'ContentBuilder') {
97900
- console.log(`
97901
- ContentBuilder is a commercial library.
97902
- Please obtain a license at: https://innovastudio.com/contentbuilder
97903
- `);
97926
+ console.log(`ContentBuilder is a commercial library.
97927
+ Please obtain a license at: https://innovastudio.com/contentbuilder`);
97904
97928
  }
97905
97929
  if (this.opts.snippetJSON.target === 'ContentBox') {
97906
- console.log(`
97907
- ContentBox is a commercial library.
97908
- Please obtain a license at: https://innovastudio.com/contentbox
97909
- `);
97930
+ console.log(`ContentBox is a commercial library.
97931
+ Please obtain a license at: https://innovastudio.com/contentbox`);
97910
97932
  }
97911
97933
  };
97912
97934
  document.body.appendChild(script);