@verdocs/web-sdk 5.0.51 → 5.0.52
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/index-2b9aa26f.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +6 -6
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +2 -2
- package/dist/cjs/{verdocs-kba-dialog_2.cjs.entry.js → verdocs-kba-dialog_3.cjs.entry.js} +91 -5
- package/dist/cjs/verdocs-kba-dialog_3.cjs.entry.js.map +1 -0
- package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +7 -7
- package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +5 -0
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/dialogs/verdocs-otp-dialog/verdocs-otp-dialog.css +163 -0
- package/dist/collection/components/dialogs/verdocs-otp-dialog/verdocs-otp-dialog.js +187 -0
- package/dist/collection/components/dialogs/verdocs-otp-dialog/verdocs-otp-dialog.js.map +1 -0
- package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +1 -1
- package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +1 -1
- package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
- package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +5 -0
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
- package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +6 -6
- package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +2 -2
- package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
- package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +7 -7
- package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
- package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-31e18593.js → p-1dccb8a9.js} +2 -2
- package/dist/components/{p-31e18593.js.map → p-1dccb8a9.js.map} +1 -1
- package/dist/components/{p-a7f85081.js → p-2508f120.js} +8 -8
- package/dist/components/{p-a7f85081.js.map → p-2508f120.js.map} +1 -1
- package/dist/components/{p-571fe280.js → p-25c19f32.js} +2 -2
- package/dist/components/{p-571fe280.js.map → p-25c19f32.js.map} +1 -1
- package/dist/components/{p-f9789855.js → p-592a0baf.js} +6 -6
- package/dist/components/{p-f9789855.js.map → p-592a0baf.js.map} +1 -1
- package/dist/components/{p-f3d501b9.js → p-6130383b.js} +2 -2
- package/dist/components/{p-f3d501b9.js.map → p-6130383b.js.map} +1 -1
- package/dist/components/p-b663b885.js +116 -0
- package/dist/components/p-b663b885.js.map +1 -0
- package/dist/components/{p-ffa430d4.js → p-bcdf821c.js} +5 -5
- package/dist/components/{p-ffa430d4.js.map → p-bcdf821c.js.map} +1 -1
- package/dist/components/{p-8203a6af.js → p-c04daa8c.js} +2 -2
- package/dist/components/{p-8203a6af.js.map → p-c04daa8c.js.map} +1 -1
- package/dist/components/{p-83430ada.js → p-d16c9dd7.js} +2 -2
- package/dist/components/{p-83430ada.js.map → p-d16c9dd7.js.map} +1 -1
- package/dist/components/{p-d9fd90cc.js → p-de58dbf5.js} +2 -2
- package/dist/components/{p-d9fd90cc.js.map → p-de58dbf5.js.map} +1 -1
- package/dist/components/{p-e90316c8.js → p-e46946db.js} +2 -2
- package/dist/components/{p-e90316c8.js.map → p-e46946db.js.map} +1 -1
- package/dist/components/{p-c0e75957.js → p-ec382639.js} +3 -3
- package/dist/components/{p-c0e75957.js.map → p-ec382639.js.map} +1 -1
- package/dist/components/{p-43fb3b33.js → p-edf89442.js} +6 -6
- package/dist/components/{p-43fb3b33.js.map → p-edf89442.js.map} +1 -1
- package/dist/components/{p-03b81b12.js → p-f887116b.js} +2 -2
- package/dist/components/{p-03b81b12.js.map → p-f887116b.js.map} +1 -1
- package/dist/components/verdocs-build.js +9 -9
- package/dist/components/verdocs-envelope-document-page.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +7 -7
- package/dist/components/verdocs-field-attachment.js +1 -1
- package/dist/components/verdocs-field-signature.js +1 -1
- package/dist/components/verdocs-otp-dialog.d.ts +11 -0
- package/dist/components/verdocs-otp-dialog.js +8 -0
- package/dist/components/verdocs-otp-dialog.js.map +1 -0
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-quick-functions.js +1 -1
- package/dist/components/verdocs-search-tabs.js +1 -1
- package/dist/components/verdocs-sign.js +26 -15
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-signature-dialog.js +1 -1
- package/dist/components/verdocs-status-indicator.js +1 -1
- package/dist/components/verdocs-template-card.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-template-role-properties.js +1 -1
- package/dist/components/verdocs-template-roles.js +1 -1
- package/dist/components/verdocs-template-star.js +1 -1
- package/dist/components/verdocs-template-tags.js +1 -1
- package/dist/components/verdocs-templates-list.js +1 -1
- package/dist/components/verdocs-upload-dialog.js +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/custom-elements.json +2252 -0
- package/dist/esm/index-24c3207f.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +6 -6
- package/dist/esm/verdocs-field-attachment_13.entry.js +2 -2
- package/dist/esm/{verdocs-kba-dialog_2.entry.js → verdocs-kba-dialog_3.entry.js} +92 -7
- package/dist/esm/verdocs-kba-dialog_3.entry.js.map +1 -0
- package/dist/esm/verdocs-menu-panel_2.entry.js +7 -7
- package/dist/esm/verdocs-quick-functions.entry.js +1 -1
- package/dist/esm/verdocs-search-tabs.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +5 -0
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-status-indicator.entry.js +2 -2
- package/dist/esm/verdocs-template-card.entry.js +1 -1
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-template-tags.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/index-24c3207f.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm-es5/verdocs-kba-dialog_3.entry.js +2 -0
- package/dist/esm-es5/verdocs-kba-dialog_3.entry.js.map +1 -0
- package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
- package/dist/esm-es5/verdocs-search-tabs.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-status-indicator.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-tags.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/dialogs/verdocs-otp-dialog/verdocs-otp-dialog.d.ts +36 -0
- package/dist/types/components.d.ts +67 -2
- package/dist/verdocs-web-sdk/{p-2386d60c.entry.js → p-05000ccc.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-10cbb44d.system.entry.js → p-0b26b5c8.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7d394848.entry.js → p-0fee994b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2cc55fbf.entry.js → p-11c8ffea.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4e022197.entry.js → p-153e03e0.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-72152009.entry.js → p-1872c8f4.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-1872c8f4.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-2d892f93.system.entry.js → p-2f68a524.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-7b7be644.entry.js → p-437ce063.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-299bb90e.system.entry.js → p-49c785c1.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6fe49e4a.system.entry.js → p-4c8b181b.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-9b13c31e.system.entry.js → p-5c1789d5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-a058e16b.system.entry.js → p-689c27e5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-f4a233b8.entry.js → p-6bdbbe58.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-538d5113.entry.js → p-73fe8630.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-8a6c7f95.system.js +1 -1
- package/dist/verdocs-web-sdk/p-8a6c7f95.system.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-410a6003.system.entry.js → p-a0eef7ff.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-594d3edb.system.entry.js → p-a1d64ec5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-2f9ba82a.entry.js → p-b0d1c5ec.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e46ccb3d.entry.js → p-bb84d9fa.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e06a796b.system.entry.js → p-c1dfe6e6.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-eb08e32c.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-eb08e32c.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-8669ce44.entry.js → p-ed0f54de.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-39d89ec1.system.entry.js → p-f14c3ce8.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-f14c3ce8.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-f2a3c06d.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-f2a3c06d.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-8982eb1c.system.entry.js → p-fe35adce.system.entry.js} +2 -2
- 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/verdocs-kba-dialog_2.cjs.entry.js.map +0 -1
- package/dist/esm/verdocs-kba-dialog_2.entry.js.map +0 -1
- package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +0 -2
- package/dist/esm-es5/verdocs-kba-dialog_2.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-39d89ec1.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-72152009.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-825259ba.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-825259ba.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e7cf98ed.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e7cf98ed.entry.js.map +0 -1
- /package/dist/verdocs-web-sdk/{p-2386d60c.entry.js.map → p-05000ccc.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-10cbb44d.system.entry.js.map → p-0b26b5c8.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7d394848.entry.js.map → p-0fee994b.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-2cc55fbf.entry.js.map → p-11c8ffea.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4e022197.entry.js.map → p-153e03e0.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-2d892f93.system.entry.js.map → p-2f68a524.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-7b7be644.entry.js.map → p-437ce063.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-299bb90e.system.entry.js.map → p-49c785c1.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-6fe49e4a.system.entry.js.map → p-4c8b181b.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-9b13c31e.system.entry.js.map → p-5c1789d5.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-a058e16b.system.entry.js.map → p-689c27e5.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-f4a233b8.entry.js.map → p-6bdbbe58.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-538d5113.entry.js.map → p-73fe8630.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-410a6003.system.entry.js.map → p-a0eef7ff.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-594d3edb.system.entry.js.map → p-a1d64ec5.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-2f9ba82a.entry.js.map → p-b0d1c5ec.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e46ccb3d.entry.js.map → p-bb84d9fa.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e06a796b.system.entry.js.map → p-c1dfe6e6.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-8669ce44.entry.js.map → p-ed0f54de.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-8982eb1c.system.entry.js.map → p-fe35adce.system.entry.js.map} +0 -0
@@ -0,0 +1,116 @@
|
|
1
|
+
import { p as proxyCustomElement, H, c as createEvent, h, d as Host } from './p-20f1beff.js';
|
2
|
+
import { verifySigner, VerdocsEndpoint } from '@verdocs/js-sdk';
|
3
|
+
import { d as defineCustomElement$1 } from './p-77b37d23.js';
|
4
|
+
|
5
|
+
const verdocsOtpDialogCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-otp-dialog{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-otp-dialog .dialog{width:440px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#fff;padding:16px;gap:10px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-otp-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-otp-dialog .step{margin-left:6px;color:#666}verdocs-otp-dialog .help-box{background-color:#707ae5;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding:14px;-ms-flex-align:center;align-items:center;color:white}verdocs-otp-dialog .help-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:15px;font-size:14px}verdocs-otp-dialog .help-icon{width:40px;height:40px}verdocs-otp-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-otp-dialog .help-text{font-weight:400}verdocs-otp-dialog .input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:10px;-ms-flex-align:center;align-items:center;margin:16px 0 32px}verdocs-otp-dialog .input label{-ms-flex:0;flex:0;line-height:10px;font-weight:500;white-space:nowrap}verdocs-otp-dialog .input input{-ms-flex:1;flex:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-otp-dialog .field{gap:10px;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;max-width:100%}verdocs-otp-dialog .field .required{color:red;position:relative;top:-0.5em;font-size:80%}verdocs-otp-dialog .field label{-ms-flex:0 0 120px;flex:0 0 120px;font-weight:500;line-height:10px;text-align:right;white-space:nowrap}verdocs-otp-dialog .field verdocs-date-input{width:40%;-ms-flex-positive:1;flex-grow:1}verdocs-otp-dialog .field verdocs-date-input input{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog .field input{width:40%;-ms-flex-positive:1;flex-grow:1;padding:5px 8px;border-radius:3px;border:1px solid #cccccc}verdocs-otp-dialog .choices{display:grid;gap:15px;grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));margin:0 0 15px 0}verdocs-otp-dialog .choice{border:1px solid #707ae5;border-radius:5px;display:-ms-flexbox;display:flex;height:60px;font-size:14px;padding:0 5px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center;color:#5c6575;cursor:pointer}verdocs-otp-dialog .choice.selected{background-color:#707ae5;color:#ffffff}verdocs-otp-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-otp-dialog .buttons verdocs-button{margin-left:16px}";
|
6
|
+
const VerdocsOtpDialogStyle0 = verdocsOtpDialogCss;
|
7
|
+
|
8
|
+
const QuestionIcon = `<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0C8.95313 0 0 8.95313 0 20C0 31.0469 8.95313 40 20 40C31.0469 40 40 31.0469 40 20C40 8.95313 31.0469 0 20 0ZM20 36.25C11.0391 36.25 3.75 28.9602 3.75 20C3.75 11.0398 11.0391 3.75 20 3.75C28.9609 3.75 36.25 11.0398 36.25 20C36.25 28.9602 28.9609 36.25 20 36.25Z" fill="white"/><path d="M20 26.25C18.5938 26.25 17.5 27.3438 17.5 28.75C17.5 30.1562 18.5234 31.25 20 31.25C21.3359 31.25 22.5 30.1562 22.5 28.75C22.5 27.3438 21.3359 26.25 20 26.25ZM22.5859 10H18.5938C15.5469 10 13.125 12.4219 13.125 15.4688C13.125 16.4844 13.9844 17.3438 15 17.3438C16.0156 17.3438 16.875 16.4844 16.875 15.4688C16.875 14.5312 17.5859 13.75 18.5234 13.75H22.5156C23.5234 13.75 24.375 14.5312 24.375 15.4688C24.375 16.0938 24.0625 16.5703 23.5156 16.8828L19.0625 19.6094C18.4375 20 18.125 20.625 18.125 21.25V22.5C18.125 23.5156 18.9844 24.375 20 24.375C21.0156 24.375 21.875 23.5156 21.875 22.5V22.3438L25.3984 20.1562C27.0391 19.1406 28.0547 17.3438 28.0547 15.4688C28.125 12.4219 25.7031 10 22.5859 10Z" fill="#E7E7E7"/></svg>`;
|
9
|
+
const VerdocsOtpDialog = /*@__PURE__*/ proxyCustomElement(class VerdocsOtpDialog extends H {
|
10
|
+
constructor() {
|
11
|
+
super();
|
12
|
+
this.__registerHost();
|
13
|
+
this.exit = createEvent(this, "exit", 7);
|
14
|
+
this.next = createEvent(this, "next", 7);
|
15
|
+
this.resendTimeout = null;
|
16
|
+
/**
|
17
|
+
* The type of dialog to display. Three modes are supported.
|
18
|
+
*/
|
19
|
+
this.method = 'email';
|
20
|
+
/**
|
21
|
+
* For identity confirmation, the current recipient details.
|
22
|
+
*/
|
23
|
+
this.recipient = null;
|
24
|
+
this.resendDisabled = true;
|
25
|
+
this.response = '';
|
26
|
+
}
|
27
|
+
componentWillLoad() {
|
28
|
+
this.startResendTimeout();
|
29
|
+
verifySigner(VerdocsEndpoint.getDefault(), { auth_method: this.method, code: '', resend: true })
|
30
|
+
.then(r => {
|
31
|
+
console.log('Resend result', r);
|
32
|
+
this.response = '';
|
33
|
+
})
|
34
|
+
.catch(e => console.log('Error resending code', e));
|
35
|
+
}
|
36
|
+
disconnectedCallback() {
|
37
|
+
if (this.resendTimeout) {
|
38
|
+
clearTimeout(this.resendTimeout);
|
39
|
+
this.resendTimeout = null;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
handleCancel() {
|
43
|
+
this.exit.emit();
|
44
|
+
}
|
45
|
+
// We need a separate event handler for clicking the background because it can receive events "through" other child components
|
46
|
+
handleDismiss(e) {
|
47
|
+
if (e.target.class === 'background-overlay') {
|
48
|
+
e.preventDefault();
|
49
|
+
this.handleCancel();
|
50
|
+
}
|
51
|
+
}
|
52
|
+
startResendTimeout() {
|
53
|
+
this.resendDisabled = true;
|
54
|
+
if (this.resendTimeout) {
|
55
|
+
clearTimeout(this.resendTimeout);
|
56
|
+
}
|
57
|
+
this.resendTimeout = setTimeout(() => {
|
58
|
+
this.resendDisabled = false;
|
59
|
+
}, 30000);
|
60
|
+
}
|
61
|
+
handleResend() {
|
62
|
+
this.startResendTimeout();
|
63
|
+
verifySigner(VerdocsEndpoint.getDefault(), { auth_method: this.method, code: '', resend: true })
|
64
|
+
.then(r => {
|
65
|
+
console.log('Resend result', r);
|
66
|
+
this.response = '';
|
67
|
+
window.alert('A new code has been sent.');
|
68
|
+
})
|
69
|
+
.catch(e => console.log('Error resending code', e));
|
70
|
+
}
|
71
|
+
handleSubmit() {
|
72
|
+
this.startResendTimeout();
|
73
|
+
verifySigner(VerdocsEndpoint.getDefault(), { auth_method: this.method, code: this.response })
|
74
|
+
.then(response => {
|
75
|
+
console.log('Verification completed', response);
|
76
|
+
this.next.emit({ response });
|
77
|
+
window.alert('A new code has been sent.');
|
78
|
+
})
|
79
|
+
.catch(e => {
|
80
|
+
window.alert('Invalid verification code. Please try again.');
|
81
|
+
console.log('Invalid code', e);
|
82
|
+
});
|
83
|
+
this.response = '';
|
84
|
+
}
|
85
|
+
render() {
|
86
|
+
return (h(Host, { key: '923287e7f0d818fc660befa0f6f6a787146b3258' }, h("div", { key: 'fefdc2ab6fc4bd40dd3bfe1076da0922a06ee934', class: "background-overlay", onClick: e => this.handleDismiss(e) }, h("div", { key: 'd11f7ba31f5933dad993491d43373d084dd02225', class: "dialog" }, h("div", { key: 'a2358fa461d8ecca21eac50b14078a91c9c486f1', class: "heading" }, "Verification Required"), h("div", { key: 'c6077109c87dc7f84a13660defb2e57ae82fb28b', class: "help-box" }, h("div", { key: 'd6df4a2e614a9e00e666529c092b34462f5f08ca', class: "help-icon", innerHTML: QuestionIcon }), h("div", { key: '324245b22da5cb8bca73d30b150a25aca6edeb96', class: "help-details" }, h("div", { key: 'a8ec738fd61ea94d78370f134330b76f2faec2b0', class: "help-title" }, "Please verify your email address"), h("div", { key: 'eefac97c966abb2cd911d3f46e1253c05b8fb2c4', class: "help-text" }, "Check your email for a one-time code, and enter it below."))), h("div", { key: '811e0aa0e1539a3dba4125670ad7afdb69fd83cf', class: "input" }, h("label", { key: 'e45aebee008c72ef62535ac5e5e65dfe0b97f94e', htmlFor: "verdocs-otp-input" }, "Code:"), h("input", { key: '6ed7fe7c1e66677ef92c0936637ecc06a3879e59', type: "text", id: "verdocs-otp-input", name: "verdocs-otp-input", placeholder: "Enter your one-time code...", value: this.response, onInput: (e) => (this.response = e.target.value) })), h("div", { key: '871250aca108c8919a432221617fe728d098c959', class: "buttons" }, h("verdocs-button", { key: '6edd049a733f3390b8be205879490d51ae11d7a2', label: "Cancel", variant: "outline", onClick: () => this.handleCancel() }), h("verdocs-button", { key: '9116fc071bcc811ce124a865a2ca2bb4a5a68182', label: 'Resend', onClick: () => this.handleResend(), disabled: this.resendDisabled }), h("verdocs-button", { key: 'd5558aabd6fb7501fb2b6d33853ed95a7c7c09c0', label: 'Submit', onClick: () => this.handleSubmit(), disabled: !this.response }))))));
|
87
|
+
}
|
88
|
+
static get style() { return VerdocsOtpDialogStyle0; }
|
89
|
+
}, [0, "verdocs-otp-dialog", {
|
90
|
+
"method": [1],
|
91
|
+
"recipient": [16],
|
92
|
+
"resendDisabled": [32],
|
93
|
+
"response": [32]
|
94
|
+
}]);
|
95
|
+
function defineCustomElement() {
|
96
|
+
if (typeof customElements === "undefined") {
|
97
|
+
return;
|
98
|
+
}
|
99
|
+
const components = ["verdocs-otp-dialog", "verdocs-button"];
|
100
|
+
components.forEach(tagName => { switch (tagName) {
|
101
|
+
case "verdocs-otp-dialog":
|
102
|
+
if (!customElements.get(tagName)) {
|
103
|
+
customElements.define(tagName, VerdocsOtpDialog);
|
104
|
+
}
|
105
|
+
break;
|
106
|
+
case "verdocs-button":
|
107
|
+
if (!customElements.get(tagName)) {
|
108
|
+
defineCustomElement$1();
|
109
|
+
}
|
110
|
+
break;
|
111
|
+
} });
|
112
|
+
}
|
113
|
+
|
114
|
+
export { VerdocsOtpDialog as V, defineCustomElement as d };
|
115
|
+
|
116
|
+
//# sourceMappingURL=p-b663b885.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"p-b663b885.js","mappings":";;;;AAAA,MAAM,mBAAmB,GAAG,sgHAAsgH,CAAC;AACniH,+BAAe,mBAAmB;;ACElC,MAAM,YA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-dialog","src/components/dialogs/verdocs-otp-dialog/verdocs-otp-dialog.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-otp-dialog {\n font-family: $primary-font;\n box-sizing: border-box;\n\n div {\n box-sizing: border-box;\n }\n\n .background-overlay {\n position: fixed;\n z-index: 10000;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #0000007f;\n }\n\n .dialog {\n width: 440px;\n display: flex;\n flex-direction: column;\n border-radius: 4px;\n overflow: hidden;\n background: #fff;\n padding: 16px;\n gap: 10px;\n box-shadow: 3px 3px 5px 1px rgba(40, 40, 40, 0.4);\n }\n\n .heading {\n display: flex;\n flex-direction: row;\n font-size: 20px;\n font-weight: 500;\n }\n\n .step {\n margin-left: 6px;\n color: #666;\n }\n\n .help-box {\n background-color: $border-color;\n display: flex;\n flex-direction: row;\n padding: 14px;\n align-items: center;\n color: white;\n }\n\n .help-details {\n display: flex;\n flex-direction: column;\n margin-left: 15px;\n font-size: 14px;\n }\n\n .help-icon {\n width: 40px;\n height: 40px;\n }\n\n .help-title {\n font-weight: 600;\n margin-bottom: 4px;\n }\n\n .help-text {\n font-weight: 400;\n }\n\n .input {\n display: flex;\n flex-direction: row;\n gap: 10px;\n align-items: center;\n margin: 16px 0 32px;\n\n label {\n flex: 0;\n line-height: 10px;\n font-weight: 500;\n white-space: nowrap;\n }\n\n input {\n flex: 1;\n padding: 5px 8px;\n border-radius: 3px;\n border: 1px solid #cccccc;\n }\n }\n\n .field {\n gap: 10px;\n margin: 0;\n display: flex;\n align-items: center;\n flex-direction: row;\n max-width: 100%;\n\n .required {\n color: red;\n position: relative;\n top: -0.5em;\n font-size: 80%;\n }\n\n label {\n flex: 0 0 120px;\n font-weight: 500;\n line-height: 10px;\n text-align: right;\n white-space: nowrap;\n }\n\n verdocs-date-input {\n width: 40%;\n flex-grow: 1;\n\n input {\n width: 100%;\n box-sizing: border-box;\n }\n }\n\n input {\n width: 40%;\n flex-grow: 1;\n padding: 5px 8px;\n border-radius: 3px;\n border: 1px solid #cccccc;\n }\n }\n\n .choices {\n display: grid;\n gap: 15px;\n grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));\n margin: 0 0 15px 0;\n }\n\n .choice {\n border: 1px solid $border-color;\n border-radius: 5px;\n display: flex;\n height: 60px;\n font-size: 14px;\n padding: 0 5px;\n justify-content: center;\n align-items: center;\n text-align: center;\n color: $choice-available-color;\n cursor: pointer;\n\n &.selected {\n background-color: $border-color;\n color: $verdocs-grey-4;\n }\n }\n\n .buttons {\n display: flex;\n align-items: center;\n flex-direction: row;\n justify-content: flex-end;\n\n verdocs-button {\n margin-left: 16px;\n }\n }\n}\n","import {IRecipient, ISignerTokenResponse, VerdocsEndpoint, verifySigner} from '@verdocs/js-sdk';\nimport {Component, Prop, h, Event, EventEmitter, Host, State} from '@stencil/core';\n\nconst QuestionIcon = `<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M20 0C8.95313 0 0 8.95313 0 20C0 31.0469 8.95313 40 20 40C31.0469 40 40 31.0469 40 20C40 8.95313 31.0469 0 20 0ZM20 36.25C11.0391 36.25 3.75 28.9602 3.75 20C3.75 11.0398 11.0391 3.75 20 3.75C28.9609 3.75 36.25 11.0398 36.25 20C36.25 28.9602 28.9609 36.25 20 36.25Z\" fill=\"white\"/><path d=\"M20 26.25C18.5938 26.25 17.5 27.3438 17.5 28.75C17.5 30.1562 18.5234 31.25 20 31.25C21.3359 31.25 22.5 30.1562 22.5 28.75C22.5 27.3438 21.3359 26.25 20 26.25ZM22.5859 10H18.5938C15.5469 10 13.125 12.4219 13.125 15.4688C13.125 16.4844 13.9844 17.3438 15 17.3438C16.0156 17.3438 16.875 16.4844 16.875 15.4688C16.875 14.5312 17.5859 13.75 18.5234 13.75H22.5156C23.5234 13.75 24.375 14.5312 24.375 15.4688C24.375 16.0938 24.0625 16.5703 23.5156 16.8828L19.0625 19.6094C18.4375 20 18.125 20.625 18.125 21.25V22.5C18.125 23.5156 18.9844 24.375 20 24.375C21.0156 24.375 21.875 23.5156 21.875 22.5V22.3438L25.3984 20.1562C27.0391 19.1406 28.0547 17.3438 28.0547 15.4688C28.125 12.4219 25.7031 10 22.5859 10Z\" fill=\"#E7E7E7\"/></svg>`;\n\n/**\n * Prompt the user to confirm their identity with a one time code via email/SMS.\n */\n@Component({\n tag: 'verdocs-otp-dialog',\n styleUrl: 'verdocs-otp-dialog.scss',\n})\nexport class VerdocsOtpDialog {\n private resendTimeout: any = null;\n\n /**\n * The type of dialog to display. Three modes are supported.\n */\n @Prop() method: 'email' | 'sms' = 'email';\n\n /**\n * For identity confirmation, the current recipient details.\n */\n @Prop() recipient: IRecipient | null = null;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired when the process has completed successfully.\n */\n @Event({composed: true}) next: EventEmitter<{response: ISignerTokenResponse}>;\n\n @State() resendDisabled = true;\n @State() response = '';\n\n componentWillLoad() {\n this.startResendTimeout();\n verifySigner(VerdocsEndpoint.getDefault(), {auth_method: this.method, code: '', resend: true})\n .then(r => {\n console.log('Resend result', r);\n this.response = '';\n })\n .catch(e => console.log('Error resending code', e));\n }\n\n disconnectedCallback() {\n if (this.resendTimeout) {\n clearTimeout(this.resendTimeout);\n this.resendTimeout = null;\n }\n }\n\n handleCancel() {\n this.exit.emit();\n }\n\n // We need a separate event handler for clicking the background because it can receive events \"through\" other child components\n handleDismiss(e: any) {\n if (e.target.class === 'background-overlay') {\n e.preventDefault();\n this.handleCancel();\n }\n }\n\n startResendTimeout() {\n this.resendDisabled = true;\n\n if (this.resendTimeout) {\n clearTimeout(this.resendTimeout);\n }\n\n this.resendTimeout = setTimeout(() => {\n this.resendDisabled = false;\n }, 30000);\n }\n\n handleResend() {\n this.startResendTimeout();\n verifySigner(VerdocsEndpoint.getDefault(), {auth_method: this.method, code: '', resend: true})\n .then(r => {\n console.log('Resend result', r);\n this.response = '';\n window.alert('A new code has been sent.');\n })\n .catch(e => console.log('Error resending code', e));\n }\n\n handleSubmit() {\n this.startResendTimeout();\n verifySigner(VerdocsEndpoint.getDefault(), {auth_method: this.method, code: this.response})\n .then(response => {\n console.log('Verification completed', response);\n this.next.emit({response});\n window.alert('A new code has been sent.');\n })\n .catch(e => {\n window.alert('Invalid verification code. Please try again.');\n console.log('Invalid code', e);\n });\n\n this.response = '';\n }\n\n render() {\n return (\n <Host>\n <div class=\"background-overlay\" onClick={e => this.handleDismiss(e)}>\n <div class=\"dialog\">\n <div class=\"heading\">Verification Required</div>\n\n <div class=\"help-box\">\n <div class=\"help-icon\" innerHTML={QuestionIcon} />\n <div class=\"help-details\">\n <div class=\"help-title\">Please verify your email address</div>\n <div class=\"help-text\">Check your email for a one-time code, and enter it below.</div>\n </div>\n </div>\n\n <div class=\"input\">\n <label htmlFor=\"verdocs-otp-input\">Code:</label>\n <input\n type=\"text\"\n id=\"verdocs-otp-input\"\n name=\"verdocs-otp-input\"\n placeholder=\"Enter your one-time code...\"\n value={this.response}\n onInput={(e: any) => (this.response = e.target.value)}\n />\n </div>\n\n <div class=\"buttons\">\n <verdocs-button label=\"Cancel\" variant=\"outline\" onClick={() => this.handleCancel()} />\n <verdocs-button label={'Resend'} onClick={() => this.handleResend()} disabled={this.resendDisabled} />\n <verdocs-button label={'Submit'} onClick={() => this.handleSubmit()} disabled={!this.response} />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -5,13 +5,13 @@ import { S as Store } from './p-33300e3a.js';
|
|
5
5
|
import { d as defineCustomElement$n } from './p-77b37d23.js';
|
6
6
|
import { d as defineCustomElement$m } from './p-4f96a7dc.js';
|
7
7
|
import { d as defineCustomElement$l } from './p-82c79267.js';
|
8
|
-
import { d as defineCustomElement$k } from './p-
|
8
|
+
import { d as defineCustomElement$k } from './p-25c19f32.js';
|
9
9
|
import { d as defineCustomElement$j } from './p-62c5c0fe.js';
|
10
10
|
import { d as defineCustomElement$i } from './p-f1ccb5e1.js';
|
11
11
|
import { d as defineCustomElement$h } from './p-44712551.js';
|
12
12
|
import { d as defineCustomElement$g } from './p-843f0198.js';
|
13
13
|
import { d as defineCustomElement$f } from './p-d666322a.js';
|
14
|
-
import { d as defineCustomElement$e } from './p-
|
14
|
+
import { d as defineCustomElement$e } from './p-e46946db.js';
|
15
15
|
import { d as defineCustomElement$d } from './p-1c3c3f01.js';
|
16
16
|
import { d as defineCustomElement$c } from './p-207fff69.js';
|
17
17
|
import { d as defineCustomElement$b } from './p-07214348.js';
|
@@ -21,10 +21,10 @@ import { d as defineCustomElement$8 } from './p-cd8c3571.js';
|
|
21
21
|
import { d as defineCustomElement$7 } from './p-4b831194.js';
|
22
22
|
import { d as defineCustomElement$6 } from './p-062e67e6.js';
|
23
23
|
import { d as defineCustomElement$5 } from './p-53900f81.js';
|
24
|
-
import { d as defineCustomElement$4 } from './p-
|
24
|
+
import { d as defineCustomElement$4 } from './p-c04daa8c.js';
|
25
25
|
import { d as defineCustomElement$3 } from './p-e8f6e5b7.js';
|
26
26
|
import { d as defineCustomElement$2 } from './p-200b75fc.js';
|
27
|
-
import { d as defineCustomElement$1 } from './p-
|
27
|
+
import { d as defineCustomElement$1 } from './p-1dccb8a9.js';
|
28
28
|
|
29
29
|
const verdocsTemplateDocumentPageCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}";
|
30
30
|
const VerdocsTemplateDocumentPageStyle0 = verdocsTemplateDocumentPageCss;
|
@@ -383,4 +383,4 @@ function defineCustomElement() {
|
|
383
383
|
|
384
384
|
export { VerdocsTemplateDocumentPage as V, defineCustomElement as d };
|
385
385
|
|
386
|
-
//# sourceMappingURL=p-
|
386
|
+
//# sourceMappingURL=p-bcdf821c.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"p-ffa430d4.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,g3BAAg3B,CAAC;AACx5B,0CAAe,8BAA8B;;MCkBhC,2BAA2B;IALxC;;;;QAMU,uBAAkB,GAAG,IAAI,CAAC;;;;QAQ1B,aAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE,CAAC;;;;QAKzD,aAAQ,GAAG,KAAK,CAAC;;;;QAKjB,aAAQ,GAAG,KAAK,CAAC;;;;QAKjB,SAAI,GAAG,KAAK,CAAC;;;;QAKb,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,eAAU,GAAW,CAAC,CAAC;;;;;QAMvB,iBAAY,GAAW,GAAG,CAAC;;;;;QAMZ,kBAAa,GAAW,GAAG,CAAC;;;;;;;;;;;;;QAc3C,WAAM,GAAiB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC;QAOvD,gBAAW,GAAG,yBAAyB,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CA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;;;;","names":[],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-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 width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\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-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (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({mutable: true}) 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 @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 @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(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 }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\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 const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\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 aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"p-bcdf821c.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,8BAA8B,GAAG,g3BAAg3B,CAAC;AACx5B,0CAAe,8BAA8B;;MCkBhC,2BAA2B;IALxC;;;;QAMU,uBAAkB,GAAG,IAAI,CAAC;;;;QAQ1B,aAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE,CAAC;;;;QAKzD,aAAQ,GAAG,KAAK,CAAC;;;;QAKjB,aAAQ,GAAG,KAAK,CAAC;;;;QAKjB,SAAI,GAAG,KAAK,CAAC;;;;QAKb,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,eAAU,GAAW,CAAC,CAAC;;;;;QAMvB,iBAAY,GAAW,GAAG,CAAC;;;;;QAMZ,kBAAa,GAAW,GAAG,CAAC;;;;;;;;;;;;;QAc3C,WAAM,GAAiB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC,CAAC;QAOvD,gBAAW,GAAG,yBAAyB,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;QACrF,kBAAa,GAAW,IAAI,CAAC,YAAY,CAAC;QAC1C,mBAAc,GAAW,IAAI,CAAC,aAAa,CAAC;QAC5C,iBAAY,GAAW,IAAI,CAAC,YAAY,CAAC;QACzC,kBA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,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,GAC9C,EACF;wBACJ;4BACE,OAAO,EAAC,QAAQ,QAAE,IAAI,CAAY,CAAC;qBACtC;iBACF,CAAC,CACF,IACJ,IAAI,CAAC,cAAc,IACrB,WACE,KAAK,EAAC,0CAA0C,EAChD,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,EAAE,EACvC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,GAAG,EAAE,QAAQ,IAAI,CAAC,UAAU,EAAE,iBACjB,IAAI,EACjB,OAAO,EAAC,MAAM,EACd,MAAM,EAAE,CAAC,CAAM;;;;;;;;oBAQb,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;oBAC1C,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;oBAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;oBAC1D,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;oBAC1D,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;iBAC/D,GACD,KAEF,cAAW,CACZ,CAAA;SAAA,CACF,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-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 width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\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-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop() templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (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({mutable: true}) 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 @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 @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(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 }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\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 const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\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 aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -223,7 +223,7 @@ const VerdocsSignatureDialog = /*@__PURE__*/ proxyCustomElement(class VerdocsSig
|
|
223
223
|
}
|
224
224
|
*/
|
225
225
|
render() {
|
226
|
-
return (h(Host, { key: '
|
226
|
+
return (h(Host, { key: 'dea4d21238c781bda1f5fdaec35b51e798a8f073', onClick: e => this.handleCancel(e) }, h("div", { key: '2cc79e7a89ce233347bd2cfc46441106a2d02728', class: "dialog" }, h("div", { key: '983646ce131571a60e89d9e5f96479c8473ee888', class: "heading" }, "Create Your Signature"), h("div", { key: '7909c75a451b6778ea69d637949e29b83e3e3b12', class: "content" }, h("verdocs-text-input", { key: 'fd2b5b6a259aab0636bcda106175d225712a05e8', placeholder: "Full Name...", label: "Full Name", value: this.enteredName, onInput: e => this.handleNameChange(e), onClick: e => e.stopPropagation() }), h("div", { key: '7c3795b469571dd019e9a8a79c7110b647795147', class: "as-shown" }, "As shown on driver's license or govt. ID card."), this.fontLoaded ? h("canvas", { ref: el => (this.canvasElement = el) }) : h("div", { style: { display: 'none' } }), h("div", { key: 'ddc7ccd402ba1023e7ffbc5c1a94208149563d32', class: "disclaimer" }, "By clicking Adopt, I agree that the signature will be the electronic representation of my signature for all purposes when I (or my agent) use them on documents, including legally binding contracts \u2014 just the same as a pen-and-paper signature or initial."), h("div", { key: '74dc260aee414296796d156f3dea10919eca6da3', class: "buttons" }, h("verdocs-button", { key: '24747ae1cc4d47a640fc509c9b3c66e06fff0eb8', label: "CANCEL", size: "normal", variant: "outline", onClick: e => this.handleCancel(e) }), h("verdocs-button", { key: 'b845f87b51e1998d69ce579693b871536b316230', label: "Adopt & Sign", size: "normal", onClick: e => this.handleAdopt(e) }))))));
|
227
227
|
}
|
228
228
|
static get style() { return VerdocsSignatureDialogStyle0; }
|
229
229
|
}, [0, "verdocs-signature-dialog", {
|
@@ -263,4 +263,4 @@ function defineCustomElement() {
|
|
263
263
|
|
264
264
|
export { VerdocsSignatureDialog as V, defineCustomElement as d };
|
265
265
|
|
266
|
-
//# sourceMappingURL=p-
|
266
|
+
//# sourceMappingURL=p-c04daa8c.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"p-8203a6af.js","mappings":";;;;;AAAA,MAAM,yBAAyB,GAAG,0oEAA0oE,CAAC;AAC7qE,qCAAe,yBAAyB;;MCS3B,sBAAsB;IAJnC;;;;;;;;QAUU,SAAI,GAAW,EAAE,CAAC;QAajB,eAAU,GAAG,KAAK,CAAC;QAEnB,gBAAW,GAAW,EAAE,CAAC;QAEzB,SAAI,GAAW,MAAM,CAAC;KA4PhC;IA1PC,iBAAiB;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC;QAE7B,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,gBAAgB,EAAE,kHAAkH,CAAC,CAAC;QAC9J,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI;YACjB,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACzB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SACxB,CAAC,CAAC;KACJ;IAED,gBAAgB;QACd,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;IAED,kBAAkB;QAChB,IAAI,CAAC,eAAe,EAAE,CAAC;KACxB;IAED,eAAe;QACb,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,OAAO;SACR;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;QAE7C,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACpD,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgKD,MAAM;QACJ,QACE,EAAC,IAAI,qDAAC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IACtC,4DAAK,KAAK,EAAC,QAAQ,IACjB,4DAAK,KAAK,EAAC,SAAS,4BAA4B,EAEhD,4DAAK,KAAK,EAAC,SAAS,IAClB,2EAAoB,WAAW,EAAC,cAAc,EAAC,KAAK,EAAC,WAAW,EAAC,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,GAAI,EACvK,4DAAK,KAAK,EAAC,UAAU,qDAAqD,EAWzE,IAAI,CAAC,UAAU,GAAG,cAAQ,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,aAAa,GAAG,EAAuB,CAAC,GAAI,GAAG,WAAK,KAAK,EAAE,EAAC,OAAO,EAAE,MAAM,EAAC,GAAI,EAE5H,4DAAK,KAAK,EAAC,YAAY,yQAGjB,EAEN,4DAAK,KAAK,EAAC,SAAS,IAClB,uEAAgB,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAI,EACrG,uEAAgB,KAAK,EAAC,cAAc,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAI,CACpF,CACF,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.scss?tag=verdocs-signature-dialog","src/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-signature-dialog {\n font-family: $primary-font;\n box-sizing: border-box;\n position: fixed;\n z-index: 10000;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #0000007f;\n\n .dialog {\n width: 100%;\n max-width: 340px;\n border-radius: 4px;\n overflow: hidden;\n box-shadow: 3px 3px 5px 1px rgba(40, 40, 40, 0.4);\n background: $dialog-bg;\n }\n\n .heading {\n display: flex;\n flex-direction: row;\n padding: 20px 20px 0 20px;\n line-height: 28px;\n font-size: 20px;\n font-weight: 500;\n }\n\n .content {\n font-size: 14px;\n padding: 20px;\n }\n\n .buttons {\n display: flex;\n margin: 20px 0 0 0;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n\n verdocs-button {\n margin-left: 16px;\n }\n }\n\n canvas {\n background: $verdocs-grey-4;\n box-sizing: border-box;\n margin: 0 auto;\n width: 300px;\n // TODO: The original app had an aspect ratio of (80 / 305) * (signatureBodyWidth - 20)\n height: 79px;\n max-width: 100%;\n box-shadow: 0 0 6px 0 #0000001f;\n }\n\n .disclaimer {\n text-align: justify;\n padding: 8px 0;\n font-size: 11px;\n line-height: 14px;\n color: rgba(0, 0, 0, 0.54);\n }\n\n .as-shown {\n font-size: 11px;\n margin: 4px 0 20px 4px;\n color: rgba(0, 0, 0, 0.54);\n }\n\n .tabs {\n display: flex;\n flex-direction: row;\n\n .tab {\n padding: 8px 15px;\n cursor: pointer;\n\n &.active {\n border-bottom: 2px solid $light-border-color;\n }\n\n &:hover {\n color: $primary-color;\n }\n }\n }\n}\n","import {Component, Prop, h, Event, EventEmitter, State, Host} from '@stencil/core';\n\n/**\n * Display a dialog that allows the user to specify a signature image, either by using a signature-font-generated image\n * based on their full name, or by hand-drawing their signature with a mouse or tablet.\n */\n@Component({\n tag: 'verdocs-signature-dialog',\n styleUrl: 'verdocs-signature-dialog.scss',\n})\nexport class VerdocsSignatureDialog {\n private canvasElement?: HTMLCanvasElement;\n\n /**\n * Initial signature text\n */\n @Prop() name: string = '';\n\n /**\n * Fired when the user completes the dialog and clicks Adopt. The event detail will contain a base64-encoded string\n * representation of the signature adopted.\n */\n @Event({composed: true}) next: EventEmitter<string>;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n @State() fontLoaded = false;\n\n @State() enteredName: string = '';\n\n @State() mode: string = 'type';\n\n componentWillLoad() {\n this.enteredName = this.name;\n\n const ds = new FontFace('Dancing Script', 'url(https://fonts.gstatic.com/s/dancingscript/v19/If2cXTr6YS-zF4S-kcSWSVi_sxjsohD9F50Ruu7BMSo3Sup6hNX6plRP.woff)');\n ds.load().then(font => {\n document.fonts.add(font);\n this.fontLoaded = true;\n });\n }\n\n componentDidLoad() {\n this.redrawSignature();\n }\n\n componentDidUpdate() {\n this.redrawSignature();\n }\n\n redrawSignature() {\n if (!this.canvasElement) {\n return;\n }\n\n const canvasWidth = this.canvasElement.width;\n\n const context = this.canvasElement.getContext('2d');\n context.clearRect(0, 0, this.canvasElement.width, this.canvasElement.height);\n\n let fontSize = 100;\n do {\n fontSize -= 2;\n context.font = `${fontSize}px Dancing Script`;\n } while (context.measureText(this.enteredName).width > canvasWidth - 32); // 32px padding each side\n\n context.textAlign = 'center';\n context.textBaseline = 'middle';\n context.font = `${fontSize}px Dancing Script`;\n context.fillText(this.enteredName, this.canvasElement.width / 2, this.canvasElement.height / 2);\n }\n\n handleNameChange(e: any) {\n this.enteredName = e.target.value;\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n e.preventDefault();\n this.exit.emit();\n }\n\n handleAdopt(e: any) {\n e.stopPropagation();\n e.preventDefault();\n const data = this.canvasElement.toDataURL('image/png');\n this.next.emit(data);\n }\n\n /*\n selColor(hex: string) {\n this.color = hex;\n this.animateDraw();\n }\n\n stopDraw() {\n this.paint = false;\n this.adoptedAndSigned = !this.hasSignature();\n }\n\n draw(e) {\n this.paint = true;\n this.addPoints(e, false);\n this.animateDraw();\n }\n\n recordPoints(e) {\n if (this.paint) {\n this.addPoints(e, true);\n this.animateDraw();\n }\n }\n\n animateDraw() {\n this.canvas.clearRect(0, 0, this.canvas.canvas.offsetWidth, this.canvas.canvas.offsetHeight);\n\n this.canvas.strokeStyle = this.color || '#000000';\n this.canvas.lineJoin = 'round';\n this.canvas.lineWidth = 3;\n\n for (let i = 0; i < this.points.length; i++) {\n this.canvas.beginPath();\n if (this.points[i].drag && i) {\n this.canvas.moveTo(this.points[i - 1].x, this.points[i - 1].y);\n // this.canvas.arc(this.points[i - 1].x, this.points[i - 1].y, 2, 0, 2 * Math.PI, false);\n } else {\n this.canvas.moveTo(this.points[i].x - 1, this.points[i].y);\n // this.canvas.arc(this.points[i].x, this.points[i].y, 2, 0, 2 * Math.PI, false);\n }\n\n this.canvas.lineTo(this.points[i].x, this.points[i].y);\n this.canvas.closePath();\n this.canvas.stroke();\n }\n }\n\n drawCurve(color: string, curve: number) {\n this.canvas.beginPath();\n }\n\n\n\n addPoints(e, drag: boolean) {\n if (window) {\n let x;\n let y;\n e.preventDefault();\n if (e.touches && e.touches.length > 0) {\n x = e.touches[0].clientX;\n } else {\n x = e.clientX;\n }\n\n if (e.touches && e.touches.length > 0) {\n y = e.touches[0].clientY;\n } else {\n y = e.clientY;\n }\n const rect = this.signatureCanvas.nativeElement.getBoundingClientRect();\n this.points.push({\n x: x - rect.left,\n y: y - rect.top,\n drag: drag\n });\n }\n }\n\n clearPad() {\n this.canvas.clearRect(0, 0, this.canvas.canvas.offsetWidth, this.canvas.canvas.offsetHeight);\n this.points = [];\n this.adoptedAndSigned = !this.hasSignature();\n }\n\n async adoptAndSign() {\n try {\n this.adoptedAndSigned = true;\n await this.updateFullName();\n await this.captureSignatureFromCanvas();\n const message = this.signatureMode === 'Signature' ? 'Saving Signature' : 'Saving Initial';\n this.snackbarService.open(message, 'OK', this.snackbarService.initConfig(null, 'bottom'));\n this.handleMode();\n } catch (err) {\n this.snackbarService.open('Failed to apply signature', 'OK', this.snackbarService.initConfig(null, 'bottom'));\n }\n }\n\n handleMode() {\n let currentField;\n switch (this.mode) {\n case 'signerview':\n if (this.signatureMode === 'Signature') {\n this.signatureService.postSignatureBlob().then(result => {\n if (result && result.id && result.url) {\n currentField = this.signatureService.currField;\n this.signatureService.updateSigned(currentField.fName, true);\n this.signatureService.toggleSig(false);\n this.signatureService.setSignatureId(result.id);\n this.signatureService.putSignatureField(this.envelopeId, this.fieldName, result.id).then(res => {\n this.eventTracker.createEvent({\n category: 'verdoc',\n action: 'verdoc signed',\n label: `verdoc id: ${this.envelopeId}`\n })\n if (res && res.settings) {\n this.signatureService.setSignatureData(res.settings.base64);\n this.signatureService.setSignatureId(res.settings.signature_id);\n }\n this.snackbarService.dismiss();\n this.dialog.close({ status: 'saved', temp_sig: res.settings.base64, sig_id: res.settings.signature_id });\n }).catch(err => {\n this.snackbarService.open('Failed to save signature. Please try again.', 'DISMISS', {\n duration: 3000\n });\n this.adoptedAndSigned = false;\n return err;\n });\n }\n });\n } else {\n this.signatureService.postInitialBlob().then(result => {\n if (result && result.id && result.url) {\n currentField = this.signatureService.currField;\n this.signatureService.updateInitialed(currentField.fName, true);\n this.signatureService.setInitialId(result.id);\n this.signatureService.toggleSig(false);\n this.signatureService.putInitialField(this.envelopeId, this.fieldName, result.id).then(res => {\n if (res && res.settings) {\n this.signatureService.setInitialData(res.settings.base64);\n this.signatureService.setInitialId(res.settings.initial_id);\n }\n this.snackbarService.dismiss();\n this.dialog.close({ status: 'saved', temp_int: res.settings.base64, int_id: res.settings.initial_id });\n }).catch(err => {\n this.snackbarService.open('Failed to save initial. Please try again.', 'DISMISS', {\n duration: 3000\n });\n this.adoptedAndSigned = false;\n return err;\n });\n }\n });\n }\n break;\n }\n }\n */\n\n render() {\n return (\n <Host onClick={e => this.handleCancel(e)}>\n <div class=\"dialog\">\n <div class=\"heading\">Create Your Signature</div>\n\n <div class=\"content\">\n <verdocs-text-input placeholder=\"Full Name...\" label=\"Full Name\" value={this.enteredName} onInput={e => this.handleNameChange(e)} onClick={e => e.stopPropagation()} />\n <div class=\"as-shown\">As shown on driver's license or govt. ID card.</div>\n\n {/*<div class=\"tabs\">*/}\n {/* <div class={{tab: true, active: this.mode === 'type'}} onClick={() => (this.mode = 'type')}>*/}\n {/* Type*/}\n {/* </div>*/}\n {/*<div class={{tab: true, active: this.mode === 'draw'}} onClick={() => (this.mode = 'draw')}>*/}\n {/* Draw*/}\n {/*</div>*/}\n {/*</div>*/}\n\n {this.fontLoaded ? <canvas ref={el => (this.canvasElement = el as HTMLCanvasElement)} /> : <div style={{display: 'none'}} />}\n\n <div class=\"disclaimer\">\n By clicking Adopt, I agree that the signature will be the electronic representation of my signature for all purposes when I (or my agent) use them on documents,\n including legally binding contracts — just the same as a pen-and-paper signature or initial.\n </div>\n\n <div class=\"buttons\">\n <verdocs-button label=\"CANCEL\" size=\"normal\" variant=\"outline\" onClick={e => this.handleCancel(e)} />\n <verdocs-button label=\"Adopt & Sign\" size=\"normal\" onClick={e => this.handleAdopt(e)} />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"p-c04daa8c.js","mappings":";;;;;AAAA,MAAM,yBAAyB,GAAG,0oEAA0oE,CAAC;AAC7qE,qCAAe,yBAAyB;;MCS3B,sBAAsB;IAJnC;;;;;;;;QAUU,SAAI,GAAW,EAAE,CAAC;QAajB,eAAU,GAAG,KAAK,CAAC;QAEnB,gBAAW,GAAW,EAAE,CAAC;QAEzB,SAAI,GAAW,MAAM,CAAC;KA4PhC;IA1PC,iBAAiB;QACf,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC;QAE7B,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,gBAAgB,EAAE,kHAAkH,CAAC,CAAC;QAC9J,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI;YACjB,QAAQ,CAAC,KAAK,CAAC,GA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K,EAAC,SAAS,IAClB,uEAAgB,KAAK,EAAC,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,GAAI,EACrG,uEAAgB,KAAK,EAAC,cAAc,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAI,CACpF,CACF,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.scss?tag=verdocs-signature-dialog","src/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-signature-dialog {\n font-family: $primary-font;\n box-sizing: border-box;\n position: fixed;\n z-index: 10000;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #0000007f;\n\n .dialog {\n width: 100%;\n max-width: 340px;\n border-radius: 4px;\n overflow: hidden;\n box-shadow: 3px 3px 5px 1px rgba(40, 40, 40, 0.4);\n background: $dialog-bg;\n }\n\n .heading {\n display: flex;\n flex-direction: row;\n padding: 20px 20px 0 20px;\n line-height: 28px;\n font-size: 20px;\n font-weight: 500;\n }\n\n .content {\n font-size: 14px;\n padding: 20px;\n }\n\n .buttons {\n display: flex;\n margin: 20px 0 0 0;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n\n verdocs-button {\n margin-left: 16px;\n }\n }\n\n canvas {\n background: $verdocs-grey-4;\n box-sizing: border-box;\n margin: 0 auto;\n width: 300px;\n // TODO: The original app had an aspect ratio of (80 / 305) * (signatureBodyWidth - 20)\n height: 79px;\n max-width: 100%;\n box-shadow: 0 0 6px 0 #0000001f;\n }\n\n .disclaimer {\n text-align: justify;\n padding: 8px 0;\n font-size: 11px;\n line-height: 14px;\n color: rgba(0, 0, 0, 0.54);\n }\n\n .as-shown {\n font-size: 11px;\n margin: 4px 0 20px 4px;\n color: rgba(0, 0, 0, 0.54);\n }\n\n .tabs {\n display: flex;\n flex-direction: row;\n\n .tab {\n padding: 8px 15px;\n cursor: pointer;\n\n &.active {\n border-bottom: 2px solid $light-border-color;\n }\n\n &:hover {\n color: $primary-color;\n }\n }\n }\n}\n","import {Component, Prop, h, Event, EventEmitter, State, Host} from '@stencil/core';\n\n/**\n * Display a dialog that allows the user to specify a signature image, either by using a signature-font-generated image\n * based on their full name, or by hand-drawing their signature with a mouse or tablet.\n */\n@Component({\n tag: 'verdocs-signature-dialog',\n styleUrl: 'verdocs-signature-dialog.scss',\n})\nexport class VerdocsSignatureDialog {\n private canvasElement?: HTMLCanvasElement;\n\n /**\n * Initial signature text\n */\n @Prop() name: string = '';\n\n /**\n * Fired when the user completes the dialog and clicks Adopt. The event detail will contain a base64-encoded string\n * representation of the signature adopted.\n */\n @Event({composed: true}) next: EventEmitter<string>;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n @State() fontLoaded = false;\n\n @State() enteredName: string = '';\n\n @State() mode: string = 'type';\n\n componentWillLoad() {\n this.enteredName = this.name;\n\n const ds = new FontFace('Dancing Script', 'url(https://fonts.gstatic.com/s/dancingscript/v19/If2cXTr6YS-zF4S-kcSWSVi_sxjsohD9F50Ruu7BMSo3Sup6hNX6plRP.woff)');\n ds.load().then(font => {\n document.fonts.add(font);\n this.fontLoaded = true;\n });\n }\n\n componentDidLoad() {\n this.redrawSignature();\n }\n\n componentDidUpdate() {\n this.redrawSignature();\n }\n\n redrawSignature() {\n if (!this.canvasElement) {\n return;\n }\n\n const canvasWidth = this.canvasElement.width;\n\n const context = this.canvasElement.getContext('2d');\n context.clearRect(0, 0, this.canvasElement.width, this.canvasElement.height);\n\n let fontSize = 100;\n do {\n fontSize -= 2;\n context.font = `${fontSize}px Dancing Script`;\n } while (context.measureText(this.enteredName).width > canvasWidth - 32); // 32px padding each side\n\n context.textAlign = 'center';\n context.textBaseline = 'middle';\n context.font = `${fontSize}px Dancing Script`;\n context.fillText(this.enteredName, this.canvasElement.width / 2, this.canvasElement.height / 2);\n }\n\n handleNameChange(e: any) {\n this.enteredName = e.target.value;\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n e.preventDefault();\n this.exit.emit();\n }\n\n handleAdopt(e: any) {\n e.stopPropagation();\n e.preventDefault();\n const data = this.canvasElement.toDataURL('image/png');\n this.next.emit(data);\n }\n\n /*\n selColor(hex: string) {\n this.color = hex;\n this.animateDraw();\n }\n\n stopDraw() {\n this.paint = false;\n this.adoptedAndSigned = !this.hasSignature();\n }\n\n draw(e) {\n this.paint = true;\n this.addPoints(e, false);\n this.animateDraw();\n }\n\n recordPoints(e) {\n if (this.paint) {\n this.addPoints(e, true);\n this.animateDraw();\n }\n }\n\n animateDraw() {\n this.canvas.clearRect(0, 0, this.canvas.canvas.offsetWidth, this.canvas.canvas.offsetHeight);\n\n this.canvas.strokeStyle = this.color || '#000000';\n this.canvas.lineJoin = 'round';\n this.canvas.lineWidth = 3;\n\n for (let i = 0; i < this.points.length; i++) {\n this.canvas.beginPath();\n if (this.points[i].drag && i) {\n this.canvas.moveTo(this.points[i - 1].x, this.points[i - 1].y);\n // this.canvas.arc(this.points[i - 1].x, this.points[i - 1].y, 2, 0, 2 * Math.PI, false);\n } else {\n this.canvas.moveTo(this.points[i].x - 1, this.points[i].y);\n // this.canvas.arc(this.points[i].x, this.points[i].y, 2, 0, 2 * Math.PI, false);\n }\n\n this.canvas.lineTo(this.points[i].x, this.points[i].y);\n this.canvas.closePath();\n this.canvas.stroke();\n }\n }\n\n drawCurve(color: string, curve: number) {\n this.canvas.beginPath();\n }\n\n\n\n addPoints(e, drag: boolean) {\n if (window) {\n let x;\n let y;\n e.preventDefault();\n if (e.touches && e.touches.length > 0) {\n x = e.touches[0].clientX;\n } else {\n x = e.clientX;\n }\n\n if (e.touches && e.touches.length > 0) {\n y = e.touches[0].clientY;\n } else {\n y = e.clientY;\n }\n const rect = this.signatureCanvas.nativeElement.getBoundingClientRect();\n this.points.push({\n x: x - rect.left,\n y: y - rect.top,\n drag: drag\n });\n }\n }\n\n clearPad() {\n this.canvas.clearRect(0, 0, this.canvas.canvas.offsetWidth, this.canvas.canvas.offsetHeight);\n this.points = [];\n this.adoptedAndSigned = !this.hasSignature();\n }\n\n async adoptAndSign() {\n try {\n this.adoptedAndSigned = true;\n await this.updateFullName();\n await this.captureSignatureFromCanvas();\n const message = this.signatureMode === 'Signature' ? 'Saving Signature' : 'Saving Initial';\n this.snackbarService.open(message, 'OK', this.snackbarService.initConfig(null, 'bottom'));\n this.handleMode();\n } catch (err) {\n this.snackbarService.open('Failed to apply signature', 'OK', this.snackbarService.initConfig(null, 'bottom'));\n }\n }\n\n handleMode() {\n let currentField;\n switch (this.mode) {\n case 'signerview':\n if (this.signatureMode === 'Signature') {\n this.signatureService.postSignatureBlob().then(result => {\n if (result && result.id && result.url) {\n currentField = this.signatureService.currField;\n this.signatureService.updateSigned(currentField.fName, true);\n this.signatureService.toggleSig(false);\n this.signatureService.setSignatureId(result.id);\n this.signatureService.putSignatureField(this.envelopeId, this.fieldName, result.id).then(res => {\n this.eventTracker.createEvent({\n category: 'verdoc',\n action: 'verdoc signed',\n label: `verdoc id: ${this.envelopeId}`\n })\n if (res && res.settings) {\n this.signatureService.setSignatureData(res.settings.base64);\n this.signatureService.setSignatureId(res.settings.signature_id);\n }\n this.snackbarService.dismiss();\n this.dialog.close({ status: 'saved', temp_sig: res.settings.base64, sig_id: res.settings.signature_id });\n }).catch(err => {\n this.snackbarService.open('Failed to save signature. Please try again.', 'DISMISS', {\n duration: 3000\n });\n this.adoptedAndSigned = false;\n return err;\n });\n }\n });\n } else {\n this.signatureService.postInitialBlob().then(result => {\n if (result && result.id && result.url) {\n currentField = this.signatureService.currField;\n this.signatureService.updateInitialed(currentField.fName, true);\n this.signatureService.setInitialId(result.id);\n this.signatureService.toggleSig(false);\n this.signatureService.putInitialField(this.envelopeId, this.fieldName, result.id).then(res => {\n if (res && res.settings) {\n this.signatureService.setInitialData(res.settings.base64);\n this.signatureService.setInitialId(res.settings.initial_id);\n }\n this.snackbarService.dismiss();\n this.dialog.close({ status: 'saved', temp_int: res.settings.base64, int_id: res.settings.initial_id });\n }).catch(err => {\n this.snackbarService.open('Failed to save initial. Please try again.', 'DISMISS', {\n duration: 3000\n });\n this.adoptedAndSigned = false;\n return err;\n });\n }\n });\n }\n break;\n }\n }\n */\n\n render() {\n return (\n <Host onClick={e => this.handleCancel(e)}>\n <div class=\"dialog\">\n <div class=\"heading\">Create Your Signature</div>\n\n <div class=\"content\">\n <verdocs-text-input placeholder=\"Full Name...\" label=\"Full Name\" value={this.enteredName} onInput={e => this.handleNameChange(e)} onClick={e => e.stopPropagation()} />\n <div class=\"as-shown\">As shown on driver's license or govt. ID card.</div>\n\n {/*<div class=\"tabs\">*/}\n {/* <div class={{tab: true, active: this.mode === 'type'}} onClick={() => (this.mode = 'type')}>*/}\n {/* Type*/}\n {/* </div>*/}\n {/*<div class={{tab: true, active: this.mode === 'draw'}} onClick={() => (this.mode = 'draw')}>*/}\n {/* Draw*/}\n {/*</div>*/}\n {/*</div>*/}\n\n {this.fontLoaded ? <canvas ref={el => (this.canvasElement = el as HTMLCanvasElement)} /> : <div style={{display: 'none'}} />}\n\n <div class=\"disclaimer\">\n By clicking Adopt, I agree that the signature will be the electronic representation of my signature for all purposes when I (or my agent) use them on documents,\n including legally binding contracts — just the same as a pen-and-paper signature or initial.\n </div>\n\n <div class=\"buttons\">\n <verdocs-button label=\"CANCEL\" size=\"normal\" variant=\"outline\" onClick={e => this.handleCancel(e)} />\n <verdocs-button label=\"Adopt & Sign\" size=\"normal\" onClick={e => this.handleAdopt(e)} />\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -107,7 +107,7 @@ const VerdocsEnvelopeDocumentPage = /*@__PURE__*/ proxyCustomElement(class Verdo
|
|
107
107
|
}
|
108
108
|
render() {
|
109
109
|
const height = `${this.renderedHeight}px`;
|
110
|
-
return (h(Host, { key: '
|
110
|
+
return (h(Host, { key: '52fea0a651da570fe851a27db144ae889c4301ad', id: `${this.containerId}`, style: { height, flex: `0 0 ${height}` } }, this.layers.map(layer => layer.type === 'div' ? (h("div", { class: "verdocs-envelope-document-page-layer", id: `${this.containerId}-${layer.name}`, style: { height } })) : this.pageDisplayUri ? (h("img", { class: "verdocs-envelope-document-page-layer img", id: `${this.containerId}-${layer.name}`, src: this.pageDisplayUri, alt: `Page ${this.pageNumber}`, "aria-hidden": true, loading: "lazy", onLoad: (e) => {
|
111
111
|
// Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that
|
112
112
|
// useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).
|
113
113
|
// Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values
|
@@ -158,4 +158,4 @@ function defineCustomElement() {
|
|
158
158
|
|
159
159
|
export { VerdocsEnvelopeDocumentPage as V, defineCustomElement as d };
|
160
160
|
|
161
|
-
//# sourceMappingURL=p-
|
161
|
+
//# sourceMappingURL=p-d16c9dd7.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"file":"p-83430ada.js","mappings":";;;;AAAA,MAAM,8BAA8B,GAAG,+qBAA+qB,CAAC;AACvtB,0CAAe,8BAA8B;;MCgBhC,2BAA2B;IALxC;;;;;;;QAYU,aAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE,CAAC;;;;QAKzD,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,eAAU,GAAW,CAAC,CAAC;;;;;QAMvB,iBAAY,GAAW,GAAG,CAAC;;;;;QAMZ,kBAAa,GAAW,GAAG,CAAC;;;;;;;;;;;;;QAc3C,WAAM,GAAiB,CAAC,EAAC,IA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EAAC,0CAA0C,EAChD,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,EAAE,EACvC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,GAAG,EAAE,QAAQ,IAAI,CAAC,UAAU,EAAE,iBACjB,IAAI,EACjB,OAAO,EAAC,MAAM,EACd,MAAM,EAAE,CAAC,CAAM;;;;;;;;gBAQb,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;gBAC1C,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;gBAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;gBAC1D,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;gBAC1D,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;aAC/D,GACD,KAEF,cAAW,CACZ,CACF,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.scss?tag=verdocs-envelope-document-page","src/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-envelope-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-envelope-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 width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getEnvelopeDocumentPageDisplayUri, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {throttle} from '../../../utils/utils';\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-envelope-document-page',\n styleUrl: 'verdocs-envelope-document-page.scss',\n shadow: false,\n})\nexport class VerdocsEnvelopeDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the envelope the document is for.\n */\n @Prop() envelopeId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (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({mutable: true}) 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-envelope-document-page-ker2fr1p9\">\n * <div id=\"verdocs-envelope-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-envelope-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n @Prop() type: 'original' | 'filled' | 'certificate' = 'original';\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-envelope-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 @State() pageDisplayUri = 'https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png';\n\n async componentWillLoad() {\n this.pageDisplayUri = await getEnvelopeDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber, this.type);\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(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 }, 100),\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 documentId: this.documentId,\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 aspectRatio: this.aspectRatio,\n xScale: this.renderedWidth / this.virtualWidth,\n yScale: this.renderedHeight / this.virtualHeight,\n });\n }\n\n render() {\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-envelope-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-envelope-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
1
|
+
{"file":"p-d16c9dd7.js","mappings":";;;;AAAA,MAAM,8BAA8B,GAAG,+qBAA+qB,CAAC;AACvtB,0CAAe,8BAA8B;;MCgBhC,2BAA2B;IALxC;;;;;;;QAYU,aAAQ,GAAoB,eAAe,CAAC,UAAU,EAAE,CAAC;;;;QAKzD,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,eAAU,GAAW,EAAE,CAAC;;;;QAKxB,eAAU,GAAW,CAAC,CAAC;;;;;QAMvB,iBAAY,GAAW,GAAG,CAAC;;;;;QAMZ,kBAAa,GAAW,GAAG,CAAC;;;;;;;;;;;;;QAc3C,WAAM,GAAiB,CAAC,EAAC,IAAI,EAAE,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A0C,EAChD,EAAE,EAAE,GAAG,IAAI,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,EAAE,EACvC,GAAG,EAAE,IAAI,CAAC,cAAc,EACxB,GAAG,EAAE,QAAQ,IAAI,CAAC,UAAU,EAAE,iBACjB,IAAI,EACjB,OAAO,EAAC,MAAM,EACd,MAAM,EAAE,CAAC,CAAM;;;;;;;;gBAQb,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;gBAC1C,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;gBAC5C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC;gBAC1D,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;gBAC1D,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;aAC/D,GACD,KAEF,cAAW,CACZ,CACF,CACI,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.scss?tag=verdocs-envelope-document-page","src/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-envelope-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-envelope-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 width: 100%;\n }\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getEnvelopeDocumentPageDisplayUri, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {throttle} from '../../../utils/utils';\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-envelope-document-page',\n styleUrl: 'verdocs-envelope-document-page.scss',\n shadow: false,\n})\nexport class VerdocsEnvelopeDocumentPage {\n @Element() container: HTMLElement;\n private resizeObserver: ResizeObserver;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the envelope the document is for.\n */\n @Prop() envelopeId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop() documentId: string = '';\n\n /**\n * The page number being rendered. (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({mutable: true}) 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-envelope-document-page-ker2fr1p9\">\n * <div id=\"verdocs-envelope-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-envelope-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n @Prop() type: 'original' | 'filled' | 'certificate' = 'original';\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-envelope-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 @State() pageDisplayUri = 'https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png';\n\n async componentWillLoad() {\n this.pageDisplayUri = await getEnvelopeDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber, this.type);\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(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 }, 100),\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 documentId: this.documentId,\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 aspectRatio: this.aspectRatio,\n xScale: this.renderedWidth / this.virtualWidth,\n yScale: this.renderedHeight / this.virtualHeight,\n });\n }\n\n render() {\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-envelope-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}} />\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-envelope-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -5,7 +5,7 @@ import { S as SDKError } from './p-fd97809c.js';
|
|
5
5
|
import { S as Store } from './p-33300e3a.js';
|
6
6
|
import { d as defineCustomElement$6 } from './p-77b37d23.js';
|
7
7
|
import { d as defineCustomElement$5 } from './p-7b258587.js';
|
8
|
-
import { d as defineCustomElement$4 } from './p-
|
8
|
+
import { d as defineCustomElement$4 } from './p-d16c9dd7.js';
|
9
9
|
import { d as defineCustomElement$3 } from './p-cd8c3571.js';
|
10
10
|
import { d as defineCustomElement$2 } from './p-4b831194.js';
|
11
11
|
import { d as defineCustomElement$1 } from './p-062e67e6.js';
|
@@ -277,4 +277,4 @@ function defineCustomElement() {
|
|
277
277
|
|
278
278
|
export { VerdocsView as V, defineCustomElement as d };
|
279
279
|
|
280
|
-
//# sourceMappingURL=p-
|
280
|
+
//# sourceMappingURL=p-de58dbf5.js.map
|