@innovastudio/contentbuilder 1.5.142 → 1.5.144

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
@@ -46,6 +46,7 @@ interface ContentBuilderOptions {
46
46
  onContentClick?: () => void;
47
47
  onChange?: () => void;
48
48
  onAdd?: () => void;
49
+ uploadFile?: (file: File) => Promise<any>;
49
50
  largerImageHandler?: string;
50
51
  onLargerImageUpload?: () => void;
51
52
  imageHandler?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.142",
4
+ "version": "1.5.144",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -78581,13 +78581,19 @@ class Lightbox {
78581
78581
  autoplayVideos: true,
78582
78582
  skin: 'light'
78583
78583
  };
78584
- if (builder.isContentBox) {
78585
- this.util.refreshLightbox(this.lightboxOptions);
78584
+
78585
+ /*
78586
+ if(builder.isContentBox) {
78587
+ this.util.refreshLightbox(this.lightboxOptions);
78586
78588
  } else {
78587
- const glightbox = new GlightboxInit(this.lightboxOptions); // css applied from contentbuilder.css
78588
- glightbox.init();
78589
- this.builder.glightbox = glightbox;
78589
+ const glightbox = new GlightboxInit(this.lightboxOptions); // css applied from contentbuilder.css
78590
+ glightbox.init();
78591
+ this.builder.glightbox = glightbox;
78590
78592
  }
78593
+ */
78594
+ const glightbox = new GlightboxInit(this.lightboxOptions); // css applied from contentbuilder.css
78595
+ glightbox.init();
78596
+ this.builder.glightbox = glightbox;
78591
78597
  }
78592
78598
  openImage(url) {
78593
78599
  this.openLightbox(url, this.lightboxOptions);
@@ -93933,6 +93939,19 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
93933
93939
  // obj.preserveSelection = true; (can be set programmatically) to prevent click that clears selection on external custom modal.
93934
93940
 
93935
93941
  this.opts = Object.assign(this, defaults, opts);
93942
+ if (this.opts.uploadFile) {
93943
+ const uploadHandler = () => {
93944
+ return async file => {
93945
+ const data = await this.opts.uploadFile(file);
93946
+ this.returnUrl(data.url);
93947
+ };
93948
+ };
93949
+ this.onImageUpload = uploadHandler();
93950
+ this.onVideoUpload = uploadHandler();
93951
+ this.onAudioUpload = uploadHandler();
93952
+ this.onMediaUpload = uploadHandler();
93953
+ this.onFileUpload = uploadHandler();
93954
+ }
93936
93955
  if (this.opts.basePath) {
93937
93956
  this.opts.assetPath = this.opts.basePath + 'assets/';
93938
93957
  this.opts.fontAssetPath = this.opts.basePath + 'assets/fonts/';