@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.
- package/dist/index.d.ts +11 -0
- package/dist/sparkvault.cjs.js +15 -0
- package/dist/sparkvault.cjs.js.map +1 -1
- package/dist/sparkvault.esm.js +15 -0
- package/dist/sparkvault.esm.js.map +1 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/vaults/upload/types.d.ts +11 -0
- package/package.json +1 -1
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
|
package/dist/sparkvault.cjs.js
CHANGED
|
@@ -8678,6 +8678,14 @@ class UploadRenderer {
|
|
|
8678
8678
|
this.config = config;
|
|
8679
8679
|
// Update branding
|
|
8680
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
|
+
}
|
|
8681
8689
|
// Show form
|
|
8682
8690
|
this.setState({ view: 'form', config });
|
|
8683
8691
|
}
|
|
@@ -9237,6 +9245,13 @@ class UploadRenderer {
|
|
|
9237
9245
|
percentage: 100,
|
|
9238
9246
|
phase: 'complete',
|
|
9239
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
|
+
}
|
|
9240
9255
|
this.setState({ view: 'complete', result, config });
|
|
9241
9256
|
// Notify success
|
|
9242
9257
|
this.callbacks.onSuccess(result);
|