@verdocs/web-sdk 4.2.110 → 4.2.112

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 (60) hide show
  1. package/dist/cjs/index-a27a7f77.js +4 -8
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +6 -6
  4. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +27 -15
  5. package/dist/cjs/{verdocs-view.cjs.entry.js → verdocs-kba-dialog_2.cjs.entry.js} +39 -0
  6. package/dist/cjs/verdocs-sign.cjs.entry.js +24 -3
  7. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  8. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +18 -1
  9. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +27 -5
  10. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +6 -6
  11. package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js +28 -15
  12. package/dist/components/verdocs-auth.js +1 -1
  13. package/dist/components/verdocs-envelope-sidebar.js +6 -6
  14. package/dist/components/verdocs-field-attachment2.js +28 -15
  15. package/dist/components/verdocs-kba-dialog.js +1 -69
  16. package/dist/{esm/verdocs-kba-dialog.entry.js → components/verdocs-kba-dialog2.js} +37 -7
  17. package/dist/components/verdocs-sign.js +41 -13
  18. package/dist/custom-elements.json +2044 -0
  19. package/dist/esm/index-a68c7262.js +4 -8
  20. package/dist/esm/loader.js +1 -1
  21. package/dist/esm/verdocs-envelope-sidebar.entry.js +6 -6
  22. package/dist/esm/verdocs-field-attachment_13.entry.js +27 -15
  23. package/dist/esm/{verdocs-view.entry.js → verdocs-kba-dialog_2.entry.js} +40 -2
  24. package/dist/esm/verdocs-sign.entry.js +25 -4
  25. package/dist/esm/verdocs-web-sdk.js +1 -1
  26. package/dist/esm-es5/index-a68c7262.js +1 -1
  27. package/dist/esm-es5/loader.js +1 -1
  28. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  29. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  30. package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +1 -0
  31. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  32. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  33. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +4 -1
  34. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
  35. package/dist/types/components/fields/verdocs-field-attachment/verdocs-field-attachment.d.ts +3 -2
  36. package/dist/types/components.d.ts +8 -0
  37. package/dist/verdocs-web-sdk/p-0dc92b1c.system.entry.js +1 -0
  38. package/dist/verdocs-web-sdk/p-12f6450a.entry.js +1 -0
  39. package/dist/verdocs-web-sdk/p-267df026.system.js +1 -1
  40. package/dist/verdocs-web-sdk/p-2c43aa85.system.entry.js +1 -0
  41. package/dist/verdocs-web-sdk/p-43d82aaa.system.entry.js +1 -0
  42. package/dist/verdocs-web-sdk/p-707322d0.entry.js +1 -0
  43. package/dist/verdocs-web-sdk/p-85114f35.system.entry.js +1 -0
  44. package/dist/verdocs-web-sdk/p-a7c89171.entry.js +1 -0
  45. package/dist/verdocs-web-sdk/p-ecd14df7.entry.js +1 -0
  46. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  47. package/package.json +1 -1
  48. package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +0 -45
  49. package/dist/esm-es5/verdocs-kba-dialog.entry.js +0 -1
  50. package/dist/esm-es5/verdocs-view.entry.js +0 -1
  51. package/dist/verdocs-web-sdk/p-0be3e7a7.entry.js +0 -1
  52. package/dist/verdocs-web-sdk/p-21481ed6.entry.js +0 -1
  53. package/dist/verdocs-web-sdk/p-3a69494d.system.entry.js +0 -1
  54. package/dist/verdocs-web-sdk/p-4755c31a.entry.js +0 -1
  55. package/dist/verdocs-web-sdk/p-4c7da20d.system.entry.js +0 -1
  56. package/dist/verdocs-web-sdk/p-545dda43.system.entry.js +0 -1
  57. package/dist/verdocs-web-sdk/p-5cc1a52a.system.entry.js +0 -1
  58. package/dist/verdocs-web-sdk/p-5fc9541b.entry.js +0 -1
  59. package/dist/verdocs-web-sdk/p-9c496734.system.entry.js +0 -1
  60. package/dist/verdocs-web-sdk/p-c00c794f.entry.js +0 -1
@@ -1,13 +1,14 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host, Fragment } from '@stencil/core/internal/client';
2
- import { VerdocsEndpoint, startSigningSession, getKbaStep, envelopeRecipientAgree, envelopeRecipientDecline, getEnvelope, updateEnvelopeField, createSignature, updateEnvelopeFieldSignature, createInitials, updateEnvelopeFieldInitials, isValidPhone, isValidEmail, envelopeRecipientSubmit, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, formatFullName, fullNameToInitials, integerSequence } from '@verdocs/js-sdk';
2
+ import { VerdocsEndpoint, startSigningSession, getKbaStep, envelopeRecipientAgree, envelopeRecipientDecline, getEnvelope, updateEnvelopeField, createSignature, updateEnvelopeFieldSignature, createInitials, updateEnvelopeFieldInitials, isValidPhone, isValidEmail, envelopeRecipientSubmit, uploadEnvelopeFieldAttachment, deleteEnvelopeFieldAttachment, formatFullName, fullNameToInitials, submitKbaPin, integerSequence } from '@verdocs/js-sdk';
3
3
  import { a as saveAttachment, u as updateDocumentFieldValue, r as renderDocumentField, g as getFieldId } from './utils.js';
