@innovastudio/contentbuilder 1.5.143 → 1.5.145

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?: (e: Event) => 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.143",
4
+ "version": "1.5.145",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -93939,6 +93939,17 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
93939
93939
  // obj.preserveSelection = true; (can be set programmatically) to prevent click that clears selection on external custom modal.
93940
93940
 
93941
93941
  this.opts = Object.assign(this, defaults, opts);
93942
+ if (this.opts.uploadFile) {
93943
+ const uploadHandler = async e => {
93944
+ const data = await this.opts.uploadFile(e);
93945
+ this.returnUrl(data.url);
93946
+ };
93947
+ this.onImageUpload = uploadHandler;
93948
+ this.onVideoUpload = uploadHandler;
93949
+ this.onAudioUpload = uploadHandler;
93950
+ this.onMediaUpload = uploadHandler;
93951
+ this.onFileUpload = uploadHandler;
93952
+ }
93942
93953
  if (this.opts.basePath) {
93943
93954
  this.opts.assetPath = this.opts.basePath + 'assets/';
93944
93955
  this.opts.fontAssetPath = this.opts.basePath + 'assets/fonts/';