@sparkvault/sdk-js 15.15.0 → 15.16.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.mjs CHANGED
@@ -4047,6 +4047,9 @@ class LoadingView {
4047
4047
  /** The terms of service, published once, on the marketing site. */
4048
4048
  const TERMS_URL = 'https://sparkvault.com/terms/';
4049
4049
 
4050
+ /** The privacy policy, published once, on the marketing site. */
4051
+ const PRIVACY_URL = 'https://sparkvault.com/privacy/';
4052
+
4050
4053
  /**
4051
4054
  * Beside every field where a person enters a phone number SparkVault texts or
4052
4055
  * calls (the sign-in field and the backup phone of Identity's sign-in, in
@@ -4055,17 +4058,26 @@ const TERMS_URL = 'https://sparkvault.com/terms/';
4055
4058
  * text or a call: a phone number the sign-in was handed reaches the picker
4056
4059
  * without passing the field. The terms take the consent from whoever provides
4057
4060
  * the number, so the words fit a number typed and a number handed over alike.
4058
- * It agrees with the terms' SMS and voice disclosures (apps/www/terms.md 15.2,
4059
- * held to them by apps/www/tests/consent-lines.test.mjs): STOP opts the number
4060
- * out, HELP answers, rates may apply, and where texts and calls go and how to
4061
- * opt back in (START or UNSTOP) are the terms' to say.
4061
+ * A carrier approves the number SparkVault texts from only when this line, its
4062
+ * call to action, names the service, the consent, how often messages come,
4063
+ * that rates may apply, how to opt out and get help, and links the terms and
4064
+ * the privacy policy, so it says each of them. It agrees with the terms' SMS
4065
+ * and voice disclosures and the privacy policy (apps/www/terms.md 15,
4066
+ * apps/www/privacy.md 1.1, held to them by
4067
+ * apps/www/tests/consent-lines.test.mjs): texts carry the codes, alerts and
4068
+ * notifications they name and calls only the codes, STOP opts the number out,
4069
+ * HELP answers, frequency varies, rates may apply, and where texts and calls
4070
+ * go and how to opt back in (START or UNSTOP) are the terms' to say.
4062
4071
  */
4063
4072
  const SMS_CONSENT = Object.freeze({
4064
- beforeTerms: 'By providing a phone number, you agree to receive verification codes and account messages from SparkVault by text or automated call, as its ',
4073
+ beforeTerms: 'By providing a phone number, you agree to receive texts from SparkVault with verification codes, security alerts and account notifications, and automated calls with verification codes, as its ',
4065
4074
  terms: 'Terms',
4066
- afterTerms: ' describe. Message and data rates may apply. Reply STOP to opt out or HELP for help.'
4075
+ beforePrivacy: ' and ',
4076
+ privacy: 'Privacy Policy',
4077
+ afterPrivacy: ' describe. Message frequency varies. Message and data rates may apply. Reply STOP to opt out or HELP for help.'
4067
4078
  });
4068
4079
 
4080
+ /* global HTMLAnchorElement */
4069
4081
  /**
4070
4082
  * SMS and Voice Consent
4071
4083
  *
@@ -4075,8 +4087,19 @@ const SMS_CONSENT = Object.freeze({
4075
4087
  * under the method picker wherever it offers a text or a call. It describes
4076
4088
  * the field or the methods above it, so a screen reader reads it with them.
4077
4089
  */
4090
+ /** A document the line names, linked in place and opening in a new tab. */
4091
+ function documentLink(name, href) {
4092
+ const link = document.createElement('a');
4093
+ link.className = 'sv-sms-consent-link';
4094
+ link.href = href;
4095
+ link.target = '_blank';
4096
+ link.rel = 'noopener noreferrer';
4097
+ link.textContent = name;
4098
+ return link;
4099
+ }
4078
4100
  /**
4079
- * The consent line, its "Terms" opening the terms in a new tab.
4101
+ * The consent line, its "Terms" and "Privacy Policy" opening those documents
4102
+ * in a new tab.
4080
4103
  *
4081
4104
  * @param id - The line's id, which the field or each method names in its `aria-describedby`
4082
4105
  */
@@ -4084,13 +4107,7 @@ function smsConsent(id) {
4084
4107
  const line = document.createElement('p');
4085
4108
  line.className = 'sv-sms-consent';
4086
4109
  line.id = id;
4087
- const terms = document.createElement('a');
4088
- terms.className = 'sv-sms-consent-link';
4089
- terms.href = TERMS_URL;
4090
- terms.target = '_blank';
4091
- terms.rel = 'noopener noreferrer';
4092
- terms.textContent = SMS_CONSENT.terms;
4093
- line.append(SMS_CONSENT.beforeTerms, terms, SMS_CONSENT.afterTerms);
4110
+ line.append(SMS_CONSENT.beforeTerms, documentLink(SMS_CONSENT.terms, TERMS_URL), SMS_CONSENT.beforePrivacy, documentLink(SMS_CONSENT.privacy, PRIVACY_URL), SMS_CONSENT.afterPrivacy);
4094
4111
  return line;
4095
4112
  }
4096
4113
 
@@ -8257,7 +8274,7 @@ function getStyles(options) {
8257
8274
  };
8258
8275
  return `
8259
8276
  /* ========================================
8260
- MOTION SYSTEM — shared duration/easing tokens so every transition in
8277
+ MOTION SYSTEM: shared duration/easing tokens so every transition in
8261
8278
  the flow is consistent. 120/180/280ms tiers; standard and decelerate
8262
8279
  curves only, never overshoot.
8263
8280
  ======================================== */
@@ -8546,7 +8563,7 @@ function getStyles(options) {
8546
8563
  background: ${tokens.primaryHover};
8547
8564
  }
8548
8565
 
8549
- /* Secondary Button — quiet: subtle fill, hairline border */
8566
+ /* Secondary Button, quiet: subtle fill, hairline border */
8550
8567
  .sv-btn-secondary {
8551
8568
  background: ${tokens.bgSubtle};
8552
8569
  color: ${tokens.textPrimary};
@@ -8558,7 +8575,7 @@ function getStyles(options) {
8558
8575
  border-color: ${tokens.borderHover};
8559
8576
  }
8560
8577
 
8561
- /* Method Button — a full-width row with a nudging chevron affordance
8578
+ /* Method Button: a full-width row with a nudging chevron affordance
8562
8579
  (added via ::after so no DOM change is needed). The card itself stays
8563
8580
  planted: hover is a quiet fill + border shift, no translate. */
8564
8581
  .sv-btn-method {
@@ -8638,7 +8655,7 @@ function getStyles(options) {
8638
8655
  width: 100%;
8639
8656
  }
8640
8657
 
8641
- /* Bare glyph slot — no container chrome. Quiet slate stroke that takes
8658
+ /* Bare glyph slot, no container chrome. Quiet slate stroke that takes
8642
8659
  the accent on row hover. */
8643
8660
  .sv-method-icon {
8644
8661
  width: 20px;
@@ -8907,8 +8924,8 @@ function getStyles(options) {
8907
8924
  }
8908
8925
 
8909
8926
  /* The SMS and voice consent under a phone number field: fine print in the
8910
- secondary ink, its link underlined in the same ink so it reads as a link
8911
- without a second color. */
8927
+ secondary ink, its links underlined in the same ink so each reads as a
8928
+ link without a second color. */
8912
8929
  .sv-sms-consent {
8913
8930
  margin: 8px 0 0;
8914
8931
  font-size: 12px;
@@ -9367,7 +9384,7 @@ function getStyles(options) {
9367
9384
  margin-bottom: 16px;
9368
9385
  }
9369
9386
 
9370
- /* Bare glyph — no tinted circle container. */
9387
+ /* Bare glyph, no tinted circle container. */
9371
9388
  .sv-sparklink-icon {
9372
9389
  width: 48px;
9373
9390
  height: 48px;
@@ -11158,7 +11175,7 @@ class IdentityModule {
11158
11175
  throw new ValidationError('Invalid OAuth state');
11159
11176
  }
11160
11177
  if (!codeVerifier) {
11161
- throw new ValidationError('Sign-in session was lost — please sign in again.');
11178
+ throw new ValidationError('Sign-in session was lost. Please sign in again.');
11162
11179
  }
11163
11180
  // WHICH account the code carries is settled where it is minted, never
11164
11181
  // here: the code is PKCE- and origin-bound to this tab, and a recovery
@@ -27081,7 +27098,7 @@ class SparkVault {
27081
27098
  }
27082
27099
  /** Get the SDK version */
27083
27100
  static get version() {
27084
- return '15.15.0';
27101
+ return '15.16.0';
27085
27102
  }
27086
27103
  }
27087
27104
  if (typeof window !== 'undefined') {