@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
@@ -168,8 +168,8 @@ const VerdocsAdoptSignatureDialog = class {
168
168
  };
169
169
  }
170
170
  componentWillLoad() {
171
- this.enteredName = this.name;
172
- this.computeEnteredInitials(this.name);
171
+ this.enteredName = this.initialEnteredName || this.name;
172
+ this.computeEnteredInitials(this.enteredName);
173
173
  if (this.initialMode) {
174
174
  this.mode = this.initialMode;
175
175
  }
@@ -383,7 +383,7 @@ const VerdocsAdoptSignatureDialog = class {
383
383
  e.preventDefault();
384
384
  const signature = this.signatureElement.toDataURL('image/png');
385
385
  const initials = this.initialsElement.toDataURL('image/png');
386
- this.next.emit({ signature, initials, mode: this.mode });
386
+ this.next.emit({ signature, initials, mode: this.mode, name: this.enteredName });
387
387
  }
388
388
  isAdoptButtonDisabled() {
389
389
  switch (this.mode) {
@@ -512,11 +512,11 @@ const VerdocsAdoptSignatureDialog = class {
512
512
  };
513
513
  }
514
514
  render() {
515
- return (h("verdocs-dialog", { key: '43e4a40803e7cf511bed41328fd48a54da571f23', persistent: true, onExit: () => this.exit.emit() }, h("div", { key: '462e271fe1390006727a0daa1a47de9b359af39c', slot: "heading", class: "heading" }, "Adopt Your Signature"), h("div", { key: '3617b310cba6e6defdd6a01bb3c16dd08db81c29', slot: "content", class: "content" }, h("div", { key: '4365227155f52f36c6421b1ff1cc6dcb2ea4fa6e', style: { fontWeight: '300', color: '#242424', fontSize: '13px' } }, "Confirm your name, initials, and signature."), h("div", { key: 'a768ae444c23e06b58a477e7f3654d128e5d1a6a', class: { type: true, active: this.mode === 'type' } }, h("verdocs-text-input", { key: 'dd3ba8e3b0994ed84148d890b6fba81c8554f70e', label: "Full Name", value: this.enteredName, disabled: this.nameLocked, onInput: e => this.handleNameChange(e), onClick: e => e.stopPropagation() }), this.nameLocked && h("div", { key: '45875c35eeaf050b2de2cc313f6275460fd96e0a', class: "name-locked-hint" }, "Your name has been set by the sender and cannot be changed.")), h("div", { key: 'cc6b9a9072ab0069fbf58ff0395311c93283fb7e', style: { fontWeight: '400', color: '#242424', fontSize: '13px' } }, "Select a signature style"), h("div", { key: '19034c3e2232c832ad4b0032d47e0940fa52c8d2', style: { display: 'flex', flexDirection: 'row', gap: '10px', marginBottom: '6px', alignItems: 'center', fontSize: '13px' } }, h("verdocs-radio-button", { key: 'c2f084d61633dbbd8aed7b6e3b941e19a953ccab', checked: this.mode === 'type', value: "type", name: "mode", onClick: () => this.setMode('type') }), h("label", { key: 'e1f22d03c316ad2c9fae0d80f81965557c0fbce6' }, "Typed with a keyboard")), h("div", { key: '9c343a3b9a3a551806d86f7c33496f856e50fe99', style: { display: 'flex', flexDirection: 'row', gap: '10px', marginBottom: '6px', alignItems: 'center', fontSize: '13px' } }, h("verdocs-radio-button", { key: '7e411e25456464390b028237cce9dcace361b7cf', checked: this.mode === 'draw', value: "draw", name: "mode", onClick: () => this.setMode('draw') }), h("label", { key: '9a707c87cf4229a6a8831adfeced815ce098180b' }, "Drawn with touch, mouse, or stylus")), h("div", { key: 'aa35cc9591db961dbff6cd26127ccfff96f225d0', class: "preview-header" }, h("div", { key: '4144d977477a558f1785d8f77072d83e8832841b', style: { fontSize: '13px', fontWeight: '400' } }, "Signature Preview"), this.mode === 'draw' && (h("button", { key: '3b687ce578839aefc9447357f61c46ecf783500a', class: "clear-button-text", onClick: e => this.handleClearDrawing(e, 'signature'), disabled: !this.hasDrawnSignature }, "Clear"))), h("div", { key: '306bad99deb8abf8c071d45146f6bbb63c8ca8f4', class: "canvas-container signature-container" }, h("div", { key: 'e5538c0694e4c32d63d0d2169938aa55f0a282c1', class: "signing-indicator" }, h("div", { key: 'd1b5f38019d723b90d95c5ad23219ed4f38a4248', class: "x-icon", innerHTML: SignatureXIcon }), h("div", { key: 'd2f2693b3fdd9feeb6ce7ab8ef006ede715217ab', class: "signing-line" })), h("canvas", { key: '59aa5a8bc5a588bd7fe08bafd43f06394ed35128', ref: el => (this.signatureElement = el),
515
+ return (h("verdocs-dialog", { key: '3bf57218c88709dcb904ed197ac37551c26c8c37', persistent: true, onExit: () => this.exit.emit() }, h("div", { key: '26bf968eb7e6169e29c11c96806c387fc2891df2', slot: "heading", class: "heading" }, "Adopt Your Signature"), h("div", { key: 'dd9cb18b25d3055cf98a79fca2fe12a7a0f756da', slot: "content", class: "content" }, h("div", { key: 'ff7520ccf2d8e15a72b12aabeba11f785c33a4b1', style: { fontWeight: '300', color: '#242424', fontSize: '13px' } }, "Confirm your name, initials, and signature."), h("div", { key: '428c77e16cfcddf1a202cc9155220fe7899f12e3', class: { type: true, active: this.mode === 'type' } }, h("verdocs-text-input", { key: '3df310a9c55c581350fc5ee5847e768764283ee6', label: "Full Name", value: this.enteredName, disabled: this.nameLocked, onInput: e => this.handleNameChange(e), onClick: e => e.stopPropagation() }), this.nameLocked && h("div", { key: '060c1edd0986a6be98f9ce68f7b94d562782a3ae', class: "name-locked-hint" }, "Your name has been set by the sender and cannot be changed.")), h("div", { key: '95b80e7b68150ba7e912176834686b769c1ad74e', style: { fontWeight: '400', color: '#242424', fontSize: '13px' } }, "Select a signature style"), h("div", { key: '8567f38208d1c2130ecacb21a6f09eaa089f6fb4', style: { display: 'flex', flexDirection: 'row', gap: '10px', marginBottom: '6px', alignItems: 'center', fontSize: '13px' } }, h("verdocs-radio-button", { key: '278fa39a73863c07512b297cdc13d2ad6bc18320', checked: this.mode === 'type', value: "type", name: "mode", onClick: () => this.setMode('type') }), h("label", { key: '20ebbd899fa095783e0b9b307e7c5bc6c73585c8' }, "Typed with a keyboard")), h("div", { key: '2aa96af7da2dbff4437f76d3be8c25660a5ae5ec', style: { display: 'flex', flexDirection: 'row', gap: '10px', marginBottom: '6px', alignItems: 'center', fontSize: '13px' } }, h("verdocs-radio-button", { key: 'e72c8a7350e6a368748746622dfc8382c94bbd7d', checked: this.mode === 'draw', value: "draw", name: "mode", onClick: () => this.setMode('draw') }), h("label", { key: '423eff813da06377c1c5d66f8ea813564f40478c' }, "Drawn with touch, mouse, or stylus")), h("div", { key: '013b7108cd626c5ef736520c4e93374205d62ea1', class: "preview-header" }, h("div", { key: '9af65f41a953990c2412b02176e921a60ef191ca', style: { fontSize: '13px', fontWeight: '400' } }, "Signature Preview"), this.mode === 'draw' && (h("button", { key: '5e422b7f7ef72fdf50eb7c5e102b9062a6f10e1c', class: "clear-button-text", onClick: e => this.handleClearDrawing(e, 'signature'), disabled: !this.hasDrawnSignature }, "Clear"))), h("div", { key: '220cdf4f321aa3a388c9c4f9340d130cb207e7cf', class: "canvas-container signature-container" }, h("div", { key: '0ffa2c39b216ecd3ef76a36122b8d51f6e5a59bb', class: "signing-indicator" }, h("div", { key: 'c295f652022004645377620a49b9314330bbca7c', class: "x-icon", innerHTML: SignatureXIcon }), h("div", { key: '0b24b19acd68f1e9ab9588f7b0aa3412e571a12d', class: "signing-line" })), h("canvas", { key: '72134d2f592c8f60fab5a90290f15b21e0b3e6aa', ref: el => (this.signatureElement = el),
516
516
  // width="300"
517
- height: "79", class: "signature-canvas", onPointerDown: this.handleSigPointerDown, onPointerMove: this.handleSigPointerMove, onPointerUp: this.handleSigPointerUp, onPointerCancel: this.handleSigPointerCancel, style: { touchAction: 'none', cursor: 'crosshair' } })), h("div", { key: '86a97be28c467678bd34e455412877ff55de26c2', class: "preview-header" }, h("div", { key: '0a605a59765dbb1f7ee15aa17bc3b4547983c747', style: { fontSize: '13px', fontWeight: '400' } }, "Initials Preview"), this.mode === 'draw' && (h("button", { key: '2426ed63c75312a999a9c12653dd75afe844fa07', class: "clear-button-text", onClick: e => this.handleClearDrawing(e, 'initials'), disabled: !this.hasDrawnInitials }, "Clear"))), h("div", { key: 'fa2c72403a43dfdd6a5f237fa3a21f048ceb517b', class: "canvas-container initials-container" }, h("div", { key: '4e1fbf7d941fcb46c363a35cd238c03d5cc75491', class: "signing-indicator" }, h("div", { key: 'c52486f29337d6b9027b32ea103e86c45904749e', class: "x-icon", innerHTML: SignatureXIcon }), h("div", { key: '6fa97d0d887d543f696de750db82b1a034bcb2b6', class: "signing-line" })), h("canvas", { key: '062e4e8da832b9d0f1a5af24a76188d3a9164ad4', ref: el => (this.initialsElement = el),
517
+ height: "79", class: "signature-canvas", onPointerDown: this.handleSigPointerDown, onPointerMove: this.handleSigPointerMove, onPointerUp: this.handleSigPointerUp, onPointerCancel: this.handleSigPointerCancel, style: { touchAction: 'none', cursor: 'crosshair' } })), h("div", { key: '847d54a8a55652ab67a3909d6510a4d587fb9bd8', class: "preview-header" }, h("div", { key: 'e270bb3dc8971ecc816db09ec6d91eb1a6613786', style: { fontSize: '13px', fontWeight: '400' } }, "Initials Preview"), this.mode === 'draw' && (h("button", { key: 'be4a46390d14a90f9705f40ff90a920174d58d85', class: "clear-button-text", onClick: e => this.handleClearDrawing(e, 'initials'), disabled: !this.hasDrawnInitials }, "Clear"))), h("div", { key: 'a8c2ace5575bf6b95e18e08febbd2dd3876d53c6', class: "canvas-container initials-container" }, h("div", { key: '1cab75d06695c2458452b4adc039f1078959c740', class: "signing-indicator" }, h("div", { key: 'e925e1f10a180aa65953dba5c007f294daf52ad2', class: "x-icon", innerHTML: SignatureXIcon }), h("div", { key: 'ecd9548ff69aa7ac7241433c1e88e5d66ceb2486', class: "signing-line" })), h("canvas", { key: '46c776d1efcee7e3d5bf5bd4a01db517eb638481', ref: el => (this.initialsElement = el),
518
518
  // width="300"
519
- height: "79", class: "initials-canvas", onPointerDown: this.handleInitialsPointerDown, onPointerMove: this.handleInitialsPointerMove, onPointerUp: this.handleInitialsPointerUp, onPointerCancel: this.handleInitialsPointerCancel, style: { touchAction: 'none', cursor: 'crosshair' } })), h("div", { key: 'f589d9624ff808b4179c55fad6ca1ef27b79f553', class: "disclaimer" }, "By clicking \u00ABAdopt Signature\u00BB, I agree that the signature and initials above will be the electronic representation of my signature and initials for all purposes when I use them to sign documents. Applying them to a document is legally equivalent to signing with a pen on paper.")), h("div", { key: '33058008d0000a073a43abae0246effa3970a52d', class: "footer", slot: "footer" }, h("div", { key: '3f6ea8bbca9a5eb9fab950a2a4d3d2e135698f56', class: "buttons" }, h("button", { key: '94512ed74ce791505f8e949f818ab7cac907271f', class: "cancel", onClick: e => this.handleCancel(e) }, "Cancel"), h("button", { key: '085af06c8d1671b0533a6f2b49891fcefe3697a9', class: "proceed", onClick: e => this.handleAdopt(e), disabled: this.isAdoptButtonDisabled() }, "Adopt & Sign")))));
519
+ height: "79", class: "initials-canvas", onPointerDown: this.handleInitialsPointerDown, onPointerMove: this.handleInitialsPointerMove, onPointerUp: this.handleInitialsPointerUp, onPointerCancel: this.handleInitialsPointerCancel, style: { touchAction: 'none', cursor: 'crosshair' } })), h("div", { key: '7039cf8e45f20d2c659937b9b637be9ee236b2d7', class: "disclaimer" }, "By clicking \u00ABAdopt Signature\u00BB, I agree that the signature and initials above will be the electronic representation of my signature and initials for all purposes when I use them to sign documents. Applying them to a document is legally equivalent to signing with a pen on paper.")), h("div", { key: '93030327757e8dbb438a9f7c0aa36829e54d1725', class: "footer", slot: "footer" }, h("div", { key: '7138105a5cd87dc3a85058fbfa0bd999a8ff68c5', class: "buttons" }, h("button", { key: '6051baa6bade91f491530b955710ceb672a45547', class: "cancel", onClick: e => this.handleCancel(e) }, "Cancel"), h("button", { key: 'cf3d5ff3b39f6c2b32c29306ca9a1656edb17e29', class: "proceed", onClick: e => this.handleAdopt(e), disabled: this.isAdoptButtonDisabled() }, "Adopt & Sign")))));
520
520
  }
521
521
  };
522
522
  VerdocsAdoptSignatureDialog.style = verdocsAdoptSignatureDialogCss;
@@ -79,6 +79,7 @@ const VerdocsSign = class {
79
79
  this.signatureAdoptMode = 'type';
80
80
  this.adoptedSignaturePreview = null;
81
81
  this.adoptedInitialsPreview = null;
82
+ this.adoptedName = null;
82
83
  this.skippedFields = [];
83
84
  this.documentsSingularPlural = 'document';
84
85
  this.authStep = null;
@@ -233,6 +234,7 @@ const VerdocsSign = class {
233
234
  this.signatureAdoptMode = 'type';
234
235
  this.adoptedSignaturePreview = null;
235
236
  this.adoptedInitialsPreview = null;
237
+ this.adoptedName = null;
236
238
  this.submitted = recipient.status === 'submitted';
237
239
  this.loading = false;
238
240
  this.isDone = this.submitted;
@@ -403,6 +405,50 @@ const VerdocsSign = class {
403
405
  }
404
406
  });
405
407
  }
