@innovastudio/contentbuilder 1.5.145 → 1.5.147

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
+ upload?: (file: File) => Promise<any>;
49
50
  uploadFile?: (e: Event) => Promise<any>;
50
51
  largerImageHandler?: string;
51
52
  onLargerImageUpload?: () => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.145",
4
+ "version": "1.5.147",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -93950,6 +93950,18 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
93950
93950
  this.onMediaUpload = uploadHandler;
93951
93951
  this.onFileUpload = uploadHandler;
93952
93952
  }
93953
+ if (this.opts.upload) {
93954
+ const uploadHandler = async e => {
93955
+ const file = e.target.files[0];
93956
+ const data = await this.opts.upload(file);
93957
+ this.returnUrl(data.url);
93958
+ };
93959
+ this.onImageUpload = uploadHandler;
93960
+ this.onVideoUpload = uploadHandler;
93961
+ this.onAudioUpload = uploadHandler;
93962
+ this.onMediaUpload = uploadHandler;
93963
+ this.onFileUpload = uploadHandler;
93964
+ }
93953
93965
  if (this.opts.basePath) {
93954
93966
  this.opts.assetPath = this.opts.basePath + 'assets/';
93955
93967
  this.opts.fontAssetPath = this.opts.basePath + 'assets/fonts/';