@sparkvault/sdk-js 1.25.0 → 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.
package/dist/index.d.ts CHANGED
@@ -486,6 +486,17 @@ interface UploadOptions {
486
486
  backdropBlur?: boolean;
487
487
  /** Hide "Upload Another File" button on success screen (for single-file flows) */
488
488
  hideUploadAnother?: boolean;
489
+ /**
490
+ * Skip the success screen entirely. On completion the SDK fires onSuccess
491
+ * and closes the dialog, so a host site can render its own post-upload UI.
492
+ */
493
+ hideSuccessScreen?: boolean;
494
+ /**
495
+ * Upload this File directly, skipping the SDK's drop-zone. The host owns
496
+ * file selection (its own button, picker, or drop target) and hands the
497
+ * File to the SDK, which shows only the secure-upload progress dialog.
498
+ */
499
+ file?: File;
489
500
  /**
490
501
  * Vault Access Token. When provided, the upload is authorized by the VAT
491
502
  * (no public-upload flag required). When omitted, the public upload flow
@@ -7153,6 +7153,8 @@ function getUploadStyles(options) {
7153
7153
  .svu-drop-icon {
7154
7154
  color: ${tokens.textMuted};
7155
7155
  margin-bottom: 12px;
7156
+ display: flex;
7157
+ justify-content: center;
7156
7158
  }
7157
7159
 
7158
7160
  .svu-drop-text {
@@ -8676,6 +8678,14 @@ class UploadRenderer {
8676
8678
  this.config = config;
8677
8679
  // Update branding
8678
8680
  this.container.updateBranding(config.branding);
8681
+ // Programmatic mode: a File was supplied, so skip the drop-zone form
8682
+ // and upload it straight away. Lets a host site own file selection
8683
+ // (its own button, picker, or drop target) and hand the File to the SDK.
8684
+ if (this.options.file) {
8685
+ this.selectedFile = this.options.file;
8686
+ await this.startUpload(config);
8687
+ return;
8688
+ }
8679
8689
  // Show form
8680
8690
  this.setState({ view: 'form', config });
8681
8691
  }
@@ -9235,6 +9245,13 @@ class UploadRenderer {
9235
9245
  percentage: 100,
9236
9246
  phase: 'complete',
9237
9247
  });
9248
+ // Silent mode: skip the success screen — fire onSuccess and close so
9249
+ // the host site can render its own post-upload UI.
9250
+ if (this.options.hideSuccessScreen) {
9251
+ this.callbacks.onSuccess(result);
9252
+ this.close();
9253
+ return;
9254
+ }
9238
9255
  this.setState({ view: 'complete', result, config });
9239
9256
  // Notify success
9240
9257
  this.callbacks.onSuccess(result);