@verdocs/web-sdk 6.13.0 → 6.13.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.
Files changed (52) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-preview_6.cjs.entry.js +43 -2
  3. package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
  4. package/dist/cjs/verdocs-sign.cjs.entry.js +39 -7
  5. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  6. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  7. package/dist/collection/components/embeds/verdocs-send/verdocs-send.css +55 -0
  8. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +45 -1
  9. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  10. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +39 -7
  11. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  12. package/dist/components/p-VqyGWtIp.js +2 -0
  13. package/dist/components/p-VqyGWtIp.js.map +1 -0
  14. package/dist/components/verdocs-build.js +1 -1
  15. package/dist/components/verdocs-send.js +1 -1
  16. package/dist/components/verdocs-sign.js +1 -1
  17. package/dist/components/verdocs-sign.js.map +1 -1
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/esm/verdocs-preview_6.entry.js +44 -3
  20. package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
  21. package/dist/esm/verdocs-sign.entry.js +39 -7
  22. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  23. package/dist/esm/verdocs-web-sdk.js +1 -1
  24. package/dist/esm-es5/loader.js +1 -1
  25. package/dist/esm-es5/verdocs-preview_6.entry.js +2 -2
  26. package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
  27. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  28. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  29. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  30. package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +14 -1
  31. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
  32. package/dist/verdocs-web-sdk/p-575b6f98.system.entry.js +8 -0
  33. package/dist/verdocs-web-sdk/p-575b6f98.system.entry.js.map +1 -0
  34. package/dist/verdocs-web-sdk/p-957e4cb0.entry.js +2 -0
  35. package/dist/verdocs-web-sdk/p-957e4cb0.entry.js.map +1 -0
  36. package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
  37. package/dist/verdocs-web-sdk/p-f3924e9e.entry.js +8 -0
  38. package/dist/verdocs-web-sdk/p-f3924e9e.entry.js.map +1 -0
  39. package/dist/verdocs-web-sdk/p-f41af68e.system.entry.js +2 -0
  40. package/dist/verdocs-web-sdk/p-f41af68e.system.entry.js.map +1 -0
  41. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/components/p-CnUZ9w2T.js +0 -2
  44. package/dist/components/p-CnUZ9w2T.js.map +0 -1
  45. package/dist/verdocs-web-sdk/p-2a6a3bc6.entry.js +0 -2
  46. package/dist/verdocs-web-sdk/p-2a6a3bc6.entry.js.map +0 -1
  47. package/dist/verdocs-web-sdk/p-5404f6bf.system.entry.js +0 -2
  48. package/dist/verdocs-web-sdk/p-5404f6bf.system.entry.js.map +0 -1
  49. package/dist/verdocs-web-sdk/p-788c8d67.system.entry.js +0 -8
  50. package/dist/verdocs-web-sdk/p-788c8d67.system.entry.js.map +0 -1
  51. package/dist/verdocs-web-sdk/p-987d5653.entry.js +0 -8
  52. package/dist/verdocs-web-sdk/p-987d5653.entry.js.map +0 -1
@@ -262,10 +262,32 @@ const VerdocsSign = class {
262
262
  existing.remove();
263
263
  }
264
264
  }
