@verdocs/web-sdk 1.9.21 → 1.9.22
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-2277461f.js → Envelopes-647724d8.js} +2 -2
- package/dist/cjs/{Envelopes-2277461f.js.map → Envelopes-647724d8.js.map} +1 -1
- package/dist/cjs/{Templates-3404a881.js → Templates-c0b4453e.js} +2 -2
- package/dist/cjs/{Templates-3404a881.js.map → Templates-c0b4453e.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{templateStore-3c43f83c.js → templateStore-86cc0f59.js} +2 -2
- package/dist/cjs/{templateStore-3c43f83c.js.map → templateStore-86cc0f59.js.map} +1 -1
- package/dist/cjs/{utils-9b27a65b.js → utils-fae54b93.js} +5 -4
- package/dist/cjs/utils-fae54b93.js.map +1 -0
- package/dist/cjs/verdocs-auth.cjs.entry.js +0 -4
- package/dist/cjs/verdocs-auth.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-document-page_2.cjs.entry.js +1 -0
- package/dist/cjs/verdocs-document-page_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-signature_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-send.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +4 -3
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-template-create_4.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-view.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js +1 -0
- package/dist/collection/components/elements/verdocs-document-page/verdocs-document-page.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +0 -22
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.stories.js +1 -2
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.stories.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +4 -0
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +1 -0
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/utils/utils.js +4 -3
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/utils.js +4 -3
- package/dist/components/utils.js.map +1 -1
- package/dist/components/verdocs-auth.js +0 -5
- package/dist/components/verdocs-auth.js.map +1 -1
- package/dist/components/verdocs-document-page2.js +1 -0
- package/dist/components/verdocs-document-page2.js.map +1 -1
- package/dist/components/verdocs-sign.js +2 -1
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/custom-elements.json +1123 -0
- package/dist/docs.json +1 -18
- package/dist/esm/{Envelopes-c80609e5.js → Envelopes-bae41b1e.js} +2 -2
- package/dist/esm/{Envelopes-c80609e5.js.map → Envelopes-bae41b1e.js.map} +1 -1
- package/dist/esm/{Templates-7ae1294e.js → Templates-a5ba3f59.js} +2 -2
- package/dist/esm/{Templates-7ae1294e.js.map → Templates-a5ba3f59.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{templateStore-a6dfb726.js → templateStore-dd69f2f3.js} +2 -2
- package/dist/esm/{templateStore-a6dfb726.js.map → templateStore-dd69f2f3.js.map} +1 -1
- package/dist/esm/{utils-53001d87.js → utils-f2bdefaa.js} +5 -4
- package/dist/esm/utils-f2bdefaa.js.map +1 -0
- package/dist/esm/verdocs-auth.entry.js +0 -4
- package/dist/esm/verdocs-auth.entry.js.map +1 -1
- package/dist/esm/verdocs-build.entry.js +3 -3
- package/dist/esm/verdocs-document-page_2.entry.js +1 -0
- package/dist/esm/verdocs-document-page_2.entry.js.map +1 -1
- package/dist/esm/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm/verdocs-field-date.entry.js +1 -1
- package/dist/esm/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm/verdocs-field-initial.entry.js +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm/verdocs-field-signature_3.entry.js +1 -1
- package/dist/esm/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +2 -2
- package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm/verdocs-preview.entry.js +3 -3
- package/dist/esm/verdocs-send.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +4 -3
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-template-create_4.entry.js +3 -3
- package/dist/esm/verdocs-view.entry.js +2 -2
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{Envelopes-c80609e5.js → Envelopes-bae41b1e.js} +2 -2
- package/dist/esm-es5/{Envelopes-c80609e5.js.map → Envelopes-bae41b1e.js.map} +0 -0
- package/dist/esm-es5/{Templates-7ae1294e.js → Templates-a5ba3f59.js} +2 -2
- package/dist/esm-es5/{Templates-7ae1294e.js.map → Templates-a5ba3f59.js.map} +0 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/{templateStore-a6dfb726.js → templateStore-dd69f2f3.js} +2 -2
- package/dist/esm-es5/{templateStore-a6dfb726.js.map → templateStore-dd69f2f3.js.map} +0 -0
- package/dist/esm-es5/utils-f2bdefaa.js +2 -0
- package/dist/esm-es5/utils-f2bdefaa.js.map +1 -0
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-document-page_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-template-create_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.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-auth/verdocs-auth.d.ts +0 -6
- package/dist/types/components/embeds/verdocs-auth/verdocs-auth.stories.d.ts +1 -2
- package/dist/types/components.d.ts +0 -8
- package/dist/verdocs-web-sdk/p-0012a455.js +2 -0
- package/dist/verdocs-web-sdk/{p-4ef84b54.js.map → p-0012a455.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-359129d0.entry.js → p-0b771a2e.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-359129d0.entry.js.map → p-0b771a2e.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-f632dbd8.entry.js → p-0cbee9ee.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f632dbd8.entry.js.map → p-0cbee9ee.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-e014f9a6.system.entry.js → p-103d61f1.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e014f9a6.system.entry.js.map → p-103d61f1.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-2c0f9340.system.js → p-112b3e2c.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2c0f9340.system.js.map → p-112b3e2c.system.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-c0804682.entry.js → p-1d976e5e.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c0804682.entry.js.map → p-1d976e5e.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a580d69a.system.entry.js → p-1f2c70da.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a580d69a.system.entry.js.map → p-1f2c70da.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a9d20e4b.system.entry.js → p-2b98b182.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a9d20e4b.system.entry.js.map → p-2b98b182.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-c475a969.system.entry.js → p-2c986881.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c475a969.system.entry.js.map → p-2c986881.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-2fe18d0b.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-2fe18d0b.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-6c2273ee.system.entry.js → p-352d2017.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6c2273ee.system.entry.js.map → p-352d2017.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-40554b1a.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-40554b1a.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-2b7f196e.system.entry.js → p-435153a4.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2b7f196e.system.entry.js.map → p-435153a4.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-4f321d05.entry.js → p-45e74078.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4f321d05.entry.js.map → p-45e74078.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-4943d790.system.entry.js → p-4fce2fbf.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4943d790.system.entry.js.map → p-4fce2fbf.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-48285c26.entry.js → p-5648a6a6.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-48285c26.entry.js.map → p-5648a6a6.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-fa722164.entry.js → p-656387e4.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-fa722164.entry.js.map → p-656387e4.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-77a77df6.entry.js → p-6787c11e.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-77a77df6.entry.js.map → p-6787c11e.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-888cf244.system.entry.js → p-69f813f6.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-888cf244.system.entry.js.map → p-69f813f6.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-ecdd15bf.entry.js → p-70bf612f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ecdd15bf.entry.js.map → p-70bf612f.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-7bccd90d.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-7bccd90d.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-5c3fce00.entry.js → p-7ccd5b2b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-5c3fce00.entry.js.map → p-7ccd5b2b.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-00cc11c3.entry.js → p-7e9dc6ea.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-00cc11c3.entry.js.map → p-7e9dc6ea.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-208a3320.js → p-80e95049.js} +2 -2
- package/dist/verdocs-web-sdk/p-80e95049.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-ace31857.system.entry.js → p-89864e7a.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ace31857.system.entry.js.map → p-89864e7a.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-66eacdf0.system.entry.js → p-89c64ec1.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-66eacdf0.system.entry.js.map → p-89c64ec1.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-a9429014.system.entry.js → p-92580c34.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a9429014.system.entry.js.map → p-92580c34.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-f05afb1f.system.entry.js → p-936c9fa5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f05afb1f.system.entry.js.map → p-936c9fa5.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-bdff66f3.js → p-96eb4665.js} +2 -2
- package/dist/verdocs-web-sdk/{p-bdff66f3.js.map → p-96eb4665.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-a0259b33.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-a0259b33.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-0e7a7666.entry.js → p-a21c0320.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-0e7a7666.entry.js.map → p-a21c0320.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-a9413269.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-a9413269.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-0eee7f43.system.js → p-b00c8e00.system.js} +2 -2
- package/dist/verdocs-web-sdk/p-b00c8e00.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-90fe342a.entry.js → p-b84401ed.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-90fe342a.entry.js.map → p-b84401ed.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-5bbbf36a.entry.js → p-c70b6871.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-5bbbf36a.entry.js.map → p-c70b6871.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-ba8727f3.system.entry.js → p-ce949e78.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ba8727f3.system.entry.js.map → p-ce949e78.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-3175c6f2.system.entry.js → p-de90c405.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-3175c6f2.system.entry.js.map → p-de90c405.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-4437603c.system.js → p-e0e6e79d.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4437603c.system.js.map → p-e0e6e79d.system.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-d65f5bf7.system.entry.js → p-e5338826.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d65f5bf7.system.entry.js.map → p-e5338826.system.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-35333c3b.entry.js → p-ee3deda1.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-35333c3b.entry.js.map → p-ee3deda1.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-f2d637b8.js +2 -0
- package/dist/verdocs-web-sdk/{p-dadccc57.js.map → p-f2d637b8.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-f2f60dc9.entry.js → p-f563a7c8.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f2f60dc9.entry.js.map → p-f563a7c8.entry.js.map} +0 -0
- package/dist/verdocs-web-sdk/{p-f2137361.system.js → p-f9915732.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f2137361.system.js.map → p-f9915732.system.js.map} +0 -0
- package/dist/verdocs-web-sdk/p-fed9fd2b.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-fed9fd2b.system.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 +1 -1
- package/dist/cjs/utils-9b27a65b.js.map +0 -1
- package/dist/esm/utils-53001d87.js.map +0 -1
- package/dist/esm-es5/utils-53001d87.js +0 -2
- package/dist/esm-es5/utils-53001d87.js.map +0 -1
- package/dist/typings.d.ts +0 -4
- package/dist/verdocs-web-sdk/p-0eee7f43.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-208a3320.js.map +0 -1
- package/dist/verdocs-web-sdk/p-4ef84b54.js +0 -2
- package/dist/verdocs-web-sdk/p-64cad758.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-64cad758.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-99144a0a.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-99144a0a.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-9a763c04.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-9a763c04.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-c4357387.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-c4357387.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d0a360d6.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d0a360d6.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-dadccc57.js +0 -2
- package/dist/verdocs-web-sdk/p-e4569806.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e4569806.system.entry.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const utils = require('./utils-
|
|
3
|
+
const utils = require('./utils-fae54b93.js');
|
|
4
4
|
const index = require('./index-eb130f52.js');
|
|
5
5
|
|
|
6
6
|
// NOTE: Do not attempt to convert this to a named-export module. It triggers compilation issues in Rollup that I spent days trying to
|
|
@@ -62,4 +62,4 @@ const getEnvelopeById = async (endpoint, envelopeId) => {
|
|
|
62
62
|
exports.getEnvelopeById = getEnvelopeById;
|
|
63
63
|
exports.state = state;
|
|
64
64
|
|
|
65
|
-
//# sourceMappingURL=Envelopes-
|
|
65
|
+
//# sourceMappingURL=Envelopes-647724d8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"Envelopes-
|
|
1
|
+
{"file":"Envelopes-647724d8.js","mappings":";;;;;AAAA;MAMM,EAAC,KAAK,EAAE,QAAQ,EAAC,GAAGA,iBAAW,CAAC;EACpC,QAAQ,EAAE,IAAwB;EAClC,YAAY,EAAE,CAAC;EACf,OAAO,EAAE,IAAI;EACb,KAAK,EAAE,EAAE;EAET,SAAS,EAAE,EAAc;EACzB,KAAK,EAAE,KAAK;CACb,EAAE;AAEH,QAAQ,CAAC,UAAU,EAAE,OAAM,WAAW;EACpC,IAAI,CAAC,WAAW,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC;IACrB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,KAAK,CAAC,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AE,QAAQ,0CAAE,MAAM,MAAK,GAAG,GAAG,yBAAyB,GAAG,CAAC,CAAC,OAAO,CAAC;IAC1F,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,CAAC,CAAC;GACT;AACH;;;;;","names":["createStore","EnvelopeStore","getEnvelope"],"sources":["./src/utils/envelopeStore.ts","./src/utils/Envelopes.ts"],"sourcesContent":["// NOTE: Do not attempt to convert this to a named-export module. It triggers compilation issues in Rollup that I spent days trying to\n// resolve. This needs to export a single default value of the store's state. Any helper functions should go in Templates.ts here.\n\nimport {createStore} from '@stencil/store';\nimport {IEnvelope} from '@verdocs/js-sdk/Envelopes/Types';\n\nconst {state, onChange} = createStore({\n envelope: null as IEnvelope | null,\n loadProgress: 0,\n loading: true,\n error: '',\n\n roleNames: [] as string[],\n dirty: false,\n});\n\nonChange('envelope', async newEnvelope => {\n if (!newEnvelope) {\n console.log('[ENVELOPESTORE] Clearing envelope');\n state.roleNames = [];\n state.dirty = false;\n state.loading = false;\n state.error = '';\n state.loadProgress = 0;\n return;\n }\n\n console.log('[ENVELOPESTORE] Loaded envelope', newEnvelope);\n\n state.roleNames = newEnvelope.recipients.map(recipient => recipient.role_name);\n newEnvelope.recipients;\n console.log('[ENVELOPESTORE] Loaded roles', state.roleNames);\n});\n\nexport default state;\n","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 EnvelopeStore.envelope = null;\n\n if (!envelopeId) {\n console.log(`[ENVELOPES] Missing required envelope ID`);\n return;\n }\n\n if (EnvelopeStore.envelope?.id === envelopeId) {\n return;\n }\n\n EnvelopeStore.error = '';\n EnvelopeStore.loading = true;\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"],"version":3}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const Templates = require('./Templates-8ef16e3d.js');
|
|
4
|
-
const templateStore = require('./templateStore-
|
|
4
|
+
const templateStore = require('./templateStore-86cc0f59.js');
|
|
5
5
|
|
|
6
6
|
const loadTemplate = async (endpoint, templateId) => {
|
|
7
7
|
templateStore.state.template = null;
|
|
@@ -28,4 +28,4 @@ const loadTemplate = async (endpoint, templateId) => {
|
|
|
28
28
|
|
|
29
29
|
exports.loadTemplate = loadTemplate;
|
|
30
30
|
|
|
31
|
-
//# sourceMappingURL=Templates-
|
|
31
|
+
//# sourceMappingURL=Templates-c0b4453e.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"Templates-
|
|
1
|
+
{"file":"Templates-c0b4453e.js","mappings":";;;;;MAIa,YAAY,GAAG,OAAO,QAAyB,EAAE,UAAkB;EAC9EA,mBAAa,CAAC,QAAQ,GAAG,IAAI,CAAC;EAE9B,IAAI,CAAC,UAAU,EAAE;IACf,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;IACxD,OAAO;GACR;EAEDA,mBAAa,CAAC,OAAO,GAAG,IAAI,CAAC;EAE7B,IAAI;IACF,OAAO,CAAC,GAAG,CAAC,gCAAgC,UAAU,EAAE,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAMC,qBAAW,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;IAEDD,mBAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAClCA,mBAAa,CAAC,OAAO,GAAG,KAAK,CAAC;GAC/B;EAAC,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,CAAC,CAAC,CAAC;IACrD,MAAM,CAAC,CAAC;GACT;AACH;;;;","names":["TemplateStore","getTemplate"],"sources":["./src/utils/Templates.ts"],"sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {getTemplate} from '@verdocs/js-sdk/Templates/Templates';\nimport TemplateStore from './templateStore';\n\nexport const loadTemplate = async (endpoint: VerdocsEndpoint, templateId: string) => {\n TemplateStore.template = null;\n\n if (!templateId) {\n console.log(`[TEMPLATES] Missing required template ID`);\n return;\n }\n\n TemplateStore.loading = true;\n\n try {\n console.log(`[TEMPLATES] Loading template ${templateId}`);\n const template = await getTemplate(endpoint, templateId, true);\n if (!template) {\n console.log('[TEMPLATES] Unable to load template');\n return;\n }\n\n TemplateStore.template = template;\n TemplateStore.loading = false;\n } catch (e) {\n console.log('[TEMPLATES] Error loading template', e);\n throw e;\n }\n};\n"],"version":3}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["verdocs-build.cjs",[[0,"verdocs-build",{"endpoint":[16],"templateId":[1,"template-id"],"step":[32],"pdfUrl":[32],"template":[32]}]]],["verdocs-sign.cjs",[[0,"verdocs-sign",{"envelopeId":[1,"envelope-id"],"roleId":[1,"role-id"],"inviteCode":[1,"invite-code"],"recipient":[32],"signerToken":[32],"hasSignature":[32],"nextButtonLabel":[32],"nextSubmits":[32],"errorMessage":[32],"focusedField":[32],"isDone":[32],"showDone":[32],"finishLater":[32],"showFinishLater":[32]}]]],["verdocs-field-initial.cjs",[[0,"verdocs-field-initial",{"field":[16],"disabled":[4],"initials":[1],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"tempInitials":[32],"focusField":[64]}]]],["verdocs-auth.cjs",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"
|
|
17
|
+
return index.bootstrapLazy([["verdocs-build.cjs",[[0,"verdocs-build",{"endpoint":[16],"templateId":[1,"template-id"],"step":[32],"pdfUrl":[32],"template":[32]}]]],["verdocs-sign.cjs",[[0,"verdocs-sign",{"envelopeId":[1,"envelope-id"],"roleId":[1,"role-id"],"inviteCode":[1,"invite-code"],"recipient":[32],"signerToken":[32],"hasSignature":[32],"nextButtonLabel":[32],"nextSubmits":[32],"errorMessage":[32],"focusedField":[32],"isDone":[32],"showDone":[32],"finishLater":[32],"showFinishLater":[32]}]]],["verdocs-field-initial.cjs",[[0,"verdocs-field-initial",{"field":[16],"disabled":[4],"initials":[1],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"tempInitials":[32],"focusField":[64]}]]],["verdocs-auth.cjs",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"isAuthenticated":[32],"displayMode":[32],"username":[32],"password":[32],"loggingIn":[32],"activeSession":[32],"loginError":[32]}]]],["verdocs-field-date.cjs",[[0,"verdocs-field-date",{"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"containerId":[32],"focusField":[64]}]]],["verdocs-field-textarea.cjs",[[0,"verdocs-field-textarea",{"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"focusField":[64]}]]],["verdocs-field-textbox.cjs",[[0,"verdocs-field-textbox",{"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"focusField":[64]}]]],["verdocs-field-timestamp.cjs",[[0,"verdocs-field-timestamp",{"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"focusField":[64]}]]],["verdocs-search.cjs",[[0,"verdocs-search",{"endpoint":[16]}]]],["verdocs-send.cjs",[[0,"verdocs-send",{"endpoint":[16],"templateId":[1,"template-id"],"template":[32],"pdfUrl":[32],"containerId":[32],"rolesAtLevel":[32],"showPickerForId":[32],"sessionContacts":[32],"recipientsAssigned":[32]}]]],["verdocs-field-attachment.cjs",[[0,"verdocs-field-attachment",{"field":[16],"disabled":[4],"roleIndex":[2,"role-index"],"focusField":[64]}]]],["verdocs-preview.cjs",[[0,"verdocs-preview",{"endpoint":[16],"templateId":[1,"template-id"]}]]],["verdocs-view.cjs",[[0,"verdocs-view",{"endpoint":[16],"envelopeId":[1,"envelope-id"]}]]],["verdocs-kba-dialog.cjs",[[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"choices":[16],"response":[32]}]]],["verdocs-field-checkbox.cjs",[[0,"verdocs-field-checkbox",{"field":[16],"option":[2],"disabled":[4],"done":[4],"roleindex":[2]}]]],["verdocs-field-dropdown.cjs",[[0,"verdocs-field-dropdown",{"field":[16],"disabled":[4],"roleindex":[2],"focusField":[64]}]]],["verdocs-field-payment.cjs",[[0,"verdocs-field-payment",{"field":[16],"disabled":[4],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"focused":[4],"signed":[4],"roleindex":[2],"preparedMessage":[32],"signatureUrl":[32]}]]],["verdocs-field-radio-button.cjs",[[0,"verdocs-field-radio-button",{"field":[16],"option":[2],"disabled":[4],"done":[4],"roleindex":[2]}]]],["verdocs-organization-card.cjs",[[0,"verdocs-organization-card",{"organization":[16]}]]],["verdocs-search-tabs.cjs",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["verdocs-status-indicator.cjs",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"envelope":[16],"isOpen":[32],"recipientStatusIcons":[32],"containerId":[32]}]]],["verdocs-template-card.cjs",[[0,"verdocs-template-card",{"template":[16]}]]],["verdocs-template-tags.cjs",[[0,"verdocs-template-tags",{"tags":[16]}]]],["verdocs-toggle.cjs",[[0,"verdocs-toggle",{"options":[16],"theme":[1],"selectedOption":[32]}]]],["verdocs-contact-picker.cjs",[[0,"verdocs-contact-picker",{"endpoint":[16],"templateRole":[16],"contactSuggestions":[16],"name":[32],"email":[32],"phone":[32],"message":[32],"showSuggestions":[32],"showMessage":[32],"delegator":[32]}]]],["verdocs-initial-dialog.cjs",[[0,"verdocs-initial-dialog",{"initials":[1],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["verdocs-upload-dialog.cjs",[[0,"verdocs-upload-dialog",{"draggingOver":[32],"decodedFiles":[32]}]]],["verdocs-dropdown.cjs",[[0,"verdocs-dropdown",{"options":[16],"open":[32]}]]],["verdocs-ok-dialog.cjs",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"showCancel":[4,"show-cancel"]}]]],["verdocs-toggle-button.cjs",[[0,"verdocs-toggle-button",{"active":[4],"icon":[1],"label":[1],"size":[1],"_active":[32]}]]],["verdocs-quick-functions_3.cjs",[[0,"verdocs-quick-functions",{"endpoint":[16]}],[0,"verdocs-search-activity",{"endpoint":[16],"type":[1],"options":[8],"emptyMessage":[32],"authFailure":[32],"title":[32],"recent":[32],"saved":[32],"starred":[32]}],[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1],"grabsFocus":[4,"grabs-focus"],"focusField":[64]}]]],["verdocs-checkbox.cjs",[[0,"verdocs-checkbox",{"checked":[4],"name":[1],"label":[1],"value":[1],"theme":[1],"disabled":[4]}]]],["verdocs-radio-button.cjs",[[0,"verdocs-radio-button",{"checked":[4],"name":[1],"value":[1],"disabled":[4]}]]],["verdocs-button.cjs",[[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["verdocs-help-icon_2.cjs",[[0,"verdocs-template-sender-dialog",{"value":[1],"newValue":[32]}],[0,"verdocs-help-icon",{"text":[1],"containerId":[32]}]]],["verdocs-field-signature_3.cjs",[[0,"verdocs-field-signature",{"field":[16],"name":[1],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"tempSignature":[32],"focusField":[64]}],[0,"verdocs-toolbar-icon",{"text":[1],"icon":[1],"containerId":[32]}],[0,"verdocs-signature-dialog",{"name":[1],"fontLoaded":[32],"enteredName":[32],"mode":[32]}]]],["verdocs-document-page_2.cjs",[[0,"verdocs-document-page",{"pageImageUri":[1,"page-image-uri"],"pageNumber":[2,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[2,"virtual-height"],"layers":[16],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32]}],[0,"verdocs-loader"]]],["verdocs-button-panel_3.cjs",[[4,"verdocs-button-panel",{"icon":[1]}],[0,"verdocs-select-input",{"value":[1],"label":[1],"options":[16],"disabled":[4]}],[0,"verdocs-text-input",{"value":[1],"label":[1],"placeholder":[1],"autocomplete":[1],"type":[1],"disabled":[4]}]]],["verdocs-template-create_4.cjs",[[0,"verdocs-template-fields",{"endpoint":[16],"templateId":[1,"template-id"]}],[0,"verdocs-template-properties",{"endpoint":[16],"templateId":[1,"template-id"],"template":[32],"name":[32],"visibility":[32],"sendReminders":[32],"firstReminderDays":[32],"reminderDays":[32]}],[0,"verdocs-template-recipients",{"endpoint":[16],"templateRole":[16],"contactSuggestions":[16],"name":[32],"email":[32],"phone":[32],"message":[32],"showSuggestions":[32],"showMessage":[32],"delegator":[32],"sender":[32],"showingSenderDialog":[32],"orderedRoles":[32]}],[0,"verdocs-template-create",{"endpoint":[16],"file":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index-eb130f52.js');
|
|
4
|
-
const utils = require('./utils-
|
|
4
|
+
const utils = require('./utils-fae54b93.js');
|
|
5
5
|
|
|
6
6
|
// NOTE: Do not attempt to convert this to a named-export module. It triggers compilation issues in Rollup that I spent days trying to
|
|
7
7
|
// import {getPageImage} from '@verdocs/js-sdk/Templates/Pages';
|
|
@@ -43,4 +43,4 @@ onChange('fields', newField => {
|
|
|
43
43
|
|
|
44
44
|
exports.state = state;
|
|
45
45
|
|
|
46
|
-
//# sourceMappingURL=templateStore-
|
|
46
|
+
//# sourceMappingURL=templateStore-86cc0f59.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"templateStore-
|
|
1
|
+
{"file":"templateStore-86cc0f59.js","mappings":";;;;;AAAA;AAQA;MAEM,EAAC,KAAK,EAAE,QAAQ,EAAC,GAAGA,iBAAW,CAAC;EACpC,QAAQ,EAAE,IAAwB;EAClC,YAAY,EAAE,CAAC;EACf,OAAO,EAAE,IAAI;EAEb,WAAW,EAAE,EAAc;EAC3B,QAAQ,EAAE,EAA4B;EACtC,SAAS,EAAE,EAAc;EACzB,MAAM,EAAE,EAAsB;EAC9B,KAAK,EAAE,KAAK;CACb,EAAE;AAEH,QAAQ,CAAC,UAAU,EAAE,OAAM,WAAW;EACpC,IAAI,CAAC,WAAW,EAAE;IAChB,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACjD,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC;IACrB,KAAK,CAAC,WAAW,GAAG,EAAE,CAAC;IACvB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;IACtB,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;IACvB,OAAO;GACR;EAED,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,WAAW,CAAC,CAAC;EAE5D,KAAK,CAAC,SAAS,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;EAC3D,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;EAE7D,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;EAClB,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;IAC5B,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;GACnC,CAAC,CAAC;EAEH,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;EAE3D,KAAK,CAAC,WAAW,GAAGC,qBAAe,CAAC,CAAC,EAAE,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,QAAQ,EAAE,QAAQ;EACzB,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC;EACvD,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;AACrB,CAAC,CAAC;;;;","names":["createStore","integerSequence"],"sources":["./src/utils/templateStore.ts"],"sourcesContent":["// NOTE: Do not attempt to convert this to a named-export module. It triggers compilation issues in Rollup that I spent days trying to\n// resolve. This needs to export a single default value of the store's state. Any helper functions should go in Templates.ts here.\n\nimport {createStore} from '@stencil/store';\nimport {ITemplate, ITemplateField} from '@verdocs/js-sdk/Templates/Types';\n// import {VerdocsEndpoint} from '@verdocs/js-sdk';\n// import {getTemplate} from '@verdocs/js-sdk/Templates/Templates';\nimport {integerSequence} from './utils';\n// import {getPageImage} from '@verdocs/js-sdk/Templates/Pages';\n\nconst {state, onChange} = createStore({\n template: null as ITemplate | null,\n loadProgress: 0,\n loading: true,\n\n pageNumbers: [] as number[],\n pageUris: {} as Record<number, string>,\n roleNames: [] as string[],\n fields: [] as ITemplateField[],\n dirty: false,\n});\n\nonChange('template', async newTemplate => {\n if (!newTemplate) {\n console.log('[TEMPLATESTORE] Clearing template');\n state.fields = [];\n state.roleNames = [];\n state.pageNumbers = [];\n state.dirty = false;\n state.loading = false;\n state.loadProgress = 0;\n return;\n }\n\n console.log('[TEMPLATESTORE] Template loaded', newTemplate);\n\n state.roleNames = newTemplate.roles.map(role => role.name);\n console.log('[TEMPLATESTORE] Loaded roles', state.roleNames);\n\n state.fields = [];\n newTemplate.roles.forEach(role => {\n state.fields.push(...role.fields);\n });\n\n console.log('[TEMPLATESTORE] Loaded fields', state.fields);\n\n state.pageNumbers = integerSequence(1, newTemplate.pages.length);\n});\n\nonChange('fields', newField => {\n console.log('[TEMPLATESTORE] Field changed', newField);\n state.dirty = true;\n});\n\nexport default state;\n"],"version":3}
|
|
@@ -182,6 +182,7 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
|
|
|
182
182
|
const { disabled = false, editable = false, draggable = false, done = false } = fieldOptions;
|
|
183
183
|
const controlsDiv = document.getElementById(docPage.containerId + '-controls');
|
|
184
184
|
if (!controlsDiv) {
|
|
185
|
+
console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);
|
|
185
186
|
return;
|
|
186
187
|
}
|
|
187
188
|
switch (field.type) {
|
|
@@ -198,7 +199,7 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
|
|
|
198
199
|
const existingField = document.getElementById(id);
|
|
199
200
|
if (existingField) {
|
|
200
201
|
setControlStyles(existingField, field, docPage.xScale, docPage.yScale);
|
|
201
|
-
return;
|
|
202
|
+
return existingField;
|
|
202
203
|
}
|
|
203
204
|
const el = document.createElement(`verdocs-field-${field.type}`);
|
|
204
205
|
el.field = field;
|
|
@@ -230,7 +231,7 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
|
|
|
230
231
|
const existingField = document.getElementById(id);
|
|
231
232
|
if (existingField) {
|
|
232
233
|
setControlStyles(existingField, field, docPage.xScale, docPage.yScale);
|
|
233
|
-
return;
|
|
234
|
+
return existingField;
|
|
234
235
|
}
|
|
235
236
|
const cbEl = document.createElement(`verdocs-field-checkbox`);
|
|
236
237
|
cbEl.field = field;
|
|
@@ -253,7 +254,7 @@ const renderDocumentField = (field, docPage, roleIndex, fieldOptions) => {
|
|
|
253
254
|
const existingField = document.getElementById(id);
|
|
254
255
|
if (existingField) {
|
|
255
256
|
setControlStyles(existingField, field, docPage.xScale, docPage.yScale);
|
|
256
|
-
return;
|
|
257
|
+
return existingField;
|
|
257
258
|
}
|
|
258
259
|
const radioEl = document.createElement(`verdocs-field-radio-button`);
|
|
259
260
|
radioEl.field = field;
|
|
@@ -347,4 +348,4 @@ exports.updateEnvelopeField = updateEnvelopeField;
|
|
|
347
348
|
exports.updateEnvelopeFieldInitials = updateEnvelopeFieldInitials;
|
|
348
349
|
exports.updateEnvelopeFieldSignature = updateEnvelopeFieldSignature;
|
|
349
350
|
|
|
350
|
-
//# sourceMappingURL=utils-
|
|
351
|
+
//# sourceMappingURL=utils-fae54b93.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"file":"utils-fae54b93.js","mappings":";;;;AAAA,IAAI,SAAS,GAAG,CAACA,SAAI,IAAIA,SAAI,CAAC,SAAS,KAAK,UAAU,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AACzF,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AAChH,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,O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AI,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACtB,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,CAAC,KAAK,EAAE,CAAC;IACV,CAAC,CAAC,MAAM,EAAE,CAAC;GACZ,CAAC;EAEF,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,+BAA+B,IAAI,EAAE,CAAC,CAAC;EACvD,GAAG,CAAC,IAAI,EAAE,CAAC;AACb;;;;;;;;;;;;;;;;","names":["this","decodeAccessTokenBody","Envelopes.getEnvelopeFile"],"sources":["./node_modules/@verdocs/js-sdk/Envelopes/Envelopes.js","./node_modules/@verdocs/js-sdk/Utils/Fields.js","./src/utils/utils.ts"],"sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nimport { decodeAccessTokenBody } from '../Utils/Token';\n/**\n * Create an envelope\n *\n * ```typescript\n * import {Envelopes, ICreateEnvelopeRole, ICreateEnvelopeRequest} from '@verdocs/js-sdk/Envelopes';\n *\n * const role1: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Seller',\n * full_name: 'Paige Turner',\n * email: 'paige.turner@nomail.com',\n * phone: '',\n * sequence: 1,\n * delegator: false,\n * message: '',\n * };\n *\n * const role2: ICreateEnvelopeRole = {\n * type: 'signer',\n * name: 'Buyer',\n * full_name: 'Will Power',\n * email: 'will.power@nomail.com',\n * phone: '',\n * sequence: 2,\n * delegator: false,\n * message: '',\n * };\n *\n * const request: ICreateEnvelopeRequest = {template_id: 'd2338742-f3a1-465b-8592-806587413cc1', name: 'Bill of Sale', roles: [role1, role2]};\n * const {id, recipients} = await Envelopes.createEnvelope(VerdocsEndpoint.getDefault(), request);\n * ```\n */\nexport var createEnvelope = function (endpoint, request) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes', request)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a summary of currently active envelopes.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {action_required, completed, waiting_on_others} = await Envelopes.getSummary(VerdocsEndpoint.getDefault());\n * ```\n */\nexport var getSummary = function (endpoint, page) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/summary', { page: page })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Search for envelopes matching various criteria.\n *\n * ```typescript\n * import {Envelopes} from '@verdocs/js-sdk/Envelopes';\n *\n * const {result, page, total} = await Envelopes.search(VerdocsEndpoint.getDefault(), { ... });\n * ```\n */\nexport var searchEnvelopes = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .post('/envelopes/search', params)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get a signing session for an Envelope.\n */\nexport var getSigningSession = function (endpoint, params) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(params.envelopeId, \"/recipients/\").concat(encodeURIComponent(params.roleId), \"/invitation/\").concat(params.inviteCode))\n .then(function (r) {\n var _a;\n // Avoiding a jsonwebtoken dependency here - we don't actually need the whole library\n var signerToken = ((_a = r.headers) === null || _a === void 0 ? void 0 : _a.signer_token) || '';\n var session = decodeAccessTokenBody(signerToken);\n endpoint.setToken(signerToken);\n return { recipient: r.data, session: session, signerToken: signerToken };\n })];\n });\n}); };\n/**\n * Get the list of recipients for an Envelope.\n */\nexport var getEnvelopeRecipients = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/recipients\"))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelope = function (endpoint, envelopeId, ssr) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId) + (ssr ? '?ssr=true' : ''))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Get all metadata for an Envelope.\n */\nexport var getEnvelopeDocument = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Cancel an Envelope.\n */\nexport var cancelEnvelope = function (endpoint, envelopeId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId), { action: 'cancel' })\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Returns true if the recipient has a pending action. Note that this does not necessarily mean the recipient can act (yet).\n */\nexport var recipientHasAction = function (recipient) { return !['submitted', 'canceled', 'declined'].includes(recipient.status); };\n/**\n * Returns the recipients who still have a pending action. Note that not all of these recipients may be able to act (yet).\n */\nexport var getRecipientsWithActions = function (envelope) { return ((envelope === null || envelope === void 0 ? void 0 : envelope.recipients) || []).filter(recipientHasAction); };\n/**\n * Returns true if the recipient can act.\n */\nexport var recipientCanAct = function (recipient, recipientsWithActions) { var _a; return recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence); };\n/**\n * Returns true if the user can act.\n */\nexport var userCanAct = function (email, recipientsWithActions) {\n var _a;\n var recipient = recipientsWithActions.find(function (r) { return r.email === email; });\n return recipient && recipient.sequence === ((_a = recipientsWithActions === null || recipientsWithActions === void 0 ? void 0 : recipientsWithActions[0]) === null || _a === void 0 ? void 0 : _a.sequence);\n};\n/**\n * Get (binary download) a file attached to an Envelope. It is important to use this method\n * rather than a direct A HREF or similar link to set the authorization headers for the\n * request.\n */\nexport var getEnvelopeFile = function (endpoint, envelopeId, documentId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .get(\"/envelopes/\".concat(envelopeId, \"/envelope_documents/\").concat(documentId, \"?file=true\"), {\n responseType: 'arraybuffer',\n })\n .then(function (r) { return Buffer.from(r.data, 'binary').toString('base64'); })];\n });\n}); };\n/**\n * Update a Document field. Typically called during the signing process as a Recipient fills in fields.\n */\nexport var updateEnvelopeField = function (endpoint, envelopeId, fieldName, value) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName), value)\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldSignature = function (endpoint, envelopeId, fieldName, signatureId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/signature/\").concat(signatureId))\n .then(function (r) { return r.data; })];\n });\n}); };\n/**\n * Update a Document signature field. Signature fields are ID-driven. Call `Document.createSignature()` first to create a\n * signature for a Recipient, then call `Documents.updateDocumentFieldSignature()` to attach it to a field.\n */\nexport var updateEnvelopeFieldInitials = function (endpoint, envelopeId, fieldName, initialId) { return __awaiter(void 0, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, endpoint.api //\n .put(\"/envelopes/\".concat(envelopeId, \"/fields/\").concat(fieldName, \"/initial/\").concat(initialId))\n .then(function (r) { return r.data; })];\n });\n}); };\n","export function getRTop(y, fieldHeight, iTextHeight, yRatio) {\n return iTextHeight - (y + fieldHeight) * yRatio;\n}\nexport function getRLeft(x, ratio) {\n return x * ratio;\n}\nexport function getRValue(y, ratio) {\n return y * ratio;\n}\nexport function blobToBase64(image) {\n var fileReader = new FileReader();\n return new Promise(function (resolve, reject) {\n fileReader.onerror = function () {\n reject(new DOMException('Problem reading blob.'));\n };\n fileReader.onload = function () {\n resolve(fileReader.result);\n };\n fileReader.readAsDataURL(image);\n });\n}\nexport function rescale(r, n) {\n return r * n;\n}\n","// These should probably all move to JS-SDK\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Envelopes} from '@verdocs/js-sdk/Envelopes';\nimport {rescale} from '@verdocs/js-sdk/Utils/Fields';\nimport {ITemplateField} from '@verdocs/js-sdk/Templates/Types';\nimport {IDocumentField, IEnvelope} from '@verdocs/js-sdk/Envelopes/Types';\nimport {IDocumentPageInfo} from './Types';\n\nexport const integerSequence = (start: number, count: number): number[] =>\n Array(count)\n .fill(1)\n .map((_, index) => index + start);\n\nexport const fullNameToInitials = (name: string) =>\n name\n .split(' ')\n .map(word => word[0])\n .join('');\n\nexport const defaultWidth = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 82;\n }\n\n return 150;\n};\n\nexport const defaultHeight = (field: ITemplateField | IDocumentField) => {\n switch (field.type) {\n case 'attachment':\n case 'payment':\n return 24;\n case 'checkbox':\n case 'checkbox_group':\n case 'radio_button_group':\n return 14;\n case 'signature':\n case 'initial':\n return 41;\n }\n\n return 50;\n};\n\nexport const setControlStyles = (el: HTMLElement, field: ITemplateField | IDocumentField, xScale: number, yScale: number, option?: number) => {\n const settings = (field as ITemplateField).setting || (field as IDocumentField).settings;\n let {x = 0, y = 0, width = defaultWidth(field), height = defaultHeight(field)} = settings;\n\n const optionSettings = option !== undefined && settings.options[option] ? settings.options[option] : null;\n if (optionSettings) {\n x = optionSettings.x ?? x;\n y = optionSettings.y ?? y;\n width = optionSettings.width ?? width;\n height = optionSettings.height ?? height;\n }\n\n el.style.width = `${width}px`;\n el.style.height = `${height}px`;\n el.style.position = 'absolute';\n el.style.left = `${rescale(xScale, x)}px`;\n el.style.bottom = `${rescale(yScale, y)}px`;\n el.style.transform = `scale(${xScale}, ${yScale})`;\n // el.style.backgroundColor = field['rgba'] || getRGBA(roleIndex);\n};\n\nexport const getFieldId = (field: ITemplateField | IDocumentField) => {\n return `verdocs-doc-fld-${field.name}`;\n};\n\nexport const getFieldOptionId = (field: ITemplateField | IDocumentField, index: number) => {\n return `verdocs-doc-fld-${field.name}-${index}`;\n};\n\ninterface IFieldOptions {\n disabled?: boolean;\n editable?: boolean;\n draggable?: boolean;\n done?: boolean;\n}\n\nexport const renderDocumentField = (field: ITemplateField | IDocumentField, docPage: IDocumentPageInfo, roleIndex: number, fieldOptions: IFieldOptions) => {\n const {disabled = false, editable = false, draggable = false, done = false} = fieldOptions;\n const controlsDiv = document.getElementById(docPage.containerId + '-controls');\n if (!controlsDiv) {\n console.log('[renderDocumentField] No controls DIV found', docPage.containerId + '-controls', docPage);\n return;\n }\n\n switch (field.type) {\n case 'attachment':\n case 'date':\n case 'dropdown':\n case 'initial':\n case 'payment':\n case 'signature':\n case 'timestamp':\n case 'textarea':\n case 'textbox': {\n const id = getFieldId(field);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const el: any = document.createElement(`verdocs-field-${field.type}`);\n el.field = field;\n el.setAttribute('id', id);\n el.setAttribute('roleIndex', roleIndex);\n\n if (disabled) {\n el.setAttribute('tabindex', -1);\n el.setAttribute('disabled', true);\n } else {\n el.setAttribute('tabIndex', 1);\n }\n\n if (editable) {\n el.setAttribute('editable', true);\n }\n\n if (draggable) {\n el.setAttribute('draggable', true);\n }\n\n if (done) {\n el.setAttribute('done', true);\n }\n\n setControlStyles(el, field, docPage.xScale, docPage.yScale);\n controlsDiv.appendChild(el);\n\n return el;\n }\n\n case 'checkbox_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, checkboxIndex) => {\n const id = getFieldOptionId(field, checkboxIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const cbEl: any = document.createElement(`verdocs-field-checkbox`);\n cbEl.field = field;\n cbEl.setAttribute('id', id);\n cbEl.setAttribute('roleIndex', roleIndex);\n cbEl.setAttribute('option', checkboxIndex);\n if (disabled) {\n cbEl.setAttribute('disabled', true);\n }\n if (done) {\n cbEl.setAttribute('done', true);\n }\n setControlStyles(cbEl, field, docPage.xScale, docPage.yScale, checkboxIndex);\n controlsDiv.appendChild(cbEl);\n\n return cbEl;\n });\n\n case 'radio_button_group':\n return ((field as any).settings || (field as any).setting || {}).options.map((_, buttonIndex) => {\n const id = getFieldOptionId(field, buttonIndex);\n const existingField = document.getElementById(id);\n if (existingField) {\n setControlStyles(existingField, field, docPage.xScale, docPage.yScale);\n return existingField;\n }\n\n const radioEl: any = document.createElement(`verdocs-field-radio-button`);\n radioEl.field = field;\n radioEl.setAttribute('id', id);\n radioEl.setAttribute('roleIndex', roleIndex);\n radioEl.setAttribute('option', buttonIndex);\n if (disabled) {\n radioEl.setAttribute('disabled', true);\n }\n if (done) {\n radioEl.setAttribute('done', true);\n }\n setControlStyles(radioEl, field, docPage.xScale, docPage.yScale, buttonIndex);\n controlsDiv.appendChild(radioEl);\n\n return radioEl;\n });\n\n // case 'attachment':\n // el = document.createElement('verdocs-field-attachment');\n // el.setAttribute('value', result || '');\n // break;\n // case 'payment':\n // el = document.createElement('verdocs-field-payment');\n // break;\n default:\n console.log('[PREVIEW] Skipping unsupported field type', field);\n return null;\n }\n};\n\nexport const getRoleIndex = (roles: string[], role: string) => roles.indexOf(role) || 0;\n\n// TODO: We can clean this up a lot if we alter the API to emit both setting and settings regardless of the source type,\n// but then merge the SDK types to encourage developers to use just `settings`.\nexport const getFieldSettings = (field: ITemplateField | IDocumentField) => {\n if ((field as ITemplateField).setting) {\n return (field as ITemplateField).setting;\n }\n\n if ((field as IDocumentField).settings) {\n return (field as IDocumentField).settings;\n }\n\n return {x: 0, y: 0, required: false, disabled: false, result: '', value: ''};\n};\n\n/**\n * Helper function to safely set/update components in a CSS transform attribute. Transform is normally set as a string of\n * `operation1(param) operation2(param) ...` components, which makes updating them a bit of a pain. This will remove the\n * specified component if it's already set and replace it with the new value, without touching the other components that\n * may already be set. Note that this operation moves the component to the end of the transform chain so it's not meant\n * to be used for order-sensitive components e.g. translate-then-rotate.\n */\nexport const updateCssTransform = (el: HTMLElement, key: string, value: string) => {\n // e.g. 'scale(1.87908, 1.87908) translate(0px, 0px);'\n const currentTransform = el.style.transform;\n // e.g. ['scale(1.87908, 1.87908)', 'scale', '1.87908, 1.87908', ...], [ 'translate(0px, 0px)', 'translate', '0px, 0px']]\n const components = [...currentTransform.matchAll(/(\\w+)\\(([^)]*)\\)/gi)];\n el.style.transform = [\n components //\n .filter(component => component[1] !== key) // Remove the entry if it's already set\n .map(component => component[0]), // Convert back the remaining entries\n `${key}(${value})`,\n ].join(' ');\n};\n\nexport const savePDF = async (endpoint: VerdocsEndpoint, envelope: IEnvelope, documentId: string) => {\n const fileName = `${envelope.name} - ${envelope.updated_at.split('T')[0]}.pdf`;\n const data = await Envelopes.getEnvelopeFile(endpoint, envelope.id, documentId);\n\n // This is better in React than doing window.href= or similar to trigger a download. For a description of the technique\n // see https://stackoverflow.com/questions/8126623/downloading-canvas-element-to-an-image\n let xhr = new XMLHttpRequest();\n xhr.responseType = 'blob';\n xhr.onload = function () {\n let a = document.createElement('a');\n a.href = window.URL.createObjectURL(xhr.response);\n a.download = fileName;\n a.style.display = 'none';\n document.body.appendChild(a);\n a.click();\n a.remove();\n };\n\n xhr.open('GET', `data:application/pdf;base64,${data}`);\n xhr.send();\n};\n"],"version":3}
|
|
@@ -35,7 +35,6 @@ const VerdocsAuth = class {
|
|
|
35
35
|
this.endpoint = VerdocsEndpoint.VerdocsEndpoint.getDefault();
|
|
36
36
|
this.visible = true;
|
|
37
37
|
this.logo = 'https://verdocs.com/assets/blue-logo.svg';
|
|
38
|
-
this.debug = false;
|
|
39
38
|
this.isAuthenticated = false;
|
|
40
39
|
this.displayMode = 'login';
|
|
41
40
|
this.username = '';
|
|
@@ -95,9 +94,6 @@ const VerdocsAuth = class {
|
|
|
95
94
|
return index.h("div", { style: { display: 'none' } }, "Verdocs Auth Placeholder");
|
|
96
95
|
}
|
|
97
96
|
if (this.isAuthenticated) {
|
|
98
|
-
if (this.debug) {
|
|
99
|
-
return (index.h("div", { class: "status-result debug" }, index.h("verdocs-button", { label: "Logout", disabled: this.loggingIn, onClick: () => this.handleLogout() })));
|
|
100
|
-
}
|
|
101
97
|
return index.h("div", { class: "status-result" }, "Authenticated");
|
|
102
98
|
}
|
|
103
99
|
if (this.displayMode === 'signup') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"verdocs-auth.entry.cjs.js","mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAI,gBAAgB,GAAG,UAAU,QAAQ,EAAE,MAAM,EAAE;AAC1D,IAAI,OAAO,QAAQ,CAAC,GAAG;AACvB,SAAS,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC;AAC9C,SAAS,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/C,CAAC;;ACfD,MAAM,cAAc,GAAG,+lCAA+lC;;MC4CzmC,WAAW;;;;;oBAIcA,+BAA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OAAO,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,EAC5C,QAAQ,EAAE,IAAI,CAAC,SAAS,EACxB,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAC,GAC5E,EAEFA,4BAAgB,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAC,GAAI,CACnK,EAEN,IAAI,CAAC,UAAU,GAAGA,+BAAmB,OAAO,EAAC,aAAa,EAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,GAAI,GAAGA,oBAAO,CACrI,EACN;GACH;;;;;;","names":["VerdocsEndpoint","Auth.authenticateUser","SDKError","h"],"sources":["./node_modules/@verdocs/js-sdk/Users/Auth.js","./src/components/embeds/verdocs-auth/verdocs-auth.scss?tag=verdocs-auth","./src/components/embeds/verdocs-auth/verdocs-auth.tsx"],"sourcesContent":["/**\n * Authenticate to Verdocs via user/password authentication\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.authenticateUser({ username: 'test@test.com', password: 'PASSWORD' });\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport var authenticateUser = function (endpoint, params) {\n return endpoint.api //\n .post('/authentication/login', params)\n .then(function (r) { return r.data; });\n};\n/**\n * Authenticate to Verdocs via client ID / Secret authentication. **NOTE: This is only suitable for\n * NodeJS server-side applications. Never expose your Client Secret in a Web or Mobile app!** Also note\n * that access tokens may be cached by server-side apps (and this is recommended) but do expire after 2\n * hours. This expiration may change based on future security needs. Application developers are encouraged\n * to check the `exp` expiration field in the response accessToken and renew tokens after they expire.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.authenticateApp({ client_id: 'CLIENTID', client_secret: 'SECRET' });\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport var authenticateApp = function (endpoint, params) {\n return endpoint.api //\n .post('/authentication/login_client', {}, { headers: params })\n .then(function (r) { return r.data; });\n};\n/**\n * Validate a token. Only Verdocs tokens will be accepted. Most applications can decode tokens locally,\n * because tokens will be validated when API calls are made anyway. However, high-security applications\n * may use this endpoint to check if a token has been revoked.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const {valid} = await Auth.validateToken({ token });\n * if (!valid) {\n * window.alert('Session invalid or expired. Please re-authenticate.');\n * }\n * ```\n */\nexport var validateToken = function (endpoint, params) {\n return endpoint.api //\n .post('/token/isValid', params)\n .then(function (r) { return r.data; });\n};\n/**\n * If called before the session expires, this will refresh the caller's session and tokens.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.refreshTokens();\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport var refreshTokens = function (endpoint) {\n return endpoint.api //\n .get('/token')\n .then(function (r) { return r.data; });\n};\n/**\n * Update the caller's password. To help prevent CSRF attack vectors, the user's old password and email address are required.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const {status, message} = await Auth.updatePassword({ email, oldPassword, newPassword });\n * if (status !== 'OK') {\n * window.alert(`Password reset error: ${message}`);\n * }\n * ```\n */\nexport var updatePassword = function (endpoint, params) {\n return endpoint.api //\n .put('/user/update_password', params)\n .then(function (r) { return r.data; });\n};\n/**\n * Update the caller's email address.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const {profiles} = await Auth.updateEmail({ email: newEmail });\n * ```\n */\nexport var updateEmail = function (endpoint, params) {\n return endpoint.api //\n .put('/user/update_email', params)\n .then(function (r) { return r.data; });\n};\n","@import '../../../theme.scss';\n\nverdocs-auth {\n font-family: $verdocs-primary-font;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n .login-form,\n .signup-form {\n background: $verdocs-grey-4;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n display: flex;\n padding: 20px;\n width: 300px;\n max-width: 100%;\n }\n\n .logo {\n margin: 20px 0 30px;\n width: 128px;\n max-width: 100%;\n }\n\n h3 {\n text-align: center;\n font-weight: 400;\n font-size: 16px;\n line-height: 1.75;\n margin: 0;\n }\n\n h4 {\n text-align: center;\n font-weight: 400;\n font-size: 14px;\n line-height: 1.43;\n margin: 0;\n }\n\n .status-result {\n display: none;\n\n &.debug {\n white-space: pre-wrap;\n font-size: 14px;\n background: #fff;\n padding: 10px;\n display: block;\n flex-direction: row;\n justify-content: center;\n }\n }\n\n form {\n width: 100%;\n }\n\n verdocs-text-input {\n margin-bottom: 10px;\n }\n}\n","import {Auth} from '@verdocs/js-sdk/Users';\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {TSession} from '@verdocs/js-sdk/Sessions/Types';\nimport {Component, Prop, State, h, Event, EventEmitter} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\n\nexport interface IAuthStatus {\n authenticated: boolean;\n session: TSession;\n}\n\n/**\n * Display an authentication dialog that allows the user to login or sign up. Callbacks are provided for events that\n * occur during the process (especially successful completion). The success callback will be fired immediately if the\n * user is already authenticated with a valid session, so this component may not always display visibly.\n *\n * To simplify some types of authentication flows, a visibility flag can force this component to never display. This\n * allows you to susbcribe to notifications from the\n *\n * This embed is responsive / mobile-friendly, but the calling application should provide at least a 300px wide\n * container to allow sufficient space for the required forms.\n *\n * As noted below, the primary event is `authenticated`. This will always be fired at least once, immediately after\n * the widget is rendered and the user's status has been checked. It may be fired again as the user completes (or\n * cancels) authentication steps.\n *\n * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth\n * embed. This Element will reuse the same session produced by logging in via that Embed.\n *\n * ```typescript\n * interface IAuthStatus {\n * // If true, the user is authenticated with a valid session\n * authenticated: boolean;\n *\n * // Details for the user's session\n * session: IActiveSession | null;\n * }\n * ```\n */\n@Component({\n tag: 'verdocs-auth',\n styleUrl: 'verdocs-auth.scss',\n shadow: false,\n})\nexport class VerdocsAuth {\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 * Normally, if the user has a valid session, this embed will be invisible, otherwise it will display\n * login / signup forms. If this is set to false, this embed will be invisible in both cases. Apps may\n * use this to verify if a user has a valid session without needing a separate call to Verdocs JS SDK.\n */\n @Prop() visible: boolean = true;\n\n /**\n * By default, a Verdocs logo will be displayed above the login/signup forms. This may be used to\n * override its source. (Alternatively, you may simply hide it via CSS overrides.) Logos should be\n * in SVG format for best results.\n */\n @Prop() logo: string = 'https://verdocs.com/assets/blue-logo.svg';\n\n /**\n * If the user is authenticated, this embed will normally render invisibly. If debug is set true, a summary\n * if the user's session details will be displayed instead. This may be useful while debugging authentication\n * flows in new applications.\n */\n @Prop() debug: boolean = false;\n\n /**\n * Event fired when session authentication process has completed. Check the event contents for completion status.\n */\n @Event({composed: true}) authenticated: EventEmitter<IAuthStatus>;\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 @State() isAuthenticated: boolean = false;\n @State() displayMode: string = 'login';\n @State() username: string = '';\n @State() password: string = '';\n @State() loggingIn: boolean = false;\n @State() activeSession: TSession = null;\n @State() loginError: string | null = null;\n\n componentWillLoad() {\n this.endpoint.loadSession();\n if (this.endpoint.session) {\n console.log('[AUTH] Authenticated');\n this.isAuthenticated = true;\n this.activeSession = this.endpoint.session;\n this.authenticated?.emit({authenticated: true, session: this.endpoint.session});\n } else {\n console.log('[AUTH] Anonymous');\n this.authenticated?.emit({authenticated: false, session: null});\n }\n }\n\n handleLogin() {\n this.loggingIn = true;\n Auth.authenticateUser(this.endpoint, {username: this.username, password: this.password})\n .then(r => {\n this.loggingIn = false;\n this.endpoint.setToken(r.accessToken);\n this.activeSession = this.endpoint.session;\n this.isAuthenticated = true;\n this.authenticated?.emit({authenticated: true, session: this.endpoint.session});\n })\n .catch(e => {\n console.log('[AUTH] Authentication error', e.response, JSON.stringify(e));\n this.loggingIn = false;\n this.activeSession = null;\n this.authenticated?.emit({authenticated: false, session: null});\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n\n if (e?.response?.status === 403) {\n this.loginError = 'Please check your username and password and try again.';\n }\n });\n }\n\n handleLogout() {\n this.endpoint.clearSession();\n this.isAuthenticated = false;\n this.authenticated?.emit({authenticated: false, session: null});\n }\n\n handleClearError() {\n this.loginError = null;\n }\n\n render() {\n if (!this.visible) {\n return <div style={{display: 'none'}}>Verdocs Auth Placeholder</div>;\n }\n\n if (this.isAuthenticated) {\n if (this.debug) {\n return (\n <div class=\"status-result debug\">\n <verdocs-button label=\"Logout\" disabled={this.loggingIn} onClick={() => this.handleLogout()} />\n </div>\n );\n }\n\n return <div class=\"status-result\">Authenticated</div>;\n }\n\n if (this.displayMode === 'signup') {\n return (\n <div class=\"signup-form\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n\n <h3>Sign up for an account</h3>\n <h4>\n Already have an account?\n <verdocs-button label=\"Log In\" variant=\"text\" onClick={() => (this.displayMode = 'login')} disabled={this.loggingIn} />\n </h4>\n\n <form onSubmit={() => this.handleLogin()}>\n <verdocs-text-input label=\"Email\" autocomplete=\"username\" value={this.username} onInput={(e: any) => (this.username = e.target.value)} disabled={this.loggingIn} />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n autocomplete=\"current-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.loggingIn}\n />\n\n <verdocs-button\n label=\"Signup\"\n disabled={this.loggingIn}\n onClick={() => this.handleLogin()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n </form>\n </div>\n );\n }\n\n return (\n <div class=\"login-form\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n\n <h3>Log in to your account</h3>\n <h4>\n Don't have an account?\n <verdocs-button label=\"Sign Up\" variant=\"text\" onClick={() => (this.displayMode = 'signup')} disabled={this.loggingIn} />\n </h4>\n\n <form onSubmit={() => this.handleLogin()}>\n <verdocs-text-input label=\"Email\" autocomplete=\"username\" value={this.username} onInput={(e: any) => (this.username = e.target.value)} disabled={this.loggingIn} />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n autocomplete=\"current-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.loggingIn}\n />\n\n <verdocs-button\n label=\"Forgot Your Password?\"\n variant=\"text\"\n onClick={() => (this.displayMode = 'signup')}\n disabled={this.loggingIn}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 20px'}}\n />\n\n <verdocs-button label=\"Login\" disabled={this.loggingIn} onClick={() => this.handleLogin()} style={{display: 'flex', justifyContent: 'center', margin: '10px auto 0'}} />\n </form>\n\n {this.loginError ? <verdocs-ok-dialog heading=\"Login Error\" message={this.loginError} onNext={() => this.handleClearError()} /> : <div />}\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"verdocs-auth.entry.cjs.js","mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAI,gBAAgB,GAAG,UAAU,QAAQ,EAAE,MAAM,EAAE;AAC1D,IAAI,OAAO,QAAQ,CAAC,GAAG;AACvB,SAAS,IAAI,CAAC,uBAAuB,EAAE,MAAM,CAAC;AAC9C,SAAS,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,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,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAC,GAC5E,EAEFA,4BAAgB,KAAK,EAAC,OAAO,EAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAC,GAAI,CACnK,EAEN,IAAI,CAAC,UAAU,GAAGA,+BAAmB,OAAO,EAAC,aAAa,EAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,gBAAgB,EAAE,GAAI,GAAGA,oBAAO,CACrI,EACN;GACH;;;;;;","names":["VerdocsEndpoint","Auth.authenticateUser","SDKError","h"],"sources":["./node_modules/@verdocs/js-sdk/Users/Auth.js","./src/components/embeds/verdocs-auth/verdocs-auth.scss?tag=verdocs-auth","./src/components/embeds/verdocs-auth/verdocs-auth.tsx"],"sourcesContent":["/**\n * Authenticate to Verdocs via user/password authentication\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.authenticateUser({ username: 'test@test.com', password: 'PASSWORD' });\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport var authenticateUser = function (endpoint, params) {\n return endpoint.api //\n .post('/authentication/login', params)\n .then(function (r) { return r.data; });\n};\n/**\n * Authenticate to Verdocs via client ID / Secret authentication. **NOTE: This is only suitable for\n * NodeJS server-side applications. Never expose your Client Secret in a Web or Mobile app!** Also note\n * that access tokens may be cached by server-side apps (and this is recommended) but do expire after 2\n * hours. This expiration may change based on future security needs. Application developers are encouraged\n * to check the `exp` expiration field in the response accessToken and renew tokens after they expire.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.authenticateApp({ client_id: 'CLIENTID', client_secret: 'SECRET' });\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport var authenticateApp = function (endpoint, params) {\n return endpoint.api //\n .post('/authentication/login_client', {}, { headers: params })\n .then(function (r) { return r.data; });\n};\n/**\n * Validate a token. Only Verdocs tokens will be accepted. Most applications can decode tokens locally,\n * because tokens will be validated when API calls are made anyway. However, high-security applications\n * may use this endpoint to check if a token has been revoked.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const {valid} = await Auth.validateToken({ token });\n * if (!valid) {\n * window.alert('Session invalid or expired. Please re-authenticate.');\n * }\n * ```\n */\nexport var validateToken = function (endpoint, params) {\n return endpoint.api //\n .post('/token/isValid', params)\n .then(function (r) { return r.data; });\n};\n/**\n * If called before the session expires, this will refresh the caller's session and tokens.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n * import {Transport} from '@verdocs/js-sdk/HTTP';\n *\n * const {accessToken} = await Auth.refreshTokens();\n * Transport.setAuthToken(accessToken);\n * ```\n */\nexport var refreshTokens = function (endpoint) {\n return endpoint.api //\n .get('/token')\n .then(function (r) { return r.data; });\n};\n/**\n * Update the caller's password. To help prevent CSRF attack vectors, the user's old password and email address are required.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const {status, message} = await Auth.updatePassword({ email, oldPassword, newPassword });\n * if (status !== 'OK') {\n * window.alert(`Password reset error: ${message}`);\n * }\n * ```\n */\nexport var updatePassword = function (endpoint, params) {\n return endpoint.api //\n .put('/user/update_password', params)\n .then(function (r) { return r.data; });\n};\n/**\n * Update the caller's email address.\n *\n * ```typescript\n * import {Auth} from '@verdocs/js-sdk/Auth';\n *\n * const {profiles} = await Auth.updateEmail({ email: newEmail });\n * ```\n */\nexport var updateEmail = function (endpoint, params) {\n return endpoint.api //\n .put('/user/update_email', params)\n .then(function (r) { return r.data; });\n};\n","@import '../../../theme.scss';\n\nverdocs-auth {\n font-family: $verdocs-primary-font;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n\n .login-form,\n .signup-form {\n background: $verdocs-grey-4;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n display: flex;\n padding: 20px;\n width: 300px;\n max-width: 100%;\n }\n\n .logo {\n margin: 20px 0 30px;\n width: 128px;\n max-width: 100%;\n }\n\n h3 {\n text-align: center;\n font-weight: 400;\n font-size: 16px;\n line-height: 1.75;\n margin: 0;\n }\n\n h4 {\n text-align: center;\n font-weight: 400;\n font-size: 14px;\n line-height: 1.43;\n margin: 0;\n }\n\n .status-result {\n display: none;\n\n &.debug {\n white-space: pre-wrap;\n font-size: 14px;\n background: #fff;\n padding: 10px;\n display: block;\n flex-direction: row;\n justify-content: center;\n }\n }\n\n form {\n width: 100%;\n }\n\n verdocs-text-input {\n margin-bottom: 10px;\n }\n}\n","import {Auth} from '@verdocs/js-sdk/Users';\nimport {VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {TSession} from '@verdocs/js-sdk/Sessions/Types';\nimport {Component, Prop, State, h, Event, EventEmitter} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\n\nexport interface IAuthStatus {\n authenticated: boolean;\n session: TSession;\n}\n\n/**\n * Display an authentication dialog that allows the user to login or sign up. Callbacks are provided for events that\n * occur during the process (especially successful completion). The success callback will be fired immediately if the\n * user is already authenticated with a valid session, so this component may not always display visibly.\n *\n * To simplify some types of authentication flows, a visibility flag can force this component to never display. This\n * allows you to susbcribe to notifications from the\n *\n * This embed is responsive / mobile-friendly, but the calling application should provide at least a 300px wide\n * container to allow sufficient space for the required forms.\n *\n * As noted below, the primary event is `authenticated`. This will always be fired at least once, immediately after\n * the widget is rendered and the user's status has been checked. It may be fired again as the user completes (or\n * cancels) authentication steps.\n *\n * Authentication is required to demonstrate this Element. You may do this in Storybook by using the Auth\n * embed. This Element will reuse the same session produced by logging in via that Embed.\n *\n * ```typescript\n * interface IAuthStatus {\n * // If true, the user is authenticated with a valid session\n * authenticated: boolean;\n *\n * // Details for the user's session\n * session: IActiveSession | null;\n * }\n * ```\n */\n@Component({\n tag: 'verdocs-auth',\n styleUrl: 'verdocs-auth.scss',\n shadow: false,\n})\nexport class VerdocsAuth {\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 * Normally, if the user has a valid session, this embed will be invisible, otherwise it will display\n * login / signup forms. If this is set to false, this embed will be invisible in both cases. Apps may\n * use this to verify if a user has a valid session without needing a separate call to Verdocs JS SDK.\n */\n @Prop() visible: boolean = true;\n\n /**\n * By default, a Verdocs logo will be displayed above the login/signup forms. This may be used to\n * override its source. (Alternatively, you may simply hide it via CSS overrides.) Logos should be\n * in SVG format for best results.\n */\n @Prop() logo: string = 'https://verdocs.com/assets/blue-logo.svg';\n\n /**\n * Event fired when session authentication process has completed. Check the event contents for completion status.\n */\n @Event({composed: true}) authenticated: EventEmitter<IAuthStatus>;\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 @State() isAuthenticated: boolean = false;\n @State() displayMode: string = 'login';\n @State() username: string = '';\n @State() password: string = '';\n @State() loggingIn: boolean = false;\n @State() activeSession: TSession = null;\n @State() loginError: string | null = null;\n\n componentWillLoad() {\n this.endpoint.loadSession();\n if (this.endpoint.session) {\n console.log('[AUTH] Authenticated');\n this.isAuthenticated = true;\n this.activeSession = this.endpoint.session;\n this.authenticated?.emit({authenticated: true, session: this.endpoint.session});\n } else {\n console.log('[AUTH] Anonymous');\n this.authenticated?.emit({authenticated: false, session: null});\n }\n }\n\n handleLogin() {\n this.loggingIn = true;\n Auth.authenticateUser(this.endpoint, {username: this.username, password: this.password})\n .then(r => {\n this.loggingIn = false;\n this.endpoint.setToken(r.accessToken);\n this.activeSession = this.endpoint.session;\n this.isAuthenticated = true;\n this.authenticated?.emit({authenticated: true, session: this.endpoint.session});\n })\n .catch(e => {\n console.log('[AUTH] Authentication error', e.response, JSON.stringify(e));\n this.loggingIn = false;\n this.activeSession = null;\n this.authenticated?.emit({authenticated: false, session: null});\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n\n if (e?.response?.status === 403) {\n this.loginError = 'Please check your username and password and try again.';\n }\n });\n }\n\n handleLogout() {\n this.endpoint.clearSession();\n this.isAuthenticated = false;\n this.authenticated?.emit({authenticated: false, session: null});\n }\n\n handleClearError() {\n this.loginError = null;\n }\n\n render() {\n if (!this.visible) {\n return <div style={{display: 'none'}}>Verdocs Auth Placeholder</div>;\n }\n\n if (this.isAuthenticated) {\n return <div class=\"status-result\">Authenticated</div>;\n }\n\n if (this.displayMode === 'signup') {\n return (\n <div class=\"signup-form\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n\n <h3>Sign up for an account</h3>\n <h4>\n Already have an account?\n <verdocs-button label=\"Log In\" variant=\"text\" onClick={() => (this.displayMode = 'login')} disabled={this.loggingIn} />\n </h4>\n\n <form onSubmit={() => this.handleLogin()}>\n <verdocs-text-input label=\"Email\" autocomplete=\"username\" value={this.username} onInput={(e: any) => (this.username = e.target.value)} disabled={this.loggingIn} />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n autocomplete=\"current-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.loggingIn}\n />\n\n <verdocs-button\n label=\"Signup\"\n disabled={this.loggingIn}\n onClick={() => this.handleLogin()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n </form>\n </div>\n );\n }\n\n return (\n <div class=\"login-form\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n\n <h3>Log in to your account</h3>\n <h4>\n Don't have an account?\n <verdocs-button label=\"Sign Up\" variant=\"text\" onClick={() => (this.displayMode = 'signup')} disabled={this.loggingIn} />\n </h4>\n\n <form onSubmit={() => this.handleLogin()}>\n <verdocs-text-input label=\"Email\" autocomplete=\"username\" value={this.username} onInput={(e: any) => (this.username = e.target.value)} disabled={this.loggingIn} />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n autocomplete=\"current-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.loggingIn}\n />\n\n <verdocs-button\n label=\"Forgot Your Password?\"\n variant=\"text\"\n onClick={() => (this.displayMode = 'signup')}\n disabled={this.loggingIn}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 20px'}}\n />\n\n <verdocs-button label=\"Login\" disabled={this.loggingIn} onClick={() => this.handleLogin()} style={{display: 'flex', justifyContent: 'center', margin: '10px auto 0'}} />\n </form>\n\n {this.loginError ? <verdocs-ok-dialog heading=\"Login Error\" message={this.loginError} onNext={() => this.handleClearError()} /> : <div />}\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-1329d89c.js');
|
|
6
6
|
require('./Types-da57ce69.js');
|
|
7
7
|
const VerdocsEndpoint = require('./VerdocsEndpoint-a9bf9d59.js');
|
|
8
|
-
const Templates = require('./Templates-
|
|
8
|
+
const Templates = require('./Templates-c0b4453e.js');
|
|
9
9
|
const errors = require('./errors-0396da3d.js');
|
|
10
10
|
require('./Token-576f0e8a.js');
|
|
11
11
|
require('./Templates-8ef16e3d.js');
|
|
12
|
-
require('./templateStore-
|
|
12
|
+
require('./templateStore-86cc0f59.js');
|
|
13
13
|
require('./index-eb130f52.js');
|
|
14
|
-
require('./utils-
|
|
14
|
+
require('./utils-fae54b93.js');
|
|
15
15
|
|
|
16
16
|
const verdocsBuildCss = "verdocs-build{display:-ms-flexbox;display:flex;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-ms-flex-pack:center;justify-content:center;-ms-flex-align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C;QAC1C,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;OAC3D,GACD,CACH,CACF,CACI,EACP;GACH;;;;;AC/IH,MAAM,gBAAgB,GAAG,2pUAA2pU;;MCUvqU,aAAa;;;;EACxB,MAAM;IACJ,OAAOA,QAACC,UAAI,OAAG,CAAC;GACjB;;;;;;;","names":["h","Host"],"sources":["./src/components/elements/verdocs-document-page/verdocs-document-page.scss?tag=verdocs-document-page","./src/components/elements/verdocs-document-page/verdocs-document-page.tsx","./src/components/controls/verdocs-loader/verdocs-loader.scss?tag=verdocs-loader","./src/components/controls/verdocs-loader/verdocs-loader.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n max-width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-document-page',\n styleUrl: 'verdocs-document-page.scss',\n shadow: false,\n})\nexport class VerdocsDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The URL of the image to render as the page background.\n */\n @Prop() pageImageUri: string = '';\n\n /**\n * The page number being rendered. Not used internally, but included in callbacks/events beacuse page numbers\n * are used everywhere in document handling. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n\n @State() skipFirstNotification = true;\n\n componentDidLoad(): void {\n this.resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n });\n\n this.resizeObserver.observe(this.container);\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n // Left here for documentation purposes in case we find an edge case where this isn't true. But we apparently don't need this.\n // When we add the resize observer it will always be triggered at least once so notifying here as well is just a dupe.\n // componentDidRender() {\n // this.notifyRenderedSize();\n // }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n this.pageRendered.emit({\n container: this.container,\n containerId: this.containerId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n xScale: this.renderedWidth / this.naturalWidth,\n yScale: this.renderedHeight / this.naturalHeight,\n });\n }\n\n render() {\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : (\n <img\n class=\"verdocs-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageImageUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n onLoad={(e: any) => {\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n }}\n />\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-loader {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n font-size: 24px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n text-indent: -9999em;\n -webkit-animation: load5 1.1s infinite ease;\n animation: verdocs-loader-kf 1.1s infinite ease;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n@keyframes verdocs-loader-kf {\n 0%,\n 100% {\n box-shadow: 0em -2.6em 0em 0em $verdocs-bg-2, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);\n }\n 12.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em $verdocs-bg-2, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);\n }\n 25% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em $verdocs-bg-2, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 37.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em $verdocs-bg-2,\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 50% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4),\n 0em 2.5em 0 0em $verdocs-bg-2, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 62.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em $verdocs-bg-2, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 75% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em $verdocs-bg-2, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 87.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em $verdocs-bg-2;\n }\n}\n","import {Component, h, Host} from '@stencil/core';\n\n/**\n * Animated loader placeholder. There are currently no configuration options for this control.\n */\n@Component({\n tag: 'verdocs-loader',\n styleUrl: 'verdocs-loader.scss',\n shadow: false,\n})\nexport class VerdocsLoader {\n render() {\n return <Host />;\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"verdocs-document-page.verdocs-loader.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,sBAAsB,GAAG,0SAA0S;;MCe5T,mBAAmB;;;;wBAOC,EAAE;sBAMJ,CAAC;wBAMC,GAAG;yBAMF,GAAG;kBAcJ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC;uBAOxC,yBAAyB,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;yBAE5D,IAAI,CAAC,YAAY;0BAChB,IAAI,CAAC,aAAa;wBACpB,IAAI,CAAC,YAAY;yBAChB,IAAI,CAAC,aAAa;uBACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa;iCAEpC,IAAI;;EAErC,gBAAgB;IACd,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,OAAO;MAC9C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;QAC3B,MAAM,aAAa,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,aAAa,IAAI,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;OAChF;MAED,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC3B,CAAC,CAAC;IAEH,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;GAC7C;EAED,oBAAoB;;IAClB,MAAA,IAAI,CAAC,cAAc,0CAAE,UAAU,EAAE,CAAC;GACnC;;;;;;EAQD,kBAAkB;;;IAGhB,IAAI,IAAI,CAAC,qBAAqB,EAA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EAAE,iBACjB,IAAI,EACjB,MAAM,EAAE,CAAC,CAAM;QACb,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;OAC3D,GACD,CACH,CACF,CACI,EACP;GACH;;;;;AChJH,MAAM,gBAAgB,GAAG,2pUAA2pU;;MCUvqU,aAAa;;;;EACxB,MAAM;IACJ,OAAOA,QAACC,UAAI,OAAG,CAAC;GACjB;;;;;;;","names":["h","Host"],"sources":["./src/components/elements/verdocs-document-page/verdocs-document-page.scss?tag=verdocs-document-page","./src/components/elements/verdocs-document-page/verdocs-document-page.tsx","./src/components/controls/verdocs-loader/verdocs-loader.scss?tag=verdocs-loader","./src/components/controls/verdocs-loader/verdocs-loader.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n max-width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-document-page',\n styleUrl: 'verdocs-document-page.scss',\n shadow: false,\n})\nexport class VerdocsDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The URL of the image to render as the page background.\n */\n @Prop() pageImageUri: string = '';\n\n /**\n * The page number being rendered. Not used internally, but included in callbacks/events beacuse page numbers\n * are used everywhere in document handling. (Reminder: page numbers are 1-based.)\n */\n @Prop() pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n\n @State() skipFirstNotification = true;\n\n componentDidLoad(): void {\n this.resizeObserver = new ResizeObserver(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n });\n\n this.resizeObserver.observe(this.container);\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n // Left here for documentation purposes in case we find an edge case where this isn't true. But we apparently don't need this.\n // When we add the resize observer it will always be triggered at least once so notifying here as well is just a dupe.\n // componentDidRender() {\n // this.notifyRenderedSize();\n // }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n console.log('Notyfing new size');\n this.pageRendered.emit({\n container: this.container,\n containerId: this.containerId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n xScale: this.renderedWidth / this.naturalWidth,\n yScale: this.renderedHeight / this.naturalHeight,\n });\n }\n\n render() {\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : (\n <img\n class=\"verdocs-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageImageUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n onLoad={(e: any) => {\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n }}\n />\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-loader {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-left: -20px;\n margin-top: -20px;\n font-size: 24px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n text-indent: -9999em;\n -webkit-animation: load5 1.1s infinite ease;\n animation: verdocs-loader-kf 1.1s infinite ease;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n}\n\n@keyframes verdocs-loader-kf {\n 0%,\n 100% {\n box-shadow: 0em -2.6em 0em 0em $verdocs-bg-2, 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.3), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4);\n }\n 12.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.4), 1.8em -1.8em 0 0em $verdocs-bg-2, 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3);\n }\n 25% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.3), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.4), 2.5em 0em 0 0em $verdocs-bg-2, 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 37.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.3), 2.5em 0em 0 0em rgba(0, 0, 0, 0.4), 1.75em 1.75em 0 0em $verdocs-bg-2,\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 50% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.3), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.4),\n 0em 2.5em 0 0em $verdocs-bg-2, -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.2), -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 62.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.3),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.4), -1.8em 1.8em 0 0em $verdocs-bg-2, -2.6em 0em 0 0em rgba(0, 0, 0, 0.2), -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 75% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.3), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.4), -2.6em 0em 0 0em $verdocs-bg-2, -1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2);\n }\n 87.5% {\n box-shadow: 0em -2.6em 0em 0em rgba(0, 0, 0, 0.2), 1.8em -1.8em 0 0em rgba(0, 0, 0, 0.2), 2.5em 0em 0 0em rgba(0, 0, 0, 0.2), 1.75em 1.75em 0 0em rgba(0, 0, 0, 0.2),\n 0em 2.5em 0 0em rgba(0, 0, 0, 0.2), -1.8em 1.8em 0 0em rgba(0, 0, 0, 0.3), -2.6em 0em 0 0em rgba(0, 0, 0, 0.4), -1.8em -1.8em 0 0em $verdocs-bg-2;\n }\n}\n","import {Component, h, Host} from '@stencil/core';\n\n/**\n * Animated loader placeholder. There are currently no configuration options for this control.\n */\n@Component({\n tag: 'verdocs-loader',\n styleUrl: 'verdocs-loader.scss',\n shadow: false,\n})\nexport class VerdocsLoader {\n render() {\n return <Host />;\n }\n}\n"],"version":3}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1329d89c.js');
|
|
6
6
|
const Colors = require('./Colors-e809dcc9.js');
|
|
7
|
-
const utils = require('./utils-
|
|
7
|
+
const utils = require('./utils-fae54b93.js');
|
|
8
8
|
require('./Token-576f0e8a.js');
|
|
9
9
|
|
|
10
10
|
const verdocsFieldCheckboxCss = "@charset \"UTF-8\";verdocs-field-checkbox{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-checkbox.disabled{opacity:0.5}verdocs-field-checkbox label>input[type=checkbox]{display:none}verdocs-field-checkbox label>input[type=checkbox]+*::before{content:\"\";position:absolute;display:block;top:1px;left:1px;width:10px;height:10px;border-radius:2px;border:1px solid rgba(0, 0, 0, 0.7)}verdocs-field-checkbox label>input[type=checkbox]:checked+*{color:#55bc81}verdocs-field-checkbox label>input[type=checkbox]:checked+*::before{content:\"✓\";color:white;text-align:center;background:#55bc81;border-color:#55bc81}verdocs-field-checkbox.required label>input[type=checkbox]+*::before{border:1px solid #cc0000}verdocs-field-checkbox.hide{display:none}verdocs-field-checkbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1329d89c.js');
|
|
6
|
-
const utils = require('./utils-
|
|
6
|
+
const utils = require('./utils-fae54b93.js');
|
|
7
7
|
const Colors = require('./Colors-e809dcc9.js');
|
|
8
8
|
const index$1 = require('./index-6528b430.js');
|
|
9
9
|
require('./Token-576f0e8a.js');
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1329d89c.js');
|
|
6
6
|
const Colors = require('./Colors-e809dcc9.js');
|
|
7
|
-
const utils = require('./utils-
|
|
7
|
+
const utils = require('./utils-fae54b93.js');
|
|
8
8
|
require('./Token-576f0e8a.js');
|
|
9
9
|
|
|
10
10
|
const verdocsFieldDropdownCss = "verdocs-field-dropdown{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:85px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-dropdown.disabled{opacity:0.5}verdocs-field-dropdown select{position:absolute;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;font-size:11px;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-dropdown select:focus{outline:none}verdocs-field-dropdown select.hide{display:none}verdocs-field-dropdown.required select{border:1px solid #cc0000}verdocs-field-dropdown.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1329d89c.js');
|
|
6
6
|
const Colors = require('./Colors-e809dcc9.js');
|
|
7
|
-
const utils = require('./utils-
|
|
7
|
+
const utils = require('./utils-fae54b93.js');
|
|
8
8
|
require('./Token-576f0e8a.js');
|
|
9
9
|
|
|
10
10
|
const verdocsFieldInitialCss = "verdocs-field-initial{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:83px;height:36px;display:block;font-size:11px;letter-spacing:0.3px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-initial.disabled{opacity:0.5}verdocs-field-initial.done{border:none;opacity:1}verdocs-field-initial img{display:block;max-width:100%;max-height:100%}verdocs-field-initial button{-webkit-box-sizing:border-box;box-sizing:border-box;border:none;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-initial button.hide{display:none}verdocs-field-initial.required{border:1px solid #cc0000}verdocs-field-initial.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-initial verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-initial verdocs-button-panel[data-active],verdocs-field-initial verdocs-button-panel:hover{opacity:1}verdocs-field-initial verdocs-button-panel .icon svg{fill:#333333}verdocs-field-initial verdocs-button-panel .icon:hover svg{fill:#000000}";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1329d89c.js');
|
|
6
6
|
const Colors = require('./Colors-e809dcc9.js');
|
|
7
|
-
const utils = require('./utils-
|
|
7
|
+
const utils = require('./utils-fae54b93.js');
|
|
8
8
|
require('./Token-576f0e8a.js');
|
|
9
9
|
|
|
10
10
|
const verdocsFieldPaymentCss = "verdocs-field-payment{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:24px;height:24px;display:block;font-size:11px;position:relative;border:1px solid #cfa;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-payment.disabled{opacity:0.5}verdocs-field-payment button,verdocs-field-payment div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-field-payment button{color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px}verdocs-field-payment button.hide{display:none}verdocs-field-payment input{float:left;font-family:Arial, sans-serif}verdocs-field-payment select{position:absolute;font-family:Arial, sans-serif;background:linear-gradient(55deg, transparent 50%, #333 50%), linear-gradient(125deg, #333 50%, transparent 50%), linear-gradient(to right, transparent, transparent);background-position:calc(100% - 7px) 4px, calc(100% - 3px) 4px, 100% 0;background-size:5px 5px, 5px 5px, 2.5em 2.5em;background-repeat:no-repeat;-webkit-appearance:none;-moz-appearance:none;appearance:none}verdocs-field-payment .frame{width:100%;height:100%;background-size:contain;text-align:left}verdocs-field-payment .frame img{position:absolute;height:auto;width:100%}verdocs-field-payment.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1329d89c.js');
|
|
6
6
|
const Colors = require('./Colors-e809dcc9.js');
|
|
7
|
-
const utils = require('./utils-
|
|
7
|
+
const utils = require('./utils-fae54b93.js');
|
|
8
8
|
require('./Token-576f0e8a.js');
|
|
9
9
|
|
|
10
10
|
const verdocsFieldRadioButtonCss = "verdocs-field-radio-button{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:14px;height:14px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-field-radio-button.disabled{opacity:0.5}verdocs-field-radio-button.disabled.done{opacity:1}verdocs-field-radio-button.done input[type=radio]{margin:0;padding:0;width:10px;height:10px}verdocs-field-radio-button:not(.done) input[type=radio]{position:absolute;opacity:0}verdocs-field-radio-button:not(.done) input[type=radio]+label:before{content:\"\";border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:10px;height:10px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-field-radio-button:not(.done) input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-field-radio-button:not(.done) input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-field-radio-button:not(.done) input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#a0a0d0;background:#a0a0d0}verdocs-field-radio-button:not(.done) input[type=radio]+label:empty:before{margin-right:0}verdocs-field-radio-button.required input[type=radio]+label:before{border:1px solid #cc0000}verdocs-field-radio-button.hide{display:none}verdocs-field-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1329d89c.js');
|
|
6
6
|
const Colors = require('./Colors-e809dcc9.js');
|
|
7
|
-
const utils = require('./utils-
|
|
7
|
+
const utils = require('./utils-fae54b93.js');
|
|
8
8
|
const popper = require('./popper-11d5f714.js');
|
|
9
9
|
require('./Token-576f0e8a.js');
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-1329d89c.js');
|
|
6
6
|
const Colors = require('./Colors-e809dcc9.js');
|
|
7
|
-
const utils = require('./utils-
|
|
7
|
+
const utils = require('./utils-fae54b93.js');
|
|
8
8
|
require('./Token-576f0e8a.js');
|
|
9
9
|
|
|
10
10
|
const verdocsFieldTextareaCss = "verdocs-field-textarea{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:150px;height:15px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left}verdocs-field-textarea.disabled{opacity:0.5}verdocs-field-textarea textarea{-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87);font-weight:500;-webkit-transform-origin:0 0;transform-origin:0 0;height:100%;width:100%;background:none;font-size:11px;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textarea textarea.hide{display:none}verdocs-field-textarea.required{border:1px solid #cc0000}verdocs-field-textarea.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";
|