408
+ toDataUrl(value) {
409
+ return value.startsWith('data:') ? value : `data:image/png;base64,${value}`;
410
+ }
411
+ getAdoptModeStorageKey(signatureBlockId) {
412
+ return `verdocs-adopt-mode:${signatureBlockId}`;
413
+ }
414
+ getAdoptNameStorageKey(signatureBlockId) {
415
+ return `verdocs-adopt-name:${signatureBlockId}`;
416
+ }
417
+ /**
418
+ * Restore adopted signature/initial previews and mode from applied fields or session storage.
419
+ * Clearing a field only removes the stamp from that field — the adopted block still exists.
420
+ */
421
+ hydrateAdoptedSignatureState(triggerField) {
422
+ var _a, _b, _c, _d, _e;
423
+ const fields = this.getRecipientFields();
424
+ const signatureField = (triggerField === null || triggerField === void 0 ? void 0 : triggerField.type) === 'signature'
425
+ ? triggerField
426
+ : 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); });
427
+ 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); });
428
+ if ((_a = signatureField === null || signatureField === void 0 ? void 0 : signatureField.settings) === null || _a === void 0 ? void 0 : _a.base64) {
429
+ this.adoptedSignaturePreview = this.toDataUrl(signatureField.settings.base64);
430
+ }
431
+ if ((_b = initialsField === null || initialsField === void 0 ? void 0 : initialsField.settings) === null || _b === void 0 ? void 0 : _b.base64) {
432
+ this.adoptedInitialsPreview = this.toDataUrl(initialsField.settings.base64);
433
+ }
434
+ if ((_c = signatureField === null || signatureField === void 0 ? void 0 : signatureField.settings) === null || _c === void 0 ? void 0 : _c.signature_id) {
435
+ this.signatureId = signatureField.settings.signature_id;
436
+ }
437
+ if ((_d = initialsField === null || initialsField === void 0 ? void 0 : initialsField.settings) === null || _d === void 0 ? void 0 : _d.initial_id) {
438
+ this.initialId = initialsField.settings.initial_id;
439
+ }
440
+ const modeSourceId = this.signatureId || ((_e = signatureField === null || signatureField === void 0 ? void 0 : signatureField.settings) === null || _e === void 0 ? void 0 : _e.signature_id);
441
+ if (modeSourceId && this.adoptedSignaturePreview) {
442
+ const storedMode = sessionStorage.getItem(this.getAdoptModeStorageKey(modeSourceId));
443
+ if (storedMode === 'draw' || storedMode === 'type') {
444
+ this.signatureAdoptMode = storedMode;
445
+ }
446
+ const storedName = sessionStorage.getItem(this.getAdoptNameStorageKey(modeSourceId));
447
+ if (storedName) {
448
+ this.adoptedName = storedName;
449
+ }
450
+ }
451
+ }
406
452
  getStartedKey() {
407
453
  var _a;
408
454
  return `${this.envelopeId}:${((_a = this.recipient) === null || _a === void 0 ? void 0 : _a.role_name) || ''}`;
@@ -567,10 +613,6 @@ const VerdocsSign = class {
567
613
  }
568
614
  if (e.detail === null) {
569
615
  console.log('[SIGN] Clearing signature');
570
- this.signatureId = null;
571
- this.adoptedSignaturePreview = null;
572
- this.adoptedInitialsPreview = null;
573
- this.signatureAdoptMode = 'type';
574
616
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
575
617
  this.updateRecipientFieldValue(field.name, updateResult);
576
618
  if (field.required)
@@ -582,6 +624,7 @@ const VerdocsSign = class {
582
624
  console.log('[SIGN] Reusing signature', this.signatureId);
583
625
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.signatureId, false);
584
626
  this.updateRecipientFieldValue(field.name, updateResult);
627
+ this.hydrateAdoptedSignatureState(field);
585
628
  this.focusNextFieldAfter(field);
586
629
  return;
587
630
  }
@@ -591,6 +634,7 @@ const VerdocsSign = class {
591
634
  const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, e.detail, false);
592
635
  this.signatureId = e.detail;
593
636
  this.updateRecipientFieldValue(field.name, updateResult);
637
+ this.hydrateAdoptedSignatureState(field);
594
638
  this.focusNextFieldAfter(field);
595
639
  return;
596
640
  }
