@verdocs/web-sdk 6.5.0-beta.2 → 6.5.0-beta.3
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/{utils-4rWXSNpE.js → utils-LPO6l9nR.js} +2 -3
- package/dist/{components/p-Btmt1DxH.js.map → cjs/utils-LPO6l9nR.js.map} +1 -1
- package/dist/cjs/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-signing-progress.verdocs-view.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +11 -10
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +39 -2
- package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +76 -17
- package/dist/cjs/verdocs-sign.entry.cjs.js.map +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +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 +11 -10
- 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.css +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +77 -17
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js +38 -1
- package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +39 -1
- package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js.map +1 -1
- package/dist/collection/utils/utils.js +0 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/{p-kbW0me2Y.js → p-0lrmfxFN.js} +3 -3
- package/dist/components/{p-kbW0me2Y.js.map → p-0lrmfxFN.js.map} +1 -1
- package/dist/components/{p-Btmt1DxH.js → p-B3TbYvlU.js} +2 -3
- package/dist/components/p-B3TbYvlU.js.map +1 -0
- package/dist/components/{p-0p8NaKpS.js → p-B9DM7wD0.js} +23 -3
- package/dist/components/p-B9DM7wD0.js.map +1 -0
- package/dist/components/{p-C5xpynM2.js → p-BXwiCpEb.js} +3 -3
- package/dist/components/{p-C5xpynM2.js.map → p-BXwiCpEb.js.map} +1 -1
- package/dist/components/{p-QjwQw9ZJ.js → p-C7xRBNX9.js} +3 -3
- package/dist/components/{p-QjwQw9ZJ.js.map → p-C7xRBNX9.js.map} +1 -1
- package/dist/components/{p-DqqO4T0y.js → p-DCXdeiPc.js} +13 -12
- package/dist/components/p-DCXdeiPc.js.map +1 -0
- package/dist/components/{p-C1KzzI_w.js → p-DNGq3wZS.js} +3 -3
- package/dist/components/{p-C1KzzI_w.js.map → p-DNGq3wZS.js.map} +1 -1
- package/dist/components/{p-Z1wZ6-IT.js → p-DZv79sQs.js} +5 -5
- package/dist/components/{p-Z1wZ6-IT.js.map → p-DZv79sQs.js.map} +1 -1
- package/dist/components/{p-BToCx2ri.js → p-Dl45UNf-.js} +22 -3
- package/dist/components/p-Dl45UNf-.js.map +1 -0
- package/dist/components/{p-Dr4C7GlH.js → p-DzLB0MYu.js} +6 -6
- package/dist/components/{p-Dr4C7GlH.js.map → p-DzLB0MYu.js.map} +1 -1
- package/dist/components/{p-IcDkT207.js → p-INlr_V_p.js} +5 -5
- package/dist/components/{p-IcDkT207.js.map → p-INlr_V_p.js.map} +1 -1
- package/dist/components/{p-_CWDgKqX.js → p-rWeRsA_5.js} +3 -3
- package/dist/components/{p-_CWDgKqX.js.map → p-rWeRsA_5.js.map} +1 -1
- package/dist/components/verdocs-adopt-signature-dialog.js +1 -1
- package/dist/components/verdocs-build.js +7 -7
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-envelope-document-page.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +2 -2
- package/dist/components/verdocs-field-initial.js +1 -1
- package/dist/components/verdocs-field-signature.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-quick-filter.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +82 -22
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-templates-list.js +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/custom-elements.json +2422 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-NHDsmnv8.js → utils-UeubfAI_.js} +2 -3
- package/dist/{esm-es5/utils-NHDsmnv8.js.map → esm/utils-UeubfAI_.js.map} +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-signing-progress.verdocs-view.entry.js.map +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +11 -10
- package/dist/esm/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm/verdocs-envelope-document-page_3.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js +39 -2
- package/dist/esm/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_7.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +76 -17
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{utils-NHDsmnv8.js → utils-UeubfAI_.js} +2 -2
- package/dist/{esm/utils-NHDsmnv8.js.map → esm-es5/utils-UeubfAI_.js.map} +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-dialog.verdocs-signing-progress.verdocs-view.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js +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-template-document-page_2.entry.js +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 +1 -0
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +3 -2
- package/dist/types/components/fields/verdocs-field-initial/verdocs-field-initial.d.ts +5 -0
- package/dist/types/components/fields/verdocs-field-signature/verdocs-field-signature.d.ts +5 -0
- package/dist/types/components.d.ts +16 -0
- package/dist/verdocs-web-sdk/p-0029decb.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-0029decb.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-2439e530.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-2439e530.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7e580691.entry.js → p-2898f573.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-94e4d921.system.entry.js → p-2ecec6ed.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2adc75a7.system.entry.js → p-415fa16f.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-0c567c7d.entry.js → p-464ef358.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-fe64576a.system.entry.js → p-46991fe7.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9a7a9d7b.system.entry.js → p-4a19fbe3.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-0b57c1ef.system.entry.js → p-605b48fa.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-64d8ea72.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-64d8ea72.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-64e896e9.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-64e896e9.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-0709e936.system.entry.js → p-78e8e398.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-99ba5e3b.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-99ba5e3b.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-303ed47f.entry.js → p-9cdc0980.entry.js} +3 -3
- package/dist/verdocs-web-sdk/{p-BRVQ3Epx.system.js.map → p-B0XOGp0Z.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-BU5y2rcs.system.js → p-BAU98X36.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-BU5y2rcs.system.js.map → p-BAU98X36.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BgTW-H9_.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-CAlOUHPb.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-nK4J4UFK.js → p-CmnR51jO.js} +2 -2
- package/dist/verdocs-web-sdk/{p-nK4J4UFK.js.map → p-CmnR51jO.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-CogJ52UV.system.js.map → p-D-LZAEE-.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-Dj3cajbH.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-B_fwtKg3.system.js.map → p-O_JBau3u.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-B8lqLcUJ.system.js.map → p-XPySISfx.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-831ff4eb.entry.js → p-ab8ba727.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d06e0bce.entry.js → p-ae75565d.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-acc245e6.entry.js → p-d5fc15ee.entry.js} +3 -3
- package/dist/verdocs-web-sdk/p-db5c9ec4.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-db5c9ec4.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-CyjSP4tG.system.js.map → p-k2jmkyZp.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-C9hmmFhm.system.js.map → p-xFl_XV91.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/verdocs-adopt-signature-dialog.verdocs-delegate-dialog.verdocs-disclosure-dialog.verdocs-kba-dialog.verdocs-otp-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 +2 -2
- package/dist/cjs/utils-4rWXSNpE.js.map +0 -1
- package/dist/components/p-0p8NaKpS.js.map +0 -1
- package/dist/components/p-BToCx2ri.js.map +0 -1
- package/dist/components/p-DqqO4T0y.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0dfacde9.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-0dfacde9.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3c45dd79.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-3c45dd79.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-8ad09d97.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-8ad09d97.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-BcrrIlhF.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-DZW111-z.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-c676d027.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c676d027.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-dc1eaf38.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-dc1eaf38.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-fef8b6b5.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-fef8b6b5.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-gCoMHihf.system.js.map +0 -1
- /package/dist/verdocs-web-sdk/{p-7e580691.entry.js.map → p-2898f573.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-94e4d921.system.entry.js.map → p-2ecec6ed.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-2adc75a7.system.entry.js.map → p-415fa16f.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-0c567c7d.entry.js.map → p-464ef358.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-fe64576a.system.entry.js.map → p-46991fe7.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-9a7a9d7b.system.entry.js.map → p-4a19fbe3.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-0b57c1ef.system.entry.js.map → p-605b48fa.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-0709e936.system.entry.js.map → p-78e8e398.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-303ed47f.entry.js.map → p-9cdc0980.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-831ff4eb.entry.js.map → p-ab8ba727.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-d06e0bce.entry.js.map → p-ae75565d.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-acc245e6.entry.js.map → p-d5fc15ee.entry.js.map} +0 -0
|
@@ -78,11 +78,13 @@ export class VerdocsSign {
|
|
|
78
78
|
this.submitted = false;
|
|
79
79
|
this.isDone = false;
|
|
80
80
|
this.showDone = false;
|
|
81
|
-
this.
|
|
81
|
+
this.adoptingSignature = false;
|
|
82
82
|
this.showLoadError = false;
|
|
83
83
|
this.finishLater = false;
|
|
84
84
|
this.showFinishLater = false;
|
|
85
85
|
this.agreed = false;
|
|
86
|
+
this.signatureId = null;
|
|
87
|
+
this.initialId = null;
|
|
86
88
|
this.documentsSingularPlural = 'document';
|
|
87
89
|
this.authStep = null;
|
|
88
90
|
this.authMethodStates = {};
|
|
@@ -91,7 +93,6 @@ export class VerdocsSign {
|
|
|
91
93
|
this.declining = false;
|
|
92
94
|
this.delegating = false;
|
|
93
95
|
this.delegated = false;
|
|
94
|
-
this.startedSigning = false;
|
|
95
96
|
this.kbaChoices = [];
|
|
96
97
|
this.loading = true;
|
|
97
98
|
this.envelope = null;
|
|
@@ -134,7 +135,7 @@ export class VerdocsSign {
|
|
|
134
135
|
}
|
|
135
136
|
}
|
|
136
137
|
processAuthResponse(response) {
|
|
137
|
-
var _a, _b, _c;
|
|
138
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
138
139
|
const { envelope, recipient } = response;
|
|
139
140
|
const { auth_step } = recipient;
|
|
140
141
|
this.recipient = recipient;
|
|
@@ -143,6 +144,8 @@ export class VerdocsSign {
|
|
|
143
144
|
this.authStep = auth_step;
|
|
144
145
|
this.delegated = !!recipient.delegated_to;
|
|
145
146
|
this.agreed = recipient.agreed;
|
|
147
|
+
this.signatureId = ((_d = (_c = response.signatures) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.id) || null;
|
|
148
|
+
this.initialId = ((_f = (_e = response.initials) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.id) || null;
|
|
146
149
|
this.submitted = recipient.status === 'submitted';
|
|
147
150
|
this.loading = false;
|
|
148
151
|
this.isDone = this.submitted;
|
|
@@ -172,7 +175,7 @@ export class VerdocsSign {
|
|
|
172
175
|
this.nextButtonLabel = 'Next';
|
|
173
176
|
}
|
|
174
177
|
this.checkRecipientFields();
|
|
175
|
-
(
|
|
178
|
+
(_g = this.envelopeLoaded) === null || _g === void 0 ? void 0 : _g.emit({ endpoint: this.endpoint, envelope: this.envelope });
|
|
176
179
|
}
|
|
177
180
|
handleClickAgree() {
|
|
178
181
|
this.submitting = true;
|
|
@@ -284,15 +287,35 @@ export class VerdocsSign {
|
|
|
284
287
|
// This can be caused by a focus-out event if the user clicks the field
|
|
285
288
|
// after it's already filled in, then clicks something else like a textbox.
|
|
286
289
|
// We don't visually indicate the focus, but it's still there.
|
|
287
|
-
|
|
290
|
+
// NOTE: We now allow null to clear the field
|
|
291
|
+
if (e.detail === undefined) {
|
|
288
292
|
return;
|
|
289
293
|
}
|
|
294
|
+
if (e.detail === null) {
|
|
295
|
+
console.log('[SIGN] Clearing initial');
|
|
296
|
+
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
|
|
297
|
+
return this.updateRecipientFieldValue(field.name, updateResult);
|
|
298
|
+
}
|
|
299
|
+
// If we already have an initials block, apply it
|
|
300
|
+
if (this.initialId) {
|
|
301
|
+
console.log('[SIGN] Reusing initial', this.initialId);
|
|
302
|
+
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.initialId, false);
|
|
303
|
+
return this.updateRecipientFieldValue(field.name, updateResult);
|
|
304
|
+
}
|
|
305
|
+
// If it's a UUID, it's an existing initial ID we can just reuse
|
|
306
|
+
if (typeof e.detail === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e.detail)) {
|
|
307
|
+
console.log('[SIGN] Reusing initial', e.detail);
|
|
308
|
+
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, e.detail, false);
|
|
309
|
+
this.initialId = e.detail;
|
|
310
|
+
return this.updateRecipientFieldValue(field.name, updateResult);
|
|
311
|
+
}
|
|
290
312
|
this.showSpinner = true;
|
|
291
313
|
const initialsBlob = await (await fetch(e.detail)).blob();
|
|
292
314
|
return createInitials(this.endpoint, 'initial', initialsBlob) //
|
|
293
315
|
.then(async (newInitials) => {
|
|
294
316
|
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, newInitials.id, false);
|
|
295
317
|
this.updateRecipientFieldValue(field.name, updateResult);
|
|
318
|
+
this.initialId = newInitials.id;
|
|
296
319
|
this.showSpinner = false;
|
|
297
320
|
})
|
|
298
321
|
.catch(e => {
|
|
@@ -304,16 +327,37 @@ export class VerdocsSign {
|
|
|
304
327
|
// This can be caused by a focus-out event if the user clicks the field
|
|
305
328
|
// after it's already filled in, then clicks something else like a textbox.
|
|
306
329
|
// We don't visually indicate the focus, but it's still there.
|
|
307
|
-
|
|
330
|
+
// NOTE: We now allow null to clear the field
|
|
331
|
+
if (e.detail === undefined) {
|
|
308
332
|
return;
|
|
309
333
|
}
|
|
334
|
+
if (e.detail === null) {
|
|
335
|
+
console.log('[SIGN] Clearing signature');
|
|
336
|
+
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, null, false);
|
|
337
|
+
return this.updateRecipientFieldValue(field.name, updateResult);
|
|
338
|
+
}
|
|
339
|
+
// If we already have a signature block, apply it
|
|
340
|
+
if (this.signatureId) {
|
|
341
|
+
console.log('[SIGN] Reusing signature', this.signatureId);
|
|
342
|
+
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.signatureId, false);
|
|
343
|
+
return this.updateRecipientFieldValue(field.name, updateResult);
|
|
344
|
+
}
|
|
345
|
+
// If it's a UUID, it's an existing signature ID we can just reuse
|
|
346
|
+
if (typeof e.detail === 'string' && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e.detail)) {
|
|
347
|
+
console.log('[SIGN] Reusing signature', e.detail);
|
|
348
|
+
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, e.detail, false);
|
|
349
|
+
this.signatureId = e.detail;
|
|
350
|
+
return this.updateRecipientFieldValue(field.name, updateResult);
|
|
351
|
+
}
|
|
310
352
|
this.showSpinner = true;
|
|
311
353
|
const signatureBlob = await (await fetch(e.detail)).blob();
|
|
354
|
+
console.log('[SIGN] Creating new signature');
|
|
312
355
|
return createSignature(this.endpoint, 'signature', signatureBlob) //
|
|
313
356
|
.then(async (newSignature) => {
|
|
314
357
|
console.log('Signature update result', newSignature);
|
|
315
358
|
const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, newSignature.id, false);
|
|
316
359
|
this.updateRecipientFieldValue(field.name, updateResult);
|
|
360
|
+
this.signatureId = newSignature.id;
|
|
317
361
|
this.showSpinner = false;
|
|
318
362
|
})
|
|
319
363
|
.catch(e => {
|
|
@@ -525,7 +569,6 @@ export class VerdocsSign {
|
|
|
525
569
|
showSkip = true;
|
|
526
570
|
}
|
|
527
571
|
}
|
|
528
|
-
console.log('[SIGN] Render flag', winner.name, winner.y, winner.height);
|
|
529
572
|
renderDocumentFlag(pageInfo, winner.y, winner.height || defaultHeight(winner.type), {
|
|
530
573
|
variant,
|
|
531
574
|
label,
|
|
@@ -619,6 +662,12 @@ export class VerdocsSign {
|
|
|
619
662
|
const fullName = formatFullName(this.recipient);
|
|
620
663
|
el.setAttribute('initials', fullNameToInitials(fullName));
|
|
621
664
|
el.setAttribute('name', fullName);
|
|
665
|
+
if (this.signatureId) {
|
|
666
|
+
el.setAttribute('signatureid', this.signatureId);
|
|
667
|
+
}
|
|
668
|
+
if (this.initialId) {
|
|
669
|
+
el.setAttribute('initialid', this.initialId);
|
|
670
|
+
}
|
|
622
671
|
}
|
|
623
672
|
handlePageRendered(e) {
|
|
624
673
|
const pageInfo = e.detail;
|
|
@@ -795,9 +844,9 @@ export class VerdocsSign {
|
|
|
795
844
|
: console.log('[SIGN] All field valid');
|
|
796
845
|
return (h(Host, null, h("div", { id: "verdocs-sign-header" }, h("div", { class: "inner" }, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, this.envelope.name), h("div", { style: { flex: '1' } }), !this.finishLater && h("verdocs-button", { size: "xsmall", label: this.nextButtonLabel, disabled: !this.agreed || this.submitting, onClick: () => this.handleNext() }), h("div", { style: { marginLeft: '10px' } }), h("verdocs-dropdown", { options: !this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions, onOptionSelected: e => this.handleOptionSelected(e) }))), (() => {
|
|
797
846
|
const focusedFieldObj = this.getSortedFillableFields().find(f => f.name === this.focusedField);
|
|
798
|
-
return (h("verdocs-signing-progress", { mode: this.nextSubmits ? 'completed' : this.
|
|
799
|
-
this.
|
|
800
|
-
this.handleNext();
|
|
847
|
+
return (h("verdocs-signing-progress", { mode: this.nextSubmits ? 'completed' : false && this.signatureId && this.initialId ? 'signing' : 'start', current: Math.max(1, this.getSortedFillableFields().findIndex(f => f.name === this.focusedField) + 1), total: this.getSortedFillableFields().length, fieldLabel: (focusedFieldObj === null || focusedFieldObj === void 0 ? void 0 : focusedFieldObj.label) || (focusedFieldObj === null || focusedFieldObj === void 0 ? void 0 : focusedFieldObj.name) || '', fieldCompleted: focusedFieldObj ? !!isFieldFilled(focusedFieldObj, this.getRecipientFields()) : false, onStarted: () => {
|
|
848
|
+
this.adoptingSignature = true;
|
|
849
|
+
// this.handleNext();
|
|
801
850
|
}, onNext: () => this.handleNext(), onPrevious: () => this.handlePrev(), onExit: () => this.handleNext() }));
|
|
802
851
|
})(), h("div", { class: "document", style: { width: '64%', marginLeft: '260px' } }, (this.envelope.documents || []).map(envelopeDocument => {
|
|
803
852
|
const pageNumbers = integerSequence(1, envelopeDocument.pages);
|
|
@@ -822,11 +871,21 @@ export class VerdocsSign {
|
|
|
822
871
|
} })), 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 document and envelope certificate attached.`, onNext: () => {
|
|
823
872
|
this.showDone = false;
|
|
824
873
|
this.isDone = true;
|
|
825
|
-
} })), this.
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
874
|
+
} })), this.adoptingSignature && (h("verdocs-adopt-signature-dialog", { name: formatFullName(this.recipient), onNext: async (e) => {
|
|
875
|
+
console.log('[SIGN] Adopting signature/initials block', e.detail);
|
|
876
|
+
this.showSpinner = true;
|
|
877
|
+
// These arrive as base-64 encoded data URLs
|
|
878
|
+
const signatureBlob = await (await fetch(e.detail.signature)).blob();
|
|
879
|
+
const initialsBlob = await (await fetch(e.detail.initials)).blob();
|
|
880
|
+
const sigResult = await createSignature(this.endpoint, 'signature', signatureBlob);
|
|
881
|
+
console.log('[SIGN] Created signature', sigResult);
|
|
882
|
+
this.signatureId = sigResult.id;
|
|
883
|
+
const initResult = await createInitials(this.endpoint, 'initial', initialsBlob);
|
|
884
|
+
console.log('[SIGN] Created initials', initResult);
|
|
885
|
+
this.initialId = initResult.id;
|
|
886
|
+
this.showSpinner = false;
|
|
887
|
+
this.adoptingSignature = false;
|
|
888
|
+
}, onExit: () => (this.adoptingSignature = false) })), (this.submitting || this.showSpinner) && (h("verdocs-portal", null, h("div", { class: "spinner-overlay" }, h("verdocs-spinner", null)))), !this.loading && !this.isDone && (h("verdocs-sign-footer", { endpoint: this.endpoint, envelopeId: this.envelopeId, isDone: this.isDone, onAskQuestion: (e) => {
|
|
830
889
|
askQuestion(this.endpoint, this.envelopeId, this.roleId, { question: e.detail.question })
|
|
831
890
|
.then(() => VerdocsToast('Your question has been sent.', { style: 'success' }))
|
|
832
891
|
.catch(e => {
|
|
@@ -968,11 +1027,13 @@ export class VerdocsSign {
|
|
|
968
1027
|
"submitted": {},
|
|
969
1028
|
"isDone": {},
|
|
970
1029
|
"showDone": {},
|
|
971
|
-
"
|
|
1030
|
+
"adoptingSignature": {},
|
|
972
1031
|
"showLoadError": {},
|
|
973
1032
|
"finishLater": {},
|
|
974
1033
|
"showFinishLater": {},
|
|
975
1034
|
"agreed": {},
|
|
1035
|
+
"signatureId": {},
|
|
1036
|
+
"initialId": {},
|
|
976
1037
|
"documentsSingularPlural": {},
|
|
977
1038
|
"authStep": {},
|
|
978
1039
|
"authMethodStates": {},
|
|
@@ -981,7 +1042,6 @@ export class VerdocsSign {
|
|
|
981
1042
|
"declining": {},
|
|
982
1043
|
"delegating": {},
|
|
983
1044
|
"delegated": {},
|
|
984
|
-
"startedSigning": {},
|
|
985
1045
|
"kbaChoices": {},
|
|
986
1046
|
"loading": {},
|
|
987
1047
|
"envelope": {}
|