@sparkvault/sdk-js 15.14.0 → 15.14.1

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.cjs CHANGED
@@ -23017,11 +23017,6 @@ function getUploadStyles() {
23017
23017
  overflow: hidden;
23018
23018
  }
23019
23019
 
23020
- .svu-modal.svu-with-sidebar {
23021
- max-width: 900px;
23022
- flex-direction: row;
23023
- }
23024
-
23025
23020
  .svu-modal-main {
23026
23021
  flex: 1;
23027
23022
  display: flex;
@@ -23785,13 +23780,38 @@ function getUploadStyles() {
23785
23780
  }
23786
23781
 
23787
23782
  /* ========================================
23788
- SECURITY SIDEBAR
23783
+ ON-DEMAND SECURITY HELP
23789
23784
  ======================================== */
23790
23785
 
23786
+ .svu-security-help {
23787
+ flex-shrink: 0;
23788
+ border-top: 1px solid ${tokens.borderDark};
23789
+ }
23790
+
23791
+ .svu-security-help summary {
23792
+ display: flex;
23793
+ align-items: center;
23794
+ justify-content: center;
23795
+ width: 44px;
23796
+ min-height: 44px;
23797
+ margin-left: auto;
23798
+ cursor: pointer;
23799
+ color: ${tokens.textMutedOnDark};
23800
+ font-size: 16px;
23801
+ list-style: none;
23802
+ }
23803
+
23804
+ .svu-security-help summary::-webkit-details-marker { display: none; }
23805
+ .svu-security-help summary:focus-visible {
23806
+ outline: 2px solid ${tokens.textOnDark};
23807
+ outline-offset: -4px;
23808
+ }
23809
+
23791
23810
  .svu-sidebar {
23792
- width: 320px;
23811
+ box-sizing: border-box;
23812
+ width: 100%;
23813
+ max-height: 240px;
23793
23814
  background: ${tokens.bgDark};
23794
- border-left: 1px solid ${tokens.borderDark};
23795
23815
  color: ${tokens.textOnDark};
23796
23816
  padding: 20px;
23797
23817
  overflow-y: auto;
@@ -23961,20 +23981,6 @@ function getUploadStyles() {
23961
23981
  RESPONSIVE
23962
23982
  ======================================== */
23963
23983
 
23964
- @media (max-width: 768px) {
23965
- .svu-modal.svu-with-sidebar {
23966
- flex-direction: column;
23967
- max-width: 480px;
23968
- }
23969
-
23970
- .svu-sidebar {
23971
- width: 100%;
23972
- border-left: none;
23973
- border-top: 1px solid ${tokens.borderDark};
23974
- max-height: 300px;
23975
- }
23976
- }
23977
-
23978
23984
  @media (max-width: 480px) {
23979
23985
  .svu-modal {
23980
23986
  max-width: 100%;
@@ -24042,7 +24048,7 @@ function getUploadStyles() {
24042
24048
  * Upload Modal Container
24043
24049
  *
24044
24050
  * Single responsibility: the upload dialog's chrome (branded header, body,
24045
- * footer, and the security sidebar of the dark states) inside the SDK's shared
24051
+ * footer, and optional security help) inside the SDK's shared
24046
24052
  * modal shell, which owns the dialog behaviour (dismissal, scroll lock,
24047
24053
  * focus). Does NOT handle content rendering - that's the Renderer's job.
24048
24054
  */
@@ -24131,25 +24137,33 @@ class UploadModalContainer {
24131
24137
  this.refreshHeader();
24132
24138
  }
24133
24139
  /**
24134
- * Show or hide the security sidebar. The sidebar carries its own logo, so
24135
- * the header hides while it shows.
24140
+ * Offer security education on demand during a transfer. Never expand it
24141
+ * automatically or widen the working view to accommodate explanatory copy.
24136
24142
  */
24137
24143
  toggleSidebar(show) {
24138
24144
  if (!this.shell)
24139
24145
  return;
24140
24146
  if (show && !this.sidebar) {
24141
- this.sidebar = createSecuritySidebar(this.branding);
24142
- this.shell.modal.classList.add('svu-with-sidebar');
24143
- this.shell.modal.appendChild(this.sidebar);
24144
- if (this.header)
24145
- this.header.style.display = 'none';
24147
+ this.sidebar = document.createElement('details');
24148
+ this.sidebar.className = 'svu-security-help';
24149
+ const summary = document.createElement('summary');
24150
+ summary.textContent = '?';
24151
+ summary.setAttribute('aria-label', 'About upload security');
24152
+ summary.title = 'About upload security';
24153
+ this.sidebar.append(summary, createSecuritySidebar(this.branding));
24154
+ this.sidebar.addEventListener('keydown', (event) => {
24155
+ if (event.key !== 'Escape' || !this.sidebar?.open)
24156
+ return;
24157
+ event.preventDefault();
24158
+ event.stopPropagation();
24159
+ this.sidebar.open = false;
24160
+ summary.focus();
24161
+ });
24162
+ this.body?.after(this.sidebar);
24146
24163
  }
24147
24164
  else if (!show && this.sidebar) {
24148
- this.shell.modal.classList.remove('svu-with-sidebar');
24149
24165
  this.sidebar.remove();
24150
24166
  this.sidebar = null;
24151
- if (this.header)
24152
- this.header.style.display = '';
24153
24167
  }
24154
24168
  }
24155
24169
  handleClose() {
@@ -24547,7 +24561,7 @@ class UploadRenderer {
24547
24561
  return;
24548
24562
  // Clear body
24549
24563
  body.innerHTML = '';
24550
- // The dialog darkens and shows the security sidebar in the dark states;
24564
+ // The dialog darkens and offers optional security help in the dark states;
24551
24565
  // inline mode runs those states in its own dialog (renderInModal).
24552
24566
  if (this.container instanceof UploadModalContainer) {
24553
24567
  this.container.setDarkMode(isDarkState);
@@ -24633,7 +24647,7 @@ class UploadRenderer {
24633
24647
  if (inlineBody?.parentElement) {
24634
24648
  inlineBody.parentElement.style.display = 'none';
24635
24649
  }
24636
- // Set dark mode and show sidebar once
24650
+ // Set dark mode and offer security help once, closed until requested.
24637
24651
  this.uploadModal.setDarkMode(true);
24638
24652
  this.uploadModal.toggleSidebar(true);
24639
24653
  this.hybridModalInitialized = true;
@@ -26648,7 +26662,7 @@ class SparkVault {
26648
26662
  }
26649
26663
  /** Get the SDK version */
26650
26664
  static get version() {
26651
- return '15.14.0';
26665
+ return '15.14.1';
26652
26666
  }
26653
26667
  }
26654
26668
  if (typeof window !== 'undefined') {