265
+ // A brand saved from the detail form has colors but no CSS block of its own. Those colors still
266
+ // have to reach the signing UI, so a minimal block is built from them, using the same variables
267
+ // the Builder would have emitted.
268
+ synthesizeBrandCss(brand) {
269
+ const primary = typeof brand.primary_color === 'string' ? brand.primary_color.trim() : '';
270
+ if (!/^#[0-9a-f]{6}$/i.test(primary)) {
271
+ return '';
272
+ }
273
+ const shade = (hex, amount) => {
274
+ const channel = (i) => Math.round(Math.max(0, Math.min(255, parseInt(hex.slice(i, i + 2), 16) * (1 + amount))));
275
+ return `#${[1, 3, 5].map(i => channel(i).toString(16).padStart(2, '0')).join('')}`;
276
+ };
277
+ const secondary = typeof brand.secondary_color === 'string' && /^#[0-9a-f]{6}$/i.test(brand.secondary_color.trim()) ? brand.secondary_color.trim() : primary;
278
+ return [
279
+ ':root, .verdocs-custom-theme {',
280
+ ` --verdocs-primary-color: ${primary};`,
281
+ ` --verdocs-primary-color-hover: ${shade(primary, -0.14)};`,
282
+ ` --verdocs-link-color: ${secondary};`,
283
+ ` --verdocs-checkbox-color: ${primary};`,
284
+ '}',
285
+ ].join('\n');
286
+ }
265
287
  applyBrandStyleOverrides(brand) {
266
288
  const styleId = this.getBrandStyleOverridesId();
267
289
  const existing = document.getElementById(styleId);
268
- const overrides = brand === null || brand === void 0 ? void 0 : brand.style_overrides;
290
+ const overrides = brand ? (typeof brand.style_overrides === 'string' && brand.style_overrides.trim() ? brand.style_overrides : this.synthesizeBrandCss(brand)) : '';
269
291
  if (typeof overrides === 'string' && overrides.length > 0) {
270
292
  const styleEl = existing || document.createElement('style');
271
293
  styleEl.id = styleId;
@@ -279,15 +301,24 @@ const VerdocsSign = class {
279
301
  }
280
302
  }
281
303
  processAuthResponse(response) {
282
- var _a, _b, _c, _d;
304
+ var _a, _b, _c, _d, _e;
283
305
  const { envelope, recipient, brand } = response;
284
306
  (_a = envelope.documents) === null || _a === void 0 ? void 0 : _a.sort((a, b) => (a.order !== b.order ? a.order - b.order : a.created_at.localeCompare(b.created_at)));
285
307
  const { auth_step } = recipient;
286
308
  this.recipient = recipient;
287
309
  this.envelope = envelope;
288
- this.disclosures = ((_c = (_b = this.envelope) === null || _b === void 0 ? void 0 : _b.organization) === null || _c === void 0 ? void 0 : _c.disclaimer) || jsSdk.DEFAULT_DISCLOSURES;
289
- this.applyOrgStyleOverrides();
290
- this.applyBrandStyleOverrides(brand);
310
+ this.disclosures = (brand === null || brand === void 0 ? void 0 : brand.disclaimer) || ((_c = (_b = this.envelope) === null || _b === void 0 ? void 0 : _b.organization) === null || _c === void 0 ? void 0 : _c.disclaimer) || jsSdk.DEFAULT_DISCLOSURES;
311
+ // A resolved brand (the envelope's own, or the organization's default) replaces the
312
+ // organization's legacy CSS block outright. Applying both let the older block's direct
313
+ // header and button rules beat the brand's variables, so the brand never showed.
314
+ if (brand) {
315
+ (_d = document.getElementById(this.getOrgStyleOverridesId())) === null || _d === void 0 ? void 0 : _d.remove();
316
+ this.applyBrandStyleOverrides(brand);
317
+ }
318
+ else {
319
+ this.applyOrgStyleOverrides();
320
+ this.applyBrandStyleOverrides(null);
321
+ }
291
322
  this.authStep = auth_step;
292
323
  this.delegated = !!recipient.delegated_to;
293
324
  this.agreed = recipient.agreed;
@@ -324,7 +355,7 @@ const VerdocsSign = class {
324
355
  this.nextButtonLabel = 'Next';
325
356
  }
326
357
  this.checkRecipientFields();
327
- (_d = this.envelopeLoaded) === null || _d === void 0 ? void 0 : _d.emit({ endpoint: this.endpoint, envelope: this.envelope });
358
+ (_e = this.envelopeLoaded) === null || _e === void 0 ? void 0 : _e.emit({ endpoint: this.endpoint, envelope: this.envelope });
328
359
  }
329
360
  handleClickAgree() {
330
361
  this.submitting = true;
@@ -1162,7 +1193,8 @@ const VerdocsSign = class {
1162
1193
  const totalPages = this.envelope.documents.reduce((acc, doc) => acc + doc.pages, 0);
1163
1194
  const pageOptions = jsSdk.integerSequence(1, totalPages).map(p => ({ label: p.toString(), value: p.toString() }));
1164
1195
  let globalPageCounter = 0;
1165
- return (index.h(index.Host, null, this.toolbarStyle === 'menu' && (index.h("div", { id: "verdocs-sign-header" }, index.h("div", { class: "inner" }, index.h("div", { class: "title" }, this.envelope.name), index.h("div", { style: { flex: '1' } }), !this.finishLater && !this.submitted &&
1196
+ return (index.h(index.Host, null, this.toolbarStyle === 'menu' && (index.h("div", { id: "verdocs-sign-header" }, index.h("div", { class: "inner" }, index.h("div", { class: "title" }, this.envelope.name), index.h("div", { style: { flex: '1' } }), !this.finishLater &&
1197
+ !this.submitted &&
1166
1198
  (() => {
1167
1199
  const remaining = this.getRequiredTotalCount() - this.getRequiredFilledCount();
1168
1200
  const optionalLeft = this.getOptionalUnfilledCount();