@sparkvault/sdk 1.9.0 → 1.9.2
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 +0 -9
- package/dist/sparkvault.cjs.js +49 -11
- package/dist/sparkvault.cjs.js.map +1 -1
- package/dist/sparkvault.esm.js +49 -11
- 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/renderer.d.ts +1 -0
- package/dist/vaults/upload/types.d.ts +0 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -398,15 +398,6 @@ interface UploadOptions {
|
|
|
398
398
|
target?: string | HTMLElement;
|
|
399
399
|
/** Override backdrop blur for this dialog (uses global config if omitted) */
|
|
400
400
|
backdropBlur?: boolean;
|
|
401
|
-
/**
|
|
402
|
-
* Use minimal mode for cleaner inline experience.
|
|
403
|
-
* When true:
|
|
404
|
-
* - No dark mode transition during upload
|
|
405
|
-
* - No security sidebar during upload/ceremony
|
|
406
|
-
* - Cleaner, simpler progress visualization
|
|
407
|
-
* Defaults to true for inline mode, false for modal mode.
|
|
408
|
-
*/
|
|
409
|
-
minimal?: boolean;
|
|
410
401
|
/** Callback when upload completes successfully (if omitted, uses server-configured redirect) */
|
|
411
402
|
onSuccess?: (result: UploadResult) => void;
|
|
412
403
|
/** Callback when an error occurs (if omitted, uses server-configured redirect) */
|
package/dist/sparkvault.cjs.js
CHANGED
|
@@ -5756,18 +5756,32 @@ function getUploadStyles(options) {
|
|
|
5756
5756
|
======================================== */
|
|
5757
5757
|
|
|
5758
5758
|
.svu-overlay {
|
|
5759
|
-
|
|
5760
|
-
|
|
5759
|
+
/* Force full-screen overlay regardless of page styles */
|
|
5760
|
+
position: fixed !important;
|
|
5761
|
+
top: 0 !important;
|
|
5762
|
+
left: 0 !important;
|
|
5763
|
+
right: 0 !important;
|
|
5764
|
+
bottom: 0 !important;
|
|
5765
|
+
width: 100vw !important;
|
|
5766
|
+
height: 100vh !important;
|
|
5767
|
+
max-width: none !important;
|
|
5768
|
+
max-height: none !important;
|
|
5769
|
+
margin: 0 !important;
|
|
5761
5770
|
background: rgba(0, 0, 0, 0.5);
|
|
5762
|
-
display: flex;
|
|
5771
|
+
display: flex !important;
|
|
5763
5772
|
align-items: center;
|
|
5764
5773
|
justify-content: center;
|
|
5765
|
-
z-index: 999999;
|
|
5774
|
+
z-index: 999999 !important;
|
|
5766
5775
|
padding: 16px;
|
|
5767
5776
|
box-sizing: border-box;
|
|
5768
5777
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
5769
5778
|
-webkit-font-smoothing: antialiased;
|
|
5770
5779
|
-moz-osx-font-smoothing: grayscale;
|
|
5780
|
+
/* Break out of any containing block that could affect fixed positioning */
|
|
5781
|
+
transform: none !important;
|
|
5782
|
+
filter: none !important;
|
|
5783
|
+
contain: none !important;
|
|
5784
|
+
isolation: isolate;
|
|
5771
5785
|
}
|
|
5772
5786
|
|
|
5773
5787
|
.svu-overlay.svu-blur {
|
|
@@ -6976,6 +6990,9 @@ class UploadModalContainer {
|
|
|
6976
6990
|
setDarkMode(enabled) {
|
|
6977
6991
|
if (!this.elements)
|
|
6978
6992
|
return;
|
|
6993
|
+
// Skip if already in the requested mode
|
|
6994
|
+
if (this.isDarkMode === enabled)
|
|
6995
|
+
return;
|
|
6979
6996
|
this.isDarkMode = enabled;
|
|
6980
6997
|
if (enabled) {
|
|
6981
6998
|
this.elements.modal.classList.add('svu-dark');
|
|
@@ -6983,7 +7000,7 @@ class UploadModalContainer {
|
|
|
6983
7000
|
else {
|
|
6984
7001
|
this.elements.modal.classList.remove('svu-dark');
|
|
6985
7002
|
}
|
|
6986
|
-
// Re-create header with correct logo
|
|
7003
|
+
// Re-create header with correct logo (only when mode actually changes)
|
|
6987
7004
|
const newHeader = this.createHeader(this.branding);
|
|
6988
7005
|
if (this.headerElement?.parentNode) {
|
|
6989
7006
|
this.headerElement.parentNode.replaceChild(newHeader, this.headerElement);
|
|
@@ -7250,6 +7267,9 @@ class UploadInlineContainer {
|
|
|
7250
7267
|
setDarkMode(enabled) {
|
|
7251
7268
|
if (!this.container)
|
|
7252
7269
|
return;
|
|
7270
|
+
// Skip if already in the requested mode
|
|
7271
|
+
if (this.isDarkMode === enabled)
|
|
7272
|
+
return;
|
|
7253
7273
|
this.isDarkMode = enabled;
|
|
7254
7274
|
if (enabled) {
|
|
7255
7275
|
this.container.classList.add('svu-dark');
|
|
@@ -7257,7 +7277,7 @@ class UploadInlineContainer {
|
|
|
7257
7277
|
else {
|
|
7258
7278
|
this.container.classList.remove('svu-dark');
|
|
7259
7279
|
}
|
|
7260
|
-
// Re-create header with correct logo
|
|
7280
|
+
// Re-create header with correct logo (only when mode actually changes)
|
|
7261
7281
|
if (this.containerOptions.showHeader && this.header) {
|
|
7262
7282
|
const newHeader = this.createHeader(this.branding);
|
|
7263
7283
|
this.container.replaceChild(newHeader, this.header);
|
|
@@ -7512,6 +7532,7 @@ class UploadRenderer {
|
|
|
7512
7532
|
// Hybrid mode: modal overlay for upload/ceremony in inline mode
|
|
7513
7533
|
this.uploadModal = null;
|
|
7514
7534
|
this.isInlineMode = false;
|
|
7535
|
+
this.hybridModalInitialized = false;
|
|
7515
7536
|
this.pasteHandler = null;
|
|
7516
7537
|
this.container = container;
|
|
7517
7538
|
this.api = api;
|
|
@@ -7552,6 +7573,7 @@ class UploadRenderer {
|
|
|
7552
7573
|
if (this.uploadModal) {
|
|
7553
7574
|
this.uploadModal.destroy();
|
|
7554
7575
|
this.uploadModal = null;
|
|
7576
|
+
this.hybridModalInitialized = false;
|
|
7555
7577
|
}
|
|
7556
7578
|
this.container.destroy();
|
|
7557
7579
|
}
|
|
@@ -7571,10 +7593,16 @@ class UploadRenderer {
|
|
|
7571
7593
|
this.renderInModal();
|
|
7572
7594
|
return;
|
|
7573
7595
|
}
|
|
7574
|
-
// Close modal if we're leaving upload/ceremony states
|
|
7596
|
+
// Close modal if we're leaving upload/ceremony states (hybrid mode complete)
|
|
7575
7597
|
if (this.uploadModal) {
|
|
7576
7598
|
this.uploadModal.destroy();
|
|
7577
7599
|
this.uploadModal = null;
|
|
7600
|
+
this.hybridModalInitialized = false;
|
|
7601
|
+
// Restore inline container visibility
|
|
7602
|
+
const inlineBody = this.container.getBody();
|
|
7603
|
+
if (inlineBody?.parentElement) {
|
|
7604
|
+
inlineBody.parentElement.style.display = '';
|
|
7605
|
+
}
|
|
7578
7606
|
}
|
|
7579
7607
|
const body = this.container.getBody();
|
|
7580
7608
|
if (!body)
|
|
@@ -7613,7 +7641,7 @@ class UploadRenderer {
|
|
|
7613
7641
|
* This provides the full polished experience during upload.
|
|
7614
7642
|
*/
|
|
7615
7643
|
renderInModal() {
|
|
7616
|
-
// Create modal
|
|
7644
|
+
// Create and initialize modal only once
|
|
7617
7645
|
if (!this.uploadModal) {
|
|
7618
7646
|
this.uploadModal = new UploadModalContainer();
|
|
7619
7647
|
this.uploadModal.createLoading({ backdropBlur: this.options.backdropBlur ?? true }, () => { } // No close callback - user can't cancel during upload
|
|
@@ -7621,15 +7649,25 @@ class UploadRenderer {
|
|
|
7621
7649
|
if (this.config) {
|
|
7622
7650
|
this.uploadModal.updateBranding(this.config.branding);
|
|
7623
7651
|
}
|
|
7652
|
+
this.hybridModalInitialized = false;
|
|
7624
7653
|
}
|
|
7625
7654
|
const body = this.uploadModal.getBody();
|
|
7626
7655
|
if (!body)
|
|
7627
7656
|
return;
|
|
7657
|
+
// Initialize modal state only once (not on every progress update)
|
|
7658
|
+
if (!this.hybridModalInitialized) {
|
|
7659
|
+
// Hide inline container during hybrid mode to avoid CSS conflicts
|
|
7660
|
+
const inlineBody = this.container.getBody();
|
|
7661
|
+
if (inlineBody?.parentElement) {
|
|
7662
|
+
inlineBody.parentElement.style.display = 'none';
|
|
7663
|
+
}
|
|
7664
|
+
// Set dark mode and show sidebar once
|
|
7665
|
+
this.uploadModal.setDarkMode(true);
|
|
7666
|
+
this.uploadModal.toggleSidebar(true);
|
|
7667
|
+
this.hybridModalInitialized = true;
|
|
7668
|
+
}
|
|
7628
7669
|
// Clear and render current state
|
|
7629
7670
|
body.innerHTML = '';
|
|
7630
|
-
// Set dark mode and show sidebar
|
|
7631
|
-
this.uploadModal.setDarkMode(true);
|
|
7632
|
-
this.uploadModal.toggleSidebar(true);
|
|
7633
7671
|
if (this.viewState.view === 'uploading') {
|
|
7634
7672
|
body.appendChild(this.renderUploading(this.viewState));
|
|
7635
7673
|
}
|