@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
@@ -260,10 +260,32 @@ const VerdocsSign = class {
260
260
  existing.remove();
261
261
  }
262
262
  }
263
+ // A brand saved from the detail form has colors but no CSS block of its own. Those colors still
264
+ // have to reach the signing UI, so a minimal block is built from them, using the same variables
265
+ // the Builder would have emitted.
266
+ synthesizeBrandCss(brand) {
267
+ const primary = typeof brand.primary_color === 'string' ? brand.primary_color.trim() : '';
268
+ if (!/^#[0-9a-f]{6}$/i.test(primary)) {
269
+ return '';
270
+ }
271
+ const shade = (hex, amount) => {
272
+ const channel = (i) => Math.round(Math.max(0, Math.min(255, parseInt(hex.slice(i, i + 2), 16) * (1 + amount))));
273
+ return `#${[1, 3, 5].map(i => channel(i).toString(16).padStart(2, '0')).join('')}`;
274
+ };
275
+ const secondary = typeof brand.secondary_color === 'string' && /^#[0-9a-f]{6}$/i.test(brand.secondary_color.trim()) ? brand.secondary_color.trim() : primary;
276
+ return [
277
+ ':root, .verdocs-custom-theme {',
278
+ ` --verdocs-primary-color: ${primary};`,
279
+ ` --verdocs-primary-color-hover: ${shade(primary, -0.14)};`,
280
+ ` --verdocs-link-color: ${secondary};`,
281
+ ` --verdocs-checkbox-color: ${primary};`,
282
+ '}',
283
+ ].join('\n');
284
+ }
263
285
  applyBrandStyleOverrides(brand) {
264
286
  const styleId = this.getBrandStyleOverridesId();
265
287
  const existing = document.getElementById(styleId);
266
- const overrides = brand === null || brand === void 0 ? void 0 : brand.style_overrides;
288
+ const overrides = brand ? (typeof brand.style_overrides === 'string' && brand.style_overrides.trim() ? brand.style_overrides : this.synthesizeBrandCss(brand)) : '';
267
289
  if (typeof overrides === 'string' && overrides.length > 0) {
268
290
  const styleEl = existing || document.createElement('style');
269
291
  styleEl.id = styleId;
@@ -277,15 +299,24 @@ const VerdocsSign = class {
277
299
  }
278
300
  }
279
301
  processAuthResponse(response) {
280
- var _a, _b, _c, _d;
302
+ var _a, _b, _c, _d, _e;
281
303
  const { envelope, recipient, brand } = response;
282
304
  (_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)));
283
305
  const { auth_step } = recipient;
284
306
  this.recipient = recipient;
285
307
  this.envelope = envelope;
286
- this.disclosures = ((_c = (_b = this.envelope) === null || _b === void 0 ? void 0 : _b.organization) === null || _c === void 0 ? void 0 : _c.disclaimer) || DEFAULT_DISCLOSURES;
287
- this.applyOrgStyleOverrides();
288
- this.applyBrandStyleOverrides(brand);
308
+ 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) || DEFAULT_DISCLOSURES;
309
+ // A resolved brand (the envelope's own, or the organization's default) replaces the
310
+ // organization's legacy CSS block outright. Applying both let the older block's direct
311
+ // header and button rules beat the brand's variables, so the brand never showed.
312
+ if (brand) {
313
+ (_d = document.getElementById(this.getOrgStyleOverridesId())) === null || _d === void 0 ? void 0 : _d.remove();
314
+ this.applyBrandStyleOverrides(brand);
315
+ }
316
+ else {
317
+ this.applyOrgStyleOverrides();
318
+ this.applyBrandStyleOverrides(null);
319
+ }
289
320
  this.authStep = auth_step;
290
321
  this.delegated = !!recipient.delegated_to;
291
322
  this.agreed = recipient.agreed;
@@ -322,7 +353,7 @@ const VerdocsSign = class {
322
353
  this.nextButtonLabel = 'Next';
323
354
  }
324
355
  this.checkRecipientFields();
325
- (_d = this.envelopeLoaded) === null || _d === void 0 ? void 0 : _d.emit({ endpoint: this.endpoint, envelope: this.envelope });
356
+ (_e = this.envelopeLoaded) === null || _e === void 0 ? void 0 : _e.emit({ endpoint: this.endpoint, envelope: this.envelope });
326
357
  }
327
358
  handleClickAgree() {
328
359
  this.submitting = true;
@@ -1160,7 +1191,8 @@ const VerdocsSign = class {
1160
1191
  const totalPages = this.envelope.documents.reduce((acc, doc) => acc + doc.pages, 0);
1161
1192
  const pageOptions = integerSequence(1, totalPages).map(p => ({ label: p.toString(), value: p.toString() }));
1162
1193
  let globalPageCounter = 0;
1163
- return (h(Host, null, this.toolbarStyle === 'menu' && (h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("div", { class: "title" }, this.envelope.name), h("div", { style: { flex: '1' } }), !this.finishLater && !this.submitted &&
1194
+ return (h(Host, null, this.toolbarStyle === 'menu' && (h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("div", { class: "title" }, this.envelope.name), h("div", { style: { flex: '1' } }), !this.finishLater &&
1195
+ !this.submitted &&
1164
1196
  (() => {
1165
1197
  const remaining = this.getRequiredTotalCount() - this.getRequiredFilledCount();
1166
1198
  const optionalLeft = this.getOptionalUnfilledCount();