@sparkvault/sdk-js 1.25.1 → 1.26.0

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.
@@ -8674,6 +8674,14 @@ class UploadRenderer {
8674
8674
  this.config = config;
8675
8675
  // Update branding
8676
8676
  this.container.updateBranding(config.branding);
8677
+ // Programmatic mode: a File was supplied, so skip the drop-zone form
8678
+ // and upload it straight away. Lets a host site own file selection
8679
+ // (its own button, picker, or drop target) and hand the File to the SDK.
8680
+ if (this.options.file) {
8681
+ this.selectedFile = this.options.file;
8682
+ await this.startUpload(config);
8683
+ return;
8684
+ }
8677
8685
  // Show form
8678
8686
  this.setState({ view: 'form', config });
8679
8687
  }
@@ -9233,6 +9241,13 @@ class UploadRenderer {
9233
9241
  percentage: 100,
9234
9242
  phase: 'complete',
9235
9243
  });
9244
+ // Silent mode: skip the success screen — fire onSuccess and close so
9245
+ // the host site can render its own post-upload UI.
9246
+ if (this.options.hideSuccessScreen) {
9247
+ this.callbacks.onSuccess(result);
9248
+ this.close();
9249
+ return;
9250
+ }
9236
9251
  this.setState({ view: 'complete', result, config });
9237
9252
  // Notify success
9238
9253
  this.callbacks.onSuccess(result);