@verdocs/web-sdk 1.9.24 → 1.9.26
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-a9646e09.js → Envelopes-d44c4a28.js} +3 -2
- package/dist/cjs/Envelopes-d44c4a28.js.map +1 -0
- package/dist/cjs/{VerdocsEndpoint-a9bf9d59.js → VerdocsEndpoint-257ebdb3.js} +7 -5
- package/dist/cjs/VerdocsEndpoint-257ebdb3.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js +154 -0
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js.map +1 -0
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-send.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +10 -8
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +1 -0
- package/dist/collection/components/elements/verdocs-field-checkbox/verdocs-field-checkbox.css +1 -1
- package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.css +903 -0
- package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.css +3 -0
- package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.css +1 -0
- package/dist/collection/components/elements/verdocs-field-timestamp/verdocs-field-timestamp.css +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +6 -11
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +7 -5
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +2 -170
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js.map +1 -1
- package/dist/collection/utils/Envelopes.js +2 -1
- package/dist/collection/utils/Envelopes.js.map +1 -1
- package/dist/components/VerdocsEndpoint.js +6 -4
- package/dist/components/VerdocsEndpoint.js.map +1 -1
- package/dist/components/templateStore.js +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/components/verdocs-field-checkbox.js +1 -1
- package/dist/components/verdocs-field-checkbox.js.map +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-date.js.map +1 -1
- package/dist/components/verdocs-field-radio-button.js +1 -1
- package/dist/components/verdocs-field-radio-button.js.map +1 -1
- package/dist/components/verdocs-field-textbox.js +1 -1
- package/dist/components/verdocs-field-textbox.js.map +1 -1
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-field-timestamp.js.map +1 -1
- package/dist/components/verdocs-ok-dialog2.js +1 -1
- package/dist/components/verdocs-ok-dialog2.js.map +1 -1
- package/dist/components/verdocs-sign.js +26 -19
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-view.js +1 -259
- package/dist/components/verdocs-view.js.map +1 -1
- package/dist/components/verdocs-view2.js +152 -0
- package/dist/components/verdocs-view2.js.map +1 -0
- package/dist/docs.json +13 -2
- package/dist/esm/{Envelopes-bd915f3e.js → Envelopes-28a4c67f.js} +3 -2
- package/dist/esm/Envelopes-28a4c67f.js.map +1 -0
- package/dist/esm/{VerdocsEndpoint-76dbf9b9.js → VerdocsEndpoint-28ba21cc.js} +7 -5
- package/dist/esm/VerdocsEndpoint-28ba21cc.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm/verdocs-dropdown_2.entry.js +149 -0
- package/dist/esm/verdocs-dropdown_2.entry.js.map +1 -0
- package/dist/esm/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm/verdocs-field-checkbox.entry.js.map +1 -1
- package/dist/esm/verdocs-field-date.entry.js +1 -1
- package/dist/esm/verdocs-field-date.entry.js.map +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js.map +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js.map +1 -1
- package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm/verdocs-field-timestamp.entry.js.map +1 -1
- package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm/verdocs-ok-dialog.entry.js.map +1 -1
- package/dist/esm/verdocs-preview.entry.js +1 -1
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-send.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +10 -8
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-template-create_4.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/Envelopes-28a4c67f.js +2 -0
- package/dist/esm-es5/Envelopes-28a4c67f.js.map +1 -0
- package/dist/esm-es5/{VerdocsEndpoint-76dbf9b9.js → VerdocsEndpoint-28ba21cc.js} +2 -2
- package/dist/esm-es5/{VerdocsEndpoint-76dbf9b9.js.map → VerdocsEndpoint-28ba21cc.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/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_2.entry.js +2 -0
- package/dist/esm-es5/verdocs-dropdown_2.entry.js.map +1 -0
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.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-view/verdocs-view.d.ts +0 -1
- package/dist/verdocs-web-sdk/p-070ba589.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-070ba589.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-75f6a179.system.entry.js → p-0ca01601.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-75f6a179.system.entry.js.map → p-0ca01601.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-1058c062.system.js +2 -0
- package/dist/verdocs-web-sdk/p-1058c062.system.js.map +1 -0
- package/dist/verdocs-web-sdk/p-15aa525d.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-15aa525d.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-6524809d.entry.js → p-1cb6f31a.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6524809d.entry.js.map → p-1cb6f31a.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-93ada77f.system.entry.js → p-1f18d214.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-93ada77f.system.entry.js.map → p-1f18d214.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-8251b9eb.entry.js → p-23e0d562.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-8251b9eb.entry.js.map → p-23e0d562.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-4363499a.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-4363499a.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-4b516c47.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-4b516c47.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-61e0f6dd.system.entry.js → p-4d371bfe.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-61e0f6dd.system.entry.js.map → p-4d371bfe.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-a0259b33.system.entry.js → p-5597170d.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a0259b33.system.entry.js.map → p-5597170d.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-71de4718.entry.js → p-577d46e3.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-71de4718.entry.js.map → p-577d46e3.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-d5af4c62.entry.js → p-5a08e378.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d5af4c62.entry.js.map → p-5a08e378.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-1f1127dd.js → p-5e67c42f.js} +2 -2
- package/dist/verdocs-web-sdk/{p-1f1127dd.js.map → p-5e67c42f.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-5f036dfe.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-5f036dfe.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-27f3e394.entry.js → p-619a388e.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-27f3e394.entry.js.map → p-619a388e.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-19435eaf.entry.js → p-695a3cce.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-19435eaf.entry.js.map → p-695a3cce.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-6ec79ddc.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-6ec79ddc.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-74401f2e.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-74401f2e.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-cf1ed6b8.system.js → p-7a6c829f.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-cf1ed6b8.system.js.map → p-7a6c829f.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-08110f98.entry.js → p-7fd610f5.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-08110f98.entry.js.map → p-7fd610f5.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a9413269.entry.js → p-87a424a0.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a9413269.entry.js.map → p-87a424a0.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-2557ce63.system.entry.js → p-9dc3b579.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2557ce63.system.entry.js.map → p-9dc3b579.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-d2c1dcf9.system.entry.js → p-a42a5853.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d2c1dcf9.system.entry.js.map → p-a42a5853.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a526fa66.system.entry.js → p-a98ced34.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a526fa66.system.entry.js.map → p-a98ced34.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-b5f64429.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-b5f64429.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-d9b9a354.system.entry.js → p-ba6c3671.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d9b9a354.system.entry.js.map → p-ba6c3671.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-d4afe7a5.entry.js → p-c41d9fc0.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d4afe7a5.entry.js.map → p-c41d9fc0.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-d86dc6d1.system.entry.js → p-c6de4457.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d86dc6d1.system.entry.js.map → p-c6de4457.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-c731755d.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-c731755d.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-da9f0046.system.entry.js → p-db837a46.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-da9f0046.system.entry.js.map → p-db837a46.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-de06e0c6.js +2 -0
- package/dist/verdocs-web-sdk/p-de06e0c6.js.map +1 -0
- package/dist/verdocs-web-sdk/p-e02e05a2.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-e02e05a2.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-474155b8.system.entry.js → p-f47224c8.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-474155b8.system.entry.js.map → p-f47224c8.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-958a833f.entry.js → p-f68306f5.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-958a833f.entry.js.map → p-f68306f5.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-f9103136.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-f9103136.entry.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 +2 -2
- package/dist/cjs/Envelopes-a9646e09.js.map +0 -1
- package/dist/cjs/VerdocsEndpoint-a9bf9d59.js.map +0 -1
- package/dist/cjs/verdocs-dropdown.cjs.entry.js +0 -91
- package/dist/cjs/verdocs-dropdown.cjs.entry.js.map +0 -1
- package/dist/cjs/verdocs-view.cjs.entry.js +0 -239
- package/dist/cjs/verdocs-view.cjs.entry.js.map +0 -1
- package/dist/components/Envelopes.js +0 -62
- package/dist/components/Envelopes.js.map +0 -1
- package/dist/esm/Envelopes-bd915f3e.js.map +0 -1
- package/dist/esm/VerdocsEndpoint-76dbf9b9.js.map +0 -1
- package/dist/esm/verdocs-dropdown.entry.js +0 -87
- package/dist/esm/verdocs-dropdown.entry.js.map +0 -1
- package/dist/esm/verdocs-view.entry.js +0 -235
- package/dist/esm/verdocs-view.entry.js.map +0 -1
- package/dist/esm-es5/Envelopes-bd915f3e.js +0 -2
- package/dist/esm-es5/Envelopes-bd915f3e.js.map +0 -1
- package/dist/esm-es5/verdocs-dropdown.entry.js +0 -2
- package/dist/esm-es5/verdocs-dropdown.entry.js.map +0 -1
- package/dist/esm-es5/verdocs-view.entry.js +0 -2
- package/dist/esm-es5/verdocs-view.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-05433ef8.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-05433ef8.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3622cb3c.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-3622cb3c.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-4e1fc08d.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-4e1fc08d.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-4e775928.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-4e775928.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-7e140c6b.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-7e140c6b.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-89641895.system.js +0 -2
- package/dist/verdocs-web-sdk/p-89641895.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-abd01c86.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-abd01c86.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-be67bcbf.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-be67bcbf.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-c314c231.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c314c231.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d5c00a37.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d5c00a37.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d774ad24.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d774ad24.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d942510c.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d942510c.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-dbb4398c.js +0 -2
- package/dist/verdocs-web-sdk/p-dbb4398c.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e7295a17.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e7295a17.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-eeabb91a.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-eeabb91a.entry.js.map +0 -1
|
@@ -40,21 +40,16 @@ verdocs-sign .header .title {
|
|
|
40
40
|
}
|
|
41
41
|
verdocs-sign .intro {
|
|
42
42
|
width: 100%;
|
|
43
|
-
height: 60px;
|
|
44
43
|
display: flex;
|
|
45
|
-
|
|
46
|
-
flex-direction: row;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
}
|
|
50
|
-
verdocs-sign .intro .inner {
|
|
51
|
-
width: 100%;
|
|
44
|
+
flex: 0 0 60px;
|
|
52
45
|
color: #111111;
|
|
53
|
-
padding: 0
|
|
54
|
-
font-size:
|
|
46
|
+
padding: 0 15px;
|
|
47
|
+
font-size: 18px;
|
|
55
48
|
font-weight: 500;
|
|
56
49
|
line-height: 28px;
|
|
57
|
-
|
|
50
|
+
flex-direction: row;
|
|
51
|
+
background: #ffffff;
|
|
52
|
+
align-items: center;
|
|
58
53
|
}
|
|
59
54
|
verdocs-sign .cover {
|
|
60
55
|
top: 0;
|
|
@@ -158,7 +158,6 @@ export class VerdocsSign {
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
async handleFieldChange(field, e) {
|
|
161
|
-
console.log('fieldChange', field, e, e.target.value);
|
|
162
161
|
const { value, checked } = e.target;
|
|
163
162
|
switch (field.type) {
|
|
164
163
|
case 'textbox':
|
|
@@ -290,12 +289,13 @@ export class VerdocsSign {
|
|
|
290
289
|
}
|
|
291
290
|
// See if everything that "needs to be" filled in is, and all "fillable fields" are valid
|
|
292
291
|
checkRecipientFields() {
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
292
|
+
const invalidFields = this.recipient.fields.filter(field => !this.isFieldValid(field));
|
|
293
|
+
if (invalidFields.length < 1) {
|
|
295
294
|
this.nextButtonLabel = 'Finish';
|
|
296
295
|
this.nextSubmits = true;
|
|
297
296
|
}
|
|
298
297
|
else {
|
|
298
|
+
console.log('[SIGN] Remaining invalid fields', invalidFields);
|
|
299
299
|
this.nextSubmits = false;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
@@ -381,14 +381,16 @@ export class VerdocsSign {
|
|
|
381
381
|
{ id: 'print', label: 'Print Without Signing', disabled: true },
|
|
382
382
|
{ id: 'download', label: 'Download' },
|
|
383
383
|
];
|
|
384
|
-
return (h(Host, { class: { agreed: (_a = this.recipient) === null || _a === void 0 ? void 0 : _a.agreed } }, !this.isDone && !this.finishLater &&
|
|
384
|
+
return (h(Host, { class: { agreed: (_a = this.recipient) === null || _a === void 0 ? void 0 : _a.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) }), !((_b = this.recipient) === null || _b === void 0 ? void 0 : _b.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: !((_c = this.recipient) === null || _c === void 0 ? void 0 : _c.agreed), onClick: () => this.handleNext() }))), !this.isDone && !((_d = this.recipient) === null || _d === void 0 ? void 0 : _d.agreed) ? h("div", { class: "cover" }) : h("div", { style: { display: 'none' } }), this.isDone ? (
|
|
385
|
+
// <div>test</div>
|
|
386
|
+
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 => {
|
|
385
387
|
const pages = [...((envelopeDocument === null || envelopeDocument === void 0 ? void 0 : envelopeDocument.pages) || [])];
|
|
386
388
|
pages.sort((a, b) => a.sequence - b.sequence);
|
|
387
389
|
return (h(Fragment, null, pages.map(page => (h("verdocs-document-page", { pageImageUri: page.display_uri, virtualWidth: 612, virtualHeight: 792, pageNumber: page.sequence, onPageRendered: e => this.handlePageRendered(e), layers: [
|
|
388
390
|
{ name: 'page', type: 'canvas' },
|
|
389
391
|
{ name: 'controls', type: 'div' },
|
|
390
392
|
] })))));
|
|
391
|
-
})), 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) }))));
|
|
393
|
+
}))), 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) }))));
|
|
392
394
|
}
|
|
393
395
|
static get is() { return "verdocs-sign"; }
|
|
394
396
|
static get originalStyleUrls() {
|
|
@@ -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,EAAC,kBAAkB,EAAE,UAAU,EAAE,YAAY,EA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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 console.log('fieldChange', field, e, e.target.value);\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 someFieldsInvalid = this.recipient.fields.map(field => this.isFieldValid(field)).some(fieldValid => !fieldValid);\n if (!someFieldsInvalid) {\n this.nextButtonLabel = 'Finish';\n this.nextSubmits = true;\n } else {\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 && (\n <div class=\"intro\">\n <div class=\"inner\">Please review and act on these documents.</div>\n </div>\n )}\n\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: '#ffffff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#ffffff', 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 {!this.isDone && !this.recipient?.agreed ? <div class=\"cover\" /> : <div style={{display: 'none'}} />}\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 {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"]}
|
|
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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,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} 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 />\n )}\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { VerdocsEndpoint } from '@verdocs/js-sdk';
|
|
2
2
|
import { h, Host, Fragment } from '@stencil/core';
|
|
3
|
-
import { getRoleIndex, renderDocumentField, savePDF } from '../../../utils/utils';
|
|
4
3
|
import { getEnvelopeById } from '../../../utils/Envelopes';
|
|
5
4
|
import EnvelopeStore from '../../../utils/envelopeStore';
|
|
6
5
|
import { SDKError } from '../../../utils/errors';
|
|
6
|
+
import { savePDF } from '../../../utils/utils';
|
|
7
7
|
const 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>`;
|
|
8
8
|
const DownloadIcon = `<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"></path></svg>`;
|
|
9
9
|
/**
|
|
@@ -22,7 +22,7 @@ export class VerdocsView {
|
|
|
22
22
|
async componentDidLoad() {
|
|
23
23
|
var _a, _b, _c;
|
|
24
24
|
if (!this.envelopeId) {
|
|
25
|
-
console.error(`[VIEW] Missing
|
|
25
|
+
console.error(`[VIEW] Missing required envelopeId`);
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
try {
|
|
@@ -32,177 +32,9 @@ export class VerdocsView {
|
|
|
32
32
|
(_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
// Determine whether a page is "rotated" (in either direction)
|
|
36
|
-
// isRotated(rotation) {
|
|
37
|
-
// return rotation !== 0 && rotation % 180 !== 0;
|
|
38
|
-
// }
|
|
39
|
-
// Render one document page. Note that pageNumber is 1-based.
|
|
40
|
-
// async renderPage(pageNumber: number): Promise<void> {
|
|
41
|
-
// const domPage = this.domPages[pageNumber];
|
|
42
|
-
//
|
|
43
|
-
// // Two async operations happen here, loading the PDF and rendering the DOM div/canvas placeholders to draw the pages on.
|
|
44
|
-
// if (!domPage) {
|
|
45
|
-
// console.log('[VIEW] Skipping rendering page not yet in DOM', {pageNumber});
|
|
46
|
-
// return;
|
|
47
|
-
// }
|
|
48
|
-
//
|
|
49
|
-
// const pageMetrics = this.sourcePageMetrics[pageNumber];
|
|
50
|
-
//
|
|
51
|
-
// console.log('[VIEW] Rendering page', {pageNumber, pageMetrics, domPage});
|
|
52
|
-
// try {
|
|
53
|
-
// // const pdfPage = await this.pdfDocument.getPage(pageNumber);
|
|
54
|
-
// // const viewport = pdfPage.getViewport({scale: domPage.xScale});
|
|
55
|
-
// // console.log('[VIEW] Page viewport', domPage.xScale, viewport);
|
|
56
|
-
//
|
|
57
|
-
// // const canvas = document.getElementById(`${domPage.containerId}-page`) as HTMLCanvasElement | null;
|
|
58
|
-
// // if (!canvas) {
|
|
59
|
-
// // console.log('[VIEW] Unable to find canvas element');
|
|
60
|
-
// // return;
|
|
61
|
-
// // }
|
|
62
|
-
// //
|
|
63
|
-
// // canvas.width = domPage.renderedWidth;
|
|
64
|
-
// // canvas.height = domPage.renderedHeight;
|
|
65
|
-
// // const canvasContext = canvas.getContext('2d');
|
|
66
|
-
// // canvasContext.clearRect(0, 0, domPage.renderedWidth, domPage.renderedHeight);
|
|
67
|
-
// // await pdfPage.render({canvasContext, viewport});
|
|
68
|
-
//
|
|
69
|
-
// this.pageRendered.emit({
|
|
70
|
-
// renderedPage: domPage,
|
|
71
|
-
// sourcePageMetrics: pageMetrics,
|
|
72
|
-
// pages: this.domPages,
|
|
73
|
-
// });
|
|
74
|
-
// } catch (e) {
|
|
75
|
-
// this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));
|
|
76
|
-
// console.warn('[VIEW] Error rendering page', e);
|
|
77
|
-
// }
|
|
78
|
-
// }
|
|
79
|
-
// async renderPages(): Promise<void> {
|
|
80
|
-
// const pageNumbersToRender = integerSequence(1, this.numPages);
|
|
81
|
-
// for await (let pageNumber of pageNumbersToRender) {
|
|
82
|
-
// try {
|
|
83
|
-
// await this.renderPage(pageNumber);
|
|
84
|
-
// } catch (e) {
|
|
85
|
-
// this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));
|
|
86
|
-
// console.warn('[VIEW] Error rendering pages', e);
|
|
87
|
-
// }
|
|
88
|
-
// }
|
|
89
|
-
// }
|
|
90
|
-
// onProgress(progress: OnProgressParameters) {
|
|
91
|
-
// console.log(`[VIEW] Progress ${Math.floor((progress.loaded / progress.total) * 100)} (${progress.loaded} / ${progress.total})`);
|
|
92
|
-
// this.loadProgress = Math.floor((100 * progress.loaded) / progress.total);
|
|
93
|
-
// }
|
|
94
|
-
// After a document is done loading, go through its pages to get their dimensions
|
|
95
|
-
// async parsePageMetrics(pdfDocument: pdfjsLib.PDFDocumentProxy) {
|
|
96
|
-
// const pageNumbersToRender = integerSequence(1, pdfDocument.numPages);
|
|
97
|
-
//
|
|
98
|
-
// for await (let pageNumber of pageNumbersToRender) {
|
|
99
|
-
// const pdfPage = await pdfDocument.getPage(1);
|
|
100
|
-
// const [pageX0, pageY0, pageX1, pageY1] = pdfPage.view;
|
|
101
|
-
// this.sourcePageMetrics[pageNumber] = {width: pageX1 - pageX0, height: pageY1 - pageY0};
|
|
102
|
-
// }
|
|
103
|
-
//
|
|
104
|
-
// console.log('[VIEW] Parsed page metrics', this.sourcePageMetrics);
|
|
105
|
-
// }
|
|
106
|
-
// loadAndRender(src: string): void {
|
|
107
|
-
// console.log('[VIEW] Loading', src);
|
|
108
|
-
//
|
|
109
|
-
// const token = this.endpoint.getToken();
|
|
110
|
-
// const httpHeaders = token ? {Authorization: `Bearer ${token}`} : {};
|
|
111
|
-
//
|
|
112
|
-
// const source = {
|
|
113
|
-
// url: src,
|
|
114
|
-
// cMapUrl: CMAPS_URL,
|
|
115
|
-
// cMapPacked: true,
|
|
116
|
-
// httpHeaders,
|
|
117
|
-
// withCredentials: true,
|
|
118
|
-
// stopAtErrors: true,
|
|
119
|
-
// verbosity: pdfjsLib.VerbosityLevel.WARNINGS,
|
|
120
|
-
// // verbosity: pdfjsLib.VerbosityLevel.INFOS,
|
|
121
|
-
// } as DocumentInitParameters;
|
|
122
|
-
//
|
|
123
|
-
// // @ts-ignore
|
|
124
|
-
// const loadingTask = pdf.getDocument(source, null, null, this.onProgress);
|
|
125
|
-
// loadingTask.onProgress = this.onProgress;
|
|
126
|
-
// loadingTask.promise
|
|
127
|
-
// .then(async (pdfDocument: pdfjsLib.PDFDocumentProxy) => {
|
|
128
|
-
// await this.parsePageMetrics(pdfDocument);
|
|
129
|
-
//
|
|
130
|
-
// this.pdfDocument = pdfDocument;
|
|
131
|
-
// this.numPages = pdfDocument.numPages;
|
|
132
|
-
// this.fingerprints = pdfDocument.fingerprints;
|
|
133
|
-
// console.log(`[VIEW] Got PDF document fingerprints "${this.fingerprints.join(', ')}", ${this.numPages} page(s)`);
|
|
134
|
-
//
|
|
135
|
-
// // We don't try to render the pages here, setting loadProtress triggers that by adding the individual page entries in
|
|
136
|
-
// // DOM in render() below. Each page then fires onPageRendered when it is ready to receive content.
|
|
137
|
-
// this.loadProgress = 100;
|
|
138
|
-
// })
|
|
139
|
-
// .catch(e => {
|
|
140
|
-
// this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));
|
|
141
|
-
// console.log('[VIEW] Loading error', e);
|
|
142
|
-
// });
|
|
143
|
-
// }
|
|
144
|
-
// async handlePageRendered(e: any) {
|
|
145
|
-
// e.stopPropagation();
|
|
146
|
-
//
|
|
147
|
-
// const domPage = e.detail as IDocumentPageInfo;
|
|
148
|
-
// this.domPages[domPage.pageNumber] = domPage;
|
|
149
|
-
// await this.renderPage(domPage.pageNumber);
|
|
150
|
-
// }
|
|
151
|
-
attachFieldAttributes(pageInfo, roleIndex, el) {
|
|
152
|
-
el.setAttribute('roleindex', roleIndex);
|
|
153
|
-
el.setAttribute('xScale', pageInfo.xScale);
|
|
154
|
-
el.setAttribute('yScale', pageInfo.yScale);
|
|
155
|
-
}
|
|
156
35
|
handlePageRendered(e) {
|
|
157
36
|
const pageInfo = e.detail;
|
|
158
37
|
console.log('[SIGN] Page rendered', pageInfo);
|
|
159
|
-
EnvelopeStore.envelope.recipients.map(recipient => {
|
|
160
|
-
const fields = recipient.fields.filter(field => field.page === pageInfo.pageNumber);
|
|
161
|
-
// const fields = this.fields.filter(field => field.page_sequence === pageInfo.renderedPage.pageNumber);
|
|
162
|
-
console.log('[SIGN] Fields on page', fields);
|
|
163
|
-
fields.forEach(field => {
|
|
164
|
-
const roleIndex = getRoleIndex(EnvelopeStore.roleNames, field.recipient_role);
|
|
165
|
-
const el = renderDocumentField(field, pageInfo, roleIndex, {
|
|
166
|
-
disabled: true,
|
|
167
|
-
editable: false,
|
|
168
|
-
draggable: false,
|
|
169
|
-
done: true,
|
|
170
|
-
});
|
|
171
|
-
if (!el) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
if (Array.isArray(el)) {
|
|
175
|
-
el.map(e => this.attachFieldAttributes(pageInfo, roleIndex, e));
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
this.attachFieldAttributes(pageInfo, roleIndex, el);
|
|
179
|
-
}
|
|
180
|
-
// interact(el).draggable({
|
|
181
|
-
// listeners: {
|
|
182
|
-
// start(event) {
|
|
183
|
-
// console.log('[FIELDS] Drag started', event.type, event.target);
|
|
184
|
-
// },
|
|
185
|
-
// move(event) {
|
|
186
|
-
// const oldX = +(event.target.getAttribute('posX') || 0);
|
|
187
|
-
// const oldY = +(event.target.getAttribute('posY') || 0);
|
|
188
|
-
// const xScale = +(event.target.getAttribute('xScale') || 1);
|
|
189
|
-
// const yScale = +(event.target.getAttribute('yScale') || 1);
|
|
190
|
-
// const newX = event.dx / xScale + oldX;
|
|
191
|
-
// const newY = event.dy / yScale + oldY;
|
|
192
|
-
// event.target.setAttribute('posX', newX);
|
|
193
|
-
// event.target.setAttribute('posy', newY);
|
|
194
|
-
// updateCssTransform(event.target, 'translate', `${newX}px, ${newY}px`);
|
|
195
|
-
// },
|
|
196
|
-
// end(event) {
|
|
197
|
-
// console.log('[FIELDS] Drag ended', event);
|
|
198
|
-
// // event.target.setAttribute('posX', 0);
|
|
199
|
-
// // event.target.setAttribute('posy', 0);
|
|
200
|
-
// // updateCssTransform(event.target, 'translate', `${0}px, ${0}px`);
|
|
201
|
-
// },
|
|
202
|
-
// },
|
|
203
|
-
// });
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
38
|
}
|
|
207
39
|
render() {
|
|
208
40
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdocs-view.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-view/verdocs-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAgB,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAC,YAAY,EA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AG,CAAC,IAAI,CAAC,EAAE,CAAC,CACjB,6BACE,YAAY,EAAE,IAAI,CAAC,WAAW,EAC9B,YAAY,EAAE,GAAG,EACjB,aAAa,EAAE,GAAG,EAClB,UAAU,EAAE,IAAI,CAAC,QAAQ,EACzB,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,MAAM,EAAE;YACN,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;YAC9B,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;WAChC,GACD,CACH,CAAC,CACO,CACZ,CAAC;MACJ,CAAC,CAAC,CACE,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Element, Event, Host, Prop, EventEmitter, Fragment} from '@stencil/core';\nimport {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 * Render the documents attached to an envelope in read-only (view) mode. All documents are displayed in order.\n */\n@Component({\n tag: 'verdocs-view',\n styleUrl: 'verdocs-view.scss',\n shadow: false,\n})\nexport class VerdocsView {\n @Element() component: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The envelope ID to render. Set ONE OF templateId or envelopeId. If both are set, envelopeId will be ignored.\n */\n @Prop() envelopeId: string = '';\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 componentWillLoad() {\n this.endpoint.loadSession();\n }\n\n // TODO: Handling signing vs preview-as-user cases\n // TODO: Handle anonymous case and failure to load due to not being logged in\n async componentDidLoad() {\n if (!this.envelopeId) {\n console.error(`[VIEW] Missing reuqired envelopeId`);\n return;\n }\n\n try {\n await getEnvelopeById(this.endpoint, this.envelopeId);\n } catch (e) {\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n // Determine whether a page is \"rotated\" (in either direction)\n // isRotated(rotation) {\n // return rotation !== 0 && rotation % 180 !== 0;\n // }\n\n // Render one document page. Note that pageNumber is 1-based.\n // async renderPage(pageNumber: number): Promise<void> {\n // const domPage = this.domPages[pageNumber];\n //\n // // Two async operations happen here, loading the PDF and rendering the DOM div/canvas placeholders to draw the pages on.\n // if (!domPage) {\n // console.log('[VIEW] Skipping rendering page not yet in DOM', {pageNumber});\n // return;\n // }\n //\n // const pageMetrics = this.sourcePageMetrics[pageNumber];\n //\n // console.log('[VIEW] Rendering page', {pageNumber, pageMetrics, domPage});\n // try {\n // // const pdfPage = await this.pdfDocument.getPage(pageNumber);\n // // const viewport = pdfPage.getViewport({scale: domPage.xScale});\n // // console.log('[VIEW] Page viewport', domPage.xScale, viewport);\n //\n // // const canvas = document.getElementById(`${domPage.containerId}-page`) as HTMLCanvasElement | null;\n // // if (!canvas) {\n // // console.log('[VIEW] Unable to find canvas element');\n // // return;\n // // }\n // //\n // // canvas.width = domPage.renderedWidth;\n // // canvas.height = domPage.renderedHeight;\n // // const canvasContext = canvas.getContext('2d');\n // // canvasContext.clearRect(0, 0, domPage.renderedWidth, domPage.renderedHeight);\n // // await pdfPage.render({canvasContext, viewport});\n //\n // this.pageRendered.emit({\n // renderedPage: domPage,\n // sourcePageMetrics: pageMetrics,\n // pages: this.domPages,\n // });\n // } catch (e) {\n // this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n // console.warn('[VIEW] Error rendering page', e);\n // }\n // }\n\n // async renderPages(): Promise<void> {\n // const pageNumbersToRender = integerSequence(1, this.numPages);\n // for await (let pageNumber of pageNumbersToRender) {\n // try {\n // await this.renderPage(pageNumber);\n // } catch (e) {\n // this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n // console.warn('[VIEW] Error rendering pages', e);\n // }\n // }\n // }\n\n // onProgress(progress: OnProgressParameters) {\n // console.log(`[VIEW] Progress ${Math.floor((progress.loaded / progress.total) * 100)} (${progress.loaded} / ${progress.total})`);\n // this.loadProgress = Math.floor((100 * progress.loaded) / progress.total);\n // }\n\n // After a document is done loading, go through its pages to get their dimensions\n // async parsePageMetrics(pdfDocument: pdfjsLib.PDFDocumentProxy) {\n // const pageNumbersToRender = integerSequence(1, pdfDocument.numPages);\n //\n // for await (let pageNumber of pageNumbersToRender) {\n // const pdfPage = await pdfDocument.getPage(1);\n // const [pageX0, pageY0, pageX1, pageY1] = pdfPage.view;\n // this.sourcePageMetrics[pageNumber] = {width: pageX1 - pageX0, height: pageY1 - pageY0};\n // }\n //\n // console.log('[VIEW] Parsed page metrics', this.sourcePageMetrics);\n // }\n\n // loadAndRender(src: string): void {\n // console.log('[VIEW] Loading', src);\n //\n // const token = this.endpoint.getToken();\n // const httpHeaders = token ? {Authorization: `Bearer ${token}`} : {};\n //\n // const source = {\n // url: src,\n // cMapUrl: CMAPS_URL,\n // cMapPacked: true,\n // httpHeaders,\n // withCredentials: true,\n // stopAtErrors: true,\n // verbosity: pdfjsLib.VerbosityLevel.WARNINGS,\n // // verbosity: pdfjsLib.VerbosityLevel.INFOS,\n // } as DocumentInitParameters;\n //\n // // @ts-ignore\n // const loadingTask = pdf.getDocument(source, null, null, this.onProgress);\n // loadingTask.onProgress = this.onProgress;\n // loadingTask.promise\n // .then(async (pdfDocument: pdfjsLib.PDFDocumentProxy) => {\n // await this.parsePageMetrics(pdfDocument);\n //\n // this.pdfDocument = pdfDocument;\n // this.numPages = pdfDocument.numPages;\n // this.fingerprints = pdfDocument.fingerprints;\n // console.log(`[VIEW] Got PDF document fingerprints \"${this.fingerprints.join(', ')}\", ${this.numPages} page(s)`);\n //\n // // We don't try to render the pages here, setting loadProtress triggers that by adding the individual page entries in\n // // DOM in render() below. Each page then fires onPageRendered when it is ready to receive content.\n // this.loadProgress = 100;\n // })\n // .catch(e => {\n // this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n // console.log('[VIEW] Loading error', e);\n // });\n // }\n\n // async handlePageRendered(e: any) {\n // e.stopPropagation();\n //\n // const domPage = e.detail as IDocumentPageInfo;\n // this.domPages[domPage.pageNumber] = domPage;\n // await this.renderPage(domPage.pageNumber);\n // }\n\n attachFieldAttributes(pageInfo, roleIndex, el) {\n el.setAttribute('roleindex', roleIndex);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[SIGN] Page rendered', pageInfo);\n\n EnvelopeStore.envelope.recipients.map(recipient => {\n const fields = recipient.fields.filter(field => field.page === pageInfo.pageNumber);\n // const fields = this.fields.filter(field => field.page_sequence === pageInfo.renderedPage.pageNumber);\n console.log('[SIGN] Fields on page', fields);\n fields.forEach(field => {\n const roleIndex = getRoleIndex(EnvelopeStore.roleNames, field.recipient_role);\n const el = renderDocumentField(field, pageInfo, roleIndex, {\n disabled: true,\n editable: false,\n draggable: false,\n done: true,\n });\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, roleIndex, e));\n } else {\n this.attachFieldAttributes(pageInfo, 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 }\n\n render() {\n console.log('[VIEW] Rendering', EnvelopeStore.error, EnvelopeStore.loading, EnvelopeStore.envelope);\n if (EnvelopeStore.loading || !EnvelopeStore.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (EnvelopeStore.error) {\n return (\n <Host>\n <div>{EnvelopeStore.error}</div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div class=\"header\">\n <div class=\"inner\">\n <div class=\"toolbar\">\n <div class=\"tools\">\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: '#ffffff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#ffffff', cursor: 'pointer', marginLeft: '16px', maginRight: '30px'}}\n onClick={() => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {})}\n />\n </Fragment>\n </div>\n </div>\n </div>\n </div>\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 </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"verdocs-view.js","sourceRoot":"","sources":["../../../../src/components/embeds/verdocs-view/verdocs-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAgB,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAC,eAAe,EAAC,MAAM,0BAA0B,CAAC;AACzD,OAAO,aAAa,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAE7C,MAAM,SAAS,GAAG,yOAAyO,CAAC;AAE5P,MAAM,YAAY,GAAG,iIAAiI,CAAC;AAEvJ;;GAEG;AAMH,MAAM,OAAO,WAAW;;oBAMc,eAAe,CAAC,UAAU,EAAE;sBAKnC,EAAE;;EAQ/B,iBAAiB;IACf,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;EAC9B,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CAAC;QAE9C,OAAO,CACL,EAAC,QAAQ,QACN,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CACjB,6BACE,YAAY,EAAE,IAAI,CAAC,WAAW,EAC9B,YAAY,EAAE,GAAG,EACjB,aAAa,EAAE,GAAG,EAClB,UAAU,EAAE,IAAI,CAAC,QAAQ,EACzB,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,MAAM,EAAE;YACN,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;YAC9B,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;WAChC,GACD,CACH,CAAC,CACO,CACZ,CAAC;MACJ,CAAC,CAAC,CACE,CACD,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Element, Event, Host, Prop, EventEmitter, Fragment} from '@stencil/core';\nimport {getEnvelopeById} from '../../../utils/Envelopes';\nimport EnvelopeStore from '../../../utils/envelopeStore';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {SDKError} from '../../../utils/errors';\nimport {savePDF} from '../../../utils/utils';\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 * Render the documents attached to an envelope in read-only (view) mode. All documents are displayed in order.\n */\n@Component({\n tag: 'verdocs-view',\n styleUrl: 'verdocs-view.scss',\n shadow: false,\n})\nexport class VerdocsView {\n @Element() component: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The envelope ID to render. Set ONE OF templateId or envelopeId. If both are set, envelopeId will be ignored.\n */\n @Prop() envelopeId: string = '';\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 componentWillLoad() {\n this.endpoint.loadSession();\n }\n\n // TODO: Handling signing vs preview-as-user cases\n // TODO: Handle anonymous case and failure to load due to not being logged in\n async componentDidLoad() {\n if (!this.envelopeId) {\n console.error(`[VIEW] Missing required envelopeId`);\n return;\n }\n\n try {\n await getEnvelopeById(this.endpoint, this.envelopeId);\n } catch (e) {\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handlePageRendered(e) {\n const pageInfo = e.detail as IDocumentPageInfo;\n console.log('[SIGN] Page rendered', pageInfo);\n }\n\n render() {\n console.log('[VIEW] Rendering', EnvelopeStore.error, EnvelopeStore.loading, EnvelopeStore.envelope);\n if (EnvelopeStore.loading || !EnvelopeStore.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (EnvelopeStore.error) {\n return (\n <Host>\n <div>{EnvelopeStore.error}</div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div class=\"header\">\n <div class=\"inner\">\n <div class=\"toolbar\">\n <div class=\"tools\">\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: '#ffffff', cursor: 'pointer'}} onClick={() => window.print()} />\n <div\n innerHTML={DownloadIcon}\n style={{width: '24px', height: '24px', fill: '#ffffff', cursor: 'pointer', marginLeft: '16px', maginRight: '30px'}}\n onClick={() => savePDF(this.endpoint, EnvelopeStore.envelope, EnvelopeStore.envelope.envelope_document_id).catch(() => {})}\n />\n </Fragment>\n </div>\n </div>\n </div>\n </div>\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 </Host>\n );\n }\n}\n"]}
|
|
@@ -4,16 +4,17 @@ import EnvelopeStore from './envelopeStore';
|
|
|
4
4
|
// child elements.
|
|
5
5
|
export const getEnvelopeById = async (endpoint, envelopeId) => {
|
|
6
6
|
var _a, _b;
|
|
7
|
-
EnvelopeStore.envelope = null;
|
|
8
7
|
if (!envelopeId) {
|
|
9
8
|
console.log(`[ENVELOPES] Missing required envelope ID`);
|
|
10
9
|
return;
|
|
11
10
|
}
|
|
12
11
|
if (((_a = EnvelopeStore.envelope) === null || _a === void 0 ? void 0 : _a.id) === envelopeId) {
|
|
12
|
+
console.log(`[ENVELOPES] Skipping load for already-loaded envelope ID`);
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
EnvelopeStore.error = '';
|
|
16
16
|
EnvelopeStore.loading = true;
|
|
17
|
+
EnvelopeStore.envelope = null;
|
|
17
18
|
try {
|
|
18
19
|
console.log(`[ENVELOPES] Loading envelope ${envelopeId}`);
|
|
19
20
|
const envelope = await getEnvelope(endpoint, envelopeId, true);
|
|
@@ -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;AAE5C,uIAAuI;AACvI,kBAAkB;AAClB,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,QAAyB,EAAE,UAAkB,EAAE,EAAE;;EACrF,
|
|
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;AAE5C,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;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';\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 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"]}
|