4
4
  import { c as createTemplateFieldStoreFromEnvelope } from './TemplateFieldStore.js';
5
5
  import { V as VerdocsToast } from './Toast.js';
6
6
  import { S as SDKError } from './errors.js';
7
- import { d as defineCustomElement$9 } from './verdocs-button2.js';
8
- import { d as defineCustomElement$8 } from './verdocs-checkbox2.js';
9
- import { d as defineCustomElement$7 } from './verdocs-dropdown2.js';
10
- import { d as defineCustomElement$6 } from './verdocs-envelope-document-page2.js';
7
+ import { d as defineCustomElement$a } from './verdocs-button2.js';
8
+ import { d as defineCustomElement$9 } from './verdocs-checkbox2.js';
9
+ import { d as defineCustomElement$8 } from './verdocs-dropdown2.js';
10
+ import { d as defineCustomElement$7 } from './verdocs-envelope-document-page2.js';
11
+ import { d as defineCustomElement$6 } from './verdocs-kba-dialog2.js';
11
12
  import { d as defineCustomElement$5 } from './verdocs-loader2.js';
12
13
  import { d as defineCustomElement$4 } from './verdocs-ok-dialog2.js';
13
14
  import { d as defineCustomElement$3 } from './verdocs-portal2.js';
@@ -60,6 +61,7 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
60
61
  this.showFinishLater = false;
61
62
  this.agreed = false;
62
63
  this.documentsSingularPlural = 'document';
64
+ this.kbaStep = '';
63
65
  }
64
66
  componentWillLoad() {
65
67
  if (!this.endpoint) {
@@ -117,6 +119,7 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
117
119
  getKbaStep(this.endpoint, this.envelopeId, this.roleId)
118
120
  .then(r => {
119
121
  console.log('[SIGN] KBA Step', r);
122
+ this.kbaStep = r.kba_step;
120
123
  })
121
124
  .catch(e => console.log('Error getting KBA step', e));
122
125
  }
@@ -547,7 +550,26 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
547
550
  this.isDone = true;
548
551
  } })), this.submitting && (h("div", { class: "loading-indicator" }, h("verdocs-loader", null)))));
549
552
  }
550
- return (h(Host, { class: { agreed: this.agreed } }, 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.agreed && !this.finishLater && h("verdocs-button", { size: "small", label: this.nextButtonLabel, disabled: !this.agreed, onClick: () => this.handleNext() }), h("div", { style: { marginLeft: '10px' } }), this.agreed && (h("verdocs-dropdown", { options: !this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions, onOptionSelected: e => this.handleOptionSelected(e) })))), this.agreed ? (h("div", { class: "document", style: { paddingTop: '15px' } }, (this.envelope.documents || []).map(envelopeDocument => {
553
+ if (!this.agreed) {
554
+ return (h(Host, { class: "agreed" }, 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", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "agree" }, h("verdocs-checkbox", { name: "agree", label: "By checking this box, you:", onInput: () => this.handleClickAgree() }), h("ul", null, h("li", null, "Agree to use electronic records and signatures, and confirm you have read the", ' ', h("a", { href: "https://verdocs.com/en/electronic-record-signature-disclosure/", target: "_blank" }, "Electronic Record and Signatures Disclosure"), "."), h("li", null, "Agree to Verdocs'", ' ', h("a", { href: "https://verdocs.com/en/eula", target: "_blank" }, "End User License Agreement"), ' ', "and confirm you have read Verdocs'", ' ', h("a", { href: "https://verdocs.com/en/privacy-policy/", target: "_blank" }, "Privacy Policy"), "."))))));
555
+ }
556
+ if (this.kbaStep === 'pin') {
557
+ return (h(Host, { class: "kba" }, 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", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" })), h("div", { class: "cover" }, h("div", { class: "kba" }, h("verdocs-kba-dialog", { mode: "text", step: 1, steps: 1, helptitle: "Document is protected by a PIN code", helptext: "Please enter your PIN code to proceed. If you do not have one, please contact the sender.", label: "PIN Code", onNext: async (e) => {
558
+ submitKbaPin(this.endpoint, this.envelopeId, this.roleId, e.detail)
559
+ .then(r => {
560
+ console.log('[SIGN] PIN code submission result', r);
561
+ if (r.kba_step === 'complete') {
562
+ this.kbaStep = '';
563
+ }
564
+ })
565
+ .catch(e => {
566
+ var _a, _b;
567
+ console.log('[SIGN] Error submitting PIN', e);
568
+ VerdocsToast(((_b = (_a = e.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || 'Unable to verify PIN code. Please try again.', { style: 'error' });
569
+ });
570
+ } })))));
571
+ }
572
+ 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: "small", label: this.nextButtonLabel, disabled: !this.agreed, onClick: () => this.handleNext() }), h("div", { style: { marginLeft: '10px' } }), h("verdocs-dropdown", { options: !this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions, onOptionSelected: e => this.handleOptionSelected(e) }))), h("div", { class: "document", style: { paddingTop: '15px' } }, (this.envelope.documents || []).map(envelopeDocument => {
551
573
  const pageNumbers = integerSequence(1, envelopeDocument.pages);
552
574
  return (h(Fragment, null, pageNumbers.map(pageNumber => {
553
575
  // In signing mode we show the original template page with all the recipient fields so we can show source formatting and
@@ -563,10 +585,10 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
563
585
  { name: 'controls', type: 'div' },
564
586
  ] }));
565
587
  })));
566
- }))) : (h("div", { class: "document", style: { paddingTop: '15px' } }, h("img", { src: "https://public-assets.verdocs.com/loading-placeholder.png", style: { width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px' }, alt: "Placeholder page" }))), this.showFinishLater && (h("verdocs-ok-dialog", { heading: "You've saved your document to finish later.", message: `To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`, onNext: () => (this.showFinishLater = false) })), this.errorMessage && h("verdocs-ok-dialog", { heading: "Network Error", message: this.errorMessage, onNext: () => (this.errorMessage = '') }), 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: () => {
588
+ })), this.showFinishLater && (h("verdocs-ok-dialog", { heading: "You've saved your document to finish later.", message: `To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`, onNext: () => (this.showFinishLater = false) })), this.errorMessage && h("verdocs-ok-dialog", { heading: "Network Error", message: this.errorMessage, onNext: () => (this.errorMessage = '') }), 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: () => {
567
589
  this.showDone = false;
568
590
  this.isDone = true;
569
- } })), this.submitting && (h("div", { class: "loading-indicator" }, h("verdocs-loader", null))), !this.agreed && (h("div", { class: "cover" }, h("div", { class: "agree" }, h("verdocs-checkbox", { name: "agree", label: "By checking this box, you:", onInput: () => this.handleClickAgree() }), h("ul", null, h("li", null, "Agree to use electronic records and signatures, and confirm you have read the", ' ', h("a", { href: "https://verdocs.com/en/electronic-record-signature-disclosure/", target: "_blank" }, "Electronic Record and Signatures Disclosure"), "."), h("li", null, "Agree to Verdocs", ' ', h("a", { href: "https://verdocs.com/en/eula", target: "_blank" }, "End User License Agreement"), ' ', "and confirm you have read Verdocs'", ' ', h("a", { href: "https://verdocs.com/en/privacy-policy/", target: "_blank" }, "Privacy Policy"), ".")))))));
591
+ } })), this.submitting && (h("div", { class: "loading-indicator" }, h("verdocs-loader", null)))));
570
592
  }
