@innovastudio/contentbuilder 1.5.134 → 1.5.135

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/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.134",
4
+ "version": "1.5.135",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -96745,6 +96745,8 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
96745
96745
  destroy() {
96746
96746
  const snippetData = document.querySelector('#_snippet_data');
96747
96747
  if (snippetData) snippetData.remove();
96748
+ const linkStyle = document.head.querySelector('#_snippet_style');
96749
+ if (linkStyle) linkStyle.remove();
96748
96750
  if (this.eb) this.eb.destroy();
96749
96751
  this.doc.body.classList.remove('data-editor');
96750
96752
  document.removeEventListener('click', this.doDocumentClick, false);
@@ -97845,32 +97847,32 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
97845
97847
  } else {
97846
97848
  snippetFile = source.snippets;
97847
97849
  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);
97850
+ if (linkStyle) linkStyle.remove();
97851
+ const link = document.createElement('link');
97852
+ link.id = '_snippet_style';
97853
+ link.rel = 'stylesheet';
97854
+ // link.href = source.style;
97855
+ link.href = source.style || source.snippets.replace(/\.js$/, '.css');
97856
+
97857
+ // Find the last stylesheet <link> in <head>
97858
+ const lastCss = [...document.head.querySelectorAll('link[rel="stylesheet"]')].pop();
97859
+ if (lastCss) {
97860
+ lastCss.after(link);
97861
+ } else {
97862
+ // No linked CSS → look for first embedded <style>
97863
+ const firstStyle = document.head.querySelector('style');
97864
+ if (firstStyle) {
97865
+ document.head.insertBefore(link, firstStyle);
97858
97866
  } 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
- }
97867
+ document.head.appendChild(link);
97866
97868
  }
97867
-
97868
- // Then wait for it to load
97869
- await new Promise((resolve, reject) => {
97870
- link.onload = resolve;
97871
- link.onerror = reject;
97872
- });
97873
97869
  }
97870
+
97871
+ // Then wait for it to load
97872
+ await new Promise((resolve, reject) => {
97873
+ link.onload = resolve;
97874
+ link.onerror = reject;
97875
+ });
97874
97876
  }
97875
97877
  let includeScript = document.body.querySelector('#_snippet_data');
97876
97878
  if (!includeScript) {