@sparkvault/sdk-js 16.2.1 → 16.4.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/README.md CHANGED
@@ -394,7 +394,11 @@ contact intent records content-free assistance analytics; closing records no
394
394
  invented outcome. Search outages and protected articles are separate states,
395
395
  with contact still available subject to its own access policy. Republish older
396
396
  KB releases once to generate their in-widget reader documents; the canonical
397
- help-center link remains available.
397
+ help-center link remains available. Help Desk > Settings > General can set a
398
+ short note shown beside the "Still need help? Open a ticket" button under the
399
+ suggestions, such as who answers and how soon. The optional public desk field
400
+ is `ticket_contact_note` (one line, up to 160 characters); null or omission
401
+ shows no note. It is rendered as text, never HTML.
398
402
 
399
403
  Contact reuses the ticket form's draft, attachment and uncertain-send handling.
400
404
  The subject and message are editable. A verified website session appears without
package/dist/index.cjs CHANGED
@@ -18055,7 +18055,12 @@ class HelpDeskClient {
18055
18055
  }, undefined, false);
18056
18056
  if (revision !== this.revision)
18057
18057
  throw sessionChanged();
18058
- if (!validToken(result?.token) || result.customer?.assurance !== 'identity' || !/^hdwip_[A-Za-z0-9_-]{43}$/.test(result.identity_grant?.token)) {
18058
+ // A native sign-in opens a session at the desk's issuer: an email sign-in's customer is linked to
18059
+ // its Secure Identity (`identity`); a sign-in by the organization's own identity provider carries
18060
+ // the `federated` mark and the `federated` assurance together, never one without the other.
18061
+ const customer = result?.customer;
18062
+ const nativeIdentity = customer?.federated === true ? customer.assurance === 'federated' : customer?.assurance === 'identity';
18063
+ if (!validToken(result?.token) || !nativeIdentity || !/^hdwip_[A-Za-z0-9_-]{43}$/.test(result.identity_grant?.token)) {
18059
18064
  throw new SparkVaultError('The help desk returned an invalid support identity.', 'HELP_DESK_INVALID_RESPONSE');
18060
18065
  }
18061
18066
  this.issuedSessions.set(result, result.token);
@@ -22675,9 +22680,9 @@ function injectHelpDeskSupportStyles() {
22675
22680
  .svhs-result:hover .svhs-result-title{color:var(--hd-accent-ink,${DS.action});text-decoration:underline}
22676
22681
  .svhs-result-excerpt{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;color:${DS.slate600};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
22677
22682
  .svhs-result-category{display:block;margin-top:6px;color:${DS.slate500};font-size:12px;line-height:1.4}
22678
- .svhs-results-bottom{background:${DS.slate50};border-top-color:${DS.slate200}}
22679
- .svhs-footer-title{margin:0 0 3px;color:${DS.slate900};font-size:14px;font-weight:600;line-height:1.5}
22680
- .svhs-footer-copy{margin:0 0 14px;color:${DS.slate600};font-size:13px;line-height:1.5}
22683
+ .svhs-results-bottom{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;background:${DS.slate50};border-top-color:${DS.slate200}}
22684
+ /* Wraps below the ticket button when less than 200px remain beside it, as under the panel's full-width button. */
22685
+ .svhs-contact-note{flex:1 1 200px;min-width:0;margin:0;color:${DS.slate500};font-size:13px;line-height:1.5;overflow-wrap:anywhere}
22681
22686
  .svhs-error{margin:12px 0 0;color:${DS.error};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
22682
22687
  .svhs-status{margin:16px 0;color:${DS.slate600};font-size:14px;line-height:1.5}
22683
22688
  .svhs-empty{padding:12px 0 4px}
@@ -22820,10 +22825,6 @@ function injectHelpDeskSupportStyles() {
22820
22825
  .svhs-page .svhs-start-bottom{padding-top:0;align-items:flex-start}
22821
22826
  .svhs-page .svhs-start-bottom .svhs-primary{width:auto;min-width:160px}
22822
22827
  .svhs-page[data-stage=issue] .svhs-heading{font-size:28px}
22823
- .svhs-page .svhs-results-bottom{display:flex;align-items:center;gap:24px}
22824
- .svhs-page .svhs-results-bottom[hidden]{display:none}
22825
- .svhs-page .svhs-escalation{flex:1;min-width:0}
22826
- .svhs-page .svhs-footer-copy{margin:0}
22827
22828
  .svhs-page .svhs-results-bottom .svhs-secondary{width:auto;flex:none}
22828
22829
  .svhs-page .svhs-contact-target,.svhs-page .svhs-contact-target>.svhd-container{min-height:0}
22829
22830
  .svhs-page .svhs-contact-scroll{padding:0}
@@ -22836,8 +22837,7 @@ function injectHelpDeskSupportStyles() {
22836
22837
  .svhs-page .svhs-start-bottom{padding-top:0}
22837
22838
  .svhs-page .svhs-start-bottom .svhs-primary{width:100%}
22838
22839
  .svhs-page[data-stage=issue] .svhs-heading{font-size:26px}
22839
- .svhs-page .svhs-results-bottom{display:block}
22840
- .svhs-page .svhs-results-bottom .svhs-secondary{width:100%;margin-top:14px}
22840
+ .svhs-page .svhs-results-bottom .svhs-secondary{width:100%}
22841
22841
  .svhs-page .svhs-contact-scroll{padding:0}
22842
22842
  }
22843
22843
  `;
@@ -23227,6 +23227,7 @@ class SupportView {
23227
23227
  this.resultCopy = element('p', 'svhs-copy');
23228
23228
  this.resultStatus = element('div', 'svhs-empty');
23229
23229
  this.resultError = element('p', 'svhs-error');
23230
+ this.contactNote = element('p', 'svhs-contact-note');
23230
23231
  this.articleTitle = element('h2', 'svhs-article-title');
23231
23232
  this.articleCategory = element('p', 'svhs-category');
23232
23233
  this.articleContent = element('div', 'svhs-article-content');
@@ -23339,9 +23340,11 @@ class SupportView {
23339
23340
  return;
23340
23341
  this.actions.onContact(['locked', 'unavailable'].includes(this.state?.kbState || '') ? 'direct' : this.state?.results?.length ? 'none_match' : 'no_results');
23341
23342
  });
23343
+ this.contactNote.id = `${this.prefix}-contact-note`;
23344
+ this.contactNote.hidden = true;
23342
23345
  this.resultsFooter = this.footer('results');
23343
23346
  this.resultsFooter.classList.add('svhs-results-bottom');
23344
- this.resultsFooter.append(this.contactResults);
23347
+ this.resultsFooter.append(this.contactResults, this.contactNote);
23345
23348
  const article = this.screen('article');
23346
23349
  article.classList.add('svhs-article-scroll');
23347
23350
  this.articleTitle.tabIndex = -1;
@@ -23709,6 +23712,13 @@ class SupportView {
23709
23712
  }
23710
23713
  this.resultsFooter.hidden = Boolean(state.busy);
23711
23714
  this.contactResults.disabled = Boolean(state.busy);
23715
+ // Desk configuration, set as text: never parsed as markup.
23716
+ this.contactNote.textContent = state.contactNote || '';
23717
+ this.contactNote.hidden = !state.contactNote;
23718
+ if (state.contactNote)
23719
+ this.contactResults.setAttribute('aria-describedby', this.contactNote.id);
23720
+ else
23721
+ this.contactResults.removeAttribute('aria-describedby');
23712
23722
  }
23713
23723
  renderResultStatus(state, results) {
23714
23724
  const signature = state.kbState === 'locked' ? `locked:${state.kbAccessMode}` : state.busy ? 'busy' : state.kbState === 'unavailable' ? 'unavailable' : results.length ? 'matches' : 'empty';
@@ -24206,7 +24216,7 @@ function createHelpDeskSupport(config, options) {
24206
24216
  return (await http.request(path, { method: 'POST', body, credentials: 'omit', headers: { 'X-SV-Client': 'help-desk-portal', ...headers } })).data;
24207
24217
  },
24208
24218
  });
24209
- update({ deskName: answer.desk.organization_name || 'Support', brandColor: answer.desk.branding?.color });
24219
+ update({ deskName: answer.desk.organization_name || 'Support', brandColor: answer.desk.branding?.color, contactNote: answer.desk.ticket_contact_note ?? undefined });
24210
24220
  return answer;
24211
24221
  }).catch((error) => { connected = null; throw error; });
24212
24222
  return connected;
@@ -29547,7 +29557,7 @@ class SparkVault {
29547
29557
  }
29548
29558
  /** Get the SDK version */
29549
29559
  static get version() {
29550
- return '16.2.1';
29560
+ return '16.4.0';
29551
29561
  }
29552
29562
  }
29553
29563
  if (typeof window !== 'undefined') {