@verdocs/web-sdk 6.5.0-beta.22 → 6.5.0-beta.23

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.
@@ -504,14 +504,14 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
504
504
  sortFields(recipientFields);
505
505
  return recipientFields;
506
506
  }
507
- handleNext() {
507
+ async handleNext() {
508
508
  var _a;
509
509
  if (this.nextSubmits) {
510
510
  try {
511
511
  // Patches the date picker to be forcibly removed if still showing during submission
512
512
  (_a = document.getElementById('air-datepicker-global-container')) === null || _a === void 0 ? void 0 : _a.remove();
513
513
  this.submitting = true;
514
- const result = envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);
514
+ const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);
515
515
  console.log('[SIGN] Submitted successfully', result);
516
516
  // TODO: The "proper" way is generating an error from Stencil
517
517
  // NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which
@@ -520,6 +520,8 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
520
520
  }
521
521
  catch (e) {
522
522
  console.log('[SIGN] Error submitting', e);
523
+ this.submitting = false;
524
+ VerdocsToast('Unable to submit document, please try again.', { style: 'error' });
523
525
  }
524
526
  return;
525
527
  }
@@ -991,22 +993,6 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
991
993
  this.initialId = initResult.id;
992
994
  this.showSpinner = false;
993
995
  this.adoptingSignature = false;
994
- // If we have a focused field, we should auto-apply the new signature/initials to it
995
- if (this.focusedField) {
996
- const field = this.getRecipientFields().find(f => f.name === this.focusedField);
997
- if (field) {
998
- console.log('[SIGN] Auto-applying adopted signature to focused field', field.name);
999
- if (field.type === 'signature') {
1000
- const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.signatureId, false);
1001
- this.updateRecipientFieldValue(field.name, updateResult);
1002
- }
1003
- else if (field.type === 'initial') {
1004
- const updateResult = await updateEnvelopeField(this.endpoint, this.envelopeId, this.roleId, field.name, this.initialId, false);
1005
- this.updateRecipientFieldValue(field.name, updateResult);
1006
- }
1007
- this.checkRecipientFields();
1008
- }
1009
- }
1010
996
  }, onExit: () => (this.adoptingSignature = false) })), (this.submitting || this.showSpinner) && (h("verdocs-portal", null, h("div", { class: "spinner-overlay" }, h("verdocs-spinner", null)))), this.showDownloadDialog && (h("verdocs-download-dialog", { hasCertificate: (_b = (_a = this.envelope) === null || _a === void 0 ? void 0 : _a.documents) === null || _b === void 0 ? void 0 : _b.some(d => d.type === 'certificate'), onExit: () => (this.showDownloadDialog = false), onNext: async (e) => {
1011
997
  this.showDownloadDialog = false;
1012
998
  const { action } = e.detail;
@@ -1020,15 +1006,6 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
1020
1006
  window.open(url, '_blank');
1021
1007
  }
1022
1008
  else {
1023
- // If multiple docs, we might want to zip them or just download the first one for now as per previous logic?
1024
- // The requirement says "Document", implies the PDF.
1025
- // Users might have multiple files though.
1026
- // For now let's just do the zip of everything if multiple? Or loop?
1027
- // Let's stick to the previous behavior "firstDoc" strategy if we can't do better,
1028
- // or use getEnvelopeDocumentDownloadLink for each?
1029
- // Best user experience for "Document" if multiple is probably just the first one or a zip of docs.
1030
- // But "All Files" covers zip.
1031
- // Let's assume the main document is the primary intent.
1032
1009
  const firstDoc = attachments[0];
1033
1010
  if (firstDoc) {
1034
1011
  const url = await getEnvelopeDocumentDownloadLink(this.endpoint, firstDoc.id);