@verdocs/web-sdk 1.9.26 → 1.9.31
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/{Envelopes-d44c4a28.js → Envelopes-752bdc31.js} +10 -2
- package/dist/cjs/Envelopes-752bdc31.js.map +1 -0
- package/dist/cjs/{Templates-805e8ffa.js → Templates-a4370308.js} +2 -2
- package/dist/cjs/{Templates-805e8ffa.js.map → Templates-a4370308.js.map} +1 -1
- package/dist/cjs/index-1329d89c.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{templateStore-a1ccccdb.js → templateStore-8c8dc4c1.js} +2 -2
- package/dist/cjs/{templateStore-a1ccccdb.js.map → templateStore-8c8dc4c1.js.map} +1 -1
- package/dist/cjs/{utils-aa1285cc.js → utils-91d249b4.js} +12 -1
- package/dist/cjs/utils-91d249b4.js.map +1 -0
- package/dist/cjs/verdocs-build.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-document-page_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-document-page_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js +3 -2
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-initial.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-signature_3.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-field-signature_3.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-send.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +72 -41
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js +1 -1
- package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js.map +1 -1
- package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.js +3 -3
- package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.js.map +1 -1
- package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.js +3 -3
- package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +72 -41
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js +2 -2
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.stories.js.map +1 -1
- package/dist/collection/utils/Envelopes.js +7 -0
- package/dist/collection/utils/Envelopes.js.map +1 -1
- package/dist/collection/utils/envelopeStore.js +1 -0
- package/dist/collection/utils/envelopeStore.js.map +1 -1
- package/dist/collection/utils/utils.js +10 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/templateStore.js +1 -1
- package/dist/components/utils.js +11 -1
- package/dist/components/utils.js.map +1 -1
- package/dist/components/verdocs-document-page2.js +1 -1
- package/dist/components/verdocs-document-page2.js.map +1 -1
- package/dist/components/verdocs-field-initial.js +3 -3
- package/dist/components/verdocs-field-initial.js.map +1 -1
- package/dist/components/verdocs-field-signature2.js +3 -3
- package/dist/components/verdocs-field-signature2.js.map +1 -1
- package/dist/components/verdocs-sign.js +72 -41
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-template-fields2.js +1 -1
- package/dist/components/verdocs-view2.js +9 -1
- package/dist/components/verdocs-view2.js.map +1 -1
- package/dist/docs.json +2 -2
- package/dist/esm/{Envelopes-28a4c67f.js → Envelopes-83934981.js} +10 -2
- package/dist/esm/Envelopes-83934981.js.map +1 -0
- package/dist/esm/{Templates-653648bb.js → Templates-41762101.js} +2 -2
- package/dist/esm/{Templates-653648bb.js.map → Templates-41762101.js.map} +1 -1
- package/dist/esm/index-f78d163d.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{templateStore-8585145f.js → templateStore-103a54ab.js} +2 -2
- package/dist/esm/{templateStore-8585145f.js.map → templateStore-103a54ab.js.map} +1 -1
- package/dist/esm/{utils-c666adcf.js → utils-36d44309.js} +12 -2
- package/dist/esm/utils-36d44309.js.map +1 -0
- package/dist/esm/verdocs-build.entry.js +3 -3
- package/dist/esm/verdocs-document-page_2.entry.js +1 -1
- package/dist/esm/verdocs-document-page_2.entry.js.map +1 -1
- package/dist/esm/verdocs-dropdown_2.entry.js +3 -2
- package/dist/esm/verdocs-dropdown_2.entry.js.map +1 -1
- package/dist/esm/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm/verdocs-field-date.entry.js +1 -1
- package/dist/esm/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm/verdocs-field-initial.entry.js +4 -4
- package/dist/esm/verdocs-field-initial.entry.js.map +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm/verdocs-field-signature_3.entry.js +4 -4
- package/dist/esm/verdocs-field-signature_3.entry.js.map +1 -1
- package/dist/esm/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +2 -2
- package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm/verdocs-preview.entry.js +3 -3
- package/dist/esm/verdocs-send.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +72 -41
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-template-create_4.entry.js +3 -3
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/Envelopes-83934981.js +2 -0
- package/dist/esm-es5/Envelopes-83934981.js.map +1 -0
- package/dist/esm-es5/{Templates-653648bb.js → Templates-41762101.js} +2 -2
- package/dist/esm-es5/{Templates-653648bb.js.map → Templates-41762101.js.map} +0 -0
- package/dist/esm-es5/index-f78d163d.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/{templateStore-8585145f.js → templateStore-103a54ab.js} +2 -2
- package/dist/esm-es5/{templateStore-8585145f.js.map → templateStore-103a54ab.js.map} +0 -0
- package/dist/esm-es5/utils-36d44309.js +2 -0
- package/dist/esm-es5/utils-36d44309.js.map +1 -0
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-document-page_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-dropdown_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature_3.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-send.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-create_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +2 -1
- package/dist/types/utils/envelopeStore.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/verdocs-web-sdk/p-0225575c.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-0225575c.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-6ec79ddc.system.entry.js → p-0398fe67.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6ec79ddc.system.entry.js.map → p-0398fe67.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-7421e32e.entry.js → p-102bc4bc.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-102bc4bc.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-15aa525d.entry.js → p-19a634b9.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-15aa525d.entry.js.map → p-19a634b9.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-9e5fcf92.system.entry.js → p-1b3be2ae.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9e5fcf92.system.entry.js.map → p-1b3be2ae.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-f47224c8.system.entry.js → p-206bbfe3.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f47224c8.system.entry.js.map → p-206bbfe3.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a6781789.system.entry.js → p-26e0caa5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a6781789.system.entry.js.map → p-26e0caa5.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-e02e05a2.entry.js → p-29044b5b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e02e05a2.entry.js.map → p-29044b5b.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a98ced34.system.entry.js → p-2d1b5389.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a98ced34.system.entry.js.map → p-2d1b5389.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-b5f64429.entry.js → p-2e8a3d90.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b5f64429.entry.js.map → p-2e8a3d90.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-075025ab.system.js → p-30fcf18d.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-075025ab.system.js.map → p-30fcf18d.system.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-5b7a5deb.js → p-3ce35714.js} +2 -2
- package/dist/verdocs-web-sdk/{p-5b7a5deb.js.map → p-3ce35714.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-1cb6f31a.entry.js → p-455c2dd9.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-1cb6f31a.entry.js.map → p-455c2dd9.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a51bb6bf.js → p-458b639d.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a51bb6bf.js.map → p-458b639d.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-49227301.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-5f036dfe.entry.js.map → p-49227301.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-c41d9fc0.entry.js → p-515f3ab2.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c41d9fc0.entry.js.map → p-515f3ab2.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-57fad02b.system.js +2 -0
- package/dist/verdocs-web-sdk/p-57fad02b.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-78f5c8ad.system.js → p-58c4b767.system.js} +2 -2
- package/dist/verdocs-web-sdk/p-58c4b767.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7937a240.system.entry.js → p-5e693763.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7937a240.system.entry.js.map → p-5e693763.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-db837a46.system.entry.js → p-6896b64c.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-db837a46.system.entry.js.map → p-6896b64c.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-6baf87ba.js +2 -0
- package/dist/verdocs-web-sdk/p-6baf87ba.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7fd610f5.entry.js → p-6d858f25.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7fd610f5.entry.js.map → p-6d858f25.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-2bc68d06.system.js → p-6d8b9e75.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2bc68d06.system.js.map → p-6d8b9e75.system.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-070ba589.system.entry.js → p-729db0b6.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-070ba589.system.entry.js.map → p-729db0b6.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-f7a56f6c.entry.js → p-78c6b2b1.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-78c6b2b1.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-c6de4457.system.entry.js → p-7d1a5bc5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c6de4457.system.entry.js.map → p-7d1a5bc5.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-4f3b1c7c.entry.js → p-8c2cdcc4.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4f3b1c7c.entry.js.map → p-8c2cdcc4.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-97329951.system.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-4d371bfe.system.entry.js → p-99495fbb.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4d371bfe.system.entry.js.map → p-99495fbb.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-38d5bc9e.entry.js → p-9f381d10.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-38d5bc9e.entry.js.map → p-9f381d10.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-a45632ec.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-695a3cce.entry.js.map → p-a45632ec.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-1fc3f986.system.entry.js → p-b5cf7ddc.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-b5cf7ddc.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-b76c949d.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-b76c949d.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-0ca01601.system.entry.js → p-bd6175d9.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-0ca01601.system.entry.js.map → p-bd6175d9.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-c16b6ca4.system.js +1 -1
- package/dist/verdocs-web-sdk/p-c16b6ca4.system.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-92e526a0.system.entry.js → p-c35a211a.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-c35a211a.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-5a08e378.entry.js → p-c3d5596a.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-5a08e378.entry.js.map → p-c3d5596a.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-f68306f5.entry.js → p-c8fb8a55.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f68306f5.entry.js.map → p-c8fb8a55.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-0126c601.entry.js → p-cc30f8c8.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-0126c601.entry.js.map → p-cc30f8c8.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-cf6cfa4f.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-cf6cfa4f.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d1c6b0f4.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-c731755d.system.entry.js.map → p-d1c6b0f4.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-9dc3b579.system.entry.js → p-d9413770.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9dc3b579.system.entry.js.map → p-d9413770.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-de207098.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-de207098.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-ff1278ed.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-fcc3041d.js → p-ff3b285c.js} +2 -2
- package/dist/verdocs-web-sdk/p-ff3b285c.js.map +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/Envelopes-d44c4a28.js.map +0 -1
- package/dist/cjs/utils-aa1285cc.js.map +0 -1
- package/dist/esm/Envelopes-28a4c67f.js.map +0 -1
- package/dist/esm/utils-c666adcf.js.map +0 -1
- package/dist/esm-es5/Envelopes-28a4c67f.js +0 -2
- package/dist/esm-es5/Envelopes-28a4c67f.js.map +0 -1
- package/dist/esm-es5/utils-c666adcf.js +0 -2
- package/dist/esm-es5/utils-c666adcf.js.map +0 -1
- package/dist/verdocs-web-sdk/p-1058c062.system.js +0 -2
- package/dist/verdocs-web-sdk/p-1058c062.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-1fc3f986.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-4b516c47.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-4b516c47.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-5f036dfe.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-695a3cce.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-7421e32e.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-78f5c8ad.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-92e526a0.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-c731755d.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c7a22e57.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c7a22e57.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-de06e0c6.js +0 -2
- package/dist/verdocs-web-sdk/p-de06e0c6.js.map +0 -1
- package/dist/verdocs-web-sdk/p-f7a56f6c.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-f9103136.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-f9103136.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-fa25cd77.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-fa25cd77.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-fcc3041d.js.map +0 -1
|
@@ -6,7 +6,7 @@ import { envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubm
|
|
|
6
6
|
import { isValidEmail, isValidPhone } from '@verdocs/js-sdk/Templates/Validators';
|
|
7
7
|
import { Host, Fragment, h } from '@stencil/core';
|
|
8
8
|
import { updateEnvelopeFieldInitials, updateEnvelopeFieldSignature } from '@verdocs/js-sdk/Envelopes/Envelopes';
|
|
9
|
-
import { fullNameToInitials, getFieldId, getRoleIndex, renderDocumentField, savePDF } from '../../../utils/utils';
|
|
9
|
+
import { fullNameToInitials, getFieldId, getRoleIndex, renderDocumentField, savePDF, updateDocumentFieldValue } from '../../../utils/utils';
|
|
10
10
|
import { getEnvelopeById } from '../../../utils/Envelopes';
|
|
11
11
|
import EnvelopeStore from '../../../utils/envelopeStore';
|
|
12
12
|
import { SDKError } from '../../../utils/errors';
|
|
@@ -33,7 +33,6 @@ export class VerdocsSign {
|
|
|
33
33
|
constructor() {
|
|
34
34
|
this.endpoint = null;
|
|
35
35
|
this.recipientIndex = -1;
|
|
36
|
-
this.fields = [];
|
|
37
36
|
this.envelopeId = null;
|
|
38
37
|
this.roleId = null;
|
|
39
38
|
this.inviteCode = null;
|
|
@@ -48,6 +47,7 @@ export class VerdocsSign {
|
|
|
48
47
|
this.showDone = false;
|
|
49
48
|
this.finishLater = false;
|
|
50
49
|
this.showFinishLater = false;
|
|
50
|
+
this.agreed = false;
|
|
51
51
|
}
|
|
52
52
|
componentWillLoad() {
|
|
53
53
|
this.endpoint = new VerdocsEndpoint({ sessionType: 'signing' });
|
|
@@ -75,22 +75,23 @@ export class VerdocsSign {
|
|
|
75
75
|
});
|
|
76
76
|
console.log(`[SIGN] Loaded signing session ${session.email} / ${session.profile_id}`);
|
|
77
77
|
this.recipient = recipient;
|
|
78
|
+
console.log('[SIGN] We are recipient', this.recipient);
|
|
78
79
|
this.signerToken = signerToken;
|
|
79
80
|
this.endpoint.setToken(signerToken);
|
|
80
|
-
if (this.
|
|
81
|
+
if (this.agreed) {
|
|
81
82
|
this.nextButtonLabel = 'Next';
|
|
82
83
|
}
|
|
83
84
|
await getEnvelopeById(this.endpoint, this.envelopeId);
|
|
84
|
-
// const envelope = await Envelopes.getEnvelope(this.endpoint, this.envelopeId);
|
|
85
|
-
// this.envelope = envelope;
|
|
86
|
-
// console.log('[SIGN] Loaded envelope', envelope);
|
|
87
85
|
this.recipientIndex = EnvelopeStore.envelope.recipients.findIndex(recipient => recipient.role_name == this.roleId);
|
|
88
86
|
if (this.recipientIndex > -1) {
|
|
89
87
|
this.recipient = EnvelopeStore.envelope.recipients[this.recipientIndex];
|
|
90
|
-
this.
|
|
88
|
+
this.agreed = this.recipient.agreed;
|
|
89
|
+
console.log('[SIGN] Found our recipient in the envelope', this.recipientIndex, this.recipient);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
console.log('[SIGN] Could not find our recipient record', this.roleId, EnvelopeStore.envelope.recipients);
|
|
91
93
|
}
|
|
92
94
|
this.isDone = ['submitted', 'canceled', 'declined'].includes(this.recipient.status);
|
|
93
|
-
console.log('Done', this.isDone);
|
|
94
95
|
// TODO: Fix service to allow this?
|
|
95
96
|
// const sigs = await getSignatures();
|
|
96
97
|
// console.log('sigs', sigs);
|
|
@@ -103,10 +104,10 @@ export class VerdocsSign {
|
|
|
103
104
|
}
|
|
104
105
|
handleClickAgree() {
|
|
105
106
|
envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)
|
|
106
|
-
.then(
|
|
107
|
+
.then(() => {
|
|
107
108
|
var _a;
|
|
108
109
|
this.nextButtonLabel = 'Next';
|
|
109
|
-
this.
|
|
110
|
+
this.agreed = true; // The server returns a recipient object but it's not "deep" so we track this locally
|
|
110
111
|
(_a = this.envelopeUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, envelope: EnvelopeStore.envelope, event: 'agreed' });
|
|
111
112
|
})
|
|
112
113
|
.catch(e => {
|
|
@@ -121,11 +122,9 @@ export class VerdocsSign {
|
|
|
121
122
|
this.finishLater = true;
|
|
122
123
|
this.showFinishLater = true;
|
|
123
124
|
// this.router.navigate([`view/sign/${this.envelopeId}/role/${this.roleName}/saved`]);
|
|
124
|
-
// if (!window?.['STORYBOOK_ENV']) {
|
|
125
|
-
// window.alert('User intends to sign later.');
|
|
126
|
-
// }
|
|
127
125
|
break;
|
|
128
126
|
case 'claim':
|
|
127
|
+
window.alert('This feature will be available in an upcoming release.');
|
|
129
128
|
break;
|
|
130
129
|
case 'decline':
|
|
131
130
|
{
|
|
@@ -142,8 +141,20 @@ export class VerdocsSign {
|
|
|
142
141
|
break;
|
|
143
142
|
}
|
|
144
143
|
}
|
|
144
|
+
updateRecipientFieldValue(fieldName, updateResult) {
|
|
145
|
+
this.recipient.fields.forEach(oldField => {
|
|
146
|
+
if (oldField.name === fieldName) {
|
|
147
|
+
oldField.settings = updateResult.settings;
|
|
148
|
+
// TODO: When we break out other fields like value, update them here too
|
|
149
|
+
updateDocumentFieldValue(oldField);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
145
153
|
saveFieldChange(fieldName, fields) {
|
|
146
154
|
Envelopes.updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //
|
|
155
|
+
.then(updateResult => {
|
|
156
|
+
this.updateRecipientFieldValue(fieldName, updateResult);
|
|
157
|
+
})
|
|
147
158
|
.catch(e => {
|
|
148
159
|
var _a, _b, _c, _d, _e, _f;
|
|
149
160
|
if (((_a = e.response) === null || _a === void 0 ? void 0 : _a.status) === 401 && ((_c = (_b = e.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.error) === 'jwt expired') {
|
|
@@ -175,16 +186,16 @@ export class VerdocsSign {
|
|
|
175
186
|
case 'initial':
|
|
176
187
|
const initialsBlob = await (await fetch(e.detail)).blob();
|
|
177
188
|
return createInitials(this.endpoint, 'initial', initialsBlob) //
|
|
178
|
-
.then(newInitials => {
|
|
179
|
-
|
|
180
|
-
|
|
189
|
+
.then(async (newInitials) => {
|
|
190
|
+
const updateResult = await updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);
|
|
191
|
+
this.updateRecipientFieldValue(field.name, updateResult);
|
|
181
192
|
});
|
|
182
193
|
case 'signature':
|
|
183
194
|
const signatureBlob = await (await fetch(e.detail)).blob();
|
|
184
195
|
return createSignature(this.endpoint, 'signature', signatureBlob) //
|
|
185
|
-
.then(newSignature => {
|
|
186
|
-
|
|
187
|
-
|
|
196
|
+
.then(async (newSignature) => {
|
|
197
|
+
const updateResult = await updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);
|
|
198
|
+
this.updateRecipientFieldValue(field.name, updateResult);
|
|
188
199
|
});
|
|
189
200
|
case 'date':
|
|
190
201
|
const iso = e.target.getAttribute('iso');
|
|
@@ -245,22 +256,14 @@ export class VerdocsSign {
|
|
|
245
256
|
console.log('[SIGN] Submitted successfully', result);
|
|
246
257
|
this.showDone = true;
|
|
247
258
|
this.isDone = true;
|
|
248
|
-
// updateRecipientStatus()
|
|
249
259
|
}
|
|
250
260
|
catch (e) {
|
|
251
261
|
console.log('Error submitting', e);
|
|
252
262
|
}
|
|
253
263
|
return;
|
|
254
|
-
// You're done.
|
|
255
|
-
// You can access the Verdoc at any time by clicking on the link from invitation email.
|
|
256
|
-
//
|
|
257
|
-
// After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.
|
|
258
|
-
//
|
|
259
|
-
// Thank you for using Verdocs.
|
|
260
|
-
// Got it, thanks
|
|
261
264
|
}
|
|
262
265
|
// Find and focus the next incomplete required field
|
|
263
|
-
const requiredFields = this.fields.filter(field => field.required);
|
|
266
|
+
const requiredFields = this.recipient.fields.filter(field => field.required);
|
|
264
267
|
const focusedIndex = requiredFields.findIndex(field => field.name === this.focusedField);
|
|
265
268
|
let nextFocusedIndex = focusedIndex + 1;
|
|
266
269
|
if (nextFocusedIndex >= requiredFields.length) {
|
|
@@ -296,12 +299,14 @@ export class VerdocsSign {
|
|
|
296
299
|
}
|
|
297
300
|
else {
|
|
298
301
|
console.log('[SIGN] Remaining invalid fields', invalidFields);
|
|
302
|
+
this.nextButtonLabel = 'Next';
|
|
299
303
|
this.nextSubmits = false;
|
|
300
304
|
}
|
|
301
305
|
}
|
|
302
306
|
attachFieldAttributes(pageInfo, field, roleIndex, el) {
|
|
303
307
|
var _a;
|
|
304
308
|
el.addEventListener('input', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));
|
|
309
|
+
el.addEventListener('blur', () => this.checkRecipientFields());
|
|
305
310
|
el.addEventListener('fieldChange', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));
|
|
306
311
|
el.setAttribute('roleindex', roleIndex);
|
|
307
312
|
el.setAttribute('xScale', pageInfo.xScale);
|
|
@@ -353,24 +358,38 @@ export class VerdocsSign {
|
|
|
353
358
|
// Render fields for "the other" recipients
|
|
354
359
|
EnvelopeStore.envelope.recipients
|
|
355
360
|
.filter(recipient => recipient.role_name !== this.recipient.role_name)
|
|
356
|
-
.
|
|
361
|
+
.forEach(otherRecipient => {
|
|
357
362
|
const otherRoleIndex = getRoleIndex(EnvelopeStore.roleNames, otherRecipient.role_name);
|
|
358
363
|
const recipientFields = otherRecipient.fields.filter(field => field.page === pageInfo.pageNumber);
|
|
359
|
-
//
|
|
364
|
+
// We don't render other recipients' fields if they've already acted, because those values are now stamped into the document page.
|
|
365
|
+
// TODO: Do we want to render alternate treatments for recipients who have declined (red boxes?) and/or if the envelope is cancelled?
|
|
366
|
+
// TODO: When doing server-side rendering we probably want to "stamp" values into the rendered PDF only once the recipient is done
|
|
367
|
+
// acting. Do this once vSign is in Production.
|
|
368
|
+
// TODO: Changed tacks here. During signing we show the template PDFs and everybody's fields, filled in or no. When done, we switch
|
|
369
|
+
// to showing the envelope PDFs with stamped-in values. Confirm this is a good approach.
|
|
370
|
+
// if (!['submitted', 'signed'].includes(otherRecipient.status)) {
|
|
360
371
|
recipientFields.forEach(field => {
|
|
361
|
-
const el = renderDocumentField(field, pageInfo, otherRoleIndex, {
|
|
372
|
+
const el = renderDocumentField(field, pageInfo, otherRoleIndex, {
|
|
373
|
+
disabled: true,
|
|
374
|
+
editable: false,
|
|
375
|
+
draggable: false,
|
|
376
|
+
done: this.isDone,
|
|
377
|
+
});
|
|
362
378
|
if (!el) {
|
|
363
379
|
return;
|
|
364
380
|
}
|
|
365
|
-
el.setAttribute
|
|
366
|
-
el.setAttribute
|
|
367
|
-
|
|
381
|
+
// TODO: Research why this occurs. There are cases when we're getting "el.setAttribute is not a function"
|
|
382
|
+
if (el.setAttribute) {
|
|
383
|
+
el.setAttribute('roleindex', otherRoleIndex);
|
|
384
|
+
el.setAttribute('xScale', pageInfo.xScale);
|
|
385
|
+
el.setAttribute('yScale', pageInfo.yScale);
|
|
386
|
+
}
|
|
368
387
|
});
|
|
388
|
+
// }
|
|
369
389
|
});
|
|
370
390
|
this.checkRecipientFields();
|
|
371
391
|
}
|
|
372
392
|
render() {
|
|
373
|
-
var _a, _b, _c, _d;
|
|
374
393
|
if (EnvelopeStore.loading || !EnvelopeStore.envelope) {
|
|
375
394
|
return (h(Host, null, h("verdocs-loader", null)));
|
|
376
395
|
}
|
|
@@ -381,15 +400,26 @@ export class VerdocsSign {
|
|
|
381
400
|
{ id: 'print', label: 'Print Without Signing', disabled: true },
|
|
382
401
|
{ id: 'download', label: 'Download' },
|
|
383
402
|
];
|
|
384
|
-
return (h(Host, { class: { agreed:
|
|
403
|
+
return (h(Host, { class: { agreed: this.agreed } }, !this.isDone && !this.finishLater && h("div", { class: "intro" }, "Please review and act on these documents."), !this.isDone && (h("div", { class: "header" }, !this.isDone && !this.finishLater && h("verdocs-dropdown", { options: menuOptions, onOptionSelected: e => this.handleOptionSelected(e) }), !this.agreed ? (h("div", { class: "agree" }, h("verdocs-checkbox", { name: "agree", label: "I agree to use electronic records and signatures.", onInput: () => this.handleClickAgree() }))) : (h(Fragment, null, h("img", { src: "https://verdocs.com/assets/white-logo.svg", alt: "Verdocs Logo", class: "logo" }), h("div", { class: "title" }, EnvelopeStore.envelope.name), h("div", { style: { flex: '1' } }), h("div", { innerHTML: PrintIcon, style: { width: '24px', height: '24px', fill: '#fff', cursor: 'pointer' }, onClick: () => window.print() }), h("div", { innerHTML: DownloadIcon, style: { width: '24px', height: '24px', fill: '#fff', cursor: 'pointer', margin: '0 16px', maginRight: '30px' }, onClick: () => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => { }) }))), !this.isDone && !this.finishLater && h("verdocs-button", { size: "small", label: this.nextButtonLabel, disabled: !this.agreed, onClick: () => this.handleNext() }))), !this.isDone && !this.agreed ? h("div", { class: "cover" }) : h("div", { style: { display: 'none' } }), this.isDone ? (
|
|
385
404
|
// <div>test</div>
|
|
386
405
|
h("verdocs-view", { endpoint: this.endpoint, envelopeId: this.envelopeId, onSdkError: e => { var _a; return (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(e.detail); } })) : (h("div", { class: "document" }, (EnvelopeStore.envelope.documents || []).map(envelopeDocument => {
|
|
387
406
|
const pages = [...((envelopeDocument === null || envelopeDocument === void 0 ? void 0 : envelopeDocument.pages) || [])];
|
|
388
407
|
pages.sort((a, b) => a.sequence - b.sequence);
|
|
389
|
-
return (h(Fragment, null, pages.map(page =>
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
408
|
+
return (h(Fragment, null, pages.map(page => {
|
|
409
|
+
var _a;
|
|
410
|
+
// In signing mode we show the original template page with all the recipient fields so we can show source formatting and
|
|
411
|
+
// where everything went. This is also a visual indicator when optional fields weren't filled in by previous actors, or
|
|
412
|
+
// future signers still need to act. Once we're "done" we flip to showing the envelope's documents which have the final
|
|
413
|
+
// field vales (so far) stamped into them.
|
|
414
|
+
const templatePage = (_a = EnvelopeStore.template) === null || _a === void 0 ? void 0 : _a.pages.find(p => p.sequence === page.sequence);
|
|
415
|
+
// TODO: Confirm that a pure page-number match is good enough to find the matching template page. We need to make sure
|
|
416
|
+
// we either don't reset our page numbers for additional attachments, or add match-on identifiers to work around that.
|
|
417
|
+
// console.log('tp', templatePage, page);
|
|
418
|
+
return (h("verdocs-document-page", { pageImageUri: (templatePage === null || templatePage === void 0 ? void 0 : templatePage.display_uri) || page.display_uri, virtualWidth: 612, virtualHeight: 792, pageNumber: page.sequence, onPageRendered: e => this.handlePageRendered(e), layers: [
|
|
419
|
+
{ name: 'page', type: 'canvas' },
|
|
420
|
+
{ name: 'controls', type: 'div' },
|
|
421
|
+
] }));
|
|
422
|
+
})));
|
|
393
423
|
}))), this.showFinishLater && (h("verdocs-ok-dialog", { heading: "You've saved your document to finish later.", message: "To complete the document, 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 Verdoc 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: () => (this.showDone = false) }))));
|
|
394
424
|
}
|
|
395
425
|
static get is() { return "verdocs-sign"; }
|
|
@@ -473,7 +503,8 @@ export class VerdocsSign {
|
|
|
473
503
|
"isDone": {},
|
|
474
504
|
"showDone": {},
|
|
475
505
|
"finishLater": {},
|
|
476
|
-
"showFinishLater": {}
|
|
506
|
+
"showFinishLater": {},
|
|
507
|
+
"agreed": {}
|
|
477
508
|
};
|
|
478
509
|
}
|
|
479
510
|
static get events() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdocs-sign.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-sign/verdocs-sign.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAC,eAAe,EAAC,MAAM,sCAAsC,CAAC;AAErE,OAAO,EAAC,sBAAsB,EAAE,wBAAwB,EAAE,uBAAuB,EAAC,MAAM,sCAAsC,CAAC;AAC/H,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAC,KAAK,EAAgB,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAC,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAC,2BAA2B,EAAE,4BAA4B,EAAC,MAAM,qCAAqC,CAAC;AAC9G,OAAO,EA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CAAC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,GAAI;MACtI,IAAI,CAAC,QAAQ,IAAI,CAChB,yBACE,OAAO,EAAC,cAAc,EACtB,OAAO,EAAC,uOAAuO,EAC/O,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,GACrC,CACH,CACI,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {createInitials} from '@verdocs/js-sdk/Envelopes/Initials';\nimport {createSignature} from '@verdocs/js-sdk/Envelopes/Signatures';\nimport {IDocumentField, IEnvelope, IRecipient} from '@verdocs/js-sdk/Envelopes/Types';\nimport {envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit} from '@verdocs/js-sdk/Envelopes/Recipients';\nimport {isValidEmail, isValidPhone} from '@verdocs/js-sdk/Templates/Validators';\nimport {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {updateEnvelopeFieldInitials, updateEnvelopeFieldSignature} from '@verdocs/js-sdk/Envelopes/Envelopes';\nimport {fullNameToInitials, getFieldId, getRoleIndex, renderDocumentField, savePDF} from '../../../utils/utils';\nimport {getEnvelopeById} from '../../../utils/Envelopes';\nimport EnvelopeStore from '../../../utils/envelopeStore';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\n\nconst PrintIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"></path></svg>`;\n\nconst DownloadIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z\"></path></svg>`;\n\n/**\n * Display an envelope signing experience. This will display the envelope's attached\n * documents with signing fields overlaid on each page.\n *\n * The component will attempt to initiate a signing session and load the specified\n * envelope. If successful, the recipient's fields will be enabled and the user will\n * be able to sign the envelope's attached documents. If not, an `sdkError` will be\n * thrown and the component will be blank/empty. To provide the best user experience,\n * applications should capture and handle this error to provide the user with\n * instructions/options for next steps based on the application's design and workflow.\n *\n * Unlike other components, this will always create its own endpoint to manage the\n * session session. This endpoint will be included in event callbacks for the\n * convenience of host applications that may wish to make server calls using the\n * signer's credentials once signing is complete (e.g. to obtain copies of\n * the signed attachments.)\n */\n@Component({\n tag: 'verdocs-sign',\n styleUrl: 'verdocs-sign.scss',\n shadow: false,\n})\nexport class VerdocsSign {\n endpoint: VerdocsEndpoint = null;\n\n /**\n * The ID of the envelope to sign.\n */\n @Prop() envelopeId: string | null = null;\n\n /**\n * The ID of the role that will be signing e.g. 'Recipient 1'\n */\n @Prop() roleId: string | null = null;\n\n /**\n * The invite code for the signer.\n */\n @Prop() inviteCode: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeLoaded: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope}>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n @State() recipient: IRecipient | null = null;\n @State() signerToken = null;\n // @State() envelope: IEnvelope | null = null;\n // @State() fields: IDocumentField[] = [];\n @State() hasSignature = false;\n @State() nextButtonLabel = 'Start';\n @State() nextSubmits = false;\n @State() errorMessage = '';\n @State() focusedField = '';\n @State() isDone = false;\n @State() showDone = false;\n\n @State() finishLater = false;\n @State() showFinishLater = false;\n\n recipientIndex: number = -1;\n fields: IDocumentField[] = [];\n\n componentWillLoad() {\n this.endpoint = new VerdocsEndpoint({sessionType: 'signing'});\n }\n\n async componentDidLoad() {\n if (!this.envelopeId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required envelopId', 500, ''));\n return;\n }\n\n if (!this.roleId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required roleId', 500, ''));\n return;\n }\n\n if (!this.inviteCode) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required inviteCode', 500, ''));\n return;\n }\n\n try {\n console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);\n const {session, recipient, signerToken} = await Envelopes.getSigningSession(this.endpoint, {\n envelopeId: this.envelopeId,\n roleId: this.roleId,\n inviteCode: this.inviteCode,\n });\n\n console.log(`[SIGN] Loaded signing session ${session.email} / ${session.profile_id}`);\n\n this.recipient = recipient;\n this.signerToken = signerToken;\n this.endpoint.setToken(signerToken);\n\n if (this.recipient.agreed) {\n this.nextButtonLabel = 'Next';\n }\n\n await getEnvelopeById(this.endpoint, this.envelopeId);\n // const envelope = await Envelopes.getEnvelope(this.endpoint, this.envelopeId);\n // this.envelope = envelope;\n // console.log('[SIGN] Loaded envelope', envelope);\n\n this.recipientIndex = EnvelopeStore.envelope.recipients.findIndex(recipient => recipient.role_name == this.roleId);\n if (this.recipientIndex > -1) {\n this.recipient = EnvelopeStore.envelope.recipients[this.recipientIndex];\n this.fields = this.recipient.fields;\n }\n\n this.isDone = ['submitted', 'canceled', 'declined'].includes(this.recipient.status);\n console.log('Done', this.isDone);\n\n // TODO: Fix service to allow this?\n // const sigs = await getSignatures();\n // console.log('sigs', sigs);\n\n this.envelopeLoaded?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope});\n } catch (e) {\n console.log('Error with signing session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handleClickAgree() {\n envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)\n .then(r => {\n this.nextButtonLabel = 'Next';\n this.recipient = r;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope, event: 'agreed'});\n })\n .catch(e => {\n console.log('Update failure', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleOptionSelected(e) {\n switch (e.detail.id) {\n case 'later':\n this.finishLater = true;\n this.showFinishLater = true;\n // this.router.navigate([`view/sign/${this.envelopeId}/role/${this.roleName}/saved`]);\n // if (!window?.['STORYBOOK_ENV']) {\n // window.alert('User intends to sign later.');\n // }\n break;\n case 'claim':\n break;\n case 'decline':\n {\n const declineResult = await envelopeRecipientDecline(this.endpoint, this.envelopeId, this.roleId);\n console.log('Decline result', declineResult);\n this.isDone = true;\n }\n break;\n case 'print':\n window.print();\n break;\n case 'download':\n savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {});\n break;\n }\n }\n\n saveFieldChange(fieldName: string, fields: Record<string, any>) {\n Envelopes.updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //\n .catch(e => {\n if (e.response?.status === 401 && e.response?.data?.error === 'jwt expired') {\n // TODO: Do we want to improve the instructions here?\n console.log('[SIGN] Signing session expired');\n this.errorMessage = 'Signing session expired.';\n } else {\n console.log('[SIGN] Server error', e);\n }\n\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleFieldChange(field: IDocumentField, e: any) {\n const {value, checked} = e.target;\n\n switch (field.type) {\n case 'textbox':\n return this.saveFieldChange(field.name, {prepared: false, value});\n\n case 'checkbox_group': {\n const options = field.settings.options.map(option => ({id: option.id, checked: e.target.checked}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'radio_button_group': {\n const options = field.settings.options.map(option => ({id: option.id, selected: e.target.value === option.id}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'dropdown':\n return this.saveFieldChange(field.name, {prepared: false, value: e.detail});\n\n case 'initial':\n const initialsBlob = await (await fetch(e.detail)).blob();\n return createInitials(this.endpoint, 'initial', initialsBlob) //\n .then(newInitials => {\n console.log('New initials', field.name, newInitials);\n updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);\n });\n\n case 'signature':\n const signatureBlob = await (await fetch(e.detail)).blob();\n return createSignature(this.endpoint, 'signature', signatureBlob) //\n .then(newSignature => {\n console.log('New sign', field.name, newSignature);\n updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);\n });\n\n case 'date':\n const iso = e.target.getAttribute('iso');\n return this.saveFieldChange(field.name, {prepared: false, value: iso});\n\n case 'timestamp':\n console.log('Updating timestamp', {value, ts: e.target.getAttribute('timestamp')});\n break;\n\n default:\n console.log('Unhandled field update', {value, checked}, field);\n break;\n }\n }\n\n isFieldValid(field: IDocumentField) {\n const {required = false} = field;\n const {result = '', value = '', base64 = ''} = field.settings || {};\n switch (field.type) {\n case 'textbox':\n switch (field.settings?.validator || '') {\n case 'email':\n return isValidEmail(result);\n case 'phone':\n return isValidPhone(result);\n default:\n return !required || result !== '';\n }\n\n case 'signature':\n case 'initial':\n return !required || base64 !== '';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'textarea':\n case 'date':\n case 'attachment':\n return !required || result !== '';\n\n case 'dropdown':\n return !required || value !== '';\n\n case 'checkbox_group':\n const checkedCount = (field.settings?.options?.filter(option => option.checked) || []).length;\n return !required || (checkedCount >= (field.settings?.minimum_checked || 0) && checkedCount <= (field.settings?.maximum_checked || 999));\n\n case 'radio_button_group':\n return !required || (field.settings?.options?.filter(option => option.selected) || []).length > 0;\n // TODO\n // case 'checkbox':\n // return <verdocs-field-checkbox style={style} value={result || ''} id={id} />;\n // case 'payment':\n // return <verdocs-field-payment style={style} field={field} id={id} />;\n default:\n return false;\n }\n }\n\n async handleNext() {\n if (this.nextSubmits) {\n try {\n const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Submitted successfully', result);\n this.showDone = true;\n this.isDone = true;\n // updateRecipientStatus()\n } catch (e) {\n console.log('Error submitting', e);\n }\n return;\n // You're done.\n // You can access the Verdoc at any time by clicking on the link from invitation email.\n //\n // After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.\n //\n // Thank you for using Verdocs.\n // Got it, thanks\n }\n\n // Find and focus the next incomplete required field\n const requiredFields = this.fields.filter(field => field.required);\n const focusedIndex = requiredFields.findIndex(field => field.name === this.focusedField);\n\n let nextFocusedIndex = focusedIndex + 1;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n\n let nextRequiredField = requiredFields[nextFocusedIndex];\n\n // Skip signature and initial fields that are already filled in. We have to count our \"skips\" just in case, to avoid infinite loops.\n let skips = 0;\n if (skips < requiredFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && nextRequiredField.settings?.result === 'signed') {\n skips++;\n nextFocusedIndex++;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n nextRequiredField = requiredFields[nextFocusedIndex];\n }\n\n if (skips >= requiredFields.length) {\n nextRequiredField = null;\n }\n\n if (nextRequiredField) {\n const id = getFieldId(nextRequiredField);\n const el = document.getElementById(id) as any;\n el?.focusField();\n this.focusedField = nextRequiredField.name;\n }\n }\n\n // See if everything that \"needs to be\" filled in is, and all \"fillable fields\" are valid\n checkRecipientFields() {\n const invalidFields = this.recipient.fields.filter(field => !this.isFieldValid(field));\n if (invalidFields.length < 1) {\n this.nextButtonLabel = 'Finish';\n this.nextSubmits = true;\n } else {\n console.log('[SIGN] Remaining invalid fields', invalidFields);\n this.nextSubmits = false;\n }\n }\n\n attachFieldAttributes(pageInfo, field, roleIndex, el) {\n el.addEventListener('input', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));\n el.addEventListener('fieldChange', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));\n\n el.setAttribute('roleindex', roleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n el.setAttribute('initials', this.recipient ? fullNameToInitials(this.recipient.full_name) : '');\n el.setAttribute('name', this.recipient?.full_name || '');\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n const roleIndex = getRoleIndex(EnvelopeStore.roleNames, this.recipient.role_name);\n const recipientFields = this.recipient.fields.filter(field => field.page === pageInfo.pageNumber);\n console.log('[SIGN] Page rendered, updating fields', {pageInfo, roleIndex, recipientFields});\n\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, roleIndex, {disabled: false, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, roleIndex, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, roleIndex, el);\n }\n\n // interact(el).draggable({\n // listeners: {\n // start(event) {\n // console.log('[FIELDS] Drag started', event.type, event.target);\n // },\n // move(event) {\n // const oldX = +(event.target.getAttribute('posX') || 0);\n // const oldY = +(event.target.getAttribute('posY') || 0);\n // const xScale = +(event.target.getAttribute('xScale') || 1);\n // const yScale = +(event.target.getAttribute('yScale') || 1);\n // const newX = event.dx / xScale + oldX;\n // const newY = event.dy / yScale + oldY;\n // event.target.setAttribute('posX', newX);\n // event.target.setAttribute('posy', newY);\n // updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n // },\n // end(event) {\n // console.log('[FIELDS] Drag ended', event);\n // // event.target.setAttribute('posX', 0);\n // // event.target.setAttribute('posy', 0);\n // // updateCssTransform(event.target, 'translate', `${0}px, ${0}px`);\n // },\n // },\n // });\n });\n\n // Render fields for \"the other\" recipients\n EnvelopeStore.envelope.recipients\n .filter(recipient => recipient.role_name !== this.recipient.role_name)\n .map(otherRecipient => {\n const otherRoleIndex = getRoleIndex(EnvelopeStore.roleNames, otherRecipient.role_name);\n const recipientFields = otherRecipient.fields.filter(field => field.page === pageInfo.pageNumber);\n // const fields = this.fields.filter(field => field.page_sequence === pageInfo.renderedPage.pageNumber);\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, otherRoleIndex, {disabled: true, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n el.setAttribute('roleindex', otherRoleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n });\n });\n\n this.checkRecipientFields();\n }\n\n render() {\n if (EnvelopeStore.loading || !EnvelopeStore.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n const menuOptions = [\n {id: 'later', label: 'Finish Later'}, //\n // {id: 'claim', label: 'Claim the Document', disabled: true},\n {id: 'decline', label: 'Decline to Sign'},\n {id: 'print', label: 'Print Without Signing', disabled: true},\n {id: 'download', label: 'Download'},\n ];\n\n return (\n <Host class={{agreed: this.recipient?.agreed}}>\n {!this.isDone && !this.finishLater && <div class=\"intro\">Please review and act on these documents.</div>}\n\n {!this.isDone && (\n <div class=\"header\">\n {!this.isDone && !this.finishLater && <verdocs-dropdown options={menuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />}\n\n {!this.recipient?.agreed ? (\n <div class=\"agree\">\n <verdocs-checkbox name=\"agree\" label=\"I agree to use electronic records and signatures.\" onInput={() => this.handleClickAgree()} />\n </div>\n ) : (\n <Fragment>\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{EnvelopeStore.envelope.name}</div>\n <div style={{flex: '1'}} />\n <div innerHTML={PrintIcon} style={{width: '24px', height: '24px', fill: '#fff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#fff', cursor: 'pointer', margin: '0 16px', maginRight: '30px'}}\n onClick={() => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {})}\n />\n </Fragment>\n )}\n\n {!this.isDone && !this.finishLater && <verdocs-button size=\"small\" label={this.nextButtonLabel} disabled={!this.recipient?.agreed} onClick={() => this.handleNext()} />}\n </div>\n )}\n\n {!this.isDone && !this.recipient?.agreed ? <div class=\"cover\" /> : <div style={{display: 'none'}} />}\n\n {this.isDone ? (\n // <div>test</div>\n <verdocs-view endpoint={this.endpoint} envelopeId={this.envelopeId} onSdkError={e => this.sdkError?.emit(e.detail)} />\n ) : (\n <div class=\"document\">\n {(EnvelopeStore.envelope.documents || []).map(envelopeDocument => {\n const pages = [...(envelopeDocument?.pages || [])];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Fragment>\n {pages.map(page => (\n <verdocs-document-page\n pageImageUri={page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n ))}\n </Fragment>\n );\n })}\n </div>\n )}\n\n {this.showFinishLater && (\n <verdocs-ok-dialog\n heading=\"You've saved your document to finish later.\"\n message=\"To complete the document, use the link in the original email notification inviting you to review and finish the document.\"\n onNext={() => (this.showFinishLater = false)}\n />\n )}\n\n {this.errorMessage && <verdocs-ok-dialog heading=\"Network Error\" message={this.errorMessage} onNext={() => (this.errorMessage = '')} />}\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message=\"You can access the Verdoc 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.\"\n onNext={() => (this.showDone = false)}\n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kBAAkB,CAAC,CAAC,CAAC,EAC/C,MAAM,EAAE;cACN,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;cAC9B,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;aAChC,GACD,CACH,CAAC;QACJ,CAAC,CAAC,CACO,CACZ,CAAC;MACJ,CAAC,CAAC,CACE,CACP;MAEA,IAAI,CAAC,eAAe,IAAI,CACvB,yBACE,OAAO,EAAC,6CAA6C,EACrD,OAAO,EAAC,2HAA2H,EACnI,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,GAC5C,CACH;MAEA,IAAI,CAAC,YAAY,IAAI,yBAAmB,OAAO,EAAC,eAAe,EAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,GAAI;MACtI,IAAI,CAAC,QAAQ,IAAI,CAChB,yBACE,OAAO,EAAC,cAAc,EACtB,OAAO,EAAC,uOAAuO,EAC/O,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,GACrC,CACH,CACI,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {createInitials} from '@verdocs/js-sdk/Envelopes/Initials';\nimport {createSignature} from '@verdocs/js-sdk/Envelopes/Signatures';\nimport {IDocumentField, IEnvelope, IRecipient} from '@verdocs/js-sdk/Envelopes/Types';\nimport {envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit} from '@verdocs/js-sdk/Envelopes/Recipients';\nimport {isValidEmail, isValidPhone} from '@verdocs/js-sdk/Templates/Validators';\nimport {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {updateEnvelopeFieldInitials, updateEnvelopeFieldSignature} from '@verdocs/js-sdk/Envelopes/Envelopes';\nimport {fullNameToInitials, getFieldId, getRoleIndex, renderDocumentField, savePDF, updateDocumentFieldValue} from '../../../utils/utils';\nimport {getEnvelopeById} from '../../../utils/Envelopes';\nimport EnvelopeStore from '../../../utils/envelopeStore';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\n\nconst PrintIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z\"></path></svg>`;\n\nconst DownloadIcon = `<svg focusable=\"false\" aria-hidden=\"true\" viewBox=\"0 0 24 24\"><path d=\"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z\"></path></svg>`;\n\n/**\n * Display an envelope signing experience. This will display the envelope's attached\n * documents with signing fields overlaid on each page.\n *\n * The component will attempt to initiate a signing session and load the specified\n * envelope. If successful, the recipient's fields will be enabled and the user will\n * be able to sign the envelope's attached documents. If not, an `sdkError` will be\n * thrown and the component will be blank/empty. To provide the best user experience,\n * applications should capture and handle this error to provide the user with\n * instructions/options for next steps based on the application's design and workflow.\n *\n * Unlike other components, this will always create its own endpoint to manage the\n * session session. This endpoint will be included in event callbacks for the\n * convenience of host applications that may wish to make server calls using the\n * signer's credentials once signing is complete (e.g. to obtain copies of\n * the signed attachments.)\n */\n@Component({\n tag: 'verdocs-sign',\n styleUrl: 'verdocs-sign.scss',\n shadow: false,\n})\nexport class VerdocsSign {\n endpoint: VerdocsEndpoint = null;\n\n /**\n * The ID of the envelope to sign.\n */\n @Prop() envelopeId: string | null = null;\n\n /**\n * The ID of the role that will be signing e.g. 'Recipient 1'\n */\n @Prop() roleId: string | null = null;\n\n /**\n * The invite code for the signer.\n */\n @Prop() inviteCode: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeLoaded: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope}>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n @State() recipient: IRecipient | null = null;\n @State() signerToken = null;\n @State() hasSignature = false;\n @State() nextButtonLabel = 'Start';\n @State() nextSubmits = false;\n @State() errorMessage = '';\n @State() focusedField = '';\n @State() isDone = false;\n @State() showDone = false;\n\n @State() finishLater = false;\n @State() showFinishLater = false;\n @State() agreed = false;\n\n recipientIndex: number = -1;\n\n componentWillLoad() {\n this.endpoint = new VerdocsEndpoint({sessionType: 'signing'});\n }\n\n async componentDidLoad() {\n if (!this.envelopeId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required envelopId', 500, ''));\n return;\n }\n\n if (!this.roleId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required roleId', 500, ''));\n return;\n }\n\n if (!this.inviteCode) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required inviteCode', 500, ''));\n return;\n }\n\n try {\n console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);\n const {session, recipient, signerToken} = await Envelopes.getSigningSession(this.endpoint, {\n envelopeId: this.envelopeId,\n roleId: this.roleId,\n inviteCode: this.inviteCode,\n });\n\n console.log(`[SIGN] Loaded signing session ${session.email} / ${session.profile_id}`);\n\n this.recipient = recipient;\n console.log('[SIGN] We are recipient', this.recipient);\n this.signerToken = signerToken;\n this.endpoint.setToken(signerToken);\n\n if (this.agreed) {\n this.nextButtonLabel = 'Next';\n }\n\n await getEnvelopeById(this.endpoint, this.envelopeId);\n\n this.recipientIndex = EnvelopeStore.envelope.recipients.findIndex(recipient => recipient.role_name == this.roleId);\n if (this.recipientIndex > -1) {\n this.recipient = EnvelopeStore.envelope.recipients[this.recipientIndex];\n this.agreed = this.recipient.agreed;\n console.log('[SIGN] Found our recipient in the envelope', this.recipientIndex, this.recipient);\n } else {\n console.log('[SIGN] Could not find our recipient record', this.roleId, EnvelopeStore.envelope.recipients);\n }\n\n this.isDone = ['submitted', 'canceled', 'declined'].includes(this.recipient.status);\n\n // TODO: Fix service to allow this?\n // const sigs = await getSignatures();\n // console.log('sigs', sigs);\n\n this.envelopeLoaded?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope});\n } catch (e) {\n console.log('Error with signing session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handleClickAgree() {\n envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)\n .then(() => {\n this.nextButtonLabel = 'Next';\n this.agreed = true; // The server returns a recipient object but it's not \"deep\" so we track this locally\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: EnvelopeStore.envelope, event: 'agreed'});\n })\n .catch(e => {\n console.log('Update failure', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleOptionSelected(e) {\n switch (e.detail.id) {\n case 'later':\n this.finishLater = true;\n this.showFinishLater = true;\n // this.router.navigate([`view/sign/${this.envelopeId}/role/${this.roleName}/saved`]);\n break;\n case 'claim':\n window.alert('This feature will be available in an upcoming release.');\n break;\n case 'decline':\n {\n const declineResult = await envelopeRecipientDecline(this.endpoint, this.envelopeId, this.roleId);\n console.log('Decline result', declineResult);\n this.isDone = true;\n }\n break;\n case 'print':\n window.print();\n break;\n case 'download':\n savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {});\n break;\n }\n }\n\n updateRecipientFieldValue(fieldName: string, updateResult: any) {\n this.recipient.fields.forEach(oldField => {\n if (oldField.name === fieldName) {\n oldField.settings = updateResult.settings;\n // TODO: When we break out other fields like value, update them here too\n updateDocumentFieldValue(oldField);\n }\n });\n }\n\n saveFieldChange(fieldName: string, fields: Record<string, any>) {\n Envelopes.updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //\n .then(updateResult => {\n this.updateRecipientFieldValue(fieldName, updateResult);\n })\n .catch(e => {\n if (e.response?.status === 401 && e.response?.data?.error === 'jwt expired') {\n // TODO: Do we want to improve the instructions here?\n console.log('[SIGN] Signing session expired');\n this.errorMessage = 'Signing session expired.';\n } else {\n console.log('[SIGN] Server error', e);\n }\n\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleFieldChange(field: IDocumentField, e: any) {\n const {value, checked} = e.target;\n\n switch (field.type) {\n case 'textbox':\n return this.saveFieldChange(field.name, {prepared: false, value});\n\n case 'checkbox_group': {\n const options = field.settings.options.map(option => ({id: option.id, checked: e.target.checked}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'radio_button_group': {\n const options = field.settings.options.map(option => ({id: option.id, selected: e.target.value === option.id}));\n return this.saveFieldChange(field.name, {prepared: false, value: {options}});\n }\n\n case 'dropdown':\n return this.saveFieldChange(field.name, {prepared: false, value: e.detail});\n\n case 'initial':\n const initialsBlob = await (await fetch(e.detail)).blob();\n return createInitials(this.endpoint, 'initial', initialsBlob) //\n .then(async newInitials => {\n const updateResult = await updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n });\n\n case 'signature':\n const signatureBlob = await (await fetch(e.detail)).blob();\n return createSignature(this.endpoint, 'signature', signatureBlob) //\n .then(async newSignature => {\n const updateResult = await updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n });\n\n case 'date':\n const iso = e.target.getAttribute('iso');\n return this.saveFieldChange(field.name, {prepared: false, value: iso});\n\n case 'timestamp':\n console.log('Updating timestamp', {value, ts: e.target.getAttribute('timestamp')});\n break;\n\n default:\n console.log('Unhandled field update', {value, checked}, field);\n break;\n }\n }\n\n isFieldValid(field: IDocumentField) {\n const {required = false} = field;\n const {result = '', value = '', base64 = ''} = field.settings || {};\n switch (field.type) {\n case 'textbox':\n switch (field.settings?.validator || '') {\n case 'email':\n return isValidEmail(result);\n case 'phone':\n return isValidPhone(result);\n default:\n return !required || result !== '';\n }\n\n case 'signature':\n case 'initial':\n return !required || base64 !== '';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'textarea':\n case 'date':\n case 'attachment':\n return !required || result !== '';\n\n case 'dropdown':\n return !required || value !== '';\n\n case 'checkbox_group':\n const checkedCount = (field.settings?.options?.filter(option => option.checked) || []).length;\n return !required || (checkedCount >= (field.settings?.minimum_checked || 0) && checkedCount <= (field.settings?.maximum_checked || 999));\n\n case 'radio_button_group':\n return !required || (field.settings?.options?.filter(option => option.selected) || []).length > 0;\n // TODO\n // case 'checkbox':\n // return <verdocs-field-checkbox style={style} value={result || ''} id={id} />;\n // case 'payment':\n // return <verdocs-field-payment style={style} field={field} id={id} />;\n default:\n return false;\n }\n }\n\n async handleNext() {\n if (this.nextSubmits) {\n try {\n const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Submitted successfully', result);\n this.showDone = true;\n this.isDone = true;\n } catch (e) {\n console.log('Error submitting', e);\n }\n\n return;\n }\n\n // Find and focus the next incomplete required field\n const requiredFields = this.recipient.fields.filter(field => field.required);\n const focusedIndex = requiredFields.findIndex(field => field.name === this.focusedField);\n\n let nextFocusedIndex = focusedIndex + 1;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n\n let nextRequiredField = requiredFields[nextFocusedIndex];\n\n // Skip signature and initial fields that are already filled in. We have to count our \"skips\" just in case, to avoid infinite loops.\n let skips = 0;\n if (skips < requiredFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && nextRequiredField.settings?.result === 'signed') {\n skips++;\n nextFocusedIndex++;\n if (nextFocusedIndex >= requiredFields.length) {\n nextFocusedIndex = 0;\n }\n nextRequiredField = requiredFields[nextFocusedIndex];\n }\n\n if (skips >= requiredFields.length) {\n nextRequiredField = null;\n }\n\n if (nextRequiredField) {\n const id = getFieldId(nextRequiredField);\n const el = document.getElementById(id) as any;\n el?.focusField();\n this.focusedField = nextRequiredField.name;\n }\n }\n\n // See if everything that \"needs to be\" filled in is, and all \"fillable fields\" are valid\n checkRecipientFields() {\n const invalidFields = this.recipient.fields.filter(field => !this.isFieldValid(field));\n if (invalidFields.length < 1) {\n this.nextButtonLabel = 'Finish';\n this.nextSubmits = true;\n } else {\n console.log('[SIGN] Remaining invalid fields', invalidFields);\n this.nextButtonLabel = 'Next';\n this.nextSubmits = false;\n }\n }\n\n attachFieldAttributes(pageInfo, field, roleIndex, el) {\n el.addEventListener('input', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));\n el.addEventListener('blur', () => this.checkRecipientFields());\n el.addEventListener('fieldChange', e => this.handleFieldChange(field, e).finally(() => this.checkRecipientFields()));\n\n el.setAttribute('roleindex', roleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n el.setAttribute('initials', this.recipient ? fullNameToInitials(this.recipient.full_name) : '');\n el.setAttribute('name', this.recipient?.full_name || '');\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n const roleIndex = getRoleIndex(EnvelopeStore.roleNames, this.recipient.role_name);\n const recipientFields = this.recipient.fields.filter(field => field.page === pageInfo.pageNumber);\n console.log('[SIGN] Page rendered, updating fields', {pageInfo, roleIndex, recipientFields});\n\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, roleIndex, {disabled: false, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, roleIndex, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, roleIndex, el);\n }\n\n // interact(el).draggable({\n // listeners: {\n // start(event) {\n // console.log('[FIELDS] Drag started', event.type, event.target);\n // },\n // move(event) {\n // const oldX = +(event.target.getAttribute('posX') || 0);\n // const oldY = +(event.target.getAttribute('posY') || 0);\n // const xScale = +(event.target.getAttribute('xScale') || 1);\n // const yScale = +(event.target.getAttribute('yScale') || 1);\n // const newX = event.dx / xScale + oldX;\n // const newY = event.dy / yScale + oldY;\n // event.target.setAttribute('posX', newX);\n // event.target.setAttribute('posy', newY);\n // updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);\n // },\n // end(event) {\n // console.log('[FIELDS] Drag ended', event);\n // // event.target.setAttribute('posX', 0);\n // // event.target.setAttribute('posy', 0);\n // // updateCssTransform(event.target, 'translate', `${0}px, ${0}px`);\n // },\n // },\n // });\n });\n\n // Render fields for \"the other\" recipients\n EnvelopeStore.envelope.recipients\n .filter(recipient => recipient.role_name !== this.recipient.role_name)\n .forEach(otherRecipient => {\n const otherRoleIndex = getRoleIndex(EnvelopeStore.roleNames, otherRecipient.role_name);\n const recipientFields = otherRecipient.fields.filter(field => field.page === pageInfo.pageNumber);\n\n // We don't render other recipients' fields if they've already acted, because those values are now stamped into the document page.\n // TODO: Do we want to render alternate treatments for recipients who have declined (red boxes?) and/or if the envelope is cancelled?\n // TODO: When doing server-side rendering we probably want to \"stamp\" values into the rendered PDF only once the recipient is done\n // acting. Do this once vSign is in Production.\n // TODO: Changed tacks here. During signing we show the template PDFs and everybody's fields, filled in or no. When done, we switch\n // to showing the envelope PDFs with stamped-in values. Confirm this is a good approach.\n // if (!['submitted', 'signed'].includes(otherRecipient.status)) {\n recipientFields.forEach(field => {\n const el = renderDocumentField(field, pageInfo, otherRoleIndex, {\n disabled: true,\n editable: false,\n draggable: false,\n done: this.isDone,\n });\n if (!el) {\n return;\n }\n\n // TODO: Research why this occurs. There are cases when we're getting \"el.setAttribute is not a function\"\n if (el.setAttribute) {\n el.setAttribute('roleindex', otherRoleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n }\n });\n // }\n });\n\n this.checkRecipientFields();\n }\n\n render() {\n if (EnvelopeStore.loading || !EnvelopeStore.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n const menuOptions = [\n {id: 'later', label: 'Finish Later'}, //\n // {id: 'claim', label: 'Claim the Document', disabled: true},\n {id: 'decline', label: 'Decline to Sign'},\n {id: 'print', label: 'Print Without Signing', disabled: true},\n {id: 'download', label: 'Download'},\n ];\n\n return (\n <Host class={{agreed: this.agreed}}>\n {!this.isDone && !this.finishLater && <div class=\"intro\">Please review and act on these documents.</div>}\n\n {!this.isDone && (\n <div class=\"header\">\n {!this.isDone && !this.finishLater && <verdocs-dropdown options={menuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />}\n\n {!this.agreed ? (\n <div class=\"agree\">\n <verdocs-checkbox name=\"agree\" label=\"I agree to use electronic records and signatures.\" onInput={() => this.handleClickAgree()} />\n </div>\n ) : (\n <Fragment>\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{EnvelopeStore.envelope.name}</div>\n <div style={{flex: '1'}} />\n <div innerHTML={PrintIcon} style={{width: '24px', height: '24px', fill: '#fff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#fff', cursor: 'pointer', margin: '0 16px', maginRight: '30px'}}\n onClick={() => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {})}\n />\n </Fragment>\n )}\n\n {!this.isDone && !this.finishLater && <verdocs-button size=\"small\" label={this.nextButtonLabel} disabled={!this.agreed} onClick={() => this.handleNext()} />}\n </div>\n )}\n\n {!this.isDone && !this.agreed ? <div class=\"cover\" /> : <div style={{display: 'none'}} />}\n\n {this.isDone ? (\n // <div>test</div>\n <verdocs-view endpoint={this.endpoint} envelopeId={this.envelopeId} onSdkError={e => this.sdkError?.emit(e.detail)} />\n ) : (\n <div class=\"document\">\n {(EnvelopeStore.envelope.documents || []).map(envelopeDocument => {\n const pages = [...(envelopeDocument?.pages || [])];\n pages.sort((a, b) => a.sequence - b.sequence);\n\n return (\n <Fragment>\n {pages.map(page => {\n // In signing mode we show the original template page with all the recipient fields so we can show source formatting and\n // where everything went. This is also a visual indicator when optional fields weren't filled in by previous actors, or\n // future signers still need to act. Once we're \"done\" we flip to showing the envelope's documents which have the final\n // field vales (so far) stamped into them.\n const templatePage = EnvelopeStore.template?.pages.find(p => p.sequence === page.sequence);\n // TODO: Confirm that a pure page-number match is good enough to find the matching template page. We need to make sure\n // we either don't reset our page numbers for additional attachments, or add match-on identifiers to work around that.\n // console.log('tp', templatePage, page);\n return (\n <verdocs-document-page\n pageImageUri={templatePage?.display_uri || page.display_uri}\n virtualWidth={612}\n virtualHeight={792}\n pageNumber={page.sequence}\n onPageRendered={e => this.handlePageRendered(e)}\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n )}\n\n {this.showFinishLater && (\n <verdocs-ok-dialog\n heading=\"You've saved your document to finish later.\"\n message=\"To complete the document, use the link in the original email notification inviting you to review and finish the document.\"\n onNext={() => (this.showFinishLater = false)}\n />\n )}\n\n {this.errorMessage && <verdocs-ok-dialog heading=\"Network Error\" message={this.errorMessage} onNext={() => (this.errorMessage = '')} />}\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message=\"You can access the Verdoc 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.\"\n onNext={() => (this.showDone = false)}\n />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -3,9 +3,9 @@ export default {
|
|
|
3
3
|
title: 'Embeds/Sign',
|
|
4
4
|
component: 'verdocs-sign',
|
|
5
5
|
args: {
|
|
6
|
-
envelopeId: '
|
|
6
|
+
envelopeId: 'b4a03f7e-8a2b-4752-ac65-621114a1f878',
|
|
7
7
|
roleId: 'Seller',
|
|
8
|
-
inviteCode: '
|
|
8
|
+
inviteCode: 'e4bee24c3d2795f340ceeb53f6fefc1a',
|
|
9
9
|
},
|
|
10
10
|
argTypes: {},
|
|
11
11
|
parameters: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdocs-sign.stories.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-sign/verdocs-sign.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,UAAU,CAAC;AAG9B,eAAe;EACb,KAAK,EAAE,aAAa;EACpB,SAAS,EAAE,cAAc;EACzB,IAAI,EAAE;IACJ,UAAU,EAAE,sCAAsC;IAClD,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,kCAAkC;GAC/C;EACD,QAAQ,EAAE,EAAE;EACZ,UAAU,EAAE;IACV,MAAM,EAAE,YAAY;GACrB;CACM,CAAC;AAEV,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAC,EAAE,EAAE,CAAC,IAAI,CAAA,6BAA6B,UAAU,YAAY,MAAM,gBAAgB,UAAU,KAAK,CAAC","sourcesContent":["import {html} from 'lit-html';\nimport {Meta} from '@storybook/web-components';\n\nexport default {\n title: 'Embeds/Sign',\n component: 'verdocs-sign',\n args: {\n envelopeId: '
|
|
1
|
+
{"version":3,"file":"verdocs-sign.stories.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-sign/verdocs-sign.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,UAAU,CAAC;AAG9B,eAAe;EACb,KAAK,EAAE,aAAa;EACpB,SAAS,EAAE,cAAc;EACzB,IAAI,EAAE;IACJ,UAAU,EAAE,sCAAsC;IAClD,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,kCAAkC;GAC/C;EACD,QAAQ,EAAE,EAAE;EACZ,UAAU,EAAE;IACV,MAAM,EAAE,YAAY;GACrB;CACM,CAAC;AAEV,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAC,EAAE,EAAE,CAAC,IAAI,CAAA,6BAA6B,UAAU,YAAY,MAAM,gBAAgB,UAAU,KAAK,CAAC","sourcesContent":["import {html} from 'lit-html';\nimport {Meta} from '@storybook/web-components';\n\nexport default {\n title: 'Embeds/Sign',\n component: 'verdocs-sign',\n args: {\n envelopeId: 'b4a03f7e-8a2b-4752-ac65-621114a1f878',\n roleId: 'Seller',\n inviteCode: 'e4bee24c3d2795f340ceeb53f6fefc1a',\n },\n argTypes: {},\n parameters: {\n layout: 'fullscreen',\n },\n} as Meta;\n\nexport const Sign = ({envelopeId, roleId, inviteCode}) => html`<verdocs-sign .envelopeId=${envelopeId} .roleId=${roleId} .inviteCode=${inviteCode} />`;\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getEnvelope } from '@verdocs/js-sdk/Envelopes/Envelopes';
|
|
2
2
|
import EnvelopeStore from './envelopeStore';
|
|
3
|
+
import { getTemplate } from '@verdocs/js-sdk/Templates/Templates';
|
|
3
4
|
// Allows envelope data to be cached for reuse between components, without parent components having to prop-drill entire envelopes into
|
|
4
5
|
// child elements.
|
|
5
6
|
export const getEnvelopeById = async (endpoint, envelopeId) => {
|
|
@@ -23,6 +24,12 @@ export const getEnvelopeById = async (endpoint, envelopeId) => {
|
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
EnvelopeStore.envelope = envelope;
|
|
27
|
+
const template = await getTemplate(endpoint, envelope.template_id, true);
|
|
28
|
+
if (!envelope) {
|
|
29
|
+
console.log('[ENVELOPES] Unable to load template');
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
EnvelopeStore.template = template;
|
|
26
33
|
EnvelopeStore.loading = false;
|
|
27
34
|
}
|
|
28
35
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Envelopes.js","sourceRoot":"","sources":["../../src/utils/Envelopes.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,qCAAqC,CAAC;AAChE,OAAO,aAAa,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Envelopes.js","sourceRoot":"","sources":["../../src/utils/Envelopes.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,qCAAqC,CAAC;AAChE,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,WAAW,EAAC,MAAM,qCAAqC,CAAC;AAEhE,uIAAuI;AACvI,kBAAkB;AAClB,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,QAAyB,EAAE,UAAkB,EAAE,EAAE;;EACrF,IAAI,CAAC,UAAU,EAAE;IACf,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IACxD,OAAO;GACR;EAED,IAAI,CAAA,MAAA,aAAa,CAAC,QAAQ,0CAAE,EAAE,MAAK,UAAU,EAAE;IAC7C,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;IACxE,OAAO;GACR;EAED,aAAa,CAAC,KAAK,GAAG,EAAE,CAAC;EACzB,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;EAC7B,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC;EAE9B,IAAI;IACF,OAAO,CAAC,GAAG,CAAC,gCAAgC,UAAU,EAAE,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IAC/D,IAAI,CAAC,QAAQ,EAAE;MACb,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;MACnD,OAAO;KACR;IAED,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAElC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;IACzE,IAAI,CAAC,QAAQ,EAAE;MACb,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;MACnD,OAAO;KACR;IAED,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAClC,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;GAC/B;EAAC,OAAO,CAAC,EAAE;IACV,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;IAC9B,aAAa,CAAC,KAAK,GAAG,CAAA,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,0CAAE,MAAM,MAAK,GAAG,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,CAAC,CAAC;GACT;AACH,CAAC,CAAC","sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {getEnvelope} from '@verdocs/js-sdk/Envelopes/Envelopes';\nimport EnvelopeStore from './envelopeStore';\nimport {getTemplate} from '@verdocs/js-sdk/Templates/Templates';\n\n// Allows envelope data to be cached for reuse between components, without parent components having to prop-drill entire envelopes into\n// child elements.\nexport const getEnvelopeById = async (endpoint: VerdocsEndpoint, envelopeId: string) => {\n if (!envelopeId) {\n console.log(`[ENVELOPES] Missing required envelope ID`);\n return;\n }\n\n if (EnvelopeStore.envelope?.id === envelopeId) {\n console.log(`[ENVELOPES] Skipping load for already-loaded envelope ID`);\n return;\n }\n\n EnvelopeStore.error = '';\n EnvelopeStore.loading = true;\n EnvelopeStore.envelope = null;\n\n try {\n console.log(`[ENVELOPES] Loading envelope ${envelopeId}`);\n const envelope = await getEnvelope(endpoint, envelopeId, true);\n if (!envelope) {\n console.log('[ENVELOPES] Unable to load envelope');\n return;\n }\n\n EnvelopeStore.envelope = envelope;\n\n const template = await getTemplate(endpoint, envelope.template_id, true);\n if (!envelope) {\n console.log('[ENVELOPES] Unable to load template');\n return;\n }\n\n EnvelopeStore.template = template;\n EnvelopeStore.loading = false;\n } catch (e) {\n EnvelopeStore.loading = false;\n EnvelopeStore.error = e?.response?.status === 401 ? 'Authentication required' : e.message;\n console.log('[ENVELOPES] Error loading envelope', e);\n throw e;\n }\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envelopeStore.js","sourceRoot":"","sources":["../../src/utils/envelopeStore.ts"],"names":[],"mappings":"AAAA,sIAAsI;AACtI,kIAAkI;AAElI,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"envelopeStore.js","sourceRoot":"","sources":["../../src/utils/envelopeStore.ts"],"names":[],"mappings":"AAAA,sIAAsI;AACtI,kIAAkI;AAElI,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAI3C,MAAM,EAAC,KAAK,EAAE,QAAQ,EAAC,GAAG,WAAW,CAAC;EACpC,QAAQ,EAAE,IAAwB;EAClC,QAAQ,EAAE,IAAwB;EAClC,YAAY,EAAE,CAAC;EACf,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,EAAE;EAET,SAAS,EAAE,EAAc;EACzB,KAAK,EAAE,KAAK;CACb,CAAC,CAAC;AAEH,QAAQ,CAAC,UAAU,EAAE,KAAK,EAAC,WAAW,EAAC,EAAE;EACvC,IAAI,CAAC,WAAW,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC;IACrB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;IACjB,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;IACvB,OAAO;GACR;EAED,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,WAAW,CAAC,CAAC;EAE5D,KAAK,CAAC,SAAS,GAAG,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;EAC/E,WAAW,CAAC,UAAU,CAAC;EACvB,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["// NOTE: Do not attempt to convert this to a named-export module. It triggers compilation issues in Rollup that I spent days trying to\n// resolve. This needs to export a single default value of the store's state. Any helper functions should go in Templates.ts here.\n\nimport {createStore} from '@stencil/store';\nimport {IEnvelope} from '@verdocs/js-sdk/Envelopes/Types';\nimport {ITemplate} from '@verdocs/js-sdk/Templates/Types';\n\nconst {state, onChange} = createStore({\n envelope: null as IEnvelope | null,\n template: null as ITemplate | null,\n loadProgress: 0,\n loading: true,\n error: '',\n\n roleNames: [] as string[],\n dirty: false,\n});\n\nonChange('envelope', async newEnvelope => {\n if (!newEnvelope) {\n console.log('[ENVELOPESTORE] Clearing envelope');\n state.roleNames = [];\n state.dirty = false;\n state.loading = false;\n state.error = '';\n state.loadProgress = 0;\n return;\n }\n\n console.log('[ENVELOPESTORE] Loaded envelope', newEnvelope);\n\n state.roleNames = newEnvelope.recipients.map(recipient => recipient.role_name);\n newEnvelope.recipients;\n console.log('[ENVELOPESTORE] Loaded roles', state.roleNames);\n});\n\nexport default state;\n"]}
|
|
@@ -62,6 +62,16 @@ export const getFieldId = (field) => {
|
|
|
62
62
|
export const getFieldOptionId = (field, index) => {
|
|
63
63
|
return `verdocs-doc-fld-${field.name}-${index}`;
|
|
64
64
|
};
|
|
65
|
+
export const updateDocumentFieldValue = (field) => {
|
|
66
|
+
const id = getFieldId(field);
|
|
67
|
+
const existingField = document.getElementById(id);
|
|
68
|
+
if (existingField) {
|
|
69
|
+
existingField.field = field;
|
|
70
|
+
existingField.setAttribute('id', id); // We need this to trigger a re-render
|
|
71
|
+
existingField.setAttribute('disabled', true); // We need this to trigger a re-render
|
|
72
|
+
existingField.setAttribute('disabled', false); // We need this to trigger a re-render
|
|
73
|
+
}
|
|
74
|
+
};
|
|
65
75
|
export const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
|
|
66
76
|
const { disabled = false, editable = false, draggable = false, done = false } = fieldOptions;
|
|
67
77
|
const controlsDiv = document.getElementById(docPage.containerId + '-controls');
|