571
593
  static get style() { return VerdocsSignStyle0; }
572
594
  }, [0, "verdocs-sign", {
@@ -594,13 +616,14 @@ const VerdocsSign$1 = /*@__PURE__*/ proxyCustomElement(class VerdocsSign extends
594
616
  "finishLater": [32],
595
617
  "showFinishLater": [32],
596
618
  "agreed": [32],
597
- "documentsSingularPlural": [32]
619
+ "documentsSingularPlural": [32],
620
+ "kbaStep": [32]
598
621
  }]);
599
622
  function defineCustomElement$1() {
600
623
  if (typeof customElements === "undefined") {
601
624
  return;
602
625
  }
603
- const components = ["verdocs-sign", "verdocs-button", "verdocs-checkbox", "verdocs-dropdown", "verdocs-envelope-document-page", "verdocs-loader", "verdocs-ok-dialog", "verdocs-portal", "verdocs-view"];
626
+ const components = ["verdocs-sign", "verdocs-button", "verdocs-checkbox", "verdocs-dropdown", "verdocs-envelope-document-page", "verdocs-kba-dialog", "verdocs-loader", "verdocs-ok-dialog", "verdocs-portal", "verdocs-view"];
604
627
  components.forEach(tagName => { switch (tagName) {
605
628
  case "verdocs-sign":
606
629
  if (!customElements.get(tagName)) {
@@ -609,20 +632,25 @@ function defineCustomElement$1() {
609
632
  break;
610
633
  case "verdocs-button":
611
634
  if (!customElements.get(tagName)) {
612
- defineCustomElement$9();
635
+ defineCustomElement$a();
613
636
  }
614
637
  break;
615
638
  case "verdocs-checkbox":
616
639
  if (!customElements.get(tagName)) {
617
- defineCustomElement$8();
640
+ defineCustomElement$9();
618
641
  }
619
642
  break;
620
643
  case "verdocs-dropdown":
621
644
  if (!customElements.get(tagName)) {
622
- defineCustomElement$7();
645
+ defineCustomElement$8();
623
646
  }
624
647
  break;
625
648
  case "verdocs-envelope-document-page":
649
+ if (!customElements.get(tagName)) {
650
+ defineCustomElement$7();
651
+ }
652
+ break;
653
+ case "verdocs-kba-dialog":
626
654
  if (!customElements.get(tagName)) {
627
655
  defineCustomElement$6();
628
656
  }