@hubsync/esign-web-sdk 6.9.43 → 6.9.44

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 (58) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-signing-progress.verdocs-view.entry.cjs.js.map +1 -1
  3. package/dist/cjs/verdocs-adopt-signature-dialog_8.cjs.entry.js +6 -6
  4. package/dist/cjs/verdocs-sign.cjs.entry.js +56 -6
  5. package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
  6. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  7. package/dist/collection/components/dialogs/verdocs-adopt-signature-dialog/verdocs-adopt-signature-dialog.js +27 -8
  8. package/dist/collection/components/dialogs/verdocs-adopt-signature-dialog/verdocs-adopt-signature-dialog.js.map +1 -1
  9. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +57 -6
  10. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  11. package/dist/components/{p-BUE7R0tf.js → p-DSzyP6KP.js} +9 -8
  12. package/dist/components/p-DSzyP6KP.js.map +1 -0
  13. package/dist/components/verdocs-adopt-signature-dialog.js +1 -1
  14. package/dist/components/verdocs-sign.js +58 -7
  15. package/dist/components/verdocs-sign.js.map +1 -1
  16. package/dist/custom-elements.json +4 -0
  17. package/dist/esm/loader.js +1 -1
  18. package/dist/esm/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-signing-progress.verdocs-view.entry.js.map +1 -1
  19. package/dist/esm/verdocs-adopt-signature-dialog_8.entry.js +6 -6
  20. package/dist/esm/verdocs-sign.entry.js +56 -6
  21. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  22. package/dist/esm/verdocs-web-sdk.js +1 -1
  23. package/dist/esm-es5/loader.js +1 -1
  24. package/dist/esm-es5/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-signing-progress.verdocs-view.entry.js.map +1 -1
  25. package/dist/esm-es5/verdocs-adopt-signature-dialog_8.entry.js +1 -1
  26. package/dist/esm-es5/verdocs-adopt-signature-dialog_8.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/dialogs/verdocs-adopt-signature-dialog/verdocs-adopt-signature-dialog.d.ts +5 -0
  31. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +9 -0
  32. package/dist/types/components.d.ts +10 -2
  33. package/dist/verdocs-web-sdk/p-7a0f0515.entry.js +2 -0
  34. package/dist/verdocs-web-sdk/p-7a0f0515.entry.js.map +1 -0
  35. package/dist/verdocs-web-sdk/p-965a8331.entry.js +2 -0
  36. package/dist/verdocs-web-sdk/p-965a8331.entry.js.map +1 -0
  37. package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
  38. package/dist/verdocs-web-sdk/p-CSd2l4lv.system.js.map +1 -0
  39. package/dist/verdocs-web-sdk/p-cbae68bb.system.entry.js +2 -0
  40. package/dist/verdocs-web-sdk/p-cbae68bb.system.entry.js.map +1 -0
  41. package/dist/verdocs-web-sdk/p-dx3XIcHV.system.js.map +1 -0
  42. package/dist/verdocs-web-sdk/p-ff5f20c9.system.entry.js +2 -0
  43. package/dist/verdocs-web-sdk/p-ff5f20c9.system.entry.js.map +1 -0
  44. package/dist/verdocs-web-sdk/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-passcode-dialog.verdocs-signing-progress.verdocs-view.entry.esm.js.map +1 -1
  45. package/dist/verdocs-web-sdk/verdocs-sign.entry.esm.js.map +1 -1
  46. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  47. package/package.json +1 -1
  48. package/dist/components/p-BUE7R0tf.js.map +0 -1
  49. package/dist/verdocs-web-sdk/p-32af0c78.entry.js +0 -2
  50. package/dist/verdocs-web-sdk/p-32af0c78.entry.js.map +0 -1
  51. package/dist/verdocs-web-sdk/p-64c0f4e1.system.entry.js +0 -2
  52. package/dist/verdocs-web-sdk/p-64c0f4e1.system.entry.js.map +0 -1
  53. package/dist/verdocs-web-sdk/p-DL_q7a6L.system.js.map +0 -1
  54. package/dist/verdocs-web-sdk/p-DyUrM6Ex.system.js.map +0 -1
  55. package/dist/verdocs-web-sdk/p-b8966f51.entry.js +0 -2
  56. package/dist/verdocs-web-sdk/p-b8966f51.entry.js.map +0 -1
  57. package/dist/verdocs-web-sdk/p-e13491c4.system.entry.js +0 -2
  58. package/dist/verdocs-web-sdk/p-e13491c4.system.entry.js.map +0 -1
