@innovastudio/contentbuilder 1.5.155 → 1.5.156

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/index.d.ts CHANGED
@@ -330,5 +330,6 @@ declare class ContentBuilder {
330
330
  print(): void;
331
331
 
332
332
  generateImage(prompt: string, callback?: () => void): void;
333
+ openFilePicker(type?: string, callback?: () => void): void;
333
334
  }
334
335
  export default ContentBuilder;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.155",
4
+ "version": "1.5.156",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -15027,6 +15027,34 @@ class HtmlUtil {
15027
15027
  elm.innerHTML = '';
15028
15028
  });
15029
15029
  }
15030
+
15031
+ // Clean all interactive components
15032
+ const components = tmp.querySelectorAll('[data-cb-type]');
15033
+ components.forEach(element => {
15034
+ const original = element.getAttribute('data-cb-original-content');
15035
+ if (original) {
15036
+ // Restore original HTML
15037
+ element.innerHTML = original;
15038
+
15039
+ // Remove runtime-added attributes
15040
+ element.removeAttribute('data-cb-original-content');
15041
+
15042
+ // element.removeAttribute('data-cb-logo-loop-initialized');
15043
+
15044
+ Array.from(element.attributes).forEach(attr => {
15045
+ const name = attr.name;
15046
+ // Remove any attribute that starts with "data-cb-" and ends with "-initialized"
15047
+ if (name.startsWith('data-cb-') && name.endsWith('-initialized')) {
15048
+ element.removeAttribute(name);
15049
+ }
15050
+ });
15051
+ element.removeAttribute('data-cb-editmode');
15052
+
15053
+ // Remove runtime-added classes
15054
+ const type = element.getAttribute('data-cb-type');
15055
+ element.classList.remove(`cb-${type}`);
15056
+ }
15057
+ });
15030
15058
  html = '';
15031
15059
  if (multiple) {
15032
15060
  //ContentBox
@@ -52664,6 +52692,9 @@ class Element$1 {
52664
52692
  subblock = true;
52665
52693
  }
52666
52694
  }
52695
+ if (elm.closest('[data-cb-type]')) {
52696
+ customcode = true;
52697
+ }
52667
52698
  if (!customcode && !noedit && !_protected || subblock) {
52668
52699
  //previously this is commented: && !noedit && !_protected
52669
52700
 
@@ -62306,6 +62337,7 @@ class ElementTool {
62306
62337
  let elm = this.builder.activeElement;
62307
62338
  if (!elm) return;
62308
62339
  if (elm.closest('.is-dock')) return;
62340
+ if (elm.closest('[data-cb-type]')) return;
62309
62341
  let top, left;
62310
62342
  if (!this.builder.iframe) {
62311
62343
  top = elm.getBoundingClientRect().top + window.pageYOffset;
@@ -97797,6 +97829,9 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
97797
97829
  }
97798
97830
  });
97799
97831
  }
97832
+ openFilePicker(type, callback) {
97833
+ this.openAssetSelect(type, callback);
97834
+ }
97800
97835
  openAssetSelect(targetAssetType, callback, defaultValue) {
97801
97836
  const inpUrl = document.createElement('input');
97802
97837