@hubsync/esign-web-sdk 6.9.43 → 6.9.45
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/cjs/loader.cjs.js +1 -1
- 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
- package/dist/cjs/verdocs-adopt-signature-dialog_8.cjs.entry.js +35 -8
- package/dist/cjs/verdocs-sign.cjs.entry.js +106 -6
- package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/dialogs/verdocs-adopt-signature-dialog/verdocs-adopt-signature-dialog.js +108 -13
- package/dist/collection/components/dialogs/verdocs-adopt-signature-dialog/verdocs-adopt-signature-dialog.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +109 -6
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/components/{p-BUE7R0tf.js → p-DFsjkMkI.js} +40 -10
- package/dist/components/p-DFsjkMkI.js.map +1 -0
- package/dist/components/verdocs-adopt-signature-dialog.js +1 -1
- package/dist/components/verdocs-sign.js +110 -7
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/custom-elements.json +5 -1
- package/dist/esm/loader.js +1 -1
- 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
- package/dist/esm/verdocs-adopt-signature-dialog_8.entry.js +35 -8
- package/dist/esm/verdocs-sign.entry.js +106 -6
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- 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
- package/dist/esm-es5/verdocs-adopt-signature-dialog_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_8.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/dialogs/verdocs-adopt-signature-dialog/verdocs-adopt-signature-dialog.d.ts +35 -3
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +22 -0
- package/dist/types/components.d.ts +43 -5
- package/dist/verdocs-web-sdk/p-3832868c.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-3832868c.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
- package/dist/verdocs-web-sdk/p-BEzGtFgy.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-CCpu7MXO.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-c67b23fc.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-c67b23fc.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-ec29782b.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-ec29782b.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-fe804f97.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-fe804f97.system.entry.js.map +1 -0
- 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
- package/dist/verdocs-web-sdk/verdocs-sign.entry.esm.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-BUE7R0tf.js.map +0 -1
- package/dist/verdocs-web-sdk/p-32af0c78.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-32af0c78.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-64c0f4e1.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-64c0f4e1.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-DL_q7a6L.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-DyUrM6Ex.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-b8966f51.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b8966f51.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e13491c4.system.entry.js +0 -2
- 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.
|
|
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
|
}
|
|
@@ -234,17 +234,30 @@ const VerdocsAdoptSignatureDialog = class {
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
async restoreDrawnPreviewsIfNeeded() {
|
|
237
|
+
var _a, _b;
|
|
237
238
|
// Preserve in-session stroke edits; only restore saved previews when there are no strokes yet.
|
|
238
239
|
if (this.allSigStrokes.length > 0 || this.allInitialsStrokes.length > 0) {
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
242
|
const tasks = [];
|
|
242
|
-
|
|
243
|
+
// Prefer replaying the saved strokes (faithful + editable). Fall back to the rasterized preview only when no
|
|
244
|
+
// strokes are available, e.g. resuming from a server-stored bitmap in a fresh browser session.
|
|
245
|
+
if (((_a = this.initialSignatureStrokes) === null || _a === void 0 ? void 0 : _a.length) && this.signatureElement) {
|
|
246
|
+
this.allSigStrokes = this.denormalizeStrokes(this.initialSignatureStrokes, this.signatureElement);
|
|
247
|
+
this.hasDrawnSignature = true;
|
|
248
|
+
this.redrawDrawnSignature();
|
|
249
|
+
}
|
|
250
|
+
else if (this.initialSignature && this.signatureElement) {
|
|
243
251
|
tasks.push(this.drawImageOnCanvas(this.signatureElement, this.initialSignature).then(() => {
|
|
244
252
|
this.hasDrawnSignature = true;
|
|
245
253
|
}));
|
|
246
254
|
}
|
|
247
|
-
if (this.
|
|
255
|
+
if (((_b = this.initialInitialsStrokes) === null || _b === void 0 ? void 0 : _b.length) && this.initialsElement) {
|
|
256
|
+
this.allInitialsStrokes = this.denormalizeStrokes(this.initialInitialsStrokes, this.initialsElement);
|
|
257
|
+
this.hasDrawnInitials = true;
|
|
258
|
+
this.redrawDrawnInitials();
|
|
259
|
+
}
|
|
260
|
+
else if (this.initialInitials && this.initialsElement) {
|
|
248
261
|
tasks.push(this.drawImageOnCanvas(this.initialsElement, this.initialInitials).then(() => {
|
|
249
262
|
this.hasDrawnInitials = true;
|
|
250
263
|
}));
|
|
@@ -383,7 +396,21 @@ const VerdocsAdoptSignatureDialog = class {
|
|
|
383
396
|
e.preventDefault();
|
|
384
397
|
const signature = this.signatureElement.toDataURL('image/png');
|
|
385
398
|
const initials = this.initialsElement.toDataURL('image/png');
|
|
386
|
-
|
|
399
|
+
// Persist the editable source for drawn signatures so a future Edit can replay the exact strokes natively rather
|
|
400
|
+
// than reconstructing them from the bitmap. Typed signatures need no strokes — they re-render from the name.
|
|
401
|
+
const signatureStrokes = this.mode === 'draw' ? this.normalizeStrokes(this.allSigStrokes, this.signatureElement) : [];
|
|
402
|
+
const initialsStrokes = this.mode === 'draw' ? this.normalizeStrokes(this.allInitialsStrokes, this.initialsElement) : [];
|
|
403
|
+
this.next.emit({ signature, initials, mode: this.mode, name: this.enteredName, signatureStrokes, initialsStrokes });
|
|
404
|
+
}
|
|
405
|
+
normalizeStrokes(strokes, canvas) {
|
|
406
|
+
const width = (canvas === null || canvas === void 0 ? void 0 : canvas.width) || 1;
|
|
407
|
+
const height = (canvas === null || canvas === void 0 ? void 0 : canvas.height) || 1;
|
|
408
|
+
return strokes.map(stroke => stroke.map(point => ({ x: point.x / width, y: point.y / height })));
|
|
409
|
+
}
|
|
410
|
+
denormalizeStrokes(strokes, canvas) {
|
|
411
|
+
const width = canvas.width || 1;
|
|
412
|
+
const height = canvas.height || 1;
|
|
413
|
+
return strokes.map(stroke => stroke.map(point => ({ x: point.x * width, y: point.y * height })));
|
|
387
414
|
}
|
|
388
415
|
isAdoptButtonDisabled() {
|
|
389
416
|
switch (this.mode) {
|
|
@@ -512,11 +539,11 @@ const VerdocsAdoptSignatureDialog = class {
|
|
|
512
539
|
};
|
|
513
540
|
}
|
|
514
541
|
render() {
|
|
515
|
-
return (h("verdocs-dialog", { key: '
|
|
542
|
+
return (h("verdocs-dialog", { key: 'ddc22647c01547a474b875c409358e3af2f24e3c', persistent: true, onExit: () => this.exit.emit() }, h("div", { key: 'e8a0089ee73a51008d0aeec9dcc7fca1576104ac', slot: "heading", class: "heading" }, "Adopt Your Signature"), h("div", { key: '2d7c449062e88b4bc25d6762cd6c793992f47f4d', slot: "content", class: "content" }, h("div", { key: 'e8d4ec00383967dc9fe30d773ec2212d93b82975', style: { fontWeight: '300', color: '#242424', fontSize: '13px' } }, "Confirm your name, initials, and signature."), h("div", { key: '0f694d93d6f00feb519841870c0fc6a71194d2ca', class: { type: true, active: this.mode === 'type' } }, h("verdocs-text-input", { key: '0d5513fef5e5572b7f4abf1cbac0a1ca3440463f', label: "Full Name", value: this.enteredName, disabled: this.nameLocked, onInput: e => this.handleNameChange(e), onClick: e => e.stopPropagation() }), this.nameLocked && h("div", { key: 'e89a2f87dcfad2fe8f8f4d48a24223e6ea17383d', class: "name-locked-hint" }, "Your name has been set by the sender and cannot be changed.")), h("div", { key: 'd11ea670ee76e772a38455f30f18cbec98fb395a', style: { fontWeight: '400', color: '#242424', fontSize: '13px' } }, "Select a signature style"), h("div", { key: '3bf1e22f0a9e3bbadd0bf4f0b8a3f1b3896d7315', style: { display: 'flex', flexDirection: 'row', gap: '10px', marginBottom: '6px', alignItems: 'center', fontSize: '13px' } }, h("verdocs-radio-button", { key: '99eef6a79eea724f2ad8e66b9394dd40bc9acfe0', checked: this.mode === 'type', value: "type", name: "mode", onClick: () => this.setMode('type') }), h("label", { key: '04194fdf3a502ffd95b696ed9078ab3982a0caf9' }, "Typed with a keyboard")), h("div", { key: '4e122b72fe041edaf499c5ce9ebabaa5c0883a61', style: { display: 'flex', flexDirection: 'row', gap: '10px', marginBottom: '6px', alignItems: 'center', fontSize: '13px' } }, h("verdocs-radio-button", { key: '4a4f2b7492cdb8118184347613cd27ab4994b4dd', checked: this.mode === 'draw', value: "draw", name: "mode", onClick: () => this.setMode('draw') }), h("label", { key: '86824cda2d7968e30d26426e40f336797776ced2' }, "Drawn with touch, mouse, or stylus")), h("div", { key: '94993f0f41b5099d2e86703e711041939c98eda9', class: "preview-header" }, h("div", { key: '55bad19f2cf23ef7ecb4793f76b95feab654b940', style: { fontSize: '13px', fontWeight: '400' } }, "Signature Preview"), this.mode === 'draw' && (h("button", { key: 'ef4713146fca813bef48f537190c438819ff84a2', class: "clear-button-text", onClick: e => this.handleClearDrawing(e, 'signature'), disabled: !this.hasDrawnSignature }, "Clear"))), h("div", { key: '1e58344a555fe2e224f159f3ef830d46ef362086', class: "canvas-container signature-container" }, h("div", { key: '16fac93400bd3f53e7420222c6ba062d49b5d665', class: "signing-indicator" }, h("div", { key: 'e094b7097e905fd438cebc0d897faf1746eefcc7', class: "x-icon", innerHTML: SignatureXIcon }), h("div", { key: 'a67e3effd1f6db780c8a20d31dedd1940e874062', class: "signing-line" })), h("canvas", { key: '5d6c807b860ac53af851dd85cc655aa797ece1ae', ref: el => (this.signatureElement = el),
|
|
516
543
|
// 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: '
|
|
544
|
+
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: '53953056fcc62dc29bc780400bda01c668d8fc48', class: "preview-header" }, h("div", { key: '554d920b0814e1ada74a0a88310d91b93ac08a5a', style: { fontSize: '13px', fontWeight: '400' } }, "Initials Preview"), this.mode === 'draw' && (h("button", { key: '16db130dd8bdd452e55269ed0670b3ad4b7520f4', class: "clear-button-text", onClick: e => this.handleClearDrawing(e, 'initials'), disabled: !this.hasDrawnInitials }, "Clear"))), h("div", { key: '0e8555d834f009e73b4527b92588d61c4ec20516', class: "canvas-container initials-container" }, h("div", { key: '95292eee946791cc24699d4da2af7df556fd9b34', class: "signing-indicator" }, h("div", { key: 'baba2bc70666d290a93d8c858397da0fa378e65a', class: "x-icon", innerHTML: SignatureXIcon }), h("div", { key: 'ad97b82227759ec6aeaa6735d4ed6355d2ee62e5', class: "signing-line" })), h("canvas", { key: '988f27616ab5bdf37bfba869c612ce75bcde4bd8', ref: el => (this.initialsElement = el),
|
|
518
545
|
// 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: '
|
|
546
|
+
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: 'e1f78a82f1f4418d081efa92a9ddb0440b7c410a', 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: 'a715ffeab244a8f4c68eeab7e4d605a4b0858139', class: "footer", slot: "footer" }, h("div", { key: 'bd07769e1cb702ee6884c72f5d0a005b1844feea', class: "buttons" }, h("button", { key: 'd2905afb693781de51e0e2131368802284a534df', class: "cancel", onClick: e => this.handleCancel(e) }, "Cancel"), h("button", { key: 'a6a5a42a123357c85c9cea004643e33de9caec05', class: "proceed", onClick: e => this.handleAdopt(e), disabled: this.isAdoptButtonDisabled() }, "Adopt & Sign")))));
|
|
520
547
|
}
|
|
521
548
|
};
|
|
522
549
|
VerdocsAdoptSignatureDialog.style = verdocsAdoptSignatureDialogCss;
|
|
@@ -79,6 +79,9 @@ const VerdocsSign = class {
|
|
|
79
79
|
this.signatureAdoptMode = 'type';
|
|
80
80
|
this.adoptedSignaturePreview = null;
|
|
81
81
|
this.adoptedInitialsPreview = null;
|
|
82
|
+
this.adoptedSignatureStrokes = null;
|
|
83
|
+
this.adoptedInitialsStrokes = null;
|
|
84
|
+
this.adoptedName = null;
|
|
82
85
|
this.skippedFields = [];
|
|
83
86
|
this.documentsSingularPlural = 'document';
|
|
84
87
|
this.authStep = null;
|
|
@@ -233,6 +236,9 @@ const VerdocsSign = class {
|
|
|
233
236
|
this.signatureAdoptMode = 'type';
|
|
234
237
|
this.adoptedSignaturePreview = null;
|
|
235
238
|
this.adoptedInitialsPreview = null;
|
|
239
|
+
this.adoptedSignatureStrokes = null;
|
|
240
|
+
this.adoptedInitialsStrokes = null;
|
|
241
|
+
this.adoptedName = null;
|
|
236
242
|
this.submitted = recipient.status === 'submitted';
|
|
237
243
|
this.loading = false;
|
|
238
244
|
this.isDone = this.submitted;
|
|
@@ -403,6 +409,91 @@ const VerdocsSign = class {
|
|
|
403
409
|
}
|
|
404
410
|
});
|
|
405
411
|
}
|
|
412
|
+
toDataUrl(value) {
|
|
413
|
+
return value.startsWith('data:') ? value : `data:image/png;base64,${value}`;
|
|
414
|
+
}
|
|
415
|
+
getAdoptModeStorageKey(signatureBlockId) {
|
|
416
|
+
return `verdocs-adopt-mode:${signatureBlockId}`;
|
|
417
|
+
}
|
|
418
|
+
getAdoptNameStorageKey(signatureBlockId) {
|
|
419
|
+
return `verdocs-adopt-name:${signatureBlockId}`;
|
|
420
|
+
}
|
|
421
|
+
getAdoptStrokesStorageKey(signatureBlockId) {
|
|
422
|
+
return `verdocs-adopt-strokes:${signatureBlockId}`;
|
|
423
|
+
}
|
|
424
|
+
/** Save (or clear) the drawn strokes (normalized 0..1) for a signature/initial block so a later Edit can replay them. */
|
|
425
|
+
persistStrokes(signatureBlockId, strokes) {
|
|
426
|
+
const key = this.getAdoptStrokesStorageKey(signatureBlockId);
|
|
427
|
+
if (strokes && strokes.length > 0) {
|
|
428
|
+
sessionStorage.setItem(key, JSON.stringify(strokes));
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
// Typed signatures (or cleared drawings) have no strokes — make sure a stale entry doesn't linger.
|
|
432
|
+
sessionStorage.removeItem(key);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
/** Read previously saved drawn strokes (normalized 0..1) for a signature/initial block, if any. */
|
|
436
|
+
readStoredStrokes(signatureBlockId) {
|
|
437
|
+
if (!signatureBlockId) {
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
const raw = sessionStorage.getItem(this.getAdoptStrokesStorageKey(signatureBlockId));
|
|
441
|
+
if (!raw) {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
444
|
+
try {
|
|
445
|
+
const parsed = JSON.parse(raw);
|
|
446
|
+
return Array.isArray(parsed) ? parsed : null;
|
|
447
|
+
}
|
|
448
|
+
catch (_a) {
|
|
449
|
+
return null;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Restore adopted signature/initial previews and mode from applied fields or session storage.
|
|
454
|
+
* Clearing a field only removes the stamp from that field — the adopted block still exists.
|
|
455
|
+
*/
|
|
456
|
+
hydrateAdoptedSignatureState(triggerField) {
|
|
457
|
+
var _a, _b, _c, _d, _e;
|
|
458
|
+
const fields = this.getRecipientFields();
|
|
459
|
+
const signatureField = (triggerField === null || triggerField === void 0 ? void 0 : triggerField.type) === 'signature'
|
|
460
|
+
? triggerField
|
|
461
|
+
: 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); });
|
|
462
|
+
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); });
|
|
463
|
+
if ((_a = signatureField === null || signatureField === void 0 ? void 0 : signatureField.settings) === null || _a === void 0 ? void 0 : _a.base64) {
|
|
464
|
+
this.adoptedSignaturePreview = this.toDataUrl(signatureField.settings.base64);
|
|
465
|
+
}
|
|
466
|
+
if ((_b = initialsField === null || initialsField === void 0 ? void 0 : initialsField.settings) === null || _b === void 0 ? void 0 : _b.base64) {
|
|
467
|
+
this.adoptedInitialsPreview = this.toDataUrl(initialsField.settings.base64);
|
|
468
|
+
}
|
|
469
|
+
if ((_c = signatureField === null || signatureField === void 0 ? void 0 : signatureField.settings) === null || _c === void 0 ? void 0 : _c.signature_id) {
|
|
470
|
+
this.signatureId = signatureField.settings.signature_id;
|
|
471
|
+
}
|
|
472
|
+
if ((_d = initialsField === null || initialsField === void 0 ? void 0 : initialsField.settings) === null || _d === void 0 ? void 0 : _d.initial_id) {
|
|
473
|
+
this.initialId = initialsField.settings.initial_id;
|
|
474
|
+
}
|
|
475
|
+
// Restore the editable stroke source (if previously saved this session) so re-opening the dialog replays the exact
|
|
476
|
+
// hand-drawn signature/initials instead of falling back to the rasterized bitmap.
|
|
477
|
+
const storedSignatureStrokes = this.readStoredStrokes(this.signatureId);
|
|
478
|
+
if (storedSignatureStrokes) {
|
|
479
|
+
this.adoptedSignatureStrokes = storedSignatureStrokes;
|
|
480
|
+
}
|
|
481
|
+
const storedInitialsStrokes = this.readStoredStrokes(this.initialId);
|
|
482
|
+
if (storedInitialsStrokes) {
|
|
483
|
+
this.adoptedInitialsStrokes = storedInitialsStrokes;
|
|
484
|
+
}
|
|
485
|
+
const modeSourceId = this.signatureId || ((_e = signatureField === null || signatureField === void 0 ? void 0 : signatureField.settings) === null || _e === void 0 ? void 0 : _e.signature_id);
|
|
486
|
+
if (modeSourceId && this.adoptedSignaturePreview) {
|
|
487
|
+
const storedMode = sessionStorage.getItem(this.getAdoptModeStorageKey(modeSourceId));
|
|
488
|
+
if (storedMode === 'draw' || storedMode === 'type') {
|
|
489
|
+
this.signatureAdoptMode = storedMode;
|
|
490
|
+
}
|
|
491
|
+
const storedName = sessionStorage.getItem(this.getAdoptNameStorageKey(modeSourceId));
|
|
492
|
+
if (storedName) {
|
|
493
|
+
this.adoptedName = storedName;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
406
497
|
getStartedKey() {
|
|
407
498
|
var _a;
|
|
408
499
|
return `${this.envelopeId}:${((_a = this.recipient) === null || _a === void 0 ? void 0 : _a.role_name) || ''}`;
|
|
@@ -567,10 +658,6 @@ const VerdocsSign = class {
|
|
|
567
658
|
}
|
|
568
659
|
if (e.detail === null) {
|
|
569
660
|
console.log('[SIGN] Clearing signature');
|
|
570
|
-
this.signatureId = null;
|
|
571
|
-
this.adoptedSignaturePreview = null;
|
|
572
|
-
this.adoptedInitialsPreview = null;
|
|
573
|
-
this.signatureAdoptMode = 'type';
|
|
574
661
|
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
|
|
575
662
|
this.updateRecipientFieldValue(field.name, updateResult);
|
|
576
663
|
if (field.required)
|
|
@@ -582,6 +669,7 @@ const VerdocsSign = class {
|
|
|
582
669
|
console.log('[SIGN] Reusing signature', this.signatureId);
|
|
583
670
|
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.signatureId, false);
|
|
584
671
|
this.updateRecipientFieldValue(field.name, updateResult);
|
|
672
|
+
this.hydrateAdoptedSignatureState(field);
|
|
585
673
|
this.focusNextFieldAfter(field);
|
|
586
674
|
return;
|
|
587
675
|
}
|
|
@@ -591,6 +679,7 @@ const VerdocsSign = class {
|
|
|
591
679
|
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, e.detail, false);
|
|
592
680
|
this.signatureId = e.detail;
|
|
593
681
|
this.updateRecipientFieldValue(field.name, updateResult);
|
|
682
|
+
this.hydrateAdoptedSignatureState(field);
|
|
594
683
|
this.focusNextFieldAfter(field);
|
|
595
684
|
return;
|
|
596
685
|
}
|
|
@@ -948,6 +1037,7 @@ const VerdocsSign = class {
|
|
|
948
1037
|
});
|
|
949
1038
|
el.addEventListener('adopt', () => {
|
|
950
1039
|
this.focusedField = field.name;
|
|
1040
|
+
this.hydrateAdoptedSignatureState(field);
|
|
951
1041
|
this.updateAllFlags();
|
|
952
1042
|
this.adoptingSignature = true;
|
|
953
1043
|
});
|
|
@@ -1033,7 +1123,7 @@ const VerdocsSign = class {
|
|
|
1033
1123
|
});
|
|
1034
1124
|
}
|
|
1035
1125
|
render() {
|
|
1036
|
-
var _a, _b, _c;
|
|
1126
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1037
1127
|
if (this.showLoadError) {
|
|
1038
1128
|
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
1129
|
window.location.reload();
|
|
@@ -1183,21 +1273,31 @@ const VerdocsSign = class {
|
|
|
1183
1273
|
} })), 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
1274
|
this.showDone = false;
|
|
1185
1275
|
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: (
|
|
1276
|
+
} })), 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, initialSignatureStrokes: (_e = this.adoptedSignatureStrokes) !== null && _e !== void 0 ? _e : undefined, initialInitialsStrokes: (_f = this.adoptedInitialsStrokes) !== null && _f !== void 0 ? _f : undefined, onNext: async (e) => {
|
|
1277
|
+
var _a, _b;
|
|
1187
1278
|
console.log('[SIGN] Adopting signature/initials block', e.detail);
|
|
1188
1279
|
this.showSpinner = true;
|
|
1189
1280
|
this.signatureAdoptMode = e.detail.mode;
|
|
1190
1281
|
this.adoptedSignaturePreview = e.detail.signature;
|
|
1191
1282
|
this.adoptedInitialsPreview = e.detail.initials;
|
|
1283
|
+
this.adoptedSignatureStrokes = ((_a = e.detail.signatureStrokes) === null || _a === void 0 ? void 0 : _a.length) ? e.detail.signatureStrokes : null;
|
|
1284
|
+
this.adoptedInitialsStrokes = ((_b = e.detail.initialsStrokes) === null || _b === void 0 ? void 0 : _b.length) ? e.detail.initialsStrokes : null;
|
|
1285
|
+
this.adoptedName = e.detail.name;
|
|
1192
1286
|
// These arrive as base-64 encoded data URLs
|
|
1193
1287
|
const signatureBlob = await (await fetch(e.detail.signature)).blob();
|
|
1194
1288
|
const initialsBlob = await (await fetch(e.detail.initials)).blob();
|
|
1195
1289
|
const sigResult = await createSignature(this.endpoint, 'signature', signatureBlob);
|
|
1196
1290
|
console.log('[SIGN] Created signature', sigResult);
|
|
1197
1291
|
this.signatureId = sigResult.id;
|
|
1292
|
+
sessionStorage.setItem(this.getAdoptModeStorageKey(sigResult.id), e.detail.mode);
|
|
1293
|
+
sessionStorage.setItem(this.getAdoptNameStorageKey(sigResult.id), e.detail.name);
|
|
1294
|
+
this.persistStrokes(sigResult.id, e.detail.signatureStrokes);
|
|
1198
1295
|
const initResult = await createInitials(this.endpoint, 'initial', initialsBlob);
|
|
1199
1296
|
console.log('[SIGN] Created initials', initResult);
|
|
1200
1297
|
this.initialId = initResult.id;
|
|
1298
|
+
sessionStorage.setItem(this.getAdoptModeStorageKey(initResult.id), e.detail.mode);
|
|
1299
|
+
sessionStorage.setItem(this.getAdoptNameStorageKey(initResult.id), e.detail.name);
|
|
1300
|
+
this.persistStrokes(initResult.id, e.detail.initialsStrokes);
|
|
1201
1301
|
this.showSpinner = false;
|
|
1202
1302
|
this.adoptingSignature = false;
|
|
1203
1303
|
this.markEnvelopeStarted();
|