@@ -104,6 +104,7 @@ export class VerdocsSign {
104
104
  this.signatureAdoptMode = 'type';
105
105
  this.adoptedSignaturePreview = null;
106
106
  this.adoptedInitialsPreview = null;
107
+ this.adoptedName = null;
107
108
  this.skippedFields = [];
108
109
  this.documentsSingularPlural = 'document';
109
110
  this.authStep = null;
@@ -258,6 +259,7 @@ export class VerdocsSign {
258
259
  this.signatureAdoptMode = 'type';
259
260
  this.adoptedSignaturePreview = null;
260
261
  this.adoptedInitialsPreview = null;
262
+ this.adoptedName = null;
261
263
  this.submitted = recipient.status === 'submitted';
262
264
  this.loading = false;
263
265
  this.isDone = this.submitted;
@@ -428,6 +430,50 @@ export class VerdocsSign {
428
430
  }
429
431
  });
430
432
  }
433
+ toDataUrl(value) {
434
+ return value.startsWith('data:') ? value : `data:image/png;base64,${value}`;
435
+ }
436
+ getAdoptModeStorageKey(signatureBlockId) {
437
+ return `verdocs-adopt-mode:${signatureBlockId}`;
438
+ }
439
+ getAdoptNameStorageKey(signatureBlockId) {
440
+ return `verdocs-adopt-name:${signatureBlockId}`;
441
+ }
442
+ /**
443
+ * Restore adopted signature/initial previews and mode from applied fields or session storage.
444
+ * Clearing a field only removes the stamp from that field — the adopted block still exists.
445
+ */
446
+ hydrateAdoptedSignatureState(triggerField) {
447
+ var _a, _b, _c, _d, _e;
448
+ const fields = this.getRecipientFields();
449
+ const signatureField = (triggerField === null || triggerField === void 0 ? void 0 : triggerField.type) === 'signature'
450
+ ? triggerField
451
+ : fields.find(f => { var _a, _b; return f.type === 'signature' && ((_a = f.settings) === null || _a === void 0 ? void 0 : _a.base64) && ((_b = f.settings) === null || _b === void 0 ? void 0 : _b.signature_id); });
452
+ const initialsField = fields.find(f => { var _a, _b; return f.type === 'initial' && ((_a = f.settings) === null || _a === void 0 ? void 0 : _a.base64) && ((_b = f.settings) === null || _b === void 0 ? void 0 : _b.initial_id); });
453
+ if ((_a = signatureField === null || signatureField === void 0 ? void 0 : signatureField.settings) === null || _a === void 0 ? void 0 : _a.base64) {
454
+ this.adoptedSignaturePreview = this.toDataUrl(signatureField.settings.base64);
455
+ }
456
+ if ((_b = initialsField === null || initialsField === void 0 ? void 0 : initialsField.settings) === null || _b === void 0 ? void 0 : _b.base64) {
457
+ this.adoptedInitialsPreview = this.toDataUrl(initialsField.settings.base64);
458
+ }
459
+ if ((_c = signatureField === null || signatureField === void 0 ? void 0 : signatureField.settings) === null || _c === void 0 ? void 0 : _c.signature_id) {
460
+ this.signatureId = signatureField.settings.signature_id;
461
+ }
462
+ if ((_d = initialsField === null || initialsField === void 0 ? void 0 : initialsField.settings) === null || _d === void 0 ? void 0 : _d.initial_id) {
463
+ this.initialId = initialsField.settings.initial_id;
464
+ }
465
+ const modeSourceId = this.signatureId || ((_e = signatureField === null || signatureField === void 0 ? void 0 : signatureField.settings) === null || _e === void 0 ? void 0 : _e.signature_id);
466
+ if (modeSourceId && this.adoptedSignaturePreview) {
467
+ const storedMode = sessionStorage.getItem(this.getAdoptModeStorageKey(modeSourceId));
468
+ if (storedMode === 'draw' || storedMode === 'type') {
469
+ this.signatureAdoptMode = storedMode;
470
+ }
471
+ const storedName = sessionStorage.getItem(this.getAdoptNameStorageKey(modeSourceId));
472
+ if (storedName) {
473
+ this.adoptedName = storedName;
474
+ }
475
+ }
476
+ }
431
477
  getStartedKey() {
432
478
  var _a;
433
479
  return `${this.envelopeId}:${((_a = this.recipient) === null || _a === void 0 ? void 0 : _a.role_name) || ''}`;
@@ -592,10 +638,6 @@ export class VerdocsSign {
592
638
  }
593
639
  if (e.detail === null) {
594
640
  console.log('[SIGN] Clearing signature');
595
- this.signatureId = null;
596
- this.adoptedSignaturePreview = null;
597
- this.adoptedInitialsPreview = null;
598
- this.signatureAdoptMode = 'type';
599
641
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
600
642
  this.updateRecipientFieldValue(field.name, updateResult);
601
643
  if (field.required)
@@ -607,6 +649,7 @@ export class VerdocsSign {
607
649
  console.log('[SIGN] Reusing signature', this.signatureId);
608
650
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.signatureId, false);
609
651
  this.updateRecipientFieldValue(field.name, updateResult);
652
+ this.hydrateAdoptedSignatureState(field);
610
653
  this.focusNextFieldAfter(field);
611
654
  return;
612
655
  }
@@ -616,6 +659,7 @@ export class VerdocsSign {
616
659
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, e.detail, false);
617
660
  this.signatureId = e.detail;
618
661
  this.updateRecipientFieldValue(field.name, updateResult);
662
+ this.hydrateAdoptedSignatureState(field);
619
663
  this.focusNextFieldAfter(field);
620
664
  return;
621
665
  }