@@ -948,6 +992,7 @@ const VerdocsSign = class {
948
992
  });
949
993
  el.addEventListener('adopt', () => {
950
994
  this.focusedField = field.name;
995
+ this.hydrateAdoptedSignatureState(field);
951
996
  this.updateAllFlags();
952
997
  this.adoptingSignature = true;
953
998
  });
@@ -1033,7 +1078,7 @@ const VerdocsSign = class {
1033
1078
  });
1034
1079
  }
1035
1080
  render() {
1036
- var _a, _b, _c;
1081
+ var _a, _b, _c, _d;
1037
1082
  if (this.showLoadError) {
1038
1083
  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: () => {
1039
1084
  window.location.reload();
@@ -1183,21 +1228,26 @@ const VerdocsSign = class {
1183
1228
  } })), 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: () => {
1184
1229
  this.showDone = false;
1185
1230
  this.isDone = true;
1186
- } })), 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) => {
1231
+ } })), 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) => {
1187
1232
  console.log('[SIGN] Adopting signature/initials block', e.detail);
1188
1233
  this.showSpinner = true;
1189
1234
  this.signatureAdoptMode = e.detail.mode;
1190
1235
  this.adoptedSignaturePreview = e.detail.signature;
1191
1236
  this.adoptedInitialsPreview = e.detail.initials;
1237
+ this.adoptedName = e.detail.name;
1192
1238
  // These arrive as base-64 encoded data URLs
1193
1239
  const signatureBlob = await (await fetch(e.detail.signature)).blob();
1194
1240
  const initialsBlob = await (await fetch(e.detail.initials)).blob();
1195
1241
  const sigResult = await createSignature(this.endpoint, 'signature', signatureBlob);
1196
1242
  console.log('[SIGN] Created signature', sigResult);
1197
1243
  this.signatureId = sigResult.id;
1244
+ sessionStorage.setItem(this.getAdoptModeStorageKey(sigResult.id), e.detail.mode);
1245
+ sessionStorage.setItem(this.getAdoptNameStorageKey(sigResult.id), e.detail.name);
1198
1246
  const initResult = await createInitials(this.endpoint, 'initial', initialsBlob);
1199
1247
  console.log('[SIGN] Created initials', initResult);
1200
1248
  this.initialId = initResult.id;
1249
+ sessionStorage.setItem(this.getAdoptModeStorageKey(initResult.id), e.detail.mode);
1250
+ sessionStorage.setItem(this.getAdoptNameStorageKey(initResult.id), e.detail.name);
1201
1251
  this.showSpinner = false;
1202
1252
  this.adoptingSignature = false;
1203
1253
  this.markEnvelopeStarted();