@@ -973,6 +1017,7 @@ export class VerdocsSign {
973
1017
  });
974
1018
  el.addEventListener('adopt', () => {
975
1019
  this.focusedField = field.name;
1020
+ this.hydrateAdoptedSignatureState(field);
976
1021
  this.updateAllFlags();
977
1022
  this.adoptingSignature = true;
978
1023
  });
@@ -1058,7 +1103,7 @@ export class VerdocsSign {
1058
1103
  });
1059
1104
  }
1060
1105
  render() {
1061
- var _a, _b, _c;
1106
+ var _a, _b, _c, _d;
1062
1107
  if (this.showLoadError) {
1063
1108
  return (h(Host, null, h("verdocs-ok-dialog", { heading: "Unable to Start Signing", message: `Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`, buttonLabel: "OK", onNext: () => {
1064
1109
  window.location.reload();
@@ -1208,21 +1253,26 @@ export class VerdocsSign {
1208
1253
  } })), this.showDone && (h("verdocs-ok-dialog", { heading: "You're Done!", message: `You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the completed document and certificate attached.`, hideCloseButton: true, onNext: () => {
1209
1254
  this.showDone = false;
1210
1255
  this.isDone = true;
1211
- } })), this.adoptingSignature && (h("verdocs-adopt-signature-dialog", { name: formatFullName(this.recipient), nameLocked: !!((_a = this.recipient) === null || _a === void 0 ? void 0 : _a.name_locked), initialMode: this.adoptedSignaturePreview ? this.signatureAdoptMode : undefined, initialSignature: (_b = this.adoptedSignaturePreview) !== null && _b !== void 0 ? _b : undefined, initialInitials: (_c = this.adoptedInitialsPreview) !== null && _c !== void 0 ? _c : undefined, onNext: async (e) => {
1256
+ } })), this.adoptingSignature && (h("verdocs-adopt-signature-dialog", { name: formatFullName(this.recipient), nameLocked: !!((_a = this.recipient) === null || _a === void 0 ? void 0 : _a.name_locked), initialEnteredName: (_b = this.adoptedName) !== null && _b !== void 0 ? _b : undefined, initialMode: this.adoptedSignaturePreview ? this.signatureAdoptMode : undefined, initialSignature: (_c = this.adoptedSignaturePreview) !== null && _c !== void 0 ? _c : undefined, initialInitials: (_d = this.adoptedInitialsPreview) !== null && _d !== void 0 ? _d : undefined, onNext: async (e) => {
1212
1257
  console.log('[SIGN] Adopting signature/initials block', e.detail);
1213
1258
  this.showSpinner = true;
1214
1259
  this.signatureAdoptMode = e.detail.mode;
1215
1260
  this.adoptedSignaturePreview = e.detail.signature;
1216
1261
  this.adoptedInitialsPreview = e.detail.initials;
1262
+ this.adoptedName = e.detail.name;
1217
1263
  // These arrive as base-64 encoded data URLs
1218
1264
  const signatureBlob = await (await fetch(e.detail.signature)).blob();
1219
1265
  const initialsBlob = await (await fetch(e.detail.initials)).blob();
1220
1266
  const sigResult = await createSignature(this.endpoint, 'signature', signatureBlob);
1221
1267
  console.log('[SIGN] Created signature', sigResult);
1222
1268
  this.signatureId = sigResult.id;
1269
+ sessionStorage.setItem(this.getAdoptModeStorageKey(sigResult.id), e.detail.mode);
1270
+ sessionStorage.setItem(this.getAdoptNameStorageKey(sigResult.id), e.detail.name);
1223
1271
  const initResult = await createInitials(this.endpoint, 'initial', initialsBlob);
1224
1272
  console.log('[SIGN] Created initials', initResult);
1225
1273
  this.initialId = initResult.id;
1274
+ sessionStorage.setItem(this.getAdoptModeStorageKey(initResult.id), e.detail.mode);
1275
+ sessionStorage.setItem(this.getAdoptNameStorageKey(initResult.id), e.detail.name);
1226
1276
  this.showSpinner = false;
1227
1277
  this.adoptingSignature = false;
1228
1278
  this.markEnvelopeStarted();
@@ -1490,6 +1540,7 @@ export class VerdocsSign {
1490
1540
  "signatureAdoptMode": {},
1491
1541
  "adoptedSignaturePreview": {},
1492
1542
  "adoptedInitialsPreview": {},
1543
+ "adoptedName": {},
1493
1544
  "skippedFields": {},
1494
1545
  "documentsSingularPlural": {},
1495
1546
  "authStep": {},